/*
 * "Drawing sheet": the page reads like a technical drawing or datasheet.
 * Graphite on cool drafting paper, a construction grid, one muted drafting blue,
 * thin/thick line weights, monospace labels and numbered sections.
 */
:root {
    color-scheme: light dark;
    --bg: #f4f5f6;
    --bg-alt: #e8ebee;
    --panel: #ffffff;
    --ink: #1a1e23;
    --muted: #58606a;
    --syntax: #98a0a9;
    --rule: #1a1e23;
    --hair: #cdd2d8;
    --grid: rgb(31 77 130 / 7%);
    --accent: #1f4d82;
    --accent-ink: #ffffff;
    --mark: #dfe7f0;
    --mark-ink: #163a63;
    --code: #161a1f;
    --code-ink: #dce2e8;
    --sans: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
    --grid-paper: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { margin: 0; overflow-x: clip; color: var(--ink); background: var(--bg); font-family: var(--sans); font-size: 1.02rem; line-height: 1.6; }
a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--ink); text-decoration-thickness: 2px; }
button { font: inherit; }
code, pre { font-family: var(--mono); }
code { font-size: .88em; }
p code, li code, td code, span code { padding: .05em .3em; border: 1px solid var(--hair); background: var(--panel); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--mark); color: var(--mark-ink); }

.skip-link { position: fixed; z-index: 10; top: .5rem; left: .5rem; padding: .5rem .8rem; color: var(--accent-ink); background: var(--accent); font-family: var(--mono); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

/* Masthead: the title strip of the sheet */
.masthead { position: sticky; z-index: 5; top: 0; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2rem; padding: .6rem clamp(1.2rem, 4vw, 3.5rem); border-bottom: 1px solid var(--rule); background: var(--bg); }
.wordmark { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); font-family: var(--mono); font-size: 1rem; font-weight: 700; text-decoration: none; }
.wordmark:hover { color: var(--ink); }
.wordmark-stamp { display: grid; width: 1.8rem; height: 1.8rem; place-items: center; border: 1.5px solid var(--accent); color: var(--accent); font-family: var(--mono); font-size: .95rem; font-weight: 700; }
.masthead-note { margin: 0; padding-left: 1rem; border-left: 1px solid var(--hair); color: var(--muted); font-family: var(--mono); font-size: .66rem; line-height: 1.4; text-transform: uppercase; letter-spacing: .06em; }
.primary-nav { display: flex; align-items: center; font-family: var(--mono); font-size: .74rem; }
.primary-nav a { padding: .35rem .8rem; border-left: 1px solid var(--hair); color: var(--ink); text-decoration: none; }
.primary-nav a:hover { color: var(--accent); }
.primary-nav a[aria-current] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }

main { max-width: 1360px; margin: 0 auto; padding: 0 clamp(1.2rem, 5vw, 4rem); counter-reset: listing; }

/* Type */
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: var(--sans); font-weight: 650; letter-spacing: -.03em; }
h1 em, h2 em { color: var(--accent); font-style: normal; }

/* Hero: the main view of the drawing */
.hero { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: clamp(2rem, 6vw, 6rem); padding: clamp(3.5rem, 8vw, 7rem) 0; }
.hero::before { position: absolute; z-index: -1; inset: 0 calc(50% - 50vw); content: ""; background-image: var(--grid-paper); background-size: 24px 24px; background-position: center top; }
.hero-copy { max-width: 640px; }
.overline, .section-kicker, .source-label, .code-caption, .specimen-cap, .ticker, .evidence-number { font-family: var(--mono); }
.overline, .section-kicker { color: var(--accent); font-size: .7rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.overline { display: inline-block; margin-bottom: 1.4rem; padding: .25rem .55rem; border: 1px solid var(--accent); background: var(--bg); }
.proof-dot { display: none; }
h1 { margin-bottom: 1.4rem; font-size: clamp(3rem, 6.6vw, 6.2rem); line-height: .98; }
.hero-intro { max-width: 34rem; color: var(--muted); font-size: clamp(1.08rem, 1.5vw, 1.25rem); }
.hero-links { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.4rem; margin-top: 2rem; font-family: var(--mono); font-size: .8rem; }
.ink-link { padding: .7rem 1.1rem; border: 1px solid var(--ink); color: var(--bg); background: var(--ink); text-decoration: none; }
.ink-link:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent); }
.quiet-link { color: var(--ink); }
.hero-footnote, .margin-note { max-width: 34rem; margin-top: 2.2rem; color: var(--muted); font-size: .88rem; }
.margin-mark { padding-right: .4rem; color: var(--accent); font-family: var(--mono); font-size: .76rem; font-weight: 700; }

