/* Video Studio docs site: shared styles. Light by default, one soft blue accent, dark only via the Theme toggle. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-2: #f7f8fb;
  --bg-3: #f0f2f7;
  --ink: #15171c;
  --ink-2: #454b57;
  --muted: #727987;
  --line: #e8eaf0;
  --line-2: #d9dce5;
  --accent: #3b6cf6;
  --accent-strong: #2c55d4;
  --accent-ink: #ffffff;
  --accent-soft: #eef3ff;
  --accent-line: #cdd9fb;
  --code-bg: #f3f5f9;
  --ok: #1f8a57;
  --warn: #a06a00;
  --bad: #c0392b;
  --shadow-sm: 0 1px 2px rgba(21, 23, 28, 0.04);
  --shadow: 0 1px 2px rgba(21, 23, 28, 0.04), 0 8px 24px rgba(21, 23, 28, 0.05);
  --shadow-lg: 0 2px 4px rgba(21, 23, 28, 0.04), 0 24px 56px rgba(21, 23, 28, 0.09);
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1120px;
  --measure: 70ch;
  --header-h: 60px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1013;
  --bg-2: #15181d;
  --bg-3: #1b1f26;
  --ink: #f1f2f4;
  --ink-2: #c6c9d1;
  --muted: #8d93a0;
  --line: #262a32;
  --line-2: #323744;
  --accent: #6b93ff;
  --accent-strong: #8aa9ff;
  --accent-ink: #0e1013;
  --accent-soft: #19233f;
  --accent-line: #2c3c68;
  --code-bg: #1a1d23;
  --ok: #55c28b;
  --warn: #e0b04a;
  --bad: #ff8a80;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 20px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: var(--accent-strong); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; z-index: 50; font-weight: 600; text-decoration: none; }
.skip:focus { top: 10px; }
img, video, svg { max-width: 100%; height: auto; }
::selection { background: var(--accent-soft); }

/* Type */
h1, h2, h3, h4 { line-height: 1.18; letter-spacing: -0.022em; font-weight: 700; margin: 0 0 0.5em; color: var(--ink); }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.4rem); letter-spacing: -0.03em; line-height: 1.08; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 2.6em; }
h3 { font-size: 1.22rem; margin-top: 1.9em; }
h4 { font-size: 1.02rem; margin-top: 1.5em; }
h2 + h3, h2:first-child, h3:first-child { margin-top: 0; }
h2 .anchor, h3 .anchor { color: var(--muted); text-decoration: none; margin-left: 0.35em; opacity: 0; font-weight: 500; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus-visible { opacity: 1; }
p { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.35em; margin: 0 0 1.1em; }
li { margin: 0.3em 0; }
li::marker { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.6em 0; }
strong { font-weight: 650; }
code, kbd, pre { font-family: var(--mono); font-size: 0.87em; }
code { background: var(--code-bg); padding: 0.12em 0.4em; border-radius: 6px; overflow-wrap: anywhere; }
kbd { background: var(--bg); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 0.05em 0.45em; }
pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  position: relative;
  margin: 0 0 1.3em;
  line-height: 1.55;
  max-width: 100%;
}
pre code { background: none; padding: 0; overflow-wrap: normal; font-size: 1em; }
pre:has(.copy) { padding-right: 76px; }
.copy {
  position: absolute; top: 8px; right: 8px;
  font: 600 12px var(--font);
  background: var(--bg); color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: 8px;
  padding: 4px 10px; cursor: pointer;
}
.copy:hover { border-color: var(--accent); color: var(--accent-strong); }
table { border-collapse: separate; border-spacing: 0; width: 100%; margin: 0 0 1.5em; font-size: 0.94em; display: block; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-weight: 650; background: var(--bg-2); white-space: nowrap; font-size: 0.9em; color: var(--ink-2); }
tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
blockquote { margin: 0 0 1.2em; padding: 0.3em 1.1em; border-left: 3px solid var(--accent-line); color: var(--ink-2); background: var(--bg-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
blockquote > :last-child { margin-bottom: 0; }
details { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 16px; margin: 0 0 10px; background: var(--bg); }
details[open] { padding-bottom: 10px; box-shadow: var(--shadow-sm); }
summary { cursor: pointer; font-weight: 600; padding: 12px 0; list-style-position: outside; }
summary::marker { color: var(--muted); }

/* Layout */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
header.site {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.5) blur(12px);
  -webkit-backdrop-filter: saturate(1.5) blur(12px);
  border-bottom: 1px solid var(--line);
}
header.site .wrap { display: flex; align-items: center; gap: 14px; min-height: var(--header-h); max-width: 1320px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -0.015em; white-space: nowrap; }
.brand .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); display: inline-block; box-shadow: 0 0 0 4px var(--accent-soft); }
nav.main { display: flex; gap: 1px; flex: 1; min-width: 0; justify-content: center; }
nav.main a {
  color: var(--ink-2); text-decoration: none; font-size: 0.9rem; font-weight: 500;
  padding: 6px 10px; border-radius: 8px; white-space: nowrap;
}
nav.main a:hover { background: var(--bg-3); color: var(--ink); }
nav.main a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 650; }
.tools { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.btn {
  font: 600 0.9rem var(--font); cursor: pointer; text-decoration: none; line-height: 1.2;
  border: 1px solid var(--line-2); background: var(--bg); color: var(--ink);
  border-radius: 10px; padding: 8px 14px; display: inline-flex; align-items: center; gap: 7px;
  box-shadow: var(--shadow-sm); transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.lg { padding: 12px 22px; font-size: 1rem; border-radius: 12px; }
.btn.ghost { background: transparent; box-shadow: none; }
.menu-btn { display: none; }
.menu-btn .bars, .menu-btn .bars::before, .menu-btn .bars::after { display: block; width: 16px; height: 2px; background: currentColor; border-radius: 2px; position: relative; content: ""; }
.menu-btn .bars::before { position: absolute; top: -5px; left: 0; }
.menu-btn .bars::after { position: absolute; top: 5px; left: 0; }

main { padding: 56px 0 104px; }
main > .wrap > :first-child { margin-top: 0; }

/* Hero */
.hero { padding: 32px 0 12px; }
.hero h1 { max-width: 20ch; }
.hero-band {
  background: radial-gradient(1200px 380px at 85% -10%, var(--accent-soft), transparent 70%), var(--bg-2);
  border-bottom: 1px solid var(--line);
  margin: -56px calc(50% - 50vw) 48px; padding: 76px 0 56px;
}
.hero-band .wrap { max-width: var(--maxw); }
.hero p.lead, p.lead { font-size: clamp(1.1rem, 2.2vw, 1.3rem); color: var(--ink-2); max-width: 60ch; line-height: 1.6; }
.eyebrow { color: var(--accent-strong); font-weight: 650; font-size: 0.84rem; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 0.9em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.6em 0 0; }
.hero-media { margin: 40px 0 0; border-radius: 18px; overflow: hidden; border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); background: #0b0c0e; line-height: 0; }
.hero-media video, .hero-media img { width: 100%; display: block; aspect-ratio: 16 / 9; object-fit: cover; }
.hero-cap { color: var(--muted); font-size: 0.88rem; margin: 10px 2px 0; }

/* Sections */
.section { margin: 72px 0 0; }
.section > h2 { margin-top: 0; }
.section-head { margin-bottom: 1.4em; max-width: 62ch; }
.section-head p { color: var(--ink-2); margin: 0; font-size: 1.05rem; }

/* Cards and grids */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin: 1.2em 0 2em; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 20px 18px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 7px; min-width: 0;
}
.card h3, .card h4 { margin: 0; font-size: 1.06rem; letter-spacing: -0.012em; }
.card p { margin: 0; color: var(--ink-2); font-size: 0.94rem; line-height: 1.55; }
.card .meta { color: var(--muted); font-size: 0.84rem; margin-top: auto; padding-top: 6px; }
a.card { text-decoration: none; color: inherit; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
a.card:hover { border-color: var(--accent-line); transform: translateY(-2px); box-shadow: var(--shadow); }
a.card:hover h3 { color: var(--accent-strong); }
.card .icon { width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; margin-bottom: 6px; }
.card .icon svg { width: 20px; height: 20px; }
.badge {
  align-self: flex-start;
  display: inline-block; font-size: 0.76rem; font-weight: 650; padding: 2px 10px; border-radius: 999px; line-height: 1.5;
  background: var(--accent-soft); color: var(--accent-strong); border: 1px solid transparent;
}
.badge.ok { background: color-mix(in srgb, var(--ok) 13%, transparent); color: var(--ok); }
.badge.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.badge.bad { background: color-mix(in srgb, var(--bad) 13%, transparent); color: var(--bad); }
.badge.plain { background: var(--bg-3); color: var(--ink-2); }

/* Stats */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 1.2em 0; }
.stat { border: 1px solid var(--line); background: var(--bg-2); border-radius: var(--radius); padding: 18px 18px 16px; }
.stat b { display: block; font-size: clamp(1.9rem, 4vw, 2.5rem); line-height: 1; letter-spacing: -0.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat span { display: block; color: var(--ink-2); font-size: 0.9rem; margin-top: 8px; line-height: 1.35; }
.stat small { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 2px; }

/* Callouts */
.callout {
  border: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--bg-2);
  border-radius: var(--radius-sm); padding: 14px 18px; margin: 0 0 1.3em;
}
.callout > :last-child { margin-bottom: 0; }
.callout.warn { border-left-color: var(--warn); }
.callout.ok { border-left-color: var(--ok); }
.callout.bad { border-left-color: var(--bad); }
.callout .title { font-weight: 700; margin-bottom: 0.3em; }

/* Steps and flow */
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding: 4px 0 18px 52px; margin: 0; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 2px; width: 34px; height: 34px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; font-size: 0.95rem;
  display: grid; place-items: center; border: 1px solid var(--accent-line);
}
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 16.5px; top: 40px; bottom: 4px; width: 1px; background: var(--line-2); }
.steps > li > :first-child { margin-top: 0; }
.steps > li strong:first-child { display: inline-block; font-size: 1.04rem; }
.flow { list-style: none; padding: 0; margin: 1.4em 0 2em; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; counter-reset: flow; }
.flow > li { counter-increment: flow; position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px 16px; margin: 0; box-shadow: var(--shadow-sm); }
.flow > li::before { content: counter(flow); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 0.9rem; margin-bottom: 12px; }
.flow > li:not(:last-child)::after { content: ""; position: absolute; top: 33px; left: calc(100% - 2px); width: 16px; height: 2px; background: var(--accent-line); z-index: 1; }
.flow h3 { margin: 0 0 4px; font-size: 1.02rem; }
.flow p { margin: 0; color: var(--ink-2); font-size: 0.9rem; line-height: 1.5; }
.flow .tag { display: block; margin-top: 10px; color: var(--muted); font-size: 0.8rem; font-family: var(--mono); }

