/* SRTDrive project page
   Theme colours are the original page's blue palette. Colour carries one meaning
   everywhere: orange = the frozen planner's reference, theme blue = SRTDrive's
   output, light blue = generated alternatives. */

@font-face {
  font-family: "Overpass";
  src: url("assets/fonts/overpass-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* Theme: the original SRTDrive page palette */
  --bg: #ffffff;
  --ground: #f6f8fb;
  --ink: #182c49;
  --text: #28374a;
  --muted: #5a6879;
  --line: #e0e5ec;
  --line-strong: #c8d3e3;
  --track: #e8edf4;
  --brand: #244b91; --brand-hover: #182c49; --on-brand: #ffffff;
  --focus: #7398de;

  /* Data: orange = frozen planner alone, theme blue = with SRTDrive */
  --ref: #ef8a1f;  --ref-ink: #a65500;
  --sel: #315eaa;  --sel-ink: #244b91;
  --alt: #9bb6e8;  --alt-soft: #f0f4fc;
  --agent: #a2aebf; --agent-edge: #8492a6;
  --other: #9aa6b8;
  --hit: #e5484d;
  --bad: #d8695c;  --bad-ink: #b23b2f;

  --road: #ffffff; --road-edge: #6c7b90; --grid: #e7ecf3;

  --band: #244b91; --on-band: #ffffff; --band-muted: #bccbe9;
  --band-line: rgb(255 255 255 / 18%); --band-ref: #ffb768; --band-sel: #ffffff;

  --shell: 1140px;
  --font: "Overpass", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --bg: #0e1625;
    --ground: #141d30;
    --ink: #eef2f9;
    --text: #c5cedd;
    --muted: #8f9cb2;
    --line: #232f48;
    --line-strong: #394869;
    --track: #1e2940;
    --brand: #8fb3f5; --brand-hover: #b5cdfa; --on-brand: #0e1625;
    --focus: #8fb3f5;

    --ref: #f39a3d;  --ref-ink: #f6ad62;
    --sel: #5d8de2;  --sel-ink: #9dbcf7;
    --alt: #5f79ad;  --alt-soft: #18233d;
    --agent: #55637b; --agent-edge: #7684a0;
    --other: #5a6984;
    --hit: #f0666a;
    --bad: #e07a6d;  --bad-ink: #f0958a;

    --road: #18233a; --road-edge: #7d8ba8; --grid: #172036;

    --band: #1c3769; --on-band: #ffffff; --band-muted: #a9bce0;
    --band-line: rgb(255 255 255 / 16%); --band-ref: #ffb768; --band-sel: #ffffff;
  }
}

/* ───────── Base ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.62 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.is-locked { overflow: hidden; }
img, svg { max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4, p { overflow-wrap: break-word; }
small { font-size: inherit; }
::selection { background: color-mix(in srgb, var(--sel) 24%, transparent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.shell { width: min(var(--shell), 100% - 48px); margin-inline: auto; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; z-index: 100; top: 10px; left: 10px; padding: 10px 16px; border-radius: 8px; background: var(--brand); color: var(--on-brand); transform: translateY(-200%); }
.skip-link:focus { transform: none; }

.arrow { width: 22px; height: 10px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ───────── Header ───────── */
.site-header { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 90%, transparent); -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px); }
.bar { display: flex; align-items: center; gap: 20px; min-height: 60px; }
.wordmark { margin-right: auto; color: var(--brand); font-size: 1.1875rem; font-weight: 800; letter-spacing: -.025em; text-decoration: none; }
.site-header nav { display: flex; gap: 2px; }
.site-header nav a { padding: 7px 12px 5px; border-radius: 8px; color: var(--muted); font-size: .9375rem; font-weight: 550; text-decoration: none; white-space: nowrap; }
.site-header nav a:hover { color: var(--brand); }
.site-header nav a[aria-current] { color: var(--brand); background: var(--alt-soft); }
.bar-status { padding-left: 20px; border-left: 1px solid var(--line); color: var(--muted); font-size: .875rem; white-space: nowrap; }

