/* Autonex MCP docs. Tokens follow autonex-web-v2 (paper, ink, Work Sans + Inter, brand blue, mesh) and the panel
   design system (light gray page, white cards, darker sidebar, line tabs, success/warning/destructive soft badges). */

@font-face { font-family: 'Inter'; src: url('assets/inter-latin.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Work Sans'; src: url('assets/worksans-latin.woff2') format('woff2'); font-weight: 500 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Roboto Mono'; src: url('assets/robotomono-latin.woff2') format('woff2'); font-weight: 400 500; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #FAFAF9; --paper-2: #F3F3F1; --surface: #FFFFFF; --code-bg: #F6F6F4;
  --ink: #1C1C1C; --ink-2: #2A2A2C; --mute: #64646A; --rule: #E2E1DC; --rule-strong: #CFCEC8;
  --brand: #196DFF; --brand-ink: #0A5BD6; --brand-fill: #0A5BD6; --brand-fill-hover: #0F4FCC; --brand-soft: #E8F0FF;
  --coral: #FF8755; --lilac: #E282FF; --sky: #4CB4ED;
  --success: #1E7A5A; --success-soft: #E2F0EA; --warning-ink: #8A5510; --warning: #B4741A; --warning-soft: #F8EEDC;
  --danger: #B3392E; --danger-soft: #F7E5E2; --ai: #7532DD;
  --tk-c: #737378; --tk-s: #1E7A5A; --tk-k: #7532DD; --tk-n: #A1461A; --tk-b: #A1461A; --tk-p: #0A5BD6; --tk-f: #7532DD; --tk-v: #8A5510; --tk-h: #0A5BD6;
  --mesh: radial-gradient(120% 100% at 12% 18%, rgba(76, 180, 237, .42) 0%, transparent 60%),
          radial-gradient(95% 80% at 88% 90%, rgba(255, 135, 85, .22) 0%, transparent 55%),
          radial-gradient(70% 70% at 92% 8%, rgba(226, 130, 255, .20) 0%, transparent 60%),
          radial-gradient(100% 90% at 50% 105%, rgba(25, 109, 255, .22) 0%, transparent 60%),
          linear-gradient(135deg, #EEF4FB 0%, #F3F0EC 100%);
  --glass: rgba(255, 255, 255, .55); --glass-border: rgba(255, 255, 255, .8);
  --shadow: 0 1px 2px rgba(28, 28, 28, .04), 0 4px 12px rgba(28, 28, 28, .04);
  --focus: 0 0 0 3px rgba(25, 109, 255, .35);
  --f-display: 'Work Sans', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --f-body: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --f-mono: 'Roboto Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --top-h: 60px; --side-w: 272px; --toc-w: 216px; --measure: 46rem;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #141416; --paper-2: #1A1A1D; --surface: #1E1E21; --code-bg: #19191C;
    --ink: #EDEDEE; --ink-2: #D6D6D8; --mute: #A3A3A8; --rule: #2C2C30; --rule-strong: #3A3A3F;
    --brand: #4C87F0; --brand-ink: #7FA8FF; --brand-fill: #2F75FF; --brand-fill-hover: #4F88FF; --brand-soft: rgba(47, 117, 255, .16);
    --success: #4CC79A; --success-soft: rgba(30, 122, 90, .24); --warning-ink: #F2B65A; --warning: #F2B65A; --warning-soft: rgba(180, 116, 26, .22);
    --danger: #F08A80; --danger-soft: rgba(179, 57, 46, .24); --ai: #B28CF5;
    --tk-c: #8C8C92; --tk-s: #7FD3A8; --tk-k: #C3A2FF; --tk-n: #FFB089; --tk-b: #FFB089; --tk-p: #8DB4FF; --tk-f: #C3A2FF; --tk-v: #F2C36B; --tk-h: #8DB4FF;
    --mesh: radial-gradient(120% 100% at 12% 18%, rgba(76, 180, 237, .20) 0%, transparent 60%),
            radial-gradient(95% 80% at 88% 90%, rgba(255, 135, 85, .12) 0%, transparent 55%),
            radial-gradient(70% 70% at 92% 8%, rgba(226, 130, 255, .12) 0%, transparent 60%),
            radial-gradient(100% 90% at 50% 105%, rgba(25, 109, 255, .18) 0%, transparent 60%),
            linear-gradient(135deg, #171A20 0%, #1B1918 100%);
    --glass: rgba(30, 30, 33, .6); --glass-border: rgba(255, 255, 255, .08);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 12px rgba(0, 0, 0, .2);
    --focus: 0 0 0 3px rgba(127, 168, 255, .45);
  }
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 16px); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.65 var(--f-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--brand-ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 30%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.i { width: 1em; height: 1em; flex: none; vertical-align: -.125em; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
code, kbd, pre { font-family: var(--f-mono); }
kbd { font-size: 11px; line-height: 1; padding: 3px 5px; border: 1px solid var(--rule-strong); border-bottom-width: 2px; border-radius: 4px; color: var(--mute); background: var(--surface); }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 14px; background: var(--ink); color: var(--paper); border-radius: 8px; text-decoration: none; font-weight: 500; }
.skip:focus { top: 10px; }
.muted { color: var(--mute); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--rule-strong);
  background: var(--surface); color: var(--ink); font: 500 15px/1.2 var(--f-body); text-decoration: none; white-space: nowrap;
  transition: background-color .15s var(--ease), border-color .15s var(--ease); }
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--brand-fill); border-color: var(--brand-fill); color: #fff; }
.btn-primary:hover { background: var(--brand-fill-hover); border-color: var(--brand-fill-hover); }
.btn-sm { min-height: 34px; padding: 6px 14px; font-size: 14px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font-size: 22px; cursor: pointer; }
.icon-btn:hover { background: var(--paper-2); }

/* ── Header ── */
.top { position: sticky; top: 0; z-index: 40; height: var(--top-h); background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px) saturate(140%); -webkit-backdrop-filter: blur(12px) saturate(140%); border-bottom: 1px solid var(--rule); }
.top-in { height: 100%; display: flex; align-items: center; gap: 12px; padding: 0 20px; max-width: 1560px; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: none; }
.wordmark { height: 19px; width: auto; display: block; }
.brand-product { font: 600 17px/1 var(--f-display); letter-spacing: -.01em; padding-left: 10px; border-left: 1px solid var(--rule-strong); }
.brand-docs { font-size: 14px; color: var(--mute); margin-left: -2px; }
.search-btn { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; width: min(320px, 32vw); height: 38px; padding: 0 8px 0 12px;
  border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); color: var(--mute); font: 400 14px var(--f-body); cursor: pointer; }
