/* docs.babbit.dev: babbit.dev's tokens (site/styles/tokens.css), sized for reading rather than for selling. */

@font-face { font-family: Geist; src: url("/assets/fonts/geist-latin.woff2") format("woff2"); font-style: normal; font-weight: 100 900; font-display: swap; }

:root {
  --bg: #f4f5f6;
  --surface: #fcfcfd;
  --surface-2: #f8f9fa;
  --surface-3: #edeff1;
  --line: #dfe3e7;
  --line-strong: #aeb7bf;
  --ink: #22272b;
  --ink-2: #576068;
  --ink-3: #626a71;
  --ink-4: #c2c8ce;
  --accent: #a74825;
  --accent-ink: #fcfcfd;
  --accent-tint: #f4e7df;
  --clay: #a74825;
  --pass: #236542;
  --pass-tint: #e8f1ec;
  --fail: #9b3933;
  --fail-tint: #f7e9e7;
  --warn: #805710;
  --warn-tint: #fbf3e3;
  --info: #2b5fa8;
  --info-tint: #e8effa;
  --mark: #f4e7df;
  --shade: 102 114 127;
  --sans: Geist, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --top: 64px;
  --side: 272px;
  --toc: 232px;
  --measure: 70ch;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151719;
    --surface: #202326;
    --surface-2: #1b1e20;
    --surface-3: #272b2e;
    --line: #363d43;
    --line-strong: #65707a;
    --ink: #f3f4f5;
    --ink-2: #b6bdc3;
    --ink-3: #a0a9b1;
    --ink-4: #42494f;
    --accent: #e69b7c;
    --accent-ink: #201810;
    --accent-tint: #3b2d27;
    --clay: #e69b7c;
    --pass: #95d3af;
    --pass-tint: #223a2c;
    --fail: #efaaa4;
    --fail-tint: #432e2b;
    --warn: #e6bd74;
    --warn-tint: #3a2e18;
    --info: #9dbcf2;
    --info-tint: #1d2a40;
    --mark: #3b2d27;
    --shade: 8 11 14;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151719;
  --surface: #202326;
  --surface-2: #1b1e20;
  --surface-3: #272b2e;
  --line: #363d43;
  --line-strong: #65707a;
  --ink: #f3f4f5;
  --ink-2: #b6bdc3;
  --ink-3: #a0a9b1;
  --ink-4: #42494f;
  --accent: #e69b7c;
  --accent-ink: #201810;
  --accent-tint: #3b2d27;
  --clay: #e69b7c;
  --pass: #95d3af;
  --pass-tint: #223a2c;
  --fail: #efaaa4;
  --fail-tint: #432e2b;
  --warn: #e6bd74;
  --warn-tint: #3a2e18;
  --info: #9dbcf2;
  --info-tint: #1d2a40;
  --mark: #3b2d27;
  --shade: 8 11 14;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--mark); color: var(--ink); }
svg { flex: none; }
a { color: inherit; }

/* Focus: crop marks, four corner ticks just outside what has focus (DESIGN.md › Materials). */
:focus { outline: none; }
:focus-visible {
  outline: none;
  border-radius: 3px;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--ink-3);
}
@supports (background: conic-gradient(red, red)) {
  a:focus-visible, button:focus-visible, [tabindex]:focus-visible, input:focus-visible { box-shadow: none; background-image:
    linear-gradient(var(--ink), var(--ink)), linear-gradient(var(--ink), var(--ink)), linear-gradient(var(--ink), var(--ink)), linear-gradient(var(--ink), var(--ink)),
    linear-gradient(var(--ink), var(--ink)), linear-gradient(var(--ink), var(--ink)), linear-gradient(var(--ink), var(--ink)), linear-gradient(var(--ink), var(--ink));
    background-repeat: no-repeat;
    background-size: 7px 1.5px, 1.5px 7px, 7px 1.5px, 1.5px 7px, 7px 1.5px, 1.5px 7px, 7px 1.5px, 1.5px 7px;
    background-position: left top, left top, right top, right top, left bottom, left bottom, right bottom, right bottom;
    outline: none; }
}

.skip { position: absolute; left: 12px; top: -48px; z-index: 50; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 4px; }
.skip:focus { top: 10px; }