/* ───────── Buttons ───────── */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 2px 22px 0; border: 1.5px solid transparent; border-radius: 10px; font-size: 1rem; font-weight: 650; text-decoration: none; transition: background-color .15s, border-color .15s, color .15s; }
.btn-solid { background: var(--brand); color: var(--on-brand); }
.btn-solid:hover { background: var(--brand-hover); }
.btn-line { border-color: var(--line-strong); background: transparent; color: var(--brand); }
.btn-line:hover { border-color: var(--brand); }
.btn-small { min-height: 38px; padding-inline: 14px; font-size: .9375rem; }

/* ───────── Hero ───────── */
.hero { padding-block: clamp(36px, 6vw, 80px) clamp(40px, 6vw, 76px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(32px, 6vw, 84px); align-items: center; }
.hero-meta { margin: 0 0 26px; color: var(--muted); font-size: .9375rem; }
h1 { margin: 0; color: var(--ink); }
.h1-name { display: block; color: var(--brand); font-size: clamp(3.6rem, 9.4vw, 7rem); font-weight: 800; line-height: .9; letter-spacing: -.045em; }
.h1-title { display: block; max-width: 25ch; margin-top: clamp(16px, 2vw, 24px); font-size: clamp(1.3rem, 2.25vw, 1.8rem); font-weight: 500; line-height: 1.22; letter-spacing: -.012em; text-wrap: balance; }
.hero-lede { max-width: 52ch; margin: 26px 0 0; font-size: 1.125rem; line-height: 1.58; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-note { margin: 18px 0 0; color: var(--muted); font-size: .9375rem; }

/* Scene: schematic bird's-eye view */
.scene { margin: 0; }
.scene-stage { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--ground); }
.scene-svg { display: block; width: 100%; height: auto; }
.scene-switch, .tablist { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); }
.scene-switch[hidden], .tablist[hidden] { display: none; }
.scene-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 14px; }
.scene-controls .key { margin: 0; }
.scene-switch button, .tablist button { min-height: 36px; padding: 2px 15px 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: .9375rem; font-weight: 620; }
.scene-switch button:hover, .tablist button:hover { color: var(--brand); }
.scene-switch button[aria-pressed="true"], .tablist button[aria-selected="true"] { background: var(--brand); color: var(--on-brand); }

.s-ground { fill: var(--ground); }
.s-grid { fill: none; stroke: var(--grid); stroke-width: 1; }
.s-road { fill: var(--road); }
.s-edge { fill: none; stroke: var(--road-edge); stroke-width: 2; }
.s-lane { fill: none; stroke: var(--road-edge); stroke-width: 1.5; stroke-dasharray: 10 10; opacity: .55; }
.s-ego { fill: var(--ink); }
.s-ego-glass { fill: var(--bg); opacity: .2; }
.s-agent { fill: var(--agent); stroke: var(--agent-edge); stroke-width: 1.2; }
.s-alt { fill: none; stroke: var(--alt); stroke-width: 1.9; stroke-linecap: round; stroke-dasharray: 1; }
.s-alt-end { fill: var(--alt); }
.s-ref { fill: none; stroke: var(--ref); stroke-width: 4.5; stroke-linecap: round; stroke-dasharray: 1; }
.s-ref-dot { fill: var(--road); stroke: var(--ref); stroke-width: 2.3; }
.s-sel { fill: none; stroke: var(--sel); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 1; }
.s-sel-dot { fill: var(--road); stroke: var(--sel); stroke-width: 2.4; }
.s-keep-halo { fill: none; stroke: var(--sel); stroke-width: 13; stroke-linecap: round; stroke-dasharray: 1; opacity: .5; }
.s-hit { fill: var(--hit); stroke: var(--road); stroke-width: 1.2; stroke-linejoin: round; }
.s-hit-core { fill: #ffe08a; }
.s-ref-dot, .s-sel-dot, .s-hit, .s-hit-core, .s-alt-end { transform-box: fill-box; transform-origin: center; }

.scene-layer { display: none; }
.scene[data-scene="replace"] [data-layer="replace"],
.scene[data-scene="keep"] [data-layer="keep"] { display: inline; }
[data-caption] { display: none; }
.scene[data-scene="replace"] [data-caption="replace"],
.scene[data-scene="keep"] [data-caption="keep"] { display: inline; }

@media (prefers-reduced-motion: no-preference) {
  .scene-layer .s-ref { animation: draw .9s cubic-bezier(.6, 0, .2, 1) .3s both; }
  .scene-layer .s-ref-dot { animation: pop .3s ease-out calc(.42s + var(--i) * .13s) both; }
  .scene-layer .s-hit, .scene-layer .s-hit-core { animation: pop .4s cubic-bezier(.2, 1.7, .4, 1) 1.2s both; }
  .scene-layer .s-alt { animation: draw .7s ease-out calc(1.6s + var(--i) * .07s) both; }
  .scene-layer .s-alt-end { animation: pop .25s ease-out calc(2.25s + var(--i) * .07s) both; }
  .scene-layer .s-sel { animation: draw .85s cubic-bezier(.6, 0, .2, 1) 2.8s both; }
  .scene-layer .s-keep-halo { animation: draw-halo .85s cubic-bezier(.6, 0, .2, 1) 2.8s both; }
  .scene-layer .s-sel-dot { animation: pop .3s ease-out calc(2.9s + var(--i) * .12s) both; }
}
@keyframes draw { 0% { stroke-dashoffset: 1; opacity: 0; } 2% { opacity: 1; } 100% { stroke-dashoffset: 0; } }
@keyframes draw-halo { 0% { stroke-dashoffset: 1; opacity: 0; } 2% { opacity: .5; } 100% { stroke-dashoffset: 0; opacity: .5; } }
@keyframes pop { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: scale(1); } }