.search-btn:hover { border-color: var(--rule-strong); color: var(--ink); }
.search-btn .i { font-size: 17px; }
.search-btn kbd { margin-left: auto; }
.top-links { display: flex; align-items: center; gap: 4px; }
.search-btn[hidden] + .top-links { margin-left: auto; }
.top-link { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500; }
.top-link:hover { background: var(--paper-2); color: var(--ink); }
.top-link .i { font-size: 17px; }
.nav-toggle { margin-left: -8px; }
@media (min-width: 961px) { .nav-toggle { display: none !important; } }

/* ── Shell ── */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); max-width: 1560px; margin: 0 auto; min-height: calc(100vh - var(--top-h)); }
.shell.has-toc { grid-template-columns: var(--side-w) minmax(0, 1fr) var(--toc-w); }
main { min-width: 0; padding: 40px clamp(20px, 4vw, 64px) 64px; outline: none; }
main > * { max-width: var(--measure); margin-left: auto; margin-right: auto; }
.is-home main > * { max-width: 1080px; }

/* ── Sidebar ── */
.sidenav { position: sticky; top: var(--top-h); align-self: start; height: calc(100vh - var(--top-h)); overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper-2); border-right: 1px solid var(--rule); scrollbar-width: thin; }
.sidenav-in { padding: 20px 14px 40px; font-size: 14px; }
.sidenav ul { list-style: none; margin: 0; padding: 0; }
.sidenav a { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; line-height: 1.35; }
.sidenav a:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }
.sidenav a[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: inset 2px 0 0 var(--brand), var(--shadow); }
.sidenav .i { font-size: 17px; color: var(--mute); }
.nav-group { margin-top: 22px; }
.nav-h { margin: 0 0 6px; padding: 0 10px; font: 600 13px/1.3 var(--f-body); color: var(--mute); }
.nav-top a { font-weight: 500; }
.sidenav .sub { margin: 2px 0 8px 18px; padding-left: 9px; border-left: 1px solid var(--rule-strong); }
.sidenav .sub a { padding: 4px 8px; }
.sidenav .sub code { font-size: 12.5px; }
.sidenav .pack.open > a { color: var(--ink); font-weight: 500; }
@media (min-width: 641px) { .nav-ext { display: none; } }

