/* PAVE Engine Study Archive — modern edition */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --sunk: #f2f0ea;
  --ink: #16181d;
  --ink-2: #3a3f4b;
  --muted: #6a7080;
  --line: #e3e0d7;
  --line-2: #d3cfc3;
  --accent: #1f4fb8;
  --accent-ink: #173d8f;
  --accent-soft: #e8eefb;
  --warm: #d4581f;
  --hero: #0d1424;
  --shadow: 0 1px 2px rgb(16 20 30 / .06), 0 6px 24px rgb(16 20 30 / .06);
  --serif: "Iowan Old Style", "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --bar-h: 58px;
  --radius: 10px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e1015;
  --surface: #161a22;
  --sunk: #12151c;
  --ink: #e8eaf0;
  --ink-2: #c3c8d4;
  --muted: #8b92a3;
  --line: #262b36;
  --line-2: #343a48;
  --accent: #8eb0ff;
  --accent-ink: #b5caff;
  --accent-soft: #1b2540;
  --warm: #ff8a4c;
  --hero: #080b12;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 30px rgb(0 0 0 / .25);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1015; --surface: #161a22; --sunk: #12151c; --ink: #e8eaf0; --ink-2: #c3c8d4; --muted: #8b92a3;
    --line: #262b36; --line-2: #343a48; --accent: #8eb0ff; --accent-ink: #b5caff; --accent-soft: #1b2540;
    --warm: #ff8a4c; --hero: #080b12; --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 30px rgb(0 0 0 / .25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 16px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); text-rendering: optimizeLegibility; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-ink); }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 30; height: var(--bar-h);
  display: flex; align-items: center; gap: 18px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 15px; white-space: nowrap; }