.key { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 16px 0 0; padding: 0; list-style: none; color: var(--text); font-size: .9375rem; }
.key li, .key span { display: inline-flex; align-items: center; }
.swatch { flex: none; width: 22px; height: 5px; margin: 0 9px 2px 0; border-radius: 3px; }
.swatch-ref { background: var(--ref); }
.swatch-sel { background: var(--sel); }
.swatch-alt { height: 2px; background: var(--alt); }
.scene-caption { min-height: 3.1em; margin: 10px 0 0; color: var(--muted); font-size: .9375rem; line-height: 1.5; }
.scene-aside { white-space: nowrap; }

/* ───────── Headline numbers ───────── */
.glance { padding-block: 38px 30px; background: var(--band); color: var(--on-band); }
.glance-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.glance-grid li { padding: 2px 0 2px 30px; border-left: 1px solid var(--band-line); }
.glance-grid li:first-child { padding-left: 0; border-left: 0; }
.glance-values { display: flex; align-items: baseline; gap: 10px; margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.glance-values .arrow { align-self: center; color: var(--band-muted); }
.g-ref { color: var(--band-ref); font-size: 1.1875rem; font-weight: 500; }
.g-sel { color: var(--band-sel); font-size: clamp(2rem, 3.3vw, 2.75rem); font-weight: 760; line-height: 1; letter-spacing: -.035em; }
.glance-label { margin: 12px 0 0; font-weight: 620; line-height: 1.3; }
.glance-context { margin: 3px 0 0; color: var(--band-muted); font-size: .875rem; }
.glance-key { display: flex; flex-wrap: wrap; gap: 6px 26px; margin: 28px 0 0; color: var(--band-muted); font-size: .875rem; }
.glance-key span { display: inline-flex; align-items: center; }
.dot { flex: none; width: 9px; height: 9px; margin: 0 8px 2px 0; border-radius: 50%; }
.dot-ref { background: var(--band-ref); }
.dot-sel { background: var(--band-sel); }

/* ───────── Sections ───────── */
.section { padding-block: clamp(56px, 8vw, 104px); }
.section-ground { background: var(--ground); }
h2 { margin: 0; color: var(--ink); font-size: clamp(2rem, 3.7vw, 2.8rem); font-weight: 770; line-height: 1.04; letter-spacing: -.032em; }
h3, h4 { color: var(--ink); }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 14px 48px; align-items: end; margin-bottom: clamp(28px, 4vw, 44px); }
.section-head > p { max-width: 58ch; margin: 0; }
.section-head .key-inline { max-width: none; justify-content: flex-end; margin: 0 0 6px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.5fr); gap: 20px 48px; align-items: start; }
.split-note { margin: 12px 0 0; color: var(--muted); font-size: .9375rem; }
.prose { max-width: 70ch; }
.prose p { margin: 0 0 1.05em; }
.prose p:last-child { margin-bottom: 0; }