/* ── TOC ── */
.toc { position: sticky; top: var(--top-h); align-self: start; max-height: calc(100vh - var(--top-h)); overflow-y: auto; padding: 44px 20px 40px 0; font-size: 13px; }
.toc-h { margin: 0 0 10px; font-weight: 600; color: var(--ink); }
.toc ul, .toc-inline ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.toc a, .toc-inline a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; border-left: 1px solid transparent; color: var(--mute); text-decoration: none; line-height: 1.4; overflow-wrap: anywhere; }
.toc .d3 a, .toc-inline .d3 a { padding-left: 24px; }
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--brand-ink); border-left-color: var(--brand); font-weight: 500; }
.toc-inline { display: none; margin: 0 0 28px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); font-size: 14px; }
.toc-inline summary { cursor: pointer; padding: 10px 16px; font-weight: 500; }
.toc-inline ul { margin: 0 16px 14px; }

/* ── Prose ── */
.prose { font-size: 16px; }
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .page-head h1, .hero h1, .home-sec h2 { font-family: var(--f-display); font-weight: 500; color: var(--ink); letter-spacing: -.02em; }
.prose h1, .page-head h1 { font-size: clamp(30px, 4vw, 40px); line-height: 1.12; margin: 0 0 18px; }
.prose h2 { font-size: 26px; line-height: 1.25; margin: 52px 0 14px; }
.prose h3 { font-size: 19px; line-height: 1.35; margin: 34px 0 10px; letter-spacing: -.01em; }
.prose h4 { font-size: 16px; margin: 26px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose li > p { margin: 0 0 8px; }
.prose li::marker { color: var(--mute); }
.prose strong { font-weight: 600; color: var(--ink); }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 40px 0; }
.prose :where(:not(pre) > code), .page-head :where(code), .facts :where(code), .tool-card-p :where(code) { font-size: .86em; padding: .12em .4em; border-radius: 5px; background: var(--paper-2); border: 1px solid var(--rule); overflow-wrap: anywhere; color: var(--ink-2); }
.prose a code { color: var(--brand-ink); }
.anchor { display: inline-flex; vertical-align: middle; margin-left: 8px; color: var(--mute); opacity: 0; font-size: .7em; text-decoration: none; transition: opacity .15s; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus-visible { opacity: 1; }
.prose blockquote { margin: 18px 0; padding: 14px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--rule); color: var(--ink-2); font-size: 15.5px; }
.prose blockquote > :last-child { margin-bottom: 0; }

/* Callouts */
.callout { margin: 22px 0; padding: 14px 18px 14px 16px; border-radius: 12px; border: 1px solid; font-size: 15px; }
.callout > :last-child { margin-bottom: 0; }
.callout p { margin: 0 0 8px; }
.callout-title { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 0 0 4px !important; }
.callout-title .i { font-size: 18px; }
.callout-note { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 25%, transparent); }
.callout-note .callout-title { color: var(--brand-ink); }
.callout-tip { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.callout-tip .callout-title { color: var(--success); }
.callout-warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.callout-warning .callout-title { color: var(--warning-ink); }
.callout code { background: color-mix(in srgb, var(--surface) 70%, transparent) !important; }

/* Tables */
.table-wrap { margin: 18px 0 24px; overflow-x: auto; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.table-wrap th, .table-wrap td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--rule); }
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap th { background: var(--paper); color: var(--mute); font-weight: 600; font-size: 13px; white-space: nowrap; }
.table-wrap table.kv td:first-child { width: 32%; font-weight: 500; color: var(--ink); background: var(--paper); }
.table-wrap td code { white-space: nowrap; }
.table-wrap td:last-child code { white-space: normal; }
table.fields td:first-child { white-space: nowrap; }
table.fields .fname { font-weight: 500; color: var(--ink); }
table.fields .ftype { font-size: 12px; color: var(--ai); background: transparent; border: 0; padding: 0; white-space: normal; overflow-wrap: anywhere; }
table.fields td:nth-child(2) { min-width: 132px; max-width: 240px; }
table.fields tr.nested td:first-child { padding-left: 28px; }
table.fields tr.nested.d2 td:first-child { padding-left: 42px; }
table.fields tr.nested .fname { font-weight: 400; color: var(--ink-2); }
.req { display: block; margin-top: 3px; font-size: 11.5px; font-weight: 500; color: var(--danger); }