.brand b { letter-spacing: .06em; }
.brand:hover { color: var(--ink); }
.bar-links { display: flex; gap: 4px; margin-left: 8px; }
.bar-links a { color: var(--ink-2); text-decoration: none; font-size: 14.5px; padding: 6px 10px; border-radius: 8px; }
.bar-links a:hover { background: var(--sunk); color: var(--ink); }
.bar-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-btn {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 10px; min-width: 200px;
  border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); color: var(--muted);
  font: inherit; font-size: 14px; cursor: pointer;
}
.search-btn span { flex: 1; text-align: left; }
.search-btn svg { width: 17px; height: 17px; }
kbd { font: 12px var(--mono); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; color: var(--muted); background: var(--sunk); }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 1px solid transparent; background: none; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--sunk); }
.nav-toggle { display: none; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
.classic-link { font-size: 13px; color: var(--muted); text-decoration: none; border: 1px solid var(--line-2); padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.classic-link:hover { color: var(--ink); border-color: var(--muted); }

/* ---------- document layout ---------- */
.doc { display: grid; grid-template-columns: 290px minmax(0, 1fr) 230px; gap: 0; max-width: 1480px; margin: 0 auto; }
.toc {
  position: sticky; top: var(--bar-h); align-self: start; height: calc(100vh - var(--bar-h)); overflow-y: auto;
  padding: 26px 18px 40px 22px; border-right: 1px solid var(--line); font-size: 14px; scrollbar-width: thin;
}
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; color: var(--ink-2); text-decoration: none; padding: 5px 10px; border-radius: 7px; line-height: 1.35; }
.toc a:hover { background: var(--sunk); color: var(--ink); }
.toc a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.toc .solo, .toc summary > a { font-weight: 600; color: var(--ink); }
.toc details { margin: 2px 0; }
.toc summary { list-style: none; display: flex; align-items: center; cursor: pointer; border-radius: 7px; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: ""; width: 7px; height: 7px; margin: 0 10px 0 auto; flex: none; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; }
.toc details[open] > summary::after { transform: rotate(45deg); }
.toc summary > a { flex: 1; }
.toc-l1 { margin: 2px 0 8px 10px !important; border-left: 1px solid var(--line); padding-left: 6px !important; }
.toc-l1 a { font-size: 13.5px; }
.toc .lv2 a { padding-left: 20px; }
.toc .lv3 a { padding-left: 30px; font-size: 13px; }
.toc .lv4 a { padding-left: 40px; font-size: 13px; }
.toc-extra { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.toc-extra a { color: var(--muted); }

.article { padding: 34px clamp(20px, 4vw, 56px) 60px; min-width: 0; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

.outline { position: sticky; top: var(--bar-h); align-self: start; max-height: calc(100vh - var(--bar-h)); overflow-y: auto; padding: 34px 20px 40px 8px; font-size: 13px; scrollbar-width: thin; }
.outline-h { font: 600 11.5px var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.outline ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.outline a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.35; }
.outline a:hover { color: var(--ink); }
.outline a.on { color: var(--accent-ink); border-left-color: var(--accent); }
.outline .o1 a { padding-left: 24px; }
.outline .o2 a { padding-left: 36px; }

/* ---------- prose (converted report content) ---------- */
.prose { max-width: 780px; color: var(--ink-2); font-size: 16.5px; }
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--ink); font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -.005em; text-wrap: balance; }
.prose h1 { font-size: clamp(30px, 3.6vw, 40px); margin: 0 0 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.prose h2 { font-size: 26px; margin: 2.1em 0 .7em; }
.prose h3 { font-size: 20.5px; margin: 1.9em 0 .6em; }
.prose h4 { font-size: 17.5px; margin: 1.6em 0 .5em; }
.prose h1 b, .prose h2 b, .prose h3 b, .prose h4 b { font-weight: inherit; }
.prose p { margin: 0 0 1em; }
.prose p[data-li] { position: relative; padding-left: 2.1em; margin-bottom: .55em; }
.prose p[data-li="2"] { margin-left: 2em; }
.prose p[data-li="3"] { margin-left: 4em; }
.prose .lm { position: absolute; left: 0; width: 1.8em; color: var(--warm); font-weight: 600; font-variant-numeric: tabular-nums; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }
.prose img { border-radius: 4px; vertical-align: middle; }
.prose a.zoom img, .prose img.zoomable { cursor: zoom-in; }
.prose .cap { font-size: 14px; color: var(--muted); margin-top: .4em; }
.prose .cap b { color: var(--ink-2); }
.prose sup { line-height: 0; }
.prose sup a { text-decoration: none; }
.prose a.ext::after { content: "\2197"; font-size: .75em; margin-left: 2px; color: var(--muted); }
.prose :is(h1, h2, h3, h4) { scroll-margin-top: calc(var(--bar-h) + 16px); }

.prose .lay { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: flex-start; justify-content: center; margin: 1.6em 0; }
.prose .lay > .cell { flex: 1 1 260px; min-width: 0; text-align: center; }
.prose .lay > .cell:only-child { text-align: left; flex-basis: 100%; }
.prose .lay > .cell p { margin-bottom: .5em; }
.prose .lay > .cell:has(img) p { font-size: 14px; color: var(--muted); }
.prose .lay img { box-shadow: var(--shadow); }

.tbl { overflow-x: auto; margin: 1.6em 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); scrollbar-width: thin; }
table.data { border-collapse: collapse; width: 100%; font-size: 13.5px; line-height: 1.4; color: var(--ink-2); }
table.data td, table.data th { padding: 7px 10px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); vertical-align: top; text-align: left; }
table.data td:last-child, table.data th:last-child { border-right: 0; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:first-child td { background: var(--sunk); color: var(--ink); font-weight: 600; }
table.data td[data-num] { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tr:hover td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
table.data p { margin: 0; }
table.data img { box-shadow: none; }

.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 780px; margin-top: 56px; padding-top: 26px; border-top: 1px solid var(--line); }
.pn a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--surface); }
.pn a:hover { border-color: var(--accent); }
.pn small { color: var(--muted); font-size: 12.5px; }
.pn .next { text-align: right; grid-column: 2; }
.pn span { font-weight: 600; font-size: 14.5px; line-height: 1.35; }