.specimen { position: relative; margin: 0; border: 1px solid var(--rule); background: var(--panel); outline: 1px dashed var(--syntax); outline-offset: 7px; }
.specimen-cap { display: flex; justify-content: space-between; padding: .5rem .9rem; border-bottom: 1px solid var(--rule); color: var(--ink); background: var(--bg-alt); font-size: .7rem; letter-spacing: .04em; }
.specimen-cap span:first-child { font-weight: 700; }
.specimen-cap span:last-child { color: var(--muted); }
.preview-controls { display: none; border-bottom: 1px solid var(--hair); }
.js-ready .preview-controls { display: flex; }
.preview-controls button { padding: .45rem .9rem; border: 0; border-right: 1px solid var(--hair); color: var(--muted); background: transparent; font-family: var(--mono); font-size: .72rem; cursor: pointer; }
.preview-controls button:hover { color: var(--ink); }
.preview-controls button[aria-pressed="true"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.specimen-source, .specimen-output { padding: .9rem; }
.specimen-source { border-bottom: 1px dashed var(--hair); }
.source-label { display: block; margin-bottom: .5rem; color: var(--muted); font-size: .66rem; letter-spacing: .06em; }
.specimen-register { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule); color: var(--muted); font-family: var(--mono); font-size: .66rem; letter-spacing: .04em; }
.specimen-register span { padding: .45rem .9rem; }
.specimen-register span + span { border-left: 1px solid var(--hair); text-align: right; }
.hero-index { position: absolute; right: 0; bottom: 1rem; margin: 0; padding: .2rem .5rem; border: 1px solid var(--hair); color: var(--muted); background: var(--bg); font-family: var(--mono); font-size: .64rem; letter-spacing: .08em; }
.hero-index::before { content: "DWG "; color: var(--syntax); }

pre { max-width: 100%; margin: 0; overflow: auto; color: var(--code-ink); background: var(--code); font-size: clamp(.72rem, 1vw, .84rem); line-height: 1.7; tab-size: 4; }
pre code { display: block; padding: 1rem 1.1rem; font-size: inherit; white-space: pre; }
.specimen pre { color: var(--ink); background: var(--panel); }
.specimen pre code { padding: .2rem 0; }

/* Spec strip under the hero */
.ticker { display: flex; align-items: stretch; margin: 0 calc(clamp(1.2rem, 5vw, 4rem) * -1); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--bg); font-size: .72rem; letter-spacing: .04em; white-space: nowrap; }
.ticker span { flex: 1; padding: .7rem clamp(1rem, 2vw, 1.5rem); border-right: 1px solid var(--hair); }
.ticker span:first-child { padding-left: clamp(1.2rem, 5vw, 4rem); }
.ticker span:last-child { border-right: 0; }
.ticker i { display: none; }

/* Sections: numbered like sheet zones */
.field-section { position: relative; display: grid; grid-template-columns: 5rem 1fr; padding: clamp(4rem, 8vw, 6.5rem) 0; border-bottom: 1px solid var(--hair); }
.field-section::before { align-self: start; width: 3.6rem; padding-top: .35rem; border-top: 2px solid var(--accent); color: var(--muted); content: "SEC " attr(data-index); font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; }
.section-body { min-width: 0; max-width: 980px; }
.section-kicker { margin-bottom: 1rem; }
h2 { margin-bottom: 1.4rem; font-size: clamp(2.3rem, 4.6vw, 4.1rem); line-height: 1.04; }
h3 { font-size: 1.2rem; font-weight: 650; letter-spacing: -.01em; }
.lede { max-width: 50rem; font-size: clamp(1.08rem, 1.6vw, 1.3rem); line-height: 1.5; }
.split-copy { display: grid; grid-template-columns: 1fr .9fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; margin: 2.5rem 0; }
.split-copy p { color: var(--muted); }
.command-slip { position: relative; border: 1px solid var(--rule); background: var(--panel); }
.command-slip .source-label { margin: 0; padding: .45rem .8rem; border-bottom: 1px solid var(--rule); color: var(--ink); background: var(--bg-alt); }
.command-slip p { margin: 0; padding: .6rem .8rem; font-size: .84rem; }
.small-heading { margin: 3rem 0 .5rem; }
.code-proof { position: relative; margin: 1.3rem 0; border: 1px solid var(--rule); }
.code-caption { display: block; padding: .45rem .8rem; border-bottom: 1px solid var(--rule); color: var(--ink); background: var(--bg-alt); font-size: .7rem; letter-spacing: .03em; counter-increment: listing; }
.code-caption::before { color: var(--accent); content: "LST-" counter(listing, decimal-leading-zero) "  "; font-weight: 700; white-space: pre; }
.source-fold .code-proof { border: 0; }

