/* ═══════════════════════════════════════════════════════════════
   Sequifi API docs, on the North Star design system.

   Token values are the Figma "Sequifi North Star Design System" library
   (file 3jxZPHSzIfqu43l7rFsWA7), copied from sequipay-web's
   src/styles/tokens.css so the docs and the product read as one system:
   Hanken Grotesk for text, Google Sans Code for code and figures, Brand
   purple for primary actions, blue for links, the #141728 navigation rail,
   a Gray/200 ground under white cards. Light-only, like the product.
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:ital,wght@0,400;0,500;0,600;0,700;1,500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Google+Sans+Code:wght@400;500;600&display=swap');

:root {
  /* Primary/Brand */
  --brand-50:  #F3F5FF;
  --brand-100: #E4E9FA;
  --brand-200: #CDD6F6;
  --brand-300: #A4B3F2;
  --brand-400: #8A9EEF;
  --brand-500: #6078EC;
  --brand-600: #4E61D6;
  --brand-700: #3B4DB4;
  --brand-800: #253377;
  --brand-900: #1A286D;

  /* Primary/Gray */
  --neutral-0:   #FFFFFF;
  --neutral-50:  #F9F9F9;
  --neutral-100: #F5F5F5;
  --neutral-200: #EEEEEE;
  --neutral-300: #E0E0E0;
  --neutral-400: #BDBDBD;
  --neutral-500: #9E9E9E;
  --neutral-600: #757575;
  --neutral-700: #616161;
  --neutral-800: #424242;
  --neutral-900: #212121;

  --success-50:  #ECFDF3;
  --success-700: #027A48;
  --success-800: #05603A;
  --warning-50:  #FFFAEB;
  --warning-500: #F79009;
  --warning-800: #93370D;
  --orange-50:   #FFF6ED;
  --orange-800:  #9C2A10;
  --blue-50:  #E8F0FD;
  --blue-500: #1867E7;
  --blue-800: #0A295C;
  --red-50:  #FEF3F2;
  --red-600: #D92D20;
  --red-700: #B42318;
  --red-800: #912018;
  --teal-50:  #EFFAFA;
  --teal-600: #085E5A;

  /* Semantic */
  --ink:       #000000;
  --ink-soft:  var(--neutral-900);
  --muted:     var(--neutral-700);
  --faint:     var(--neutral-500);
  --link:      var(--blue-500);
  --ground:    var(--neutral-200);
  --surface:   var(--neutral-0);
  --surface-sunk: var(--neutral-100);
  --rule:      var(--neutral-200);
  --rule-strong: var(--neutral-300);
  --brand:     var(--brand-600);

  --rail:       #141728;
  --rail-ink:   #F9F9F9;
  --rail-muted: #BDBDBD;
  --rail-default: #E0E0E0;
  --rail-active: rgba(96, 120, 236, .16);
  --rail-rule:   rgba(96, 120, 236, .24);

  --good: var(--success-800); --good-tint: var(--success-50); --good-line: var(--success-700);
  --warn: var(--warning-800); --warn-tint: var(--warning-50); --warn-line: var(--warning-500);
  --info: var(--brand-800);   --info-tint: var(--brand-50);   --info-line: var(--brand-700);
  --danger: var(--red-600);   --danger-tint: var(--red-50);   --danger-line: var(--red-700); --danger-deep: var(--red-800);

  --focus-line: var(--brand-400);
  --focus-ring: rgba(164, 179, 242, .4);
  --focus-dash: var(--brand-800);
  --button-primary: var(--brand-700);
  --button-primary-pressed: var(--brand-800);

  /* Code surfaces sit on the rail colour so code reads as part of the shell. */
  --code-bg:    #141728;
  --code-ink:   #E4E9FA;
  --code-muted: #8A93B8;
  --code-key:   #A4B3F2;
  --code-str:   #9BE3BF;
  --code-num:   #F9C78B;
  --code-kw:    #F4A5C0;
  --code-rule:  rgba(164, 179, 242, .14);

  --font-sans: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-code: 'Google Sans Code', ui-monospace, 'SF Mono', Menlo, monospace;

  --text-xs: 12px;  --leading-xs: 18px;
  --text-sm: 14px;  --leading-sm: 20px;
  --text-md: 16px;  --leading-md: 24px;
  --text-lg: 18px;  --leading-lg: 28px;
  --text-xl: 20px;  --leading-xl: 30px;
  --text-2xl: 24px; --leading-2xl: 34px;
  --text-3xl: 30px; --leading-3xl: 40px;

  --space-4: 4px; --space-8: 8px; --space-12: 12px; --space-16: 16px;
  --space-20: 20px; --space-24: 24px; --space-32: 32px; --space-40: 40px; --space-48: 48px;

  --radius-sm: 6px; --radius-md: 8px; --radius-xl: 12px; --radius-2xl: 16px; --radius-full: 9999px;

  --shadow-card: 0 1px 2px rgba(10, 13, 18, .04), 0 0 3px rgba(10, 13, 18, .08);
  --shadow-menu: 0 0 8px rgba(10, 13, 18, .12);
  --shadow-modal: 0 0 6px rgba(59, 77, 180, .12);
  --shadow-header: 0 0 3px 0 rgba(96, 120, 236, .16);
  --shadow-button-hover: 0 2px 4px -2px rgba(17, 24, 39, .06), 0 4px 8px -2px rgba(17, 24, 39, .10);

  --rail-w: 264px;
  --header-h: 56px;
  --content-max: 1360px;
}