/* Code */
.code { margin: 18px 0 22px; border: 1px solid var(--rule); border-radius: 12px; background: var(--code-bg); overflow: hidden; }
.code-bar { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 6px 0 14px; border-bottom: 1px solid var(--rule); background: var(--surface); }
.code-label { font: 500 12px/1 var(--f-mono); color: var(--mute); }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 13.5px; line-height: 1.6; tab-size: 2; color: var(--ink); }
.code pre:focus-visible { outline-offset: -2px; }
.copy { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px; border: 0; border-radius: 7px; background: transparent;
  color: var(--mute); font: 500 12.5px var(--f-body); cursor: pointer; }
.copy:hover { background: var(--paper-2); color: var(--ink); }
.copy .i { font-size: 15px; }
.copy.is-done { color: var(--success); }
.t-c { color: var(--tk-c); font-style: italic; } .t-s { color: var(--tk-s); } .t-k { color: var(--tk-k); } .t-n { color: var(--tk-n); } .t-b { color: var(--tk-b); }
.t-p { color: var(--tk-p); } .t-f { color: var(--tk-f); } .t-v { color: var(--tk-v); } .t-h { color: var(--tk-h); font-weight: 500; }

/* Tabs: line variant (underline, no pill) */
.tabs { margin: 18px 0 22px; }
.tabs.is-tabbed { border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; background: var(--code-bg); }
.tabs.is-tabbed .code { margin: 0; border: 0; border-radius: 0; }
.tablist { display: flex; gap: 2px; padding: 0 8px; overflow-x: auto; background: var(--surface); border-bottom: 1px solid var(--rule); scrollbar-width: none; }
.tablist [role="tab"] { position: relative; flex: none; padding: 11px 10px 10px; border: 0; background: none; color: var(--mute); font: 500 13.5px var(--f-body); cursor: pointer; }
.tablist [role="tab"]:hover { color: var(--ink); }
.tablist [role="tab"][aria-selected="true"] { color: var(--ink); }
.tablist [role="tab"][aria-selected="true"]::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ink); }
.tablist [role="tab"]:focus-visible { outline-offset: -4px; }
.tabs.is-tabbed .code-bar { background: var(--code-bg); border-bottom-color: color-mix(in srgb, var(--rule) 60%, transparent); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 8px; border-radius: 999px; font: 500 12.5px/1.3 var(--f-body); white-space: nowrap; }
.badge .i { font-size: 14px; }
.badge-read { background: var(--success-soft); color: var(--success); }
.badge-two-phase { background: var(--warning-soft); color: var(--warning-ink); }
.badge-write { background: var(--danger-soft); color: var(--danger); }

/* Copy field (endpoint, tool name) */
.copyfield { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 6px 6px 14px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); }
.copyfield code { flex: 1; min-width: 0; font-size: 14.5px; color: var(--ink); overflow-wrap: anywhere; background: none; border: 0; padding: 0; }
.copyfield .copy { margin-left: 0; height: 32px; border: 1px solid var(--rule); }