/* Misc blocks */
.two { display: grid; gap: 32px; grid-template-columns: 1fr 1fr; align-items: start; }
.toc { border: 1px solid var(--line); background: var(--bg-2); border-radius: var(--radius); padding: 14px 20px; margin: 0 0 2em; }
.toc ul { margin: 0; list-style: none; padding: 0; columns: 2; column-gap: 28px; }
.toc li { margin: 0.25em 0; break-inside: avoid; }
.crumbs, nav.crumbs { color: var(--muted); font-size: 0.88rem; margin-bottom: 1.4em; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent-strong); text-decoration: underline; }
.crumbs span.sep { opacity: 0.5; }
.crumbs [aria-current] { color: var(--ink-2); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1.2em; align-items: center; }
.filters input[type="search"], .filters select {
  font: 500 0.95rem var(--font); color: var(--ink); background: var(--bg);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 13px; min-width: 0;
}
.filters input[type="search"] { flex: 1 1 240px; }
.hidden { display: none !important; }
figure { margin: 0 0 1.5em; }
figure img, figure video { border-radius: var(--radius); border: 1px solid var(--line); display: block; }
figcaption { color: var(--muted); font-size: 0.88rem; margin-top: 8px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 1.4em; }
.kv dt { color: var(--muted); font-size: 0.9rem; }
.kv dd { margin: 0; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1.4em; padding: 0; list-style: none; }
.pills li { margin: 0; }
.pills a, .pills span { display: inline-block; padding: 5px 13px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 0.88rem; text-decoration: none; color: var(--ink-2); background: var(--bg); }
.pills a:hover { border-color: var(--accent); color: var(--accent-strong); }