/* ───────── Figures ───────── */
.tablist { margin-bottom: 14px; }
.figure { margin: 0; }
.figure + .figure { margin-top: 28px; }
.figure[hidden] { display: none; }
.plate { display: block; padding: clamp(10px, 2.2vw, 26px); border: 1px solid var(--line); border-radius: 18px; background: #fff; cursor: zoom-in; transition: border-color .15s; }
.plate:hover { border-color: var(--line-strong); }
.plate img { display: block; width: 100%; height: auto; }
.figure figcaption { max-width: 86ch; margin-top: 12px; color: var(--muted); font-size: .9375rem; line-height: 1.55; }
.figure figcaption b { color: var(--ink); font-weight: 650; }

/* ───────── Method ───────── */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: clamp(34px, 5vw, 56px) 0 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { padding-left: 30px; padding-right: 20px; border-left: 1px solid var(--line-strong); counter-increment: step; }
.steps li:first-child { padding-left: 0; border-left: 0; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 30px; height: 30px; padding-top: 2px; margin-bottom: 14px; border: 1.5px solid var(--brand); border-radius: 50%; color: var(--brand); font-size: .9375rem; font-weight: 700; line-height: 1; }
.steps h3 { margin: 0 0 8px; font-size: 1.25rem; font-weight: 720; line-height: 1.2; letter-spacing: -.015em; }
.steps p { margin: 0; font-size: 1rem; }

.target { margin-top: clamp(36px, 5vw, 60px); padding: clamp(22px, 3vw, 32px); border: 1px solid var(--line); border-radius: 18px; background: var(--bg); }
.target-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; }
.target-head h3 { margin: 0; font-size: 1.25rem; font-weight: 720; letter-spacing: -.015em; }
.target-head p { margin: 0; color: var(--muted); font-size: .9375rem; }
.ladder { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; margin: 20px 0 0; padding: 0; list-style: none; counter-reset: rung; }
.ladder li { position: relative; padding: 15px 18px 16px; border-radius: 12px; background: var(--ground); counter-increment: rung; }
.ladder li + li::before { content: ""; position: absolute; top: 50%; left: -20px; width: 9px; height: 9px; border-top: 2px solid var(--muted); border-right: 2px solid var(--muted); transform: translate(-50%, -50%) rotate(45deg); }
.ladder b { display: block; color: var(--ink); font-weight: 680; line-height: 1.3; }
.ladder b::before { content: counter(rung) ". "; color: var(--muted); font-weight: 500; }
.ladder span { display: block; margin-top: 5px; color: var(--muted); font-size: .9375rem; line-height: 1.5; }


/* ───────── Results ───────── */
.finding { padding-block: clamp(36px, 5vw, 60px); border-top: 1px solid var(--line); }
.finding-last { padding-bottom: 0; }
.finding-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px 48px; align-items: start; margin-bottom: 28px; }
.finding-head h3 { margin: 0; font-size: clamp(1.4rem, 2.3vw, 1.75rem); font-weight: 730; line-height: 1.16; letter-spacing: -.022em; text-wrap: balance; }
.finding-head p { max-width: 60ch; margin: 0; }
.footnote { max-width: 92ch; margin: 16px 0 0; color: var(--muted); font-size: .875rem; line-height: 1.55; }

.track { display: block; height: 10px; overflow: hidden; border-radius: 3px; background: var(--track); }
.fill { display: block; height: 100%; border-radius: 3px; }
.fill-ref { background: var(--ref); }
.fill-sel { background: var(--sel); }
.fill-other { background: var(--other); }
.val { min-width: 3.3rem; color: var(--muted); font-size: .9375rem; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1; text-align: right; }
.val-ref { color: var(--ref-ink); }
.val-sel { color: var(--sel-ink); font-weight: 740; }