/* ── Base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--ground); color: var(--ink-soft);
  font-family: var(--font-sans); font-size: var(--text-md); line-height: var(--leading-md);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--ink); margin: 0; font-weight: 700; }
p { margin: 0; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
code, kbd, pre { font-family: var(--font-code); }
:focus-visible { outline: 2px solid var(--focus-line); outline-offset: 2px; }
[hidden] { display: none !important; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-md); }
.skip-link:focus { left: 8px; }

/* ── Buttons (Design System Buttons 109:910) ─────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 20px; border: 0; border-radius: var(--radius-full);
  background: var(--button-primary); color: var(--neutral-50);
  font: 500 var(--text-md)/var(--leading-md) var(--font-sans);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { box-shadow: var(--shadow-button-hover); }
.btn:active { background: var(--button-primary-pressed); box-shadow: none; }
.btn:focus-visible { outline: 2px dashed var(--focus-dash); outline-offset: 3px; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn--outline { background: var(--surface); color: var(--ink-soft); border: 1px solid var(--neutral-800); padding: 7px 19px; }
.btn--outline:hover { background: var(--neutral-100); }
.btn--outline:active { background: var(--neutral-200); }
.btn--secondary { background: var(--surface); color: var(--button-primary); border: 1px solid var(--button-primary); padding: 7px 19px; }
.btn--secondary:hover { background: var(--neutral-50); }
.btn--secondary:active { background: var(--brand-100); }
.btn--sm { padding: 6px 16px; font-size: var(--text-sm); line-height: var(--leading-sm); gap: 6px; }
.btn--sm.btn--outline, .btn--sm.btn--secondary { padding: 5px 15px; }
.btn--quiet { background: transparent; color: var(--ink-soft); padding: 6px 12px; }
.btn--quiet:hover { background: var(--neutral-100); box-shadow: none; }
.btn svg { flex: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 0; border-radius: var(--radius-full);
  background: transparent; color: var(--ink-soft); cursor: pointer;
}
.icon-btn:hover { background: var(--neutral-100); }

/* ── Tags and method badges ──────────────────────────────────── */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--text-xs); line-height: var(--leading-xs); font-weight: 500;
  color: var(--neutral-600); background: var(--neutral-100);
  border-radius: var(--radius-full); padding: 2px 8px; white-space: nowrap;
}
.tag--good   { color: var(--success-800); background: var(--success-50); }
.tag--warn   { color: var(--warning-800); background: var(--warning-50); }
.tag--danger { color: var(--red-800);     background: var(--red-50); }
.tag--brand  { color: var(--brand-800);   background: var(--brand-50); }
.tag--blue   { color: var(--blue-800);    background: var(--blue-50); }

.method {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 52px; padding: 1px 6px; border-radius: var(--radius-sm);
  font: 600 11px/18px var(--font-code); letter-spacing: .02em; text-transform: uppercase;
}
.method--get    { color: var(--success-800); background: var(--success-50); }
.method--post   { color: var(--blue-800);    background: var(--blue-50); }
.method--put    { color: var(--warning-800); background: var(--warning-50); }
.method--patch  { color: var(--brand-800);   background: var(--brand-50); }
.method--delete { color: var(--red-800);     background: var(--red-50); }
.method--sm { min-width: 40px; font-size: 10px; line-height: 16px; padding: 0 4px; }

.status { font: 600 var(--text-xs)/var(--leading-xs) var(--font-code); padding: 2px 8px; border-radius: var(--radius-full); }
.status--2 { color: var(--success-800); background: var(--success-50); }
.status--4 { color: var(--warning-800); background: var(--warning-50); }
.status--5 { color: var(--red-800);     background: var(--red-50); }
.status--0 { color: var(--neutral-700); background: var(--neutral-100); }

