/* CacheGenie Docs (docs.cachegenie.com)
   1 Fonts and tokens   2 Base   3 Header   4 Layout and navigation   5 Article
   6 Code   7 Home and category   8 Search   9 Footer   10 Small screens   11 Motion */

/* 1 Fonts and tokens */
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-display: swap; font-weight: 200 800; src: url(fonts/bricolage-grotesque-latin.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: "Bricolage Grotesque"; font-style: normal; font-display: swap; font-weight: 200 800; src: url(fonts/bricolage-grotesque-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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: "Instrument Sans"; font-style: normal; font-display: swap; font-weight: 400 700; font-stretch: 75% 100%; src: url(fonts/instrument-sans-latin.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: "Instrument Sans"; font-style: normal; font-display: swap; font-weight: 400 700; font-stretch: 75% 100%; src: url(fonts/instrument-sans-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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: "Instrument Sans"; font-style: italic; font-display: swap; font-weight: 400 700; font-stretch: 75% 100%; src: url(fonts/instrument-sans-latin-italic.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 100 800; src: url(fonts/jetbrains-mono-latin.woff2) format("woff2"); }

:root {
    color-scheme: light;
    --ink: #1b1d3a;
    --ink-2: #3a3e5c;
    --muted: #5a5e7d;
    --faint: #8a8fa8;
    --paper: #ffffff;
    --mist: #f5f6fb;
    --mist-2: #eceef7;
    --line: #e3e5f0;
    --line-2: #d2d6e6;
    --genie: #4a43cc;
    --genie-ink: #3830ae;
    --genie-tint: #efeefd;
    --genie-soft: #d9d7fa;
    --sash: #127f78;
    --sash-tint: #e1f4f2;
    --mark: #fff1b8;
    --code-bg: #171930;
    --code-bar: #20233f;
    --code-ink: #e6e7f5;
    --code-muted: #9396bb;
    --t-k: #c9b1ff;
    --t-s: #8fe3cc;
    --t-n: #ffc78f;
    --t-c: #8285ab;
    --t-p: #a3bdff;
    --t-v: #ffa8c5;
    --t-f: #86d6ff;
    --t-a: #f2d68e;
    --f-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
    --f-text: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --header-h: 64px;
    --nav-w: 272px;
    --toc-w: 236px;
    --measure: 70ch;
    --r-s: 6px;
    --r-m: 10px;
    --r-l: 16px;
    --focus: 0 0 0 3px var(--genie-soft), 0 0 0 1px var(--genie);
}

/* 2 Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 20px); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.7 var(--f-text); font-kerning: normal; font-variant-ligatures: common-ligatures; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-wrap: break-word; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--genie); text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: color-mix(in srgb, var(--genie) 35%, transparent); }
a:hover { color: var(--genie-ink); text-decoration-color: currentColor; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
button { font: inherit; color: inherit; }
mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 0.08em; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--r-s); text-decoration: none; font-weight: 600; }
.skip:focus { top: 10px; color: #fff; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
kbd { font: 500 0.75rem/1 var(--f-mono); padding: 3px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; color: var(--muted); background: var(--paper); }

/* 3 Header */
.top { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top-in { height: var(--header-h); display: flex; align-items: center; gap: 20px; padding: 0 24px; max-width: 1600px; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: 0 0 auto; border-radius: var(--r-s); }
.brand img { width: auto; height: 40px; }
.brand-docs { align-self: center; margin-top: 6px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 999px; font: 600 11px/20px var(--f-text); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.search-open { flex: 1 1 auto; max-width: 440px; margin-left: auto; height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--mist); color: var(--muted); cursor: pointer; text-align: left; font-size: 0.9375rem; transition: border-color .15s, background-color .15s; }
.search-open:hover { border-color: var(--genie-soft); background: var(--paper); color: var(--ink-2); }
.search-open svg { width: 18px; height: 18px; flex: 0 0 auto; }
.search-open span { flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-links { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; flex: 0 0 auto; }
.top-links a { display: inline-flex; align-items: center; height: 40px; padding: 0 12px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 0.9375rem; }
.top-links a:hover { background: var(--mist); color: var(--ink); }
.top-links .signin { background: var(--ink); color: #fff; margin-left: 6px; padding: 0 16px; }
.top-links .signin:hover { background: var(--genie-ink); color: #fff; }
.icon-btn { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: 999px; color: var(--ink); cursor: pointer; flex: 0 0 auto; }
.icon-btn:hover { background: var(--mist); }
.icon-btn svg { width: 22px; height: 22px; }

/* 4 Layout and navigation */
.shell { max-width: 1600px; margin: 0 auto; display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr) var(--toc-w); }
.shell.no-toc { grid-template-columns: var(--nav-w) minmax(0, 1fr); }
.side { position: sticky; top: calc(var(--header-h) + 1px); align-self: start; height: calc(100vh - var(--header-h) - 1px); height: calc(100dvh - var(--header-h) - 1px); overflow-y: auto; overscroll-behavior: contain; padding: 28px 16px 40px 24px; border-right: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.nav-group { margin: 0 0 4px; }
.nav-group > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 10px; border-radius: var(--r-s); cursor: pointer; font: 620 0.9375rem/1.3 var(--f-text); color: var(--ink); user-select: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary:hover { background: var(--mist); }
.nav-group > summary .cat-icon { width: 20px; height: 20px; color: var(--genie); flex: 0 0 auto; }
.nav-group > summary .chev { width: 16px; height: 16px; margin-left: auto; color: var(--faint); transition: transform .18s; flex: 0 0 auto; }
.nav-group[open] > summary .chev { transform: rotate(90deg); }
.nav-group ul { list-style: none; margin: 2px 0 10px 19px; padding: 0 0 0 12px; border-left: 1px solid var(--line); }
.nav-group li a { display: block; padding: 6px 10px; margin-left: -13px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: 0.9375rem; line-height: 1.4; border-radius: 0 var(--r-s) var(--r-s) 0; }
.nav-group li a:hover { color: var(--ink); background: var(--mist); }
.nav-group li a[aria-current="page"] { color: var(--genie-ink); border-left-color: var(--genie); background: var(--genie-tint); font-weight: 600; }
.main { min-width: 0; padding: 40px 56px 96px; }
.main-in { max-width: var(--measure); margin: 0 auto; }
.toc { position: sticky; top: calc(var(--header-h) + 1px); align-self: start; max-height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 40px 24px 40px 8px; scrollbar-width: thin; }
.toc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 12px; }
.toc-title { font: 620 0.875rem/1.3 var(--f-text); color: var(--ink); margin: 0; }
.toc-left { font: 500 0.8125rem/1.3 var(--f-text); color: var(--sash); font-variant-numeric: tabular-nums; white-space: nowrap; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: 0.875rem; line-height: 1.4; }
.toc li a:hover { color: var(--ink); }
.toc li a.is-here { color: var(--genie-ink); border-left-color: var(--genie); font-weight: 600; }
.toc li a.is-read { color: var(--ink-2); }

/* 5 Article */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; font-size: 0.875rem; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--genie-ink); text-decoration: underline; }
.crumbs li + li::before { content: ""; display: inline-block; width: 5px; height: 5px; border-top: 1.5px solid var(--faint); border-right: 1.5px solid var(--faint); transform: rotate(45deg); margin: 0 8px 1px 2px; }
.article-head { margin: 0 0 36px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.article-head h1 { font: 680 clamp(2rem, 1.35rem + 2.1vw, 2.875rem)/1.08 var(--f-display); letter-spacing: -0.025em; margin: 0 0 14px; text-wrap: balance; }
.lede { font-size: 1.1875rem; line-height: 1.6; color: var(--ink-2); margin: 0 0 18px; text-wrap: pretty; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.875rem; color: var(--muted); margin: 0; }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.meta svg { width: 15px; height: 15px; color: var(--faint); }
.preview-band { display: flex; align-items: center; gap: 10px; margin: 0 0 24px; padding: 10px 14px; border-radius: var(--r-m); background: var(--sash-tint); color: var(--sash); font-weight: 600; font-size: 0.9375rem; }
.prose > :first-child { margin-top: 0; }
.prose > p.lede { font-size: 1.1875rem; line-height: 1.6; color: var(--ink-2); margin-bottom: 1.2em; }
.prose p { margin: 0 0 1.1em; text-wrap: pretty; }
.prose h3 { position: relative; font: 650 1.5rem/1.25 var(--f-display); letter-spacing: -0.015em; margin: 2.4em 0 0.6em; scroll-margin-top: calc(var(--header-h) + 20px); }
.prose h3:focus { outline: none; }
.prose h4 { font: 640 1.125rem/1.4 var(--f-text); margin: 1.9em 0 0.5em; }
.prose h3 + h4 { margin-top: 0.8em; }
.anchor { margin-left: 0.4em; padding: 0 0.2em; color: var(--faint); text-decoration: none; font-weight: 500; opacity: 0; transition: opacity .15s; }
.prose h3:hover .anchor, .anchor:focus-visible { opacity: 1; }
.anchor:hover { color: var(--genie); }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.prose li { margin: 0.35em 0; padding-left: 0.2em; }
.prose li::marker { color: var(--faint); }
.prose ol > li::marker { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.prose li > ul, .prose li > ol { margin: 0.35em 0 0.5em; }
.prose strong { font-weight: 650; color: var(--ink); }
.prose code { font: 500 0.875em/1.4 var(--f-mono); background: var(--mist-2); border: 1px solid var(--line); border-radius: 5px; padding: 0.06em 0.3em; color: var(--ink); overflow-wrap: break-word; }
.prose a code { color: inherit; }
.prose a.ext::after { content: ""; display: inline-block; width: 0.62em; height: 0.62em; margin-left: 0.22em; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: translateY(-0.12em); opacity: 0.6; }
.note { display: flex; gap: 14px; margin: 1.6em 0; padding: 16px 18px; border-radius: var(--r-m); background: var(--genie-tint); border: 1px solid var(--genie-soft); }
.note-icon { width: 22px; height: 22px; flex: 0 0 auto; color: var(--genie); margin-top: 2px; }
.note-body > :last-child { margin-bottom: 0; }
.note-body p { margin: 0 0 0.6em; }
.table-frame { margin: 1.6em 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-m); scrollbar-width: thin; }
.table-frame table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; line-height: 1.5; }
.table-frame th { text-align: left; font-weight: 620; background: var(--mist); color: var(--ink); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: bottom; }
.table-frame td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; min-width: 8ch; }
.table-frame tr:last-child td { border-bottom: 0; }
.table-frame td code { white-space: nowrap; }
.table-frame td.keep { white-space: nowrap; }
.media { margin: 2em 0; }
.media img, .media video { border-radius: var(--r-m); border: 1px solid var(--line); background: var(--mist); }
.media video { width: 100%; }
.media-zoom { display: block; border-radius: var(--r-m); cursor: zoom-in; }
.media figcaption { margin-top: 10px; font-size: 0.875rem; color: var(--muted); text-align: left; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 64px 0 0; padding-top: 28px; border-top: 1px solid var(--line); }
.pager a { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-m); text-decoration: none; color: var(--ink); transition: border-color .15s, background-color .15s; }
.pager a:hover { border-color: var(--genie-soft); background: var(--genie-tint); }
.pager small { display: block; font-size: 0.8125rem; color: var(--muted); margin-bottom: 4px; }
.pager b { font: 640 1.0625rem/1.35 var(--f-display); }
.pager .next { text-align: right; grid-column: 2; }
.toc-inline { display: none; margin: 0 0 28px; border: 1px solid var(--line); border-radius: var(--r-m); }
.toc-inline summary { list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 8px 16px; cursor: pointer; font-weight: 600; }
.toc-inline summary::-webkit-details-marker { display: none; }
.toc-inline ol { margin: 0; padding: 0 16px 12px 34px; }
.toc-inline li { margin: 4px 0; }
.toc-inline a { color: var(--ink-2); text-decoration: none; font-size: 0.9375rem; }

/* 6 Code */
.code { margin: 1.5em 0; border-radius: var(--r-m); background: var(--code-bg); color: var(--code-ink); overflow: hidden; }
.code-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 38px; padding: 0 6px 0 16px; background: var(--code-bar); border-bottom: 1px solid #2b2f52; }
.code-lang { font: 500 0.75rem/1 var(--f-mono); color: var(--code-muted); letter-spacing: 0.02em; }
.code-copy { height: 28px; padding: 0 11px; border: 1px solid #383d66; border-radius: 6px; background: transparent; color: var(--code-ink); font-size: 0.8125rem; font-weight: 500; cursor: pointer; }
.code-copy:hover { background: #2c3056; }
.code-copy.is-done { color: var(--t-s); border-color: #2f6e63; }
.code pre { margin: 0; padding: 16px 18px 18px; overflow-x: auto; font: 450 0.875rem/1.65 var(--f-mono); tab-size: 4; scrollbar-width: thin; scrollbar-color: #3a3f68 transparent; }
.code pre:focus-visible { box-shadow: inset 0 0 0 2px var(--genie-soft); border-radius: 0; }
.code code { font: inherit; background: none; border: 0; padding: 0; color: inherit; white-space: pre; overflow-wrap: normal; }
.t-k { color: var(--t-k); }
.t-s { color: var(--t-s); }
.t-n { color: var(--t-n); }
.t-c { color: var(--t-c); font-style: italic; }
.t-p { color: var(--t-p); }
.t-v { color: var(--t-v); }
.t-f { color: var(--t-f); }
.t-a { color: var(--t-a); }
.t-u { color: var(--t-s); text-decoration: underline; text-decoration-color: #3f7f72; text-underline-offset: 0.2em; }

/* 7 Home and category */
.hero { max-width: 1600px; margin: 0 auto; padding: 72px 24px 56px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: end; border-bottom: 1px solid var(--line); }
.hero-text { max-width: 760px; padding-left: max(0px, calc((100vw - 1600px) / 2)); }
.hero h1 { font: 700 clamp(2.5rem, 1.5rem + 3.6vw, 4.5rem)/1.02 var(--f-display); letter-spacing: -0.035em; margin: 0 0 18px; text-wrap: balance; }
.hero p { font-size: 1.25rem; line-height: 1.55; color: var(--ink-2); margin: 0 0 32px; max-width: 34em; }
.start { width: 340px; margin: 0 0 4px; padding-right: max(0px, calc((100vw - 1600px) / 2)); }
.start h2 { font: 620 0.9375rem/1.3 var(--f-text); color: var(--muted); margin: 0 0 10px; }
.start ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.start li { border-bottom: 1px solid var(--line); }
.start a { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 4px; text-decoration: none; color: var(--ink); }
.start a:hover { color: var(--genie-ink); }
.start .cat-badge { width: 32px; height: 32px; border-radius: 9px; }
.start .cat-badge svg { width: 18px; height: 18px; }
.start b { display: block; font: 620 1rem/1.3 var(--f-text); }
.start small { display: block; font-size: 0.8125rem; color: var(--muted); }
.big-search { display: flex; align-items: center; gap: 12px; max-width: 640px; height: 60px; padding: 0 10px 0 20px; border: 1.5px solid var(--line-2); border-radius: 999px; background: var(--paper); cursor: text; transition: border-color .15s, box-shadow .15s; }
.big-search:hover { border-color: var(--genie-soft); }
.big-search:focus-within { border-color: var(--genie); box-shadow: 0 0 0 4px var(--genie-tint); }
.big-search svg { width: 22px; height: 22px; color: var(--muted); flex: 0 0 auto; }
.big-search input { flex: 1 1 auto; min-width: 0; height: 100%; border: 0; background: transparent; font: 400 1.125rem/1 var(--f-text); color: var(--ink); outline: none; }
.big-search input::placeholder { color: var(--faint); }
.big-search button { height: 42px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; cursor: pointer; flex: 0 0 auto; }
.big-search button:hover { background: var(--genie-ink); }
.index { max-width: 1600px; margin: 0 auto; padding: 56px 24px 88px; }
.index-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 28px; }
.index-head h2 { font: 650 1.5rem/1.2 var(--f-display); letter-spacing: -0.015em; margin: 0; }
.index-head p { margin: 0; color: var(--muted); font-size: 0.9375rem; }
.index-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px 48px; align-items: start; }
.index-cat { margin: 0; display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
.index-cat > h3 { grid-row: 1; }
.index-cat > p { grid-row: 2; }
.index-cat > ul { grid-row: 3; align-self: start; }
.index-cat h3 { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; font: 650 1.25rem/1.25 var(--f-display); letter-spacing: -0.01em; }
.index-cat h3 a { color: var(--ink); text-decoration: none; }
.index-cat h3 a:hover { color: var(--genie-ink); }
.cat-badge { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 11px; background: var(--genie-tint); color: var(--genie); flex: 0 0 auto; }
.cat-badge svg { width: 21px; height: 21px; }
.index-cat > p { margin: 0 0 14px; color: var(--muted); font-size: 0.9375rem; line-height: 1.55; }
.index-cat ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.index-cat li { border-bottom: 1px solid var(--line); }
.index-cat li a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 9px 4px; color: var(--ink-2); text-decoration: none; font-size: 0.9875rem; line-height: 1.4; }
.index-cat li a:hover { color: var(--genie-ink); }
.index-cat li a svg { width: 16px; height: 16px; color: var(--faint); flex: 0 0 auto; transition: transform .15s, color .15s; }
.index-cat li a:hover svg { color: var(--genie); transform: translateX(3px); }
.cat-head { display: flex; align-items: flex-start; gap: 18px; margin: 0 0 32px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.cat-head .cat-badge { width: 52px; height: 52px; border-radius: 14px; }
.cat-head .cat-badge svg { width: 27px; height: 27px; }
.cat-head h1 { font: 680 clamp(2rem, 1.4rem + 2vw, 2.75rem)/1.08 var(--f-display); letter-spacing: -0.025em; margin: 2px 0 10px; }
.cat-head p { margin: 0; font-size: 1.125rem; color: var(--ink-2); line-height: 1.6; }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li + li { border-top: 1px solid var(--line); }
.cat-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 20px; padding: 18px 12px; margin: 0 -12px; border-radius: var(--r-m); text-decoration: none; color: var(--ink); }
.cat-list a:hover { background: var(--mist); }
.cat-list b { font: 640 1.125rem/1.35 var(--f-display); }
.cat-list span { grid-column: 1; color: var(--muted); font-size: 0.9375rem; line-height: 1.55; }
.cat-list svg { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 18px; height: 18px; color: var(--faint); }
.cat-list a:hover svg { color: var(--genie); }
.empty { text-align: left; padding: 72px 0; }
.empty h1 { font: 700 clamp(2rem, 1.4rem + 2vw, 3rem)/1.08 var(--f-display); letter-spacing: -0.03em; margin: 0 0 12px; }
.empty > p { font-size: 1.125rem; color: var(--ink-2); margin: 0 0 28px; max-width: 34em; }
.empty .index-cols { margin-top: 48px; }

/* 8 Search */
.search-dialog { width: min(680px, calc(100vw - 32px)); max-height: min(640px, calc(100vh - 96px)); margin: 72px auto auto; padding: 0; border: 1px solid var(--line-2); border-radius: var(--r-l); background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(27, 29, 58, 0.35); overflow: hidden; }
.search-dialog[open] { display: flex; flex-direction: column; }
.search-dialog::backdrop { background: rgba(27, 29, 58, 0.42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sd-field { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.sd-field svg { width: 20px; height: 20px; color: var(--muted); flex: 0 0 auto; }
.sd-field input { flex: 1 1 auto; min-width: 0; height: 60px; border: 0; outline: none; background: transparent; font: 400 1.125rem/1 var(--f-text); color: var(--ink); }
.sd-field input::-webkit-search-cancel-button { display: none; }
.sd-close { height: 30px; padding: 0 9px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--paper); color: var(--muted); font: 500 0.75rem/1 var(--f-mono); cursor: pointer; flex: 0 0 auto; }
.sd-results { flex: 1 1 auto; overflow-y: auto; padding: 8px; margin: 0; list-style: none; overscroll-behavior: contain; }
.sd-results li a { display: block; padding: 12px 14px; border-radius: var(--r-m); text-decoration: none; color: var(--ink); }
.sd-results li a[aria-selected="true"], .sd-results li a:hover { background: var(--genie-tint); }
.sd-results b { display: block; font: 620 1rem/1.35 var(--f-text); }
.sd-results .sd-where { display: block; font-size: 0.8125rem; color: var(--genie-ink); margin: 2px 0 4px; }
.sd-results .sd-snip { display: block; font-size: 0.875rem; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sd-state { padding: 28px 20px; color: var(--muted); font-size: 0.9375rem; text-align: center; }
.sd-foot { display: flex; gap: 18px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 0.8125rem; color: var(--muted); background: var(--mist); flex: 0 0 auto; }
.sd-foot span { display: inline-flex; align-items: center; gap: 6px; }
.results-page h1 { font: 680 2.25rem/1.1 var(--f-display); letter-spacing: -0.025em; margin: 0 0 20px; }
.results-page .big-search { margin-bottom: 28px; }
.results-page .count { color: var(--muted); margin: 0 0 12px; font-size: 0.9375rem; }
.results { list-style: none; margin: 0; padding: 0; }
.results li + li { border-top: 1px solid var(--line); }
.results a { display: block; padding: 16px 12px; margin: 0 -12px; border-radius: var(--r-m); text-decoration: none; color: var(--ink); }
.results a:hover { background: var(--mist); }
.results b { font: 640 1.125rem/1.35 var(--f-display); }
.results .where { display: block; font-size: 0.875rem; color: var(--genie-ink); margin: 2px 0 6px; }
.results .snip { display: block; color: var(--muted); font-size: 0.9375rem; line-height: 1.55; }

/* Image viewer */
.zoom-dialog { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 94vh; overflow: visible; }
.zoom-dialog::backdrop { background: rgba(15, 16, 34, 0.86); }
.zoom-dialog img { max-width: 96vw; max-height: 88vh; width: auto; height: auto; border-radius: var(--r-m); background: var(--paper); }
.zoom-dialog button { position: fixed; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.zoom-dialog button:hover { background: rgba(255, 255, 255, 0.24); }

/* 9 Footer */
.foot { border-top: 1px solid var(--line); background: var(--mist); }
.foot-in { max-width: 1600px; margin: 0 auto; padding: 32px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; font-size: 0.875rem; color: var(--muted); }
.foot ul { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0; padding: 0; list-style: none; }
.foot ul a { display: inline-flex; align-items: center; min-height: 34px; padding: 0 10px; border-radius: var(--r-s); color: var(--ink-2); text-decoration: none; }
.foot ul a:hover { background: var(--paper); color: var(--ink); }
.foot p { margin: 0; }

/* Drawer (small screens) */
.drawer-scrim { display: none; }

/* 10 Small screens */
@media (max-width: 1240px) {
    .shell { grid-template-columns: var(--nav-w) minmax(0, 1fr); }
    .toc { display: none; }
    .toc-inline { display: block; }
    .main { padding: 36px 40px 88px; }
}
@media (max-width: 960px) {
    .shell, .shell.no-toc { grid-template-columns: minmax(0, 1fr); }
    .index-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 40px; }
    .side { position: fixed; z-index: 70; top: 0; left: 0; bottom: 0; width: min(320px, 86vw); height: auto; background: var(--paper); border-right: 1px solid var(--line); padding: 20px 16px 40px; transform: translateX(-102%); transition: transform .22s ease; visibility: hidden; }
    .side.is-open { transform: none; visibility: visible; }
    .drawer-scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(27, 29, 58, 0.42); opacity: 0; pointer-events: none; transition: opacity .2s; }
    .drawer-scrim.is-on { opacity: 1; pointer-events: auto; }
    .side-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px 8px; }
    .icon-btn { display: inline-flex; }
    .menu-btn { margin-left: -10px; }
    .top-links li:not(.keep) { display: none; }
    .hero { grid-template-columns: minmax(0, 1fr); padding: 48px 24px 40px; }
    .start { width: auto; max-width: 640px; }
}
@media (min-width: 961px) {
    .side-head { display: none; }
}
@media (max-width: 720px) {
    :root { --header-h: 58px; }
    body { font-size: 1rem; }
    .top-in { gap: 8px; padding: 0 12px 0 16px; }
    .brand img { height: 34px; }
    .brand-docs { margin-top: 5px; padding: 0 7px; font-size: 10px; line-height: 18px; }
    .search-open { display: none; }
    .search-icon { display: inline-flex; margin-left: auto; }
    .top-links { display: none; }
    .main { padding: 28px 16px 72px; }
    .article-head { margin-bottom: 28px; padding-bottom: 22px; }
    .lede { font-size: 1.0625rem; }
    .prose h3 { font-size: 1.3125rem; }
    .code { margin-left: -16px; margin-right: -16px; border-radius: 0; }
    .code pre { font-size: 0.8125rem; padding: 14px 16px 16px; }
    .table-frame { border: 0; border-radius: 0; overflow: visible; margin: 1.2em 0; }
    .table-frame table, .table-frame tbody, .table-frame tr, .table-frame td { display: block; width: 100%; }
    .table-frame thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .table-frame tr { border: 1px solid var(--line); border-radius: var(--r-m); margin: 0 0 12px; padding: 6px 14px; }
    .table-frame td { border-bottom: 1px solid var(--line); padding: 8px 0; min-width: 0; }
    .table-frame tr td:last-child { border-bottom: 0; }
    .table-frame td[data-label]::before { content: attr(data-label); display: block; font-size: 0.75rem; font-weight: 620; color: var(--muted); margin-bottom: 2px; }
    .table-frame td code, .table-frame td.keep { white-space: normal; }
    .pager { grid-template-columns: minmax(0, 1fr); }
    .pager .next { grid-column: 1; }
    .hero { padding: 40px 16px 32px; }
    .hero p { font-size: 1.0625rem; margin-bottom: 24px; }
    .big-search { height: 54px; padding: 0 6px 0 16px; }
    .big-search button { padding: 0 16px; height: 42px; }
    .index { padding: 40px 16px 64px; }
    .index-head { flex-direction: column; gap: 4px; }
    .index-cols { grid-template-columns: minmax(0, 1fr); gap: 36px; }
    .table-frame tr td:first-child { font-weight: 620; color: var(--ink); }
    .table-frame tr td:first-child::before { display: none; }
    .cat-head { flex-direction: column; gap: 14px; }
    .foot-in { padding: 24px 16px; flex-direction: column; align-items: flex-start; }
    .foot ul { margin-left: -10px; }
    .search-dialog { margin-top: 12px; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
    .sd-foot { display: none; }
}
@media (min-width: 721px) {
    .search-icon { display: none; }
}
@media (hover: none) {
    .anchor { opacity: 0.55; }
}

/* 11 Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
    .top, .side, .toc, .pager, .foot, .code-copy, .anchor, .toc-inline { display: none !important; }
    .shell { display: block; }
    .main { padding: 0; }
    .code { background: #f6f6f8; color: #111; }
}