.caps { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- Keys: what you press ---------- */
.key {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 34px; padding: 6px 13px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font: 500 14px/1.2 var(--sans); text-decoration: none; cursor: pointer;
  box-shadow: inset 0 -2px 0 var(--surface-3), 0 1px 0 rgb(var(--shade) / .06);
  transition: transform 60ms, box-shadow 60ms, border-color 120ms;
}
.key:hover { border-color: var(--ink-3); }
.key:active { transform: translateY(1px); box-shadow: inset 0 1px 2px rgb(var(--shade) / .14); }
.key-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); box-shadow: none; padding-inline: 18px; }
.key-primary:hover { border-color: var(--ink); color: var(--bg); background: color-mix(in srgb, var(--ink) 86%, var(--bg)); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid transparent; border-radius: 999px; background: none; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn svg, .key svg, .search-btn svg, .search-field svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Fields ---------- */
.field { border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 1px 2px rgb(var(--shade) / .06); }
kbd {
  display: inline-block; min-width: 20px; padding: 1px 5px; border: 1px solid var(--line-strong); border-radius: 3px;
  background: var(--surface); box-shadow: inset 0 -1px 0 var(--surface-3);
  font: 500 11.5px/1.5 var(--mono); color: var(--ink-2); text-align: center;
}

/* ---------- Top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  height: var(--top); padding: 0 20px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; width: calc(var(--side) - 34px); flex: none; color: var(--ink); }
.wordmark { width: 92px; height: auto; aspect-ratio: 1198 / 293; color: var(--ink); fill: currentColor; }
.brand-docs { font: 500 13px/1 var(--sans); color: var(--ink-3); padding-left: 10px; border-left: 1px solid var(--line-strong); }
.search-btn { display: flex; align-items: center; gap: 10px; width: min(440px, 100%); height: 36px; padding: 0 8px 0 11px; color: var(--ink-3); font: 14px var(--sans); cursor: pointer; text-align: left; }
.search-btn span { flex: 1; }
.search-btn:hover { border-color: var(--ink-3); }
.top-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.theme-toggle svg:last-child { display: none; }
:root[data-theme="dark"] .theme-toggle svg:first-child { display: none; }
:root[data-theme="dark"] .theme-toggle svg:last-child { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle svg:first-child { display: none; }
  :root:not([data-theme="light"]) .theme-toggle svg:last-child { display: block; }
}
.nav-toggle { display: none; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); max-width: 1480px; margin: 0 auto; }
.sidebar {
  position: sticky; top: var(--top); align-self: start;
  height: calc(100vh - var(--top)); overflow-y: auto; overscroll-behavior: contain;
  padding: 26px 18px 40px 22px; border-right: 1px solid var(--line);
}
.nav-group + .nav-group { margin-top: 26px; }
.nav-group .caps { padding: 0 10px 8px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a {
  position: relative; display: block; padding: 5px 10px; border-radius: 4px;
  color: var(--ink-2); font-size: 14.5px; line-height: 1.4; text-decoration: none;
}
.sidebar a:hover { background: var(--surface-3); color: var(--ink); }
.sidebar a[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.sidebar a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.scrim { display: none; }

.main { display: grid; grid-template-columns: minmax(0, 1fr) var(--toc); gap: 48px; padding: 44px 48px 96px 64px; min-width: 0; }
.main:not(:has(.toc)) { grid-template-columns: minmax(0, 1fr); }
.doc { min-width: 0; max-width: 780px; }
/* text keeps a reading measure; figures, tables and code may use the column */
.doc > :is(p, ul, ol, dl, blockquote, h2, h3, h4, hr, .callout, .doc-head, .cards) { max-width: var(--measure); }

/* ---------- On this page ---------- */
.toc { position: sticky; top: calc(var(--top) + 44px); align-self: start; max-height: calc(100vh - var(--top) - 88px); overflow-y: auto; padding-left: 16px; border-left: 1px solid var(--line); }
.toc .caps { margin-bottom: 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 4px 0; color: var(--ink-3); font-size: 13.5px; line-height: 1.4; text-decoration: none; }
.toc a:hover { color: var(--ink); }
.toc .toc-3 a { padding-left: 12px; font-size: 13px; }
.toc a.active { color: var(--ink); font-weight: 600; }
.toc a.active::before { content: ""; position: absolute; margin-left: -20px; margin-top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.toc .toc-3 a.active::before { margin-left: -32px; }

/* ---------- The document ---------- */
.doc-head { margin-bottom: 34px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.tape {
  display: inline-block; margin: 0 0 16px; padding: 3px 12px 3px 8px;
  background: var(--surface-3); color: var(--ink-2);
  font: 600 11px/1.6 var(--sans); letter-spacing: .07em; text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%);
}
.doc h1 { margin: 0; font-size: clamp(30px, 4vw, 38px); line-height: 1.15; letter-spacing: -.025em; font-weight: 700; text-wrap: balance; }
.lead { margin: 14px 0 0; font-size: 19px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.doc h2 { margin: 56px 0 14px; font-size: 25px; line-height: 1.25; letter-spacing: -.018em; font-weight: 650; text-wrap: balance; }
.doc h3 { margin: 36px 0 10px; font-size: 19px; line-height: 1.35; letter-spacing: -.01em; font-weight: 650; }
.doc h4 { margin: 28px 0 8px; font-size: 16px; font-weight: 650; }
.doc h2:first-child, .doc-head + h2 { margin-top: 0; }
.doc :is(h2, h3, h4, dt) { position: relative; scroll-margin-top: calc(var(--top) + 20px); }
.anchor { position: absolute; left: -1.1em; width: 1em; color: var(--ink-4); text-decoration: none; font-weight: 400; opacity: 0; transition: opacity 120ms; }
:is(h2, h3, h4, dt):hover .anchor, .anchor:focus { opacity: 1; }
.doc p, .doc li { text-wrap: pretty; }
.doc p { margin: 0 0 16px; }
.doc a { color: var(--ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--clay) 45%, transparent); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: text-decoration-color 120ms; }
.doc a:hover { color: var(--clay); text-decoration-color: var(--clay); }
.doc a.ext::after { content: "↗"; display: inline-block; margin-left: 2px; font-size: .8em; color: var(--ink-3); text-decoration: none; }
.doc strong { font-weight: 650; }
.doc :not(pre) > code {
  padding: 1px 5px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface);
  font: .86em/1.4 var(--mono); color: var(--ink); overflow-wrap: anywhere;
}
.doc ul, .doc ol { margin: 0 0 18px; padding-left: 22px; }
.doc li { margin: 6px 0; padding-left: 4px; }
.doc li > ul, .doc li > ol { margin: 6px 0; }
.doc li::marker { color: var(--ink-3); }
.doc hr { margin: 44px 0; border: 0; border-top: 1px solid var(--line); }
.doc blockquote { margin: 0 0 18px; padding: 2px 0 2px 18px; border-left: 2px solid var(--line-strong); color: var(--ink-2); }

/* Ordered lists are procedures: each step on a square numeral plate (a circle is a light). */
.doc ol.steps { list-style: none; padding-left: 0; counter-reset: step; }
.doc ol.steps > li { position: relative; counter-increment: step; margin: 0; padding: 2px 0 14px 44px; }
.doc ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 2px;
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 4px;
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: inset 0 -2px 0 var(--surface-3);
  font: 600 13px/1 var(--mono); color: var(--ink);
}
.doc ol.steps > li::after { content: ""; position: absolute; left: 13px; top: 32px; bottom: 4px; width: 1px; background: var(--line); }
.doc ol.steps > li:last-child { padding-bottom: 4px; }
.doc ol.steps > li:last-child::after { display: none; }
.doc ol.steps > li > p:last-child { margin-bottom: 0; }
.doc ol.steps ol.steps > li { padding-left: 38px; }
.doc ol.steps ol.steps > li::before { width: 22px; height: 22px; font-size: 12px; top: 3px; }
.doc ol.steps ol.steps > li::after { left: 11px; top: 30px; }