/* Doc layout: prose with sticky in-page table of contents */
.doc { display: grid; grid-template-columns: minmax(0, 1fr) 232px; gap: 56px; align-items: start; }
.doc > .prose, .doc > .doc-main { grid-column: 1; grid-row: 1; min-width: 0; }
.doc-toc {
  grid-column: 2; grid-row: 1;
  position: sticky; top: calc(var(--header-h) + 24px);
  max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto;
  font-size: 0.88rem; line-height: 1.4; padding: 2px 0 2px 18px; border-left: 1px solid var(--line);
}
.doc-toc .toc-title { font-size: 0.74rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); font-weight: 650; margin: 0 0 10px; }
.doc-toc ul { list-style: none; margin: 0; padding: 0; }
.doc-toc li { margin: 0; }
.doc-toc a { display: block; padding: 5px 0 5px 0; color: var(--ink-2); text-decoration: none; border-left: 2px solid transparent; margin-left: -20px; padding-left: 18px; }
.doc-toc li.l3 a { padding-left: 32px; font-size: 0.93em; color: var(--muted); }
.doc-toc a:hover { color: var(--ink); }
.doc-toc a.active { color: var(--accent-strong); border-left-color: var(--accent); font-weight: 600; }
.prose { max-width: var(--measure); }
.prose.wide { max-width: none; }
.prose > h1 { margin-bottom: 0.4em; }
.prose h2 { padding-top: 0.2em; }
.prose h2:not(:first-child) { border-top: 1px solid var(--line); padding-top: 1.4em; margin-top: 2.4em; }
.prose img { border-radius: var(--radius-sm); }
.prose table { max-width: 100%; }
.prose-wrap { max-width: var(--measure); }

