/* SAF Scripts Docs. Dark only. Solid colours, hairlines, IBM Plex. */

/* ------------------------------------------------------------------ fonts (bundled, no external requests) */
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/ibm-plex-sans-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/ibm-plex-sans-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans Condensed'; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/ibm-plex-sans-condensed-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/ibm-plex-sans-condensed-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/ibm-plex-sans-condensed-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/ibm-plex-mono-latin-600-normal.woff2) format('woff2'); }

/* ------------------------------------------------------------------ tokens */
:root {
  --bg: #0D1015;
  --surface: #141920;
  --raised: #1A2029;
  --border: #2A313C;
  --border-strong: #3A4350;
  --text: #EEF1F5;
  --body: #D3D9E1;
  --muted: #A7AFBB;
  --faint: #7E8896;
  --accent: #E8A33D;
  --accent-hover: #F0B455;
  --accent-ink: #0D1015;
  --red: #E0574F;
  --teal: #4CB5A8;

  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --cond: 'IBM Plex Sans Condensed', 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;

  /* spacing scale: 4 8 12 16 24 32 48 64 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --top: 56px;
  --side: 272px;
  --toc: 224px;
  --radius: 4px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + var(--s5)); }
body {
  margin: 0; background: var(--bg); color: var(--body);
  font: 400 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
::selection { background: #5a4120; color: var(--text); }
.i { width: 1em; height: 1em; flex: none; }
.mono { font-family: var(--mono); font-size: .92em; }
kbd {
  display: inline-block; min-width: 20px; padding: 0 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px;
  border-radius: 3px; background: var(--raised); color: var(--text); font: 500 11.5px/18px var(--mono); text-align: center;
}
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; font-weight: 600; }
.skip:focus { left: 8px; }

/* ------------------------------------------------------------------ top bar */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--top);
  display: flex; align-items: center; gap: var(--s4);
  padding: 0 var(--s5) 0 var(--s5); background: var(--bg); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); width: calc(var(--side) - var(--s5) - var(--s4)); flex: none; }
.brand-bar { width: 4px; height: 26px; background: var(--accent); }
.brand-saf { font: 700 23px/1 var(--cond); letter-spacing: .01em; }
.brand-scripts { font: 600 12px/1 var(--cond); letter-spacing: .24em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.brand-sep { width: 1px; height: 18px; background: var(--border-strong); margin: 0 2px; }
.brand-docs { font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-top: 2px; }
.nav-toggle { display: none; }

.search-open {
  display: flex; align-items: center; gap: 10px; width: 100%; max-width: 420px; height: 36px; padding: 0 8px 0 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); cursor: pointer;
  transition: border-color .12s, background-color .12s;
}
.search-open:hover { border-color: var(--border-strong); background: var(--raised); color: var(--text); }
.search-open .i { width: 17px; height: 17px; }
.search-open-text { flex: 1; text-align: left; font-size: 14px; }
.top-links { margin-left: auto; display: flex; gap: var(--s1); }
.top-links a {
  display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; color: var(--muted);
  font: 600 13px/1 var(--cond); letter-spacing: .08em; text-transform: uppercase; border-radius: var(--radius);
  transition: background-color .12s, color .12s;
}
.top-links a:hover { color: var(--text); background: var(--surface); }
.top-links .i { width: 17px; height: 17px; }