/* ── Shell: rail + frame ─────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; flex: none; width: var(--rail-w);
  display: flex; flex-direction: column; background: var(--rail); color: var(--rail-default);
  z-index: 30;
}
.rail__brand {
  display: flex; align-items: center; gap: 10px; height: var(--header-h); padding: 0 20px;
  color: var(--rail-ink); text-decoration: none; font-weight: 700; font-size: var(--text-md);
  border-bottom: 1px solid var(--rail-rule);
}
.rail__brand img { border-radius: 6px; background: #fff; padding: 3px; }
.rail__nav { flex: 1; overflow-y: auto; padding: 12px 12px 24px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.rail__foot { display: flex; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--rail-rule); font-size: var(--text-xs); }
.rail__foot a { color: var(--rail-muted); text-decoration: none; }
.rail__foot a:hover { color: var(--rail-ink); }

.nav-group { margin-top: 20px; display: flex; flex-direction: column; gap: 2px; }
.nav-group:first-child { margin-top: 4px; }
/* Docs-only: the North Star Sidebar has no section labels; an API reference
   needs them to say which domain a module belongs to. */
.nav-group__title {
  padding: 0 12px 6px; color: var(--rail-muted); opacity: .7;
  font-size: 11px; line-height: 16px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
/* Sidebar rows (shell.css .rail__item in sequipay-web): pill, 14/20, 400. */
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 9px 12px; border: 0; border-radius: var(--radius-full);
  background: none; color: var(--rail-default); text-align: left; text-decoration: none;
  font: 400 var(--text-sm)/var(--leading-sm) var(--font-sans); cursor: pointer;
}
.nav-item:hover { background: var(--rail-active); color: var(--rail-ink); }
.nav-item.is-active { background: var(--rail-active); color: var(--rail-ink); font-weight: 700; }
.nav-item__icon { flex: none; opacity: .9; }
.nav-item__label { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nav-item__chev { margin-left: auto; flex: none; display: inline-flex; opacity: .75; transition: transform .18s ease; }
.nav-item--parent[aria-expanded="true"] .nav-item__chev { transform: rotate(90deg); }
/* The open module: one tinted, rounded panel around the row and its children. */
.nav-block.is-open { background: var(--rail-active); border-radius: var(--radius-2xl); padding-bottom: 6px; }
.nav-block.is-open > .nav-item--parent { color: var(--rail-ink); font-weight: 700; }
.nav-block.is-open > .nav-item--parent:hover { background: transparent; }
.nav-sub { display: flex; flex-direction: column; gap: 1px; }
.nav-item--child { align-items: flex-start; gap: 8px; padding: 7px 12px 7px 42px; border-radius: var(--radius-md); font-size: 13px; line-height: 18px; }
.nav-item--child:hover { background: rgba(96, 120, 236, .14); }
.nav-item--child.is-active { background: rgba(96, 120, 236, .24); font-weight: 600; }
.nav-item--child .method { margin-top: 1px; min-width: 38px; font-size: 9.5px; line-height: 15px; padding: 0 3px; }
.rail .method--get    { color: #9BE3BF; background: rgba(18, 183, 106, .14); }
.rail .method--post   { color: #A9C8FA; background: rgba(24, 103, 231, .2); }
.rail .method--put    { color: #F9C78B; background: rgba(247, 144, 9, .16); }
.rail .method--patch  { color: #C3CDF7; background: rgba(96, 120, 236, .22); }
.rail .method--delete { color: #F7A9A3; background: rgba(240, 68, 56, .18); }

.frame { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--header-h);
  display: flex; align-items: center; gap: 16px; padding: 0 24px;
  background: var(--surface); box-shadow: var(--shadow-header);
}
.topbar__menu { display: none; }
.search-trigger {
  display: flex; align-items: center; gap: 10px; flex: 0 1 440px; height: 38px; padding: 0 8px 0 14px;
  border: 1px solid var(--rule-strong); border-radius: var(--radius-full); background: var(--neutral-50);
  color: var(--faint); font: 500 var(--text-sm)/1 var(--font-sans); cursor: pointer; text-align: left;
}
.search-trigger:hover { border-color: var(--neutral-400); background: var(--surface); }
.search-trigger span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
kbd {
  font-size: 11px; line-height: 16px; padding: 1px 6px; border-radius: var(--radius-sm);
  border: 1px solid var(--rule-strong); background: var(--surface); color: var(--muted);
}
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.vertical-pick { display: flex; align-items: center; gap: 8px; font-size: var(--text-sm); color: var(--muted); font-weight: 500; }
.vertical-pick select, .select {
  height: 34px; padding: 0 30px 0 12px; border: 1px solid var(--rule-strong); border-radius: var(--radius-md);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23616161' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  -webkit-appearance: none; appearance: none;
  font: 500 var(--text-sm)/1 var(--font-sans); color: var(--ink-soft); cursor: pointer;
}
.token-btn { gap: 8px; }
.token-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--neutral-400); }
.token-btn.is-set .token-dot { background: var(--success-700); box-shadow: 0 0 0 3px var(--success-50); }

.main { flex: 1; min-width: 0; outline: none; }
.page { max-width: var(--content-max); margin: 0 auto; padding: 32px 40px 80px; }
.page--narrow { max-width: 920px; }

/* ── Page head: title with its actions beside it, bottom-aligned ── */
.page-head { display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head__text { flex: 1 1 420px; min-width: 0; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: var(--text-sm); font-weight: 600; color: var(--brand); text-decoration: none; }
.eyebrow:hover { text-decoration: underline; }
.page-title { font-size: var(--text-3xl); line-height: var(--leading-3xl); letter-spacing: -.01em; }
.lede { margin-top: 8px; font-size: var(--text-lg); line-height: var(--leading-lg); color: var(--muted); max-width: 72ch; }

.card { background: var(--surface); border-radius: var(--radius-2xl); padding: var(--space-24); box-shadow: var(--shadow-card); }
.card + .card { margin-top: var(--space-16); }
.grid > .card, .domain-grid > .card { margin-top: 0; }
.card__title { font-size: var(--text-lg); line-height: var(--leading-lg); margin-bottom: 4px; }
.card__sub { color: var(--muted); font-size: var(--text-sm); line-height: var(--leading-sm); }

/* ── Endpoint line ────────────────────────────────────────────── */
.endpoint-line {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding: 8px 8px 8px 12px;
  background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-card); max-width: 100%;
}
.endpoint-line > code { font-size: var(--text-md); font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.endpoint-line__actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.icon-btn--sm { width: 30px; height: 30px; color: var(--muted); }

/* ── Overview ─────────────────────────────────────────────────── */
.hero { padding: 8px 0 8px; }
.hero .page-title { font-size: 36px; line-height: 44px; }
.base-url { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 6px 6px 6px 14px; border-radius: var(--radius-full); background: var(--surface); box-shadow: var(--shadow-card); font-size: var(--text-sm); }
.base-url code { color: var(--ink-soft); }
.base-url__label { color: var(--muted); font-weight: 600; }
.grid { display: grid; gap: 16px; }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.section { margin-top: 40px; }
.section__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section__title { font-size: var(--text-xl); line-height: var(--leading-xl); }
.section__note { color: var(--muted); font-size: var(--text-sm); }
.step { position: relative; }
.step__num {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-bottom: 12px;
  border-radius: 50%; background: var(--brand-50); color: var(--brand-800); font-weight: 700; font-size: var(--text-sm);
}
.step p { color: var(--muted); font-size: var(--text-sm); line-height: var(--leading-sm); margin-top: 4px; }
.step .code-mini { margin-top: 12px; }
.code-mini {
  display: block; padding: 10px 12px; border-radius: var(--radius-md); background: var(--code-bg); color: var(--code-ink);
  font-size: 12px; line-height: 18px; white-space: pre; overflow-x: auto;
}
.ai-card { background: linear-gradient(135deg, #F3F5FF 0%, #FFFFFF 70%); border: 1px solid var(--brand-100); box-shadow: none; }
.ai-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.ai-link {
  display: block; padding: 14px; border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--rule);
  text-decoration: none; color: var(--ink-soft);
}
.ai-link:hover { border-color: var(--brand-300); box-shadow: var(--shadow-card); }
.ai-link strong { display: block; font-size: var(--text-sm); color: var(--ink); }
.ai-link code { font-size: 12px; color: var(--brand-700); }
.ai-link span { display: block; margin-top: 4px; font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--muted); }
.module-card { display: block; text-decoration: none; color: inherit; padding: 18px 20px; transition: box-shadow .15s; }
.module-card:hover { box-shadow: var(--shadow-button-hover), var(--shadow-card); }
.module-card__head { display: flex; align-items: center; gap: 8px; }
.module-card__name { font-weight: 700; color: var(--ink); }
.module-card__count { margin-left: auto; }
.module-card p { margin-top: 6px; font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Overview: one compact list per domain. */
.domain-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.domain { padding: 8px 0; }
.domain__title { padding: 12px 20px 8px; font-size: 11px; line-height: 16px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.domain__row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 14px; align-items: baseline; padding: 10px 20px; text-decoration: none; color: inherit; border-top: 1px solid var(--rule); }
.domain__row:hover { background: var(--neutral-50); }
.domain__name { font-weight: 700; color: var(--ink); font-size: var(--text-sm); }
.domain__desc { font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.domain__count { font: 600 var(--text-xs)/var(--leading-xs) var(--font-code); color: var(--faint); }

/* ── Endpoint page: docs column + sticky code column ─────────── */
.ep-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 520px); gap: 40px; align-items: start; }
.ep-aside { position: sticky; top: calc(var(--header-h) + 24px); display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - var(--header-h) - 48px); }
.ep-section { margin-top: 32px; }
.ep-section__title { font-size: var(--text-xl); line-height: var(--leading-xl); padding-bottom: 10px; border-bottom: 1px solid var(--rule-strong); margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.ep-section__title .tag { font-weight: 600; }

.auth-note { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-left: 4px; font-size: var(--text-sm); color: var(--muted); }
.auth-note__sep { color: var(--faint); }
.auth-note svg { color: var(--brand); flex: none; }

/* Prose rendered from Markdown */
.prose { font-size: var(--text-md); line-height: 26px; color: var(--ink-soft); max-width: 78ch; }
.guide-body.prose { max-width: 880px; }
.prose > * + * { margin-top: 14px; }
.prose h2 { font-size: var(--text-2xl); line-height: var(--leading-2xl); margin-top: 36px; }
.prose h3 { font-size: var(--text-lg); line-height: var(--leading-lg); margin-top: 28px; }
.prose h4 { font-size: var(--text-md); margin-top: 20px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 6px; }
.prose li > p { margin: 0; }
.prose strong { color: var(--ink); font-weight: 700; }
.prose :not(pre) > code {
  font-size: .86em; padding: 1px 5px; border-radius: 5px; background: var(--brand-50); color: var(--brand-800);
  overflow-wrap: anywhere;
}
.prose a code { color: inherit; }
.prose blockquote { margin: 0; padding: 12px 16px; border-left: 3px solid var(--brand-300); background: var(--brand-50); border-radius: 0 var(--radius-md) var(--radius-md) 0; color: var(--info); }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); line-height: var(--leading-sm); display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose th { background: var(--neutral-100); font-weight: 700; color: var(--ink); white-space: nowrap; }
.prose hr { border: 0; border-top: 1px solid var(--rule-strong); margin: 28px 0; }
.prose pre { margin-top: 14px; }
.prose--sm { font-size: var(--text-sm); line-height: 22px; }
.prose--sm > * + * { margin-top: 8px; }
.prose--sm h3 { font-size: var(--text-md); margin-top: 18px; }

/* Progressive disclosure: a description's sections fold into scannable rows. */
.disclose-list { margin-top: 20px; background: var(--surface); border-radius: var(--radius-2xl); box-shadow: var(--shadow-card); overflow: hidden; }
.disclose-list__head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 20px; border-bottom: 1px solid var(--rule); font-size: var(--text-sm); font-weight: 700; color: var(--ink); }
.disclose-list__count { font-weight: 500; color: var(--faint); }
.disclose-list__head .btn { margin-left: auto; }
.disclose { border-bottom: 1px solid var(--rule); }
.disclose:last-child { border-bottom: 0; }
.disclose > summary {
  display: flex; align-items: center; gap: 12px; padding: 13px 20px; cursor: pointer; list-style: none;
  font-size: var(--text-md); line-height: var(--leading-md); font-weight: 600; color: var(--ink);
}
.disclose > summary::-webkit-details-marker { display: none; }
.disclose > summary::after {
  content: ""; margin-left: auto; flex: none; width: 8px; height: 8px;
  border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(-45deg); transition: transform .15s;
}
.disclose[open] > summary::after { transform: rotate(45deg); }
.disclose > summary:hover { background: var(--neutral-50); }
.disclose > summary code { font-size: .86em; padding: 1px 5px; border-radius: 5px; background: var(--brand-50); color: var(--brand-800); }
.disclose__body { padding: 0 20px 18px; font-size: var(--text-sm); line-height: 22px; }
.disclose__body > * + * { margin-top: 10px; }

/* "Show N more" at the foot of a long field list. */
.field-more { list-style: none; padding: 12px 0 4px; }
.field-more > details > summary {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  padding: 6px 14px; border: 1px solid var(--rule-strong); border-radius: var(--radius-full);
  font-size: var(--text-sm); font-weight: 600; color: var(--ink-soft); background: var(--surface);
}
.field-more > details > summary::-webkit-details-marker { display: none; }
.field-more > details > summary:hover { background: var(--neutral-100); }
/* Open, the pill reads "Show fewer": the count text hides and ::before speaks. */
.field-more > details[open] > summary { margin-bottom: 4px; font-size: 0; }
.field-more > details[open] > summary::before { font-size: var(--text-sm); content: "Show fewer"; }

/* Long field descriptions clamp to three lines. */
.field-row__desc.is-clamped { max-height: 66px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.link-btn { margin-top: 2px; padding: 0; border: 0; background: none; color: var(--link); font: 600 var(--text-xs)/var(--leading-xs) var(--font-sans); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* Callouts: the Design System Light Banner (904:19211). */
.callout { display: flex; gap: 10px; padding: 14px 16px; border-radius: var(--radius-xl); border: 1px solid var(--info-line); background: var(--info-tint); color: var(--info); font-size: var(--text-sm); line-height: 22px; }
.callout--warn { border-color: var(--warn-line); background: var(--warn-tint); color: var(--warn); }
.callout--good { border-color: var(--good-line); background: var(--good-tint); color: var(--good); }
.callout svg { flex: none; margin-top: 2px; }
.callout a { color: inherit; }
.callout code { background: rgba(255,255,255,.7) !important; color: inherit !important; }

/* Field tables: parameters, body fields, response fields */
.fields { list-style: none; margin: 0; padding: 0; }
.field-row { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.field-row:last-child { border-bottom: 0; }
.field-row__head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; }
.field-row__name { font: 600 var(--text-sm)/var(--leading-sm) var(--font-code); color: var(--ink); overflow-wrap: anywhere; }
.field-row__type { font: 500 12px/18px var(--font-code); color: var(--muted); }
.field-row__req { font-size: 11px; line-height: 16px; font-weight: 700; color: var(--red-700); text-transform: uppercase; letter-spacing: .04em; }
.field-row__opt { font-size: 11px; line-height: 16px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.field-row__desc { margin-top: 4px; }
.field-row__desc.prose { font-size: var(--text-sm); line-height: 22px; color: var(--muted); }
.field-row__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; font-size: var(--text-xs); color: var(--muted); }
.field-row__meta code { font-size: 11.5px; padding: 1px 6px; border-radius: 5px; background: var(--neutral-100); color: var(--ink-soft); }
.field-children { margin-top: 10px; border: 1px solid var(--rule-strong); border-radius: var(--radius-xl); }
.field-children > summary { cursor: pointer; padding: 8px 14px; font-size: var(--text-sm); font-weight: 600; color: var(--ink-soft); list-style: none; display: flex; align-items: center; gap: 6px; }
.field-children > summary::-webkit-details-marker { display: none; }
.field-children > summary::before { content: ""; width: 0; height: 0; border-left: 5px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .15s; }
.field-children[open] > summary::before { transform: rotate(90deg); }
.field-children > .fields { padding: 0 14px; border-top: 1px solid var(--rule); }
.field-variant { margin-top: 8px; font-size: var(--text-xs); color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* Responses list */
.resp { border-bottom: 1px solid var(--rule); }
.resp > summary { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; cursor: pointer; list-style: none; }
.resp > summary::-webkit-details-marker { display: none; }
.resp > summary .status { flex: none; margin-top: 1px; }
.resp__desc { flex: 1; font-size: var(--text-sm); line-height: 22px; color: var(--ink-soft); }
.resp__chev { flex: none; margin-top: 3px; color: var(--faint); transition: transform .15s; }
.resp[open] .resp__chev { transform: rotate(90deg); }
.resp__body { padding: 0 0 16px 0; }
.resp--plain > summary { cursor: default; }

/* Vertical labels panel */
.vl-panel > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.vl-panel > summary::-webkit-details-marker { display: none; }
.vl-panel__hint { margin: 12px 0; font-size: var(--text-sm); color: var(--muted); }
.vl-table-wrap { overflow-x: auto; border: 1px solid var(--rule-strong); border-radius: var(--radius-xl); }
.vl-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); line-height: var(--leading-sm); }
.vl-table th { position: sticky; top: 0; background: var(--neutral-100); text-align: left; padding: 10px 14px; font-weight: 700; color: var(--ink); white-space: nowrap; border-bottom: 1px solid var(--rule-strong); }
.vl-table td { padding: 9px 14px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.vl-table tr:last-child td { border-bottom: 0; }
.vl-table td:first-child, .vl-table th:first-child { position: sticky; left: 0; background: inherit; }
.vl-table tbody td:first-child { background: var(--surface); }
.vl-table code { font-size: 12.5px; color: var(--ink); }
.vl-table .is-active { background: var(--brand-50); }
.vl-table th.is-active { background: var(--brand-100); color: var(--brand-800); }
.vl-hidden { color: var(--faint); }
.vl-toggle { display: flex; align-items: center; gap: 10px; margin: 8px 0 10px; font-size: var(--text-sm); color: var(--muted); }

.vl-req { color: var(--red-700); font-weight: 700; margin-left: 2px; }

/* ── Code panels ──────────────────────────────────────────────── */
.code-card { background: var(--code-bg); border-radius: var(--radius-2xl); overflow: hidden; display: flex; flex-direction: column; min-height: 0; box-shadow: 0 2px 8px rgba(20, 23, 40, .18); }
.code-card__head { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--code-rule); }
.code-card__title { color: var(--code-muted); font-size: var(--text-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-right: 8px; }
.code-tab {
  padding: 4px 10px; border: 0; border-radius: var(--radius-full); background: transparent; color: var(--code-muted);
  font: 600 var(--text-xs)/var(--leading-xs) var(--font-sans); cursor: pointer;
}
.code-tab:hover { color: var(--code-ink); }
.code-tab[aria-selected="true"] { background: rgba(164, 179, 242, .16); color: #fff; }
.code-card__tools { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.code-icon {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border: 0; border-radius: var(--radius-md);
  background: transparent; color: var(--code-muted); cursor: pointer; font: 600 12px/1 var(--font-sans);
}
.code-icon:hover { background: rgba(164, 179, 242, .12); color: #fff; }
.code-card pre {
  margin: 0; padding: 14px 16px; overflow: auto; color: var(--code-ink);
  font-size: 12.5px; line-height: 20px; tab-size: 2; min-height: 0;
}
.code-card--request pre { max-height: 40vh; }
.code-card--response { flex: 1 1 auto; }
.code-card--response pre { max-height: 46vh; }
.code-card__try { padding: 10px; border-top: 1px solid var(--code-rule); display: flex; gap: 8px; align-items: center; }
.code-card__try .btn { flex: 1; }
.code-card__try-note { color: var(--code-muted); font-size: 12px; line-height: 16px; }
.code-card select.select { height: 28px; background-color: transparent; color: var(--code-ink); border-color: var(--code-rule); font-size: 12px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A93B8' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.code-card select.select option { color: #000; }
.tok-key { color: var(--code-key); }
.tok-str { color: var(--code-str); }
.tok-num { color: var(--code-num); }
.tok-kw  { color: var(--code-kw); }
.tok-mut { color: var(--code-muted); }

.prose pre, .code-block {
  position: relative; padding: 14px 16px; border-radius: var(--radius-xl); background: var(--code-bg); color: var(--code-ink);
  font-size: 12.5px; line-height: 20px; overflow: auto;
}
.prose pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
/* A fenced block with no language is prose-like (a prompt, a config line): wrap it. */
.code-block--wrap { white-space: pre-wrap; word-break: break-word; }
.prose td code, .prose th code { white-space: nowrap; overflow-wrap: normal; }
.copy-float { position: absolute; top: 6px; right: 6px; opacity: 0; transition: opacity .15s; }
.prose pre:hover .copy-float, .code-block:hover .copy-float { opacity: 1; }

/* ── Page actions menu ────────────────────────────────────────── */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 25; min-width: 260px; padding: 6px;
  background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-menu);
}
.menu__item {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-md);
  background: none; text-align: left; text-decoration: none; color: var(--ink-soft); cursor: pointer; font: inherit;
}
.menu__item:hover { background: var(--neutral-100); }
.menu__item strong { display: block; font-size: var(--text-sm); line-height: var(--leading-sm); font-weight: 600; color: var(--ink); }
.menu__item span { display: block; font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--muted); }
.menu__item svg { flex: none; margin-top: 2px; color: var(--muted); }

/* ── Module page ──────────────────────────────────────────────── */
.op-list { padding: 0; overflow: hidden; }
.op-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 16px; gap: 16px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit; }
.op-row:last-child { border-bottom: 0; }
.op-row:hover { background: var(--neutral-50); }
.op-row__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.op-row__sum { font-size: var(--text-md); font-weight: 600; color: var(--ink); }
.op-row code { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.op-row__chev { color: var(--faint); }

/* ── Guide page ───────────────────────────────────────────────── */
.guide-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 48px; align-items: start; }
.guide-aside { position: sticky; top: calc(var(--header-h) + 32px); display: flex; flex-direction: column; gap: 24px; }
.guide-aside__actions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 30px; }
.toc { font-size: var(--text-sm); }
.toc__title { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.toc a { display: block; padding: 4px 0 4px 12px; border-left: 2px solid var(--rule-strong); color: var(--muted); text-decoration: none; line-height: 18px; }
.toc a:hover { color: var(--ink); border-color: var(--brand-300); }
.guide-body { max-width: 880px; background: var(--surface); border-radius: var(--radius-2xl); box-shadow: var(--shadow-card); padding: 40px 48px; }
.pager { display: flex; gap: 16px; margin-top: 24px; }
.pager a { flex: 1; padding: 14px 18px; background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-card); text-decoration: none; color: var(--ink); font-weight: 600; }
.pager a span { display: block; font-size: var(--text-xs); color: var(--muted); font-weight: 500; }
.pager a.next { text-align: right; }

/* ── Drawer: Try it ───────────────────────────────────────────── */
.scrim { position: fixed; inset: 0; background: rgba(20, 23, 40, .32); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(640px, 100vw);
  display: flex; flex-direction: column; background: var(--surface); box-shadow: -8px 0 24px rgba(20, 23, 40, .16);
}
.drawer__head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--rule-strong); }
.drawer__title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.drawer__title code { font-size: var(--text-sm); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer__body { flex: 1; overflow-y: auto; padding: 4px 20px 24px; }
.drawer__group { margin-top: 20px; }
.drawer__group-title { font-size: var(--text-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.drawer__shortcut { font-size: var(--text-xs); color: var(--faint); }

/* Fields: the Design System Input field (789:4690). */
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.field > label { font-size: var(--text-sm); line-height: var(--leading-sm); font-weight: 700; color: var(--ink-soft); display: flex; gap: 6px; align-items: baseline; }
.field > label code { font-weight: 600; }
.field__in { font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.field__required { color: var(--danger); font-weight: 700; }
.field .hint { font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--neutral-600); font-style: italic; }
.input, .textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--rule-strong); border-radius: var(--radius-md); background: var(--surface);
  font: 500 var(--text-sm)/var(--leading-sm) var(--font-sans); color: var(--ink-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .textarea:hover { border-color: var(--neutral-400); }
.input:focus, .textarea:focus { outline: none; border-color: var(--focus-line); box-shadow: 0 0 0 4px var(--focus-ring); }
.input--code, .textarea { font-family: var(--font-code); font-size: 12.5px; }
.textarea { min-height: 220px; resize: vertical; line-height: 19px; tab-size: 2; }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; }

.result { margin-top: 24px; border-top: 1px solid var(--rule-strong); padding-top: 18px; }
.result__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.result__meta { font-size: var(--text-xs); color: var(--muted); font-family: var(--font-code); }
.result .code-block { max-height: 60vh; }
.result__error { margin-bottom: 12px; }

/* ── Dialogs: search, token ───────────────────────────────────── */
.dialog-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; background: rgba(20, 23, 40, .32); }
.dialog { width: min(640px, 100%); max-height: 76vh; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-2xl); box-shadow: var(--shadow-modal), 0 24px 48px rgba(20, 23, 40, .18); overflow: hidden; }
.dialog--form { width: min(520px, 100%); }
.dialog__head { padding: 20px 24px 0; }
.dialog__title { font-size: var(--text-xl); line-height: var(--leading-xl); }
.dialog__body { padding: 8px 24px 20px; overflow-y: auto; }
.dialog__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--rule); background: var(--neutral-50); }
.dialog__body p { font-size: var(--text-sm); line-height: 22px; color: var(--muted); margin-top: 6px; }
.search-box { display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--rule); color: var(--faint); }
.search-box input { flex: 1; height: 56px; border: 0; outline: none; font: 500 var(--text-md)/1 var(--font-sans); color: var(--ink); background: none; }
.search-results { overflow-y: auto; padding: 6px; }
.search-hit { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-md); text-decoration: none; color: var(--ink-soft); }
.search-hit.is-active, .search-hit:hover { background: var(--brand-50); }
.search-hit__main { min-width: 0; flex: 1; }
.search-hit__title { font-size: var(--text-sm); font-weight: 600; color: var(--ink); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-hit__sub { font-size: var(--text-xs); color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-hit__sub.is-code { font-family: var(--font-code); }
.search-hit__kind { font-size: 11px; color: var(--faint); font-weight: 600; }
.search-empty { padding: 28px; text-align: center; color: var(--muted); font-size: var(--text-sm); }
.search-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--rule); font-size: 11px; color: var(--faint); }

