/* site.css: DOT F1 brand and shared components for the Lab, Head-to-head and Lap pages. */
/* display face: Titillium Web (SIL OFL 1.1, ui/fonts/OFL.txt), self-hosted, latin subset */
@font-face { font-family:"Titillium Web"; font-style:normal; font-weight:400; font-display:swap; src:url("./fonts/titillium-web-400.woff2") format("woff2"); }
@font-face { font-family:"Titillium Web"; font-style:normal; font-weight:600; font-display:swap; src:url("./fonts/titillium-web-600.woff2") format("woff2"); }
@font-face { font-family:"Titillium Web"; font-style:normal; font-weight:700; font-display:swap; src:url("./fonts/titillium-web-700.woff2") format("woff2"); }
@font-face { font-family:"Titillium Web"; font-style:normal; font-weight:900; font-display:swap; src:url("./fonts/titillium-web-900.woff2") format("woff2"); }
:root {
  --ink:#0a0e14; --ink-2:#465061; --ink-3:#5d6776; --rule:#e1e6ec; --rule-2:#eef1f5; --grid:#e9edf2; --axis:#b6bfcb; --plane:#f3f5f8;
  --accent:#e0362c;                                   /* the brand dot only; the car marker is ink on white */
  --accel:#2d6be4; --brake:#e45f17; --corner:#0e9fb0; /* one meaning per colour (validated: CVD, contrast) */
  --drs:#d6a10e; --drs-text:#7a5800; --neutral:#cdd4dd;   /* DRS zones (always labelled); the diverging midpoint */
  --good-text:#006300; --bad-text:#d03b3b;
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,Helvetica,sans-serif;
  --display:"Titillium Web",var(--font);
  --mono:"SF Mono","JetBrains Mono",ui-monospace,Menlo,monospace;
  --radius:12px;
}
* { box-sizing:border-box; }
html, body { margin:0; background:var(--raised); color:var(--ink); font-family:var(--font); -webkit-font-smoothing:antialiased; }
/* the browser's own surfaces, themed */
html { scrollbar-width:thin; scrollbar-color:var(--axis) transparent; caret-color:var(--accent); accent-color:var(--ink); }
::selection { background:rgba(45,107,228,.16); color:var(--ink); }
::-webkit-scrollbar { width:10px; height:10px; } ::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:#cfd6df; border-radius:999px; border:3px solid #fff; } ::-webkit-scrollbar-thumb:hover { background:#aab3bf; }
a { text-underline-offset:3px; text-decoration-thickness:1px; }
button, select, input { font:inherit; color:inherit; }
a { color:inherit; }
:focus-visible { outline:2px solid var(--accel); outline-offset:2px; border-radius:6px; }
[hidden] { display:none !important; }

/* ---------- brand bar ---------- */
.top { position:sticky; top:0; z-index:20; display:flex; align-items:center; justify-content:space-between; gap:20px; padding:14px 32px; border-top:3px solid var(--ink); background:var(--raised); border-bottom:1px solid var(--rule); }
.brand { display:flex; align-items:center; gap:10px; text-decoration:none; }
.brand-mark { color:var(--ink); width:26px; height:26px; flex:none; }
.brand-word { display:grid; line-height:1; }
.brand-word b { font-family:var(--display); font-size:22px; font-weight:900; letter-spacing:.02em; line-height:.9; }
.brand-word small { font-size:11.5px; font-weight:500; color:var(--ink-3); margin-top:3px; }
.nav { display:flex; gap:2px; background:var(--rule-2); border-radius:999px; padding:3px; }
.nav a { padding:7px 14px; border-radius:999px; font-size:13px; font-weight:700; color:var(--ink-2); text-decoration:none; white-space:nowrap; }
.nav a:hover { color:var(--ink); }
.nav a[aria-current="page"] { background:var(--ink); color:var(--on-ink); }
.top-left { display:flex; align-items:center; gap:22px; min-width:0; }
.pickers { display:flex; gap:12px; align-items:end; }
.pick { display:grid; gap:4px; }
.pick > span, .eyebrow { font-size:12px; font-weight:600; color:var(--ink-2); }
select { min-width:190px; padding:8px 30px 8px 10px; border:1px solid var(--rule); border-radius:8px; background:var(--raised); font-size:13px; font-weight:600;
  appearance:none; -webkit-appearance:none; cursor:pointer;
  background-image:linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position:calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size:5px 5px; background-repeat:no-repeat; }