/* ---------- Callouts ---------- */
.callout { margin: 22px 0; padding: 14px 18px 2px; border: 1px solid var(--line); border-left: 3px solid var(--ink-3); border-radius: 0 6px 6px 0; background: var(--surface); }
.callout-title { display: flex; align-items: center; gap: 8px; margin: 0 0 6px !important; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.callout-title::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 16%, transparent); }
.callout > :last-child { margin-bottom: 14px; }
.callout p { font-size: 15.5px; }
.callout-tip { border-left-color: var(--pass); }
.callout-tip .callout-title { color: var(--pass); }
.callout-caution { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn-tint) 60%, var(--surface)); }
.callout-caution .callout-title { color: var(--warn); }
.callout-important { border-left-color: var(--fail); }
.callout-important .callout-title { color: var(--fail); }
.callout-note .callout-title { color: var(--info); }
.callout-note { border-left-color: var(--info); }
.callout-planned { border-style: dashed; border-left-style: solid; border-left-color: var(--ink-4); background: var(--surface-2); }
.callout-planned .callout-title { color: var(--ink-3); }
.callout-planned .callout-title::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }

/* Stamps: a verdict inked on the record. */
.stamp { display: inline-block; padding: 0 6px; border: 1px solid color-mix(in srgb, currentColor 45%, transparent); border-radius: 2px; background: color-mix(in srgb, currentColor 7%, transparent); font: 700 10.5px/1.7 var(--sans); letter-spacing: .07em; text-transform: uppercase; vertical-align: 2px; white-space: nowrap; }
.stamp-live { color: var(--pass); }
.stamp-planned { color: var(--ink-3); border-style: dashed; }
.stamp-owner { color: var(--info); }
/* Lights: state. */
.led { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--l, var(--pass)); vertical-align: 0; box-shadow: inset 0 -1px 1px rgb(0 0 0 / .2), 0 0 0 2px color-mix(in srgb, var(--l, var(--pass)) 16%, transparent); }
.led-pass { --l: var(--pass); }
.led-fail { --l: var(--fail); }
.led-warn { --l: var(--warn); }
.led-hollow { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-3); }