/* Conformance: test record */
.scoreline { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; margin: 3rem 0; border: 1px solid var(--rule); background: var(--panel); }
.score { position: relative; display: grid; gap: .5rem; padding: 1.4rem 1.6rem; }
.score::after { position: absolute; top: 1rem; right: 1rem; padding: .1rem .4rem; border: 1px solid var(--accent); color: var(--accent); content: "PASS"; font-family: var(--mono); font-size: .62rem; font-weight: 700; letter-spacing: .1em; }
.score strong { color: var(--ink); font-family: var(--mono); font-size: clamp(2.3rem, 5vw, 4.4rem); font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: -.04em; line-height: 1; white-space: nowrap; }
.score:first-child strong { color: var(--accent); }
.score strong span { padding: 0 .1em; color: var(--syntax); font-weight: 400; }
.score-label { color: var(--muted); font-family: var(--mono); font-size: .7rem; letter-spacing: .03em; line-height: 1.45; }
.score-divider { display: grid; place-items: center; padding: 0 1rem; border-right: 1px solid var(--hair); border-left: 1px solid var(--hair); color: var(--syntax); font-family: var(--mono); font-size: 1.2rem; }
.spec-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.spec-notes p { color: var(--muted); font-size: .88rem; }
.source-citation { margin-top: 1.6rem; color: var(--muted); font-family: var(--mono); font-size: .74rem; }