/* ------------------------------------------------------------------ shell */
.shell { display: flex; align-items: flex-start; }
.sidebar {
  position: sticky; top: var(--top); height: calc(100vh - var(--top)); width: var(--side); flex: none;
  background: var(--surface); border-right: 1px solid var(--border);
}
.sidebar-scroll { height: 100%; overflow-y: auto; display: flex; flex-direction: column; padding: var(--s5) 0 var(--s4); scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.sidebar nav { flex: 1; }
.nav-group { padding: 0 var(--s3) var(--s5); }
.nav-group + .nav-group { border-top: 1px solid var(--border); padding-top: var(--s4); }
.nav-label {
  display: flex; justify-content: space-between; align-items: center; padding: 0 var(--s3) var(--s2);
  font: 600 12px/1.2 var(--cond); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.nav-label span { font: 500 11px/1 var(--mono); letter-spacing: 0; color: var(--faint); }
.sidebar nav a {
  position: relative; display: flex; align-items: center; gap: var(--s2); min-height: 32px; padding: 5px var(--s3);
  color: var(--body); font-size: 14.5px; line-height: 1.35; border-radius: 3px; transition: background-color .12s, color .12s;
}
.sidebar nav a:hover { background: var(--raised); color: var(--text); }
.sidebar nav a[aria-current="page"] { background: var(--raised); color: var(--text); font-weight: 500; }
.sidebar nav a[aria-current="page"]::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px; background: var(--accent); }
.nav-script-link { justify-content: space-between; }
.nav-script-link code { font: 400 11.5px/1 var(--mono); color: var(--faint); }
.nav-script.is-open > .nav-script-link { color: var(--text); font-weight: 600; }
.nav-sub { margin: 2px 0 var(--s2) var(--s3); padding-left: var(--s2); border-left: 1px solid var(--border); }
.sidebar nav .nav-sub a { min-height: 30px; font-size: 14px; color: var(--muted); }
.sidebar nav .nav-sub a:hover, .sidebar nav .nav-sub a[aria-current="page"] { color: var(--text); }
.sidebar-foot { border-top: 1px solid var(--border); padding: var(--s4) var(--s5) 0; display: grid; gap: var(--s2); }
.sidebar-foot a { display: flex; align-items: center; gap: var(--s2); color: var(--muted); font-size: 13px; }
.sidebar-foot a:hover { color: var(--text); }
.sidebar-foot .i { width: 15px; height: 15px; }
.scrim { display: none; }

.main { flex: 1; min-width: 0; }
.page { display: flex; justify-content: center; gap: var(--s7); padding: var(--s6) var(--s6) 0; }
.doc { width: 100%; max-width: 800px; min-width: 0; }
.no-toc .doc { max-width: 880px; }

/* ------------------------------------------------------------------ toc */
.toc { position: sticky; top: calc(var(--top) + var(--s6)); width: var(--toc); flex: none; max-height: calc(100vh - var(--top) - 64px); overflow-y: auto; padding-bottom: var(--s5); scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.toc-label { font: 600 12px/1 var(--cond); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-bottom: var(--s3); border-bottom: 1px solid var(--border); margin-bottom: var(--s2); }
.toc ul, .toc-inline ul { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 4px 0 4px var(--s3); border-left: 1px solid var(--border); color: var(--muted); font-size: 13.5px; line-height: 1.4; transition: color .12s, border-color .12s; }
.toc .toc-3 a { padding-left: var(--s5); font-size: 13px; }
.toc a:hover { color: var(--text); }
.toc a.is-active { color: var(--text); border-left: 2px solid var(--accent); padding-left: 11px; }
.toc .toc-3 a.is-active { padding-left: 23px; }
.toc-inline { display: none; }

/* ------------------------------------------------------------------ page header */
.crumbs { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s3); font: 500 12.5px/1 var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs [aria-current] { color: var(--muted); }
h1 { margin: 0 0 var(--s3); font: 600 40px/1.1 var(--cond); color: var(--text); letter-spacing: -.005em; }
.lead { margin: 0 0 var(--s5); font-size: 18.5px; line-height: 1.55; color: var(--muted); max-width: 680px; }
.soon-bar { display: flex; gap: var(--s2); align-items: center; margin: 0 0 var(--s5); padding: 10px var(--s4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); font-size: 14px; }
.soon-bar .i { color: var(--accent); width: 17px; height: 17px; }

.status { display: inline-flex; align-items: center; gap: 8px; font: 600 12.5px/1 var(--cond); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.status::before { content: ''; width: 8px; height: 8px; border-radius: 1px; }
.status-live { color: var(--teal); }
.status-live::before { background: var(--teal); }
.status-soon { color: var(--accent); }
.status-soon::before { background: var(--accent); }

.spec { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 0 var(--s5); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.spec div { display: grid; grid-template-columns: 120px 1fr; gap: var(--s3); align-items: baseline; padding: 10px var(--s4); border-bottom: 1px solid var(--border); }
.spec div:nth-child(odd) { border-right: 1px solid var(--border); }
.spec div:nth-last-child(-n+2):nth-child(odd), .spec div:last-child { border-bottom: 0; }
.spec div:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: 0; }
.spec div:last-child:nth-child(odd) { grid-template-columns: 120px 1fr; }
.spec dt { font: 600 12px/1.4 var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.spec dd { margin: 0; color: var(--text); font-size: 14.5px; line-height: 1.45; }

/* ------------------------------------------------------------------ prose */
.prose { color: var(--body); }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 var(--s4); }
.prose h2, .prose h3, .prose h4 { position: relative; color: var(--text); }
.prose h2 { margin: var(--s7) 0 var(--s4); padding-top: var(--s5); border-top: 1px solid var(--border); font: 600 26px/1.2 var(--cond); }
.prose h3 { margin: var(--s6) 0 var(--s3); font: 600 18.5px/1.3 var(--sans); }
.prose h4 { margin: var(--s5) 0 var(--s2); font: 600 16px/1.3 var(--sans); }
.anchor { position: absolute; left: -26px; width: 20px; color: var(--faint); opacity: 0; transition: opacity .12s; }
.prose h2 .anchor { top: calc(var(--s5) + 5px); }
.prose h3 .anchor { top: 3px; }
.anchor .i { width: 16px; height: 16px; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .anchor:focus-visible { opacity: 1; }
.anchor:hover { color: var(--accent); }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-color: #6a4f26; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol { margin: 0 0 var(--s4); padding-left: var(--s5); }
.prose li { margin: 0 0 6px; padding-left: 2px; }
.prose li::marker { color: var(--faint); }
.prose ol > li::marker { font-family: var(--mono); font-size: .9em; color: var(--muted); }
.prose li > ul, .prose li > ol { margin: 6px 0 0; }
.prose li > .code { margin: var(--s2) 0 var(--s3); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: var(--s6) 0; }
.prose blockquote { margin: 0 0 var(--s4); padding: 0 0 0 var(--s4); border-left: 2px solid var(--border-strong); color: var(--muted); }

.prose :not(pre) > code {
  font: 400 .86em/1 var(--mono); color: var(--text); background: var(--raised);
  border-radius: 3px; padding: 2px 5px;
}
.prose :not(pre) > code { overflow-wrap: break-word; }
.prose td code { background: none; padding: 0; font-size: .9em; color: #E4D3B4; }
.prose td:first-child code { color: var(--text); font-weight: 500; }
.prose a code { color: var(--accent); }

/* code blocks */
.code { margin: 0 0 var(--s5); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.code-head { display: flex; align-items: center; justify-content: space-between; height: 34px; padding: 0 6px 0 var(--s4); border-bottom: 1px solid var(--border); background: var(--bg); }
.code-lang { font: 600 11.5px/1 var(--cond); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.code-file { font: 500 12.5px/1 var(--mono); color: var(--muted); }
.copy {
  display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border: 0; border-radius: 3px; background: transparent;
  color: var(--muted); font: 500 12px/1 var(--mono); cursor: pointer; transition: background-color .12s, color .12s;
}
.copy:hover { background: var(--raised); color: var(--text); }
.copy .i { width: 15px; height: 15px; }
.copy.is-done { color: var(--teal); }
.code pre { margin: 0; padding: 14px var(--s4) 16px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.code code { font: 400 13.5px/1.65 var(--mono); color: #DCE2EA; tab-size: 4; }

/* syntax colours */
.hljs-comment, .hljs-quote { color: #8A94A3; }
.hljs-keyword, .hljs-selector-tag, .hljs-meta .hljs-keyword { color: #E8A33D; }
.hljs-string, .hljs-regexp, .hljs-template-string { color: #6FC7B9; }
.hljs-number, .hljs-literal, .hljs-symbol { color: #EE8B7F; }
.hljs-built_in, .hljs-type { color: #9DBBE0; }
.hljs-title, .hljs-title.function_, .hljs-section { color: #F4CF92; }
.hljs-attr, .hljs-attribute, .hljs-property, .hljs-variable { color: #B9C7D8; }
.hljs-params { color: #DCE2EA; }
.hljs-meta { color: #8A94A3; }

/* tables */
.table-wrap { margin: 0 0 var(--s5); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.prose thead th {
  text-align: left; padding: 9px var(--s4); background: var(--surface); border-bottom: 1px solid var(--border);
  font: 600 12px/1.3 var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.prose td { padding: 9px var(--s4); border-bottom: 1px solid var(--border); vertical-align: top; color: var(--body); }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose td:first-child { color: var(--text); }
.prose tbody tr:hover td { background: #11161C; }

/* callouts */
.callout { margin: 0 0 var(--s5); padding: var(--s3) var(--s4) var(--s3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.callout-head { display: flex; align-items: center; gap: var(--s2); margin-bottom: 6px; font: 600 12.5px/1 var(--cond); letter-spacing: .12em; text-transform: uppercase; }
.callout-head .i { width: 17px; height: 17px; }
.callout-note .callout-head { color: var(--teal); }
.callout-tip .callout-head { color: var(--accent); }
.callout-warning .callout-head { color: var(--red); }
.callout-body { font-size: 15px; }
.callout-body > :last-child { margin-bottom: 0; }
.callout-body .code { margin-bottom: var(--s3); }

/* figures */
.shot { margin: 0 0 var(--s5); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.shot img { width: 100%; }
.shot figcaption { display: flex; gap: var(--s3); align-items: baseline; padding: 9px var(--s4); border-top: 1px solid var(--border); font-size: 13.5px; color: var(--muted); }
.shot figcaption span { font: 500 11.5px/1 var(--mono); color: var(--faint); letter-spacing: .04em; flex: none; }
.shot-hero { margin-bottom: var(--s6); }
.prose figure.shot img[src*="weather-card"], .prose figure.shot img[src*="pursuit-"] { max-width: 420px; margin: 0 auto; }
.prose figure.shot img[src*="scenes-editor"] { max-width: 720px; margin: 0 auto; }

/* ------------------------------------------------------------------ pager + footer */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); margin: var(--s8) 0 0; padding-top: var(--s5); border-top: 1px solid var(--border); }
.pager a { display: flex; flex-direction: column; gap: 6px; padding: var(--s3) var(--s4); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: border-color .12s, background-color .12s; }
.pager a:hover { border-color: var(--border-strong); background: var(--raised); }
.pager-next { text-align: right; align-items: flex-end; }
.pager-dir { display: flex; align-items: center; gap: 6px; font: 600 12px/1 var(--cond); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.pager-dir .i { width: 14px; height: 14px; }
.pager-title { color: var(--text); font-weight: 500; font-size: 15.5px; }
.pager a:hover .pager-title { color: var(--accent); }

.site-foot { margin: var(--s6) 0 0; padding: var(--s5) 0 var(--s6); border-top: 1px solid var(--border); color: var(--faint); font-size: 13px; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3); color: var(--muted); }
.foot-links { display: flex; flex-wrap: wrap; gap: var(--s4); }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--accent); }
.site-foot p { margin: var(--s2) 0 0; }

/* ------------------------------------------------------------------ home */
.hero { padding: var(--s5) 0 var(--s6); }
.hero-label { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s4); font: 500 12.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.hero h1 { font-size: 52px; line-height: 1.04; margin-bottom: var(--s4); max-width: 700px; }
.hero .lead { font-size: 19px; margin-bottom: var(--s5); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); }
.btn {
  display: inline-flex; align-items: center; gap: var(--s2); height: 40px; padding: 0 var(--s4);
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text);
  font: 600 14px/1 var(--cond); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; text-decoration: none;
  transition: background-color .12s, border-color .12s;
}
.btn .i { width: 17px; height: 17px; }
.btn:hover { background: var(--raised); border-color: #4A5462; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.products { margin: 0 0 var(--s5); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.product-head, .product-row { display: grid; grid-template-columns: 230px 1fr 130px 28px; gap: var(--s4); align-items: center; padding: 0 var(--s4); }
.product-head { height: 36px; background: var(--surface); border-bottom: 1px solid var(--border); font: 600 12px/1 var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.prose .product-row { min-height: 60px; padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); color: var(--body); text-decoration: none; transition: background-color .12s; }
.prose .product-row:last-child { border-bottom: 0; }
.prose .product-row:hover { background: var(--surface); }
.pr-name { display: flex; flex-direction: column; gap: 2px; }
.pr-name strong { color: var(--text); font: 600 17px/1.2 var(--cond); letter-spacing: .01em; }
.prose .pr-name code { background: none; border: 0; padding: 0; font-size: 12px; color: var(--faint); }
.pr-sum { font-size: 14.5px; line-height: 1.45; }
.pr-go { color: var(--faint); display: flex; justify-content: flex-end; }
.pr-go .i { width: 18px; height: 18px; }
.prose .product-row:hover .pr-go { color: var(--accent); }

.notfound { padding: var(--s7) 0 var(--s5); }
.notfound-code { font: 600 14px/1 var(--mono); color: var(--accent); letter-spacing: .1em; margin-bottom: var(--s4); }

/* ------------------------------------------------------------------ search */
.search { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: center; align-items: flex-start; padding: 10vh var(--s4) var(--s4); background: rgba(5, 7, 10, .72); }
.search[hidden] { display: none; }
.search-panel { width: 100%; max-width: 680px; max-height: 76vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 24px 64px rgba(0, 0, 0, .55); }
.search-bar { display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s3) 0 var(--s4); height: 56px; border-bottom: 1px solid var(--border); }
.search-bar > .i { width: 20px; height: 20px; color: var(--muted); }
.search-bar input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: 400 17px/1 var(--sans); }
.search-bar input::placeholder { color: var(--faint); }
.search-bar input::-webkit-search-cancel-button { display: none; }
.search-close { border: 0; background: none; cursor: pointer; padding: 4px; }
.search-results { overflow-y: auto; padding: var(--s2); scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.search-results:empty { display: none; }
.sr-group { padding: var(--s3) var(--s3) 6px; font: 600 11.5px/1 var(--cond); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.sr-item { display: block; padding: var(--s2) var(--s3); border-radius: 3px; color: var(--body); }
.sr-item[aria-selected="true"] { background: var(--raised); }
.sr-item[aria-selected="true"] .sr-title { color: var(--accent); }
.sr-title { display: block; color: var(--text); font-weight: 500; font-size: 15px; }
.sr-title span { color: var(--faint); font-weight: 400; }
.sr-text { display: block; margin-top: 2px; color: var(--muted); font-size: 13.5px; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-item mark { background: none; color: var(--accent); font-weight: 600; }
.sr-empty { padding: var(--s5) var(--s4); color: var(--muted); font-size: 14.5px; }
.search-foot { display: flex; gap: var(--s4); padding: 10px var(--s4); border-top: 1px solid var(--border); color: var(--faint); font-size: 12.5px; }
.search-foot kbd { margin-right: 4px; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1240px) {
  .toc { display: none; }
  .toc-inline { display: block; margin: 0 0 var(--s5); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
  .toc-inline summary { display: flex; align-items: center; justify-content: space-between; padding: 10px var(--s4); cursor: pointer; list-style: none; font: 600 12.5px/1 var(--cond); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .toc-inline summary::-webkit-details-marker { display: none; }
  .toc-inline summary .i { width: 16px; height: 16px; transition: transform .12s; }
  .toc-inline[open] summary .i { transform: rotate(180deg); }
  .toc-inline ul { padding: 0 var(--s4) var(--s3); border-top: 1px solid var(--border); padding-top: var(--s2); }
  .toc-inline a { display: block; padding: 4px 0; color: var(--muted); font-size: 14px; }
  .toc-inline .toc-3 a { padding-left: var(--s4); }
  .toc-inline a:hover { color: var(--text); }
}

@media (max-width: 960px) {
  :root { --top: 56px; }
  .topbar { padding: 0 var(--s3); gap: var(--s2); }
  .nav-toggle { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; flex: none; }
  .nav-toggle .i { width: 20px; height: 20px; }
  .brand { width: auto; }
  .search-open { width: 40px; padding: 0; justify-content: center; margin-left: auto; flex: none; }
  .search-open-text, .search-open kbd { display: none; }
  .top-links { margin-left: 0; }
  .top-links span { display: none; }
  .top-links a { width: 40px; padding: 0; justify-content: center; }
  .top-links .i { width: 20px; height: 20px; }

  .sidebar { position: fixed; z-index: 50; top: var(--top); left: 0; height: calc(100dvh - var(--top)); width: min(320px, 86vw); transform: translateX(-100%); transition: transform .16s ease-out; visibility: hidden; }
  body.nav-open .sidebar { transform: none; visibility: visible; }
  .scrim { position: fixed; inset: var(--top) 0 0 0; z-index: 45; background: rgba(5, 7, 10, .72); }
  body.nav-open .scrim { display: block; }
  body.nav-open { overflow: hidden; }

  .page { padding: var(--s5) var(--s4) 0; }
  h1 { font-size: 34px; }
  .hero h1 { font-size: 40px; }
  .anchor { display: none; }
}

@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .brand-scripts, .brand-sep { display: none; }
  .lead, .hero .lead { font-size: 17px; }
  .prose h2 { font-size: 23px; margin-top: var(--s6); }
  .spec { grid-template-columns: 1fr; }
  .spec div:nth-child(odd) { border-right: 0; }
  .spec div:nth-last-child(-n+2):nth-child(odd) { border-bottom: 1px solid var(--border); }
  .spec div { grid-template-columns: 112px 1fr; }
  .product-head { display: none; }
  .prose .product-row { grid-template-columns: 1fr 24px; gap: 6px var(--s3); padding: var(--s3) var(--s4); }
  .pr-name { grid-column: 1; grid-row: 1; flex-direction: row; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
  .pr-sum { grid-column: 1; grid-row: 2; }
  .pr-status { grid-column: 1; grid-row: 3; }
  .pr-go { grid-column: 2; grid-row: 1 / 4; }
  .pager { grid-template-columns: 1fr; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  /* tables with 3+ columns become stacked rows */
  .table-wrap.stack { border: 0; overflow: visible; }
  .stack table, .stack tbody, .stack tr, .stack td { display: block; width: 100%; }
  .stack thead { display: none; }
  .stack tr { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: var(--s2); background: var(--surface); }
  .prose .stack td { border: 0; padding: 4px var(--s3); }
  .prose .stack td:first-child { padding-top: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); font-weight: 600; }
  .prose .stack td:last-child { padding-bottom: 10px; }
  .prose .stack td:not(:first-child)::before { content: attr(data-label); display: block; font: 600 11px/1.6 var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
  .prose .stack td:empty { display: none; }
  .prose .stack tbody tr:hover td { background: none; }
  .pager-next { order: -1; }
  .code code { font-size: 12.5px; }
  .prose table { font-size: 13.5px; }
  .prose thead th, .prose td { padding: 8px var(--s3); }
  .search { padding: var(--s2); }
  .search-panel { max-height: calc(100dvh - 16px); }
  .search-foot { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
