/* Theme roles shared by public controls, partner marks and agent drawers. */
:root {
  --ui-choice-bg: #eaf7d2;
  --ui-choice-ink: #172510;
  --ui-choice-line: #657e31;
  --ui-mark-filter: brightness(0);
  --ui-mark-blend: normal;
}
:root[data-theme="dark"] {
  --ui-choice-bg: #283b23;
  --ui-choice-ink: #e4f9c8;
  --ui-choice-line: #a9d86d;
  --ui-mark-filter: brightness(0) invert(1);
  --ui-mark-blend: normal;
}
:where(button, input, select, textarea) { color-scheme: inherit; }
:where(.btn-secondary, .button-secondary, .btn-ghost, .filter-chip) {
  color: var(--text, #111813);
  background-color: var(--surface, #fff);
  border-color: var(--line-strong, #7a877d);
}
:where(.btn-secondary, .button-secondary, .btn-ghost, .filter-chip):hover {
  background-color: var(--bg-subtle, #eef2e9);
  color: var(--text, #111813);
}
:where(button, [role="button"], summary):focus-visible {
  outline: 2px solid var(--color-focus, var(--syn-sea, #2d7864));
  outline-offset: 3px;
}
/* Long labels may grow vertically; they never escape a chip or the page. */
body[data-story-layout] :is(.example-chip, .bk-chip, .pill, .badge, .tag) {
  box-sizing: border-box;
  min-inline-size: 0;
  max-inline-size: 100%;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

/* Labels retain their intrinsic width; the row wraps instead of squeezing them. */
.personal-page .personal-demo-agents {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  max-inline-size: 100%;
}
.personal-page .personal-demo-agents button {
  box-sizing: border-box;
  flex: 0 1 auto;
  flex-direction: row;
  min-inline-size: 0;
  max-inline-size: 100%;
  min-block-size: 44px;
  padding: .6rem .75rem;
  gap: .5rem;
  font-size: .875rem;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--text-secondary);
  background: var(--surface);
  border-color: var(--line-strong);
}
.personal-page .personal-demo-agents button[aria-pressed="true"],
.personal-page .personal-agent-picker button[aria-pressed="true"],
.personal-page .personal-topic.is-active {
  background: var(--ui-choice-bg);
  color: var(--ui-choice-ink);
  border-color: var(--ui-choice-line);
}
.personal-page .personal-topic-row { flex-wrap: wrap; }
.personal-page .personal-topic {
  max-inline-size: 100%;
  min-inline-size: 0;
  font-size: .875rem;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}
.personal-page .personal-delivery-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
}
.personal-page .personal-delivery-head > div { min-width: 0; }
.personal-page .personal-delivery-head div span {
  max-inline-size: none;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Transparent ink marks follow the selected theme, without an added white tile. */
body .personal-demo-agents img,
body .personal-agent-logo {
  box-sizing: border-box;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
  filter: var(--ui-mark-filter);
  mix-blend-mode: var(--ui-mark-blend);
}
body .personal-demo-agents img { inline-size: 24px; block-size: 24px; flex: 0 0 24px; }
body .personal-agent-logo { inline-size: 36px; block-size: 36px; }
body .personal-demo-agents img[src*="instinct.svg"],
body .personal-agent-logo[src*="instinct.svg"],
body .agent-showcase-logo img[src*="instinct.svg"] {
  content: url('/assets/agent-marks/instinct-mark.svg');
  padding: 0;
  border: 0;
  background: transparent;
  filter: var(--ui-mark-filter);
}
[data-theme="dark"] body .personal-demo-agents img[src*="instinct.svg"],
[data-theme="dark"] body .personal-agent-logo[src*="instinct.svg"],
[data-theme="dark"] body .agent-showcase-logo img[src*="instinct.svg"] {
  filter: var(--ui-mark-filter);
}


.agent-brandmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  inline-size: 24px;
  block-size: 24px;
  padding: 0;
  border: 0;
  background: transparent;
}
.agent-brandmark img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: contain;
  filter: var(--ui-mark-filter);
  mix-blend-mode: var(--ui-mark-blend);
}
/* Fo's white face is part of the source image. No mix-blend-mode in light mode: iPhone Safari skips it. brightness(.98) turns white into the page colour #fafafa. */
body img[src*="fo-avatar.webp"]:is(.personal-agent-logo, .personal-demo-agents img, .agent-brandmark img) {
  filter: grayscale(1) contrast(3) brightness(.98);
  mix-blend-mode: normal;
}
[data-theme="dark"] body img[src*="fo-avatar.webp"]:is(.personal-agent-logo, .personal-demo-agents img, .agent-brandmark img) {
  filter: grayscale(1) contrast(3) invert(1);
  mix-blend-mode: screen;
}

/* One accessible drawer stays open. The first tour follows its agent category. */
:is(#synorb-homepage-concept,#synorb-works) .sx-site .sx-agent-groups { display: block; margin-top: 1rem; }
:is(#synorb-homepage-concept,#synorb-works) .sx-site .sx-agent-group {
  min-inline-size: 0;
  border-top: 1px solid var(--sx-line);
}
:is(#synorb-homepage-concept,#synorb-works) .sx-site .sx-agent-group summary {
  pointer-events: auto;
  cursor: pointer;
  align-items: center;
  gap: 1rem;
  min-block-size: 48px;
  padding: 1rem 0;
  margin: 0;
  font-size: .875rem;
  line-height: 1.4;
  color: var(--sx-secondary);
}
:is(#synorb-homepage-concept,#synorb-works) .sx-site .sx-agent-group summary > span {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .75rem;
}
:is(#synorb-homepage-concept,#synorb-works) .sx-site .sx-agent-group[open] summary { color: var(--sx-ink); }
:is(#synorb-homepage-concept,#synorb-works) .sx-site .sx-agent-group:not([open]) .sx-wordmarks { display: none; }
:is(#synorb-homepage-concept,#synorb-works) .sx-site .sx-wordmarks {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: .5rem;
  padding-bottom: 1rem;
}
:is(#synorb-homepage-concept,#synorb-works) .sx-site .sx-wordmark {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: .5rem;
  min-inline-size: 0;
  max-inline-size: 100%;
  min-block-size: 44px;
  padding: .5rem .75rem;
  border: 1px solid var(--sx-line);
  border-radius: .5rem;
  background: var(--sx-panel);
  color: var(--sx-ink);
  font-size: .875rem;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  text-decoration: none;
}
:is(#synorb-homepage-concept,#synorb-works) .sx-site .sx-wordmark[aria-pressed="true"] {
  background: var(--ui-choice-bg);
  color: var(--ui-choice-ink);
  border-color: var(--ui-choice-line);
  text-decoration: none;
}
:is(#synorb-homepage-concept,#synorb-works) .sx-agent-label { min-width: 0; overflow-wrap: anywhere; }
:is(#synorb-homepage-concept,#synorb-works) .sx-site .sx-workflow-selector button {
  font-size: .875rem;
  line-height: 1.35;
  padding: .5rem .25rem;
  white-space: normal;
}
@media (prefers-reduced-motion: reduce) {
  :is(#synorb-homepage-concept,#synorb-works) .sx-agent-group { scroll-behavior: auto; }
}

/* Legacy personal-agent placements use the same transparent palm mark. */
body :is(.personal-demo-agents, .agent-showcase-logo) img[src*="poke.webp"],
body .personal-agent-logo[src*="poke.webp"] {
  content: url('/assets/agent-marks/poke-mark.svg');
  filter: var(--ui-mark-filter);
  mix-blend-mode: var(--ui-mark-blend);
}
/* Small audience labels need the text token, rather than the chart accent. */
body .sk2-who { color: var(--text-secondary); }

body[data-story-layout] .toggle-row button {
  color: var(--text-secondary);
  border-color: var(--line-strong);
}
body[data-story-layout] .toggle-row button.is-active {
  color: var(--ui-choice-ink);
  background: var(--ui-choice-bg);
  border-color: var(--ui-choice-line);
}

/* Menu descriptions wrap independently of the single-line primary nav row. */
#story-header .story-menu .story-menu-item {
  min-inline-size: 0;
  max-inline-size: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
:is(#synorb-homepage-concept,#synorb-works) .sx-cta-arrow {
  inline-size: 1em;
  block-size: 1em;
  flex: 0 0 auto;
}