/* ── Page heads (packs, tools) ── */
.page-head { margin-bottom: 30px; }
.page-head h1 { margin-bottom: 14px; }
.crumb { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 14px; color: var(--mute); }
.crumb a { display: inline-flex; align-items: center; gap: 7px; color: var(--mute); text-decoration: none; font-weight: 500; }
.crumb a:hover { color: var(--ink); }
.crumb .i { font-size: 17px; }
.page-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface); border: 1px solid var(--rule); color: var(--ink); }
.page-head .lead { font-size: 17.5px; color: var(--ink-2); margin: 0 0 16px; max-width: 42rem; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; font-size: 13.5px; color: var(--mute); }
.stats span { padding: 3px 10px; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); }
.tool-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 18px; }
.copyfield-name { padding-left: 12px; }
.copyfield-name code { font-weight: 500; font-size: 15px; }
.facts { display: grid; gap: 4px; margin: 0; padding: 12px 16px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); font-size: 14.5px; }
.facts div { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.facts dt { color: var(--mute); min-width: 150px; }
.facts dd { margin: 0; }

/* Tool cards (pack pages) */
.tools-sec h2 { margin-top: 8px; }
.filter { position: relative; margin: 0 0 14px; max-width: 420px; }
.filter .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--mute); font-size: 17px; pointer-events: none; }
.filter input, .s-field input { width: 100%; height: 42px; padding: 0 12px 0 38px; border: 1px solid var(--rule-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: 400 15px var(--f-body); }
.filter input:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.filter-empty { color: var(--mute); }
.tool-cards { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.tool-card { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.tool-card:hover { border-color: var(--rule-strong); box-shadow: var(--shadow); }
.tool-card-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.tool-card .tool-name { background: none; border: 0; padding: 0; }
.tool-name { font-size: 14px; font-weight: 500; color: var(--brand-ink); overflow-wrap: anywhere; }
.tool-card-t { font-size: 14.5px; color: var(--ink-2); line-height: 1.45; }
.tool-card-p { display: flex; gap: 6px; align-items: baseline; margin-top: auto; font-size: 12.5px; color: var(--mute); }
.tool-card-p .i { align-self: center; }

/* Pager */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--rule); }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); text-decoration: none; color: var(--ink); }
.pager a:hover { border-color: var(--rule-strong); }
.pager-next { text-align: right; grid-column: 2; }
.pager-k { font-size: 13px; color: var(--mute); }
.pager-t { font-weight: 500; color: var(--brand-ink); }

/* ── Home ── */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 40px; align-items: center;
  padding: clamp(28px, 4.5vw, 56px); border-radius: 24px; background: var(--mesh); overflow: hidden; isolation: isolate; }