/* ---------- Tables ---------- */
.table { margin: 22px 0 26px; overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.doc table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.doc th { padding: 10px 14px; text-align: left; vertical-align: bottom; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.doc td { padding: 10px 14px; vertical-align: top; border-top: 1px solid var(--line); }
.doc tr:first-child td { border-top: 0; }
.doc td:first-child { font-weight: 550; }
.doc td code { white-space: nowrap; }
.doc .num { text-align: right; }

/* ---------- Code ---------- */
.code { position: relative; margin: 20px 0 24px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); overflow: hidden; }
.code-head { display: flex; align-items: center; justify-content: space-between; min-height: 36px; padding: 0 6px 0 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); font: 600 11px/1 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 13.5px/1.6 var(--mono); color: var(--ink); tab-size: 2; }
.copy { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border: 1px solid transparent; border-radius: 4px; background: none; color: var(--ink-3); font: 500 12px var(--sans); letter-spacing: 0; text-transform: none; cursor: pointer; }
.copy:hover { background: var(--surface-3); color: var(--ink); }
.code:not(:has(.code-head)) .copy { position: absolute; top: 6px; right: 6px; background: var(--surface); }
.copy[data-done] { color: var(--pass); }

/* ---------- Diagrams ---------- */
.diagram { margin: 28px 0 32px; padding: 22px 20px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.diagram svg { display: block; width: 100%; height: auto; overflow: visible; }
.diagram figcaption { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.5; color: var(--ink-3); }
.diagram .wide { min-width: 640px; }
.diagram:has(.wide) { overflow-x: auto; }
/* diagram parts, so a theme moves them */
.d-box { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 1; }
.d-box-strong { fill: var(--surface); stroke: var(--ink-3); stroke-width: 1.2; }
.d-box-ink { fill: var(--ink); stroke: var(--ink); }
.d-box-dash { fill: none; stroke: var(--ink-4); stroke-width: 1; stroke-dasharray: 4 4; }
.d-line { fill: none; stroke: var(--ink-3); stroke-width: 1.3; }
.d-line-soft { fill: none; stroke: var(--line-strong); stroke-width: 1.2; }
.d-line-dash { fill: none; stroke: var(--ink-4); stroke-width: 1.2; stroke-dasharray: 4 4; }
.d-head { fill: var(--ink-3); }
.d-t { fill: var(--ink); font: 600 13px var(--sans); }
.d-t-inv { fill: var(--bg); font: 600 13px var(--sans); }
.d-s { fill: var(--ink-3); font: 12px var(--sans); }
.d-m { fill: var(--ink-3); font: 11.5px var(--mono); }
.d-caps { fill: var(--ink-3); font: 650 10.5px var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.d-pass { fill: var(--pass); }
.d-fail { fill: var(--fail); }
.d-warn { fill: var(--warn); }
.d-accent { fill: var(--clay); }
.d-stroke-pass { stroke: var(--pass); }
.d-stroke-fail { stroke: var(--fail); }
.d-stroke-clay { stroke: var(--clay); stroke-width: 1.6; }
.d-tint-pass { fill: var(--pass-tint); stroke: color-mix(in srgb, var(--pass) 45%, transparent); }
.d-tint-fail { fill: var(--fail-tint); stroke: color-mix(in srgb, var(--fail) 45%, transparent); }
.d-tint-info { fill: var(--info-tint); stroke: color-mix(in srgb, var(--info) 45%, transparent); }

/* ---------- Home ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px; margin: 24px 0 34px; }
.card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); text-decoration: none !important; box-shadow: 0 1px 0 rgb(var(--shade) / .03); transition: border-color 120ms, transform 120ms; }
.card:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.card .caps { font-size: 10.5px; }
.card strong { font-size: 16.5px; font-weight: 650; letter-spacing: -.01em; }
.card span:last-child { color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }

/* ---------- Glossary ---------- */
.glossary { margin: 8px 0 0; }
.def { padding: 16px 0; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--top) + 20px); }
.def:target { background: linear-gradient(90deg, var(--mark), transparent 70%); margin: 0 -14px; padding: 16px 14px; }
.def dt { font-weight: 650; font-size: 16.5px; }
.def dd { margin: 4px 0 0; color: var(--ink-2); }