/* Prev / next */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 64px 0 0; padding-top: 28px; border-top: 1px solid var(--line); max-width: var(--measure); }
.pager a { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; text-decoration: none; color: var(--ink); background: var(--bg); box-shadow: var(--shadow-sm); transition: border-color 0.15s, transform 0.15s; }
.pager a:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.pager small { display: block; color: var(--muted); font-size: 0.8rem; margin-bottom: 2px; }
.pager strong { font-size: 1rem; }
.pager .next { text-align: right; grid-column: 2; }
.pager .prev { grid-column: 1; }

footer.site { border-top: 1px solid var(--line); padding: 36px 0 56px; color: var(--muted); font-size: 0.9rem; background: var(--bg-2); }
footer.site .cols { display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; }
footer.site a { color: var(--ink-2); }
footer.site strong { color: var(--ink); }

/* Tour/home helpers */
.map { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 0 0 1.6em; }
.map > div { display: grid; grid-template-columns: minmax(130px, 200px) 1fr; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--line); align-items: baseline; }
.map > div:last-child { border-bottom: 0; }
.map > div:nth-child(even) { background: var(--bg-2); }
.map code { background: none; padding: 0; font-weight: 600; color: var(--accent-strong); }
.map span { color: var(--ink-2); font-size: 0.95rem; }
.brief { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); margin: 0 0 18px; box-shadow: var(--shadow-sm); overflow: hidden; }
.brief > .brief-head { padding: 12px 18px; background: var(--bg-2); border-bottom: 1px solid var(--line); font-weight: 650; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.brief pre { border: 0; border-radius: 0; margin: 0; background: transparent; white-space: pre-wrap; word-break: break-word; }
.gloss { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin: 0 0 1.6em; }
.gloss > div { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--bg); }
.gloss dt, .gloss strong.term { font-weight: 700; display: block; margin-bottom: 3px; }
.gloss p { margin: 0; color: var(--ink-2); font-size: 0.93rem; line-height: 1.5; }
.days { display: grid; gap: 10px; margin: 0 0 1.6em; }
.day { display: grid; grid-template-columns: 76px 1fr; gap: 16px; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; background: var(--bg); align-items: start; }
.day .n { text-align: center; background: var(--accent-soft); color: var(--accent-strong); border-radius: 11px; padding: 8px 0 6px; font-weight: 700; line-height: 1.1; }
.day .n small { display: block; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 650; }
.day .n b { font-size: 1.6rem; }
.day h3 { margin: 0 0 2px; font-size: 1.04rem; }
.day p { margin: 0; color: var(--ink-2); font-size: 0.94rem; }
.engines th:first-child, .engines td:first-child { white-space: nowrap; font-weight: 650; }