.hero h1 { margin: 0 0 16px; font-size: clamp(40px, 6vw, 64px); line-height: 1; letter-spacing: -.035em; }
.hero .lead { margin: 0 0 26px; max-width: 36rem; font-size: 17.5px; line-height: 1.6; color: var(--ink-2); }
.endpoint { max-width: 34rem; padding: 14px; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-border); backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%); }
.endpoint-k { margin: 0 0 8px 2px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.endpoint-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 10px 2px 0; font-size: 13px; }
.endpoint-meta div { display: flex; gap: 6px; flex-wrap: wrap; }
.endpoint-meta dt { color: var(--mute); }
.endpoint-meta dd { margin: 0; color: var(--ink-2); }
.endpoint-meta code { font-size: 12.5px; }
.hero-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 0; }
.hero-demo { align-self: stretch; display: flex; align-items: center; }
.chat { width: 100%; display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 20px; background: var(--glass); border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%); box-shadow: 0 20px 40px -24px rgba(25, 60, 120, .25); }
.bubble { max-width: 92%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.bubble .who { display: block; font-size: 12px; font-weight: 600; color: var(--mute); margin-bottom: 2px; }
.bubble-you { align-self: flex-end; border-bottom-right-radius: 6px; background: var(--ink); color: var(--paper); }
.bubble-you .who { color: color-mix(in srgb, var(--paper) 65%, transparent); }
.bubble-agent { border-bottom-left-radius: 6px; }
.call { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--rule); font-size: 12.5px; box-shadow: var(--shadow); }
.call-dot { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: 12px; }
.call code { color: var(--mute); font-size: 12.5px; background: none; border: 0; padding: 0; }
.call .call-tool { color: var(--ink); font-weight: 500; }
.home-sec { margin-top: 64px; }
.home-sec h2 { font-size: clamp(26px, 3vw, 32px); line-height: 1.2; margin: 0 0 8px; }
.sec-lead { margin: 0 0 22px; color: var(--mute); font-size: 16px; }
.prose .steps, .prose .cards, .prose .tool-cards { padding-left: 0; }
.prose .steps > li, .prose .cards > li, .prose .tool-cards > li { margin: 0; }
.steps { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 14px; }
.step { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 18px; padding: 22px 24px; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); }
.step-n { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--rule); font: 600 16px var(--f-display); color: var(--ink); }
.step h3 { margin: 5px 0 6px; font: 500 20px/1.3 var(--f-display); letter-spacing: -.01em; }
.step p { margin: 0 0 12px; color: var(--ink-2); max-width: 44rem; }
.step .code, .step .tabs { margin: 12px 0 10px; }
.step code { font-size: .86em; }
.step p code { padding: .12em .4em; border-radius: 5px; background: var(--paper-2); border: 1px solid var(--rule); }
.more { margin: 0 !important; font-size: 14.5px; }
.more a { font-weight: 500; }
.prompt { display: flex; align-items: center; gap: 12px; margin: 12px 0 0; padding: 12px 8px 12px 16px; border-radius: 14px; background: var(--ink); color: var(--paper); font-size: 15px; }
.prompt > .i { font-size: 20px; opacity: .7; }
.prompt-t { flex: 1; min-width: 0; }
.prompt .copy { color: color-mix(in srgb, var(--paper) 75%, transparent); }
.prompt .copy:hover { background: color-mix(in srgb, var(--paper) 12%, transparent); color: var(--paper); }
.prompt .copy.is-done { color: #7FD3A8; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px; border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); color: var(--ink); text-decoration: none;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.card:hover { border-color: var(--rule-strong); box-shadow: var(--shadow); }
.card:hover .card-t { color: var(--brand-ink); }
.card-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; margin-bottom: 8px; border-radius: 10px; background: var(--paper-2); color: var(--ink); font-size: 21px; }
.card-t { font: 500 17px/1.3 var(--f-display); letter-spacing: -.01em; }
.card-d { font-size: 14px; line-height: 1.5; color: var(--mute); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; font-size: 12.5px; color: var(--mute); }
.card-meta span { padding: 2px 8px; border-radius: 999px; background: var(--paper-2); }

/* 404 + chooser */
.notfound { padding: 40px 0; }
.nf-code { margin: 0 0 8px; font: 500 88px/1 var(--f-display); letter-spacing: -.04em; background: linear-gradient(135deg, var(--brand) 0%, var(--sky) 50%, var(--coral) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.choose { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--mesh); }
.choose-card { width: min(440px, 100%); padding: 36px 32px; border-radius: 24px; background: var(--glass); border: 1px solid var(--glass-border); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); text-align: center; }
.choose-card .wordmark { height: 24px; margin: 0 auto 18px; color: var(--ink); }
.choose-card h1 { margin: 0 0 8px; font: 500 34px/1.1 var(--f-display); letter-spacing: -.03em; }
.choose-card p { color: var(--ink-2); }
.choose-btns { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 22px 0 0; }

/* ── Footer ── */
.foot { border-top: 1px solid var(--rule); background: var(--paper); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; max-width: 1560px; margin: 0 auto; padding: 40px 20px 20px; }
.foot-brand { max-width: 360px; }
.foot-logo { display: inline-block; color: var(--ink); }
.foot-logo .wordmark { height: 20px; }
.foot-brand p { margin: 12px 0 0; font-size: 14px; color: var(--mute); }
.foot-links { display: flex; flex-wrap: wrap; gap: 20px 56px; }
.foot-links ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.foot-links a { color: var(--ink-2); text-decoration: none; }
.foot-links a:hover { color: var(--ink); text-decoration: underline; }
.foot-copy { max-width: 1560px; margin: 0 auto; padding: 16px 20px 32px; font-size: 13px; color: var(--mute); }