/* Extension table: a parts list */
.extension-table-wrap { margin: 2.5rem 0 1rem; overflow-x: auto; border: 1px solid var(--rule); background: var(--panel); }
.extension-table { width: 100%; border-collapse: collapse; text-align: left; counter-reset: part; }
.extension-table th, .extension-table td { padding: .65rem .8rem; border-bottom: 1px solid var(--hair); vertical-align: top; }
.extension-table th + td, .extension-table td + td, .extension-table th + th { border-left: 1px solid var(--hair); }
.extension-table thead th { border-bottom: 1px solid var(--rule); color: var(--muted); background: var(--bg-alt); font-family: var(--mono); font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.extension-table tbody tr { counter-increment: part; }
.extension-table tbody tr:last-child th, .extension-table tbody tr:last-child td { border-bottom: 0; }
.extension-table tbody th { width: 30%; font-family: var(--mono); font-size: .8rem; font-weight: 400; }
.extension-table tbody th::before { display: inline-block; width: 2.2rem; color: var(--syntax); content: counter(part, decimal-leading-zero); }
.extension-table tbody tr:hover { background: var(--bg); }
.extension-table td { color: var(--muted); font-size: .9rem; }

/* Custom block guide: process steps */
.work-steps { display: grid; grid-template-columns: repeat(4, 1fr); margin: 2.5rem 0; padding: 0; border: 1px solid var(--rule); background: var(--panel); list-style: none; counter-reset: steps; }
.work-steps li { display: grid; align-content: start; gap: .6rem; padding: 1rem; border-right: 1px solid var(--hair); counter-increment: steps; }
.work-steps li:last-child { border-right: 0; }
.work-steps b { font-family: var(--mono); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.work-steps b::before { display: block; margin-bottom: .4rem; color: var(--accent); content: "STEP " counter(steps, decimal-leading-zero); font-size: .66rem; letter-spacing: .08em; }
.work-steps span { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.source-fold { margin: 2rem 0; border: 1px solid var(--rule); background: var(--panel); }
.source-fold summary { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; color: var(--ink); font-family: var(--mono); font-size: .8rem; cursor: pointer; }
.source-fold summary:hover { color: var(--accent); }
.source-fold summary span { color: var(--muted); font-size: .7rem; }
.source-fold[open] summary { border-bottom: 1px solid var(--rule); background: var(--bg-alt); }

/* Custom renderer guide */
.renderer-demo { grid-template-columns: 1.3fr .7fr; }
.check-list, .migration-list { padding-left: 0; list-style: none; }
.check-list li, .migration-list li { position: relative; padding: .35rem 0 .35rem 1.6rem; border-bottom: 1px dashed var(--hair); color: var(--muted); }
.check-list li::before, .migration-list li::before { position: absolute; left: 0; font-family: var(--mono); font-size: .85em; }
.check-list li::before { color: var(--accent); content: "✓"; font-weight: 700; }
.migration-list li::before { color: var(--syntax); content: "—"; }
.renderer-margin p { margin-top: 1.2rem; color: var(--muted); font-size: .9rem; }

/* Architecture figure: a block diagram on grid paper */
.architecture { margin: 3rem 0 1rem; padding: 1.2rem; border: 1px solid var(--rule); background-color: var(--panel); background-image: var(--grid-paper); background-size: 20px 20px; }
.architecture svg { display: block; width: 100%; height: auto; color: var(--ink); }
.diagram-lines { stroke-width: 1.5; }
.diagram-node rect { fill: var(--panel); stroke: currentColor; stroke-width: 1.5; }
.diagram-node .tree-node { fill: var(--mark); stroke: var(--accent); stroke-width: 2; }
.diagram-node text { fill: var(--ink); font-family: var(--mono); font-size: 15px; font-weight: 600; }
.diagram-node .diagram-small { fill: var(--muted); font-size: 10px; font-weight: 400; }
.diagram-node .tree-node + text, .diagram-node .tree-node + text + text { fill: var(--mark-ink); }
.diagram-note { fill: var(--accent); font-family: var(--mono); font-size: 10px; }
.architecture figcaption { margin-top: 1rem; padding-top: .6rem; border-top: 1px solid var(--hair); color: var(--muted); font-family: var(--mono); font-size: .72rem; }

/* Platforms, evidence, migration */
.platform-strip { display: grid; grid-template-columns: repeat(2, 1fr); margin: 2.5rem 0; border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); background: var(--panel); }
.platform-strip p { display: grid; gap: .3rem; margin: 0; padding: 1.1rem 1rem; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.platform-strip b { font-family: var(--mono); font-size: .82rem; }
.platform-strip span { color: var(--muted); font-size: .9rem; }
.evidence-list { margin: 2.5rem 0; border-top: 1px solid var(--rule); }
.evidence-list article { display: grid; grid-template-columns: 3rem 1fr auto; align-items: center; gap: 1rem; padding: 1.2rem 0; border-bottom: 1px solid var(--hair); }
.evidence-number { display: grid; width: 2rem; height: 2rem; place-items: center; border: 1px solid var(--accent); color: var(--accent); font-size: .8rem; font-weight: 700; }
.evidence-list article:hover .evidence-number { color: var(--accent-ink); background: var(--accent); }
.evidence-list h3 { margin: 0; }
.evidence-list p { margin: .2rem 0 0; color: var(--muted); font-size: .9rem; }
.evidence-link { font-family: var(--mono); font-size: .76rem; white-space: nowrap; }
.migration-compare { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; margin: 2.5rem 0; border: 1px solid var(--rule); background: var(--panel); }
.migration-compare > div { display: grid; gap: .3rem; padding: 1rem; }
.migration-compare > div:first-child code { color: var(--muted); }
.migration-compare > div:last-child { color: var(--mark-ink); background: var(--mark); }
.migration-compare > div:last-child .source-label { color: var(--mark-ink); }
.migration-compare code { overflow-wrap: anywhere; border: 0; background: none; }
.compare-arrow { display: grid; place-items: center; padding: 0 1rem; border-right: 1px solid var(--rule); border-left: 1px solid var(--rule); color: var(--accent); font-family: var(--mono); }
.migration-list { margin-bottom: 2rem; }
.contribute-links { display: flex; flex-wrap: wrap; gap: 1.2rem; font-family: var(--mono); font-size: .8rem; }
.license-line { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--hair); color: var(--muted); font-size: .88rem; }

/* Documentation pages: a sheet index beside the drawing */
.doc-layout { display: grid; grid-template-columns: 16rem minmax(0, 1fr); max-width: 1360px; margin: 0 auto; }
.doc-index { position: sticky; top: 3.1rem; align-self: start; max-height: calc(100vh - 3.1rem); overflow-y: auto; padding: 2.4rem 1.2rem 2.4rem clamp(1.2rem, 4vw, 3.5rem); border-right: 1px solid var(--hair); font-family: var(--mono); font-size: .76rem; }
.doc-index-title { margin: 1.5rem 0 .45rem; color: var(--muted); font-size: .64rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.doc-index-title:first-child { margin-top: 0; }
.doc-index ul { margin: 0; padding: 0; border-left: 1px solid var(--hair); list-style: none; }
.doc-index a { display: flex; gap: .55rem; margin-left: -1px; padding: .2rem .7rem; border-left: 2px solid transparent; color: var(--ink); text-decoration: none; }
.doc-index a:hover { color: var(--accent); }
.doc-index a[aria-current="page"] { border-left-color: var(--accent); color: var(--accent); font-weight: 700; }
.doc-index-number { color: var(--syntax); font-weight: 400; }
.doc-main { min-width: 0; max-width: 940px; margin: 0; padding: clamp(2.5rem, 5vw, 4rem) clamp(1.2rem, 5vw, 4rem) 4rem; counter-reset: listing doc-section; }
.doc-body > .doc-main { margin: 0 auto; }
.doc-header { position: relative; padding-bottom: 2.2rem; border-bottom: 1px solid var(--rule); }
.doc-header h1 { margin-bottom: 1rem; font-size: clamp(2.4rem, 5vw, 3.8rem); line-height: 1.02; }
.doc-header .lede { color: var(--muted); }
.spec-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 2rem 0 0; border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); background: var(--panel); }
.spec-card div { min-width: 0; padding: .7rem .9rem; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.spec-card dt { margin-bottom: .25rem; color: var(--muted); font-family: var(--mono); font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; }
.spec-card dd { margin: 0; font-size: .9rem; overflow-wrap: anywhere; }
.spec-card code { border: 0; padding: 0; background: none; }
.doc-section { padding: 2.8rem 0 .4rem; counter-increment: doc-section; }
.doc-section h2 { display: flex; align-items: baseline; gap: .8rem; margin-bottom: 1rem; font-size: clamp(1.5rem, 2.4vw, 1.9rem); letter-spacing: -.02em; line-height: 1.2; }
.doc-section h2::before { color: var(--accent); content: counter(doc-section, decimal-leading-zero); font-family: var(--mono); font-size: .78rem; font-weight: 600; letter-spacing: .04em; }
.doc-section > p, .doc-section li { max-width: 48rem; }
.doc-section .extension-table-wrap { margin: 1.2rem 0; }
.doc-section .extension-table tbody th { width: 34%; }
.doc-section .extension-table tbody th::before { content: none; }
#modules .extension-table tbody th::before { content: counter(part, decimal-leading-zero); }
.doc-section .command-slip { max-width: 44rem; margin: 1rem 0 1.4rem; }
.doc-section .migration-list { margin: 1rem 0; }
.io-pair { display: grid; grid-template-columns: minmax(0, 1fr); margin: 1.3rem 0; border: 1px solid var(--rule); background: var(--panel); }
.io-panel { min-width: 0; padding: .8rem .9rem; }
.io-panel pre { color: var(--ink); background: transparent; }
.io-panel pre code { padding: .2rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.io-panel .tok-keyword { color: var(--accent); font-weight: 700; }
.io-panel .tok-string, .io-panel .tok-number { color: var(--mark-ink); }
.io-panel .tok-comment { color: var(--muted); }
.io-arrow { display: block; padding: .1rem .9rem; border-top: 1px dashed var(--hair); border-bottom: 1px dashed var(--hair); color: var(--accent); background: var(--bg-alt); font-family: var(--mono); font-size: .8rem; }
.io-arrow::after { content: " parse · render"; color: var(--muted); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; }
.io-pair .copy-button { display: none; }
.notice { max-height: 30rem; }
.notice code { white-space: pre-wrap; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.pager a { display: grid; gap: .2rem; padding: .8rem 1rem; border: 1px solid var(--hair); color: var(--ink); background: var(--panel); font-weight: 600; text-decoration: none; }
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pager span { color: var(--muted); font-family: var(--mono); font-size: .64rem; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; }
.pager-next { grid-column: 2; text-align: right; }

/* Footer: the title block */
.colophon { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 1.4rem clamp(1.2rem, 4vw, 3.5rem); border-top: 1px solid var(--rule); background: var(--bg-alt); }
.colophon p, .colophon > a:last-child { margin: 0; color: var(--muted); font-family: var(--mono); font-size: .7rem; }

/* Syntax tokens (code blocks are always dark) */
.tok-keyword { color: #8db6de; }
.tok-string { color: #b5c792; }
.tok-number { color: #d2b47a; }
.tok-comment { color: #6d7782; font-style: italic; }
.specimen .tok-keyword { color: var(--accent); font-weight: 700; }
.specimen .tok-string, .specimen .tok-number { color: var(--mark-ink); }
.copy-button { position: absolute; z-index: 1; right: .5rem; bottom: .5rem; padding: .25rem .55rem; border: 1px solid #3c444d; color: var(--code-ink); background: var(--code); font-family: var(--mono); font-size: .66rem; cursor: pointer; }
.copy-button:hover { border-color: #8db6de; color: #8db6de; }
.specimen .copy-button, .command-slip .copy-button { display: none; }
html.js-ready [hidden] { display: none !important; }

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #101418; --bg-alt: #182027; --panel: #131a20; --ink: #d9dfe5; --muted: #8f9aa5; --syntax: #56616c;
        --rule: #6f7c88; --hair: #27313a; --grid: rgb(141 182 222 / 6%); --accent: #8db6de; --accent-ink: #0d1722;
        --mark: #1c2e42; --mark-ink: #cfe0f2; --code: #0b0f13; --code-ink: #d9dfe5;
    }
}
@media (max-width: 900px) {
    .masthead { grid-template-columns: auto 1fr; gap: .6rem 1rem; }
    .masthead-note { justify-self: end; border-left: 0; text-align: right; }
    .primary-nav { grid-column: 1 / -1; justify-content: space-between; }
    .primary-nav a:first-child { border-left: 0; padding-left: 0; }
    .hero { grid-template-columns: 1fr; }
    .hero-index { display: none; }
    .field-section { grid-template-columns: 1fr; }
    .field-section::before { margin-bottom: 1rem; }
    .work-steps { grid-template-columns: repeat(2, 1fr); }
    .work-steps li:nth-child(2) { border-right: 0; }
    .work-steps li:nth-child(-n+2) { border-bottom: 1px solid var(--hair); }
    .ticker { overflow: auto; }
    .doc-layout { grid-template-columns: 1fr; }
    .doc-index { position: static; order: 2; max-height: none; padding: 2rem clamp(1.2rem, 5vw, 4rem); border-top: 1px solid var(--rule); border-right: 0; columns: 2; }
    .doc-index-title { break-after: avoid; }
    .doc-index ul { break-inside: avoid; }
}
@media (max-width: 620px) {
    .primary-nav { font-size: .66rem; }
    .primary-nav a { padding: .35rem .45rem; }
    .split-copy, .renderer-demo, .spec-notes { grid-template-columns: 1fr; gap: 1rem; }
    .scoreline, .migration-compare { grid-template-columns: 1fr; }
    .score-divider, .compare-arrow { padding: .3rem; border: 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
    .extension-table { min-width: 620px; }
    .work-steps, .platform-strip { grid-template-columns: 1fr; }
    .work-steps li { border-right: 0; border-bottom: 1px solid var(--hair); }
    .evidence-list article { grid-template-columns: 2.6rem 1fr; }
    .evidence-link { grid-column: 2; }
    .colophon { flex-wrap: wrap; gap: .8rem; }
    .spec-card, .pager { grid-template-columns: 1fr; }
    .pager-next { grid-column: 1; }
    .doc-index { columns: 1; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
@media print {
    :root { --bg: #fff; --bg-alt: #f2f2f2; --panel: #fff; --ink: #000; --muted: #333; --hair: #bbb; --grid: transparent; --accent: #000; --code: #f2f2f2; --code-ink: #000; }
    .masthead, .preview-controls, .copy-button, .skip-link, .hero-index, .doc-index, .pager { display: none !important; }
    .doc-layout { display: block; }
    main { max-width: none; padding: 0; }
    .specimen { outline: 0; }
    .field-section { padding: 1.5rem 0; break-inside: avoid; }
    details:not([open]) > *:not(summary) { display: block; }
    pre { white-space: pre-wrap; overflow-wrap: anywhere; }
    a[href^="http"]::after { content: " <" attr(href) ">"; font-size: .7em; }
}