/* Finding 1: paired bars per planner */
.planners, .swap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.planner, .swap-chart, .repair-block { border: 1px solid var(--line); border-radius: 18px; background: var(--bg); }
.planner { padding: 22px 26px 6px; }
.planner h4 { margin: 0 0 16px; font-size: 1.1875rem; font-weight: 740; letter-spacing: -.015em; }
.metric { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; padding: 14px 0 18px; border-top: 1px solid var(--line); }
.metric-name { grid-area: 1 / 1; margin: 0 0 3px; color: var(--ink); font-weight: 620; line-height: 1.3; }
.metric-name small { margin-left: 4px; color: var(--muted); font-size: .875rem; font-weight: 400; }
.metric-delta { grid-area: 1 / 2; align-self: start; justify-self: end; margin: 0; color: var(--sel-ink); font-weight: 740; font-variant-numeric: tabular-nums; line-height: 1.3; }

/* Finding 2: same candidates, different selector */
.swap-chart { --name: 9.4rem; --valw: 3.3rem; --gap: 12px; padding: 22px 26px 20px; }
.swap-chart h4 { margin: 0 0 14px; font-size: 1.0625rem; font-weight: 720; line-height: 1.3; }
.swap-chart h4 small { margin-left: 4px; color: var(--muted); font-size: .875rem; font-weight: 400; }
.swap-rows { position: relative; display: grid; grid-template-columns: var(--name) minmax(0, 1fr) var(--valw); gap: 14px var(--gap); align-items: center; padding-block: 10px; }
.swap-row { display: contents; }
.swap-name { font-size: .9375rem; line-height: 1.25; }
.is-sel .swap-name { color: var(--sel-ink); font-weight: 720; }
.swap-base { position: absolute; top: 0; bottom: 0; left: calc(var(--name) + var(--gap) + (100% - var(--name) - var(--valw) - 2 * var(--gap)) * var(--base)); border-left: 2px dashed var(--ref); }
.swap-baseline { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; color: var(--muted); font-size: .875rem; }
.dash { flex: none; height: 16px; border-left: 2px dashed var(--ref); }

/* Disclosures */
.more { margin-top: 18px; }
.more summary { display: inline-flex; align-items: center; gap: 12px; padding: 8px 0; color: var(--ink); font-size: 1rem; font-weight: 620; list-style: none; cursor: pointer; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: ""; flex: none; width: 8px; height: 8px; margin-left: 2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-1px) rotate(-45deg); transition: transform .15s; }
.more[open] summary::before { transform: translateY(-3px) rotate(45deg); }
.more summary:hover { color: var(--sel-ink); }
.more-body { display: grid; gap: 20px; padding-top: 12px; }