/* Responsive */
@media (max-width: 1180px) {
  .menu-btn { display: inline-flex; }
  header.site .wrap { flex-wrap: wrap; row-gap: 0; }
  .tools { order: 2; }
  .brand { order: 1; }
  .menu-btn { order: 3; }
  nav.main {
    order: 4; flex-basis: 100%; display: none; flex-direction: column; gap: 2px;
    padding: 6px 0 14px; border-top: 1px solid var(--line); margin-top: 0; justify-content: flex-start;
  }
  header.site.open nav.main { display: flex; }
  nav.main a { padding: 11px 12px; font-size: 1rem; }
  header.site .wrap { padding-top: 0; padding-bottom: 0; }
  header.site .wrap > .brand, header.site .wrap > .tools { min-height: var(--header-h); }
  .menu-btn { align-self: center; margin-left: 4px; }
  header.site .wrap > .tools { margin-left: auto; }
}
@media (max-width: 960px) {
  .doc { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .doc-toc {
    grid-column: 1; grid-row: 1; position: static; max-height: none; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--bg-2); padding: 14px 18px; margin: 0 0 2em;
  }
  .doc > .prose, .doc > .doc-main { grid-row: 2; }
  .doc-toc a { margin-left: 0; padding-left: 0; border-left: 0; }
  .doc-toc li.l3 a { padding-left: 16px; }
  .doc-toc a.active { border-left: 0; }
  .flow { grid-template-columns: 1fr; }
  .flow > li { padding-left: 64px; }
  .flow > li::before { position: absolute; left: 16px; top: 16px; margin: 0; }
  .flow > li:not(:last-child)::after { top: 48px; left: 30px; width: 2px; height: calc(100% - 32px); }
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .two { grid-template-columns: 1fr; gap: 12px; }
  .toc ul { columns: 1; }
  body { font-size: 16px; }
  main { padding: 32px 0 72px; }
  .wrap { padding: 0 16px; }
  .hero-band { margin-top: -32px; padding: 44px 0 36px; }
  .section { margin-top: 52px; }
  .map > div { grid-template-columns: 1fr; gap: 2px; }
  .day { grid-template-columns: 56px 1fr; gap: 12px; padding: 12px 14px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next, .pager .prev { grid-column: 1; text-align: left; }
  .hero-media { border-radius: 12px; margin-top: 28px; }
  .tools .btn { padding: 8px 11px; }
}
@media (max-width: 420px) {
  .tools .btn:not(#theme-toggle) { display: none; }
  .cta .btn { flex: 1 1 100%; justify-content: center; }
}
@media print {
  header.site, footer.site, .copy, .cta, .filters, .doc-toc, .pager, .menu-btn { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  main { padding: 0; }
  .doc { display: block; }
  a { color: inherit; }
  .card, .callout, pre, table, figure { break-inside: avoid; }
  .hero-band { background: none; border: 0; margin: 0; padding: 0; }
}

/* Wide prose: text keeps a readable measure, blocks use the full column */
.prose.wide > p, .prose.wide > ul, .prose.wide > ol, .prose.wide > blockquote { max-width: 70ch; }
.prose.wide { max-width: none; }
main > .wrap > .hero-band { margin-top: -56px; }
@media (max-width: 820px) { main > .wrap > .hero-band { margin-top: -32px; } }
.grid > *, .two > *, .doc > *, .stats > * { min-width: 0; }
.section-head h2, .section-head p.eyebrow + h2 { margin-top: 0; }
.section-head .eyebrow { margin-bottom: 0.5em; }
header.site { background: color-mix(in srgb, var(--bg) 94%, transparent); }