/* ---------- Pager and foot ---------- */
.doc-foot { margin-top: 64px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pager .key { border-radius: 16px; flex-direction: column; align-items: flex-start; gap: 4px; padding: 13px 16px 15px; text-decoration: none; }
.pager-next { align-items: flex-end !important; text-align: right; grid-column: 2; }
.pager-title { display: flex; align-items: center; gap: 8px; font-size: 15.5px; font-weight: 600; }
.updated { margin-top: 28px !important; font-size: 13.5px; color: var(--ink-3); }

/* ---------- Search ---------- */
.search { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgb(var(--shade) / .28); }
.search[hidden] { display: none; }
.search-panel { width: min(640px, 100%); max-height: 72vh; display: flex; flex-direction: column; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); box-shadow: 0 24px 64px rgb(var(--shade) / .28); overflow: hidden; }
.search-field { display: flex; align-items: center; gap: 10px; margin: 12px; padding: 0 10px 0 12px; height: 44px; color: var(--ink-3); background: var(--surface); }
.search-field input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--ink); font: 16px var(--sans); }
.search-field input:focus-visible { background: none; }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-results { list-style: none; margin: 0; padding: 0 8px 8px; overflow-y: auto; }
.search-results a { display: block; padding: 10px 12px; border-radius: 6px; text-decoration: none; }
.search-results a[aria-selected="true"] { background: var(--surface-3); }
.search-results .r-path { display: block; font-size: 12px; color: var(--ink-3); }
.search-results .r-head { display: block; margin-top: 1px; font-weight: 600; font-size: 15px; }
.search-results .r-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.search-results mark { background: var(--mark); color: inherit; border-radius: 2px; }
.search-empty { margin: 0; padding: 4px 24px 22px; color: var(--ink-3); font-size: 14px; }

/* ---------- Narrow windows ---------- */
@media (max-width: 1240px) {
  .main { grid-template-columns: minmax(0, 1fr); padding: 40px 40px 88px; }
  .toc { display: none; }
}
@media (max-width: 900px) {
  :root { --top: 56px; }
  .top { padding: 0 12px; gap: 8px; }
  .nav-toggle { display: inline-grid; }
  .brand { width: auto; }
  .search-btn { width: 36px; padding: 0; justify-content: center; border-color: transparent; background: none; box-shadow: none; }
  .search-btn span, .search-btn kbd { display: none; }
  .search-btn:hover { background: var(--surface-3); }
  .top-end { margin-left: auto; }
  .open-app { display: none; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 40; top: 0; left: 0; bottom: 0; height: auto; padding-top: calc(var(--top) + 22px); width: min(320px, 86vw); background: var(--bg); transform: translateX(-102%); transition: transform 200ms ease; visibility: hidden; }
  .nav-open .sidebar { transform: none; visibility: visible; box-shadow: 0 0 48px rgb(var(--shade) / .25); }
  .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgb(var(--shade) / .22); }
  .main { padding: 28px 16px 72px; }
  .lead { font-size: 17.5px; }
  .doc h2 { margin-top: 44px; font-size: 22px; }
  .anchor { display: none; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager-next { grid-column: 1; }
}
@media (max-width: 520px) {
  .brand-docs { display: none; }
  .diagram { padding: 14px 12px 10px; }
  .doc td, .doc th { padding: 9px 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .top, .sidebar, .toc, .pager, .search { display: none !important; }
  .shell, .main { display: block; padding: 0; }
  body { background: #fff; }
}
.doc .mid { text-align: center; }