/* Tables */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); }
.data { width: 100%; border-collapse: collapse; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.data caption { padding: 14px 18px 12px; color: var(--muted); font-size: .875rem; line-height: 1.5; text-align: left; }
.data th, .data td { padding: 11px 16px 9px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
.data thead th { border-top: 0; background: var(--ground); color: var(--muted); font-size: .8125rem; font-weight: 600; line-height: 1.3; vertical-align: bottom; white-space: normal; }
.data thead th small { display: block; font-weight: 400; }
.data th:first-child { text-align: left; }
.data tbody th { min-width: 11rem; color: var(--ink); font-weight: 520; white-space: normal; }
.data b { color: var(--ink); font-weight: 740; }
.data .row-sel th { color: var(--sel-ink); font-weight: 700; }
.data .row-gap th, .data .row-gap td { border-top: 2px solid var(--line-strong); }

.mini-tables { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.data-mini { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; border-collapse: separate; border-spacing: 0; background: var(--bg); font-size: .875rem; }
.data-mini caption { padding: 0 2px 10px; color: var(--ink); font-size: 1rem; font-weight: 700; }
.data-mini caption span { display: block; color: var(--muted); font-size: .8125rem; font-weight: 400; }
.data-mini th, .data-mini td { padding: 9px 12px 7px; }
.data-mini tbody th { min-width: 0; }

/* Finding 3: open-loop table */
.open-loop th, .open-loop td { padding-block: 13px 11px; text-align: left; }
.open-loop tbody th { width: 21%; min-width: 8.5rem; font-weight: 620; }
.open-loop .pairs { width: 19%; }
.open-loop .arrow { width: 18px; margin: 0 9px 2px; color: var(--muted); opacity: .7; vertical-align: middle; }
.p-ref { color: var(--ref-ink); }
.p-sel { color: var(--sel-ink); }
.open-loop b { color: inherit; }
b.p-ref { color: var(--ref-ink); }
b.p-sel { color: var(--sel-ink); }
.dnum { display: inline-block; min-width: 3.6rem; margin-right: 12px; font-weight: 680; text-align: right; }
.dbar { position: relative; display: inline-block; width: 112px; height: 10px; border-radius: 2px; background: var(--track); vertical-align: 0; }
.dbar::after { content: ""; position: absolute; top: -4px; bottom: -4px; left: calc(50% - 1px); width: 2px; border-radius: 1px; background: var(--muted); }
.dbar i { position: absolute; top: 0; bottom: 0; width: calc(var(--w) / 2); min-width: 2px; }
.good .dbar i { right: 50%; border-radius: 2px 0 0 2px; background: var(--sel); }
.bad .dbar i { left: 50%; border-radius: 0 2px 2px 0; background: var(--bad); }
.same .dbar i { display: none; }
.good .dnum { color: var(--sel-ink); }
.bad .dnum { color: var(--bad-ink); }
.same .dnum { color: var(--muted); }

/* Finding 4: repair analysis */
.repair { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 20px; }
.repair-block { padding: 22px 26px 24px; }
.repair-block h4 { margin: 0 0 18px; color: var(--text); font-size: 1.0625rem; font-weight: 500; line-height: 1.3; }
.repair-block h4 b { margin-right: 3px; color: var(--ink); font-size: 1.625rem; font-weight: 770; letter-spacing: -.025em; }
.waffle { display: grid; grid-template-columns: repeat(21, minmax(0, 1fr)); gap: 4px; }
.waffle i { aspect-ratio: 1; border-radius: 3px; }
.cell { flex: none; width: 14px; height: 14px; border-radius: 3px; }
.cell-clear { background: var(--sel); }
.cell-less { background: color-mix(in srgb, var(--sel) 42%, var(--bg)); }
.cell-miss { background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--sel); }
.cell-none { background: var(--track); }
.tally { display: grid; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; font-size: .9375rem; line-height: 1.35; }
.tally li { display: grid; grid-template-columns: 14px 1.6rem minmax(0, 1fr); gap: 10px; align-items: center; }
.tally b { color: var(--ink); font-weight: 720; font-variant-numeric: tabular-nums; text-align: right; }
.readout { margin: 0; }
.readout > div { display: grid; grid-template-columns: 6.4rem minmax(0, 1fr); gap: 16px; align-items: baseline; padding: 13px 0 14px; border-top: 1px solid var(--line); }
.readout dt { color: var(--ink); font-size: 1.375rem; font-weight: 750; letter-spacing: -.025em; white-space: nowrap; }
.readout dd { margin: 0; font-size: .9375rem; line-height: 1.5; }

/* Qualitative */
.key-strokes { gap: 8px 28px; margin: 0 0 20px; }
.stroke { flex: none; width: 30px; height: 0; margin: 0 10px 2px 0; border-top: 3px solid; }
.stroke-log { border-top-style: dotted; border-color: var(--ink); }
.stroke-ref { border-color: #b87a00; }
.stroke-ttc { border-top-style: dashed; border-color: #d9506e; }
.stroke-sel { border-color: #008f91; }
.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.shot { margin: 0; }
.shot .plate { padding: 10px; overflow: hidden; }
.shot-cam { aspect-ratio: 16 / 9; border-radius: 10px; object-fit: cover; }
.shot-bev { display: grid; place-items: center; margin-top: 10px; padding: 14px 0; border-radius: 10px; background: #f6f8f7; }
.shot-bev img { width: auto; height: clamp(250px, 26vw, 330px); }
.shot figcaption { margin-top: 12px; color: var(--text); font-size: .9375rem; line-height: 1.45; }

/* ───────── Limits ───────── */
.limits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; margin: 0; padding: 0; list-style: none; }
.limits li { padding: 22px 0 26px; border-top: 1px solid var(--line-strong); }
.limits h3 { margin: 0 0 8px; font-size: 1.1875rem; font-weight: 720; line-height: 1.25; letter-spacing: -.012em; }
.limits p { max-width: 58ch; margin: 0; font-size: 1rem; }

/* ───────── BibTeX and footer ───────── */
.cite pre { margin: 0; padding: 22px 24px; overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--ground); white-space: pre-wrap; overflow-wrap: anywhere; }
.cite code { color: var(--ink); font: .875rem/1.75 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.cite .btn { margin-top: 14px; }
.cite .btn[hidden] { display: none; }
.copy-status { margin-left: 12px; color: var(--sel-ink); font-size: .9375rem; font-weight: 620; }
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; min-height: 76px; padding-block: 18px; color: var(--muted); font-size: .875rem; }

/* ───────── Lightbox ───────── */
.lightbox { width: min(1480px, 96vw); max-width: 96vw; max-height: 94dvh; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: #182c49; }
.lightbox::backdrop { background: rgb(24 44 73 / 70%); }
.lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 14px 10px 20px; border-bottom: 1px solid #e0e5ec; font-size: .9375rem; }
.lightbox-bar a { color: #315eaa; }
.lightbox-bar .btn { border-color: #c8d3e3; color: #244b91; }
.lightbox-stage { max-height: calc(94dvh - 62px); padding: 20px; overflow: auto; overscroll-behavior: contain; }
.lightbox-stage img { display: block; width: 100%; height: auto; }

/* ───────── Responsive ───────── */
@media (max-width: 1020px) {
  .bar-status { display: none; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .scene { max-width: 560px; }
  .h1-title { max-width: 30ch; }
  .glance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 30px; }
  .glance-grid li:nth-child(odd) { padding-left: 0; border-left: 0; }
  .section-head, .finding-head, .split { grid-template-columns: minmax(0, 1fr); }
  .section-head .key-inline { justify-content: flex-start; }
  .planners, .swap, .repair { grid-template-columns: minmax(0, 1fr); }
  .mini-tables { grid-template-columns: minmax(0, 1fr); max-width: 520px; }
}
@media (max-width: 760px) {
  body { font-size: 1rem; }
  .shell { width: calc(100% - 36px); }
  html { scroll-padding-top: 72px; }
  .bar { min-height: 54px; gap: 8px; }
  .site-header nav a { padding-inline: 9px; }
  .site-header nav a[href="#abstract"], .site-header nav a[href="#bibtex"] { display: none; }
  .hero-lede { font-size: 1.0625rem; }
  .steps, .ladder, .limits { grid-template-columns: minmax(0, 1fr); }
  .steps { gap: 26px; }
  .steps li, .steps li:first-child { padding: 0; border-left: 0; }
  .ladder { gap: 26px; }
  .ladder li + li::before { top: -13px; left: 28px; transform: translate(-50%, -50%) rotate(135deg); }
  .planner, .swap-chart, .repair-block { padding-inline: 18px; }
  .swap-chart { --name: 7.6rem; --gap: 10px; }
  .dbar { display: none; }
  .dnum { min-width: 0; margin-right: 0; }
  .open-loop thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .open-loop tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 12px 16px 11px; border-top: 1px solid var(--line); }
  .open-loop tbody tr:first-child { border-top: 0; }
  .open-loop tbody th, .open-loop tbody td { width: auto; padding: 2px 0; border: 0; }
  .open-loop tbody th { grid-column: 1 / -1; padding-bottom: 5px; font-size: 1rem; }
  .open-loop .pairs::before { content: attr(data-label); display: inline-block; min-width: 6.2rem; color: var(--muted); font-size: .8125rem; }
  .open-loop .chg { text-align: right; }
  .shots { grid-template-columns: minmax(0, 1fr); max-width: 440px; }
  .shot-bev img { height: 300px; }
  .data th, .data td { padding-inline: 11px; }
  .readout > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .lightbox-stage { padding: 12px; }
  .lightbox-stage img { width: max(860px, 100%); max-width: none; }
}
@media (max-width: 460px) {
  .glance-grid { grid-template-columns: minmax(0, 1fr); row-gap: 22px; }
  .glance-grid li, .glance-grid li:nth-child(odd) { padding-left: 0; border-left: 0; }
  .h1-name { font-size: clamp(3.1rem, 17vw, 3.9rem); }
  .waffle { gap: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