select:hover { border-color:var(--ink-3); }

/* ---------- page ---------- */
main { max-width:1600px; margin:0 auto; padding:22px 32px 40px; }
.hero-title { display:flex; justify-content:space-between; align-items:end; gap:20px; flex-wrap:wrap; }
.hero-title h2 { margin:0; font-family:var(--display); font-size:44px; font-weight:900; letter-spacing:.005em; text-transform:uppercase; line-height:.95; text-wrap:balance; }
.hero-title .sub { margin:8px 0 0; color:var(--ink-2); font-size:14px; font-variant-numeric:tabular-nums; }
.sub .sep { color:var(--rule); margin:0 8px; }
.section { margin-top:48px; }
.section-head { display:flex; align-items:baseline; gap:16px; margin:0 0 16px; padding-top:22px; border-top:1px solid var(--rule); }
.section-head h3 { margin:0; font-family:var(--display); font-size:28px; font-weight:700; letter-spacing:0; line-height:1; }
.section-head p { margin:0; color:var(--ink-3); font-size:13.5px; flex:1; min-width:200px; max-width:72ch; }
.card { border:1px solid var(--rule); border-radius:var(--radius); background:var(--raised); }
.card-head { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:14px 16px 0; }
.card-head h4 { margin:0; font-family:var(--display); font-size:18px; font-weight:700; letter-spacing:0; line-height:1.1; }
.card-head .hint, .explain, .muted { color:var(--ink-3); font-size:12.5px; line-height:1.45; }
.explain { margin:4px 16px 0; }
.take { font-size:12.5px; font-weight:700; text-align:right; }