/* ── Search dialog ── */
.search-dlg { width: min(640px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 80px)); margin: 10vh auto 0; padding: 0; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 64px -16px rgba(0, 0, 0, .35); }
.search-dlg::backdrop { background: rgba(20, 20, 22, .35); backdrop-filter: blur(2px); }
.s-box { display: flex; flex-direction: column; max-height: inherit; }
.s-field { position: relative; display: flex; align-items: center; gap: 8px; padding: 12px; border-bottom: 1px solid var(--rule); }
.s-field > .i { position: absolute; left: 24px; color: var(--mute); font-size: 18px; }
.s-field input { border-color: transparent; background: var(--paper); font-size: 16px; }
.s-field input:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.s-close { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 8px; border: 0; background: none; color: var(--mute); font: 500 13px var(--f-body); cursor: pointer; }
.s-close kbd { display: none; }
.s-results { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.s-results a { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.s-results [aria-selected="true"] a { background: var(--brand-soft); }
.s-kind { grid-row: span 2; align-self: start; margin-top: 2px; padding: 1px 8px; border-radius: 999px; background: var(--paper-2); color: var(--mute); font-size: 11.5px; font-weight: 500; }
.s-title { font-weight: 500; overflow-wrap: anywhere; }
.s-title code { font-size: .92em; }
.s-sub { color: var(--mute); font-weight: 400; }
.s-x { font-size: 13px; color: var(--mute); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.s-results mark { background: color-mix(in srgb, var(--brand) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.s-hint { padding: 16px 12px; color: var(--mute); font-size: 14px; }

/* ── Responsive ── */
@media (max-width: 1279px) {
  .shell.has-toc { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .toc { display: none; }
  .toc-inline { display: block; }
}
@media (max-width: 1100px) {
  .hide-md { display: none !important; }
  .hero { grid-template-columns: 1fr; }
  .hero-demo { max-width: 520px; }
}
@media (max-width: 960px) {
  :root { --top-h: 56px; }
  .shell, .shell.has-toc { grid-template-columns: minmax(0, 1fr); }
  .js .sidenav { position: fixed; top: var(--top-h); left: 0; bottom: 0; z-index: 35; width: min(320px, 86vw); height: auto;
    transform: translateX(-102%); visibility: hidden; transition: transform .25s var(--ease), visibility 0s linear .25s; box-shadow: 0 10px 40px rgba(0, 0, 0, .18); }
  .js body.nav-open .sidenav { transform: none; visibility: visible; transition: transform .25s var(--ease); }
  .js body.nav-open::after { content: ''; position: fixed; inset: var(--top-h) 0 0; z-index: 30; background: rgba(20, 20, 22, .3); }
  html:not(.js) .sidenav { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--rule); }
  main { padding: 28px 20px 56px; }
  .top-in { padding: 0 12px 0 16px; gap: 8px; }
  .search-btn { width: auto; flex: 1; max-width: 260px; }
  .brand-docs { display: none; }
}
@media (max-width: 640px) {
  .hide-sm { display: none !important; }
  main { padding: 24px 16px 48px; }
  .search-btn { flex: 0 0 auto; width: 40px; height: 40px; padding: 0; justify-content: center; border-color: transparent; background: none; color: var(--ink); }
  .search-btn .i { font-size: 21px; }
  .search-btn-text, .search-btn kbd { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .prose h2 { font-size: 23px; margin-top: 44px; }
  .hero { padding: 24px 18px; border-radius: 20px; }
  .hero .lead { font-size: 16.5px; }
  .chat { padding: 14px; }
  .step { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 18px 16px; }
  .step-n { width: 32px; height: 32px; font-size: 15px; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { grid-column: 1; }
  .facts dt { min-width: 0; }
  .code pre { font-size: 13px; }
  .table-wrap th, .table-wrap td { padding: 9px 11px; }
}
@media (max-width: 400px) {
  .brand-product { font-size: 16px; padding-left: 8px; }
  .wordmark { height: 17px; }
  .top-link.lang span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
@media print {
  .top, .sidenav, .toc, .toc-inline, .foot, .pager, .copy { display: none !important; }
  .shell, .shell.has-toc { display: block; }
}