/* ── Toast ────────────────────────────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 60; padding: 10px 16px; border-radius: var(--radius-full); background: var(--rail); color: var(--rail-ink); font-size: var(--text-sm); font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ── Static index (shown before app.js runs, and to non-JS readers) ── */
.static-index { max-width: 920px; margin: 0 auto; padding: 40px; }
.static-index h1 { font-size: var(--text-3xl); line-height: var(--leading-3xl); }
.static-index h2 { margin-top: 28px; font-size: var(--text-xl); }
.static-index h3 { margin-top: 18px; font-size: var(--text-md); }
.static-index p { margin-top: 10px; color: var(--muted); }
.static-index ul { margin: 8px 0 0; padding-left: 20px; font-size: var(--text-sm); }
.static-index code { font-size: .9em; }

.loading { padding: 80px; text-align: center; color: var(--muted); }
.empty-note { color: var(--muted); font-size: var(--text-sm); padding: 12px 0; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .ep-layout { grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: 28px; }
  .ai-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .ep-layout { grid-template-columns: minmax(0, 1fr); }
  .ep-aside { position: static; max-height: none; }
  .code-card--response pre, .code-card--request pre { max-height: 360px; }
  .guide-layout { grid-template-columns: minmax(0, 1fr); }
  .guide-aside { position: static; gap: 0; }
  .guide-aside__actions { flex-direction: row; padding-top: 0; }
  .toc { display: none; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .rail { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: 8px 0 24px rgba(0,0,0,.2); }
  .rail.is-open { transform: none; z-index: 45; }
  .topbar { padding: 0 16px; gap: 10px; }
  .topbar__menu { display: inline-flex; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .search-trigger { flex: none; width: 38px; padding: 0; justify-content: center; }
  .vertical-pick > span { display: none; }
  .page { padding: 24px 16px 64px; }
  .page-title { font-size: var(--text-2xl); line-height: var(--leading-2xl); }
  .hero .page-title { font-size: 30px; line-height: 38px; }
  .grid--3, .grid--2, .ai-links, .domain-grid { grid-template-columns: minmax(0, 1fr); }
  .domain__row { grid-template-columns: minmax(0, 1fr) auto; }
  .domain__desc { display: none; }
  .guide-body { padding: 24px 20px; }
  .op-row { grid-template-columns: 56px minmax(0, 1fr) 12px; }
  .static-index { padding: 24px 16px; }
}
@media (max-width: 520px) {
  .token-btn { padding: 5px 12px; }
  .endpoint-line code .base { display: none; }
  .vertical-pick select { max-width: 120px; }
}
