@font-face { font-family: "Sora"; src: url("sora-semibold.ttf") format("truetype"); font-weight: 600; font-display: swap; }

/* ---------- tokens ---------- */
:root {
  --bg: #ffffff; --bg-soft: #f7f8fb; --surface: #ffffff; --surface-2: #f3f5f9;
  --text: #121826; --text-2: #3a4356; --muted: #667085; --border: #e4e7ee; --border-strong: #cfd5e1;
  --accent: #4f46e5; --accent-2: #4338ca; --accent-soft: #eef0ff; --accent-line: #c7cbff;
  --code-bg: #0e1424; --code-text: #e6e9f2; --code-muted: #8b94ad; --inline-code: #f0f2f7; --inline-code-text: #2b3245;
  --header: #0b1120; --header-line: #1d2742;
  --warn: #b54708; --warn-soft: #fffaeb; --warn-line: #fedf89;
  --ok: #067647; --ok-soft: #ecfdf3; --ok-line: #abefc6;
  --danger: #b42318; --danger-soft: #fef3f2;
  --sev-critical: #9f1239; --sev-critical-bg: #ffe4e8; --sev-high: #b93815; --sev-high-bg: #ffead5;
  --sev-medium: #915b00; --sev-medium-bg: #fef4c7; --sev-low: #175cd3; --sev-low-bg: #e0ecff; --sev-info: #475467; --sev-info-bg: #eef0f4;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.14);
  --radius: 10px; --radius-sm: 6px; --sidebar: 280px; --toc: 232px; --topbar: 60px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --display: Sora, var(--font);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1020; --bg-soft: #0e1428; --surface: #121a2e; --surface-2: #172036;
    --text: #e8ebf4; --text-2: #c3c9d8; --muted: #949db3; --border: #232d45; --border-strong: #33405e;
    --accent: #9a94ff; --accent-2: #b4afff; --accent-soft: #1c2045; --accent-line: #3b3f80;
    --code-bg: #070b16; --inline-code: #1b2440; --inline-code-text: #dfe4f2;
    --warn: #f5b04c; --warn-soft: #2a2110; --warn-line: #5c4313;
    --ok: #5fd39f; --ok-soft: #0f2a1d; --ok-line: #1e5a3d;
    --danger: #ff8a80; --danger-soft: #2d1414;
    --sev-critical: #ffb3c1; --sev-critical-bg: #4a1424; --sev-high: #ffc49b; --sev-high-bg: #4a2410;
    --sev-medium: #f8dc7a; --sev-medium-bg: #3e3210; --sev-low: #a6c8ff; --sev-low-bg: #142a4d; --sev-info: #c3c9d8; --sev-info-bg: #232b40;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 16px 40px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  --bg: #0b1020; --bg-soft: #0e1428; --surface: #121a2e; --surface-2: #172036;
  --text: #e8ebf4; --text-2: #c3c9d8; --muted: #949db3; --border: #232d45; --border-strong: #33405e;
  --accent: #9a94ff; --accent-2: #b4afff; --accent-soft: #1c2045; --accent-line: #3b3f80;
  --code-bg: #070b16; --inline-code: #1b2440; --inline-code-text: #dfe4f2;
  --warn: #f5b04c; --warn-soft: #2a2110; --warn-line: #5c4313;
  --ok: #5fd39f; --ok-soft: #0f2a1d; --ok-line: #1e5a3d;
  --danger: #ff8a80; --danger-soft: #2d1414;
  --sev-critical: #ffb3c1; --sev-critical-bg: #4a1424; --sev-high: #ffc49b; --sev-high-bg: #4a2410;
  --sev-medium: #f8dc7a; --sev-medium-bg: #3e3210; --sev-low: #a6c8ff; --sev-low-bg: #142a4d; --sev-info: #c3c9d8; --sev-info-bg: #232b40;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 16px 40px rgba(0,0,0,.5);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--topbar) + 20px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.7 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
svg.i { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
img { max-width: 100%; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--surface); color: var(--text); padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 8px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; height: var(--topbar); padding: 0 20px; background: var(--header); color: #fff; border-bottom: 1px solid var(--header-line); }
.topbar .brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; flex: none; }
.topbar .brand img { height: 22px; width: auto; display: block; }
.topbar .brand span { font: 600 14px/1 var(--display); color: #c9cff5; padding: 4px 8px; border: 1px solid #2e3a63; border-radius: 999px; }
.toplinks { display: flex; gap: 4px; margin-left: 12px; }
.toplinks a { color: #c4cadb; text-decoration: none; font-size: 14px; padding: 6px 10px; border-radius: 6px; }
.toplinks a:hover { color: #fff; background: #18213a; }
.search { position: relative; margin-left: auto; width: min(400px, 40vw); }
.search > svg.i { position: absolute; left: 11px; top: 9px; color: #8a94b2; pointer-events: none; }
.search input { width: 100%; height: 36px; border-radius: 8px; border: 1px solid #27314f; background: #141c32; color: #fff; padding: 0 34px 0 36px; font: inherit; font-size: 14px; }
.search input:focus { outline: none; border-color: #6e67ff; box-shadow: 0 0 0 3px rgba(110,103,255,.3); }
.search input::placeholder { color: #8a94b2; }
.search input::-webkit-search-cancel-button { display: none; }
.search .hint { position: absolute; right: 9px; top: 8px; background: #1d2742; border-color: #33405e; color: #a9b1c9; line-height: 18px; }
.results { position: absolute; top: 44px; left: 0; width: max(100%, 440px); max-height: 70vh; overflow: auto; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); display: none; padding: 6px; }
.results.open { display: block; }
.results a { display: block; padding: 9px 12px; text-decoration: none; color: var(--text); border-radius: 6px; font-weight: 600; font-size: 14.5px; }
.results a.sub { font-weight: 500; padding-left: 28px; position: relative; }
.results a.sub::before { content: "#"; position: absolute; left: 12px; color: var(--muted); }
.results a:hover, .results a.active { background: var(--accent-soft); }
.results small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; }
.results .snip { display: block; color: var(--text-2); font-weight: 400; font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results mark { background: transparent; color: var(--accent); font-weight: 700; }
.results .none { padding: 12px 14px; color: var(--muted); }
.toplink-ext { display: inline-flex; align-items: center; gap: 6px; color: #fff; text-decoration: none; font-size: 14px; font-weight: 600; background: #4f46e5; padding: 7px 12px; border-radius: 8px; flex: none; }
.toplink-ext:hover { background: #4338ca; color: #fff; }
.toplink-ext svg.i { width: 15px; height: 15px; }
.iconbtn { display: inline-grid; place-items: center; background: none; border: 1px solid #27314f; color: #dfe3ee; border-radius: 8px; height: 36px; width: 36px; cursor: pointer; flex: none; }
.iconbtn:hover { background: #18213a; }
.menu { display: none; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--toc); max-width: 1480px; margin: 0 auto; }
body.wide .layout, body.home .layout { grid-template-columns: var(--sidebar) minmax(0, 1fr); }
body.wide .toc, body.home .toc { display: none; }
.sidebar { position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow: auto; padding: 22px 14px 48px 18px; border-right: 1px solid var(--border); background: var(--bg-soft); scrollbar-width: thin; }
.navgroup { margin-bottom: 18px; }
.sidebar h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding: 0 10px; font: 600 12px/1.4 var(--display); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.sidebar h4 svg.i { width: 15px; height: 15px; color: var(--accent); }
.sidebar a { display: block; padding: 5px 10px 5px 33px; border-radius: 6px; color: var(--text-2); text-decoration: none; font-size: 14.5px; line-height: 1.45; border-left: 2px solid transparent; }
.sidebar a:hover { background: var(--surface-2); color: var(--text); }
.sidebar a.current { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
main { padding: 28px 56px 64px; min-width: 0; }
article { max-width: 820px; }
body.home article, body.wide article { max-width: 1040px; }

/* breadcrumbs */
.crumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; font-size: 13px; color: var(--muted); }
.crumb li { display: flex; align-items: center; gap: 6px; }
.crumb li + li::before { content: "/"; color: var(--border-strong); }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); }
.crumb li[aria-current] { color: var(--text-2); }

/* ---------- typography ---------- */
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.25; letter-spacing: -.01em; color: var(--text); }
h1 { font-size: 34px; margin: 0 0 10px; letter-spacing: -.02em; }
.lede { font-size: 18.5px; line-height: 1.6; color: var(--text-2); margin: 0 0 18px; max-width: 70ch; }
h2 { font-size: 23px; margin: 52px 0 12px; }
h3 { font-size: 17.5px; margin: 32px 0 8px; }
h4 { font-size: 15px; margin: 22px 0 6px; }
h2 .anchor, h3 .anchor { opacity: 0; margin-left: 8px; text-decoration: none; color: var(--muted); font-weight: 400; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }
p, li, dd { max-width: 76ch; }
p { margin: 0 0 14px; }
ul, ol { padding-left: 24px; margin: 0 0 16px; }
li { margin: 5px 0; }
li > ul, li > ol { margin: 6px 0; }
strong, b { font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0; }
code { font: 13.5px/1.5 var(--mono); background: var(--inline-code); color: var(--inline-code-text); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border); overflow-wrap: anywhere; }
pre { position: relative; background: var(--code-bg); color: var(--code-text); padding: 18px 20px; border-radius: var(--radius); overflow: auto; margin: 14px 0 22px; font-size: 13.5px; line-height: 1.6; border: 1px solid #1c2440; }
pre code { background: none; padding: 0; color: inherit; border: 0; font-size: inherit; overflow-wrap: normal; }
pre .copy { position: absolute; top: 8px; right: 8px; background: #1f2840; color: #dfe3ee; border: 1px solid #2c3757; border-radius: 6px; padding: 3px 10px; font: 12px/1.6 var(--font); cursor: pointer; opacity: .85; }
pre .copy:hover { opacity: 1; background: #2a3555; }
pre[data-label] { padding-top: 40px; }
pre[data-label]::before { content: attr(data-label); position: absolute; top: 0; left: 0; right: 0; padding: 7px 20px; font: 600 12px/1.4 var(--font); color: var(--code-muted); border-bottom: 1px solid #1c2440; letter-spacing: .02em; }
.kbd { display: inline-block; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; font: 12px/20px var(--mono); background: var(--surface); color: var(--text-2); }

/* page header + meta strip */
.pagehead { padding-bottom: 20px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
dl.meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 4px 0 0; font-size: 13px; color: var(--muted); }
dl.meta > div { display: flex; align-items: center; gap: 6px; }
dl.meta svg.i { width: 15px; height: 15px; color: var(--muted); }
dl.meta dt { font-weight: 600; color: var(--text-2); }
dl.meta dt::after { content: ":"; }
dl.meta dd { margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
dl.meta code { font-size: 12px; padding: 0 5px; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; margin: 14px 0 24px; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; line-height: 1.55; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child > td { border-bottom: 0; }
th { background: var(--surface-2); font-weight: 600; font-size: 13px; color: var(--text-2); white-space: nowrap; }
td code { white-space: nowrap; }
td.wrap code { white-space: normal; }
tbody tr:hover td, table tr:hover td { background: color-mix(in srgb, var(--accent-soft) 35%, transparent); }

/* ---------- callouts ---------- */
.callout { position: relative; border: 1px solid var(--accent-line); background: var(--accent-soft); padding: 12px 16px 12px 46px; border-radius: var(--radius); margin: 20px 0; }
.callout .callout-ico { position: absolute; left: 15px; top: 14px; width: 19px; height: 19px; color: var(--accent); }
.callout.warn { border-color: var(--warn-line); background: var(--warn-soft); }
.callout.warn .callout-ico { color: var(--warn); }
.callout.ok { border-color: var(--ok-line); background: var(--ok-soft); }
.callout.ok .callout-ico { color: var(--ok); }
.callout p { margin: 4px 0; }
.callout ul { margin: 6px 0; }
.callout > b:first-of-type, .callout .title { display: block; margin-bottom: 2px; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 18px 0 24px; }
.cards a, .cards > div { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 16px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: border-color .15s, transform .15s, box-shadow .15s; }
.cards a:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); transform: translateY(-1px); color: var(--text); }
.cards b { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 600; margin-bottom: 6px; color: var(--text); font-size: 15.5px; }
.cards b svg.i { color: var(--accent); width: 20px; height: 20px; }
.cards span { display: block; color: var(--muted); font-size: 14px; line-height: 1.55; }
.cards.two { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

/* ---------- steps ---------- */
ol.steps { counter-reset: s; list-style: none; padding-left: 0; margin: 16px 0 24px; }
ol.steps > li { counter-increment: s; position: relative; padding: 0 0 18px 46px; margin: 0; max-width: 80ch; }
ol.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); font: 600 13px/26px var(--display); text-align: center; }
ol.steps > li::after { content: ""; position: absolute; left: 14px; top: 32px; bottom: 4px; width: 1px; background: var(--border); }
ol.steps > li:last-child::after { display: none; }
ol.steps > li > pre { margin: 10px 0 4px; }

/* ---------- badges and pills ---------- */
.pill { display: inline-block; font: 600 12px/1 var(--font); padding: 4px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; vertical-align: 1px; }
.pill.critical { background: var(--sev-critical-bg); color: var(--sev-critical); border-color: transparent; }
.pill.high { background: var(--sev-high-bg); color: var(--sev-high); border-color: transparent; }
.pill.medium { background: var(--sev-medium-bg); color: var(--sev-medium); border-color: transparent; }
.pill.low { background: var(--sev-low-bg); color: var(--sev-low); border-color: transparent; }
.pill.info { background: var(--sev-info-bg); color: var(--sev-info); border-color: transparent; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.pill.accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.method { display: inline-block; min-width: 46px; text-align: center; font: 700 11.5px/1 var(--mono); padding: 4px 6px; border-radius: 5px; margin-right: 6px; vertical-align: 1px; }
.method.get { background: var(--ok-soft); color: var(--ok); }
.method.post { background: var(--accent-soft); color: var(--accent); }

/* ---------- lifecycle flows (accessible ordered lists) ---------- */
ol.flow { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 0; padding: 0; margin: 18px 0 24px; counter-reset: f; }
ol.flow > li { position: relative; flex: 1 1 140px; min-width: 130px; margin: 0; padding: 12px 22px 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); font-size: 13.5px; line-height: 1.45; max-width: none; counter-increment: f; }
ol.flow > li + li { margin-left: 18px; }
ol.flow > li + li::before { content: ""; position: absolute; left: -17px; top: 50%; width: 14px; height: 2px; background: var(--border-strong); }
ol.flow > li + li::after { content: ""; position: absolute; left: -7px; top: calc(50% - 4px); border: 5px solid transparent; border-left-color: var(--border-strong); border-right: 0; }
ol.flow b { display: block; font: 600 14px/1.3 var(--display); margin-bottom: 3px; color: var(--text); }
ol.flow b::before { content: counter(f) ". "; color: var(--accent); }
ol.flow span { color: var(--muted); display: block; }
ol.flow li.end { border-color: var(--ok-line); background: var(--ok-soft); }
ol.flow li.alt { border-style: dashed; }
.flowcap { font-size: 13px; color: var(--muted); margin-top: -14px; }
figure.diagram { margin: 18px 0 26px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow-x: auto; }
figure.diagram svg { display: block; width: 100%; height: auto; min-width: 560px; font-family: var(--font); }
figure.diagram figcaption { font-size: 13px; color: var(--muted); margin-top: 10px; }
.dg-box { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1.2; }
.dg-box.cust { fill: var(--accent-soft); stroke: var(--accent-line); }
.dg-box.pts { fill: var(--warn-soft); stroke: var(--warn-line); }
.dg-box.done { fill: var(--ok-soft); stroke: var(--ok-line); }
.dg-t { fill: var(--text); font-size: 14px; font-weight: 600; }
.dg-s { fill: var(--muted); font-size: 12px; }
.dg-line { stroke: var(--border-strong); stroke-width: 1.5; fill: none; }
.dg-line.back { stroke-dasharray: 4 4; }
.dg-arrow { fill: var(--border-strong); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.legend span::before { content: ""; display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; border: 1px solid var(--border-strong); background: var(--surface-2); }
.legend .cust::before { background: var(--accent-soft); border-color: var(--accent-line); }
.legend .pts::before { background: var(--warn-soft); border-color: var(--warn-line); }
.legend .done::before { background: var(--ok-soft); border-color: var(--ok-line); }

/* ---------- definition lists for fields ---------- */
dl.fields { margin: 14px 0 24px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
dl.fields > div { display: grid; grid-template-columns: minmax(150px, 30%) 1fr; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
dl.fields > div:last-child { border-bottom: 0; }
dl.fields dt { font-weight: 600; font-size: 14.5px; }
dl.fields dd { margin: 0; font-size: 14.5px; color: var(--text-2); }

/* ---------- code tabs (enhanced by docs.js) ---------- */
.codetabs { margin: 14px 0 22px; }
.codetabs .tabbar { display: flex; gap: 2px; background: var(--code-bg); border: 1px solid #1c2440; border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; padding: 6px 6px 0; }
.codetabs .tabbar button { background: none; border: 0; color: var(--code-muted); font: 600 12.5px/1 var(--font); padding: 9px 12px; border-radius: 6px 6px 0 0; cursor: pointer; }
.codetabs .tabbar button[aria-selected="true"] { color: #fff; background: #1a2240; }
.codetabs.ready pre { margin: 0; border-radius: 0 0 var(--radius) var(--radius); }
.codetabs.ready pre[data-label] { padding-top: 18px; }
.codetabs.ready pre[data-label]::before { display: none; }
.codetabs.ready pre[hidden] { display: none; }

/* ---------- FAQ / details ---------- */
details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin: 10px 0; box-shadow: var(--shadow); }
details > summary { cursor: pointer; padding: 13px 44px 13px 16px; font-weight: 600; list-style: none; position: relative; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: ""; position: absolute; right: 18px; top: 19px; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
details[open] > summary::after { transform: rotate(-135deg); top: 22px; }
details > div { padding: 0 16px 12px; border-top: 1px solid var(--border); padding-top: 12px; }
details > div > :last-child { margin-bottom: 0; }

/* ---------- home ---------- */
.hero { position: relative; overflow: hidden; margin: -28px -56px 32px; padding: 56px 56px 48px; background: radial-gradient(1200px 400px at 85% -10%, rgba(99,91,255,.35), transparent 60%), linear-gradient(180deg, #0b1120, #111a33); color: #fff; border-bottom: 1px solid var(--header-line); }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 600 12.5px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: #b9b5ff; background: rgba(110,103,255,.15); border: 1px solid rgba(154,148,255,.35); padding: 6px 10px; border-radius: 999px; }
.hero h1 { color: #fff; font-size: 42px; margin: 18px 0 12px; max-width: 18ch; }
.hero p { color: #c8cee0; font-size: 18.5px; max-width: 62ch; margin: 0 0 24px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: 15px; text-decoration: none; border: 1px solid transparent; }
.btn.primary { background: #4f46e5; color: #fff; }
.btn.primary:hover { background: #4338ca; color: #fff; }
.btn.ghost { color: #e6e9f5; border-color: #34406a; background: rgba(255,255,255,.04); }
.btn.ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.hero .endpoints { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 28px; font-size: 13px; color: #9aa4c2; }
.hero .endpoints code { background: rgba(255,255,255,.06); border-color: #2a3558; color: #dfe3f3; }
.sectionhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 40px 0 4px; }
.sectionhead h2 { margin: 0; }
.sectionhead p { margin: 0; color: var(--muted); font-size: 14.5px; }
.persona b { margin-bottom: 4px; }
.persona em { display: block; font-style: normal; font-size: 12.5px; color: var(--accent); font-weight: 600; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .05em; }
.tasklist { list-style: none; padding: 0; margin: 14px 0 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 28px; }
.tasklist li { margin: 0; max-width: none; border-bottom: 1px solid var(--border); }
.tasklist a { display: flex; align-items: center; gap: 10px; padding: 11px 2px; text-decoration: none; color: var(--text); }
.tasklist a:hover { color: var(--accent); }
.tasklist a svg.i { color: var(--muted); width: 16px; height: 16px; margin-left: auto; }
.tasklist a:hover svg.i { color: var(--accent); }

/* ---------- table of contents ---------- */
.toc { position: sticky; top: var(--topbar); align-self: start; max-height: calc(100vh - var(--topbar)); overflow: auto; padding: 32px 18px 32px 8px; font-size: 13.5px; }
.toc b { display: block; color: var(--text-2); font: 600 12px/1.4 var(--display); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 10px; }
.toc nav { border-left: 1px solid var(--border); }
.toc nav a { display: block; color: var(--muted); text-decoration: none; padding: 4px 0 4px 14px; margin-left: -1px; border-left: 2px solid transparent; line-height: 1.4; }
.toc nav a:hover { color: var(--text); }
.toc nav a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.toc .totop { display: inline-block; margin-top: 14px; color: var(--muted); font-size: 12.5px; text-decoration: none; }
.toc .totop:hover { color: var(--accent); }

/* ---------- pager + footer ---------- */
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; }
.pager a { flex: 1 1 0; max-width: 48%; text-decoration: none; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; background: var(--surface); font-weight: 600; color: var(--text); box-shadow: var(--shadow); }
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pager small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; }
.pager a.prev small::before { content: "\2190  "; }
.pager a.next { text-align: right; margin-left: auto; }
.pager a.next small::after { content: "  \2192"; }
.sitefoot { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; max-width: 1040px; }
.footcols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 18px; }
.footcols b { display: block; color: var(--text-2); font-family: var(--display); margin-bottom: 6px; font-size: 13px; }
.footcols a { display: block; color: var(--muted); text-decoration: none; padding: 2px 0; }
.footcols a:hover { color: var(--accent); }
.sitefoot code { font-size: 12px; }

/* ---------- responsive ---------- */
@media (max-width: 1240px) { .layout { grid-template-columns: var(--sidebar) minmax(0, 1fr); } .toc { display: none; } .toplinks { display: none; } }
@media (max-width: 900px) {
  .layout, body.wide .layout, body.home .layout { grid-template-columns: 1fr; }
  .menu { display: inline-grid; }
  .sidebar { position: fixed; left: 0; top: var(--topbar); width: 300px; max-width: 86vw; background: var(--surface); z-index: 25; transform: translateX(-105%); transition: transform .2s ease; box-shadow: none; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .scrim { display: none; position: fixed; inset: var(--topbar) 0 0 0; background: rgba(5,8,18,.5); z-index: 24; }
  body.nav-open .scrim { display: block; }
  main { padding: 22px 18px 56px; }
  .hero { margin: -22px -18px 28px; padding: 40px 18px 34px; }
  .toplink-ext { display: none; }
}
@media (max-width: 600px) {
  .topbar { gap: 8px; padding: 0 10px; }
  .topbar .brand img { height: 18px; }
  .topbar .brand span { display: none; }
  .search { width: auto; flex: 1; }
  .search .hint { display: none; }
  .search input { padding-right: 10px; }
  .results { position: fixed; left: 8px; right: 8px; top: calc(var(--topbar) - 4px); width: auto; }
  h1 { font-size: 27px; }
  .hero h1 { font-size: 31px; }
  .lede, .hero p { font-size: 16.5px; }
  h2 { font-size: 21px; margin-top: 42px; }
  ol.flow { flex-direction: column; gap: 14px; }
  ol.flow > li { flex: none; }
  ol.flow > li + li { margin-left: 0; }
  pre:not([data-label]), .codetabs.ready pre[data-label] { padding-top: 40px; }
  ol.flow > li + li::before { left: 22px; top: -13px; width: 2px; height: 10px; }
  ol.flow > li + li::after { left: 18px; top: -5px; border: 5px solid transparent; border-top-color: var(--border-strong); border-bottom: 0; }
  dl.fields > div { grid-template-columns: 1fr; gap: 2px; }
  .footcols { grid-template-columns: 1fr 1fr; }
  .pager { flex-direction: column; }
  .pager a { max-width: none; }
  .tablewrap table { min-width: 600px; }
  td code { overflow-wrap: normal; }
}

/* ---------- print ---------- */
@media print {
  :root { --bg: #fff; --text: #000; --text-2: #222; --muted: #444; --border: #bbb; --surface: #fff; --surface-2: #f2f2f2; --code-bg: #f6f6f6; --code-text: #000; --accent: #1a1a8c; --accent-soft: #f3f3ff; }
  body { font-size: 11pt; background: #fff; color: #000; }
  .topbar, .sidebar, .toc, .pager, .scrim, .skip, pre .copy, .anchor, .codetabs .tabbar, .crumb, .sitefoot .footcols, .hero .actions { display: none !important; }
  .layout, body.wide .layout, body.home .layout { display: block; }
  main { padding: 0; }
  article { max-width: none; }
  .hero { margin: 0 0 16px; padding: 0; background: none; color: #000; border: 0; }
  .hero h1, .hero p { color: #000; }
  pre { border: 1px solid #bbb; white-space: pre-wrap; word-break: break-word; }
  .codetabs.ready pre[hidden] { display: block; }
  a { color: #000; }
  article a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #444; }
  h2, h3 { break-after: avoid; }
  table, pre, .callout, ol.flow, figure, details { break-inside: avoid; }
  .tablewrap, .cards a, details, ol.flow > li, figure.diagram { box-shadow: none; }
  details > div { display: block; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