/* ---------- controls ---------- */
.ctls { padding:4px 16px 16px; }
.ctl { display:grid; gap:4px; margin:0 0 14px; }
.ctl > label { display:flex; justify-content:space-between; align-items:baseline; gap:8px; font-size:13px; font-weight:600; }
.ctl > label output { font-weight:700; font-variant-numeric:tabular-nums; text-align:right; }
.ctl > small, .ctl-foot small { color:var(--ink-3); font-size:11.5px; line-height:1.35; min-height:0; }
.ctl select { min-width:0; width:100%; }
.was { color:var(--ink-3); font-weight:500; margin-left:4px; }
.pill { border:1px solid var(--rule); background:var(--raised); border-radius:999px; padding:4px 10px; font-size:11.5px; font-weight:600; color:var(--ink-2); cursor:pointer; }
.pill:hover { border-color:var(--ink-3); } .pill.on { border-color:var(--ink); color:var(--ink); background:var(--rule-2); }
.tyres { display:flex; gap:6px; flex-wrap:wrap; }
.tyre { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--rule); background:var(--raised); border-radius:999px; padding:4px 10px 4px 6px; font-size:12px; font-weight:600; color:var(--ink-2); cursor:pointer; }
.tyre i { width:12px; height:12px; border-radius:50%; border:3px solid; background:#1d2430; }
.tyre.on { border-color:var(--ink); color:var(--ink); background:var(--rule-2); }
.toggles { display:flex; gap:8px; flex-wrap:wrap; margin:0 0 12px; }
.chip { border:1px solid var(--rule); background:var(--raised); border-radius:999px; padding:5px 12px 5px 9px; cursor:pointer; font-size:12px; font-weight:600; display:inline-flex; align-items:center; gap:6px; color:var(--ink-3); }
.chip i { width:8px; height:8px; border-radius:50%; background:var(--rule); }
.chip.on { border-color:var(--ink); color:var(--ink); } .chip.on i { background:var(--accel); }
details.adv { border-top:1px solid var(--rule-2); padding-top:10px; margin:6px 0 12px; }
details.adv summary { cursor:pointer; font-size:12.5px; font-weight:700; color:var(--ink-2); list-style:none; display:flex; justify-content:space-between; margin-bottom:10px; }
details.adv summary::-webkit-details-marker { display:none; }
details.adv summary::after, .chev::after { content:""; width:7px; height:7px; border-right:1.5px solid var(--ink-3); border-bottom:1.5px solid var(--ink-3); transform:translateY(-2px) rotate(45deg); transition:transform .25s cubic-bezier(.16,1,.3,1); align-self:center; }
details.adv[open] summary::after { transform:translateY(1px) rotate(-135deg); }
.ctl-foot { display:flex; justify-content:space-between; align-items:center; gap:10px; border-top:1px solid var(--rule-2); padding-top:12px; }
.btn { border:1.5px solid var(--ink); background:var(--raised); color:var(--ink); padding:7px 14px; border-radius:999px; font-size:12px; font-weight:700; cursor:pointer; white-space:nowrap; }
.btn:hover { background:var(--ink); color:var(--on-ink); }
.btn.ghost { border-color:var(--rule); } .btn.ghost:hover { background:var(--rule-2); color:var(--ink); }
.btn.sm { padding:5px 11px; }
input[type=range] { -webkit-appearance:none; appearance:none; width:100%; background:transparent; height:18px; margin:0; cursor:pointer; --p:50%; }
input[type=range]::-webkit-slider-runnable-track { height:4px; border-radius:2px; background:linear-gradient(90deg, var(--ink) 0 var(--p), var(--track) var(--p) 100%); }
input[type=range]::-moz-range-track { height:4px; border-radius:2px; background:var(--track); }
input[type=range]::-moz-range-progress { height:4px; border-radius:2px; background:var(--ink); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance:none; width:16px; height:16px; border-radius:50%; background:#fff; margin-top:-6px; border:0; box-shadow:0 0 0 1px rgba(15,23,42,.14), 0 2px 6px rgba(15,23,42,.22); transition:transform .12s ease; }
input[type=range]::-moz-range-thumb { width:16px; height:16px; border-radius:50%; background:#fff; border:0; box-shadow:0 0 0 1px rgba(15,23,42,.14), 0 2px 6px rgba(15,23,42,.22); }
input[type=range]:active::-webkit-slider-thumb { transform:scale(1.12); }
input[type=range]:disabled { opacity:.45; cursor:default; }
.seg { display:inline-flex; background:var(--rule-2); border-radius:999px; padding:2px; }
.seg button { border:0; background:none; padding:4px 10px; border-radius:999px; font-size:11.5px; font-weight:600; color:var(--ink-3); cursor:pointer; }
.seg button.on { background:var(--raised); color:var(--ink); box-shadow:0 0 0 1px rgba(11,11,11,.08); }

/* ---------- transport ---------- */
.transport { display:flex; align-items:center; gap:14px; }
.icon { width:36px; height:36px; border-radius:50%; border:1.5px solid var(--ink); background:var(--raised); display:grid; place-items:center; cursor:pointer; padding:0; flex:none; }
.icon:hover { background:var(--rule-2); }
.icon svg { width:12px; height:12px; }
.transport input[type=range] { flex:1; }
.speeds { display:flex; gap:2px; }
.speeds button { border:0; background:none; padding:6px 9px; border-radius:6px; cursor:pointer; font-size:12px; font-weight:600; color:var(--ink-3); font-variant-numeric:tabular-nums; }
.speeds button.on { color:var(--ink); background:var(--rule-2); }
.clock { font:700 14px var(--font); font-variant-numeric:tabular-nums; min-width:64px; text-align:right; }

/* ---------- 3D view (carfig/model3d.js) with its own chrome hidden ---------- */
.v3d { position:relative; min-height:220px; background:var(--plane); }
.v3d .c3 { border:0; }
.v3d .c3-head, .v3d:not(.with-read) .c3-read, .v3d:not(.with-read) .c3-wind { display:none; }
.v3d.with-read .c3-read dt { font-family:var(--font); letter-spacing:0; text-transform:none; font-size:11px; color:var(--ink-3); }
.v3d .c3-credit { position:static; display:block; margin:0; padding:6px 16px 4px; background:var(--raised); white-space:normal; font-family:var(--font); font-size:10.5px; line-height:1.4; color:var(--ink-3); }
.v3d .loading { position:absolute; inset:0; display:grid; place-items:center; color:var(--ink-3); font-size:12.5px; }
.v3d .loading::before { content:""; width:22px; height:22px; border-radius:50%; border:2.5px solid var(--rule); border-top-color:var(--ink); animation:spin 0.9s linear infinite; margin-bottom:34px; position:absolute; }
@keyframes spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .v3d .loading::before { animation:none; } }

/* flat sections: content separated by a hairline instead of a box (charts that sit in a grid) */
.card.flat { border:0; border-top:1px solid var(--rule); border-radius:0; background:transparent; }
.card.flat .card-head { padding:16px 0 0; } .card.flat .explain { margin-left:0; margin-right:0; } .card.flat .vals { padding-left:0 !important; padding-right:0 !important; }
/* the one authored motion: a new lap time settles in */
@keyframes settle { from { opacity:.25; transform:translateY(6px); filter:blur(3px); } to { opacity:1; transform:none; filter:none; } }
.settle { animation:settle .55s cubic-bezier(.16,1,.3,1); }
@media (prefers-reduced-motion: reduce) { .settle { animation:none; } }
.ev-badge { display:inline-flex; align-items:center; gap:4px; padding:2px 8px 2px 6px; border-radius:999px; font-size:11.5px; font-weight:700; background:#e6f6ee; color:#0d6b47; vertical-align:2px; white-space:nowrap; }
.ev-badge svg { width:11px; height:11px; }
@media (pointer:coarse) { .seg button, .pill, .tyre, .chip, .speeds button, .nav a { min-height:36px; } }

/* ---------- small marks ---------- */
.sw { display:inline-block; width:10px; height:3px; border-radius:2px; vertical-align:middle; margin-right:5px; }
.dot { display:inline-block; width:8px; height:8px; border-radius:50%; vertical-align:0; margin-right:5px; }
.key { display:inline-flex; align-items:center; gap:6px; font-size:12px; color:var(--ink-2); } .key i { width:10px; height:10px; border-radius:3px; display:inline-block; }
.tip { position:absolute; pointer-events:none; background:var(--raised); border:1px solid rgba(11,11,11,.12); border-radius:8px; padding:7px 10px; font-size:12px; line-height:1.5; color:var(--ink-2); box-shadow:0 4px 14px rgba(0,0,0,.06); white-space:nowrap; font-variant-numeric:tabular-nums; display:none; z-index:2; }
.tip b { color:var(--ink); }
.up { color:var(--good-text); } .down { color:var(--bad-text); }

/* the 3D view's own readout (carfig/model3d.js) in the site's type */
.c3 { font-family:var(--font); }
.c3-title { font-family:var(--display) !important; font-size:18px !important; letter-spacing:0 !important; text-transform:none !important; font-weight:700 !important; }
.c3-sub, .c3-read dt, .c3-wind { font-family:var(--font) !important; letter-spacing:0 !important; text-transform:none !important; font-size:12px !important; color:var(--ink-3) !important; }

/* ---------- footer ---------- */
.foot { border-top:1px solid var(--rule); margin-top:48px; background:var(--plane); }
.foot-in { max-width:1600px; margin:0 auto; padding:26px 32px 34px; display:grid; grid-template-columns:minmax(220px,1fr) 2.2fr; gap:28px; font-size:12px; color:var(--ink-2); line-height:1.6; }
.foot-in .brand-word b { font-size:18px; }
.foot-in p { margin:8px 0 0; }
.foot-in h5 { margin:0 0 6px; font-family:var(--display); font-size:14px; font-weight:700; color:var(--ink); }
.foot-cols { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:22px; }
.foot-cols a { color:var(--ink-2); }

@media (max-width:980px) {
  .top { position:static; flex-wrap:wrap; padding:12px 18px; } main { padding:18px 18px 32px; }
  .top-left { flex-wrap:wrap; gap:12px; } select { min-width:0; }
  .foot-in, .foot-cols { grid-template-columns:1fr; }
  .hero-title h2 { font-size:26px; }
}
@media (max-width:620px) { .section-head { flex-wrap:wrap; } .section-head p { flex-basis:100%; } .card-head { flex-wrap:wrap; } .pickers { width:100%; } .pickers .pick { flex:1; min-width:0; } .nav a { padding:6px 10px; font-size:12px; } }

/* ======================================================================================================
   Workbench layout (Lab, Head to head): a sticky control rail beside a dense stage, so every knob and the
   charts it moves are on screen together. Operate-mode density: hairline panels, sentence-case headings.
   ====================================================================================================== */
:root { --rail:#f1f4f7; --top-h:58px; }
.top { padding:9px 20px; min-height:var(--top-h); gap:16px; }
.brand-mark { width:24px; height:24px; }
.brand-word b { font-size:20px; }
.brand-word small { font-size:11px; }
.pickers { gap:10px; align-items:center; }
.pick { display:flex; align-items:center; gap:8px; }
.pick > span { font-size:12px; color:var(--ink-3); }
.pick select { min-width:210px; padding:7px 30px 7px 10px; }
.bench { display:grid; grid-template-columns:304px minmax(0,1fr); min-height:calc(100vh - var(--top-h)); }
.rail { background:var(--rail); border-right:1px solid var(--rule); min-width:0; }
.rail-in { position:sticky; top:var(--top-h); max-height:calc(100vh - var(--top-h)); overflow:auto; padding:16px 18px 28px; scrollbar-gutter:stable; }
.rail-sec + .rail-sec { margin-top:16px; padding-top:14px; border-top:1px solid var(--rule); }
.rail-h { display:flex; justify-content:space-between; align-items:baseline; gap:8px; margin:0 0 12px; font-size:13px; font-weight:700; }
.rail-note { font-size:11.5px; font-weight:500; color:var(--ink-3); }
.rail .ctls { padding:0; }
.rail .ctl { margin-bottom:12px; gap:3px; }
.rail .ctl > label { font-size:12.5px; }
.rail .ctl > small { font-size:11px; }
.rail details.adv { margin:4px 0 10px; }
.rail .ctl-foot { padding-top:10px; }
.rail select { background-color:var(--raised); }
.stage { padding:18px 24px 36px; min-width:0; }
.stage > .transport { position:sticky; top:var(--top-h); z-index:6; background:var(--raised); padding:8px 0; margin:0 0 12px; border-bottom:1px solid var(--rule); }
.panel { border:1px solid var(--rule); border-radius:10px; background:var(--raised); padding:12px 14px; min-width:0; }
.stage > .panel { margin-top:14px; }
.stage > .transport + .panel { margin-top:0; }
.panel-head { display:flex; justify-content:space-between; align-items:center; gap:10px; margin:0 0 8px; min-height:24px; }
.panel-head h3 { margin:0; font-size:13.5px; font-weight:700; }
.panel-head .hint { font-size:12px; color:var(--ink-3); }
.row { display:grid; gap:14px; margin-top:14px; }
.row-3 { grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.15fr); }
.row-2 { grid-template-columns:minmax(0,1.35fr) minmax(0,1fr); }
.icon { width:32px; height:32px; }
.clock { font-size:13px; }
.foot { margin-top:0; }
@media (max-width:1280px) { .row-3 { grid-template-columns:1fr 1fr; } .row-3 > .panel-3d { grid-column:1 / -1; } }
@media (max-width:1100px) {
  .bench { grid-template-columns:minmax(0,1fr); }
  .rail { border-right:0; border-bottom:1px solid var(--rule); }
  .rail-in { position:static; max-height:none; display:grid; grid-template-columns:1fr 1fr; gap:0 28px; }
  .rail-sec + .rail-sec { margin-top:0; padding-top:0; border-top:0; }
  .stage > .transport { top:0; }
  .top { position:static; }
}
@media (max-width:760px) { .rail-in { grid-template-columns:1fr; } .row-3, .row-2 { grid-template-columns:1fr; } .stage { padding:14px 14px 28px; } .pick select { min-width:0; } }
@media (max-width:760px) { .bench > .rail { order:2; border-bottom:0; border-top:1px solid var(--rule); } }
.v3d.with-read .c3-read { overflow-x:auto; scrollbar-width:none; }
@media (max-width:760px) { .stage > .transport { flex-wrap:wrap; row-gap:6px; } .stage > .transport > input[type=range] { order:9; flex:1 1 100%; } }
@media (max-width:760px) { .panel-head .hint { display:none; } }

/* hero map */
.hero-row { grid-template-columns:minmax(0,1.65fr) minmax(330px,1fr); align-items:stretch; margin-top:0; }
.map-panel { display:flex; flex-direction:column; }
.map-wrap { position:relative; flex:1 1 auto; min-height:440px; }
.map-wrap #map { position:absolute; inset:0; width:100%; height:100%; display:block; }
.side { display:grid; gap:14px; align-content:start; min-width:0; }
.cam-wrap { position:relative; margin:0 -14px; }
.cam-wrap #mini { position:absolute; inset:0; width:100%; height:100%; display:block; background:var(--plane); }
.cam-wrap #mini[hidden] { display:none; }
.cam-opts { display:flex; flex-wrap:wrap; gap:6px 16px; padding:10px 0 0; }
canvas.stale { opacity:.35; transition:opacity .2s ease; }
canvas.fresh { opacity:1; transition:opacity .2s ease; }
@media (max-width:1180px) { .hero-row { grid-template-columns:1fr; } .map-wrap { min-height:380px; } }

/* ======================================================================================================
   Flat and calm. One soft paper surface everywhere; no cards, shadows or glass. Sections are separated by
   inset hairlines (they stop short of the edges) and by space, so the data carries the structure.
   ====================================================================================================== */
:root {
  --page:#f4f6f8;                          /* soft blue-grey paper: light, never stark */
  --ink:#13202f; --ink-2:#465365; --ink-3:#5f6b7b;   /* deep navy ink instead of black */
  --line:rgba(19,32,47,.11); --line-soft:rgba(19,32,47,.07);
  --rule:var(--line); --rule-2:rgba(19,32,47,.05); --grid:#e3e8ee; --axis:#b3bdc9; --plane:#e9edf1;
  --pad:20px; --inset:16px;
}
html, body { background:var(--page); }
body { background:var(--page); }
/* header and playback bar: the same paper, held by a single line */
.top { background:var(--page); border-top:0; border-bottom:0; box-shadow:none; }
.top::after { content:""; position:absolute; left:20px; right:20px; bottom:0; height:1px; background:var(--line); }
.nav { background:var(--rule-2); }
.nav a[aria-current="page"] { background:var(--ink); }
select { background-color:var(--raised); border-color:var(--line); box-shadow:none; }
select:hover { border-color:var(--axis); }
.stage { padding-top:18px; }
.stage > .transport { background:var(--page); border:0; border-radius:0; box-shadow:none; padding:10px 0; margin:0 0 6px; top:var(--top-h); }
.stage > .transport::after { content:""; position:absolute; left:0; right:0; bottom:0; height:1px; background:var(--line); }
.icon { background:var(--ink); border:0; box-shadow:none; }
.icon:hover { background:#24354a; }
.icon svg path { fill:var(--on-ink); }
.speeds button.on { background:var(--raised); box-shadow:inset 0 0 0 1px var(--line); }
/* the rail: no box, an inset vertical line on its right */
.rail { background:var(--page); border-right:0; padding:0; position:relative; }
.rail::after { content:""; position:absolute; right:0; top:var(--inset); bottom:var(--inset); width:1px; background:var(--line); }
.rail-in { background:none; border:0; border-radius:0; box-shadow:none; -webkit-backdrop-filter:none; backdrop-filter:none; top:var(--top-h); max-height:calc(100vh - var(--top-h)); padding:18px 22px 28px; }
.rail-sec + .rail-sec { border-top-color:var(--line-soft); }
/* panels: flat */
.panel { background:none; border:0; border-radius:0; box-shadow:none; padding:16px 0; }
.panel-head h3 { font-size:13px; letter-spacing:.005em; }
.seg { background:var(--rule-2); }
.seg button.on { background:var(--raised); box-shadow:inset 0 0 0 1px var(--line); }
.pill, .chip { background:var(--raised); border-color:var(--line); }
.pill.on, .chip.on { box-shadow:none; }
.tip { background:var(--raised); border-color:var(--line); box-shadow:0 8px 24px -12px rgba(19,32,47,.25); border-radius:10px; }
.foot { background:transparent; border-top-color:var(--line); }
.v3d { background:var(--plane); border-radius:10px; overflow:hidden; }
.v3d .c3-credit { font-size:10px; line-height:1.35; padding:6px 0 0; background:transparent; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
/* the sheet: rows of sections. Horizontal lines between rows, short vertical lines between columns. */
.sheet { display:grid; gap:0; }
.sheet > * + * { position:relative; }
.sheet > * + *::before { content:""; position:absolute; left:0; right:0; top:0; height:1px; background:var(--line); }
.sheet .row { gap:0; margin:0; }
.sheet .row > .panel, .sheet .row > .side, .sheet .row > .stack { padding-left:var(--pad); padding-right:var(--pad); position:relative; }
.sheet .row > :first-child { padding-left:0; }
.sheet .row > :last-child { padding-right:0; }
.sheet .row > * + *::after { content:""; position:absolute; left:0; top:var(--inset); bottom:var(--inset); width:1px; background:var(--line); }
.sheet .row > .side, .sheet .row > .stack { padding-top:0; padding-bottom:0; display:flex; flex-direction:column; }
.sheet .side > .panel + .panel, .sheet .stack > .panel + .panel { position:relative; }
.sheet .side > .panel + .panel::before, .sheet .stack > .panel + .panel::before { content:""; position:absolute; left:0; right:0; top:0; height:1px; background:var(--line-soft); }
.sheet .cam-wrap { margin:0; }
.sheet + .sheet, .stage > .sheet + * { margin-top:8px; }
/* chart grids: whitespace between columns, a short line above each chart */
.detail.sheet, .duo.sheet { gap:0 44px; }
.detail.sheet > .card, .duo.sheet > .card { background:none; border:0; border-radius:0; padding:0 0 18px; margin:0; position:relative; }
.detail.sheet > .card::before, .duo.sheet > .card::before { content:""; position:absolute; left:0; right:0; top:0; height:1px; background:var(--line); }
.detail.sheet > .card .card-head, .duo.sheet > .card .card-head { padding-top:16px; }
.channels-head, .won-head { border-top:0; padding-top:10px; }
.hero-row { grid-template-columns:minmax(0,1.6fr) minmax(330px,1fr); }
.map-wrap { min-height:460px; }
@media (max-width:1180px) {
  .sheet .row > .panel, .sheet .row > .side, .sheet .row > .stack { padding-left:0; padding-right:0; }
  .sheet .row > * + *::after { left:0; right:0; top:0; bottom:auto; width:auto; height:1px; }
}
@media (max-width:1100px) { .rail::after { left:var(--inset); right:var(--inset); top:auto; bottom:0; width:auto; height:1px; } .rail-in { top:auto; max-height:none; } }
@media (max-width:760px) { .rail::after { bottom:auto; top:0; } }
.sheet .race-row { align-items:stretch; }
.v3d .c3-credit { background:var(--page); }

/* small toggles: the overlays drawn on the 3D car, and the follow camera */
.ov-toggles { display:flex; flex-wrap:wrap; gap:5px; padding:10px 0 0; }
.ov-toggles button, .follow { border:1px solid var(--line); background:transparent; color:var(--ink-3); border-radius:999px; padding:4px 10px; font:600 11.5px var(--font); cursor:pointer; transition:background .15s, color .15s, border-color .15s; }
.ov-toggles button:hover, .follow:hover { color:var(--ink); border-color:var(--axis); }
.ov-toggles button { display:inline-flex; align-items:center; gap:5px; padding:4px 9px 4px 7px; }
.ov-toggles button::before { content:""; width:8px; height:8px; border-radius:50%; box-shadow:inset 0 0 0 1.5px var(--c); }
.ov-toggles button[aria-pressed="true"] { background:var(--raised); border-color:var(--axis); color:var(--ink); }
.ov-toggles button[aria-pressed="true"]::before { background:var(--c); box-shadow:none; }
.follow[aria-pressed="true"] { background:var(--ink); border-color:var(--ink); color:var(--on-ink); }
.cam-ctl { display:flex; align-items:center; gap:8px; }
/* chart grids flow in columns, so a tall chart never leaves a hole beside a short one */
.detail.sheet, .duo.sheet { display:block; column-count:3; column-gap:44px; contain:inline-size; min-width:0; }
.detail.sheet > .card, .duo.sheet > .card { break-inside:avoid; display:block; width:100%; }
@media (max-width:1400px) { .detail.sheet, .duo.sheet { column-count:2; } }
@media (max-width:760px) { .detail.sheet, .duo.sheet { column-count:1; } }

/* surface tokens used by the controls and canvases */
:root { --raised:#ffffff; --on-ink:#ffffff; --track:#d3dae3; --puck:#ffffff; --wheel:#1b2633; --wheel-grip:#0d141c; --drs-tint:#fbf0d0; --stock:#a3adba; }
.brand-mark { color:var(--ink); }

/* no layout shift while things load: reserve each late-arriving block's final size */
.v3d .c3-credit { height:2.7em; box-sizing:content-box; }          /* always two lines, so every 3D view has a fixed height */
#car3d { min-height:283px; }                                        /* Lab: 250 px view + credit */
.car.panel .v3d { min-height:233px; }                               /* Head to head: 200 px views + credit */
#duoTop { min-height:749px; }                                       /* speed + gap + Right now, built once the laps return */
#ctls:empty, .pane:empty { min-height:440px; }                      /* setup controls render a moment after the car registry */
.duel .who, .duel .d { min-height:1.35em; }                         /* Head to head: the lap-time lines exist before the laps return */
.duel b { min-height:1em; }
html { scrollbar-gutter:stable; }                                  /* a scrollbar appearing never narrows the page */
.bench > .stage { margin:0; max-width:none; width:auto; justify-self:stretch; }   /* main {margin:auto} made the stage shrink-to-fit and widen as charts loaded */