/* ---------- wide pages (contents / photos / landing) ---------- */
.wide { max-width: 1180px; margin: 0 auto; padding: 46px clamp(20px, 4vw, 48px) 70px; }
.page-head { max-width: 820px; margin-bottom: 36px; }
.kicker { font: 600 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--warm); margin: 0 0 12px; }
.page-head h1 { font: 600 clamp(34px, 4.4vw, 52px)/1.08 var(--serif); margin: 0 0 16px; letter-spacing: -.01em; text-wrap: balance; }
.lede { font-size: 19px; color: var(--ink-2); margin: 0; line-height: 1.55; text-wrap: pretty; }

.contents-grid { columns: 2 440px; column-gap: 28px; }
.c-group { break-inside: avoid; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; margin-bottom: 28px; box-shadow: var(--shadow); }
.c-group h2 { font: 600 21px/1.25 var(--serif); margin: 0 0 12px; }
.c-group h2 a { color: var(--ink); text-decoration: none; }
.c-group h2 a:hover { color: var(--accent); }
.c-group ol { list-style: none; margin: 0; padding: 0; font-size: 14.5px; }
.c-group li a { display: block; padding: 4px 0; color: var(--ink-2); text-decoration: none; line-height: 1.35; }
.c-group li a:hover { color: var(--accent); }
.c-sub { font: 600 11.5px var(--sans); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 16px 0 6px; }
.c-kids .lv2 a { padding-left: 14px; }
.c-kids .lv3 a, .c-kids .lv4 a { padding-left: 28px; font-size: 13.5px; }

.ph-set { margin-bottom: 52px; }
.ph-set h2 { font: 600 22px var(--serif); margin: 0 0 16px; }
.ph-set h2 a { color: var(--ink); text-decoration: none; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.ph-grid figure { margin: 0; }
.ph-grid a { display: block; border-radius: 8px; overflow: hidden; background: var(--sunk); aspect-ratio: 4/3; }
.ph-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; cursor: zoom-in; }
.ph-grid a:hover img { transform: scale(1.04); }
.ph-grid figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.4; }

/* ---------- landing ---------- */
.hero { position: relative; background: var(--hero); color: #eef1f7; overflow: hidden; isolation: isolate; }
.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: .42; filter: saturate(.7) contrast(1.05); }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--hero) 18%, rgb(8 12 22 / .55) 60%, rgb(8 12 22 / .2)), linear-gradient(0deg, var(--hero), transparent 40%); }
.hero-in { max-width: 1180px; margin: 0 auto; padding: clamp(70px, 11vw, 140px) clamp(20px, 4vw, 48px) clamp(60px, 8vw, 100px); }
.hero .kicker { color: #ff9a62; }
.hero h1 { font: 600 clamp(38px, 6vw, 72px)/1.03 var(--serif); margin: 0 0 22px; max-width: 900px; letter-spacing: -.015em; text-wrap: balance; }
.hero p.lede { color: #c9d0de; max-width: 680px; font-size: clamp(17px, 1.6vw, 20px); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 10px; font-weight: 600; font-size: 15px; text-decoration: none; border: 1px solid transparent; }
.btn-primary { background: #fff; color: #0d1424; }
.btn-primary:hover { background: #e6ebf5; color: #0d1424; }
.btn-ghost { color: #eef1f7; border-color: rgb(255 255 255 / .28); }
.btn-ghost:hover { background: rgb(255 255 255 / .08); color: #fff; }
.hero-meta { margin-top: 46px; font-size: 13.5px; color: #98a2b6; max-width: 720px; }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); margin-top: -46px; position: relative; overflow: hidden; }
.stat { padding: 22px 22px 20px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font: 600 clamp(26px, 2.6vw, 34px)/1.1 var(--serif); color: var(--ink); font-variant-numeric: tabular-nums; }
.stat span { display: block; font-size: 13.5px; color: var(--muted); margin-top: 6px; line-height: 1.4; }

.sec { margin-top: 86px; }
.sec-h { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.sec-h h2 { font: 600 clamp(28px, 3vw, 38px)/1.12 var(--serif); margin: 0; letter-spacing: -.01em; }
.sec-h p { margin: 8px 0 0; color: var(--muted); max-width: 640px; }
.sec-h a { white-space: nowrap; font-size: 15px; }

.compare { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); }
.compare > div { padding: 26px 28px; }
.compare > div + div { border-left: 1px solid var(--line); background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }
.compare h3 { font: 600 13px var(--mono); text-transform: uppercase; letter-spacing: .1em; margin: 0 0 16px; color: var(--muted); }
.compare > div + div h3 { color: var(--accent-ink); }
.compare dl { margin: 0; display: grid; gap: 16px; }
.compare dt { font-weight: 600; color: var(--ink); }
.compare dd { margin: 3px 0 0; color: var(--ink-2); font-size: 15px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--ink-2); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--ink-2); }
.card-img { aspect-ratio: 16/10; background: var(--sunk); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 18px 20px 20px; }
.card .kicker { font-size: 11px; margin-bottom: 8px; }
.card h3 { font: 600 20px/1.25 var(--serif); color: var(--ink); margin: 0 0 8px; }
.card p { margin: 0; font-size: 14.5px; line-height: 1.5; }

.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.split .prose { max-width: none; }
.media-frame { border-radius: 14px; overflow: hidden; background: #000; box-shadow: var(--shadow); border: 1px solid var(--line); }
.media-frame video { display: block; width: 100%; height: auto; aspect-ratio: 4/3; background: #000; }

.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 26px 26px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--warm); }
.timeline time { font: 600 13px var(--mono); color: var(--warm); letter-spacing: .05em; }
.timeline h3 { font: 600 19px/1.3 var(--serif); margin: 2px 0 4px; color: var(--ink); }
.timeline p { margin: 0; color: var(--ink-2); font-size: 15px; max-width: 680px; }

.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.doc-link { display: flex; gap: 16px; align-items: flex-start; padding: 18px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; color: var(--ink-2); }
.doc-link:hover { border-color: var(--accent); color: var(--ink-2); }
.doc-link .ft { flex: none; width: 44px; height: 54px; border-radius: 6px; display: grid; place-items: end center; padding-bottom: 6px; font: 700 10.5px var(--mono); color: #fff; background: #b8432b; letter-spacing: .04em; }
.doc-link .ft.v { background: var(--accent); }
.doc-link .ft.n { background: #4a5468; }
.doc-link b { display: block; color: var(--ink); font-size: 15.5px; line-height: 1.35; margin-bottom: 4px; }
.doc-link span { font-size: 13.5px; line-height: 1.45; display: block; }
.doc-link small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 6px; font-family: var(--mono); }

.credits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.credits div { border-top: 2px solid var(--ink); padding-top: 14px; }
.credits h3 { font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 6px; }
.credits p { margin: 0; color: var(--ink); }
.note { font-size: 13.5px; color: var(--muted); border-left: 3px solid var(--line-2); padding: 4px 0 4px 14px; margin-top: 18px; }

/* ---------- charts (redrawn) ---------- */
:root { --series-1: #2a78d6; --series-2: #eb6834; }
:root[data-theme="dark"] { --series-1: #3987e5; --series-2: #d95926; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --series-1: #3987e5; --series-2: #d95926; } }
.chart { position: relative; margin: 2em 0; padding: 20px 22px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; align-items: baseline; margin-bottom: 10px; }
.chart-head b { font: 600 17px/1.3 var(--serif); color: var(--ink); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); }
.lg { display: inline-flex; align-items: center; gap: 7px; }
.sw { display: inline-block; width: 18px; height: 3px; border-radius: 2px; }
.sw.s1 { background: var(--series-1); }
.sw.s2 { background: var(--series-2); }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.chart-sub { margin: 0 0 2px; font-size: 13px; font-weight: 600; color: var(--muted); }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg .grid { stroke: var(--line); stroke-width: 1; }
.chart-svg .axis { stroke: var(--line-2); stroke-width: 1; }
.chart-svg .tick { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chart-svg .axis-label { fill: var(--muted); font-size: 12px; }
.chart-svg .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .line.s1 { stroke: var(--series-1); }
.chart-svg .line.s2 { stroke: var(--series-2); }
.chart-svg .dot { stroke: var(--surface); stroke-width: 2; }
.chart-svg .dot.s1 { fill: var(--series-1); }
.chart-svg .dot.s2 { fill: var(--series-2); }
.chart-svg .dlabel { fill: var(--ink-2); font-size: 12px; font-weight: 600; }
.chart-svg .xhair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-tip { position: absolute; pointer-events: none; z-index: 2; background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px; box-shadow: var(--shadow); padding: 8px 11px; font-size: 13px; line-height: 1.5; color: var(--ink-2); min-width: 150px; }
.chart-tip b { color: var(--ink); display: block; }
.chart-tip i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.chart-tip span { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.chart-tip em { font-style: normal; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.chart-data { margin-top: 12px; font-size: 14px; }
.chart-data summary { cursor: pointer; color: var(--accent); }
.chart-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
@media (max-width: 760px) { .chart-grid { grid-template-columns: 1fr; } }

/* ---------- engine drawings (redrawn) ---------- */
.prose .drawings { margin-top: 1.5em; }
.dwg-set { margin: 0 0 3em; }
.dwg-set h2 { margin-top: 1.2em !important; }
.dwg { margin: 0 0 1.6em; }
.dwg-frame { display: block; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: var(--shadow); cursor: zoom-in; }
.dwg-frame img { display: block; width: 100%; height: auto; border-radius: 0; }
.dwg figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; line-height: 1.5; }
.dwg figcaption b { color: var(--ink-2); }
.dwg-links { display: block; margin-top: 4px; font-size: 13.5px; }
.dwg-ref { font-size: 13.5px; color: var(--muted); border-left: 3px solid var(--line-2); padding-left: 12px; }
.lightbox img[src$=".svg"] { background: #fff; padding: 16px; }

/* ---------- 360° panoramas ---------- */
.pano-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.pano-wrap h3 { font: 600 18px/1.3 var(--serif); margin: 0 0 4px; color: var(--ink); }
.pano-wrap p { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.pano { position: relative; border-radius: 14px; overflow: hidden; background: #0b0e14; aspect-ratio: 16/10; box-shadow: var(--shadow); border: 1px solid var(--line); outline-offset: 3px; }
.pano canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.pano.grab canvas { cursor: grabbing; }
.pano:not(.ready)::before { content: "Loading panorama…"; position: absolute; inset: 0; display: grid; place-items: center; color: #8b94a7; font-size: 14px; }
.pano-ui { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; }
.pano-ui button { width: 34px; height: 34px; border-radius: 9px; border: 0; background: rgb(10 14 22 / .62); color: #fff; font-size: 17px; line-height: 1; cursor: pointer; backdrop-filter: blur(6px); display: grid; place-items: center; }
.pano-ui button:hover { background: rgb(10 14 22 / .85); }
.pano-ui svg { width: 17px; height: 17px; }
.pano-hint { position: absolute; left: 12px; bottom: 12px; font-size: 12px; color: #fff; background: rgb(10 14 22 / .55); padding: 4px 9px; border-radius: 999px; pointer-events: none; transition: opacity .4s; }
.pano.grab .pano-hint, .pano:focus .pano-hint { opacity: 0; }
.pano:fullscreen { border-radius: 0; aspect-ratio: auto; }
.sync { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--ink-2); margin-top: 14px; cursor: pointer; }
.sync input { width: 17px; height: 17px; accent-color: var(--accent); }
@media (max-width: 960px) { .pano-pair { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 30px clamp(20px, 4vw, 48px) 40px; font-size: 13.5px; color: var(--ink-2); background: var(--sunk); }
.foot > div { max-width: 1180px; margin: 0 auto; }
.foot p { margin: 0 0 6px; max-width: 860px; }
.page-doc .foot > div { max-width: 1480px; padding-left: 290px; }

/* ---------- search ---------- */
dialog { color: var(--ink); }
dialog::backdrop { background: rgb(8 10 16 / .55); backdrop-filter: blur(3px); }
.search { width: min(680px, calc(100vw - 24px)); max-height: min(640px, 80vh); margin: 10vh auto auto; padding: 0; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); box-shadow: 0 30px 80px rgb(0 0 0 / .35); overflow: hidden; }
.search[open] { display: flex; flex-direction: column; }
.search-box { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); margin: 0; }
.search-box svg { color: var(--muted); flex: none; }
.search-box input { flex: 1; border: 0; outline: 0; background: none; font: inherit; font-size: 17px; color: var(--ink); min-width: 0; }
.search-box input::-webkit-search-cancel-button { display: none; }
.esc { font: 12px var(--mono); border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 7px; color: var(--muted); background: var(--sunk); cursor: pointer; }
.search-results { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.search-results a { display: block; padding: 10px 12px; border-radius: 9px; text-decoration: none; color: var(--ink-2); }
.search-results a:hover, .search-results a.sel { background: var(--accent-soft); }
.search-results b { display: block; color: var(--ink); font-size: 15px; }
.search-results small { color: var(--muted); font-size: 12px; font-family: var(--mono); }
.search-results p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.45; }
.search-results mark { background: color-mix(in srgb, var(--warm) 28%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }
.search-empty { padding: 26px 14px; color: var(--muted); text-align: center; font-size: 14.5px; }

/* ---------- lightbox ---------- */
.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgb(6 8 12 / .94); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgb(6 8 12 / .7); }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: calc(100vw - 140px); }
.lightbox img { max-width: calc(100vw - 140px); max-height: calc(100vh - 130px); object-fit: contain; border-radius: 4px; background: #fff; }
.lightbox figcaption { color: #d4d9e4; font-size: 14.5px; text-align: center; max-width: 760px; }
.lb-btn { position: fixed; border: 0; background: rgb(255 255 255 / .1); color: #fff; width: 48px; height: 48px; border-radius: 50%; font-size: 30px; line-height: 1; cursor: pointer; }
.lb-btn:hover { background: rgb(255 255 255 / .22); }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 18px; top: 50%; translate: 0 -50%; }
.lb-next { right: 18px; top: 50%; translate: 0 -50%; }
.lb-orig { position: fixed; bottom: 18px; right: 22px; color: #aab3c5; font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .doc { grid-template-columns: 270px minmax(0, 1fr); }
  .outline { display: none; }
  .page-doc .foot > div { padding-left: 270px; }
}
@media (max-width: 960px) {
  .nav-toggle { display: grid; }
  .bar-links { display: none; }
  .doc { grid-template-columns: minmax(0, 1fr); }
  .toc { position: fixed; z-index: 40; top: var(--bar-h); left: 0; width: min(330px, 88vw); background: var(--bg); transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow); }
  body.nav-open .toc { transform: none; }
  .page-doc .foot > div { padding-left: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { border-bottom: 1px solid var(--line); }
  .stat:nth-child(2n) { border-right: 0; }
  .compare, .split, .credits { grid-template-columns: 1fr; }
  .compare > div + div { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .search-btn { min-width: 0; }
  .search-btn span, .search-btn kbd, .classic-link { display: none; }
  .brand span { font-size: 14px; }
  .bar { gap: 10px; padding: 0 12px; }
  .prose { font-size: 16px; }
  .lightbox figure, .lightbox img { max-width: 100vw; }
  .lb-prev, .lb-next { top: auto; bottom: 16px; translate: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .bar, .toc, .outline, .pn, .foot, .crumbs { display: none !important; }
  .doc { display: block; }
  body { background: #fff; color: #000; }
}
.ba { margin: 18px 0 0; }
.ba img { width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; }
.ba figcaption { font-size: 13.5px; color: var(--muted); margin-top: 8px; }
.card-dwg { background: #fff; } .card-dwg img { object-fit: contain !important; padding: 8px; }
.page-background .media-frame { max-width: 900px; }
