/* app.css */
/* Site scale: the px-sized site reads ~15% smaller on desktop monitors, like browser zoom at 85%.
 * Eases in from 1200px wide (phones, narrow windows and the companion's 900px Planner keep 1x) to
 * 0.85 from 1700px up. Off: html.no-site-scale (theme.js, from SITE_SCALE in /api/features); the
 * live page inside the planner's iframe (html.in-frame) never scales twice. Heights that fill the
 * window divide 100vh/100dvh by --z, and JS that places popovers from rects divides by currentCSSZoom. */
:root { --z: 1; }
@media (min-width: 1300px) { html:not(.no-site-scale):not(.in-frame) { --z: .97; } }
@media (min-width: 1400px) { html:not(.no-site-scale):not(.in-frame) { --z: .94; } }
@media (min-width: 1500px) { html:not(.no-site-scale):not(.in-frame) { --z: .91; } }
@media (min-width: 1600px) { html:not(.no-site-scale):not(.in-frame) { --z: .88; } }
@media (min-width: 1700px) { html:not(.no-site-scale):not(.in-frame) { --z: .85; } }
html { zoom: var(--z); }

* {
    box-sizing: border-box;
}

:root,
[data-theme="pitwall"] {
    /* Pit Wall — phosphor green on black. The original look; these base tokens fill what a theme leaves unset. */
    --bg: #0a0c0a;
    --bg-2: #080a08;
    --bg-3: #0a1a10;
    --panel: #0e140e;
    --panel-2: #101410;
    --surface-1: #111;
    --surface-2: #1a1a1a;
    --surface-3: #222;
    --line: #1a3d24;
    --line-2: #333;
    --line-3: #444;
    --text: #e8fff0;
    --text-2: #d2ffe3;
    --text-3: #8fbf9f;
    --text-4: #728077;   /* was #666 — 3.3:1 on --panel; hints are 11-12px, so AA 4.5:1 */
    --text-hi: #fff;
    --ink: #03150a;
    --accent: #00ff66;
    --accent-rgb: 0, 255, 102;
    --accent-hover: #00cc55;
    --accent-soft: #8f8;
    --accent-dim: #1a3a2a;
    --accent-deep: #0f2a18;
    --accent-muted: #6a9a78;
    --warn: #ffaa00;
    --warn-2: #ffcc00;
    --warn-soft: #ffcc66;
    --warn-deep: #c9a227;
    --warn-dim: #2a2208;
    --crit: #ff4d6d;
    --crit-soft: #ff8a9a;
    --crit-dim: #3a1a1a;
    --info: #88ccff;
    --info-soft: #9ec9ff;
    --info-deep: #5a9ae0;
    --info-dim: #1a3a6e;
    --radius: 10px;
    --pad-cell: 10px 12px;
    --pad-tab: 12px 16px;

    /* Type scale (1.2 minor third off 14px) and a 4px space scale. Every
       padding/margin below picks from these instead of inventing a number. */
    --fs-micro: 11px;
    --fs-small: 12px;
    --fs-body: 14px;
    --fs-lead: 17px;
    --fs-title: 20px;
    --fs-display: 26px;
    --s1: 4px;
    --s2: 8px;
    --s3: 12px;
    --s4: 16px;
    --s5: 24px;
    --s6: 36px;
    --ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
    /* Status colors, shared with dash.css. --accent is brand/selection only, never status.
       "Better than target" must read green even where --accent is red (Monza, Fuji). */
    --dx-good: #4ade80;
    --dx-best: #c084fc;

    /* Legacy aliases — older rules still say --green. Kept so a theme only has
       to define --accent and both names follow it. */
    --green: var(--accent);
    --green-hover: var(--accent-hover);
}

/* Amber CRT — the old timing-monitor amber. Easier on the eyes at 3am. */
[data-theme="amber"] {
    --bg: #0b0906;
    --bg-2: #080604;
    --bg-3: #1a1206;
    --panel: #14100a;
    --panel-2: #171208;
    --surface-1: #141210;
    --surface-2: #1e1a14;
    --surface-3: #262019;
    --line: #4a3413;
    --line-2: #3a2f1e;
    --line-3: #4a3d26;
    --text: #ffeccd;
    --text-2: #f0d7a8;
    --text-3: #b39463;
    --text-4: #91784e;
    --text-hi: #fffaf0;
    --ink: #1a1204;
    --accent: #ffb000;
    --accent-rgb: 255, 176, 0;
    --accent-hover: #d99500;
    --accent-soft: #ffd48a;
    --accent-dim: #3a2a0c;
    --accent-deep: #2e2008;
    --accent-muted: #a8834a;
    --warn: #ffd166;
    --warn-2: #ffe08a;
    --warn-soft: #ffe9b0;
    --warn-deep: #c9a227;
    --warn-dim: #2e2510;
    --crit: #ff5c5c;
    --crit-soft: #ff9b8f;
    --crit-dim: #3a1a14;
    --info: #7fd4ff;
    --info-soft: #a8e3ff;
    --info-deep: #4a9ec4;
    --info-dim: #16303c;
}

/* Le Mans Night — cool blue, for long dark stints. */
[data-theme="lemans"] {
    --bg: #060a12;
    --bg-2: #04070d;
    --bg-3: #0a1626;
    --panel: #0d1626;
    --panel-2: #101c2e;
    --surface-1: #101720;
    --surface-2: #16202e;
    --surface-3: #1e2a3a;
    --line: #1e3a5f;
    --line-2: #26364a;
    --line-3: #32475e;
    --text: #e6f0ff;
    --text-2: #c2d8f5;
    --text-3: #7d97b8;
    --text-4: #6a819d;
    --text-hi: #fff;
    --ink: #04101f;
    --accent: #4da3ff;
    --accent-rgb: 77, 163, 255;
    --accent-hover: #3d86d6;
    --accent-soft: #9ecbff;
    --accent-dim: #12283f;
    --accent-deep: #0d2136;
    --accent-muted: #6d8bad;
    --warn: #ffb648;
    --warn-2: #ffcb75;
    --warn-soft: #ffdb9e;
    --warn-deep: #c98f2e;
    --warn-dim: #2e2413;
    --crit: #ff5f6d;
    --crit-soft: #ff96a0;
    --crit-dim: #34161d;
    --info: #8fe3d0;
    --info-soft: #b4efe2;
    --info-deep: #4fa899;
    --info-dim: #113029;
}

/* Monaco Harbour — deep violet-blue, yacht lights on water. */
[data-theme="monaco"] {
    --bg: #0a0610;
    --bg-2: #07040c;
    --bg-3: #160a22;
    --panel: #120a1a;
    --panel-2: #16101f;
    --surface-1: #15101c;
    --surface-2: #1e1628;
    --surface-3: #281e34;
    --line: #3a2458;
    --line-2: #322640;
    --line-3: #423252;
    --text: #f0e6ff;
    --text-2: #d4c2f0;
    --text-3: #9a84b8;
    --text-4: #8671a2;
    --text-hi: #fff;
    --ink: #10081a;
    --accent: #c084fc;
    --accent-rgb: 192, 132, 252;
    --accent-hover: #a855f7;
    --accent-soft: #e0b8ff;
    --accent-dim: #2a1840;
    --accent-deep: #1e1030;
    --accent-muted: #906fb0;
    --warn: #ffb648;
    --warn-2: #ffcb75;
    --warn-soft: #ffdb9e;
    --warn-deep: #c98f2e;
    --warn-dim: #2e2413;
    --crit: #ff5f8a;
    --crit-soft: #ff96b0;
    --crit-dim: #34161d;
    --info: #7dd3fc;
    --info-soft: #a5e4ff;
    --info-deep: #4aa8c4;
    --info-dim: #122e3c;
}

/* Spa Forest — deep Ardennes green, night under the canopy. */
[data-theme="spa"] {
    --bg: #060a06;
    --bg-2: #040704;
    --bg-3: #0a160a;
    --panel: #0c140c;
    --panel-2: #101810;
    --surface-1: #101610;
    --surface-2: #162016;
    --surface-3: #1e2a1e;
    --line: #1e4a28;
    --line-2: #26362a;
    --line-3: #324738;
    --text: #e6ffe8;
    --text-2: #c2f0c8;
    --text-3: #7db88a;
    --text-4: #5a8668;
    --text-hi: #fff;
    --ink: #041004;
    --accent: #3dd68c;
    --accent-rgb: 61, 214, 140;
    --accent-hover: #2bb872;
    --accent-soft: #8aefb8;
    --accent-dim: #123028;
    --accent-deep: #0d241c;
    --accent-muted: #5a9a78;
    --warn: #ffb648;
    --warn-2: #ffcb75;
    --warn-soft: #ffdb9e;
    --warn-deep: #c98f2e;
    --warn-dim: #2e2413;
    --crit: #ff5f6d;
    --crit-soft: #ff96a0;
    --crit-dim: #34161d;
    --info: #7fd4ff;
    --info-soft: #a8e3ff;
    --info-deep: #4a9ec4;
    --info-dim: #16303c;
}

/* Monza Red — Italian racing red on near-black. */
[data-theme="monza"] {
    --bg: #0c0606;
    --bg-2: #0a0404;
    --bg-3: #1a0a0a;
    --panel: #140c0c;
    --panel-2: #181010;
    --surface-1: #161010;
    --surface-2: #201616;
    --surface-3: #2a1e1e;
    --line: #4a1e1e;
    --line-2: #3a2626;
    --line-3: #4a3232;
    --text: #ffe6e6;
    --text-2: #f0c8c8;
    --text-3: #b88484;
    --text-4: #9f6e6e;
    --text-hi: #fff;
    --ink: #1a0808;
    --accent: #f05050;
    --accent-rgb: 240, 80, 80;
    --accent-hover: #dc2626;
    --accent-soft: #fca5a5;
    --accent-dim: #3a1414;
    --accent-deep: #2a0e0e;
    --accent-muted: #b56666;
    --warn: #ffb648;
    --warn-2: #ffcb75;
    --warn-soft: #ffdb9e;
    --warn-deep: #c98f2e;
    --warn-dim: #2e2413;
    --crit: #ff6b8a;
    --crit-soft: #ff9ab0;
    --crit-dim: #3a1420;
    --info: #7fd4ff;
    --info-soft: #a8e3ff;
    --info-deep: #4a9ec4;
    --info-dim: #16303c;
}

/* Silverstone — cool steel grey, British overcast. The default: a page with no data-theme gets it too (#781). */
:root:not([data-theme]),
[data-theme="silverstone"] {
    --bg: #080a08;
    --bg-2: #060806;
    --bg-3: #101410;
    --panel: #0e1210;
    --panel-2: #121612;
    --surface-1: #121612;
    --surface-2: #1a1e1a;
    --surface-3: #222822;
    --line: #2e3a32;
    --line-2: #2a322c;
    --line-3: #3a443c;
    --text: #e8f0ea;
    --text-2: #c8d4cc;
    --text-3: #8a9a90;
    --text-4: #708076;
    --text-hi: #fff;
    --ink: #060806;
    --accent: #94a3b8;
    --accent-rgb: 148, 163, 184;
    --accent-hover: #7b8fa6;
    --accent-soft: #cbd5e1;
    --accent-dim: #1e2830;
    --accent-deep: #141c22;
    --accent-muted: #71808e;
    --warn: #ffb648;
    --warn-2: #ffcb75;
    --warn-soft: #ffdb9e;
    --warn-deep: #c98f2e;
    --warn-dim: #2e2413;
    --crit: #ff5f6d;
    --crit-soft: #ff96a0;
    --crit-dim: #34161d;
    --info: #7dd3fc;
    --info-soft: #a5e4ff;
    --info-deep: #4aa8c4;
    --info-dim: #122e3c;
}

/* Fuji Dawn — deep crimson on near-black (matches the red UI look). */
[data-theme="fuji"] {
    --bg: #0a0608;
    --bg-2: #080406;
    --bg-3: #160a0e;
    --panel: #10080c;
    --panel-2: #140a10;
    --surface-1: #140c10;
    --surface-2: #1c1216;
    --surface-3: #26181e;
    --line: #3a1820;
    --line-2: #2e1a20;
    --line-3: #3e242c;
    --text: #ffe8ec;
    --text-2: #f0c8d0;
    --text-3: #b88890;
    --text-4: #986d75;
    --text-hi: #fff;
    --ink: #1a080c;
    --accent: #f43f5e;   /* was #e11d48 — 4.1:1 under --ink button text */
    --accent-rgb: 244, 63, 94;
    --accent-hover: #e11d48;
    --accent-soft: #fb7185;
    --accent-dim: #3a1018;
    --accent-deep: #2a0a10;
    --accent-muted: #ba5e6e;
    --warn: #ffb648;
    --warn-2: #ffcb75;
    --warn-soft: #ffdb9e;
    --warn-deep: #c98f2e;
    --warn-dim: #2e2413;
    --crit: #ff6b8a;
    --crit-soft: #ff9ab0;
    --crit-dim: #3a1420;
    --info: #7dd3fc;
    --info-soft: #a5e4ff;
    --info-deep: #4aa8c4;
    --info-dim: #122e3c;
}

/* Daytona Dusk — warm sunset orange on dark asphalt. */
[data-theme="daytona"] {
    --bg: #0c0806;
    --bg-2: #0a0604;
    --bg-3: #1a120a;
    --panel: #14100a;
    --panel-2: #18140c;
    --surface-1: #16120e;
    --surface-2: #201a14;
    --surface-3: #2a221a;
    --line: #4a3418;
    --line-2: #3a2e1e;
    --line-3: #4a3c28;
    --text: #fff0e0;
    --text-2: #f0d8c0;
    --text-3: #b89870;
    --text-4: #917856;
    --text-hi: #fffaf0;
    --ink: #1a1008;
    --accent: #fb923c;
    --accent-rgb: 251, 146, 60;
    --accent-hover: #f97316;
    --accent-soft: #fdba74;
    --accent-dim: #3a2410;
    --accent-deep: #2a1a0a;
    --accent-muted: #a87848;
    --warn: #ffd166;
    --warn-2: #ffe08a;
    --warn-soft: #ffe9b0;
    --warn-deep: #c9a227;
    --warn-dim: #2e2510;
    --crit: #ff5c5c;
    --crit-soft: #ff9b8f;
    --crit-dim: #3a1a14;
    --info: #7fd4ff;
    --info-soft: #a8e3ff;
    --info-deep: #4a9ec4;
    --info-dim: #16303c;
}

/* Daylight — high-contrast light, for a bright room or a daytime stream. */
[data-theme="daylight"] {
    --bg: #f2f5f0;
    --bg-2: #e8ece6;
    --bg-3: #dfe8e0;
    --panel: #ffffff;
    --panel-2: #f7faf6;
    --surface-1: #eef2ec;
    --surface-2: #e4eae2;
    --surface-3: #d8e0d6;
    --line: #c2d0be;
    --line-2: #cdd6ca;
    --line-3: #b8c4b5;
    --text: #10201a;
    --text-2: #2c4038;
    --text-3: #50645a;
    --text-4: #586c62;
    --text-hi: #05100c;
    --ink: #ffffff;
    --accent: #0b7a3d;
    --accent-rgb: 11, 122, 61;
    --accent-hover: #0a6534;
    --accent-soft: #3fa168;
    --accent-dim: #ddf0e3;
    --accent-deep: #c3e2ce;
    --accent-muted: #4c775f;
    --warn: #9a5700;
    --warn-2: #b06a00;
    --warn-soft: #7d4700;   /* text on --warn-dim: darker, not lighter, on a light page */
    --warn-deep: #7d4700;
    --warn-dim: #f6e6cc;
    --crit: #b3202f;
    --crit-soft: #d14a58;
    --crit-dim: #f7dcdf;
    --info: #12578f;
    --info-soft: #3d7cb0;
    --info-deep: #0d4270;
    --info-dim: #d8e6f3;
}

/* The wordmark PNG is bright green (#01ff8f), 1.3:1 on Daylight's white header.
   Darkened to about the Daylight accent: 6:1. */
[data-theme="daylight"] .brand-logo-img,
[data-theme="daylight"] .lobby-logo { filter: brightness(0.45); }
[data-theme="daylight"] { --dx-good: var(--accent); --dx-best: #7a2fc0; }

/* Racing-class colors (shared with official-views.css): the per-class dot/pill color, read by the live track map (dash.js). */
[data-cls="Hyper"], [data-cls="Hypercar"] { --cls: #e5484d; } [data-cls="LMP2"] { --cls: #3e8ef7; } [data-cls="LMP3"] { --cls: #a66cff; }
[data-cls="GT3"] { --cls: #f2a33a; } [data-cls="GTE"] { --cls: #e05fa8; }
[data-theme="daylight"] [data-cls="GT3"] { --cls: #c97a10; } [data-theme="daylight"] [data-cls="LMP3"] { --cls: #7f45d6; }

/* good / watch / act / best. Don't color the default "OK". */
.c-good { color: var(--dx-good); }
/* Tire temperature bands (tire-temp.js, #977): cold under 70, target 75 to 80, in window (off target) 70 to 90, hot over 90. */
.tt-cold { color: var(--info); }
.tt-target { color: var(--dx-good); font-weight: 700; }
.tt-window { color: color-mix(in srgb, var(--dx-good) 55%, #fff); }
.tt-hot { color: var(--warn); font-weight: 700; }
.c-warn { color: var(--warn); }
.c-bad { color: var(--crit); }
.c-best { color: var(--dx-best); }

/* Mono — no hue at all. For glare, colour-blind viewing, or clean capture. */
[data-theme="mono"] {
    --bg: #000;
    --bg-2: #000;
    --bg-3: #0e0e0e;
    --panel: #0b0b0b;
    --panel-2: #0f0f0f;
    --surface-1: #141414;
    --surface-2: #1c1c1c;
    --surface-3: #242424;
    --line: #2e2e2e;
    --line-2: #333;
    --line-3: #444;
    --text: #fff;
    --text-2: #d6d6d6;
    --text-3: #9a9a9a;
    --text-4: #797979;
    --text-hi: #fff;
    --ink: #000;
    --accent: #fff;
    --accent-rgb: 255, 255, 255;
    --accent-hover: #c9c9c9;
    --accent-soft: #e0e0e0;
    --accent-dim: #262626;
    --accent-deep: #1a1a1a;
    --accent-muted: #8a8a8a;
    --warn: #ffd400;
    --warn-2: #ffe14d;
    --warn-soft: #ffeb8a;
    --warn-deep: #b39400;
    --warn-dim: #2b2510;
    --crit: #ff3b30;
    --crit-soft: #ff7a72;
    --crit-dim: #331411;
    --info: #4db8ff;
    --info-soft: #8ad1ff;
    --info-deep: #2b7ab3;
    --info-dim: #10293a;
}

/* Theme picker (dropdown). Was a cycle button — reaching a theme meant
   stepping through the others, and the light one at full brightness in a dark
   room is genuinely unpleasant to hit by accident. */
.theme-picker {
    position: relative;
    display: inline-block;
}

.theme-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-1);
    border: 1px solid var(--surface-3);
    color: var(--text-2);
    border-radius: 8px;
    padding: 8px 12px;
    min-height: 0;
    margin: 0;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease;
}
.theme-trigger:hover { border-color: var(--accent); color: var(--text); }
.theme-trigger:focus-visible { outline: none; box-shadow: var(--ring); }
.theme-trigger:active { transform: none; }

.theme-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: var(--accent);
    box-shadow: 0 0 0 1px var(--line) inset;
    flex: none;
}
.theme-name { min-width: 84px; text-align: left; }
.theme-caret { font-size: 10px; color: var(--text-4); }

.theme-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 10005;
    min-width: 210px;
    max-height: min(70vh, 480px);
    overflow-y: auto;
    padding: 6px;
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .55);
}
.theme-menu[hidden] { display: none; }

.theme-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 8px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.theme-menu button:hover { background: var(--surface-2); color: var(--text); }
.theme-menu button:active { transform: none; }
.theme-menu button:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--accent);
}
.theme-menu button.is-current { background: var(--accent-dim); color: var(--text); }
.theme-menu button.is-current::after {
    content: "\2713";
    margin-left: auto;
    color: var(--accent);
    font-weight: 700;
}
.theme-menu .tnote {
    margin-left: auto;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-4);
}
.theme-menu button.is-current .tnote { margin-left: 0; }

/* Each swatch previews its own theme's background and accent, so the light
   one is identifiable before you select it. */
.theme-menu .sw {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex: none;
    box-shadow: 0 0 0 1px rgba(128, 128, 128, .45) inset;
}
:is(.theme-menu, .lobby-swatches) .sw[data-sw="pitwall"]     { background: linear-gradient(135deg, #0a0c0a 50%, #00ff66 50%); }
:is(.theme-menu, .lobby-swatches) .sw[data-sw="amber"]       { background: linear-gradient(135deg, #0b0906 50%, #ffb000 50%); }
:is(.theme-menu, .lobby-swatches) .sw[data-sw="lemans"]      { background: linear-gradient(135deg, #060a12 50%, #4da3ff 50%); }
:is(.theme-menu, .lobby-swatches) .sw[data-sw="monaco"]      { background: linear-gradient(135deg, #0a0610 50%, #c084fc 50%); }
:is(.theme-menu, .lobby-swatches) .sw[data-sw="spa"]         { background: linear-gradient(135deg, #060a06 50%, #3dd68c 50%); }
:is(.theme-menu, .lobby-swatches) .sw[data-sw="monza"]       { background: linear-gradient(135deg, #0c0606 50%, #f05050 50%); }
:is(.theme-menu, .lobby-swatches) .sw[data-sw="silverstone"] { background: linear-gradient(135deg, #080a08 50%, #94a3b8 50%); }
:is(.theme-menu, .lobby-swatches) .sw[data-sw="fuji"]        { background: linear-gradient(135deg, #0a0608 50%, #f43f5e 50%); }
:is(.theme-menu, .lobby-swatches) .sw[data-sw="daytona"]     { background: linear-gradient(135deg, #0c0806 50%, #fb923c 50%); }
:is(.theme-menu, .lobby-swatches) .sw[data-sw="mono"]        { background: linear-gradient(135deg, #000 50%, #fff 50%); }
:is(.theme-menu, .lobby-swatches) .sw[data-sw="daylight"]    { background: linear-gradient(135deg, #f2f5f0 50%, #0b7a3d 50%); }

/* Themed surfaces should cross-fade rather than snap */
body, .panel, .content, table, th, td, .tab, .subtab {
    transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
@media (prefers-reduced-motion: reduce) {
    body, .panel, .content, table, th, td, .tab, .subtab, .theme-trigger {
        transition: none;
    }
}

body {
    margin: 0;
    padding: 0;
    min-height: calc(100vh / var(--z, 1));
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

#app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 12px 12px;
}

body.has-race-ticker #app {
    padding-top: 44px;
}

/* ========== GLOBAL RACE TICKER (static — no clone / no marquee) ========== */
.race-ticker {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10050;
    height: 36px;
    background: linear-gradient(180deg, var(--accent-deep) 0%, var(--bg-3) 100%);
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.35);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.race-ticker::-webkit-scrollbar {
    display: none;
}
.race-ticker[hidden] {
    display: none !important;
}
.race-ticker-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-width: 100%;
    width: max-content;
    margin: 0 auto;
    padding: 0 8px;
    box-sizing: border-box;
}
.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    height: 100%;
    border-right: 1px solid rgba(var(--accent-rgb), 0.12);
    white-space: nowrap;
    flex-shrink: 0;
}
.ticker-item:last-child {
    border-right: none;
}
.ticker-item .tk-label {
    color: var(--accent-muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.ticker-item .tk-val {
    color: var(--text);
    font-variant-numeric: tabular-nums;
    font-weight: 750;
    font-size: 13px;
}
.ticker-item .tk-val.accent { color: var(--accent); }
.ticker-item .tk-val.warn { color: var(--warn-soft); }
.ticker-item .tk-val.crit { color: var(--crit-soft); }
.ticker-item .tk-val.muted { color: var(--accent-muted); font-weight: 600; }

/* ========== TOP BAR ========== */
.top-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    margin: 10px 0;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
    /* As tall as the room chip, which is the tallest thing that can sit in
     * this row and only exists inside a race. Without it the header on Teams
     * and What's new is shorter than the planner's, and the whole page jumps
     * every time you move between them. Measured, not guessed: the chip is
     * 56px, so anything less leaves the gap it is here to close. */
    min-height: 56px;
}

.brand-logo-img {
    height: 100px;
    width: 150px;
}

.top-actions {
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
}

.top-btn {
    flex: 1;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line-2);
    border-radius: 8px;
    background: var(--surface-1);
    color: var(--text-2);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}

    .top-btn:active {
        transform: scale(0.97);
    }

.room-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-1);
    border: 1px solid var(--surface-3);
    border-radius: 8px;
    padding: 8px 12px;
}

.room-label {
    color: var(--text-3);
    font-size: 0.8rem;
}

.room-code {
    color: var(--accent);
    font-family: monospace;
    font-size: 0.95rem;
    font-weight: 600;
}

.room-copy-btn {
    padding: 6px 12px;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 36px;
}

.gmt-clock {
    margin-left: auto;
    background: var(--surface-1);
    border: 1px solid var(--surface-3);
    border-radius: 8px;
    padding: 8px 14px;
    color: var(--accent);
    font-family: monospace;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ========== TABS ========== */
.tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

    .tabs::-webkit-scrollbar {
        display: none;
    }

.tab {
    flex: 1 0 auto;
    text-align: center;
    padding: 11px var(--s4);
    border-radius: 8px;
    color: var(--text-3);
    font-weight: 650;
    font-size: var(--fs-body);
    cursor: pointer;
    white-space: nowrap;
    transition: color .14s ease, background-color .14s ease;
}

    /* Selected, not shouting: underline + text, so the primary action stays the loudest thing. */
    .tab.active {
        background: var(--accent-dim);
        color: var(--text-hi);
        box-shadow: inset 0 -2px 0 var(--accent);
    }

.content {
    display: none;
    padding: 8px 0 16px;
}

    .content.active {
        display: block;
    }

/* ========== SUBTABS ========== */
.subtabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 14px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

    .subtabs::-webkit-scrollbar {
        display: none;
    }

.subtab {
    flex: 0 0 auto;
    padding: 10px 14px;
    border-radius: 7px;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
    white-space: nowrap;
}

    /* Selected: a fill plus the accent underline, the same mark as the main bar and the data page rails. */
    .subtab.active {
        color: var(--text-hi);
        background: rgba(var(--accent-rgb), 0.2);
        box-shadow: inset 0 -2px 0 var(--accent);
    }

.subcontent {
    display: none;
}

    .subcontent.active {
        display: block;
    }

/* ========== TYPE ========== */
h1, h2 {
    margin: 0 0 12px;
    color: var(--text);
    font-weight: 750;
}

h1 {
    font-size: 1.25rem;
}

h2 {
    margin-top: 22px;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--line);
    padding-bottom: 6px;
}


/* Where the per-lap numbers came from. One line above the rates table
   answering the question people ask first — "am I planning on something we
   measured, or on guesses?" — with the per-field detail underneath each box. */
.rate-summary {
    /* A note, not a warning. It was a full bordered panel in a surface colour,
       which gave a neutral remark the weight of something gone wrong — and it
       sits directly above the table, so it was the first thing read. A rule on
       the left and quiet text is enough; the accent is kept for the one state
       that is actually good news. */
    margin: 0 0 10px;
    padding: 2px 0 2px 10px;
    border-left: 2px solid var(--line-2);
    background: none;
    color: var(--text-3);
    font-size: 13px;
    line-height: 1.45;
}
.rate-summary.is-empty { color: var(--text-4); }
.rate-summary.is-measured { border-left-color: var(--accent); color: var(--text-2); }


/* The offers strip: whatever numbers are available right now, above the table
   they go into, one click each. Replaces having to know which tab to visit. */
#rateOffers { margin: 0 0 12px; display: grid; gap: 8px; }
.rate-offer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border: 1px solid var(--accent-dim);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    background: var(--surface-1);
}
.rate-offer .ro-text { display: grid; gap: 2px; min-width: 240px; flex: 1 1 320px; }
.rate-offer strong { color: var(--text); font-size: 14px; font-weight: 650; }
.rate-offer .ro-bits { color: var(--text-3); font-size: 13px; }
.rate-offer .ro-acts { display: flex; gap: 8px; flex: 0 0 auto; }
.rate-offer .ro-acts button { margin: 0; }

/* ========== TABLES ========== */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 16px;
    background: var(--panel);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
    min-width: 320px;
}

.table-wrap table {
    margin-bottom: 0;
}

th, td {
    border: 1px solid var(--line);
    padding: 11px 12px;
    text-align: left;
    font-size: 13px;
    color: var(--text);
    vertical-align: middle;
}

th {
    background: var(--accent-dim);
    color: var(--text-2);
    font-size: 11px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    position: sticky;
    top: 0;
    z-index: 2;
}

/* This used to be a GLOBAL rule forcing every table's first column to behave
   like a label column — a hangover from settings being built as tables. It
   broke real data tables (live.html carries an override to undo it). It is now
   opt-in via .kv, so a data table is just a data table. */
.kv td:first-child {
    width: 42%;
    max-width: 220px;
    word-break: break-word;
    color: var(--text-2);
}

/* Figures line up and stop jittering as they tick. */
td, th { font-variant-numeric: tabular-nums; }
td.num, th.num { text-align: right; }

/* ========== ACTION ROWS ========== */
.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.tire-controls {
    margin-bottom: 16px;
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

/* ========== INPUTS ========== */
input[type="text"],
input[type="number"],
input[type="url"],
select,
input[type="datetime-local"],
input[type="time"],
input[type="date"] {
    background: var(--bg-2);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    outline: none;
    font-size: 16px; /* stops iOS zoom */
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    caret-color: var(--green);
}

input[type="datetime-local"],
input[type="time"],
input[type="date"] {
    color-scheme: dark;
}

/* Soft invalid style – only subtle, not crazy pink boxes */
input.invalid,
select.invalid {
    border-color: var(--crit-soft) !important;
    box-shadow: 0 0 0 1px rgba(255, 77, 109, 0.25) !important;
}

input[type="color"] {
    width: 48px;
    height: 40px;
    padding: 3px;
    border: 1px solid var(--line);
    background: var(--bg-2);
    border-radius: 8px;
}

/* ========== BUTTONS ========== */
/* Button hierarchy. Everything used to be a filled green button, so nothing
   read as the primary action. Default is now the SECONDARY treatment; opt in
   to .btn-primary for the one action that matters in a view, .btn-ghost for
   tertiary. Destructive actions get .btn-danger. */
button {
    background: var(--surface-1);
    color: var(--text);
    border: 1px solid var(--line-2);
    border-radius: 8px;
    padding: 0 var(--s4);
    margin: 0 var(--s2) var(--s2) 0;
    font-size: var(--fs-body);
    font-weight: 600;
    cursor: pointer;
    min-height: 42px;
    transition: border-color .14s ease, background-color .14s ease, color .14s ease;
}
button:hover { border-color: var(--accent); color: var(--text); }
button:active { transform: translateY(1px); }
button:focus-visible { outline: none; box-shadow: var(--ring); }
/* Links had only the browser default ring: near-black, lost on every dark theme. */
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
button[disabled] { opacity: .45; cursor: not-allowed; }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--ink);
    font-weight: 700;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--ink); }

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-3);
}
.btn-ghost:hover { color: var(--text); border-color: var(--line-2); }

.btn-danger { border-color: var(--crit-dim); color: var(--crit); }
/* Same button classes on links (e.g. Teams "Sign in with Discord"); base styles only target button. */
a.btn-primary, a.btn-ghost, a.btn-danger {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 var(--s4);
    border-width: 1px;
    border-style: solid;
    border-radius: 8px;
    text-decoration: none;
}
.btn-danger:hover { border-color: var(--crit); color: var(--crit); }


/* Tire controls – make the number inputs readable */
.tire-controls input[type="number"] {
    width: 64px !important;
    min-width: 64px;
    padding: 6px 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
    background: var(--surface-2);
    border: 1px solid var(--line-2);
    border-radius: 4px;
    text-align: center;
}

    .tire-controls input[type="number"]:focus {
        border-color: var(--accent);
        outline: none;
    }

/* Slightly wider for the life limit */
#maxWearLimit {
    width: 72px !important;
}

/* ========== FOOTER ========== */
/* In the flow, not fixed: a fixed footer covered the bottom ~80px of every tab. */
#siteFooter {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--bg-2);
    border-top: 1px solid var(--line);
    color: var(--text-3);
    font-size: 12px;
}

    #siteFooter button {
        margin: 0;
        padding: 8px 18px;
        background: transparent;
        color: var(--green);
        border: 1px solid var(--green);
        min-height: 40px;
    }

/* ========== LOBBY ========== */
#lobby {
    background: var(--bg) !important;
}

.lobby-card {
    background: var(--surface-1);
    border: 1px solid var(--accent);
    border-radius: 14px;
    padding: 28px 20px;
    width: 100%;
    max-width: 360px;
    margin: 0;   /* .lobby-wrap pads it; 16px here pushed it 16px off-centre and past the edge at 360px */
    text-align: center;
    box-shadow: 0 0 40px rgba(var(--accent-rgb), 0.08);
}

.lobby-title {
    margin: 0 0 6px;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--accent);
}

.lobby-subtitle {
    margin: 0 0 22px;
    color: var(--text-4);
    font-size: 0.9rem;
}

.lobby-btn-primary {
    width: 100%;
    margin: 0;   /* the global button margin-right made it 8px wider than its card */
    padding: 15px;
    background: var(--accent);
    color: var(--ink);
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    min-height: 50px;
}

.lobby-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--text-4);   /* was --line-3, a border colour: about 2:1 as text */
    font-size: 0.8rem;
}

.lobby-line {
    flex: 1;
    height: 1px;
    background: var(--surface-3);
}

.lobby-join-row {
    display: flex;
    gap: 8px;
}

.lobby-input {
    flex: 1;
    padding: 13px 14px;
    background: var(--bg-2);
    border: 1px solid var(--line-2);
    border-radius: 8px;
    color: var(--accent);
    font-family: monospace;
    font-size: 1rem;
    min-height: 50px;
}

.lobby-btn-secondary {
    padding: 13px 18px;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 8px;
    font-weight: 700;
    min-height: 50px;
}

.lobby-error {
    color: var(--crit);
    font-size: 0.85rem;
    margin: 14px 0 0;
    min-height: 1.2em;
}

/* ========== TOAST ========== */
#toast {
    display: none;
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-1);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10000;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0,0,0,0.55);
}
/* Clicks go through the message to what it covers (the wizard's Next); its Undo stays clickable. */
#toast { pointer-events: none; }
#toast button { pointer-events: auto; }
/* A toast with a button (an error's Close, an Undo) takes the pointer, so hovering it pauses its timer. */
#toast.has-btn { pointer-events: auto; }
#toast.is-err { padding-right: 8px; }
#toast .toast-close {
    margin-left: 10px; min-width: 32px; min-height: 32px; padding: 0 6px; vertical-align: middle;
    border: 1px solid currentColor; border-radius: 8px; background: transparent; color: inherit;
    font: inherit; font-size: 18px; line-height: 1; cursor: pointer;
}
#toast .toast-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The live regions toast.js and keepFocus speak through: in the markup from load, never seen. */
#a11yStatus, #toastAlert { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* With the setup wizard open, the message sits above it, clear of its buttons. */
html.sw-open #toast { top: 12px; bottom: auto; }

/* ========== DESKTOP (restore nicer layout) ========== */
@media (min-width: 769px) {
    .top-bar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
    }

    .top-bar-left,
    .top-bar-right {
        width: auto;
        flex-wrap: nowrap;
    }

    .top-actions {
        flex: none;
        justify-content: flex-start;
    }

    .top-btn {
        flex: none;
        height: 36px;
        font-size: 13px;
    }

    .brand-logo-img {
        height: 44px;
    }

    #app {
        padding: 0 16px 12px;
    }

    input[type="text"],
    input[type="number"],
    select,
    input[type="datetime-local"],
    input[type="time"] {
        font-size: 14px;
        min-height: 38px;
        width: auto;
    }

    td:first-child {
        width: auto;
        max-width: none;
    }
}

select.tire-pick {
    width: 100%;
    min-width: 88px;
    margin-top: 3px;
    font-size: 11px;
    padding: 3px 4px;
    background: var(--surface-2);
    border: 1px solid var(--line-2);
    color: var(--text-hi);
    border-radius: 4px;
}

.life-num {
    display: block;
}

.field-hint {
    display: none;
    position: fixed;
    z-index: 10001;
    max-width: 260px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-2);
    background: var(--surface-1);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

    .field-hint strong {
        color: var(--text-hi);
    }

    .field-hint.is-visible {
        display: block;
    }

.bmc-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    opacity: 0.85;
}

    .bmc-link:hover {
        opacity: 1;
        text-decoration: underline;
    }

.stint-type-legend {
    margin: 8px 0 10px;
    font-size: 12px;
    color: var(--text-3);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

    .stint-type-legend .legend-label {
        color: var(--text-3);
    }

    .stint-type-legend .legend-item {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

.stint-type-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    border: 1px solid;
    box-sizing: border-box;
}

    .stint-type-chip.std {
        background: var(--accent-dim);
        color: var(--accent);
        border-color: var(--accent);
    }

    .stint-type-chip.fs {
        background: var(--warn-dim);
        color: var(--warn-2);
        border-color: var(--warn-2);
    }

    .stint-type-chip.wet {
        background: var(--info-dim);
        color: var(--info);
        border-color: var(--info);
    }

.stint-type-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    line-height: 1;
    box-sizing: border-box;
}

    .stint-type-btn:hover {
        filter: brightness(1.15);
    }

.driver-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 88px;
    max-width: 140px;
    height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.25);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    /* on the driver's own colour — not a themed surface */
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .driver-chip:hover {
        filter: brightness(1.1);
    }

    .driver-chip.empty {
        background: var(--surface-3);
        color: var(--text-3);
        border-color: var(--line-3);
    }

.driver-menu {
    position: fixed;
    z-index: 10002;
    min-width: 160px;
    width: max-content;
    max-width: min(280px, calc(100vw - 16px));
    /* no max-height, no overflow-y */
    background: var(--surface-1);
    border: 1px solid var(--accent);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
    padding: 6px;
}

    /* Menu items are list rows, not standalone buttons. Without these resets
       the global button rule applies its 42px min-height and 8px right/bottom
       margin to every item, which inflates each row to ~50px and gaps them —
       a full roster then runs off the bottom of the screen. */
    .driver-menu button {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        min-height: 0;
        margin: 0;
        border: none;
        background: transparent;
        color: var(--text-2);
        font-size: 13px;
        font-weight: 600;
        padding: 8px 10px;
        border-radius: 6px;
        cursor: pointer;
        text-align: left;
    }
    .driver-menu button:active { transform: none; }
    .driver-menu button:focus-visible {
        outline: none;
        box-shadow: inset 0 0 0 2px var(--accent);
    }
    /* Long rosters scroll inside the menu rather than off the page. */
    .driver-menu {
        max-height: min(60vh, 420px);
        overflow-y: auto;
    }

        .driver-menu button:hover {
            background: var(--surface-2);
        }

    .driver-menu button.is-unavailable {
        color: var(--text-4);
        cursor: not-allowed;
    }
    .driver-menu button.is-unavailable:hover { background: transparent; }
    .driver-menu button.is-unavailable .swatch { opacity: .4; }
    .driver-menu button.is-current { color: var(--text); background: var(--accent-dim); }
    .driver-menu .tick { margin-left: auto; color: var(--accent); font-weight: 700; }
    .driver-menu-empty {
        padding: 10px;
        font-size: 13px;
        color: var(--text-4);
    }

    .driver-menu .swatch {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        flex-shrink: 0;
    }

.tire-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 64px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--line-2);
    background: var(--surface-2);
    color: var(--text-3);
    font-size: 11px;
    font-weight: 600;
    cursor: default;
    line-height: 1;
}

    .tire-chip.has-tires {
        border-color: var(--accent);
        background: var(--accent-dim);
        color: var(--accent);
    }

    .tire-chip:hover {
        filter: brightness(1.12);
    }

.tire-chip-num {
    font-size: 13px;
    font-weight: 800;
}

.tire-chip-label {
    font-size: 10px;
    opacity: 0.85;
    text-transform: uppercase;
    
    letter-spacing: 0.03em;
}

.rec-pill {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    max-width: 160px;
    line-height: 1.3;
}

.tire-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 18px;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: var(--bg-2);
    border: 1px solid var(--accent-dim);
    border-radius: 10px;
}

.tire-stat-val.fresh {
    color: var(--accent);
    font-size: 1.2em;
}

.tire-stat-val.scrub {
    color: var(--info);
    font-size: 1.2em;
}

.tire-setup-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--line-2);
    border-radius: 8px;
}

.tire-shortage {
    margin-bottom: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--warn);
    background: var(--warn-dim);
    color: var(--warn-soft);
    font-size: 13px;
}

.tire-override {
    margin-top: 5px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.2;
}

    .tire-override.fresh {
        background: var(--info-dim);
        border: 1px solid var(--info-deep);
        color: var(--info-soft);
    }

    .tire-override.scrub {
        background: var(--warn-dim);
        border: 1px solid var(--warn-deep);
        color: var(--warn-soft);
    }

.tire-override-menu {
    position: fixed;
    z-index: 10002;
    min-width: 140px;
    background: var(--surface-1);
    border: 1px solid var(--accent);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 12px 32px rgba(0,0,0,.55);
}

    .tire-override-menu button {
        display: block;
        width: 100%;
        text-align: left;
        padding: 8px 10px;
        border: none;
        background: transparent;
        color: var(--text-2);
        cursor: pointer;
        border-radius: 6px;
    }

        .tire-override-menu button:hover {
            background: var(--accent-dim);
            color: var(--accent);
        }

.tire-override.keep {
    background: var(--surface-2);
    border: 1px solid var(--line-3);
    color: var(--text-3);
}

.tire-override:hover {
    filter: brightness(1.15);
}

/* A corner the user set by hand. The outline has to survive on top of the
 * keep/fresh/scrub backgrounds, so it is a ring rather than a border colour —
 * a border would be overridden by .keep and lost on exactly the rows where
 * telling yours from the optimiser's matters most. */
.tire-override.pinned {
    box-shadow: 0 0 0 2px var(--info);
    font-weight: 700;
}

/* Releasing a corner is not the same kind of act as choosing one for it, so it
 * does not sit in the list of choices looking like another tire. */
.tire-override-menu button.unpin {
    border-top: 1px solid var(--line-3);
    border-bottom: 1px solid var(--line-3);
    margin: 4px 0;
    color: var(--text-3);
    font-style: italic;
}
.tire-shortage {
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--warn);
    background: var(--warn-dim);
    color: var(--warn-soft);
    font-size: 13px;
    font-weight: 600;
}

    .tire-shortage[hidden] {
        display: none !important;
    }

.color-swatch {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.2);
    vertical-align: middle;
    margin-right: 8px;
}

.color-hex {
    font-size: 12px;
    color: var(--text-3);
    font-family: ui-monospace, monospace;
    vertical-align: middle;
}

.laptime-input {
    width: 88px;
    text-align: center;
    font-weight: 600;
}

#driverFactorsBody td {
    vertical-align: middle;
    padding: 10px 12px;
}

/* ========== LIVE SCHEDULE (iframe) ========== */
.live-stint-table {
    width: 100%;
    border-collapse: collapse;
}

    .live-stint-table th,
    .live-stint-table td {
        border: 1px solid var(--line);
        padding: 10px 8px;
        text-align: center;
        vertical-align: middle;
        font-size: 13px;
    }

    .live-stint-table th {
        background: var(--accent-dim);
        color: var(--text-2);
        font-size: 11px;
        font-weight: 650;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .live-stint-table tr.live-row {
        background: rgba(var(--accent-rgb), 0.1);
    }

    .live-stint-table tr.next-row {
        background: rgba(255, 204, 0, 0.08);
    }

    .live-stint-table tr.done-row {
        opacity: 0.45;
    }

.tire-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 8px;
    background: var(--surface-2);
    border: 1px solid var(--line-2);
    font-weight: 700;
    font-size: 13px;
}

.status-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.04em;
}

    .status-pill.live {
        background: var(--accent);
        color: var(--ink);
    }

    .status-pill.next {
        background: var(--warn-2);
        color: var(--ink);
    }

    .status-pill.done {
        background: var(--line-2);
        color: var(--text-3);
    }

    .status-pill.queued {
        background: var(--surface-3);
        color: var(--text-4);
        border: 1px solid var(--line-2);
    }

    .status-pill.frozen {
        background: var(--line-2);
        color: var(--text-2);
        border: 1px solid var(--text-4);
    }

.live-section {
    margin: 8px 0 20px;
}

.live-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px;
    flex-wrap: wrap;
}

.live-section-title {
    margin: 0;
    font-size: 13px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}

.tire-legend {
    display: flex;
    gap: 8px;
    font-size: 11px;
}

    .tire-legend .leg {
        padding: 3px 8px;
        border-radius: 4px;
        font-weight: 600;
    }

    .tire-legend .fresh {
        background: var(--info-dim);
        color: var(--info);
    }

    .tire-legend .scrub {
        background: var(--warn-dim);
        color: var(--warn-soft);
    }

    .tire-legend .low {
        background: var(--crit-dim);
        color: var(--crit);
    }

.tire-pool-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding: 8px 16px 10px;
    font-size: 13px;
    color: var(--text-2);
}

    .tire-pool-bar strong {
        color: var(--accent);
        font-variant-numeric: tabular-nums;
    }

.live-tire-table td {
    vertical-align: middle;
}

.live-tire-table .life-num {
    display: block;
    font-size: 13px;
}

.live-nested-tabs {
    padding: 8px 16px 0;
    border-bottom: 1px solid var(--surface-3);
}

.nest-panel {
    display: none;
    padding-top: 8px;
}

    .nest-panel.active {
        display: block;
    }

    .nest-panel[hidden] {
        display: none !important;
    }

.tire-plan-pill {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
}

    .tire-plan-pill.fresh {
        background: var(--info-dim);
        color: var(--info);
        border: 1px solid var(--info-deep);
    }

    .tire-plan-pill.scrub {
        background: var(--warn-dim);
        color: var(--warn-soft);
        border: 1px solid var(--warn-deep);
    }

    .tire-plan-pill.keep {
        background: var(--surface-3);
        color: var(--text-3);
        border: 1px solid var(--line-3);
    }
.stint-type-pill.locked,
.driver-chip:not(button) {
    opacity: 0.75;
    cursor: not-allowed;
}
/* ========== FORMS =========================================================
   Settings were built as two-column <table>s: a table is for data you compare
   across rows, not for input you fill in. Real fields group by meaning, carry
   their own help text, wrap on narrow screens, and let a label point at its
   input. This is the vocabulary those panes now use. */
.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: var(--s4);
    margin-bottom: var(--s5);
}
.field-grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label {
    font-size: var(--fs-small);
    font-weight: 650;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--text-3);
}
.field > input,
.field > select { width: 100%; }
.field .hint {
    font-size: var(--fs-small);
    color: var(--text-4);
    line-height: 1.45;
}
.field .unit {
    font-size: var(--fs-small);
    color: var(--text-4);
    font-variant-numeric: tabular-nums;
}

/* A computed value shown alongside inputs — same footprint as a field so the
   grid stays even, but visibly not editable. */
.field.is-derived > .value {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 0 var(--s3);
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: transparent;
    color: var(--accent);
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

/* Section headings: one level, consistent, with a rule that spans the row. */
.section {
    display: flex;
    align-items: baseline;
    gap: var(--s3);
    margin: var(--s5) 0 var(--s3);
}
.section::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}
.section h2, .section h3 {
    margin: 0;
    font-size: var(--fs-small);
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-3);
}
/* An action that belongs to a section, sat at the far end of its rule.
 * `order` puts it after the ::after line, which is what pushes it right —
 * before it, the growing rule would leave the button stranded mid-heading. */
.section-act {
    order: 1;
    margin: 0;
    padding: 2px 10px;
    font-size: var(--fs-micro);
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-3);
    border-color: var(--line);
    background: transparent;
    white-space: nowrap;
}
.section-act:hover { color: var(--text); border-color: var(--line-2); }
.section-act[disabled] { opacity: .55; cursor: default; }
/* The one heading action people go looking for: accent, not grey. */
.section-act-primary { color: var(--accent); border-color: var(--accent); background: rgba(var(--accent-rgb), .08); font-weight: 700; }
.section-act-primary:hover { color: var(--text-hi, var(--text)); background: rgba(var(--accent-rgb), .18); border-color: var(--accent); }
/* Two actions on one heading do not fit beside it on a phone: wrap them under it. */
@media (max-width: 520px) {
    .section:has(.section-act + .section-act) { flex-wrap: wrap; }
    .section:has(.section-act + .section-act) .section-act { order: 2; }
    .section:has(.section-act + .section-act)::after { flex-basis: 100%; order: 1; }
}
.section .section-note {
    font-size: var(--fs-small);
    color: var(--text-4);
}

/* Focus is visible on every interactive thing, not just buttons. */
input:focus-visible,
select:focus-visible,
.tab:focus-visible,
.subtab:focus-visible,
summary:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

/* Stint type picker — mirrors the driver menu. Both reset min-height/margin
   because the global button rule would otherwise inflate menu rows to 42px
   and gap them, which is what broke these menus once already. */
.stint-type-menu {
    position: fixed;
    z-index: 10002;
    min-width: 180px;
    width: max-content;
    padding: 6px;
    background: var(--surface-1);
    border: 1px solid var(--accent);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .55);
}
.stint-type-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 8px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.stint-type-menu button:hover { background: var(--surface-2); color: var(--text); }
.stint-type-menu button:active { transform: none; }
.stint-type-menu button:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--accent);
}
.stint-type-menu button.is-current { background: var(--accent-dim); color: var(--text); }
.stint-type-menu .swatch {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.stint-type-menu .tcode {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-4);
    font-weight: 700;
}
.stint-type-menu button.is-current .tcode { margin-left: auto; }
.stint-type-menu .tick { color: var(--accent); font-weight: 700; }

/* The type chip itself is a compact pill, not a full-size button. */
.stint-type-btn {
    min-height: 0;
    margin: 0;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 999px;
    cursor: pointer;
}
.stint-type-btn:active { transform: none; }
.stint-type-btn.locked { cursor: default; opacity: .7; }
/* Set by the planner rather than by you. A dashed edge and a dot say "this one
 * is not your choice" without changing the colour, which still has to read as
 * the stint type it is. */
.cl-tbl { border-collapse: collapse; margin: 0 0 12px; font-size: 13px; }
.cl-tbl th, .cl-tbl td { border: 1px solid var(--line); padding: 5px 10px; text-align: left; }
.cl-tbl th { color: var(--text-3); font-weight: 600; }
.plan-auto-note {
    margin: 0 0 10px;
    padding: 8px 12px;
    border-left: 2px solid var(--warn-soft);
    background: var(--panel);
    color: var(--text-2);
    font-size: 13px;
    line-height: 1.5;
}
.stint-type-btn.auto { border-style: dashed !important; }
.stint-type-btn.auto::after {
    content: "\00b7 auto";
    font-weight: 600;
    opacity: .8;
    margin-left: 4px;
}

.stint-type-btn.auto-wx::after { content: "\00b7 auto (forecast)"; }
.stint-type-btn.auto-exp::after { content: "\00b7 auto (expected weather)"; }
/* The tag wraps in the narrow Type column: let the chip grow instead of the text spilling over its border. */
.stint-type-btn.auto-wx { height: auto !important; padding-top: 3px; padding-bottom: 3px; line-height: 1.15; }

/* Fuel-balance toggle: on-state reads as selected, not as a primary action. */
#btnFuelBalance.is-on {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

/* ============================================================
   UX pass — modes, disclosure, and the plan strip.
   ============================================================ */

/* Modes are persistent state; actions are one-shot. They used to share one
   row and look identical, so a toggle read as a button you press and forget. */
.mode-row {
    display: flex;
    align-items: center;
    gap: var(--s2);
    flex-wrap: wrap;
    margin-bottom: var(--s2);
    padding: var(--s2) var(--s3);
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.mode-label {
    font-size: var(--fs-micro);
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-3);
}
.mode-label:not(:first-child) { margin-left: var(--s3); }
.mode-toggle {
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: var(--fs-small);
    cursor: pointer;
}
.mode-toggle:hover { background: var(--accent-deep); }

/* Recording: at least one stint has actually run, so the numbers in this
   table are a record rather than a proposal. Set automatically from the
   schedule itself — there is no switch to leave in the wrong position. */
#stintScheduleTable[data-mode="recording"] input {
    border-color: var(--warn);
    background: var(--warn-dim);
}
#stintScheduleTable[data-mode="planning"] input {
    border-color: var(--line-2);
}

/* Columns for a stint type that has no rates entered yet. */
.fs-col[hidden], tr.alt-stint-row[hidden] { display: none; }

/* New race, in the live view. Mirrors the rule live.js injects, so the button
   is themeable from here once live.html loads this file. Outlined like Copy —
   a control that discards a race's progress should not read as a primary
   action, and it should not be dimmed with opacity either, which goes muddy
   on a dark panel rather than quiet. */
.new-race-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font: inherit;
    font-size: var(--fs-small, 13px);
    line-height: 1;
    padding: 8px 14px;
    border-radius: var(--radius, 8px);
    background: transparent;
    color: var(--text-2);
    border: 1px solid var(--line-2);
    cursor: pointer;
    transition: color .12s, border-color .12s;
}
.new-race-btn:hover:not(:disabled) {
    color: var(--crit);
    border-color: var(--crit);
}
.new-race-btn:disabled {
    color: var(--text-4);
    border-color: var(--line);
    cursor: default;
}

/* Room name, in the top-bar chip.
 *
 * It was styled as a label that happened to be clickable, which is the same
 * as not being clickable — nobody hovers a caption. It now reads as a control:
 * a dashed underline at rest, a pencil beside it, and a filled outline on
 * hover. Unnamed it says "Name this room" rather than "Room", because the
 * label has to be the invitation.
 */
.room-chip .room-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-3);
    font: inherit;
    font-size: var(--fs-small, 12px);
    padding: 2px 6px;
    cursor: pointer;
    max-width: 200px;
}
.room-chip .room-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-bottom: 1px dashed var(--line-3);
}
.room-chip .room-name-pencil {
    opacity: .5;
    font-size: 11px;
    flex: 0 0 auto;
}
.room-chip .room-name:hover {
    color: var(--text);
    border-color: var(--line-3);
    background: var(--panel-2);
}
.room-chip .room-name:hover .room-name-pencil { opacity: 1; }
.room-chip .room-name:hover .room-name-text { border-bottom-color: transparent; }
.room-chip .room-name.is-named {
    color: var(--text);
    font-weight: 600;
}


/* Fuel-vs-energy advice under the per-lap rates. Quiet when the ratio is
   right, amber when litres are being carried for nothing — the cost of a bad
   ratio is dead weight and a longer stop, neither of which announces itself. */
.ratio-advice {
    margin: 0 0 var(--s4, 16px);
    font-size: var(--fs-small, 12px);
    line-height: 1.5;
}
.ratio-advice:empty { display: none; }
.ratio-advice.ok { color: var(--text-4); }
.ratio-advice.warn { color: var(--warn); }

/* ==========================================================================
   LAYOUT RESTORE — rules the markup needs that this file had lost.
   Appended, so it overrides the older single-column header above.
   ========================================================================== */

/* ---- Header: one row, not two ----------------------------------------
 * .top-bar above is flex-direction: column with both halves at width:100%,
 * which is the old two-row header. The markup is now brand + sections on the
 * left, room and tools on the right, in a single bar.
 */
.top-bar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--s3);
}

.top-bar-left,
.top-bar-right {
    width: auto;
    flex: 0 1 auto;
    min-width: 0;
}

.top-bar-right {
    justify-content: flex-end;
    gap: var(--s2);
}

/* 100px tall was sized for a header that owned its own row. */
.brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.brand-logo-img {
    height: 30px;
    width: auto;
    display: block;
}

/* The tab bar sits inside the header now, so it drops its own bottom margin
   and its panel chrome — the header is already a panel. */
.top-bar .tabs {
    margin-bottom: 0;
    background: transparent;
    border: 0;
    padding: 0;
}

/* .gmt-clock still carries margin-left:auto from when it lived in a full-width
   row. Inside .top-bar-right that pushes everything after it to the far edge. */
.top-bar-right .gmt-clock {
    margin-left: 0;
}

/* The clock is a button now (12/24-hour); keep the look it had as a div. */
button.gmt-clock { cursor: pointer; line-height: inherit; }

/* GMT / Local segmented toggle beside the clock. Display only. */
.clock-zone { display: inline-flex; border: 1px solid var(--surface-3); border-radius: 8px; overflow: hidden; flex: 0 0 auto; }
.clock-zone button { margin: 0; background: var(--surface-1); color: var(--text-3); border: 0; padding: 6px 9px; font: 600 0.75rem monospace; cursor: pointer; }
.clock-zone button[aria-pressed="true"] { background: var(--surface-3); color: var(--accent); }
.clock-zone button:focus-visible, button.gmt-clock:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.top-bar-right .top-actions {
    flex: 0 0 auto;
}

/* ---- Split view -------------------------------------------------------
 * split-view.js writes --split-l / --split-r onto #splitWrap as fr values and
 * toggles body.split-on. Off, the wrapper is an ordinary block so the page
 * behaves exactly as it did before the feature existed.
 */
.split-wrap {
    display: block;
    min-width: 0;
}

body.split-on .split-wrap {
    display: grid;
    grid-template-columns: var(--split-l, 1fr) auto var(--split-r, 1fr);
    align-items: stretch;
    gap: 0;
}

.pane-main {
    min-width: 0;
}

body.split-on .pane-main {
    overflow: auto;
    padding-right: var(--s3);
}

.pane-split {
    min-width: 0;
    border-left: 1px solid var(--line);
    background: var(--bg-2);
}

.pane-split[hidden] {
    display: none;
}

/* The iframe is sized by fitToWindow, which sets an explicit pixel height on
   .pane-split. Without height:100% here the frame collapses to its intrinsic
   150px and renders the whole app in a small scrolling box. */
.pane-split iframe,
#splitFrame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: var(--bg-2);
}

.split-handle {
    width: 8px;
    flex: 0 0 8px;
    cursor: col-resize;
    background: var(--line);
    border: 0;
    position: relative;
    touch-action: none;
}

.split-handle[hidden] {
    display: none;
}

.split-handle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 34px;
    transform: translate(-50%, -50%);
    border-radius: 2px;
    background: var(--text-4);
}

.split-handle:hover {
    background: var(--accent-dim);
}

/* While dragging, the iframe must not swallow the pointer. */
body.split-dragging {
    cursor: col-resize;
    user-select: none;
}

body.split-dragging iframe {
    pointer-events: none;
}

.split-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-1);
    border: 1px solid var(--surface-3);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-3);
    font-size: var(--fs-small);
    cursor: pointer;
    white-space: nowrap;
}

.split-btn:hover {
    color: var(--text);
    border-color: var(--line-3);
}

.split-btn.is-on {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

.pw-icon {
    width: 12px;
    height: 12px;
    border: 1px solid currentColor;
    border-radius: 2px;
    position: relative;
    display: inline-block;
}

.pw-icon::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: currentColor;
}

/* Split view is a wide-screen feature; below the breakpoint split-view.js
   refuses to turn it on, and the pane must not linger as a stray block. */
@media (max-width: 1100px) {
    body.split-on .split-wrap {
        display: block;
    }

    .pane-split,
    .split-handle {
        display: none;
    }
}

/* ---- The second pane is this same page ---------------------------------
 * body.is-embed. Everything that belongs to the window rather than to the
 * content is hidden, so the pane shows tabs and content and nothing else —
 * no second logo, no second room code, no second footer.
 */
body.is-embed .top-bar-left .brand,
body.is-embed .top-bar-right,
body.is-embed #siteFooter,
body.is-embed .race-ticker,
body.is-embed .split-handle,
body.is-embed .pane-split {
    display: none !important;
}

body.is-embed .top-bar {
    margin: 0 0 var(--s2);
    padding: var(--s2);
}

body.is-embed {
    padding-bottom: 0;
}

/* ---- Plan toolbar ------------------------------------------------------
 * One row: the persistent mode on the left, everyday actions next, and the
 * destructive ones behind More.
 */
.plan-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s2) var(--s3);
    margin-bottom: var(--s3);
    padding: 10px 14px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.plan-toolbar-sep {
    width: 1px;
    align-self: stretch;
    min-height: 22px;
    background: var(--line-2);
    margin: 0 var(--s1);
}

.plan-toolbar .mode-label {
    font-size: var(--fs-micro);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-4);
}

/* More menu: a <details> so it closes on Escape and needs no script. */
.more-menu {
    position: relative;
    margin-left: auto;
}

.more-menu > summary {
    list-style: none;
    cursor: pointer;
    padding: 6px 12px;
    border: 1px solid var(--surface-3);
    border-radius: 8px;
    background: var(--surface-1);
    color: var(--text-3);
    font-size: var(--fs-small);
    user-select: none;
}

.more-menu > summary::-webkit-details-marker {
    display: none;
}

.more-menu > summary:hover {
    color: var(--text);
    border-color: var(--line-3);
}

.more-menu-list {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 200;
    min-width: 230px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
    background: var(--panel);
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
}

.more-menu-list button {
    text-align: left;
    width: 100%;
    white-space: nowrap;
}

/* ---- Fuel saving and deltas, side by side ------------------------------ */
.plan-bottom {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 0 var(--s5);
    align-items: start;
}

.plan-bottom-col {
    min-width: 0;
}

/* The first section heading in each column would otherwise push the two
   columns apart by a full --s5 above the table. */
.plan-bottom-col > .section:first-child {
    margin-top: var(--s4);
}

/* ---- Setup rows --------------------------------------------------------
 * Five short values on one line rather than five full-width boxes.
 */
.field-grid.setup-row {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.field-grid.adv-row {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
/* Cold tires, one side: L __% R __% on one line. */
.cold-side { display: flex; align-items: center; gap: 6px; }
/* Wide enough for the "auto" and "class" placeholders. */
.cold-side input { width: 6em; min-width: 0; }

/* A derived value is not an input, so it should not look like an empty one. */
.field.is-derived .value {
    padding: 8px 10px;
    border: 1px dashed var(--line-2);
    border-radius: 8px;
    background: var(--bg-2);
    color: var(--accent);
    font-family: monospace;
    font-size: var(--fs-body);
    min-height: 37px;
    display: flex;
    align-items: center;
}

/* Per-lap rates: the inputs carry the width, the computed cells stay narrow. */
.rates-table input {
    width: 100%;
    min-width: 84px;
}

.rates-table td,
.rates-table th {
    white-space: nowrap;
}

/* ---- Tire setup --------------------------------------------------------
 * Allocation and the per-corner inputs side by side; both are "what you start
 * with", and stacked they took two full rows before the table.
 */
.tire-top {
    display: grid;
    /* 420, not 320: at 320 a split pane fits two columns by a hair and the RR
       corner is clipped off the right edge of the second card. */
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: var(--s4);
    align-items: start;
    margin-bottom: var(--s4);
}

.tire-top > .tire-toolbar {
    margin-bottom: 0;
    align-content: flex-start;
}

.tire-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.tire-stat input {
    width: 84px;
}

.tire-stat-label {
    font-size: var(--fs-micro);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-4);
}

.tire-stat-unit {
    font-size: var(--fs-small);
    color: var(--text-4);
}

/* The shortage banner is full width inside the toolbar's flex row. */
.tire-toolbar .tire-shortage {
    flex-basis: 100%;
}

/* One compact card: a label column, four corner columns, and a trailing
   column for the Avg / Per corner toggle. */
.tire-inputs {
    display: grid;
    grid-template-columns: auto repeat(4, minmax(64px, 1fr)) auto;
    gap: var(--s2);
    align-items: center;
    padding: 12px 14px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.tire-inputs[hidden] {
    display: none;
}

.ti-col {
    text-align: center;
    font-size: var(--fs-micro);
    letter-spacing: .08em;
    color: var(--text-4);
}

.ti-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-small);
    color: var(--text-3);
    white-space: nowrap;
}

/* The wear row spans the four corner columns, so "one average" can be a
   single box across them and "per corner" four boxes in the same track. */
/* The four boxes have to sit in the SAME tracks as the FL/FR/RL/RR headings
 * above them and the Start life boxes below, and they are one grid deeper, so
 * the column gap has to match the parent's exactly. The compact rule further
 * down overrides the panel's gap to 14px without touching this one, which left
 * the wear row a few pixels adrift from its own headings - and drifting wider
 * the wider the screen. Inherit it instead of restating it. */
.ti-row {
    grid-column: 2 / 6;
    display: grid;
    grid-template-columns: repeat(4, minmax(64px, 1fr));
    gap: inherit;
}

/* The provenance line ("measured · 7 laps") that state.js writes under each
 * rate field is inserted as the input's NEXT SIBLING. Inside this grid that
 * makes it a grid item in its own right, so four inputs and four tags filled
 * the four columns twice over and the wear row came out as a 2x2 block under
 * headings that read FL FR RL RR.
 *
 * Inputs on the first row, tags on the second. Each tag still sits under its
 * own corner, and the columns still line up with the headings above and the
 * Start life boxes below. */
.ti-row > input { grid-row: 1; }
.ti-row > [id$="Prov"] {
    grid-row: 2;
    margin-top: 0;
    font-size: var(--fs-micro);
    line-height: 1.2;
    text-align: center;
}
/* Nothing to say about this corner yet: do not reserve a line for it. */
.ti-row > [id$="Prov"]:empty { display: none; }

.ti-row[hidden] {
    display: none;
}

.ti-span {
    grid-column: 1 / -1;
}

.tire-inputs input {
    width: 100%;
    text-align: center;
}

/* ---- Segmented toggle -------------------------------------------------- */
.seg-toggle {
    display: inline-flex;
    padding: 2px;
    background: var(--surface-1);
    border: 1px solid var(--surface-3);
    border-radius: 999px;
}

.seg-toggle button {
    border: 0;
    background: transparent;
    color: var(--text-3);   /* --text-4 is AA on --bg/--panel, not on this --surface-1 track */
    font-size: var(--fs-micro);
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
}

.seg-toggle button[aria-pressed="true"],
.seg-toggle button.is-on {
    background: var(--accent-dim);
    color: var(--accent);
}

/* ---- Tooltips (hints.js) ----------------------------------------------
 * hints.js turns a title= into data-tip + .has-tip, injects .info-tip buttons,
 * and positions a single #tipPop. None of the three had any styling, so the
 * tips rendered as an unpositioned block at the end of the document.
 */
.has-tip {
    cursor: help;
    text-decoration: underline dotted var(--text-4);
    text-underline-offset: 3px;
}

.info-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--line-3);
    background: transparent;
    color: var(--text-4);
    font-size: 10px;
    font-style: normal;
    line-height: 1;
    cursor: pointer;
    vertical-align: middle;
}

.info-tip:hover {
    color: var(--accent);
    border-color: var(--accent);
}

#tipPop {
    position: fixed;
    z-index: 10100;
    max-width: min(300px, calc(100vw - 16px));
    overflow-wrap: anywhere;
    padding: 8px 10px;
    background: var(--panel);
    border: 1px solid var(--line-2);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .5);
    color: var(--text-2);
    font-size: var(--fs-small);
    line-height: 1.45;
    opacity: 0;
    visibility: hidden;
    transition: opacity .1s;
    pointer-events: none;
}

#tipPop.is-visible {
    opacity: 1;
    visibility: visible;
}

.has-tip:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---- Odds and ends ----------------------------------------------------- */
.avail-intro {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 var(--s3);
    color: var(--text-3);
    font-size: var(--fs-small);
}

.roster-wrap {
    max-width: 980px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--s3);
}

.footer-links .btn-ghost {
    padding: 4px 8px;
    font-size: var(--fs-small);
}

/* A plain <a> in the footer, which is what the Teams and What's new links are.
 * Without this they render as a browser-default blue underline in the middle of
 * a row of themed buttons — which is exactly what they did.
 *
 * :not([class]) rather than a bare `a`, because .discord-link and .bmc-link are
 * (0,1,0) and this would be (0,1,1): it would out-specify both and repaint them
 * grey no matter which came first in the file. Order does not decide a
 * specificity fight, so the selector has to not match them at all. */
.footer-links a:not([class]) {
    padding: 4px 8px;
    font-size: var(--fs-small);
    color: var(--text-3);
    text-decoration: none;
    border-radius: 6px;
}
.footer-links a:not([class]):hover { color: var(--text); background: var(--panel-2); }

.bmc-link {
    color: var(--warn);
    text-decoration: none;
}

.bmc-link:hover {
    text-decoration: underline;
}

/* ---- Lobby -------------------------------------------------------------
 * Left: what this is, for someone who arrived from a Discord link.
 * Right: the two things they came to do.
 */
.lobby-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
    gap: var(--s6);
    align-items: center;
    width: min(1040px, calc(100vw - 2 * var(--s5)));
    max-height: calc(100vh / var(--z, 1) - 2 * var(--s5));
    overflow: auto;
    padding: var(--s5);
}

.lobby-hero {
    min-width: 0;
}

.lobby-logo {
    height: 44px;
    width: auto;
    display: block;
    margin-bottom: var(--s4);
}

.lobby-badge {
    display: inline-block;
    padding: 3px 10px;
    border: 1px solid var(--accent-dim);
    border-radius: 999px;
    background: var(--accent-deep);
    color: var(--accent);
    font-size: var(--fs-micro);
    letter-spacing: .06em;
    text-transform: uppercase;
}

.lobby-headline {
    margin: var(--s3) 0 var(--s2);
    font-size: var(--fs-display);
    line-height: 1.2;
    color: var(--text-hi);
}

.lobby-lede {
    margin: 0 0 var(--s4);
    max-width: 52ch;
    color: var(--text-3);
    font-size: var(--fs-body);
    line-height: 1.55;
}

.lobby-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--s3);
}

.lobby-points li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-left: var(--s3);
    border-left: 2px solid var(--accent-dim);
}

.lobby-points b {
    color: var(--text-2);
    font-size: var(--fs-small);
}

.lobby-points span {
    color: var(--text-4);
    font-size: var(--fs-small);
}

.lobby-card-title {
    margin: 0 0 var(--s4);
    font-size: var(--fs-lead);
    color: var(--text-hi);
}

@media (max-width: 900px) {
    .lobby-wrap {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--s5);
    }

    .lobby-points {
        display: none;
    }
}

/* ---- Tire overrides: whose choice is this? -----------------------------
 * A corner the user set by hand. A ring rather than a border colour, because
 * .tire-override.keep sets its own border and would win.
 */
.tire-override.pinned {
    box-shadow: 0 0 0 2px var(--info);
    font-weight: 700;
}

/* Releasing a corner back to the optimiser is not the same kind of act as
   choosing a tire for it, so it does not sit in the list looking like one. */
.tire-override-menu button.unpin {
    border-top: 1px solid var(--line-3);
    border-bottom: 1px solid var(--line-3);
    margin: 4px 0;
    color: var(--text-3);
    font-style: italic;
}

/* ---- Narrow screens ---------------------------------------------------- */
@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .top-bar-left,
    .top-bar-right {
        width: 100%;
    }

    .tire-inputs {
        grid-template-columns: auto repeat(4, minmax(48px, 1fr));
    }

    .seg-toggle {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .more-menu {
        margin-left: 0;
    }
}

/* Tertiary is the right rank for Copy image or Clear manual changes, but with
   a transparent border AND a transparent background they read as a caption
   sitting between two real buttons. Inside a toolbar, keep the quiet fill and
   give them an edge so they are visibly pressable. */
.plan-toolbar .btn-ghost,
.tire-toolbar .btn-ghost,
.more-menu-list .btn-ghost,
.more-menu-list .btn-danger {
    border-color: var(--surface-3);
    color: var(--text-3);
}

.plan-toolbar .btn-ghost:hover,
.tire-toolbar .btn-ghost:hover,
.more-menu-list .btn-ghost:hover {
    border-color: var(--accent);
    color: var(--text);
}

/* ==========================================================================
   PASS 2 — info buttons, tire-tab density, and one header everywhere.
   ========================================================================== */

/* ---- The (i) was a 15x42 ellipse -------------------------------------
 * .info-tip set width and height, but the base `button` rule sets
 * min-height: 42px and a bottom margin, and min-height beats height. So every
 * info button stretched into a tall oval with the glyph floating in it, which
 * reads as a rendering fault rather than as something to hover.
 */
.info-tip {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    /* Nudges the glyph off the optical centre of a circle this small. */
    text-indent: 0;
}

/* The label owns the tip as well, so the target is a word rather than a
   16px dot — hovering "Wear % / lap" is what people actually try. */
.ti-label,
.tire-stat label {
    cursor: help;
}

/* ---- Tire schedule: one line per corner --------------------------------
 * A cell was three stacked blocks — life in, life out, and the pill — so a
 * twelve-stint plan ran to twelve hundred pixels and you could see four stops
 * at a time. The same three facts fit on one line.
 */
#tireScheduleTable td,
#tireScheduleTable th {
    padding: 5px 8px;
    font-size: 12px;
}

#tireScheduleTable .life-num {
    display: inline;
}

/* The "→ 82.0%" block that followed the life number. */
#tireScheduleTable td > div {
    display: inline;
    margin-left: 3px;
}

#tireScheduleTable .tire-override {
    display: inline-flex;
    align-items: center;
    min-height: 0;
    margin: 0 0 0 8px;
    padding: 1px 8px;
    font-size: 10px;
    line-height: 1.6;
}

#tireScheduleTable .driver-chip {
    padding: 2px 8px;
    font-size: 11px;
}

/* ---- Tire setup block: less air ---------------------------------------- */
.tire-top {
    gap: var(--s3);
    margin-bottom: var(--s3);
}

.tire-top > .tire-toolbar,
.tire-top > .tire-inputs {
    padding: 8px 12px;
    gap: 8px 14px;
}

.tire-top .tire-stat input {
    min-height: 32px;
    padding: 4px 8px;
}

/* :not(.info-tip) — the (i) is a 16px circle and must not be pulled up to a
   control height by a rule meant for the real buttons in this block. */
.tire-top button:not(.info-tip) {
    min-height: 34px;
    margin: 0;
}

.tire-inputs input {
    min-height: 30px;
    padding: 4px 6px;
}

.tire-inputs .seg-toggle button {
    min-height: 0;
    margin: 0;
}

/* ---- One header, in the same place, always -----------------------------
 * The tab bar used to live beside the logo and hop into the left pane when
 * split opened, so the two sides of a split read differently and the single
 * view read differently again. It now always sits at the top of the content,
 * which is where the second pane has always shown it.
 */
/* Nothing should be here now — the bar lives in .pane-main. Left unhidden on
   purpose: if an old cached index.html still has it in the header, showing it
   there is degraded but usable, and hiding it would mean no tabs at all. */

.pane-main > nav.tabs,
.split-wrap nav.tabs {
    display: flex;
    margin-bottom: var(--s3);
    background: var(--panel-2);
    border: 1px solid var(--line);
    padding: 4px;
}

/* Stretching to fill is what made the wide pane's tabs look nothing like the
   narrow pane's. Sized by their text, both sides match at any ratio. */
.pane-main > nav.tabs .tab,
body.is-embed nav.tabs .tab,
/* The site-wide nav on the pages that are not the planner. Without this the
 * default `flex: 1 0 auto` shares the whole width between three links and they
 * come out enormous, which is exactly what makes the header look like a
 * different app rather than the same one. */
nav.tabs-site .tab {
    flex: 0 0 auto;
}

/* The second pane is the same document: with the tabs moved into the content
   there is nothing left in the header worth showing. */
body.is-embed .top-bar {
    display: none;
}

/* The ticker is hidden in the second pane, so the 44px it reserves is dead
   space — and it is exactly what put the two panes' tab bars at different
   heights, which is the misalignment that reads as jarring. */
body.is-embed.has-race-ticker #app {
    padding-top: 0;
}

/* Same reason: the pane has no footer of its own to clear. */
body.is-embed #app {
    padding-bottom: 12px;
}

/* ---- Split mode uses the whole window ---------------------------------
 * #app caps at 1400px, which is right for one column of reading and wrong for
 * two panes: on a 2560px screen it threw away 1160px and left each pane at
 * 680px, narrow enough that the tire table wrapped and the setup cards
 * stacked. Split is the case where the width is the point.
 */
body.split-on #app {
    max-width: none;
    padding-left: var(--s4);
    padding-right: var(--s4);
}

/* Each pane scrolls itself, so the page does not scroll and neither side can
   drag the other off screen. Heights are set by fitToWindow. */
body.split-on .pane-main {
    overflow: auto;
    overscroll-behavior: contain;
}

/* The header stays put while the panes scroll under it. */
body.split-on .top-bar {
    position: sticky;
    top: 0;
    z-index: 60;
}

body.split-on.has-race-ticker .top-bar {
    top: 36px;
}

/* #app reserves 90px at the bottom for the footer to sit over. In split mode
   the panes scroll inside themselves and end above the footer anyway, so that
   reserve is a dead band across the window — and fitToWindow subtracts it from
   the pane height, so it costs twice. */
body.split-on #app {
    padding-bottom: var(--s3);
}

/* ==========================================================================
   PASS 3 — the availability grid, and the pit schedule at a readable density.
   ========================================================================== */

/* ---- Availability grid -------------------------------------------------
 * roster.js writes each cell with .on/.off and the driver's colour in a --drv
 * custom property, then leaves the rest to CSS. With no rule for any of it,
 * every cell rendered identically: a 24-hour grid of plain times where
 * nothing said who was free when — which is the entire point of the table.
 *
 * The intent the markup describes: available is the driver's own colour at
 * low strength with a coloured edge, unavailable is empty. Keeping it quiet
 * matters — 24 rows x 4 drivers of saturated fill is the loudest thing in the
 * app, and it sits next to a schedule you are trying to read.
 */
.av-cell {
    cursor: pointer;
    font-variant-numeric: tabular-nums;
    transition: background-color .12s ease, box-shadow .12s ease, color .12s ease;
}

.av-cell.on {
    background: color-mix(in srgb, var(--drv) 22%, transparent);
    box-shadow: inset 2px 0 0 var(--drv);
    color: var(--text);
    font-weight: 650;
}

/* Fallback for engines without color-mix: a flat tint plus the coloured edge,
   which still reads as "this driver, available" even without the blend. */
@supports not (background: color-mix(in srgb, red 20%, transparent)) {
    .av-cell.on {
        background: var(--surface-2);
    }
}

.av-cell.off {
    color: var(--text-4);
    background: transparent;
}

/* Maybe: a fainter tint and edge; the ? mark carries it without color. */
.av-cell.maybe {
    background: color-mix(in srgb, var(--drv) 9%, transparent);
    box-shadow: inset 2px 0 0 color-mix(in srgb, var(--drv) 45%, transparent);
    color: var(--text-2);
    font-style: italic;
}

.av-cell.maybe:hover {
    background: color-mix(in srgb, var(--drv) 18%, transparent);
}

.av-mark { margin-left: 3px; font-size: .85em; font-style: normal; opacity: .85; }
.av-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; font-size: .85em; }
.av-legend .av-cell { padding: 2px 8px; border-radius: 4px; cursor: default; --drv: var(--text-3); }

.av-cell.off:hover {
    background: var(--surface-1);
    color: var(--text-3);
}

.av-cell.on:hover {
    background: color-mix(in srgb, var(--drv) 34%, transparent);
}

.av-hour {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    color: var(--text-2);
}

/* Which stints an hour touches — context, not the subject of the table. */
.av-stints {
    white-space: nowrap;
    font-size: var(--fs-micro);
    color: var(--text-4);
}

.av-driver {
    white-space: nowrap;
}

/* Day divider rows, in the viewer's zone. The driver cells hold an
   "All day" button that toggles that driver for the whole day. */
.av-day th, .av-day td {
    background: var(--surface-1);
    border-top: 1px solid var(--line-2);
}
.av-day-label {
    text-align: left;
    font-weight: 650;
    color: var(--text);
    white-space: nowrap;
}
.av-day-btn {
    font-size: var(--fs-micro);
    padding: 2px 8px;
    min-height: 0;
    background: transparent;
    color: var(--text-2);
    border: 1px solid var(--line-2);
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}
.av-day-btn:hover { color: var(--text); border-color: var(--text-3); }
/* A thumb-sized target on touch screens. */
@media (pointer: coarse) { .av-day-btn { min-height: 32px; } }

/* The driver's local date is a day after/before the row's date. */
.av-dayshift {
    margin-left: 2px;
    font-weight: 700;
    color: var(--text-2);
}

/* Night (00:00-05:59) in the driver's own zone. A layer, not a colour, so it
   sits over the on/off tint and follows each theme's text colour. */
.av-cell.night {
    background-image: linear-gradient(color-mix(in srgb, var(--text) 14%, transparent), color-mix(in srgb, var(--text) 14%, transparent));
}
.av-cell:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; }

/* ---- Pit schedule: rows you can see more than eight of --------------------
 * Every editable cell is a full-size form control — inputs carry
 * min-height: 44px for iOS — so a 36-stint race was over 2,000px of vertical
 * scroll and you could never see a stop and its consequences at once. These
 * are numbers in a table, not a form: they take the table's own density.
 */
#stintScheduleTable td,
#stintScheduleTable th {
    padding: 4px 8px;
}

#stintScheduleTable input {
    min-height: 0;
    height: 28px;
    padding: 2px 6px;
    font-size: 12px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Scoped by the table id on purpose. A media query further up sets
 * `input[type="text"] { width: auto }`, which is specificity (0,1,1) and beat
 * a bare .laps-input — so these inputs kept their intrinsic ~167px and the two
 * columns stayed twice as wide as their contents. */
#stintScheduleTable .laps-input {
    width: 58px;
    margin: 0 auto;
}

#stintScheduleTable .end-time-input,
#stintScheduleTable .start-time {
    width: 96px;
    margin: 0 auto;
    font-family: monospace;
}

#stintScheduleTable .driver-chip,
#stintScheduleTable .stint-type-chip {
    padding: 2px 9px;
    font-size: 11px;
    margin: 0;
}

#stintScheduleTable button {
    min-height: 0;
    margin: 0;
    padding: 2px 9px;
    font-size: 11px;
}

/* A stint that has already run is a record, not a proposal. */
.stint-locked td {
    background: var(--bg-3);
    color: var(--text-3);
}
/* The stint on track now: the row to look at first. */
.stint-now td {
    background: var(--accent-dim);
    color: var(--text);
}
.stint-now td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
/* Live stint (Stints and Tires tables): accent edge, soft fill, and a LIVE pill where the Stints table has no status pill. */
tr.is-live-stint > td { background: var(--accent-dim); }
tr.is-live-stint > td:first-child { box-shadow: inset 3px 0 0 var(--accent); font-weight: 700; }
tr.is-live-stint > td:first-child:not([data-status])::after {
    content: "LIVE"; margin-left: 6px; padding: 1px 6px; border-radius: 999px;
    font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--accent); border: 1px solid var(--accent);
}

/* The dot marking a lap count as actual rather than planned. */
.laps-actual {
    margin-left: 3px;
    color: var(--accent);
    font-size: 14px;
    line-height: 0;
    vertical-align: middle;
}

/* A stint type whose per-lap rates have not been filled in. */
.no-rates-mark {
    color: var(--warn);
    font-weight: 700;
    margin-left: 2px;
    cursor: help;
}

/* ---- Roster table ------------------------------------------------------ */
.rs-color input {
    width: 40px;
    min-height: 0;
    height: 30px;
    padding: 2px;
}

.rs-name input,
.tname {
    width: 100%;
    min-width: 120px;
    text-align: left;
}

.rs-tz { min-width: 96px; min-height: 34px; }

.rs-num {
    width: 76px;
}

.rs-lap {
    width: 104px;
    font-family: monospace;
}

.rs-del {
    width: 1%;
    white-space: nowrap;
}

#rosterTable input {
    min-height: 0;
    height: 32px;
    padding: 3px 8px;
    font-size: 13px;
    margin: 0;
}

/* On phones the generic width:100% beat the widths above and the auto table
   squeezed lap time to 30px ("1:"). The table scrolls sideways, so keep them usable. */
#rosterTable .rs-num { min-width: 64px; }
#rosterTable .rs-lap { min-width: 96px; }

/* ---- Odds and ends ----------------------------------------------------- */
/* A destructive action small enough to sit in a table cell. */
.btn-icon-danger {
    min-height: 0;
    margin: 0;
    padding: 3px 9px;
    background: transparent;
    border-color: transparent;
    color: var(--text-4);
    font-size: 14px;
    line-height: 1;
}

.btn-icon-danger:hover {
    color: var(--crit);
    border-color: var(--crit);
}

/* "Fill this in over on Setup > Basic" — a link that moves you there. */
.go-link {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.go-link:hover { color: var(--accent-hover); }

/* Shared empty-state row for tables with nothing in them yet. */
.empty-row,
.tire-empty td {
    text-align: center;
    color: var(--text-3);
    padding: 18px;
}

/* Roster rows carry only short inputs; the table's 10px cell padding on top of
   a 32px control made each one 55px tall for four fields. */
#rosterTable td,
#rosterTable th {
    padding: 4px 8px;
}

/* Split view needs room for two panes, and split-view.js refuses to open it
   below 1100px — so on a phone the button was there, looked live, and did
   nothing when tapped. */
@media (max-width: 1100px) {
    .split-btn { display: none; }
}

/* ---- Pit schedule: every column sized, table shrink-wrapped --------------
 * Auto layout hands spare width out evenly, so a 58px lap input sat in a 290px
 * column. Constraining eight columns and leaving one flexible only moved the
 * problem: whichever column was left over became enormous — Status ended up
 * 644px wide, which is what this looked like.
 *
 * table-layout: fixed with width: auto means the table is exactly the sum of
 * the widths below and nothing is left to hand out. The bordered wrapper still
 * spans the full width, so the panel matches everything else on the page and
 * the empty space sits outside the table rather than inside a column.
 */
#stintScheduleTable {
    table-layout: fixed;
    width: auto;
    min-width: 0;
}

#stintScheduleTable th:nth-child(1), #stintScheduleTable td:nth-child(1) { width: 42px; }
#stintScheduleTable th:nth-child(2), #stintScheduleTable td:nth-child(2) { width: 74px; }
#stintScheduleTable th:nth-child(3), #stintScheduleTable td:nth-child(3) { width: 92px; }
#stintScheduleTable th:nth-child(4), #stintScheduleTable td:nth-child(4) { width: 104px; }
#stintScheduleTable th:nth-child(5), #stintScheduleTable td:nth-child(5) { width: 122px; }
#stintScheduleTable th:nth-child(6), #stintScheduleTable td:nth-child(6) { width: 82px; }
#stintScheduleTable th:nth-child(7), #stintScheduleTable td:nth-child(7) { width: 84px; }
#stintScheduleTable th:nth-child(8), #stintScheduleTable td:nth-child(8) { width: 150px; }
#stintScheduleTable th:nth-child(9), #stintScheduleTable td:nth-child(9) { width: 84px; }

#stintScheduleTable th, #stintScheduleTable td { overflow: hidden; }

/* ---- Focus you can see -------------------------------------------------
 * The tab bars are reachable from the keyboard now (see utils.js), which is
 * only useful if you can tell which one you are on. Divs get no focus ring of
 * their own, and :focus-visible keeps it off for mouse clicks. */
.tab:focus-visible,
.subtab:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}
/* The focused tab that is also selected keeps its underline under the ring. */
.tab.active:focus-visible,
.subtab.active:focus-visible {
    box-shadow: var(--ring), inset 0 -2px 0 var(--accent);
}

/* ==========================================================================
   DENSITY — the same layout, sized for the monitor it is on.
   ==========================================================================
   Everything above was tuned on a 27" 1440p screen. On a 24" 1080p one the
   chrome does not shrink with the window: header, ticker, tab bar, sub-tab bar
   and toolbar together eat ~330px before the first row of data, so a 1366px
   laptop showed seven stints out of twelve and the whole app felt oversized.

   Rather than re-tune a hundred rules, step the tokens the rest of the file
   already builds on. Type, spacing and control heights come down together, so
   proportions are kept and only the scale changes.

   The breakpoint is 2000px because that is what separates the two monitors
   this was reported against: a 27" 1440p desktop is 2560 logical pixels and
   keeps the roomy scale, a 24" 1080p one is 1920 and gets this.

   Scoped to a fine pointer: a phone or tablet keeps the full-size controls,
   which it needs for fingers, and inputs keep 16px there or iOS zooms the page
   on focus. */
@media (max-width: 2000px) and (hover: hover) and (pointer: fine) {
    :root {
        --fs-micro: 10px;
        --fs-small: 11px;
        --fs-body: 13px;
        --fs-lead: 15px;
        --fs-title: 18px;
        --fs-display: 22px;
        --s3: 10px;
        --s4: 12px;
        --s5: 18px;
        --s6: 26px;
        --pad-tab: 9px 13px;
        --pad-cell: 7px 9px;
        --radius: 8px;
    }

    /* Controls. These carry fixed pixel heights for touch targets that a mouse
       does not need. */
    button { min-height: 34px; font-size: var(--fs-body); }
    input[type="text"], input[type="number"], select,
    input[type="datetime-local"], input[type="time"] {
        min-height: 34px;
        font-size: var(--fs-body);
        padding: 6px 9px;
    }

    /* Chrome above the data. */
    .top-bar { padding: 8px 10px; margin: 6px 0; gap: 8px; }
    .brand-logo-img { height: 24px; }
    .top-bar-right { gap: 6px; }
    .room-chip, .gmt-clock, .split-btn { padding: 5px 9px; }
    .gmt-clock { font-size: 0.8rem; }

    .tabs, .subtabs { padding: 3px; margin-bottom: 8px; }
    .tab { padding: 8px 13px; font-size: var(--fs-body); }

    .race-ticker { height: 30px; }
    body.has-race-ticker #app { padding-top: 36px; }

    .plan-toolbar, .tire-toolbar { padding: 7px 10px; margin-bottom: 8px; }
    .section { margin: var(--s4) 0 var(--s2); }

    #app { padding-bottom: 12px; }
    #siteFooter { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); font-size: 11px; }
    #siteFooter .btn-ghost { padding: 3px 7px; }

    table th, table td { padding: 5px 7px; font-size: 12px; }
    #stintScheduleTable td, #stintScheduleTable th { padding: 3px 7px; }
    #stintScheduleTable input { height: 26px; }
}

/* Below ~1500px the app is wider than the window minus its own gutters, so the
   1400px cap stops doing anything useful and only costs margin. */
@media (max-width: 1500px) and (hover: hover) and (pointer: fine) {
    #app { padding-left: 10px; padding-right: 10px; }
}

/* ==========================================================================
   PHONES
   ==========================================================================
   The desktop chrome does not survive a 390px screen: logo, room chip, theme
   picker, clock, Save and Load stacked into a header taking half the viewport,
   then a tab bar, then a sub-tab bar, then a toolbar — and a fixed footer
   eating the bottom. You scrolled past all of it to reach one row of data.

   Nothing is removed. The header becomes a compact single row, the footer
   stops floating, and the scale comes down — while tap targets stay at the
   44px the guidelines ask for, which is why this cannot simply reuse the
   desktop density block above.

   Keyed on pointer: coarse as well as width, so a small laptop window keeps
   the desktop treatment and a big phone still gets this one. */
@media (max-width: 820px), (pointer: coarse) and (max-width: 1024px) {
    :root {
        --fs-micro: 10px;
        --fs-small: 11px;
        --fs-body: 13px;
        --s4: 12px;
        --s5: 16px;
        --s6: 20px;
    }

    /* ---- Header: one row, nothing stacked ---- */
    .top-bar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
        padding: 6px 8px;
        margin: 4px 0;
    }

    .top-bar-left,
    .top-bar-right {
        width: auto;
        flex: 1 1 auto;
        gap: 6px;
    }

    .brand-logo-img { height: 22px; }

    /* The room name and code are the one thing a phone user needs from the
       header — it is how they join their team. Everything else shrinks. */
    .room-chip { padding: 4px 8px; gap: 5px; font-size: var(--fs-small); }
    .room-chip .room-name-text { max-width: 9ch; overflow: hidden; text-overflow: ellipsis; }

    .gmt-clock { padding: 4px 8px; font-size: 0.72rem; }
    .theme-picker .theme-name { display: none; }
    .theme-trigger { padding: 6px 8px; }

    /* Saving and loading a plan file is a desktop job; on a phone those two
       buttons cost a third of the header and are almost never the reason
       someone opened this. */
    .top-actions { display: none; }

    /* ---- Footer stops floating ----
       position:fixed plus 90px of #app padding meant a permanent 90px hole at
       the bottom of a 660px screen. In the flow it costs nothing until you
       reach it. */
    #siteFooter {
        position: static;
        padding: 10px 12px;
        gap: 6px;
    }

    #app {
        padding-bottom: 12px;
    }

    .footer-links { gap: 8px; }
    .footer-links .btn-ghost { padding: 4px 8px; font-size: 11px; }

    /* ---- Ticker: still readable, half the height ---- */
    .race-ticker { height: 28px; }
    body.has-race-ticker #app { padding-top: 32px; }
    .ticker-item { font-size: 10px; padding: 0 8px; gap: 4px; }
    .ticker-item .tk-val { font-size: 12px; }
    /* It scrolls sideways with the scrollbar hidden; fade the right edge so a
       cut-off item reads as "more this way", not as broken. */
    .race-ticker { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
                   mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }

    /* ---- Tab bars scroll sideways rather than wrapping to three rows ---- */
    .tabs, .subtabs, .live-subtabs.subtabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 3px;
        margin-bottom: 8px;
    }

    .tab, .subtab {
        flex: 0 0 auto;
        padding: 9px 14px;
        font-size: var(--fs-body);
    }

    /* ---- Content ---- */
    .plan-toolbar, .tire-toolbar { padding: 8px; gap: 6px; }
    .plan-toolbar-sep { display: none; }
    .section { margin: var(--s4) 0 var(--s2); }

    /* One column: side-by-side panels at 390px are two unreadable columns. */
    .plan-bottom, .tire-top, .lobby-wrap {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Tables keep their shape and scroll sideways — a 9-column schedule
       reflowed into a phone-width block stops being a schedule. The wrapper
       already scrolls; this just stops the cells collapsing into slivers. */
    .table-wrap { -webkit-overflow-scrolling: touch; }
    table { min-width: 560px; }
    #stintScheduleTable, #tireScheduleTable { min-width: 720px; }
    #availabilityTable { min-width: 480px; }

    /* Tap targets stay honest even though the type came down. */
    button, .tab, .subtab { min-height: 40px; }
    .tire-override { min-height: 28px; padding: 4px 10px; }
    .av-cell { min-height: 40px; }

    /* Split view has no meaning here; the button is already hidden. */
    .pane-main { overflow: visible; height: auto !important; }
}

/* The live view is the one screen people really do watch on a phone, so it
   gets the extra room: no ticker duplicating what the dashboard already says. */
@media (max-width: 820px) {
    body.is-embed .race-ticker { display: none; }
}

/* ==========================================================================
   PHONE RACE VIEW (phone-race.js)
   ==========================================================================
   Two cards and a list: what is happening now, what happens next, and the rest
   of the race. Sized to be read at arm's length rather than studied. */
.phone-race { display: none; }

@media (max-width: 820px), (pointer: coarse) and (max-width: 1024px) {
    .phone-race {
        display: block;
        padding: 0 2px 8px;
    }

    .pr-card {
        background: var(--panel-2);
        border: 1px solid var(--line);
        border-left: 3px solid var(--accent);
        border-radius: var(--radius);
        padding: 12px 14px;
        margin-bottom: 10px;
    }

    /* Live alerts above the cards (voice-engineer.js keyAlerts). */
    .pr-alerts { display: grid; gap: 6px; margin-bottom: 10px; }
    .pr-alert {
        border: 1px solid var(--warn);
        background: var(--warn-dim);
        color: var(--warn-soft);
        border-radius: var(--radius);
        padding: 8px 12px;
        font-size: 14px;
        font-weight: 650;
    }
    .pr-alert-crit { border-color: var(--crit); background: var(--crit-dim); color: var(--crit-soft); }

    /* Connection checklist (phone-race.js readiness), mirrors live.html's pill. */
    .pr-ready-pill { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 10px; padding: 8px 12px;
        font: inherit; font-size: 14px; font-weight: 650; text-align: left; color: var(--text-2);
        background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
    .pr-ready-pill i { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--text-3); }
    .pr-ready-pill.is-ok i { background: var(--accent); }
    .pr-ready-pill.is-warn i, .pr-ready-pill.is-wait i { background: var(--warn); }
    .pr-ready-pill.is-bad { border-color: var(--crit); background: var(--crit-dim); color: var(--crit-soft); }
    .pr-ready-pill.is-bad i { background: var(--crit); }
    .pr-ready { list-style: none; margin: -4px 0 10px; padding: 10px 14px; font-size: 14px;
        background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); }
    .pr-ready li { display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 6px; padding: 4px 0; }
    .pr-ready li i { font-style: normal; font-weight: 700; text-align: center; color: var(--text-3); }
    .pr-ready li b { font-weight: 600; overflow-wrap: anywhere; }
    .pr-ready li span { grid-column: 2; font-size: 13px; color: var(--text-2); }
    .pr-ready li.is-ok i { color: var(--accent); }
    .pr-ready li.is-warn i, .pr-ready li.is-wait i { color: var(--warn); }
    .pr-ready li.is-bad i { color: var(--crit); }
    .pr-ready li.is-unk b { color: var(--text-3); font-weight: 400; }
    .pr-ready .pr-ready-head, .pr-ready .pr-ready-foot { display: block; }
    .pr-ready .pr-ready-head { font-weight: 650; padding-bottom: 6px; }
    .pr-ready .pr-ready-foot { padding-top: 6px; font-size: 13px; color: var(--text-2); }
    .pr-ready .pr-ready-foot a { color: rgb(var(--accent-rgb)); }

    .pr-label {
        font-size: 10px;
        letter-spacing: .1em;
        text-transform: uppercase;
        color: var(--text-4);
        margin-bottom: 4px;
    }

    /* The one number someone unlocked their phone to see. */
    .pr-big {
        font-size: 26px;
        font-weight: 700;
        line-height: 1.15;
        color: var(--text-hi);
        font-variant-numeric: tabular-nums;
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .pr-note {
        margin-top: 3px;
        color: var(--accent);
        font-weight: 650;
        font-size: 14px;
        font-variant-numeric: tabular-nums;
    }

    .pr-sub {
        margin-top: 6px;
        color: var(--text-3);
        font-size: 12px;
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
    }

    .pr-chip {
        display: inline-block;
        padding: 3px 10px;
        border-radius: 999px;
        background: var(--surface-3);
        color: var(--ink);
        font-size: 13px;
        font-weight: 700;
        white-space: nowrap;
    }

    .pr-chip-empty {
        background: transparent;
        border: 1px dashed var(--line-3);
        color: var(--text-4);
        font-weight: 500;
    }

    .pr-list-head {
        margin: 14px 0 6px;
        font-size: 10px;
        letter-spacing: .1em;
        text-transform: uppercase;
        color: var(--text-4);
    }

    .pr-list {
        list-style: none;
        margin: 0;
        padding: 0;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        overflow: hidden;
    }

    /* A grid, not a table: four fixed slots so the times and names line up
       down the column without the horizontal scroll a real table needs. */
    .pr-row {
        display: grid;
        grid-template-columns: 26px 52px 1fr auto;
        align-items: center;
        gap: 8px;
        padding: 9px 10px;
        border-bottom: 1px solid var(--line);
        background: var(--panel);
    }

    .pr-row:last-child { border-bottom: 0; }
    .pr-num { color: var(--text-4); font-size: 12px; text-align: right; }
    .pr-time { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text-2); }
    .pr-driver { min-width: 0; overflow: hidden; }
    .pr-driver .pr-chip { font-size: 12px; padding: 2px 8px; }
    .pr-meta { color: var(--text-4); font-size: 11px; white-space: nowrap; }
    .pr-done { display: block; text-align: center; color: var(--text-3); }

    .pr-empty {
        padding: 28px 16px;
        text-align: center;
        color: var(--text-2);
        line-height: 1.6;
    }

    .pr-empty span { color: var(--text-4); font-size: 13px; }

    .pr-full {
        width: 100%;
        margin: 12px 0 0;
        background: transparent;
        border: 1px solid var(--line-3);
        color: var(--text-3);
        font-size: 13px;
    }

    /* The Race tab hides its own overflow for the iframe; the phone view is a
       normal scrolling column. */
    #tab4 { overflow: visible !important; padding: 0 !important; }
}

/* Header, tighter still. At 390px the room chip, theme swatch and clock wrap
   to a second row, and with desktop padding that second row cost another 66px
   — a third of the screen gone before the first card. */
@media (max-width: 820px), (pointer: coarse) and (max-width: 1024px) {
    .top-bar { padding: 4px 6px; gap: 4px; margin: 3px 0; }
    .top-bar-left { flex: 0 0 auto; }
    .top-bar-right { flex: 1 1 auto; justify-content: flex-end; gap: 4px; }
    .brand-logo-img { height: 18px; }
    .room-chip { padding: 3px 7px; gap: 4px; }
    .room-chip .room-name-text { max-width: 7ch; }
    .room-copy-btn { min-height: 28px; padding: 2px 8px; font-size: 11px; margin: 0; }
    .gmt-clock { padding: 3px 7px; font-size: 0.68rem; }
    .theme-trigger { min-height: 28px; padding: 3px 6px; margin: 0; }
    .top-bar button { min-height: 30px; }
}

/* A long driver name in a fixed 150px column would be cut mid-letter by the
   overflow:hidden above. Ellipsis says "there is more" instead. */
#stintScheduleTable .driver-chip {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* Now that the table is fixed-layout with explicit widths, its max-content is
   exactly the sum of them — so the bordered box can hug it instead of running
   on for another third of the page with nothing in it. (Tried before the
   widths were explicit, where it made auto layout re-spread every column.)
   Where :has() is unsupported the box just stays full width. */
.table-wrap:has(> #stintScheduleTable) {
    width: max-content;
    max-width: 100%;
}

/* ---- Plan tab: two columns on a wide screen ----------------------------
 * The schedule stopped filling the width once its columns were sized, leaving
 * a few hundred pixels of nothing beside it. Fuel saving and Realtime deltas
 * were already the next thing down the page and both exist to grade the
 * schedule — so they move up beside it. Nothing is added or removed; the same
 * panels stop being a scroll away from the table they are about.
 *
 * Only where there is genuinely room: the deltas table wants ~420px before its
 * columns start wrapping, so below that the panels drop back underneath at
 * full width.
 */
@media (min-width: 1250px) {
    /* #sub10.active, not #sub10.
     *
     * A sub-tab is hidden by `.subcontent { display: none }` and shown by
     * `.subcontent.active { display: block }` — both class selectors. A bare
     * `#sub10 { display: grid }` is an ID, so it outranked the hide and the pit
     * schedule stayed on screen underneath the tire schedule, both sub-tabs
     * rendering at once. Matching .active keeps this rule inside the same
     * show/hide contract as every other panel. */
    #sub10.active {
        display: grid;
        grid-template-columns: max-content minmax(420px, 1fr);
        gap: 0 var(--s4);
        align-items: start;
    }

    #sub10.active > .plan-toolbar {
        grid-column: 1 / -1;
    }

    #sub10.active > .table-wrap {
        grid-column: 1;
        margin-bottom: 0;
    }

    #sub10.active > .plan-bottom {
        grid-column: 2;
        grid-template-columns: minmax(0, 1fr);
        min-width: 0;
    }

    /* Stacked in one column, the second panel needs its heading spacing back;
       the first should line up with the top of the table. */
    #sub10.active > .plan-bottom > .plan-bottom-col:first-child > .section:first-child {
        margin-top: 0;
    }
}

/* The 1400px cap was set for a single column of content. With the Plan tab in
   two columns it decides how much room the right one gets — and at 1400 that
   is ~520px, which is where "On Track Duration" started breaking mid-word.
   Only on screens that actually have the pixels to spare. */
@media (min-width: 1900px) {
    #app { max-width: 1800px; }
}

/* The planner (index.html, #app.planner) takes the Standard tier (2800, the site gutter) from a 1400
   window. Checked at 2800: the right column only grows, so the labels above never break; once it has
   room for two 524px panels (the deltas table's own floor, see the container rule below) Fuel saving
   and Realtime deltas sit side by side again instead of one very wide table. Phone and tablet keep
   the padding above. Section pages without .sl-page keep the 1400 and 1800 caps. */
#app.planner { max-width: var(--sl-w-std); }
@media (min-width: 1400px) { #app.planner { padding-left: var(--sl-gutter); padding-right: var(--sl-gutter); } }
@media (min-width: 1250px) {
    #app.planner #sub10.active > .plan-bottom { grid-template-columns: repeat(auto-fit, minmax(min(100%, 540px), 1fr)); }
}

/* And where there genuinely is not room — a 1366 laptop — the deltas table
   scrolls inside its own panel rather than hyphenating its labels. */
.plan-bottom table {
    min-width: 520px;
}

.plan-bottom td,
.plan-bottom th {
    overflow-wrap: normal;
    word-break: normal;
}

/* Local time under the GMT figure on the phone cards. Quiet on purpose — GMT
   is the number the team says out loud; this is the translation. */
.pr-local {
    width: 100%;
    margin-top: 2px;
    color: var(--text-4);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

/* ---- Saved rates (rate-memory.js) -------------------------------------- */
.rm-offer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--s3);
    margin: 0 0 var(--s4);
    padding: 12px 14px;
    background: var(--accent-deep);
    border: 1px solid var(--accent-dim);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
}

.rm-bits {
    margin-top: 3px;
    color: var(--text-3);
    font-size: var(--fs-small);
    font-variant-numeric: tabular-nums;
}

.rm-acts { display: flex; gap: var(--s2); align-items: center; }
.rm-acts button { margin: 0; }

/* Saved data: one table per car, laid out like Teams → Compare. */
.rm-list { display: grid; gap: var(--s3); }
.rm-car {
    display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap;
    margin: 0; color: var(--text-2); font-size: var(--fs-small); font-weight: 700;
}
.rm-car button, .rm-btns button { margin: 0; min-height: 30px; padding: 3px 10px; font-size: var(--fs-small); }
.rm-btns { white-space: nowrap; }
.rm-btns button + button { margin-left: var(--s2); }
.rm-table .rm-id { overflow-wrap: anywhere; }

/* Discord blurple, so the join link reads as Discord rather than as another
   footer link. Sits beside Buy me a coffee. */
.discord-link {
    color: #8b9eff;
    text-decoration: none;
    font-weight: 650;
}

.discord-link:hover { text-decoration: underline; }

/* Join our Discord, beside Buy me a coffee in the footer. */
.discord-link {
    color: var(--info);
    text-decoration: none;
    font-weight: 650;
}

.discord-link:hover { text-decoration: underline; }

/* ---- Roster: the account column (invites) ----------------------------------------- */
.rs-me { white-space: nowrap; }

.rs-claim {
    min-height: 28px;
    margin: 0;
    padding: 3px 10px;
    font-size: var(--fs-small);
    font-weight: 600;
    background: transparent;
    border-color: var(--surface-3);
    color: var(--text-3);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rs-claim:hover { border-color: var(--accent); color: var(--text); }

.rs-badge { display: inline-block; padding: 1px 6px; border: 1px solid var(--line); border-radius: 999px;
    font-size: 11px; font-weight: 600; color: var(--text-3); vertical-align: middle; }
.rs-badge.is-linked { border-color: var(--accent); color: var(--accent); }
.rs-acct { font-size: var(--fs-small); color: var(--text-2); }
.rs-sub { display: block; font-size: 11px; color: var(--text-3); }
.rs-revoke { margin: 0; padding: 0; min-height: 0; background: none; border: 0; color: var(--text-3);
    font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; }
.rs-revoke:hover { color: var(--text); }
.rr-team { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0; }

/* ---- Measured driver numbers (driver-profiles.js) ----------------------
 *
 * Sits under the roster, because that is where the link between a row and an
 * account is made and this is what comes across it. Deliberately quiet until
 * there is something to offer: an empty panel would be one more thing to read
 * for a team that has never run the companion.
 */
.dp-panel {
    margin-top: 18px;
    padding: 14px 16px 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg-2);
}
.dp-panel[hidden] { display: none; }
.dp-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.dp-head h3 { margin: 0; font-size: 0.95rem; }
.dp-intro { margin: 2px 0 10px; color: var(--text-3); font-size: 0.82rem; max-width: 74ch; }

.dp-panel table { width: auto; min-width: 0; }
/* Shrink-wrap: with `width: auto` the table still claims the whole panel and
 * hangs its border out past the last column. */
.dp-panel .table-wrap { width: max-content; max-width: 100%; }
.dp-panel table th, .dp-panel table td { white-space: nowrap; }
.dp-panel table td { font-variant-numeric: tabular-nums; }
.dp-panel table .dp-name { font-weight: 600; white-space: nowrap; }
.dp-panel table td.dp-say { white-space: normal; min-width: 14em; }
/* The Using line wraps so the Use button stays in the card (808 px of nowrap cells in 689 px at 1600 wide). */
.dp-panel table td.dp-src { white-space: normal; min-width: 11em; }
.dp-panel table .dp-src .dp-team, .dp-panel table .dp-src .dp-from { white-space: nowrap; }
#driverProfileTable tr.dp-on .dp-say::before {
    content: '\2713 ';
    color: var(--green);
}
.dp-from { color: var(--text-4); font-weight: 400; font-size: 0.78rem; }
.dp-src { color: var(--text-3); font-size: 0.8rem; }
.dp-act { text-align: right; }
.dp-act button { min-height: 30px; padding: 0 10px; font-size: 0.8rem; }

/* Signed deltas against the team rate: the number on its own says nothing,
 * the difference is the whole reason to look. */
.dp-d { font-size: 0.78rem; margin-left: 4px; }
.dp-d.up { color: var(--warn); }
.dp-d.down { color: var(--green); }

/* Wear per corner, laid out the way the car is: FL FR over RL RR, the same
   arrangement as the Setup boxes, so the two read as the same thing. */
.dp-wear, .tm-wear {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px 10px;
    font-variant-numeric: tabular-nums;
    line-height: 1.35;
}
.dp-wear b, .tm-wear b { font-weight: 500; font-size: 0.86rem; }
.dp-w.up { color: var(--warn); }
.dp-w.down { color: var(--green); }
.dp-sub, .tm-sub {
    display: block;
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--text-4);
    text-transform: none;
}
.dp-warn {
    color: var(--warn);
    border: 1px solid currentColor;
    border-radius: 4px;
    padding: 0 4px;
    font-size: 0.72rem;
    cursor: help;
}

@media (max-width: 820px), (pointer: coarse) and (max-width: 1024px) {
    .dp-panel { padding: 12px 12px 4px; }
    .dp-intro { font-size: 0.8rem; }
    .dp-panel .dp-act button { width: 100%; margin: 2px 0; }
}

/* ---- Reuse a roster ---------------------------------------------------
 *
 * An inline panel rather than a modal: the app has no modal anywhere else, and
 * one dialog built for one button is a pattern nobody else can follow.
 */
.rr-panel {
    margin: 10px 0 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg-2);
}
.rr-panel[hidden] { display: none; }
.rr-intro { margin: 0 0 10px; color: var(--text-3); font-size: 0.82rem; max-width: 74ch; }
.rr-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.rr-wait { color: var(--text-4); font-size: 0.82rem; }
.rr-room {
    display: flex; align-items: baseline; gap: 10px;
    padding: 7px 12px; min-height: 34px;
    background: var(--panel); color: var(--text);
    border: 1px solid var(--line); border-radius: 8px;
    font: inherit; font-size: 0.85rem; cursor: pointer; text-align: left;
}
.rr-room:hover { border-color: var(--accent); color: var(--accent); }
.rr-code { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rr-code label { color: var(--text-3); font-size: 0.82rem; }
.rr-code input {
    width: 160px; min-height: 34px;
    font-family: var(--mono, ui-monospace, monospace);
}
/* The toolbar's .btn-ghost gets its outline from .plan-toolbar, which this
 * button sits outside of, so it needs its own. */
.rr-code button {
    min-height: 34px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: 8px;
    background: var(--panel);
}
.rr-code button:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 820px), (pointer: coarse) and (max-width: 1024px) {
    .rr-room { width: 100%; justify-content: space-between; }
    .rr-code input { flex: 1 1 120px; width: auto; }
}

/* ---- Guide tab --------------------------------------------------------
 *
 * Long-form reading inside an app built for scanning tables. The page uses
 * the screen (cards, topics and videos side by side), but the measure is held
 * down hard on the prose (78ch on .gd-body, the Quick start steps, notes and
 * the foot) because full-width prose on a 27" monitor is where people give up.
 * The sections are <details> so the page opens as a contents list rather than a wall.
 */

/* Steps left, the g1 player right (guide-videos.js appends it); one column with the player first under 900px. */
.gd-quick {
    padding: 14px 18px 8px;
    border: 1px solid var(--line-3);
    border-radius: 10px;
    background: var(--panel);
    margin-bottom: 24px;
}
.gd-quick:has(> .gd-video:not([hidden])) {
    display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start;
}
.gd-quick > .gd-video { margin: 0 0 10px; }
.gd-quick h3 { margin: 0 0 10px; font-size: 0.95rem; }
.gd-quick ol { margin: 0; padding-left: 20px; max-width: 78ch; }
.gd-quick li { margin-bottom: 5px; line-height: 1.5; color: var(--text-2); }

.gd-sec {
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 10px;
    background: var(--panel);
}
.gd-sec > summary {
    display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
    padding: 12px 16px;
    cursor: pointer;
    list-style: none;
}
.gd-sec > summary::-webkit-details-marker { display: none; }
/* The disclosure arrow is drawn rather than inherited, so it points the same
 * way in every browser and rotates with the section. */
.gd-sec > summary::before {
    content: '\25b8';
    color: var(--text-4);
    transition: transform 0.12s ease;
}
.gd-sec[open] > summary::before { transform: rotate(90deg); }
.gd-sec > summary:hover { background: var(--panel-2); }
.gd-sec > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; box-shadow: none; }
.gd-h { font-weight: 600; }
.gd-sub { color: var(--text-4); font-size: 0.82rem; }

.gd-body { padding: 0 18px 14px 34px; color: var(--text-2); line-height: 1.6; max-width: 78ch; }
.gd-body h4 {
    margin: 16px 0 6px;
    font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--text-3);
}
.gd-body p { margin: 0 0 10px; }
.gd-body ul, .gd-body ol { margin: 0 0 10px; padding-left: 20px; }
.gd-body li { margin-bottom: 5px; }
.gd-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.88em; padding: 1px 4px;
    background: var(--panel-2); border-radius: 4px;
}
/* An aside, not a warning: these are the "why" lines, and colouring them like
 * an error would make the guide read as a list of things that go wrong. */
.gd-note {
    color: var(--text-3); font-size: 0.87rem;
    border-left: 2px solid var(--line-2);
    padding-left: 12px; margin: 10px 0 12px;
    max-width: 78ch;
}

.gd-faq { margin: 0; }
.gd-faq dt { font-weight: 600; color: var(--text); margin-top: 12px; }
.gd-faq dt:first-child { margin-top: 0; }
.gd-faq dd { margin: 4px 0 0; color: var(--text-3); }

/* Video guides: one row of cards under Quick start (it swipes on a phone), and a
 * player at the top of each section. The "all" card's player opens above the row
 * only when it is clicked. All drawn by guide-videos.js at first paint, and removed
 * if the files turn out not to exist. */
.gd-videos { margin: 0 0 24px; }
.gd-videos h3 { margin: 0 0 10px; font-size: 0.95rem; }
.gd-vgrid {
    display: grid; gap: 10px;
    grid-auto-flow: column; grid-auto-columns: 190px;
    overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    padding: 2px 2px 6px; scrollbar-width: none;
}
.gd-vgrid::-webkit-scrollbar { display: none; }
.gd-vcard {
    display: flex; flex-direction: column; text-align: left;
    padding: 0; overflow: hidden;
    font: inherit; color: var(--text);
    background: var(--panel);
    border: 1px solid var(--line-2); border-radius: 10px;
    cursor: pointer; scroll-snap-align: start; min-height: 44px;
    transition: border-color 0.12s ease, transform 0.12s ease;
}
.gd-vcard[hidden] { display: none; }
.gd-vcard:hover { border-color: var(--line-3); transform: translateY(-1px); }
.gd-vcard.is-active { border-color: var(--accent); }
.gd-vtitle { color: var(--text-hi); }
.gd-vcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gd-vthumb {
    position: relative; display: block; aspect-ratio: 16 / 9;
    background: var(--panel-2);
}
.gd-vthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gd-vplay {
    position: absolute; left: 50%; top: 50%;
    width: 38px; height: 38px; margin: -19px 0 0 -19px;
    border-radius: 50%; background: rgba(0, 0, 0, 0.6);
}
.gd-vplay::after {
    content: ''; position: absolute; left: 15px; top: 11px;
    border-style: solid; border-width: 8px 0 8px 13px;
    border-color: transparent transparent transparent #fff;
}
.gd-vmeta { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px 10px; }
.gd-vtop { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.gd-vtitle { font-weight: 600; font-size: 0.88rem; }
.gd-vdur { color: var(--text-4); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.gd-vsum { color: var(--text-3); font-size: 0.8rem; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.gd-video { margin: 4px 0 14px; max-width: 880px; }
.gd-video video {
    display: block; width: 100%; aspect-ratio: 16 / 9;
    background: #000; border-radius: 10px;
}
.gd-video video:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Unless the last visit found no videos: the text waits for guide-videos.js to draw them
 * (it removes the class). If the script never runs, the text shows after 1s anyway. */
html.gd-videos-seen .gd-page { visibility: hidden; animation: gd-show 0s 1s forwards; }
@keyframes gd-show { to { visibility: visible; } }
/* Videos found after first paint fade in (guide-videos.js) rather than pop. */
.gd-fadein { animation: gd-fadein 0.25s ease-out; }
@keyframes gd-fadein { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
    .gd-vcard, .gd-sec > summary::before { transition: none; }
    .gd-vcard:hover { transform: none; }
    .gd-fadein { animation: none; }
}

.gd-foot { margin-top: 18px; color: var(--text-3); font-size: 0.88rem; max-width: 78ch; }
.gd-foot .btn-ghost { border: 1px solid var(--line); padding: 3px 9px; }

@media (max-width: 820px), (pointer: coarse) and (max-width: 1024px) {
    .gd-body { padding: 0 14px 12px 14px; }
    .gd-sec > summary { padding: 12px 14px; min-height: 44px; }
}
@media (max-width: 900px) {
    .gd-quick:has(> .gd-video:not([hidden])) { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .gd-quick > .gd-video { order: -1; }
}

/* The guide link at the foot of the getting-started checklist. */
.ob-guide {
    display: block; margin: 10px 14px 4px;
    background: none; border: 0; padding: 0;
    color: var(--text-3); font: inherit; font-size: 0.83rem;
    cursor: pointer; text-align: left;
}
.ob-guide:hover { color: var(--accent); }

/* ---- Teams: the page's rules live in teams.css; the planner's tab and Saved data's table keep theirs here. */
#tab6 { max-width: 1000px; }
.rm-table { width: auto; min-width: 0; }
.table-wrap:has(> .rm-table) { width: max-content; max-width: 100%; }
.rm-table td { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rm-table .tm-name { font-weight: 600; }
.rm-table .tm-laps, .rm-table .tm-x { color: var(--text-4); }
.rr-link {
    background: none; border: 0; padding: 0;
    color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline;
}
@media (max-width: 820px), (pointer: coarse) and (max-width: 1024px) {
    #tab6 { max-width: none; }
}

/* Which circuit the team's filed numbers are for (the offers panel in the
 * planner still uses chips — there are rarely more than a couple there). */
.dp-combos { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 12px; }
.dp-combo {
    display: inline-flex; align-items: baseline; gap: 7px;
    min-height: 30px; padding: 0 10px;
    background: var(--panel); color: var(--text-2);
    border: 1px solid var(--line); border-radius: 7px;
    font: inherit; font-size: 0.82rem; cursor: pointer;
}
.dp-combo:hover { border-color: var(--accent); }
.dp-combo.is-on { border-color: var(--accent); background: var(--accent-dim); color: var(--text); }
.dp-team {
    font-size: 0.7rem; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--text-4); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px;
    cursor: help;
}

/* ---- Inline links -----------------------------------------------------
 *
 * Any <a> without a class of its own was falling through to the user-agent
 * stylesheet: #0000EE on a near-black background, underlined, and unmistakably
 * unstyled. That is what the Teams and What's new links looked like the moment
 * they were added, and what the guide's own links looked like before that.
 *
 * :not([class]) rather than a bare `a`, for the same reason the footer rule
 * needs it: .discord-link and .bmc-link are (0,1,0), this would be (0,1,0) too,
 * and a same-specificity fight is decided by whichever happens to come later in
 * the file. Not matching them at all is the only version that cannot be broken
 * by moving a block. It also means a link with ANY class is opting out, so
 * future styled links keep working without touching this.
 */
a:not([class]) {
    color: var(--accent);
    text-decoration: none;
}
a:not([class]):hover { text-decoration: underline; }

/* A driver's name linked to their profile (DriverLink in public/js/head.js). In data tables it keeps the text
 * color with a faint accent underline, so a 50 row board is not painted in the accent and the You chip and rank
 * colors still read; the underline means the link is not shown by color alone. Focus ring comes from
 * a:focus-visible above. In prose and cards it keeps the site link look. A new tab link gets an arrow (#687). */
a.driver-link {
    color: inherit; font-weight: inherit; border-radius: 2px;
    text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
    text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
a.driver-link:hover, a.driver-link:focus-visible { color: var(--accent-soft); text-decoration-color: currentColor; }
[data-theme="daylight"] a.driver-link:hover, [data-theme="daylight"] a.driver-link:focus-visible { color: var(--accent); }
.prose a.driver-link, .state-card p a.driver-link, .rrd-list a.driver-link, .lmu-sub a.driver-link { color: var(--accent); text-decoration: none; }
.prose a.driver-link:hover, .state-card p a.driver-link:hover, .rrd-list a.driver-link:hover, .lmu-sub a.driver-link:hover,
.prose a.driver-link:focus-visible, .state-card p a.driver-link:focus-visible, .rrd-list a.driver-link:focus-visible, .lmu-sub a.driver-link:focus-visible { color: var(--accent); text-decoration: underline; }
a.driver-link[target="_blank"]::after { content: "\2197"; font-size: .75em; margin-left: 3px; color: var(--text-3); }

/* The wordmark is an anchor around an image; it should carry no link colour at
 * all, and it has a class, so it is outside the rule above by design. */
.brand { color: inherit; text-decoration: none; }

/* ---- What's new (changelog.html) -------------------------------------
 *
 * In app.css rather than a <style> block on the page, because the page now
 * uses the planner's own shell — one stylesheet decides what StintLab looks
 * like, and a second copy of the rules in a page head is how two pages start
 * drifting apart.
 */
.tabs a.tab { text-decoration: none; }

.cl { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 12px; }
.cl > summary {
    display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
    padding: 13px 16px; cursor: pointer; list-style: none;
}
.cl > summary::-webkit-details-marker { display: none; }
.cl > summary::before { content: '\25b8'; color: var(--text-4); transition: transform .12s ease; }
.cl[open] > summary::before { transform: rotate(90deg); }
.cl > summary:hover { background: var(--panel-2); }
.cl > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; box-shadow: none; }
.cl-v { font-weight: 600; font-variant-numeric: tabular-nums; }
.cl-t { color: var(--text-2); }
.cl-tag {
    font-size: .68rem; letter-spacing: .05em; text-transform: uppercase;
    border-radius: 4px; padding: 1px 6px; margin-left: auto;
    color: var(--accent); border: 1px solid var(--accent-dim);
}
/* ---- Release groups ----------------------------------------------------
 *
 * Twenty-eight cards down one page is a wall, and nobody scrolls it looking
 * for 2.6.1 — they either want what just changed, which is at the top and
 * open, or they want a particular thing they remember, which is easier to
 * find by series than by scrolling. So everything older folds into its
 * release: one line each, a count, and a sentence saying what that run of
 * releases was about, so the summary is worth reading on its own rather than
 * being a lid on a box.
 *
 * The nested cards keep .cl, so an entry looks and behaves the same whether
 * it is the newest one at the top or three years down inside 2.5. They sit on
 * --panel-2 only so the nesting is visible without a second border. */
.cl-n {
    margin-left: auto; font-size: .72rem; color: var(--text-4);
    font-variant-numeric: tabular-nums;
}
.cl-stack { padding: 0 14px 14px 34px; }
.cl-blurb {
    color: var(--text-3); line-height: 1.6; max-width: 78ch;
    margin: 0 0 12px; font-size: .92rem;
}
.cl-group > .cl-stack > .cl { background: var(--panel-2); margin-bottom: 8px; }
.cl-group > .cl-stack > .cl:last-child { margin-bottom: 0; }
.cl-group > .cl-stack > .cl > summary { padding: 10px 14px; }
.cl-group > .cl-stack > .cl > summary:hover { background: var(--panel-3, var(--panel)); }
.cl-group > .cl-stack > .cl > .cl-body { padding: 0 16px 14px 32px; }

.cl-body { padding: 0 18px 16px 34px; color: var(--text-2); line-height: 1.62; max-width: 78ch; }
.cl-body h3 {
    margin: 18px 0 6px; font-size: .84rem; letter-spacing: .04em;
    text-transform: uppercase; color: var(--text-3);
}
.cl-body h3:first-child { margin-top: 4px; }
.cl-body p { margin: 0 0 10px; }
.cl-body ul { margin: 0 0 10px; padding-left: 20px; }
.cl-body li { margin-bottom: 5px; }
/* An aside, not a warning: colouring these like an error would make the page
 * read as a list of things that go wrong. */
.cl-fix { color: var(--text-3); border-left: 2px solid var(--line-2); padding-left: 12px; margin: 10px 0; }
.cl-fix b { color: var(--text-2); }
.cl-pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem;
    background: var(--panel-2); border-radius: 8px; padding: 10px 12px;
    overflow-x: auto; color: var(--text-2); margin: 0 0 10px;
}
/* The standing intro at the top of a page that is mostly prose. Shared by
 * Teams and What's new, so the measure is the same on both — full-width prose
 * on a 27" monitor is where people stop reading. */
.page-lede { color: var(--text-3); margin: 0 0 20px; line-height: 1.6; max-width: 78ch; }

/* ---- Privacy and Terms -------------------------------------------------
 * Legal text people actually read is legal text that looks like prose rather
 * than like fine print. Same measure as the rest of the site's prose, normal
 * body size, real spacing between sections. Nothing here is smaller or
 * greyer than the content it sits next to — shrinking the terms is how you
 * signal you would rather they were not read.
 */
.legal { max-width: 78ch; line-height: 1.65; color: var(--text-2); }
.legal h2 {
    margin: 30px 0 10px;
    font-size: 17px;
    color: var(--text);
    border-bottom: 1px solid var(--line);
    padding-bottom: 6px;
}
.legal h3 { margin: 20px 0 6px; font-size: 14px; color: var(--text); }
.legal p { margin: 0 0 12px; }
.legal ul { margin: 0 0 14px; padding-left: 20px; }
.legal li { margin: 0 0 7px; }
.legal-tight li { margin: 0 0 5px; }
.legal code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .92em;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 1px 5px;
}
.legal-meta { color: var(--text-3); font-size: 13px; margin: 0 0 22px; }
.legal-date { color: var(--text-2); }
/* An aside that qualifies the paragraph above it, not a warning. */
.legal-note {
    color: var(--text-3);
    border-left: 2px solid var(--line);
    padding: 2px 0 2px 12px;
    margin: 0 0 14px;
}
/* Deliberately loud: a placeholder left in a published legal page is a bug,
 * and it should be impossible to scroll past without noticing. */
.legal-blank {
    background: var(--warn-dim, #4a3a10);
    color: var(--warn-soft);
    border: 1px dashed var(--warn-soft);
    border-radius: 4px;
    padding: 0 6px;
    font-weight: 700;
}

@media (max-width: 820px), (pointer: coarse) and (max-width: 1024px) {
    .cl-body { padding: 0 14px 14px; max-width: none; }
    .cl > summary { min-height: 44px; }
    .cl-tag { margin-left: 0; }
    /* The indent that reads as nesting on a monitor is just lost width on a
       phone. The group's own border carries the nesting instead. */
    .cl-stack { padding: 0 8px 10px; }
    .cl-blurb { max-width: none; }
    .cl-group > .cl-stack > .cl > .cl-body { padding: 0 12px 12px; }
    /* Two deliberate lines rather than three accidental ones. A title long
       enough to wrap was pushing the release count down on its own, so the
       version sits on the first line with its count or tag and the title
       takes the second, the same shape on every card. */
    .cl > summary .cl-t { flex-basis: 100%; order: 1; }
    .cl-n, .cl-tag { margin-left: auto; }
}

/* ---- Site nav (beside the wordmark, every page) -----------------------
 *
 * Deliberately not styled like .tab. The section tabs below it are about this
 * race; these are about which part of StintLab you are in. Making them look
 * the same would put two navigations of different scope in the same visual
 * language, which is how people end up hunting for Setup under Teams.
 */
.site-nav { display: flex; align-items: center; gap: 2px; }
.site-link {
    padding: 6px 11px;
    border-radius: 7px;
    color: var(--text-3);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 650;
    white-space: nowrap;
}
.site-link:hover { color: var(--text); background: var(--panel-2); }
.site-link.is-here { color: var(--accent); background: var(--accent-dim); }

/* Groups (site-nav.js): a button that opens its links below it; in the phone menu they sit expanded. */
.sn-group { position: relative; display: flex; }
/* Undo the global button look (box, margin, 40px min height): it sits in the row as one more link. */
.sn-btn { display: inline-flex; align-items: center; gap: 4px; margin: 0; min-height: 0; background: none; border: 0; box-shadow: none; cursor: pointer; font-family: inherit; }
.sn-caret { font-size: 0.75em; opacity: 0.7; }
.sn-panel {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 210;
    display: flex; flex-direction: column; gap: 1px; min-width: 190px; padding: 6px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
.sn-panel[hidden] { display: none; }
.sn-panel .site-link { padding: 8px 10px; text-transform: none; letter-spacing: 0; }
.sn-panel .site-link.is-here { box-shadow: inset 3px 0 0 var(--accent); border-radius: 0 7px 7px 0; }
/* The group name as a heading (site-nav.js .sn-h): only in the ☰ menu, where the group button goes away entirely
 * (out of the tab order and the accessibility tree) and its links sit expanded under the heading. */
.sn-h { display: none; }
.tb-menu .sn-group { flex-direction: column; }
.tb-menu .sn-group > .sn-btn { display: none; }
.tb-menu .sn-group > .sn-h {
    display: flex; align-items: center; height: 28px; padding: 0 10px;
    color: var(--text-4); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em;
}
.tb-menu .sn-panel, .tb-menu .sn-panel[hidden] {
    position: static; display: flex; min-width: 0; padding: 0 0 4px 12px;
    background: none; border: 0; box-shadow: none;
}
/* The phone menu shows the account links outright, not behind a second tap on the avatar. */
.top-bar .tb-menu #userTrigger { display: none; }
.tb-menu #userDropdown[hidden] { display: block; }
.tb-menu #userDropdown { max-width: none; }
/* Destructive room action: red label, standard menu hover wash. */
.tb-menu .top-btn.tb-danger,
.tb-menu .top-btn.tb-danger:hover { color: var(--crit); }
@media (max-width: 768px) { .top-bar .tb-menu { left: 0; right: 0; width: auto; } }
.lobby-user { display: inline-flex; align-items: center; gap: 8px; }

@media (max-width: 820px), (pointer: coarse) and (max-width: 1024px) {
    /* Four links plus the wordmark do not fit beside each other on a phone, and
     * a nav item half off the edge of the screen is one nobody knows is there.
     *
     * flex-wrap alone did nothing: .top-bar-left cannot shrink, so the nav kept
     * its max-content width and simply overflowed the header. A 100% basis puts
     * it on its own line under the wordmark, which is deterministic rather than
     * dependent on which of several rules wins on the row above it. */
    /* flex-shrink as well as min-width. An earlier rule sets `flex: 0 0 auto`
     * on this, which is a flex-shrink of 0, so min-width:0 on its own gave it
     * permission to be narrow and no reason to take it. At 390px it sat 3px
     * wider than the header with overflow visible — a sliver of the page off
     * the right edge, and nothing to scroll to reach it. */
    .top-bar-left { flex-wrap: wrap; min-width: 0; flex: 1 1 auto; }
    .site-nav { gap: 0; flex-wrap: wrap; min-width: 0; flex: 1 1 100%; }
    .site-link { padding: 8px 9px; font-size: 0.82rem; }
}

/* Car and track as two selects (Saved data's picker; the Teams page's Compare uses them too). */
.tm-picks { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.tm-pickfield { display: flex; flex-direction: column; gap: 4px; }
.tm-pickfield > span {
    font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3);
}
.tm-pickfield select { min-height: 34px; min-width: 190px; }
@media (max-width: 820px), (pointer: coarse) and (max-width: 1024px) {
    .tm-pickfield, .tm-pickfield select { width: 100%; min-width: 0; }
    .tm-picks { gap: 10px; }
}

/* Below about 360px the four nav links still run 2px past the panel. Nobody
 * would notice, but it is two characters of padding to fix properly. */
@media (max-width: 360px) {
    .site-link { padding: 8px 6px; font-size: 0.8rem; }
}

/* "No stops yet" in the rivals table. An answer, not a shout. */
.rp-none { color: var(--text-4); }
/* A figure we assumed rather than measured. Dimmed so the eye skips it when
 * scanning for the car that is about to stop. */
.rp-assumed { color: var(--text-4); font-style: italic; }
/* A saved entry still filed under the team entry rather than the car. */
.rm-unnamed { color: var(--warn-soft); }
.rm-unnamed b { font-weight: 700; }

/* ==========================================================================
   NARROW COLUMNS: REFLOW INSTEAD OF SCROLL
   ==========================================================================
   A horizontal scrollbar is the right answer for the stint schedule — nine
   columns reflowed into a phone-width block stops being a schedule. It is the
   wrong answer for a two-row table of six short values, which is what Realtime
   deltas is: it fits perfectly well once the headings stop insisting on being
   a row.

   Keyed to the COLUMN's width, not the window's. The panel that was scrolling
   sat in a 460px column of a 1500px window, so no viewport breakpoint would
   ever have fired. A container query asks the question that actually matters:
   is there room here.

   Browsers without container-query support keep the old scrolling behaviour,
   which is what they had. */
.plan-bottom-col {
    container-type: inline-size;
}

/* 524px, not a round number: the table's own min-width is 520 and the wrapper
   takes 2 for its border, so it stops fitting just below this. Reflowing any
   earlier would stack a table that had room to stay a table — at a 1440px
   window this column is 531px wide and the real thing fits with 2px to
   spare. */
@container (max-width: 524px) {
    /* Nothing to scroll once the table fits, so lose the scroll container's
       own overflow too, or it keeps a stub of a scrollbar. */
    .table-wrap:has(> .reflow) { overflow-x: visible; }

    table.reflow { min-width: 0; width: 100%; }

    /* The headings move into each cell as a label. */
    table.reflow thead { display: none; }
    table.reflow, table.reflow tbody, table.reflow tr, table.reflow td {
        display: block;
        width: auto;
    }

    table.reflow tr {
        border-bottom: 1px solid var(--line);
        padding: 2px 0;
    }
    table.reflow tr:last-child { border-bottom: 0; }

    table.reflow td {
        border: 0;
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 14px;
        padding: 6px 12px;
        text-align: right;
    }

    table.reflow td::before {
        content: attr(data-label);
        color: var(--text-dim);
        font-size: var(--fs-micro);
        text-transform: uppercase;
        letter-spacing: .04em;
        text-align: left;
        flex: 0 0 auto;
    }

    /* The first cell is the row's name, so it reads as a heading rather than
       as "delta type: on track duration". */
    table.reflow td:first-child {
        font-weight: 600;
        padding-top: 10px;
    }
    table.reflow td:first-child::before { display: none; }
    table.reflow td:first-child { justify-content: flex-start; text-align: left; }
}

/* ---- Setup made lighter: optional rows folded away ---------------------- */
.alt-toggle {
    margin-top: 6px;
    padding: 4px 8px;
    font-size: var(--fs-small);
}
.alt-toggle[hidden] { display: none; }

/* GMT equivalent of the local race start, under the box. */
.gmt-eq {
    display: block;
    min-height: 1.2em;
    margin-top: 4px;
    font-size: var(--fs-small);
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}

.tire-alloc-hint {
    margin: 0;
    font-size: var(--fs-small);
    white-space: nowrap;
    color: var(--warn);
}
.tire-alloc-hint[hidden] { display: none; }

/* The fold's rows stay items of the parent grid, so they line up with the
   FL/FR/RL/RR headings exactly as before. */
.ti-more { display: contents; }
.ti-more[hidden] { display: none; }
.ti-more-toggle {
    grid-column: 1 / -1;
    justify-self: start;
    padding: 2px 6px;
    font-size: var(--fs-small);
}
.tire-top button.ti-more-toggle { min-height: 0; }
.ti-more-note {
    grid-column: 1 / -1;
    margin: 0;
    font-size: var(--fs-small);
    color: var(--text-4);
}

/* Narrow: the panel drops its sixth (toggle) column, so the empty spacer
   cells that fill that column on wide screens would push every row one cell
   right. Only the header's leading spacer is still needed. */
@media (max-width: 768px) {
    .tire-inputs > span:empty:not(:first-child),
    .ti-more > span:empty { display: none; }
}

/* ---- Phone: tire inputs fit inside 390px --------------------------------
 * The wear row is a nested grid whose four tracks were minmax(64px) while the
 * parent's corner tracks drop to 48px here, so #wearAvg poked ~50px past the
 * card and the whole page scrolled sideways. Let both grids shrink to the
 * same 0-min tracks (they share one gap, so columns still line up), let the
 * labels and the allocation hint wrap, and slim the input padding so "100"
 * in Start life is not clipped. The schedule table keeps scrolling inside
 * its own .table-wrap. */
@media (max-width: 768px) {
    .tire-top > .tire-inputs {
        grid-template-columns: auto repeat(4, minmax(0, 1fr));
        gap: 8px;
    }
    .ti-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .tire-inputs input { min-width: 0; padding: 4px 2px; }
    .ti-label { white-space: normal; }
    .tire-stat { flex-wrap: wrap; }
    .tire-alloc-hint { white-space: normal; }
}

/* Getting started on a phone: the next step is the point of the bar, so it
 * gets its own line instead of ending in "Next: Start t…". onboarding.js
 * injects the base rules at (0,1,0); these are (0,2,0). */
@media (max-width: 768px) {
    .onboard .onboard-head { flex-wrap: wrap; row-gap: 4px; }
    .onboard .onboard-next { order: 1; flex: 1 0 100%; white-space: normal; }
    .onboard .onboard-progress { white-space: nowrap; }
}

/* Chequered flag is worked out, not typed; until it can be, say what it needs
 * instead of showing an empty box (event-config.js leaves it blank). */
#sessionEndText:empty::before { content: 'Start + duration'; color: var(--text-4); }

/* U3-1. "+ Fuel-saving / wet rates" and "+ More tire settings" open the wet
 * and fuel-saving inputs, but as .btn-ghost they were grey text with no edge,
 * and racers did not see them as buttons. Outlined like a secondary button. */
.alt-toggle,
.ti-more-toggle { border-color: var(--line-2); color: var(--text-2); }
.alt-toggle:hover,
.ti-more-toggle:hover { border-color: var(--accent); color: var(--text); }

/* U3-2. A table's only row is a message ("Add race duration, ..."). On a phone
 * the cell is as wide as the scrolling table, so the sentence ran off screen.
 * Until there is data the headings say nothing, so drop them and let the table
 * shrink to the screen; the message then wraps where you can read it. */
@media (max-width: 768px) {
    .table-wrap table:has(> tbody > tr:only-child > td[colspan]:only-child) {
        /* !important: the plan tables set their widths by id (min-width 720px) */
        min-width: 0 !important;
        width: 100% !important;
        table-layout: auto !important;
    }
    .table-wrap table:has(> tbody > tr:only-child > td[colspan]:only-child) > thead {
        display: none;
    }
    .table-wrap tbody > tr:only-child > td[colspan]:only-child { white-space: normal; }
    /* the stint table's box hugs max-content (by id), so let it fill again */
    .table-wrap:has(> table > tbody > tr:only-child > td[colspan]:only-child) { width: auto !important; }
}

/* U3-3. Five section tabs at 360px: "Saved data" was cut to "Saved dat" and
 * nothing said the bar scrolls. Slightly tighter tabs fit all five. */
@media (max-width: 400px) {
    .pane-main > nav.tabs .tab { padding: 8px 7px; }
}

/* U3-4. "Copy" said nothing about what it copies; wide screens say "Copy link".
 * Phones keep the short word (the room chip is already tight there). */
@media (max-width: 768px) {
    .room-copy-btn .copy-wide { display: none; }
}

/* The wet line sits under its track's dry line, as in Teams → Compare. */
.rm-table tr.tm-wet td { border-top: 0; padding-top: 0; }
.rm-table tr.tm-wet .tm-name { font-weight: 400; padding-left: 1.4em; }

/* ==========================================================================
   PLANNER PASS 5 — hierarchy, focus and touch (2026-10-10)
   ========================================================================== */

/* Header in one row from 1366px up: the theme name and the Split view label
   cost two rows of chrome. The swatch and the icon keep their names. */
@media (min-width: 821px) and (max-width: 1799px) {
    .theme-picker .theme-name, .split-btn .split-label { display: none; }
}
@media (min-width: 821px) {
    .room-chip { padding: 4px 6px 4px 10px; gap: 6px; }
    .room-chip .room-name-text {
        display: inline-block; max-width: 22ch; vertical-align: bottom;
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .top-bar-left, .top-bar-right { min-height: 44px; }
}
@media (min-width: 821px) and (max-width: 1499px) {
    .top-bar-right { gap: 6px; }
    .site-link { padding-left: 8px; padding-right: 8px; }
}

/* Skip link: 30 Tab stops sit between the top of the page and the plan. */
.skip-link {
    position: absolute; left: 8px; top: -60px; z-index: 10050;
    padding: 10px 14px; border-radius: 8px;
    background: var(--surface-1); color: var(--text-hi, var(--text));
    border: 1px solid var(--accent); text-decoration: none; font-weight: 650;
}
.skip-link:focus { top: 8px; box-shadow: var(--ring); outline: none; }
#main:focus { outline: none; }
#sections:focus { outline: none; }
/* Edge focuses a segment inside the date box, which never matches :focus-visible. */
input[type="datetime-local"]:focus-within { box-shadow: var(--ring); }
#sections:focus-visible { box-shadow: var(--ring); }

/* Plan / Drivers / Race: a flat underlined bar, so it reads as the level
   above the boxed Plan tabs instead of a second copy of them. */
nav.tabs, .pane-main > nav.tabs, .split-wrap nav.tabs {
    background: none; border: 0; border-radius: 0; padding: 0;
    border-bottom: 1px solid var(--line);
}
nav.tabs .tab { flex: 0 0 auto; border-radius: 6px 6px 0 0; }
nav.tabs .tab.active { background: none; }

/* Stint table: a stop with no tire change shows a dash, not "0 TIRES", and a
   change is plain text; the accent is for things you can press. */
.tire-chip:not(.has-tires) { border-color: transparent; background: none; color: var(--text-4); }
.tire-chip:not(.has-tires) > span { display: none; }
.tire-chip:not(.has-tires)::before { content: "\2014"; }
.tire-chip.has-tires { border-color: var(--line-2); background: var(--surface-2); color: var(--text); }

/* Two rate offers stacked: one solid button, the other an outline. */
.rate-offer ~ .rate-offer .btn-primary { background: transparent; color: var(--accent); border-color: var(--accent); }
.rate-offer ~ .rate-offer .btn-primary:hover { background: var(--accent-dim); color: var(--text-hi, var(--text)); }

/* Sentence case for labels, table headers and small actions. Uppercase stays
   on section headings only, so those read as the heading level. */
.field > label,
.section-act,
.mode-label, .plan-toolbar .mode-label,
.tire-stat-label {
    text-transform: none;
    letter-spacing: 0;
}
.field > label { font-size: var(--fs-small); }
.section-act { font-size: var(--fs-small); padding: 4px 12px; }
th {
    text-transform: none;
    letter-spacing: 0;
    font-size: var(--fs-small);
    background: var(--panel-2);
}

/* A computed value is text, not a disabled-looking box. */
.field.is-derived .value,
.field.is-derived > .value {
    border-color: transparent;
    background: none;
    padding-left: 0;
    color: var(--text-2);
    font-family: inherit;
}

/* Footer (every page that loads app.css): plain links, none of them louder
   than the page above it. The id matches #siteFooter button's green outline. */
#siteFooter .footer-links .btn-ghost,
#siteFooter .footer-links .discord-link,
#siteFooter .footer-links .bmc-link {
    display: inline-flex; align-items: center;
    min-height: 36px; margin: 0; padding: 4px 8px;
    border: 0; border-radius: 6px; background: none;
    color: var(--text-3); font-size: var(--fs-small); font-weight: 500;
    text-decoration: none;
}
#siteFooter .footer-links .btn-ghost:hover,
#siteFooter .footer-links .discord-link:hover,
#siteFooter .footer-links .bmc-link:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }

/* Lobby: the team aside is a footnote, not body copy. */
.lobby-aside { margin: var(--s4) 0 0; font-size: var(--fs-small); color: var(--text-3); line-height: 1.5; }

/* Numbers that change in place should not shift sideways. */
input, .gmt-clock, .gmt-eq, .field.is-derived .value { font-variant-numeric: tabular-nums; }

/* Drivers: signed out with nothing linked, the Account column is all dashes. */


/* Phones: row controls big enough to hit. */
@media (max-width: 820px), (pointer: coarse) and (max-width: 1024px) {
    .btn-icon-danger { min-height: 40px; min-width: 40px; }
    .pr-ready-pill, .pr-full { min-height: 44px; }
    .pr-ready-foot a { display: inline-block; padding: 10px 0; }
}
.pr-delta-num, .pr-time { font-variant-numeric: tabular-nums; }

/* Motion: everything, not just the few rules that remembered to opt out. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
/* Box-shadow focus rings vanish in Windows High Contrast; an outline does not. */
@media (forced-colors: active) {
    :focus-visible { outline: 2px solid CanvasText !important; outline-offset: 2px; }
}

/* The x beside a started stint's typed lap count (stint-schedule.js): clears just that override. */
.laps-clear { margin-left: 6px; padding: 0 6px; min-width: 22px; height: 22px; line-height: 20px; border: 1px solid var(--line-2, var(--line)); border-radius: 4px; background: transparent; color: var(--text-2, var(--text)); font-size: 12px; cursor: pointer; }
.laps-clear:hover, .laps-clear:focus-visible { color: var(--text); border-color: var(--accent); }

/* LMP2 and LMP3 run on fuel alone (car-model.js usesVE): every VE box, column and readout goes
 * (body.no-ve: fuel-config.js syncVeForCar on the planner, live.js dropVeIfFuelOnly on the live pages). */
body.no-ve .ve-only,
body.no-ve .rates-table tr > :nth-child(3),
body.no-ve .rates-math tr > :nth-child(2),
body.no-ve .rates-math tr > :nth-child(6),
body.no-ve #sxFinalStint tr > :nth-child(7),
body.no-ve #sxFinalStint tr > :nth-child(8),
body.no-ve #stintScheduleTable tr > :nth-child(7),
body.no-ve .ticker-item:has([data-tk="ve"]),
body.no-ve .sw-field:has([data-for="stdVePerLap"]),
body.no-ve [data-tile="veLaps"],
body.no-ve .en-row:has(#eVe) { display: none !important; }
/* combo-alert.js: a companion on another car/track than Plan > Event */
.combo-alert { position: sticky; top: 0; z-index: 1000; display: flex; gap: 10px; align-items: flex-start; padding: 10px 16px;
    background: var(--crit-soft); border-bottom: 2px solid var(--crit); color: var(--text-hi, var(--text)); font-size: 14px; line-height: 1.4; }
.combo-alert.is-warn { background: var(--warn-soft); border-bottom-color: var(--warn); }
.combo-alert[hidden] { display: none; }
.combo-alert-icon { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--crit); color: #fff; font-weight: 800; }
.combo-alert.is-warn .combo-alert-icon { background: var(--warn); color: #000; }

/* Undo / Redo / Lock plan bar (plan-history.js). */
.plan-edit-bar { margin: var(--s2) 0 var(--s3); padding: 6px 10px; }
.plan-locked-badge { padding: 2px 10px; border-radius: 999px; font-size: var(--fs-micro); font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase; background: var(--warn); color: #000; }
body.plan-locked #planLockBtn { border-color: var(--warn); }
/* Rating badges (public/js/rating-badges.js): the large badge and the small chip for next to a name. */
.rb-badge { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.rb-badge .rb-svg { flex: 0 0 auto; }
.rb-text { display: flex; flex-direction: column; min-width: 0; }
.rb-kind { font-size: 0.75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.rb-name { font-size: 1.25rem; line-height: 1.2; color: var(--text); }
.rb-cap { font-size: 0.85rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.rb-next { font-size: 0.8rem; color: var(--text-3); }
.rb-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem; font-weight: 600; vertical-align: middle; white-space: nowrap; }
.rb-chip.rb-prov { color: var(--text-3); font-weight: 400; }
.rb-badge.rb-soft { border-style: dashed; }
.rb-chip.rb-soft .rb-svg { opacity: .7; }
/* Rating history views (public/js/rating-view.js): trend line, deltas, records, the per-race changes. */
.rv-svg { display: block; width: 100%; max-width: 720px; height: auto; margin: 6px 0 2px; }
.rb-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 0 0 10px; }
.rb-badge.rb-prov .rb-svg { color: var(--text-3); }
#lbView button[hidden] { display: none; }
.rv-grid { stroke: var(--line); stroke-width: 1; }
.rv-tick { fill: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.rv-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.rv-dot { fill: var(--accent); stroke: var(--panel); stroke-width: 1.5; }
.rv-dot.rv-prov { fill: var(--panel); stroke: var(--accent); }
.rv-sum { margin: 2px 0 10px; font-size: 0.85rem; color: var(--text-2); }
.rv-d { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-3); }
.rv-d.rv-up { color: var(--green); }
.rv-d.rv-down { color: var(--crit); }
.rv-metrics { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 0; }
.rv-metrics button { padding: 3px 12px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--text-2); font: inherit; font-size: 0.82rem; cursor: pointer; }
.rv-metrics button[aria-pressed="true"] { border-color: var(--accent); color: var(--text); background: var(--panel-2); }
.rv-recs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.rv-rec { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); min-width: 0; }
.rv-rec span { display: block; font-size: 0.72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.rv-rec b { display: block; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.rv-rec small { display: block; color: var(--text-3); font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rv-ev { padding: 8px 4px; border-bottom: 1px solid var(--line); }
/* Recent races (/account/races, rating-view.js raceRowHtml): the DR and SR change lead each row. */
.rr-list { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--line); }
.rr-row { display: flex; align-items: center; gap: 14px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.rr-deltas { flex: 0 0 auto; display: flex; gap: 10px; }
.rr-d { display: flex; flex-direction: column; align-items: center; min-width: 3.6em; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.rr-d small { font-size: 0.7rem; letter-spacing: .06em; color: var(--text-3); }
.rr-d .rv-d { font-size: 1.1rem; }
.rr-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.rr-main b { overflow-wrap: anywhere; }
.rr-main .rv-when { color: var(--text-3); font-size: 0.82rem; }
.rr-wet { font-size: 0.72rem; padding: 0 6px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); }
.rr-after { flex: 0 0 auto; text-align: right; font-size: 0.82rem; font-variant-numeric: tabular-nums; color: var(--text-2); }
.rr-after small { display: block; color: var(--text-3); font-size: 0.7rem; }
.rr-empty { color: var(--text-3); }
@media (max-width: 560px) { .rr-row { flex-wrap: wrap; } .rr-after { text-align: left; } }
/* The race drawer (races-page.js, rating-view.js raceDrawerHtml): a right side panel, a bottom sheet on phones. */
.rr-row[data-rk] { cursor: pointer; }
.rr-row[data-rk]:hover { background: var(--panel-2); }
.rr-row[data-rk]:focus-visible { outline: none; box-shadow: var(--v2-focus); border-radius: 6px; }
.rr-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 100vw; z-index: var(--z-dialog, 10090); overflow: auto; padding: 20px 20px 24px; background: var(--panel-2, var(--panel)); border-left: 1px solid var(--line-3); box-shadow: -20px 0 60px rgba(0, 0, 0, .45); animation: rr-drawer .18s ease-out; }
.rr-drawer[hidden] { display: none; }
@keyframes rr-drawer { from { transform: translateX(24px); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .rr-drawer { animation: none; } }
.rr-drawer-x { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; min-height: 0; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--text-2); font-size: 20px; line-height: 1; }
.rr-rm { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.rr-rm-q { margin: 0 0 8px; font-size: 0.88rem; color: var(--text-2); }
.rr-rm-why { display: grid; gap: 6px; margin-bottom: 10px; }
.rr-rm-opt { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; }
.rr-rm-err { margin: 0 0 10px; color: var(--bad, #f87171); font-size: 0.85rem; }
.rr-rm-acts { display: flex; gap: 8px; }
.rr-rm button:disabled { opacity: .5; cursor: not-allowed; }
.rr-drawer h2 { margin: 0 32px 2px 0; font-size: 1.2rem; }
.rr-drawer h3 { margin: 16px 0 6px; font-size: 0.78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.rr-drawer > .rr-drawer-body > .rv-when { color: var(--text-3); font-size: 0.82rem; margin: 0 0 12px; }
.rrd-big { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0 0 16px; }
.rrd-big b { display: block; font: 600 34px/1.05 var(--font-display, inherit); font-variant-numeric: tabular-nums; }
.rrd-big b .rv-d { font: inherit; min-width: 0; text-align: left; }
.rrd-lab { display: block; font-size: 0.78rem; color: var(--text-3); }
.rrd-big small { display: block; margin-top: 2px; font-size: 0.85rem; color: var(--text-2); }
.rrd-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 16px; font-size: 0.92rem; }
.rrd-list dt { color: var(--text-3); }
.rrd-list dd { margin: 0; font-variant-numeric: tabular-nums; }
.rrd-na { color: var(--text-3); }
.rrd-sec { padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line-2, var(--line)); }
.rrd-sec h3 { margin-top: 0; }
.rrd-links { display: flex; flex-wrap: wrap; gap: 8px; }
.rrd-link, .rrd-links .rrd-none { display: inline-flex; align-items: center; height: 32px; min-height: 0; margin: 0; padding: 0 12px; border: 1px solid var(--line-3); border-radius: 8px; background: none; font-size: 0.85rem; font-weight: 600; text-decoration: none; color: var(--text); }
.rrd-links .rrd-none { color: var(--text-3); border-style: dashed; font-weight: 400; }
.rrd-why { margin-top: 10px; }
.rr-rank { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-2); }
.rr-p1 { color: var(--rank-gold, #e6b93d); }
.rr-p2 { color: var(--rank-silver, #c3cbd6); }
.rr-p3 { color: var(--rank-bronze, #cd8a4e); }
.rr-dnf { color: var(--crit); }
.rrd-wait, .rrd-none { border: 1px dashed var(--line-3); border-radius: 8px; padding: 12px; color: var(--text-3); font-size: 0.85rem; }
.rrd-none { display: inline-block; padding: 6px 10px; }
.rrd-note { color: var(--text-3); font-size: 0.85rem; margin: 4px 0; }
.rrd-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 10px 0 0; font-size: 0.85rem; }
.rrd-facts dt { color: var(--text-3); font-size: 0.72rem; letter-spacing: .06em; text-transform: uppercase; }
.rrd-facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.rrd-inc { margin: 10px 0 0; padding: 0 0 0 16px; font-size: 0.85rem; color: var(--text-2); }
.rrd-open { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rrd-open h3 { flex: 0 0 100%; }
.rv-ref { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 4 4; }
.rv-dot.rv-pit { fill: var(--warn); }
.rv-dot.rv-inv { fill: var(--crit); }
@media (max-width: 720px) {
    .rr-drawer { left: 0; right: 0; top: auto; width: auto; max-height: 86vh; border-left: 0; border-top: 1px solid var(--line-3); border-radius: 14px 14px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); animation-name: lmu-sheet; }
    @keyframes lmu-sheet { from { transform: translateY(24px); opacity: .6; } }
    html.rr-drawer-open { overflow: hidden; }
}
.rv-ev-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.rv-ev-head b { min-width: 0; overflow-wrap: anywhere; }
.rv-ev-head .rv-when { color: var(--text-3); font-size: 0.82rem; }
.rv-ds { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 0; font-size: 0.85rem; color: var(--text-2); }
.rv-why { list-style: none; margin: 4px 0 0; padding: 0 0 0 12px; font-size: 0.82rem; color: var(--text-2); }
.rv-why li { display: flex; justify-content: space-between; gap: 10px; }
.rv-why li span { min-width: 0; overflow-wrap: anywhere; }
.rv-why li .rv-d, .rv-ds > span { flex: none; white-space: nowrap; }
.rv-scroll { overflow-x: auto; }
.rv-table { width: 100%; min-width: 0; border-collapse: collapse; font-size: 0.88rem; }
.rv-table th, .rv-table td { text-align: left; padding: 5px 8px; border-top: 1px solid var(--line); }
.rv-table th { color: var(--text-3); font-weight: 600; border-top: 0; }
.rv-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tm-check { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; cursor: pointer; }
.rv-team { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.rv-team-k { font-size: 0.72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.rv-hint-team { display: inline-flex; align-items: center; gap: 6px; margin-right: 10px; font-weight: 600; }
.rh-block { margin: 10px 0 0; }
.rh-now { margin: 2px 0 4px; }
.rh-note { margin: 2px 0 0; font-size: 0.8rem; color: var(--text-3); }
/* Shared labels and headings for the rating views: .ac-sub (rank-history.js "Now: …", account/driver pages) and .rt-h
 * (leaderboards.js "… history", account/driver pages). Account and driver keep their page-local copies; these make the
 * same styles available everywhere else, e.g. the viewer's history on /leaderboards. */
.ac-sub { color: var(--text-3); font-size: 0.85rem; }
.rt-h { margin: 14px 0 4px; font-size: 0.9rem; }
.tw-name .rv-team { margin-left: 5px; }
.lb-team-n { font-variant-numeric: tabular-nums; }
.tw-name .pp { margin: 0 0 0 5px; gap: 2px; }
/* People (public/js/people.js): an account's avatar and chips next to its name. */
.pp { display: inline-flex; align-items: center; gap: 6px; margin: 0 4px; vertical-align: middle; }
.pp-av { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; object-fit: cover; vertical-align: middle; }
.pp-ini { color: #fff; font-weight: 700; line-height: 1; }
.pp-td { display: inline-block; margin-left: 4px; font-size: 0.75rem; line-height: 1; vertical-align: middle; cursor: help; opacity: 0.9; }
.pp-new { display: inline-block; margin-left: 4px; font-size: 0.85rem; line-height: 1; vertical-align: middle; cursor: help; }

/* Box calls (BOX THIS LAP, BOX FOR WETS?, BOX FOR SLICKS, the pit window's BOX ...): one class, .is-box, on every
 * surface that shows the call, set by the call text (/^BOX\b/). Red, flashing at 1 s; the text stays --text on
 * the red tint for contrast in light and dark themes. Reduced motion: solid red, no flash. */
.is-box { border-color: var(--crit); background: var(--crit-dim); color: var(--text); animation: box-flash 1s ease-in-out infinite; }
@keyframes box-flash { 50% { background: color-mix(in srgb, var(--crit) 28%, var(--crit-dim)); box-shadow: inset 0 0 0 3px var(--crit); } }
@media (prefers-reduced-motion: reduce) { .is-box { animation: none; box-shadow: inset 0 0 0 3px var(--crit); } }

/* The encyclopedia's entry points (Tracks tab, About this track) until /api/features says it is on (theme.js). */
html:not(.ft-encyclopedia) .ency-only { display: none !important; }

/* What's new on the Read tier (#748): only main.cl-page (changelog.html). Entries keep their release-owned markup
   (details.cl, .cl-v, .cl-t, .cl-tag); here they look like .card. The rail holds Find, Versions and the companion. */
.cl-page .cl { position: relative; margin: 0 0 var(--sl-gap); background: var(--v2-panel); border: 1px solid var(--v2-line); border-radius: var(--r-lg); box-shadow: var(--v2-shadow-1); }
.cl-page .cl > summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; padding: 10px 12px; }
.cl-page .cl > summary::before { align-self: center; font-size: 12px; color: var(--text-3); }
.cl-page .cl-v { font: 700 15px var(--sl-display); color: var(--accent-soft, var(--accent)); letter-spacing: .02em; padding: 1px 8px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 16%, transparent); font-variant-numeric: tabular-nums; }
.cl-page .cl-t { font: 650 16px/1.25 var(--sl-display); color: var(--text-hi); }
.cl-page .cl-tag { margin-left: auto; padding: 1px 7px; border: 1px solid var(--accent); border-radius: var(--r-pill); background: var(--accent); color: var(--ink, #060806); font: 700 10.5px var(--sl-display); letter-spacing: .04em; text-transform: uppercase; }
.cl-page .cl-body { max-width: var(--sl-prose); padding: 0 16px 14px 32px; }
.cl-page .cl-body ul.cl-k { list-style: none; padding: 0; display: grid; gap: 6px; }
.cl-page .cl-body ul.cl-k > li { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 10px; align-items: baseline; margin: 0; line-height: 1.5; }
.cl-page .cl-body ul.cl-k > li > .tag { justify-self: start; }
.cl-page details.cl li.cl-hit { background: color-mix(in srgb, var(--warn) 18%, transparent); box-shadow: inset 3px 0 0 var(--warn); }
.cl-page .cl-group > .cl-stack > .cl { box-shadow: none; background: var(--panel-2, var(--panel)); }
.cl-page .cl-foot { margin-top: var(--sl-gap); }
.cl-page .cl-find { display: block; max-width: none; margin: 0; padding: 10px 12px 12px; border: 1px solid var(--v2-line); background: var(--v2-panel); }
.cl-page .cl-find label { font: inherit; color: inherit; }
.cl-page .cl-find input { width: 100%; box-sizing: border-box; min-height: 36px; font-size: 14px; }
.cl-page .cl-find-n { margin: 6px 0 0; color: var(--text-3); font-size: 12px; font-weight: 400; }
.cl-page .cl-vers ul { margin: 0; padding: 0; list-style: none; }
.cl-page .cl-vers li a { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 4px 8px; margin: 0 -8px; border-radius: 4px; color: var(--text-2); font-size: 12.5px; text-decoration: none; }
.cl-page .cl-vers li a:hover { background: var(--v2-hover); }
.cl-page .cl-vers li a.on { background: var(--v2-wash); color: var(--text-hi); }
.cl-page .cl-vers li a b { font: 700 12px var(--sl-display); color: var(--text-hi); font-variant-numeric: tabular-nums; }
.cl-page .cl-vers li a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-page .cl-vers li a.hid, .cl-page .cl-vers li a.hid b { color: var(--text-3); font-weight: 400; }
.cl-page .cl-vers #clAll { margin-top: 6px; align-self: start; }
@media (max-width: 760px) {
    .cl-page .cl-body { padding: 0 12px 12px; }
    .cl-page .cl-body ul.cl-k > li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .cl-page .cl-body ul.cl-k > li > span:empty { display: none; }
    .cl-page .cl > summary { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .cl-page .chip.live::before { animation: none; } .cl-page .cl > summary::before { transition: none; } }

/* Language picker (i18n.js, #873): globe + code before the theme picker, the footer link, the phone menu row. */
.lp-wrap { position: relative; display: inline-flex; }
.lp-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px; border: 1px solid var(--line-3, #3a443c); border-radius: 6px; background: var(--bg-2, transparent); color: var(--text, inherit); font: 700 12px var(--font-display, inherit); letter-spacing: .04em; cursor: pointer; }
.lp-btn::after { content: "\25BE"; color: var(--text-3, inherit); font-size: 10px; }
.lp-btn[aria-expanded="true"] { border-color: var(--accent); }
#siteFooter .lp-wrap .lp-btn.text, .lp-wrap .lp-btn.text { height: auto; border-color: transparent; background: none; color: inherit; font: inherit; letter-spacing: 0; padding: 0 4px; }
.lp-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 1000; width: 272px; padding: 6px; border: 1px solid var(--line-3, #3a443c); border-radius: 10px; background: var(--panel-2, #121612); box-shadow: 0 14px 34px -14px rgba(0,0,0,.8); font: 14px var(--font-ui, inherit); letter-spacing: 0; text-transform: none; text-align: left; }
.lp-up .lp-menu { top: auto; bottom: calc(100% + 6px); }
.lp-h { padding: 4px 8px 6px; font: 700 11px var(--font-display, inherit); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3, inherit); }
.lp-wrap .lp-item { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 6px; width: 100%; min-height: 34px; padding: 4px 8px; border: 0; border-radius: 6px; background: none; color: var(--text, inherit); text-align: left; font: 600 14px var(--font-ui, inherit); cursor: pointer; }
.lp-wrap .lp-item:hover, .lp-wrap .lp-item:focus-visible { background: color-mix(in srgb, var(--text, #fff) 6%, transparent); }
.lp-wrap .lp-item[aria-checked="true"] { background: rgba(var(--accent-rgb, 148, 163, 184), .13); }
.lp-item::before { content: ""; }
.lp-item[aria-checked="true"]::before { content: "\2713"; color: var(--accent); font-weight: 700; }
.lp-item small { display: block; font-weight: 400; font-size: 12px; color: var(--text-3, inherit); }
.lp-item .res { font-size: 12px; color: var(--text-3, inherit); }
.lp-sep { height: 1px; margin: 6px 2px; background: color-mix(in srgb, var(--text, #fff) 11%, transparent); }
.lp-note { margin: 6px 8px 2px; font-size: 12px; color: var(--text-3, inherit); }
.lp-help { display: block; padding: 6px 8px 4px; font-size: 12px; }
.tb-menu .lp-wrap { display: block; margin: 8px 0; }
.tb-menu .lp-menu { position: static; width: auto; box-shadow: none; }
.tb-menu .lp-item { min-height: 44px; }
.lp-banner { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 7px 20px; border-bottom: 1px solid color-mix(in srgb, var(--text, #fff) 11%, transparent); background: rgba(var(--accent-rgb, 148, 163, 184), .13); color: var(--text-2, inherit); font-size: 13px; }
.lp-banner .x { margin-left: auto; }
#siteFooter .lp-wrap .lp-btn.text { border: 0; box-shadow: none; min-height: 0; }

/* guard-display.js (#1057): a tank size that looks like gallons. */
.guard-slip[hidden] { display: none; }
.guard-slip button { margin-left: 4px; }

/* lmu-section.css */
.lmu-carlink { color: inherit; text-decoration: none; }
.lmu-carlink:hover, .lmu-carlink:focus-visible { text-decoration: underline; }
.lmu-trk-about { align-self: center; font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.lmu-trk-about:hover, .lmu-trk-about:focus-visible { color: var(--text-hi); }
/* lmu-section.css: the LMU races section (Schedule, Results, Cars, Tracks, When to race, Rank up plan, Your split). Design: docs/design/lmu-races/design-spec.md.
   Markup comes from public/js/lmu-section.js. Only site tokens are used, so every theme works; the four rank colors
   are the one exception (they match the LMU driver rank badges). Buttons, selects and tables get global styles from
   app.css, so each component below resets what it must (min-height, margin, shadow, borders, background). */

.lmu-page {
    /* --lmu-top: the top bar is position: relative on these pages (it scrolls away), so the sticky bar pins at 0. */
    --lmu-top: 0px; --lmu-caps: .08em; --lmu-good: var(--dx-good, var(--green));
    --lmu-r-ctl: 6px; --lmu-r-box: 10px; --lmu-r-pill: 999px; --lmu-h-ctl: 30px; --lmu-h-seg: 26px; --lmu-h-chip: 28px; --lmu-h-row: 40px;
    --rank-bronze: #cd8a4e; --rank-silver: #c3cbd6; --rank-gold: #e6b93d; --rank-platinum: #7fd4e6;
    --lmu-focus: var(--v2-focus, 0 0 0 3px rgba(var(--accent-rgb), .35));
    font-family: var(--v2-font-ui, var(--font-ui, system-ui, sans-serif));
    max-width: 1300px; margin: 0 auto; overflow-x: clip;
}
.lmu-page [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html.lmu-sheet-open { overflow: hidden; }

/* Focus ring, only on the section's own controls. */
.lmu-bar :focus-visible, .lmu-tabs a:focus-visible, .lmu-table button:focus-visible, .rk button:focus-visible,
.lmu-subtabs button:focus-visible, .lmu-explain summary:focus-visible, .lmu-picker-top .lmu-sel:focus-visible { outline: none; box-shadow: var(--lmu-focus); }

/* 3.1 Section header */
.lmu-eyebrow { display: flex; align-items: center; gap: var(--s3, 12px); margin: 0 0 var(--s3, 12px); font-size: 11px; font-weight: 700; letter-spacing: var(--lmu-caps); text-transform: uppercase; color: var(--text-3); }
.lmu-eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.lmu-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3, 12px) var(--s5, 24px); flex-wrap: wrap; margin-bottom: var(--s4, 16px); }
.lmu-head h1 { margin: 0; font: 600 26px/1.1 var(--v2-font-display, var(--font-display, inherit)); letter-spacing: .01em; color: var(--text-hi); text-wrap: balance; }
.lmu-sub { margin: 4px 0 0; max-width: 62ch; color: var(--text-2); font-size: 14px; }
.lmu-head-right { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2, 8px) var(--s3, 12px); }
.lmu-head-right .lmu-stats { white-space: normal; }
.lmu-stats { margin: 0; color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 3.2 Section tab bar (links) */
.lmu-tabs { display: flex; gap: 2px; margin: 0 0 var(--s4, 16px); border-bottom: 1px solid var(--line-2); overflow-x: auto; scrollbar-width: none; }
.lmu-tabs::-webkit-scrollbar { display: none; }
.lmu-tabs a { flex: none; padding: 9px 14px 10px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-3); font-size: 13px; font-weight: 650; white-space: nowrap; text-decoration: none; }
.lmu-tabs a:hover { color: var(--text-hi); }
.lmu-tabs a[aria-current="page"] { color: var(--text-hi); border-bottom-color: var(--accent); }

/* 3.3 Sub-tabs (Cars) */
.lmu-subrow { display: flex; align-items: center; justify-content: space-between; gap: var(--s3, 12px); flex-wrap: wrap; }
.lmu-subtabs { display: inline-flex; gap: 2px; padding: 3px; margin: 0 0 var(--s4, 16px); border: 1px solid var(--line-2); border-radius: var(--lmu-r-ctl); background: var(--panel); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.lmu-subtabs::-webkit-scrollbar { display: none; }
.lmu-subtabs button { height: var(--lmu-h-ctl); min-height: 0; margin: 0; padding: 0 14px; border: 0; border-radius: 3px; background: none; box-shadow: none; transform: none; color: var(--text-2); font: 600 13px/1 var(--v2-font-ui, inherit); white-space: nowrap; }
.lmu-subtabs button:hover { color: var(--text-hi); }
.lmu-subtabs button[aria-selected="true"] { background: var(--surface-3); color: var(--text-hi); box-shadow: inset 0 -2px 0 var(--accent); }
/* The selected tab keeps its accent underline under the focus ring (tabs.js gives each bar one Tab stop). */
.lmu-subtabs button[aria-selected="true"]:focus-visible { box-shadow: var(--lmu-focus), inset 0 -2px 0 var(--accent); }
.lmu-hint { margin: 0 0 var(--s4, 16px); color: var(--text-3); font-size: 12px; }

/* 3.4 Sticky filter bar and its controls */
.lmu-bar { position: sticky; top: var(--lmu-top); z-index: 30; margin: 0 0 var(--s3, 12px); padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--lmu-r-box); background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(8px); box-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
.lmu-bar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.lmu-bar-row + .lmu-bar-row { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-2); }
.lmu-bar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.lmu-grp { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; }
.lmu-lbl { font-size: 11px; font-weight: 700; letter-spacing: var(--lmu-caps); text-transform: uppercase; color: var(--text-3); }
.lmu-seg { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--lmu-r-pill); background: var(--bg-2); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.lmu-seg::-webkit-scrollbar { display: none; }
.lmu-seg button { flex: none; height: var(--lmu-h-seg); min-height: 0; margin: 0; padding: 0 11px; border: 0; border-radius: var(--lmu-r-pill); background: none; box-shadow: none; transform: none; color: var(--text-2); font: 600 12px/1 var(--v2-font-ui, inherit); white-space: nowrap; }
.lmu-seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text-hi); }
.lmu-seg button:hover:not([aria-pressed="true"]) { color: var(--text-hi); }
.lmu-sel { width: auto; max-width: 100%; height: var(--lmu-h-ctl); min-height: 0; margin: 0; padding: 0 28px 0 10px; border: 1px solid var(--line-3); border-radius: var(--lmu-r-ctl); color: var(--text); font: 600 12px/1 var(--v2-font-ui, inherit); appearance: none;
    background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238a9a90' stroke-width='1.5'/%3E%3C/svg%3E") right 10px center no-repeat; }
.lmu-inp { width: auto; max-width: 100%; min-width: 0; height: var(--lmu-h-ctl); min-height: 0; margin: 0; padding: 0 10px; border: 1px solid var(--line-3); border-radius: var(--lmu-r-ctl); background: var(--bg-2); color: var(--text); font: 12px/1 var(--v2-font-ui, inherit); }
.lmu-btn-q, .lmu-btn-o { height: var(--lmu-h-ctl); min-height: 0; margin: 0; border-radius: var(--lmu-r-ctl); box-shadow: none; transform: none; font: 600 12px/1 var(--v2-font-ui, inherit); white-space: nowrap; }
.lmu-btn-q { padding: 0 10px; border: 1px solid transparent; background: none; color: var(--text-2); }
.lmu-btn-q:hover { color: var(--text-hi); background: var(--v2-hover); }
.lmu-btn-o { padding: 0 12px; border: 1px solid var(--line-3); background: var(--bg-2); color: var(--text); }
.lmu-btn-o:hover { border-color: var(--accent); }

/* 3.5 Driver rank chips: --rk per rank, set from data-rank */
.lmu-ranks { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rk { position: relative; display: inline-flex; --rk: var(--accent); }
.rk[data-rank="Bronze"] { --rk: var(--rank-bronze); }
.rk[data-rank="Silver"] { --rk: var(--rank-silver); }
.rk[data-rank="Gold"] { --rk: var(--rank-gold); }
.rk[data-rank="Platinum"] { --rk: var(--rank-platinum); }
.rk-main, .rk-caret { height: var(--lmu-h-chip); min-height: 0; margin: 0; border: 1px solid var(--line-3); background: var(--bg-2); box-shadow: none; transform: none; color: var(--text-2); font: 650 12px/1 var(--v2-font-ui, inherit); }
.rk-main { padding: 0 10px; border-radius: var(--lmu-r-pill) 0 0 var(--lmu-r-pill); border-right: 0; display: inline-flex; align-items: center; gap: 6px; }
.rk-caret { width: 26px; padding: 0; border-radius: 0 var(--lmu-r-pill) var(--lmu-r-pill) 0; display: inline-grid; place-items: center; color: var(--text-3); }
.rk-main::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--rk); }
.rk-main[aria-pressed="true"] { background: color-mix(in srgb, var(--rk) 20%, var(--bg-2)); border-color: var(--rk); color: var(--text-hi); }
.rk-main[aria-pressed="true"]::before { background: var(--rk); }
.rk-main[aria-pressed="mixed"] { background: color-mix(in srgb, var(--rk) 12%, var(--bg-2)); border-color: var(--rk); color: var(--text-hi); }
.rk-main[aria-pressed="mixed"]::before { background: linear-gradient(90deg, var(--rk) 50%, transparent 50%); }
.rk-main[aria-pressed="true"] + .rk-caret, .rk-main[aria-pressed="mixed"] + .rk-caret { border-color: var(--rk); color: var(--rk); }
.rk-main small { font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.rk-main[aria-pressed="mixed"] small { color: var(--rk); }
.rk-caret[aria-expanded="true"] { background: var(--surface-3); color: var(--text-hi); }
.rk-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 35; min-width: 190px; padding: 8px; border: 1px solid var(--line-3); border-radius: var(--lmu-r-ctl); background: var(--panel-2); box-shadow: 0 0 0 1px rgba(0, 0, 0, .3), 0 22px 54px -14px rgba(0, 0, 0, .85); }
.rk-pop header { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 2px 4px 8px; font-size: 11px; font-weight: 700; letter-spacing: var(--lmu-caps); text-transform: uppercase; color: var(--text-3); }
.rk-pop header span button { min-height: 0; margin: 0; border: 0; background: none; box-shadow: none; padding: 0 4px; color: var(--accent-soft, var(--accent)); font: 600 11px/1.4 var(--v2-font-ui, inherit); text-transform: none; letter-spacing: 0; }
.rk-pop label { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 3px; font-size: 13px; color: var(--text); }
.rk-pop label:hover { background: var(--v2-hover); }
.rk-pop input { accent-color: var(--rk); width: 15px; height: 15px; min-height: 0; margin: 0; padding: 0; }
.rk-pop label small { margin-left: auto; color: var(--text-3); font-size: 11px; }
.rk-presets { display: inline-flex; align-items: center; gap: 2px; padding-left: 10px; margin-left: 4px; border-left: 1px solid var(--line-3); }
.rk-presets button { height: var(--lmu-h-seg); min-height: 0; margin: 0; padding: 0 8px; border: 0; border-radius: 3px; background: none; box-shadow: none; transform: none; color: var(--text-3); font: 600 12px/1 var(--v2-font-ui, inherit); }
.rk-presets button:hover { color: var(--text-hi); background: var(--v2-hover); }
.rk-presets button[aria-pressed="true"] { color: var(--text-hi); background: var(--surface-3); }
.rk-hint { color: var(--warn); font-size: 12px; }

/* 3.10 Mobile filter drawer (under 720px); the summary and the sheet head are hidden above it */
.lmu-bar-sum, .lmu-drawer-head, .lmu-drawer-foot, .lmu-scrim { display: none; }
@media (max-width: 720px) {
    .lmu-bar { padding: 8px 10px; }
    .lmu-bar-sum { display: flex; align-items: center; gap: 8px; min-width: 0; }
    .lmu-sum { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-size: 12px; }
    .lmu-sum b { color: var(--text-hi); font-weight: 650; }
    .lmu-bar-ctl { display: none; }
    /* backdrop-filter would make the bar the containing block of the fixed sheet, so it is dropped while open. */
    .lmu-bar.is-open { backdrop-filter: none; }
    .lmu-bar.is-open .lmu-bar-ctl { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 10px 14px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; max-height: 82vh; overflow: auto; padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line-3); border-radius: 14px 14px 0 0; background: var(--panel-2); box-shadow: 0 -20px 60px rgba(0, 0, 0, .7); animation: lmu-sheet .18s ease-out; }
    .lmu-bar.is-open .lmu-bar-ctl:focus { outline: none; }
    .lmu-bar.is-open .lmu-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .55); }
    .lmu-bar.is-open .lmu-bar-row { display: contents; }
    .lmu-grp { flex-wrap: wrap; }
    .lmu-bar-right { order: 9; margin-left: 0; width: 100%; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--line-2); }
    .lmu-drawer-head { width: 100%; display: flex; justify-content: space-between; align-items: center; font-weight: 700; color: var(--text-hi); }
    .lmu-drawer-x { width: 32px; height: 32px; min-height: 0; margin: 0; padding: 0; border: 1px solid var(--line-3); border-radius: var(--lmu-r-ctl); background: var(--panel-2); box-shadow: none; transform: none; color: var(--text-2); font: 400 20px/1 var(--v2-font-ui, inherit); }
    .lmu-drawer-x:hover { color: var(--text-hi); background: var(--v2-hover); }
    .lmu-drawer-foot { order: 10; width: 100%; display: flex; justify-content: flex-end; padding-top: 12px; border-top: 1px solid var(--line-2); }
    .lmu-drawer-foot .lmu-btn-o { min-width: 96px; }
    .rk-pop { position: fixed; left: 16px; right: 16px; top: auto; bottom: 20vh; }
}
@keyframes lmu-sheet { from { transform: translateY(24px); opacity: .6; } }

/* 3.8 Explainer */
/* A one-paragraph reading of the data above a table (Pace tiers distribution). */
.lmu-summary { margin: 0 0 var(--s3, 12px); padding: 12px 16px; border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: var(--lmu-r-ctl); background: var(--panel); font-size: 13px; line-height: 1.5; color: var(--text-2); }
.lmu-summary b { color: var(--text-hi); }
.lmu-explain { margin: 0 0 var(--s3, 12px); }
.lmu-explain summary { display: inline-flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; color: var(--text-2); font-size: 12px; font-weight: 600; border-radius: 3px; padding: 2px 4px; }
.lmu-explain summary::-webkit-details-marker { display: none; }
.lmu-explain summary::before { content: "?"; width: 16px; height: 16px; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-3); font-size: 10px; color: var(--text-3); }
.lmu-explain[open] summary::before { background: var(--surface-3); color: var(--text-hi); }
.lmu-explain-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 10px 24px; margin: 10px 0 0; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--lmu-r-ctl); background: var(--panel); font-size: 13px; color: var(--text-2); }
.lmu-explain-body dt { font-weight: 700; color: var(--text-hi); }
.lmu-explain-body dd { margin: 2px 0 0; }
.lmu-explain-body .full { grid-column: 1 / -1; padding-top: 6px; border-top: 1px solid var(--line-2); color: var(--text-3); font-size: 12px; }

/* 3.6 Data table: scrolls sideways inside its container; the page is the only vertical scroller. Everything is scoped under .lmu-table
   (app.css styles bare table, th and td, and compare.css styles .cmp-table). */
.lmu-table { border: 1px solid var(--line-2); border-radius: var(--lmu-r-box); background: var(--panel); overflow: auto; max-width: 100%; }
.lmu-table table { width: 100%; min-width: 0; margin: 0; border-collapse: separate; border-spacing: 0; background: none; font-size: 13px; }
.lmu-table th, .lmu-table td { border: 0; font-size: 13px; }
.lmu-table thead th { position: sticky; top: 0; z-index: 2; padding: 0; background: var(--panel-2); color: var(--text-3); font-size: 11px; font-weight: 700; letter-spacing: var(--lmu-caps); text-transform: uppercase; text-align: left; border-bottom: 1px solid var(--line-3); white-space: nowrap; }
.lmu-table thead th.num { text-align: right; }
.lmu-table thead th button { width: 100%; height: var(--lmu-h-row); min-height: 0; margin: 0; padding: 0 14px; border: 0; border-radius: 0; background: none; box-shadow: none; transform: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; text-align: inherit; display: flex; align-items: center; gap: 5px; }
.lmu-table thead th.num button { justify-content: flex-end; }
.lmu-table thead th button:hover, .lmu-table thead th[aria-sort] button { color: var(--text-hi); }
.lmu-table thead .lmu-th { display: flex; align-items: center; height: var(--lmu-h-row); padding: 0 14px; }
.lmu-table thead th button .arr { width: 9px; opacity: 0; font-size: 9px; }
.lmu-table thead th[aria-sort] button .arr { opacity: 1; }
.lmu-table thead th[aria-sort="descending"] button .arr::before { content: "\25BC"; }
.lmu-table thead th[aria-sort="ascending"] button .arr::before { content: "\25B2"; }
.lmu-table tbody td, .lmu-table tbody th { height: var(--lmu-h-row); padding: 0 14px; border-bottom: 1px solid var(--line-2); background: none; color: var(--text-2); vertical-align: middle; white-space: nowrap; }
.lmu-table tbody tr:last-child :is(td, th) { border-bottom: 0; }
.lmu-table tbody tr:nth-child(even) { background: var(--v2-zebra); }
.lmu-table tbody tr:hover { background: var(--v2-hover); }
.lmu-table tbody th { text-align: left; font-weight: 650; color: var(--text-hi); min-width: 0; max-width: none; }
.lmu-table th .pos { display: inline-block; width: 22px; color: var(--text-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.lmu-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.lmu-table td.sorted { color: var(--text-hi); font-weight: 650; }
.lmu-table .up { color: var(--lmu-good); }
.lmu-table .down { color: var(--crit); }
.lmu-table .muted { color: var(--text-3); }
.lmu-table .delta { display: inline-block; min-width: 4.5em; margin-left: 8px; font-size: 11px; color: var(--text-3); }
.lmu-table .delta.neg { color: var(--warn); }
.lmu-table .delta.pos { color: var(--lmu-good); }
.lmu-table tr.is-prov :is(td, th) { color: var(--text-3); }
.lmu-table tr.is-prov th { color: var(--text-2); }
.lmu-table .tag { display: inline-block; padding: 1px 7px; border: 1px dashed var(--line-3); border-radius: var(--lmu-r-pill); font-size: 11px; font-weight: 600; color: var(--text-3); letter-spacing: .02em; }
.lmu-tfoot { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 2px 0; color: var(--text-3); font-size: 12px; }
.lmu-tfoot .sw { display: inline-flex; align-items: center; gap: 6px; }
.lmu-tfoot .up { color: var(--lmu-good); }
.lmu-tfoot .down { color: var(--crit); }
.lmu-tfoot .sw-prov { width: 18px; height: 10px; border: 1px dashed var(--line-3); border-radius: 2px; }
@media (max-width: 720px) {
    .lmu-table tbody th, .lmu-table thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--panel); box-shadow: 1px 0 0 var(--line-2); }
    .lmu-table thead th:first-child { z-index: 3; background: var(--panel-2); }
    .lmu-table tbody tr:nth-child(even) th { background: color-mix(in srgb, var(--text) 2.5%, var(--panel)); }
    .lmu-table tbody td, .lmu-table tbody th, .lmu-table thead th button, .lmu-table thead .lmu-th { padding-left: 10px; padding-right: 10px; }
}

/* 3.7 Empty, loading, error */
.lmu-state { display: grid; justify-items: center; gap: 6px; padding: 40px 16px; text-align: center; border: 1px solid var(--line-2); border-radius: var(--lmu-r-box); background: var(--panel); color: var(--text-2); }
.lmu-state b { font-weight: 650; color: var(--text-hi); }
.lmu-state p { margin: 0; max-width: 46ch; color: var(--text-3); font-size: 13px; }
.lmu-state.err { border-color: color-mix(in srgb, var(--crit) 40%, var(--line-2)); }
.lmu-skel { display: block; max-width: 100%; height: 12px; border-radius: 3px; background: linear-gradient(90deg, var(--surface-2, var(--panel-2)), var(--surface-3), var(--surface-2, var(--panel-2))); background-size: 200% 100%; animation: lmu-shimmer 1.4s linear infinite; }
@keyframes lmu-shimmer { to { background-position: -200% 0; } }

/* 3.9 Notice */
.lmu-notice { display: grid; gap: 4px; margin: 0 0 var(--s3, 12px); padding: 10px 14px; border: 1px solid var(--line-2); border-left: 3px solid var(--warn); border-radius: var(--lmu-r-ctl); background: var(--panel); font-size: 13px; color: var(--text-2); }
.lmu-notice b { color: var(--text-hi); }
.lmu-notice ul { margin: 2px 0 0; padding-left: 18px; color: var(--text-3); font-size: 12px; }
.lmu-notice ul b { color: var(--accent-soft, var(--accent)); font-weight: 600; }

/* 4.2 Results: series picker and strip; Schedule tier heading */
.lmu-picker { margin: 0 0 var(--s3, 12px); padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--lmu-r-box); background: var(--panel); }
.lmu-picker-top { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 10px; }
.lmu-picker-top .lmu-inp { margin-left: auto; width: 220px; }
.lmu-serlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 6px; }
.lmu-serlist h4 { grid-column: 1 / -1; margin: 8px 0 0; font-size: 11px; font-weight: 700; letter-spacing: var(--lmu-caps); text-transform: uppercase; color: var(--text-3); }
.lmu-ser { display: grid; gap: 2px; min-width: 0; min-height: 0; margin: 0; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--lmu-r-ctl); background: none; box-shadow: none; text-align: left; font: inherit; }
.lmu-ser b { font-size: 13px; color: var(--text-hi); }
.lmu-ser span { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lmu-ser:hover { border-color: var(--line-3); }
.lmu-ser[aria-pressed="true"] { border-color: var(--accent); background: var(--v2-wash, rgba(var(--accent-rgb), .13)); }
.lmu-strip { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; margin: 0 0 var(--s3, 12px); padding: 10px 14px; border-left: 3px solid var(--accent); border-radius: var(--lmu-r-ctl); background: var(--panel); }
.lmu-strip h2 { margin: 0; font: 600 20px/1.2 var(--v2-font-display, var(--font-display, inherit)); color: var(--text-hi); }
.lmu-strip span { color: var(--text-2); font-size: 13px; }
.lmu-tier { margin: var(--s4, 16px) 0 var(--s3, 12px); font: 600 20px/1.2 var(--v2-font-display, var(--font-display, inherit)); color: var(--text-hi); }
.lmu-tier small { margin-left: 8px; font: 500 12px/1 var(--v2-font-ui, inherit); color: var(--text-3); }
@media (max-width: 720px) { .lmu-picker-top .lmu-inp { margin-left: 0; width: 100%; } }

/* 4.4 Rank chip (a rank name that always travels with its color): Your split's answer, ladder and the Schedule card's split chip */
.rk.rk-chip { align-items: center; gap: 6px; padding: 1px 9px 1px 7px; border: 1px solid color-mix(in srgb, var(--rk) 55%, transparent); border-radius: var(--lmu-r-pill); background: color-mix(in srgb, var(--rk) 14%, transparent); color: var(--text-hi); font: 650 13px/20px var(--v2-font-ui, inherit); letter-spacing: 0; white-space: nowrap; vertical-align: middle; }
.rk.rk-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--rk); }
.rk.rk-chip[data-rank="none"] { --rk: var(--line-3); color: var(--text-3); }

/* 4.5 Schedule card: the split chip next to the picked start (links to /your-split) */
.split-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; height: 28px; padding: 0 4px 0 10px; border: 1px solid var(--line-3); border-radius: var(--lmu-r-pill); background: var(--bg-2); color: var(--text-hi); font-size: 13px; font-weight: 650; white-space: nowrap; text-decoration: none; }
.split-chip .rk.rk-chip { font-size: 12px; line-height: 18px; padding: 0 8px 0 6px; }
.split-chip .rk.rk-chip::before { width: 7px; height: 7px; }
.split-chip:hover { border-color: var(--accent); }
.split-chip:focus-visible { outline: none; box-shadow: var(--lmu-focus); }

/* 4.6 Your split (/your-split): its rules live in css/your-split.css (the redesign layer, v2.css 15). */

@media (prefers-reduced-motion: reduce) {
    .lmu-skel, .lmu-bar.is-open .lmu-bar-ctl { animation: none; }
}

/* ---- Rank up plan (/rank-up and its /account card; public/js/rank-up.js), scoped to .ru. Rank colors only inside
   named chips and rails; sign by --good / --crit with the sign printed. ---- */
.ru { --ru-good: var(--lmu-good, var(--good)); --ru-crit: var(--crit, var(--red)); min-width: 0; }
.ru :is(button, a, summary, [tabindex="0"]):focus-visible { outline: none; box-shadow: var(--lmu-focus); }
.ru .up { color: var(--ru-good); } .ru .down { color: var(--ru-crit); }
.ru-rk { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px 1px 6px; border: 1px solid color-mix(in srgb, var(--rk) 55%, transparent); border-radius: var(--lmu-r-pill); background: color-mix(in srgb, var(--rk) 14%, transparent); color: var(--text-hi); font-size: 12px; font-weight: 650; white-space: nowrap; line-height: 18px; --rk: var(--accent); }
.ru-rk::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--rk); }
.ru-rk small { font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ru-rk.lg { font-size: 15px; padding: 3px 12px 3px 9px; line-height: 22px; }
[data-rank="Bronze"]:is(.ru-rk, .rail) { --rk: var(--rank-bronze); } [data-rank="Silver"]:is(.ru-rk, .rail) { --rk: var(--rank-silver); }
[data-rank="Gold"]:is(.ru-rk, .rail) { --rk: var(--rank-gold); } [data-rank="Platinum"]:is(.ru-rk, .rail) { --rk: var(--rank-platinum); }
.ru .hero { margin: 0 0 16px; padding: 18px 20px 16px; border: 1px solid var(--line-2); border-radius: var(--lmu-r-box); background: var(--panel); }
.ru .big { margin: 0; font: 600 clamp(24px, 3.2vw, 34px)/1.15 var(--v2-font-display, inherit); color: var(--text-hi); text-wrap: balance; }
.ru .big em { font-style: normal; color: var(--accent-soft, var(--accent)); }
.ru .hero .sub { margin: 8px 0 0; color: var(--text-2); font-size: 15px; max-width: 78ch; }
.ru b { color: var(--text-hi); font-weight: 650; }
.ru .lmu-bar { position: static; }
.ru .ranks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 12px; margin: 0 0 16px; }
.ru .rank { padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--lmu-r-box); background: var(--panel); min-width: 0; display: grid; gap: 10px; }
.ru .kk { font-size: 11px; font-weight: 700; letter-spacing: var(--lmu-caps); text-transform: uppercase; color: var(--text-3); display: flex; justify-content: space-between; gap: 8px; }
.ru .now { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ru .pc { font: 600 28px/1 var(--v2-font-display, inherit); color: var(--text-hi); }
.ru .pc small { font: 600 12px/1 var(--v2-font-ui, inherit); color: var(--text-3); margin-left: 4px; }
.ru .next { margin: 0; color: var(--text-2); font-size: 13px; }
.rail { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; height: 12px; --rk: var(--accent); }
.rail i { display: block; border-radius: 2px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.rail i.on { background: var(--rk); box-shadow: none; }
.rail i.plan { background: color-mix(in srgb, var(--rk) 35%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rk) 70%, transparent); }
.ru .ends { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--text-3); margin-top: -4px; }
.ru .recent { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.ru .step { display: inline-grid; place-items: center; min-width: 26px; height: 20px; padding: 0 5px; border-radius: 4px; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text-2); }
.ru .step.up { color: var(--ru-good); } .ru .step.down { color: var(--ru-crit); } .ru .step.dnf { text-decoration: underline dotted; text-underline-offset: 3px; }
.ru .panel { margin: 0 0 16px; border: 1px solid var(--line-2); border-radius: var(--lmu-r-box); background: var(--panel); min-width: 0; }
.ru .ph { display: flex; align-items: center; justify-content: space-between; gap: 8px 18px; flex-wrap: wrap; padding: 12px 14px 10px; border-bottom: 1px solid var(--line-2); }
.ru .ph h2, .ru .fold-h { margin: 0; font: 600 20px/1.2 var(--v2-font-display, inherit); color: var(--text-hi); }
.ru .ph h2 small { margin-left: 8px; font: 500 12px/1 var(--v2-font-ui, inherit); color: var(--text-3); }
.ru .ph span, .ru .why { color: var(--text-3); font-size: 12px; }
.ru .pb { padding: 14px; }
.ru .two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; align-items: start; margin: 0 0 16px; }
.ru .two > .panel { margin: 0; }
.ru .lede { margin: 0 0 12px; color: var(--text-2); font-size: 13px; max-width: 70ch; }
.ru .races { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.race { position: relative; display: grid; gap: 8px; padding: 12px 14px 12px 16px; border: 1px solid var(--line-2); border-radius: var(--lmu-r-box); background: var(--bg-2); min-width: 0; }
.race::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--line-3); }
.race.is-done::before { background: var(--ru-good); } .race.is-next::before { background: var(--accent); }
.race .top { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: var(--lmu-caps); text-transform: uppercase; color: var(--text-3); }
.race.is-done .st { color: var(--ru-good); } .race.is-next .st { color: var(--accent-soft, var(--accent)); }
.race .when { font: 600 20px/1.15 var(--v2-font-display, inherit); color: var(--text-hi); }
.race .when small { font: 600 13px/1 var(--v2-font-ui, inherit); color: var(--text-2); margin-left: 6px; }
.race .series { color: var(--text-2); font-size: 13px; }
.race .facts { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--text-3); font-size: 12px; align-items: center; }
/* The driver's form row (#705): the Schedule card's form line rail and tint, --warn when SR is at risk. */
.race .facts.form { flex-wrap: nowrap; gap: 8px; align-items: flex-start; padding: 6px 8px; border-radius: var(--lmu-r-ctl); color: var(--text-2); background: color-mix(in srgb, var(--ru-good) 8%, transparent); }
.race .facts.form::before { content: ""; flex: none; width: 3px; align-self: stretch; border-radius: 2px; background: var(--ru-good); }
.race .facts.form.is-sr { background: color-mix(in srgb, var(--warn, #d99a2b) 8%, transparent); }
.race .facts.form.is-sr::before { background: var(--warn, #d99a2b); }
.race .worth .v .plain { font-size: 12px; font-weight: 600; color: var(--text-3); }
@media (forced-colors: active) { .race .facts.form::before { border: 1px solid CanvasText; } }
.race .worth { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); border-radius: var(--lmu-r-ctl); overflow: hidden; }
.race .worth div { background: var(--panel); padding: 6px 8px; min-width: 0; }
.race .worth .k { font-size: 10px; font-weight: 700; letter-spacing: var(--lmu-caps); text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.race .worth .v { font-size: 15px; font-weight: 650; color: var(--text-hi); font-variant-numeric: tabular-nums; }
.race .result { padding: 8px 10px; border-radius: var(--lmu-r-ctl); background: color-mix(in srgb, var(--ru-good) 10%, transparent); font-size: 13px; color: var(--text-2); }
.race .result.miss { background: none; box-shadow: inset 0 0 0 1px var(--line-2); }
.race .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--text-3); }
.ru .avoid { margin: 12px 0 0; padding: 10px 12px; border: 1px dashed var(--line-3); border-radius: var(--lmu-r-ctl); font-size: 13px; color: var(--text-2); display: grid; gap: 4px; }
.ru .habits { display: grid; gap: 10px; margin-top: 10px; }
.habit { display: grid; grid-template-columns: minmax(130px, 170px) 1fr auto; gap: 6px 12px; align-items: center; font-size: 13px; }
.habit .name { color: var(--text-hi); font-weight: 650; }
.habit small { display: block; color: var(--text-3); font-weight: 500; font-size: 12px; }
.habit .trk { position: relative; height: 14px; border-radius: 3px; background: var(--bg-2); overflow: hidden; }
.habit .trk i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); border-radius: 0 3px 3px 0; background: color-mix(in srgb, var(--accent) 75%, transparent); }
.habit .trk em { position: absolute; top: -2px; bottom: -2px; left: var(--x); width: 2px; background: var(--text-3); border-radius: 1px; }
.habit .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-hi); font-weight: 650; white-space: nowrap; }
.habit.is-top .trk i { background: color-mix(in srgb, var(--ru-crit) 70%, transparent); }
.coach { padding: 10px 12px; border-radius: var(--lmu-r-ctl); background: var(--panel-2, var(--bg-2)); border: 1px solid var(--line-2); font-size: 13px; color: var(--text-2); display: grid; gap: 6px; }
.coach .tip-big { font: 600 20px/1.2 var(--v2-font-display, inherit); color: var(--text-hi); }
.ru .key { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text-3); font-size: 12px; margin-top: 10px; }
.ru .key i { display: inline-block; width: 14px; height: 8px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.ru .sw-top { background: color-mix(in srgb, var(--ru-crit) 70%, transparent); } .ru .sw-you, .ru .sw-plan { background: var(--accent); }
.ru .sw-typ { background: color-mix(in srgb, var(--accent) 45%, transparent); } .ru .key .mk { width: 2px; height: 12px; background: var(--text-3); }
.ru-chart { width: 100%; height: auto; display: block; overflow: visible; }
.ru-chart text { fill: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.ru-chart .grid line { stroke: var(--line-2); } .ru-chart .zero { stroke: var(--line-3); }
.ru-chart .bar-up { fill: var(--ru-good); } .ru-chart .bar-down { fill: var(--ru-crit); } .ru-chart .bar-acc { fill: var(--accent); }
.ru-chart .bar-dim { fill: color-mix(in srgb, var(--accent) 45%, transparent); } .ru-chart .lbl-hi { fill: var(--text-hi); font-weight: 650; }
.ru-chart .ln { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; } .ru-chart .ln.proj { stroke-dasharray: 3 5; }
.ru-chart .band { fill: rgba(var(--accent-rgb), .14); } .ru-chart .target { fill: rgba(var(--accent-rgb), .08); }
.ru-chart .dot { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
.ru-chart .tierline { stroke: var(--rank-silver); stroke-dasharray: 2 4; } .ru-chart .tiertext { fill: var(--rank-silver); font-weight: 650; }
.ru-chart .hit { fill: transparent; outline: none; } .ru-chart .hit:focus-visible, .ru-chart .hit:hover { fill: rgba(var(--accent-rgb), .16); }
.ru-tip { position: fixed; z-index: 50; pointer-events: none; padding: 6px 9px; border: 1px solid var(--line-3); border-radius: var(--lmu-r-ctl); background: var(--panel-2, var(--panel)); color: var(--text-2); font-size: 12px; box-shadow: 0 6px 20px rgba(0, 0, 0, .5); max-width: 260px; }
.ru .twin > summary { cursor: pointer; color: var(--text-2); font-size: 12px; font-weight: 600; padding: 2px 4px; display: inline-block; margin-top: 8px; }
.ru .tbl { border: 1px solid var(--line-2); border-radius: var(--lmu-r-ctl); overflow: auto; margin-top: 8px; }
.ru .tbl table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ru .tbl th, .ru .tbl td { padding: 0 12px; height: 34px; border-bottom: 1px solid var(--line-2); text-align: left; white-space: nowrap; }
.ru .tbl thead th { color: var(--text-3); font-size: 11px; letter-spacing: var(--lmu-caps); text-transform: uppercase; }
.ru .tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.ru .sure { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 1px; background: var(--line-2); border-bottom: 1px solid var(--line-2); }
.tile { padding: 12px 14px 13px; background: var(--panel); min-width: 0; }
.tile .k { font-size: 11px; font-weight: 700; letter-spacing: var(--lmu-caps); text-transform: uppercase; color: var(--text-3); }
.tile .v { margin: 4px 0 2px; font-size: 22px; font-weight: 650; color: var(--text-hi); line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile .s { color: var(--text-3); font-size: 12px; }
.ru .limits { margin: 0; padding: 0 0 0 18px; color: var(--text-2); font-size: 13px; display: grid; gap: 5px; }
.ru .fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; padding: 12px 14px; }
.ru .fold > summary::-webkit-details-marker { display: none; }
.ru .fold > summary::after { content: "Show"; font-size: 12px; font-weight: 600; color: var(--accent-soft, var(--accent)); margin-left: auto; }
.ru .fold[open] > summary::after { content: "Hide"; } .ru .fold[open] > summary { border-bottom: 1px solid var(--line-2); }
.ru .fold-s { color: var(--text-2); font-size: 13px; }
.ru .notes { margin: 16px 2px 0; color: var(--text-3); font-size: 12px; display: grid; gap: 4px; }
.ru .guest { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 16px; }
.ru-card .rank { padding: 0; border: 0; background: none; }
.ru-card .ranks { margin: 0 0 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
@media (prefers-reduced-motion: no-preference) { .rail i { transition: background-color .12s ease; } }
@media (max-width: 720px) { .habit { grid-template-columns: 1fr auto; } .habit .trk { grid-column: 1 / -1; } .ru .fold > summary::after { width: 100%; } }
/* 4.4 When to race: its rules live in when-to-race.css (the site redesign layer). */
.lmu-table tr[aria-selected="true"] { background: var(--v2-wash, rgba(var(--accent-rgb), .13)); }

/* Shared tooltip for table headers th[data-tip] (lmu-section.js wireTips). */
th[data-tip] { cursor: help; }
.lmu-tipcell { cursor: help; display: inline-block; border-radius: 4px; }
.lmu-tipcell:focus-visible { outline: 2px solid var(--accent, #94a3b8); outline-offset: 2px; }
.lmu-tip { position: fixed; z-index: 90; max-width: min(280px, calc(100vw - 16px)); padding: 7px 10px; border: 1px solid var(--line-3); border-radius: 8px; background: var(--panel); color: var(--text); font-size: 12px; font-weight: 400; line-height: 1.4; letter-spacing: 0; text-transform: none; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); pointer-events: none; white-space: pre-line; }
.lmu-tip[hidden] { display: none; }

/* v2.css */
/* v2.css — the "timing screen" design system. Loads LAST on every page.
 *
 * Direction: a broadcast timing screen, not a web form. Neutral graphite
 * surfaces in clear steps (page < panel < raised), hairlines instead of tinted
 * outlines, one condensed display face (Saira) for labels, tabs, buttons and
 * every number, and the theme accent kept for state and the one thing to press.
 *
 * Everything is scoped so ?design=old (or localStorage stintlab.design = 'old')
 * puts html.design-old on the page and turns all of this off:
 *   - token blocks use  html:not(.design-old)          (beats [data-theme])
 *   - rules use        :where(html:not(.design-old))   (zero specificity, so
 *     source order wins and app.css state rules like .tab.active still apply)
 * Spec and class names: DESIGN-V2.md. Page files: v2-planner/-race/-dash.css.
 */

/* Saira variable (wght 100-900, wdth 50-125), SIL OFL 1.1: /fonts/saira-OFL.txt */
@font-face {
    font-family: "SL Saira";
    src: url(/fonts/saira-var.woff2) format("woff2-variations"), url(/fonts/saira-var.woff2) format("woff2");
    font-weight: 100 900;
    font-stretch: 50% 125%;
    font-style: normal;
    font-display: swap;
}

/* ======================================================================
   1. TOKENS — derived from each theme's --bg / --text / --accent
   ====================================================================== */
html:not(.design-old) {
    color-scheme: dark;

    /* Type: 5 sizes. Display face for labels, controls and numbers; the
       system face for running text. */
    --v2-font-ui: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --v2-font-display: "SL Saira", Bahnschrift, "DIN Alternate", "Arial Narrow", system-ui, sans-serif;
    --v2-font-mono: "Cascadia Mono", ui-monospace, Consolas, monospace;
    --v2-fs-xs: 11px;    /* caps labels, table headers */
    --v2-fs-sm: 13px;    /* secondary text, dense rows, segmented items */
    --v2-fs-md: 15px;    /* body, controls */
    --v2-fs-lg: 20px;    /* section headings, card values */
    --v2-fs-xl: clamp(30px, 4.2vw, 48px);  /* key race numbers */
    --v2-track-caps: .08em;

    /* Space: --s1..--s6 from app.css (4 8 12 16 24 36) plus one. */
    --s7: 48px;

    /* Radius: sharper than before; a timing screen is not a bubble UI. */
    --v2-r-sm: 3px;
    --v2-r-md: 6px;
    --v2-r-lg: 10px;
    --v2-r-pill: 999px;
    --radius: var(--v2-r-md);

    /* Control heights */
    --v2-h-sm: 30px;
    --v2-h-md: 38px;
    --v2-h-lg: 46px;

    /* Surfaces: page < inset < panel < raised < overlay, by mixing white into
       the theme's own --bg so every dark theme keeps its tint. */
    --v2-page: var(--bg);
    --v2-inset: color-mix(in srgb, #000 40%, var(--bg));
    --v2-panel: color-mix(in srgb, #fff 4.5%, var(--bg));
    --v2-raise: color-mix(in srgb, #fff 8%, var(--bg));
    --v2-overlay: color-mix(in srgb, #fff 11%, var(--bg));
    --v2-line: color-mix(in srgb, var(--text) 11%, transparent);
    --v2-line-2: color-mix(in srgb, var(--text) 19%, transparent);
    --v2-hover: color-mix(in srgb, var(--text) 6%, transparent);
    --v2-zebra: color-mix(in srgb, var(--text) 2.5%, transparent);
    --v2-wash: rgba(var(--accent-rgb), .13);
    --v2-shadow-1: inset 0 1px 0 rgba(255, 255, 255, .045), 0 1px 2px rgba(0, 0, 0, .45);
    --v2-shadow-2: inset 0 1px 0 rgba(255, 255, 255, .06), 0 14px 34px -14px rgba(0, 0, 0, .8);
    --v2-shadow-pop: 0 0 0 1px var(--v2-line-2), 0 22px 54px -14px rgba(0, 0, 0, .85);
    --v2-focus: 0 0 0 3px rgba(var(--accent-rgb), .35);

    /* Stacking: one scale. Content stays at or below --z-sticky; the header
       never sets a z-index (no stacking context), its menus use --z-dropdown. */
    --z-base: 1;
    --z-sticky: 30;
    --z-ticker: 10050;
    --z-dropdown: 10070;
    --z-toast: 10080;
    --z-dialog: 10090;

    /* Motion */
    --v2-ease: cubic-bezier(.2, .7, .2, 1);
    --v2-fast: 120ms;
    --v2-med: 200ms;

    /* The old tokens follow, so the ~5000 lines of app.css shift with us. */
    --panel: var(--v2-panel);
    --panel-2: var(--v2-raise);
    --bg-2: var(--v2-inset);
    --surface-1: var(--v2-raise);
    --surface-2: color-mix(in srgb, #fff 11%, var(--bg));
    --surface-3: color-mix(in srgb, #fff 16%, var(--bg));
    --line: var(--v2-line);
    --line-2: var(--v2-line-2);
    --line-3: color-mix(in srgb, var(--text) 28%, transparent);
    --dx-mono: var(--v2-font-display);
}

/* Daylight: white cards on a grey page, ink shadows, darker wells. */
html[data-theme="daylight"]:not(.design-old) {
    color-scheme: light;
    --v2-inset: color-mix(in srgb, #000 3%, var(--bg));
    --v2-panel: #fff;
    --v2-raise: #fff;
    --v2-overlay: #fff;
    --v2-line: color-mix(in srgb, var(--text) 14%, transparent);
    --v2-line-2: color-mix(in srgb, var(--text) 24%, transparent);
    --v2-hover: color-mix(in srgb, var(--text) 5%, transparent);
    --v2-zebra: color-mix(in srgb, var(--text) 2.5%, transparent);
    --v2-wash: rgba(var(--accent-rgb), .1);
    --v2-shadow-1: 0 1px 2px rgba(16, 32, 26, .08);
    --v2-shadow-2: 0 1px 2px rgba(16, 32, 26, .06), 0 10px 28px -14px rgba(16, 32, 26, .28);
    --v2-shadow-pop: 0 0 0 1px var(--v2-line-2), 0 18px 44px -14px rgba(16, 32, 26, .35);
    --surface-2: color-mix(in srgb, #000 4%, var(--bg));
    --surface-3: color-mix(in srgb, #000 8%, var(--bg));
}
/* Mono's page is already #000: lift the wells a touch so they still read. */
html[data-theme="mono"]:not(.design-old) { --v2-inset: #050505; }

/* ======================================================================
   2. BASE + TYPE
   ====================================================================== */
/* Paint the whole viewport, not only what the body covers; in-frame pages stay see-through. */
:where(html:not(.in-frame)) { background: var(--v2-page, var(--bg)); }
:where(html:not(.design-old)) body {
    font-family: var(--v2-font-ui);
    background: var(--v2-page);
    font-feature-settings: "kern";
}
:where(html:not(.design-old)) h1,
:where(html:not(.design-old)) h2,
:where(html:not(.design-old)) h3 {
    font-family: var(--v2-font-display);
    font-stretch: 94%;
    letter-spacing: -.005em;
    color: var(--text-hi, var(--text));
}

/* Section heading: big and mixed case. Labels below are the small caps. */
:where(html:not(.design-old)) .section h1,
:where(html:not(.design-old)) .section h2,
:where(html:not(.design-old)) .section h3,
:where(html:not(.design-old)) .plan-sec > .section:first-child h2 {
    font-size: var(--v2-fs-lg);
    font-weight: 650;
    text-transform: none;
    letter-spacing: -.005em;
    color: var(--text-hi, var(--text));
    line-height: 1.15;
}
:where(html:not(.design-old)) .section { margin: var(--s5) 0 var(--s4); }
:where(html:not(.design-old)) .section .section-note { font-size: var(--v2-fs-sm); color: var(--text-3); }

/* Caps label: field labels, table headers, card eyebrows. */
:where(html:not(.design-old)) .v2-label,
:where(html:not(.design-old)) .field > label,
:where(html:not(.design-old)) th {
    font-family: var(--v2-font-display);
    font-size: var(--v2-fs-xs);
    font-weight: 600;
    font-stretch: 92%;
    letter-spacing: var(--v2-track-caps);
    text-transform: uppercase;
    color: var(--text-3);
}
:where(html:not(.design-old)) .field .hint { font-size: 12.5px; color: var(--text-4); }

/* ======================================================================
   3. KEY NUMBERS
   ====================================================================== */
:where(html:not(.design-old)) .v2-num,
:where(html:not(.design-old)) .tk-val,
:where(html:not(.design-old)) .gmt-clock,
:where(html:not(.design-old)) .room-code,
:where(html:not(.design-old)) #lapDelta .ld-num,
:where(html:not(.design-old)) .call-word,
:where(html:not(.design-old)) .ev-val,
:where(html:not(.design-old)) .wx-v,
:where(html:not(.design-old)) .big,
:where(html:not(.design-old)) .dv-tile > b,
:where(html:not(.design-old)) .eh-cell b,
:where(html:not(.design-old)) .eh-clock b,
:where(html:not(.design-old)) .field.is-derived .value {
    font-family: var(--v2-font-display);
    font-variant-numeric: tabular-nums lining-nums;
    font-stretch: 84%;
    letter-spacing: -.01em;
}
:where(html:not(.design-old)) .v2-num,
:where(html:not(.design-old)) #lapDelta .ld-num,
:where(html:not(.design-old)) .call-word,
:where(html:not(.design-old)) .dv-tile > b { font-weight: 700; line-height: .95; }
:where(html:not(.design-old)) .v2-kpi { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
:where(html:not(.design-old)) .v2-kpi-value {
    font-family: var(--v2-font-display); font-size: var(--v2-fs-xl); font-weight: 700;
    font-stretch: 84%; line-height: .95; letter-spacing: -.015em;
    font-variant-numeric: tabular-nums lining-nums; color: var(--text-hi, var(--text));
}
:where(html:not(.design-old)) .v2-kpi-unit { font-size: .45em; font-weight: 600; color: var(--text-3); margin-left: .15em; letter-spacing: 0; }
:where(html:not(.design-old)) .field.is-derived .value { font-size: 18px; font-weight: 600; color: var(--text-hi, var(--text)); }

/* ======================================================================
   4. SURFACES
   ====================================================================== */
:where(html:not(.design-old)) .v2-card,
:where(html:not(.design-old)) .panel {
    background: var(--v2-panel);
    border: 1px solid var(--v2-line);
    border-radius: var(--v2-r-md);
    box-shadow: var(--v2-shadow-1);
}
:where(html:not(.design-old)) .v2-card { padding: var(--s4); }
:where(html:not(.design-old)) .v2-card-2 { background: var(--v2-inset); border: 1px solid var(--v2-line); border-radius: var(--v2-r-md); padding: var(--s3); }
:where(html:not(.design-old)) .v2-quiet { border-top: 1px solid var(--v2-line); padding-top: var(--s3); }
/* The one card to look at: an accent rail down its left edge. */
:where(html:not(.design-old)) .v2-rail { box-shadow: inset 3px 0 0 var(--accent), var(--v2-shadow-1); }

/* ======================================================================
   5. HEADER, NAV, THEME MENU, TICKER
   ====================================================================== */
/* The header is a full-width band, not a floating box. */
:where(html:not(.design-old)) .top-bar {
    margin: 0 0 var(--s4);
    padding: 10px 4px;
    background: var(--v2-panel);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    /* Full-bleed band + bottom hairline painted outside #app by border-image
       outset: no clip-path or transform, so the header's dropdowns are never
       clipped or trapped in a stacking context. */
    border-image: linear-gradient(to top, var(--v2-line) 1px, var(--v2-panel) 1px) fill 0 / 0 / 0 100vmax;
}
:where(html:not(.design-old)) .site-link {
    font-family: var(--v2-font-display);
    font-size: 12.5px;
    font-weight: 600;
    font-stretch: 88%;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-3);
    border-radius: var(--v2-r-sm);
    padding: 8px 8px;
}
:where(html:not(.design-old)) .site-link:hover { color: var(--text); background: var(--v2-hover); }
:where(html:not(.design-old)) .site-link.is-here { color: var(--text-hi, var(--text)); background: none; box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
/* Companion dot (site-nav.js): a 32x44 target around a 10px light, green when connected. */
.sn-comp { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 44px; border-radius: 8px; flex: none; }
.sn-comp[hidden] { display: none; }
.sn-comp:hover { background: var(--v2-hover, var(--panel-2)); }
.sn-comp:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sn-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-4); box-shadow: 0 0 0 2px var(--v2-panel, var(--panel)); }
.sn-comp.is-on .sn-dot { background: #22c55e; }

:where(html:not(.design-old)) .room-chip { background: transparent; border: 1px solid var(--v2-line); border-radius: var(--v2-r-md); }
:where(html:not(.design-old)) .room-code { color: var(--accent); font-size: 16px; font-weight: 650; letter-spacing: .06em; }
:where(html:not(.design-old)) .gmt-clock {
    background: var(--v2-inset); border: 1px solid var(--v2-line); border-radius: var(--v2-r-md);
    color: var(--text-hi, var(--text)); font-size: 15px; font-weight: 600; min-height: var(--v2-h-md);
}
:where(html:not(.design-old)) .clock-zone { border: 1px solid var(--v2-line); border-radius: var(--v2-r-md); background: var(--v2-inset); padding: 2px; gap: 2px; }
:where(html:not(.design-old)) .clock-zone button {
    background: none; border-radius: var(--v2-r-sm); color: var(--text-3);
    font: 600 12px var(--v2-font-display); letter-spacing: .06em; text-transform: uppercase;
}
:where(html:not(.design-old)) .clock-zone button[aria-pressed="true"] { background: var(--v2-overlay); color: var(--text-hi, var(--text)); box-shadow: var(--v2-shadow-1); }

:where(html:not(.design-old)) .top-btn { height: var(--v2-h-md); }
:where(html:not(.design-old)) .top-btn,
:where(html:not(.design-old)) .theme-trigger {
    min-height: var(--v2-h-md);
    background: var(--v2-raise); border: 1px solid var(--v2-line-2); border-radius: var(--v2-r-md);
    color: var(--text); font-family: var(--v2-font-display); font-size: 14px; font-weight: 600;
    box-shadow: var(--v2-shadow-1);
}
:where(html:not(.design-old)) .top-btn:hover,
:where(html:not(.design-old)) .theme-trigger:hover { background: var(--v2-overlay); border-color: var(--line-3); }

:where(html:not(.design-old)) .theme-menu {
    background: var(--v2-overlay); border: 0; border-radius: var(--v2-r-lg);
    box-shadow: var(--v2-shadow-pop); padding: 4px;
    animation: v2-pop var(--v2-med) var(--v2-ease);
}
:where(html:not(.design-old)) .theme-menu button { min-height: 34px; border-radius: var(--v2-r-sm); font-family: var(--v2-font-display); font-size: 14px; }
:where(html:not(.design-old)) .theme-menu button:hover { background: var(--v2-hover); }
:where(html:not(.design-old)) .theme-menu button.is-current { background: var(--v2-wash); }

/* ---- Top bar: one row (topbar.js builds the "more" menu) -------------
   Left: logo, nav, room chip. Right: engineer | clock | more | account.
   Controls are ghost (no box each); groups are split by hairline dividers. */
:where(html:not(.design-old)) .top-bar {
    position: relative;
    flex-direction: row; flex-wrap: nowrap; align-items: center;
    gap: var(--s4); min-height: 60px; padding-top: 8px; padding-bottom: 8px;
}
:where(html:not(.design-old)) .top-bar-left,
:where(html:not(.design-old)) .top-bar-right {
    min-height: 44px; flex-wrap: nowrap; align-items: center; width: auto;
}
:where(html:not(.design-old)) .top-bar-left { flex: 1 1 auto; min-width: 0; gap: var(--s4); }
:where(html:not(.design-old)) .top-bar-right { flex: 0 0 auto; gap: 2px; }
:where(html:not(.design-old)) .site-nav { flex: 0 0 auto; flex-wrap: nowrap; gap: 2px; }
:where(html:not(.design-old)) .top-bar-right > .clock-group,
:where(html:not(.design-old)) .top-bar-right > .tb-more,
:where(html:not(.design-old)) .top-bar-right > .user-menu {
    margin-left: var(--s2); padding-left: var(--s2); border-left: 1px solid var(--v2-line);
}
:where(html:not(.design-old)) .top-bar-right > .tb-more { margin-left: var(--s1); padding-left: var(--s1); }
:where(html:not(.design-old)) .top-bar-right > :first-child { margin-left: 0; padding-left: 0; border-left: 0; }

/* Ghost control: the shared look of every bar button. Plain prefix: it must
   beat the styles engineer-header.js injects at runtime. */
html:not(.design-old) .top-bar .room-name,
html:not(.design-old) .top-bar .split-btn,
html:not(.design-old) .room-copy-btn,
html:not(.design-old) .top-bar .eh-btn,
html:not(.design-old) .top-bar .gmt-clock,
html:not(.design-old) .tb-more-btn,
html:not(.design-old) .top-bar .user-trigger {
    min-height: 40px; height: 40px; margin: 0; padding: 0 10px;
    display: inline-flex; align-items: center; gap: 6px;
    background: transparent; border: 1px solid transparent; border-radius: var(--v2-r-md);
    box-shadow: none; color: var(--text-2);
    font-family: var(--v2-font-display); font-size: 14px; font-weight: 600;
}
html:not(.design-old) .top-bar .room-name:hover,
html:not(.design-old) .top-bar .split-btn:hover,
html:not(.design-old) .room-copy-btn:hover,
html:not(.design-old) .top-bar .eh-btn:hover,
html:not(.design-old) .top-bar .gmt-clock:hover,
html:not(.design-old) .tb-more-btn:hover,
html:not(.design-old) .top-bar .user-trigger:hover { background: var(--v2-hover); color: var(--text-hi, var(--text)); border-color: transparent; }
html:not(.design-old) .tb-more-btn[aria-expanded="true"],
html:not(.design-old) .top-bar .eh-btn[aria-expanded="true"] { background: var(--v2-hover); color: var(--text-hi, var(--text)); }

html:not(.design-old) .top-bar :is(.room-name, .split-btn, .room-copy-btn, .eh-btn, .gmt-clock, .tb-more-btn, .user-trigger):focus-visible,
html:not(.design-old) .tb-menu :is(button, a):focus-visible { outline: none; box-shadow: var(--v2-focus); border-color: var(--accent); }

/* Split view: icon + label on wide screens, icon only below 1700px (the
   button is hidden below 1100px, where split-view.js won't open it). */
html:not(.design-old) .top-bar .split-btn.is-on,
html:not(.design-old) .top-bar .split-btn[aria-pressed="true"] { color: var(--accent); background: var(--v2-wash); }
@media (min-width: 1700px) { :where(html:not(.design-old)) .top-bar .split-btn .split-label { display: inline; } }
@media (max-width: 1699px) { :where(html:not(.design-old)) .top-bar .split-btn .split-label { display: none; } }
@media (max-width: 1100px) { html:not(.design-old) .top-bar .split-btn { display: none; } }

/* Room chip: name, code, copy icon, one compact group. */
:where(html:not(.design-old)) .top-bar .room-chip {
    flex: 0 1 auto; min-width: 0; gap: 0; padding: 0 0 0 var(--s3);
    background: none; border: 0; border-left: 1px solid var(--v2-line); border-radius: 0;
}
html:not(.design-old) .top-bar .room-name { min-width: 9ch; max-width: 34ch; color: var(--text); padding-right: 6px; }
:where(html:not(.design-old)) .top-bar .room-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:where(html:not(.design-old)) .top-bar .room-name-pencil { color: var(--text-4); font-size: 12px; }
:where(html:not(.design-old)) .top-bar .room-code { padding: 0 2px 0 4px; font-size: 15px; white-space: nowrap; }
html:not(.design-old) .room-copy-btn { width: 36px; padding: 0; justify-content: center; color: var(--text-3); }
html:not(.design-old) .room-copy-btn:hover { color: var(--accent); }

/* Engineer (engineer-header.js): icon + On/Off. */
/* "Engineer: Off" in words at every width: "off" alone read as nothing. */
html:not(.design-old) .top-bar .eh-word { display: inline; }
:where(html:not(.design-old)) .eh-btn { font-size: 13px; }
html:not(.design-old) .top-bar .eh-btn.is-on { color: var(--accent); }
html:not(.design-old) .top-bar .eh-btn.is-locked { color: var(--warn); }
:where(html:not(.design-old)) .eh-panel {
    background: var(--v2-overlay); border: 0; border-radius: var(--v2-r-lg); box-shadow: var(--v2-shadow-pop);
}

/* Clock: the time, then UTC|Local, then 12H|24H, one group (the "…" menu's Clock row when the bar is crowded). */
:where(html:not(.design-old)) .clock-group { display: inline-flex; align-items: center; gap: 6px; }
:where(html:not(.design-old)) .top-bar .gmt-clock { color: var(--text-hi, var(--text)); font-size: 16px; padding: 0 8px; white-space: nowrap; }
:where(html:not(.design-old)) .clock-zone {
    display: inline-flex; flex: 0 0 auto; gap: 1px; padding: 2px;
    background: var(--v2-inset); border: 1px solid var(--v2-line); border-radius: var(--v2-r-md);
}
:where(html:not(.design-old)) .clock-zone button {
    min-height: 26px; height: 26px; margin: 0; padding: 0 7px; border: 0; box-shadow: none;
    background: none; border-radius: var(--v2-r-sm); color: var(--text-3);
    font: 600 11px var(--v2-font-display); letter-spacing: .06em; text-transform: uppercase;
}
:where(html:not(.design-old)) .clock-zone button:hover { color: var(--text); background: var(--v2-hover); }
:where(html:not(.design-old)) .clock-zone button[aria-pressed="true"] { background: var(--v2-overlay); color: var(--text-hi, var(--text)); box-shadow: var(--v2-shadow-1); }

/* More / hamburger */
:where(html:not(.design-old)) .tb-more { display: inline-flex; }
:where(html:not(.design-old)) .tb-more-btn { width: 40px; padding: 0; justify-content: center; }
:where(html:not(.design-old)) .tb-ico-burger { display: block; }
:where(html:not(.design-old)) .top-bar .user-trigger { padding: 0 8px 0 4px; }
:where(html:not(.design-old)) .top-bar .user-trigger.is-signed-in { padding: 0 4px; }

:where(html:not(.design-old)) .tb-menu {
    position: absolute; top: calc(100% + 4px); right: 0;
    width: min(300px, calc(100vw - 16px)); max-height: calc(100dvh / var(--z, 1) - 90px); overflow-y: auto;
    padding: 6px; background: var(--v2-overlay); border-radius: var(--v2-r-lg); box-shadow: var(--v2-shadow-pop);
    display: flex; flex-direction: column;
    animation: v2-pop var(--v2-med) var(--v2-ease);
}
:where(html:not(.design-old)) .tb-menu[hidden] { display: none; }
:where(html:not(.design-old)) .tb-slot { display: flex; flex-direction: column; gap: 1px; }
:where(html:not(.design-old)) .tb-slot:empty { display: none; }
:where(html:not(.design-old)) .tb-slot:not(:empty) ~ .tb-slot:not(:empty) { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--v2-line); }
/* Rows inside the menu */
:where(html:not(.design-old)) .tb-menu .top-btn,
:where(html:not(.design-old)) .tb-menu .split-btn,
:where(html:not(.design-old)) .tb-menu .theme-trigger,
:where(html:not(.design-old)) .tb-menu .site-link,
:where(html:not(.design-old)) .tb-menu .user-trigger {
    display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; min-height: 40px; margin: 0;
    padding: 0 10px; justify-content: flex-start; flex: none;
    background: none; border: 0; border-radius: var(--v2-r-sm); box-shadow: none;
    color: var(--text-2); font-family: var(--v2-font-display); font-size: 14px; font-weight: 600;
    text-transform: none; letter-spacing: 0; text-align: left;
}
:where(html:not(.design-old)) .tb-menu .top-btn:hover,
:where(html:not(.design-old)) .tb-menu .split-btn:hover,
:where(html:not(.design-old)) .tb-menu .theme-trigger:hover,
:where(html:not(.design-old)) .tb-menu .site-link:hover,
:where(html:not(.design-old)) .tb-menu .user-trigger:hover { background: var(--v2-hover); color: var(--text-hi, var(--text)); }
:where(html:not(.design-old)) .tb-menu .site-link.is-here { color: var(--text-hi, var(--text)); box-shadow: inset 3px 0 0 var(--accent); }
:where(html:not(.design-old)) .tb-menu .site-nav { flex-direction: column; align-items: stretch; }
:where(html:not(.design-old)) .tb-menu .split-btn .split-label,
:where(html:not(.design-old)) .tb-menu .theme-picker .theme-name { display: inline; }
:where(html:not(.design-old)) .tb-menu .theme-picker { display: block; }
:where(html:not(.design-old)) .tb-menu .theme-caret { margin-left: auto; }
:where(html:not(.design-old)) .tb-menu .user-menu { display: block; }
/* Sub-menus open in place inside the panel, not as a second popup. */
:where(html:not(.design-old)) .tb-menu .theme-menu,
:where(html:not(.design-old)) .tb-menu .user-dropdown {
    position: static; width: auto; min-width: 0; max-height: none; margin: 2px 0 4px;
    box-shadow: none; background: var(--v2-inset); border: 0; animation: none;
}
:where(html:not(.design-old)) .tb-menu .clock-group { flex-wrap: wrap; padding: 4px 2px; }

/* Room menu (planner): "Room ▾" beside the room chip; grouped panel under it; a full-height sheet on a phone. */
:where(html:not(.design-old)) .tb-room { display: inline-flex; flex: none; }
html:not(.design-old) .tb-room-btn {
    min-height: 40px; height: 40px; margin: 0; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px;
    background: transparent; border: 1px solid var(--v2-line); border-radius: var(--v2-r-md); box-shadow: none;
    color: var(--text-2); font: 600 14px var(--v2-font-display); white-space: nowrap; cursor: pointer;
}
html:not(.design-old) .tb-room-btn:hover,
html:not(.design-old) .tb-room-btn[aria-expanded="true"] { background: var(--v2-hover); color: var(--text-hi, var(--text)); }
html:not(.design-old) .tb-room-btn:focus-visible { outline: none; box-shadow: var(--v2-focus); border-color: var(--accent); }
:where(html:not(.design-old)) .tb-caret { font-size: 11px; color: var(--text-4); }
/* 360px: the Clock row (label, time, UTC|Local, 12H|24H) fits on one line. */
html:not(.design-old) #tbRoomMenu { right: auto; left: var(--tb-room-x, 0); width: min(360px, calc(100vw - 16px)); }
:where(html:not(.design-old)) #tbRoomMenu .tb-h {
    padding: 10px 10px 4px; color: var(--text-4); font: 600 11px var(--v2-font-display); letter-spacing: .08em; text-transform: uppercase;
}
:where(html:not(.design-old)) #tbRoomMenu .tb-h:not(:nth-child(2)) { margin-top: 6px; border-top: 1px solid var(--v2-line); padding-top: 12px; }
:where(html:not(.design-old)) #tbRoomMenu .tb-slot ~ .tb-slot { margin-top: 0; padding-top: 0; border-top: 0; }
:where(html:not(.design-old)) #tbRoomMenu .top-btn[hidden] { display: none; }
:where(html:not(.design-old)) .tb-menu .tb-sheet-head { display: none; }
:where(html:not(.design-old)) #tbRoomMenu .clock-group { padding: 0; }
:where(html:not(.design-old)) #tbRoomMenu .gmt-clock { width: auto; justify-content: flex-start; padding: 0 6px; }
/* Room name: wraps to two lines before it is cut, and the tooltip (state.js) carries the whole name. */
html:not(.design-old) .top-bar.tb-in-room .room-name { max-width: 20ch; }
:where(html:not(.design-old)) .top-bar.tb-in-room .room-name-text {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
    white-space: normal; overflow-wrap: anywhere; line-height: 1.15; text-align: left;
}
/* People is in the Room menu; the bar keeps name, code and copy. */
html:not(.design-old) .top-bar #roomPeopleBtn { display: none; }
@media (max-width: 820px) {
    /* In a room the logo shrinks to its mark: the room name needs the width more than the wordmark. */
    html:not(.design-old) .top-bar.tb-in-room .brand-logo-img { width: 22px; object-fit: cover; object-position: left center; }
    html:not(.design-old) .top-bar.tb-in-room .room-name { min-width: 0; max-width: none; font-size: 13px; }
    /* Both menus are full-height sheets on a phone (modal: topbar.js), the page behind them does not scroll. */
    html.tb-open { overflow: hidden; }
    html:not(.design-old) :is(#tbRoomMenu, #tbMenu) {
        position: fixed; inset: 0 0 0 auto; left: auto; width: min(360px, 100vw); max-height: none; height: 100dvh;
        border-radius: 0; padding: 0 8px 16px; overscroll-behavior: contain;
    }
    :where(html:not(.design-old)) .tb-menu .tb-sheet-head {
        display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 1;
        min-height: 56px; margin: 0 -8px; padding: 0 8px 0 18px; background: var(--v2-overlay); border-bottom: 1px solid var(--v2-line);
        color: var(--text-hi, var(--text)); font: 650 16px var(--v2-font-display);
    }
    html:not(.design-old) .tb-menu .tb-sheet-x {
        width: 44px; height: 44px; min-height: 44px; margin: 0; padding: 0; background: none; border: 0; box-shadow: none;
        color: var(--text-2); font-size: 26px; line-height: 1; cursor: pointer;
    }
    :where(html:not(.design-old)) #tbRoomMenu .tb-h:nth-child(2) { margin-top: 0; }
    :where(html:not(.design-old)) #tbRoomMenu .top-btn { height: 44px; min-height: 44px; }
    :where(html:not(.design-old)) #tbMenu .tb-sheet-head + .tb-slot:not(:empty) { margin-top: 6px; }
    /* Touch rows: nav, account and theme rows are 44px tall in the sheet. */
    html:not(.design-old) #tbMenu :is(.top-btn, .split-btn, .theme-trigger, .site-link, .user-trigger) { height: 44px; min-height: 44px; }
    html:not(.design-old) #tbMenu :is(.um-item, .theme-menu button) { min-height: 44px; }
    /* The bar keeps logo, name, Room, engineer, ☰; code, copy and People are in the Room sheet. */
    html:not(.design-old) .top-bar .room-code,
    html:not(.design-old) .top-bar .room-copy-btn { display: none; }
    html:not(.design-old) .tb-room-btn { padding: 0 8px; }
}

/* Phone: logo, room chip, engineer, hamburger. */
@media (max-width: 820px) {
    :where(html:not(.design-old)) .top-bar { gap: var(--s2); padding-left: 0; padding-right: 0; min-height: 56px; }
    :where(html:not(.design-old)) .top-bar-left { gap: var(--s2); }
    :where(html:not(.design-old)) .top-bar .brand-logo-img { height: 24px; }
    :where(html:not(.design-old)) .top-bar .room-chip { padding-left: var(--s2); }
    html:not(.design-old) .top-bar .room-name { max-width: 9ch; padding: 0 4px; }
    :where(html:not(.design-old)) .top-bar .room-name-pencil { display: none; }
    :where(html:not(.design-old)) .top-bar .room-code { font-size: 14px; }
    html:not(.design-old) .room-copy-btn { width: 32px; }
    html:not(.design-old) .top-bar .eh-btn { padding: 0 8px; }
    :where(html:not(.design-old)) .top-bar-right > .tb-more { border-left: 0; margin-left: 0; padding-left: 0; }
}
@media (max-width: 380px) {
    html:not(.design-old) .top-bar .room-name { display: none; }
}

/* Dash and Debrief bars: the same ghost controls and segmented presets. */
:where(html:not(.design-old)) .dx-bar,
:where(html:not(.design-old)) .db-bar { background: var(--v2-panel); border-bottom: 1px solid var(--v2-line); }
:where(html:not(.design-old)) .dx-btn {
    background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2);
    font-family: var(--v2-font-display); font-weight: 600;
}
html:not(.design-old) .dx-bar .eh-btn { border-color: transparent; font-family: var(--v2-font-display); font-weight: 600; }
html:not(.design-old) .dx-bar .eh-btn:hover { background: var(--v2-hover); }
:where(html:not(.design-old)) .dx-btn:hover { background: var(--v2-hover); color: var(--text-hi, var(--text)); border-color: transparent; }
:where(html:not(.design-old)) .dx-seg { padding: 2px; gap: 1px; background: var(--v2-inset); border: 1px solid var(--v2-line); border-radius: var(--v2-r-md); }
:where(html:not(.design-old)) .dx-seg button { border: 0; box-shadow: none; background: none; color: var(--text-3); font-family: var(--v2-font-display); font-weight: 600; border-radius: var(--v2-r-sm); }
:where(html:not(.design-old)) .dx-seg button:first-child,
:where(html:not(.design-old)) .dx-seg button:last-child { border-radius: var(--v2-r-sm); margin-left: 0; }

/* Dash on a phone: the tools are one row that scrolls sideways, so the bar
   stays short and the grid keeps its tiles. The theme menu is fixed so the
   scroller can't clip it. */
@media (max-width: 760px) {
    :where(html:not(.design-old)) .dx-tools {
        flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain;
        scrollbar-width: none; gap: 6px; padding-bottom: 2px;
    }
    :where(html:not(.design-old)) .dx-tools::-webkit-scrollbar { display: none; }
    :where(html:not(.design-old)) .dx-tools > * { flex: 0 0 auto; }
    html:not(.design-old) .dx-tools .theme-menu { position: fixed; top: 56px; right: 8px; }
}

/* Menus above everything on the page (sticky Plan tabs, ticker, plan strip);
   toasts and dialogs above menus. Plain prefix: these must beat the styles
   account.js and engineer-header.js inject at runtime. */
html:not(.design-old) .race-ticker { z-index: var(--z-ticker); }
html:not(.design-old) .plan-jump { z-index: var(--z-sticky); }
html:not(.design-old) .theme-menu,
html:not(.design-old) .user-dropdown,
html:not(.design-old) .eh-panel,
html:not(.design-old) .tb-menu { z-index: var(--z-dropdown); }
html:not(.design-old) #toast { z-index: var(--z-toast); }
html:not(.design-old) .cfm-back { z-index: var(--z-dialog); }

/* Ticker: the darkest strip on the page, values in the number face. */
:where(html:not(.design-old)) .race-ticker {
    background: var(--v2-inset);
    border-bottom: 1px solid var(--v2-line);
    box-shadow: inset 0 -1px 0 rgba(var(--accent-rgb), .25);
}
:where(html:not(.design-old)) .ticker-item { border-right-color: var(--v2-line); }
:where(html:not(.design-old)) .ticker-item .tk-label {
    font-family: var(--v2-font-display); font-size: 10.5px; font-weight: 600;
    letter-spacing: var(--v2-track-caps); color: var(--text-4);
}
:where(html:not(.design-old)) .ticker-item .tk-val { font-size: 16px; font-weight: 650; }

/* ======================================================================
   6. TABS AND SEGMENTED CONTROLS
   ====================================================================== */
/* Level 1 — Plan / Drivers / Race: big words, a 3px accent bar under the one you're on. */
:where(html:not(.design-old)) nav.tabs { border-bottom: 1px solid var(--v2-line); gap: var(--s2); }
:where(html:not(.design-old)) nav.tabs .tab {
    font-family: var(--v2-font-display); font-size: 18px; font-weight: 600; font-stretch: 94%;
    padding: 10px var(--s3) 9px; color: var(--text-3); border-radius: 0;
    transition: color var(--v2-fast) var(--v2-ease), box-shadow var(--v2-fast) var(--v2-ease);
}
:where(html:not(.design-old)) nav.tabs .tab:hover { color: var(--text); }
:where(html:not(.design-old)) nav.tabs .tab.active { color: var(--text-hi, var(--text)); background: none; box-shadow: inset 0 -3px 0 var(--accent); }

/* Level 2 — segmented control: an inset track, the selected item raised. */
:where(html:not(.design-old)) .v2-seg,
:where(html:not(.design-old)) .plan-jump,
:where(html:not(.design-old)) .subtabs {
    background: var(--v2-inset);
    border: 1px solid var(--v2-line);
    border-radius: var(--v2-r-md);
    padding: 3px;
    gap: 2px;
}
:where(html:not(.design-old)) .plan-jump { box-shadow: 0 -8px 0 var(--v2-page); }
:where(html:not(.design-old)) .v2-seg > *,
:where(html:not(.design-old)) .plan-jump a,
:where(html:not(.design-old)) .subtab {
    font-family: var(--v2-font-display); font-size: 14px; font-weight: 600; font-stretch: 94%;
    color: var(--text-3); border-radius: var(--v2-r-sm); padding: 7px 14px;
    transition: background-color var(--v2-fast) var(--v2-ease), color var(--v2-fast) var(--v2-ease);
}
:where(html:not(.design-old)) .v2-seg > *:hover,
:where(html:not(.design-old)) .plan-jump a:hover,
:where(html:not(.design-old)) .subtab:hover { color: var(--text); background: var(--v2-hover); }
:where(html:not(.design-old)) .v2-seg > .is-on,
:where(html:not(.design-old)) .v2-seg > [aria-pressed="true"],
:where(html:not(.design-old)) .plan-jump a.is-on,
:where(html:not(.design-old)) .subtab.active {
    color: var(--text-hi, var(--text));
    background: var(--v2-overlay);
    box-shadow: inset 0 -2px 0 var(--accent), var(--v2-shadow-1);
}

/* ======================================================================
   7. BUTTONS — primary / secondary (default) / ghost / danger
   ====================================================================== */
:where(html:not(.design-old)) button,
:where(html:not(.design-old)) .v2-btn {
    font-family: var(--v2-font-display);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .01em;
    min-height: var(--v2-h-md);
    border-radius: var(--v2-r-md);
    background: var(--v2-raise);
    border: 1px solid var(--v2-line-2);
    color: var(--text);
    box-shadow: var(--v2-shadow-1);
    transition: background-color var(--v2-fast) var(--v2-ease), border-color var(--v2-fast) var(--v2-ease),
        color var(--v2-fast) var(--v2-ease), transform var(--v2-fast) var(--v2-ease);
}
:where(html:not(.design-old)) button:hover,
:where(html:not(.design-old)) .v2-btn:hover { background: var(--v2-overlay); border-color: var(--line-3); color: var(--text-hi, var(--text)); }
:where(html:not(.design-old)) button:focus-visible,
:where(html:not(.design-old)) .v2-btn:focus-visible { box-shadow: var(--v2-focus); border-color: var(--accent); }

:where(html:not(.design-old)) .btn-primary,
:where(html:not(.design-old)) a.btn-primary {
    background: var(--accent); border-color: var(--accent); color: var(--ink);
    font-weight: 700; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 1px 2px rgba(0, 0, 0, .35);
}
:where(html:not(.design-old)) .btn-primary:hover,
:where(html:not(.design-old)) a.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--ink); }

:where(html:not(.design-old)) .btn-ghost,
:where(html:not(.design-old)) a.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); box-shadow: none; }
:where(html:not(.design-old)) .btn-ghost:hover,
:where(html:not(.design-old)) a.btn-ghost:hover { background: var(--v2-hover); border-color: transparent; color: var(--text-hi, var(--text)); }

:where(html:not(.design-old)) .btn-danger,
:where(html:not(.design-old)) a.btn-danger { background: transparent; color: var(--crit); border-color: color-mix(in srgb, var(--crit) 45%, transparent); box-shadow: none; }
:where(html:not(.design-old)) .btn-danger:hover,
:where(html:not(.design-old)) a.btn-danger:hover { background: var(--crit-dim); border-color: var(--crit); color: var(--crit); }

:where(html:not(.design-old)) a.btn-primary,
:where(html:not(.design-old)) a.btn-ghost,
:where(html:not(.design-old)) a.btn-danger,
:where(html:not(.design-old)) a.v2-btn { min-height: var(--v2-h-md); border-radius: var(--v2-r-md); font-family: var(--v2-font-display); font-weight: 600; }
:where(html:not(.design-old)) .v2-btn-sm { min-height: var(--v2-h-sm); font-size: var(--v2-fs-sm); padding: 0 10px; }
:where(html:not(.design-old)) .v2-btn-lg { min-height: var(--v2-h-lg); font-size: 16px; padding: 0 20px; }

/* Existing variants mapped onto the system */
:where(html:not(.design-old)) .room-copy-btn { background: var(--v2-wash); border: 1px solid rgba(var(--accent-rgb), .5); color: var(--accent); border-radius: var(--v2-r-sm); min-height: var(--v2-h-sm); box-shadow: none; }
:where(html:not(.design-old)) .btn-download {
    min-height: var(--v2-h-sm); border-radius: var(--v2-r-md); background: var(--v2-raise);
    border: 1px solid var(--v2-line-2); color: var(--text); font-family: var(--v2-font-display); font-size: 13px; font-weight: 600;
}
:where(html:not(.design-old)) .btn-download:hover { background: var(--v2-overlay); border-color: var(--line-3); }
:where(html:not(.design-old)) .section-act {
    min-height: var(--v2-h-sm); border-radius: var(--v2-r-sm); font-family: var(--v2-font-display);
    font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: var(--text-2); box-shadow: none;
}
:where(html:not(.design-old)) .section-act-primary { color: var(--accent); border-color: rgba(var(--accent-rgb), .55); background: var(--v2-wash); }

@media (pointer: coarse) {
    :where(html:not(.design-old)) button,
    :where(html:not(.design-old)) .v2-btn,
    :where(html:not(.design-old)) a.btn-primary,
    :where(html:not(.design-old)) a.btn-ghost,
    :where(html:not(.design-old)) a.btn-danger,
    :where(html:not(.design-old)) .top-btn { min-height: 44px; }
}

/* ======================================================================
   8. INPUTS AND SELECTS — inset wells
   ====================================================================== */
:where(html:not(.design-old)) input[type="text"],
:where(html:not(.design-old)) input[type="number"],
:where(html:not(.design-old)) input[type="url"],
:where(html:not(.design-old)) input[type="email"],
:where(html:not(.design-old)) input[type="search"],
:where(html:not(.design-old)) input[type="password"],
:where(html:not(.design-old)) input[type="datetime-local"],
:where(html:not(.design-old)) input[type="time"],
:where(html:not(.design-old)) input[type="date"],
:where(html:not(.design-old)) select,
:where(html:not(.design-old)) textarea {
    background: var(--v2-inset);
    border: 1px solid var(--v2-line-2);
    border-radius: var(--v2-r-md);
    color: var(--text-hi, var(--text));
    font-family: var(--v2-font-display);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    min-height: 40px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25);
    transition: border-color var(--v2-fast) var(--v2-ease), box-shadow var(--v2-fast) var(--v2-ease);
}
:where(html:not(.design-old)) input:hover:not(:disabled):not(:focus),
:where(html:not(.design-old)) select:hover:not(:disabled):not(:focus),
:where(html:not(.design-old)) textarea:hover:not(:disabled):not(:focus) { border-color: var(--line-3); }
:where(html:not(.design-old)) input:focus,
:where(html:not(.design-old)) select:focus,
:where(html:not(.design-old)) textarea:focus { border-color: var(--accent); box-shadow: var(--v2-focus); outline: none; }
:where(html:not(.design-old)) input::placeholder,
:where(html:not(.design-old)) select::placeholder,
:where(html:not(.design-old)) textarea::placeholder { color: var(--text-4); }
:where(html[data-theme="daylight"]:not(.design-old)) :is(input, select, textarea) { box-shadow: inset 0 1px 1px rgba(16, 32, 26, .06); }
:where(html:not(.design-old)) input[type="datetime-local"],
:where(html:not(.design-old)) input[type="time"],
:where(html:not(.design-old)) input[type="date"] { color-scheme: inherit; }
@media (pointer: coarse) {
    :where(html:not(.design-old)) input[type="text"],
    :where(html:not(.design-old)) input[type="number"],
    :where(html:not(.design-old)) input[type="datetime-local"],
    :where(html:not(.design-old)) select { min-height: 44px; }
}

/* ======================================================================
   9. TABLES — row lines only, caps headers, zebra + hover, numbers right
   ====================================================================== */
:where(html:not(.design-old)) .table-wrap {
    background: var(--v2-panel);
    border: 1px solid var(--v2-line);
    border-radius: var(--v2-r-md);
    box-shadow: var(--v2-shadow-1);
}
:where(html:not(.design-old)) table { background: transparent; }
:where(html:not(.design-old)) th,
:where(html:not(.design-old)) td {
    border: 0;
    border-bottom: 1px solid var(--v2-line);
    padding: 9px 12px;
}
:where(html:not(.design-old)) td { font-size: 13.5px; }
:where(html:not(.design-old)) th {
    background: var(--v2-raise);
    border-bottom-color: var(--v2-line-2);
    padding-top: 10px; padding-bottom: 10px;
    white-space: nowrap;
}
:where(html:not(.design-old)) tbody tr:last-child > td { border-bottom: 0; }
:where(html:not(.design-old) tbody tr:nth-child(even)) { background-color: var(--v2-zebra); }
:where(html:not(.design-old) tbody tr:hover) { background-color: var(--v2-hover); }
:where(html:not(.design-old)) td.num,
:where(html:not(.design-old)) th.num,
:where(html:not(.design-old)) .v2-numcol { text-align: right; font-variant-numeric: tabular-nums; }

/* ======================================================================
   10. PILLS / BADGES
   ====================================================================== */
:where(html:not(.design-old)) .v2-pill {
    display: inline-flex; align-items: center; gap: 5px;
    height: 22px; padding: 0 9px; border-radius: var(--v2-r-pill);
    font: 600 11px/1 var(--v2-font-display); letter-spacing: .06em; text-transform: uppercase;
    background: var(--v2-hover); color: var(--text-2); border: 1px solid var(--v2-line);
    white-space: nowrap;
}
:where(html:not(.design-old)) .v2-pill.is-accent { background: var(--v2-wash); color: var(--accent); border-color: rgba(var(--accent-rgb), .4); }
:where(html:not(.design-old)) .v2-pill.is-good { background: color-mix(in srgb, var(--dx-good) 14%, transparent); color: var(--dx-good); border-color: color-mix(in srgb, var(--dx-good) 40%, transparent); }
:where(html:not(.design-old)) .v2-pill.is-warn { background: var(--warn-dim); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
:where(html:not(.design-old)) .v2-pill.is-crit { background: var(--crit-dim); color: var(--crit); border-color: color-mix(in srgb, var(--crit) 40%, transparent); }
:where(html:not(.design-old)) .v2-pill.is-info { background: var(--info-dim); color: var(--info); border-color: color-mix(in srgb, var(--info) 40%, transparent); }
/* A status dot that can sit in a pill or alone. */
:where(html:not(.design-old)) .v2-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }

/* ======================================================================
   11. RACE STEPS — a sector bar: one strip, a colored bar per step
   ====================================================================== */
:where(html:not(.design-old)) .rs-row { gap: 2px; }
:where(html:not(.design-old)) .rs-step {
    border: 0; border-radius: 0;
    background: var(--v2-panel);
    box-shadow: inset 0 3px 0 var(--v2-line-2);
}
:where(html:not(.design-old)) .rs-step:first-child { border-radius: var(--v2-r-md) 0 0 var(--v2-r-md); }
:where(html:not(.design-old)) .rs-step:last-child { border-radius: 0 var(--v2-r-md) var(--v2-r-md) 0; }
:where(html:not(.design-old)) .rs-step.is-done { box-shadow: inset 0 3px 0 var(--accent); }
:where(html:not(.design-old)) .rs-step.is-need { box-shadow: inset 0 3px 0 var(--warn); }
:where(html:not(.design-old)) .rs-step.is-next { box-shadow: inset 0 3px 0 var(--accent); background: var(--v2-raise); }
:where(html:not(.design-old)) .rs-step.is-live { box-shadow: inset 0 3px 0 var(--accent); }
:where(html:not(.design-old)) .rs-go { padding: 10px var(--s3) 8px; min-height: 0; background: none; border: 0; box-shadow: none; }
:where(html:not(.design-old)) .rs-go:hover { background: var(--v2-hover); }
:where(html:not(.design-old)) .rs-label { font-family: var(--v2-font-display); font-size: 15px; font-weight: 650; }
:where(html:not(.design-old)) .rs-why { font-variant-numeric: tabular-nums; }
:where(html:not(.design-old)) .rs-mark { border-radius: var(--v2-r-sm); }

/* ======================================================================
   12. TOASTS, DIALOGS, FOOTER
   ====================================================================== */
:where(html:not(.design-old)) #toast {
    background: var(--v2-overlay);
    border-width: 1px 1px 1px 4px;
    border-radius: var(--v2-r-md);
    box-shadow: var(--v2-shadow-pop);
    font-family: var(--v2-font-display);
    font-size: 15px;
    padding: 12px 18px;
    animation: v2-rise var(--v2-med) var(--v2-ease);
}
:where(html:not(.design-old)) dialog,
:where(html:not(.design-old)) .vid-dlg {
    background: var(--v2-raise); color: var(--text);
    border: 0; border-radius: var(--v2-r-lg); box-shadow: var(--v2-shadow-pop);
}
:where(html:not(.design-old)) dialog[open] { animation: v2-pop var(--v2-med) var(--v2-ease); }
:where(html:not(.design-old)) dialog::backdrop,
:where(html:not(.design-old)) .vid-dlg::backdrop { background: rgba(0, 0, 0, .62); backdrop-filter: blur(3px); }
/* askConfirm (toast.js) injects its own <style> later, so these need weight. */
html:not(.design-old) .cfm-back { backdrop-filter: blur(3px); }
html:not(.design-old) .cfm {
    background: var(--v2-raise); border: 0; border-top: 3px solid var(--cfm-tone, var(--warn));
    border-radius: var(--v2-r-lg); box-shadow: var(--v2-shadow-pop);
    animation: v2-pop var(--v2-med) var(--v2-ease);
}
html:not(.design-old) .cfm h2 { font-size: var(--v2-fs-lg); }
html:not(.design-old) .cfm-acts button { border-radius: var(--v2-r-md); font-family: var(--v2-font-display); }

/* Sticky footer: on a short page it sits on the window's bottom edge, on a
   long one it follows the content. Only pages with a footer (not dash.html). */
:where(html:not(.design-old)) body:has(> #siteFooter) { min-height: calc(100dvh / var(--z, 1)); display: flex; flex-direction: column; }
:where(html:not(.design-old)) body:has(> #siteFooter) > #app { flex: 1 0 auto; width: 100%; }
:where(html:not(.design-old)) body > #siteFooter { margin-top: auto; }
:where(html:not(.design-old)) #siteFooter {
    background: var(--v2-inset);
    border-top: 1px solid var(--v2-line);
    color: var(--text-4);
    padding-top: var(--s4);
}
:where(html:not(.design-old)) #siteFooter .footer-links :is(a, button) {
    font-family: var(--v2-font-display); font-size: 12.5px; letter-spacing: .02em; box-shadow: none;
}

/* ======================================================================
   13. MOTION — subtle, and off for reduced motion
   ====================================================================== */
:where(html:not(.design-old)) .content.active,
:where(html:not(.design-old)) .plan-sec:not([hidden]),
:where(html:not(.design-old)) .subcontent.active {
    animation: v2-in var(--v2-med) var(--v2-ease);
}
:where(html:not(.design-old)) button:active:not(:disabled),
:where(html:not(.design-old)) .v2-btn:active:not(:disabled),
:where(html:not(.design-old)) .btn-download:active:not(:disabled) { transform: translateY(1px); }
@keyframes v2-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes v2-rise { from { opacity: 0; transform: translate(-50%, 8px); } }
@keyframes v2-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@media (prefers-reduced-motion: reduce) {
    :where(html:not(.design-old)) * { animation: none !important; transition: none !important; }
}

/* responsive: shell */
/* topbar.js adds .tb-tight when the bar is crowded above the phone width: same squeeze as the phone. */
html:not(.design-old) .top-bar.tb-tight .room-name { max-width: 9ch; padding: 0 4px; }
:where(html:not(.design-old)) .top-bar.tb-tight .room-name-pencil { display: none; }
/* Footer links: the Discord/coffee links keep app.css's size and weight; match the rest. */
html:not(.design-old) #siteFooter .footer-links :is(.discord-link, .bmc-link, .btn-ghost) { font-family: var(--v2-font-display); font-size: 12.5px; font-weight: inherit; letter-spacing: .02em; }
/* The footer rule above clears box-shadow, which is the focus ring. */
html:not(.design-old) #siteFooter .footer-links :is(a, button):focus-visible { box-shadow: var(--v2-focus); }

/* ======================================================================
   14. EXPLANATION — the one shared fold: <details class="explain"><summary>Explanation</summary>…</details>
   Closed by default; theme.js remembers it per data-explain-key on planner pages.
   ====================================================================== */
details.explain { margin: 10px 0 0; border: 1px solid var(--v2-line, var(--surface-3, #2a2f2a)); border-radius: var(--v2-r-md, 6px); background: transparent; min-width: 0; }
details.explain > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 12px; margin: 0; border: 0; background: transparent;
    font: 600 var(--v2-fs-xs, 12px)/1.3 var(--v2-font-display, inherit); letter-spacing: var(--v2-track-caps, .06em); text-transform: uppercase; color: var(--text-2, #9aa39a); }
details.explain > summary::-webkit-details-marker { display: none; }
details.explain > summary::before { content: '\25b8'; color: var(--text-4, #667); transition: transform .12s ease; }
details.explain[open] > summary::before { transform: rotate(90deg); }
details.explain > summary:hover { color: var(--text-hi, var(--text, #fff)); background: var(--v2-hover, rgba(255,255,255,.04)); }
details.explain > summary:focus-visible { outline: none; box-shadow: var(--v2-focus, 0 0 0 2px var(--accent)); }
details.explain > :not(summary) { margin-left: 14px; margin-right: 14px; color: var(--text-2, #9aa39a); font-size: var(--v2-fs-sm, 13px); line-height: 1.5; overflow-wrap: anywhere; }
details.explain > :not(summary):not(.explain-body):last-child { margin-bottom: 12px; }
details.explain > .explain-body { margin: 0; padding: 4px 14px 12px; }
details.explain ul { margin: 4px 0; padding-left: 18px; }
@media (pointer: coarse) { details.explain > summary { min-height: 44px; } }
/* Headline pattern: the action first, one fact under it. */
.do-now { font: 700 28px/1.15 var(--v2-font-display, inherit); color: var(--text-hi, var(--text, #fff)); margin: 0 0 4px; letter-spacing: .01em; }
.do-now.is-urgent { color: var(--crit, #ff5a4f); }
.do-why { color: var(--text-2, #9aa39a); font-size: 14px; margin: 0 0 6px; }
/* "…" menu: the clock group as one labeled Clock row. The group never splits; short of room it wraps under its label. */
:where(html:not(.design-old)) .tb-menu .tb-zone { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; padding: 0 10px; color: var(--text-2); font: 600 14px var(--v2-font-display); }
:where(html:not(.design-old)) .tb-menu .tb-zone[hidden] { display: none; }
:where(html:not(.design-old)) .tb-menu .tb-clock-row { flex-wrap: wrap; row-gap: 4px; padding: 4px 10px; }
:where(html:not(.design-old)) .tb-menu .tb-clock-row > .tb-slot-time { flex-direction: row; margin-left: auto; min-width: 0; max-width: 100%; }
:where(html:not(.design-old)) .tb-menu .tb-clock-row .clock-group { flex-wrap: nowrap; padding: 0; gap: 6px; }
@media (max-width: 820px) { :where(html:not(.design-old)) .tb-menu .tb-clock-row > .tb-slot-time { margin-left: 0; } }
/* Lobby: the pitch is for newcomers; signed in, it is just the logo and your rooms (account.js sets the class). */
#lobby.is-signed-in :is(.lobby-badge, .lobby-headline, .lobby-lede, .lobby-points) { display: none; }
#lobby.is-signed-in .lobby-wrap { grid-template-columns: minmax(0, 440px); justify-content: center; gap: var(--s4); }
#lobby.is-signed-in .lobby-logo { margin: 0 auto; }
/* The card fills the 440px column, so it shares the logo's center (its 360px cap left it 40px to the left). */
#lobby.is-signed-in .lobby-card { max-width: none; }
#lobby.is-signed-in :is(.lobby-card-title, .lobby-aside) { display: none; }
#lobby:not(.is-signed-in) .lobby-quick { display: none; }
/* The demo race: a button for newcomers; signed in it is a Live demo link in .lobby-quick. */
.lobby-demo { display: flex; align-items: center; justify-content: center; margin-top: var(--s2); text-decoration: none; box-sizing: border-box; }
.lobby-demo-note { margin: var(--s2) 0 0; font-size: 13px; color: var(--text-3); text-align: center; }
.lobby-racefor { display: flex; align-items: center; gap: 8px; margin: 0 0 var(--s2); font-size: 13px; color: var(--text-3); }
.lobby-racefor[hidden] { display: none; }
.lobby-racefor select { flex: 1; min-width: 0; }
#lobby.is-signed-in :is(.lobby-demo, .lobby-demo-note) { display: none; }
/* The public demo room's banner, on the planner and the Race view (js/demo-banner.js). */
.demo-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 16px; border-bottom: 1px solid var(--accent);
    background: var(--accent-deep, var(--bg-2)); color: var(--text-hi, var(--text)); font-size: 14px; }
.demo-banner[hidden] { display: none; }
.demo-banner a { color: var(--accent); font-weight: 600; }
.demo-banner .demo-ro-note { color: var(--text-2, inherit); }
.archived-banner .archived-err { color: var(--danger, #f87171); }
.archived-banner .archived-err:empty { display: none; }
/* Read only (read-only-room.js, the demo room): fields readOnly, write controls aria-disabled. Dimmed and dashed, still
 * focusable with the normal focus ring, so a keyboard user can Tab through and read everything. */
.demo-ro [data-ro] { opacity: .6; border-style: dashed !important; cursor: not-allowed; }
.demo-ro [data-ro="text"] { opacity: .75; cursor: text; }
.demo-ro [data-ro]:focus-visible { opacity: 1; outline: 2px solid var(--accent); outline-offset: 2px; }
.demo-banner .demo-ro-lock { font-size: 15px; }
.plan-locked-badge.is-ro { background: transparent; color: var(--text-2, inherit); border: 1px dashed var(--line, currentColor); }
.demo-banner button { margin: 0 0 0 auto; min-height: 36px; padding: 0 14px; border: 0; border-radius: 8px;
    background: var(--accent); color: var(--ink); font-weight: 700; cursor: pointer; }
.lobby-greet { margin: 0 0 var(--s3); font: 650 22px/1.2 var(--v2-font-display, inherit); color: var(--text-hi, var(--text)); }
#lobby:not(.is-signed-in) .lobby-greet { font-size: 16px; color: var(--text-2); }
.lobby-rejoin { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 var(--s3); min-height: 44px; padding: 0 14px;
    background: var(--accent-deep, transparent); border: 1px solid var(--accent); border-radius: var(--v2-r-md, 8px);
    color: var(--accent); font: 700 15px var(--v2-font-display, inherit); text-align: left; cursor: pointer; }
.lobby-rejoin[hidden] { display: none; }
.lobby-rejoin::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.lobby-quick { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s2) 0 0; }
.lobby-quick a { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 12px;
    border: 1px solid var(--line-2); border-radius: var(--v2-r-md, 8px); color: var(--text-2); font-size: 14px; text-decoration: none; }
.lobby-quick a:hover, .lobby-quick a:focus-visible { border-color: var(--accent); color: var(--text-hi, var(--text)); }
.lobby-rooms .lr-live { margin-left: auto; color: var(--accent); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.lobby-companion { display: flex; align-items: center; gap: 8px; margin: var(--s3) 0 0; color: var(--text-3); font-size: 13px; }
.lobby-companion[hidden] { display: none; }
.lobby-companion .lc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
#lobby .lobby-btn-secondary { margin: 0; }   /* the global button margin-right left Join short of the card edge */
.lobby-colors { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); }
.lobby-colors > span { color: var(--text-3); font-size: 12px; }
.lobby-swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.lobby-swatches .sw { width: 22px; height: 22px; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
    box-shadow: 0 0 0 1px rgba(128, 128, 128, .45) inset; }
.lobby-swatches .sw[aria-checked="true"] { box-shadow: 0 0 0 2px var(--bg, #000), 0 0 0 4px var(--accent); }
.lobby-swatches .sw:focus-visible { outline: 2px solid var(--text-hi, #fff); outline-offset: 3px; }
@media (pointer: coarse) { .lobby-swatches { gap: 10px; } .lobby-swatches .sw { width: 30px; height: 30px; } }

/* Companion download (lobby button, planner bar button and menu item): not useful inside the Windows app or on a phone. */
.lobby-dl { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: var(--s2); text-decoration: none; box-sizing: border-box; }
.lobby-dl-hint { margin-top: 6px; }
html:not(.design-old) .top-bar .tb-dl { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px; border-radius: var(--v2-r-md); color: var(--text-2);
    font: 600 14px var(--v2-font-display); text-decoration: none; white-space: nowrap; }
html:not(.design-old) .top-bar .tb-dl:hover, html:not(.design-old) .top-bar .tb-dl:focus-visible { background: var(--v2-hover); color: var(--text-hi, var(--text)); }
html:not(.design-old) .top-bar.tb-phone .tb-dl,
html:not(.design-old) .top-bar.tb-fold .tb-dl { display: none; }   /* folded: the "..." menu item takes over */
@media (max-width: 1280px) { .tb-dl-label { display: none; } }
html.no-dl [data-companion-dl] { display: none !important; }
@media (max-width: 559px), (pointer: coarse) and (max-width: 900px) { [data-companion-dl] { display: none !important; } }

/* Lobby: the header row every page has (logo and page links), pinned to the top of the landing. */
#lobby { padding-top: 64px; box-sizing: border-box; }
#lobby .lobby-top.top-bar { position: absolute; top: 0; left: 0; right: 0; margin: 0; padding-left: 28px; padding-right: 28px; box-sizing: border-box; }
#lobby .lobby-wrap:focus { outline: none; }
@media (max-width: 820px) { #lobby { padding-top: 0; flex-direction: column; justify-content: flex-start !important; } #lobby .lobby-top.top-bar { position: relative; flex: none; align-self: stretch; padding-left: 16px; padding-right: 16px; } }
/* The demo tour (demo-banner.js): five steps under the banner, from the pit call to Start your own room. */
.demo-tour { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding: 12px 16px; background: var(--bg-2);
    border-bottom: 1px solid var(--line-2); }
.demo-tour[hidden] { display: none; }
.dt-dots { display: flex; gap: 6px; flex: none; }
.dt-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.dt-dots .past { background: var(--accent-deep, var(--text-3)); outline: 1px solid var(--accent); }
.dt-dots .on { width: 22px; border-radius: 4px; background: var(--accent); }
.dt-body { flex: 1 1 320px; min-width: 0; }
.dt-step { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.demo-tour .dt-title { margin: 2px 0 2px; padding: 0; border: 0; font: 700 17px/1.25 var(--v2-font-display, inherit); color: var(--text-hi, var(--text)); }
.dt-text { margin: 0; font-size: 14px; line-height: 1.45; color: var(--text-2, var(--text)); max-width: 70ch; }
.dt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dt-actions button { min-height: 38px; padding: 0 16px; border-radius: 8px; font-weight: 700; cursor: pointer;
    border: 1px solid var(--line-2); background: transparent; color: var(--text-hi, var(--text)); }
.dt-actions :is(.dt-next, .dt-go) { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.dt-actions .dt-close { min-width: 38px; padding: 0; font-size: 20px; line-height: 1; }
.dt-alt { font-size: 13px; color: var(--accent); }
.demo-banner .demo-tour-open { background: transparent; color: var(--accent); border: 1px solid var(--accent); margin-left: auto; }
.demo-banner .demo-tour-open + button { margin-left: 0; }
.demo-tour-open[hidden] { display: none; }
.tab.dt-spot { outline: 2px solid var(--accent); outline-offset: -3px; border-radius: 6px; animation: dtPulse 1s ease-in-out 3 alternate; }
@keyframes dtPulse { to { outline-color: transparent; } }
@media (prefers-reduced-motion: reduce) { .tab.dt-spot { animation: none; } }
/* Phones: the tour is a sheet at the bottom and the banner one short line, so the race itself fills the first screen. */
@media (max-width: 600px) {
    .demo-tour { position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 950; gap: 8px; padding: 12px 14px;
        border: 1px solid var(--accent); border-radius: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, .35); }
    .dt-dots { order: 0; }
    .dt-body { flex-basis: 100%; }
    .dt-text { font-size: 13.5px; }
    .dt-actions { width: 100%; }
    .dt-actions :is(.dt-next, .dt-go) { flex: 1; }
    .dt-alt { flex-basis: 100%; text-align: center; }
    .demo-banner { padding: 6px 12px; gap: 6px 10px; font-size: 13px; }
    .demo-banner .demo-ro-note, .demo-banner [data-demo-race] { display: none; }
    .demo-banner button { min-height: 32px; padding: 0 10px; }
    html:has(.demo-tour:not([hidden])) body { padding-bottom: 210px; }
}
/* The signed-in lobby with no rooms yet (account.js paintLobby): three first steps. */
.lobby-first { list-style: none; counter-reset: lf; display: grid; gap: 8px; margin: 8px 0 10px; padding: 0; text-align: left; }
.lobby-first li { counter-increment: lf; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; grid-template-rows: auto auto;
    align-items: center; gap: 2px 12px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg); }
.lobby-first li::before { content: counter(lf); grid-row: 1 / 3; display: grid; place-items: center; width: 30px; height: 30px;
    border-radius: 50%; border: 2px solid var(--accent); color: var(--accent); font-weight: 800; }
.lobby-first b { color: var(--text-hi, var(--text)); font-size: 15px; }
.lobby-first span { grid-column: 2; font-size: 13px; line-height: 1.4; color: var(--text-3); }
.lobby-first :is(a, button) { grid-column: 3; grid-row: 1 / 3; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px;
    border-radius: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--text-hi, var(--text));
    font: 700 13.5px var(--v2-font-display, inherit); text-decoration: none; cursor: pointer; white-space: nowrap; min-width: 112px; justify-content: center; box-sizing: border-box; }
.lobby-first li:first-child :is(a, button) { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.lobby-first :is(a, button):hover { border-color: var(--accent); }
@media (max-width: 420px) { .lobby-first li { grid-template-columns: 30px minmax(0, 1fr); }
    .lobby-first :is(a, button) { grid-column: 2; grid-row: auto; justify-self: start; margin-top: 6px; } }
#lobby.is-first-run .lobby-dl { display: none; }
/* The signed-out lobby (index.html): what setup asks, as a numbered track; the demo is the second choice, not a twin of Create. */
.lobby-next { list-style: none; counter-reset: ln; position: relative; display: grid; gap: 14px; margin: var(--s4) 0 0; padding: 0; }
.lobby-next::before { content: ""; position: absolute; left: 13px; top: 14px; bottom: 14px; width: 2px; background: var(--line-2); }
.lobby-next li { counter-increment: ln; position: relative; display: grid; gap: 2px; padding-left: 42px; }
.lobby-next li::before { content: counter(ln); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 28px; height: 28px;
    border-radius: 50%; background: var(--bg-2); border: 2px solid var(--accent); color: var(--accent); font-weight: 800; font-size: 13px; box-sizing: border-box; }
.lobby-next li:last-child::before { background: var(--accent); color: var(--ink); }
.lobby-next b { color: var(--text-hi, var(--text)); font-size: 15px; }
.lobby-next span { color: var(--text-3); font-size: 13.5px; line-height: 1.45; }
#lobby.is-signed-in .lobby-next { display: none; }
#lobby:not(.is-signed-in) .lobby-demo { background: transparent; color: var(--text-hi, var(--text)); border: 1px solid var(--line-2); }
#lobby:not(.is-signed-in) .lobby-demo:hover { border-color: var(--accent); }
@media (max-width: 900px) {
    #lobby:not(.is-signed-in) .lobby-card { order: -1; }
    #lobby:not(.is-signed-in) :is(.lobby-logo, .lobby-badge) { display: none; }
    .lobby-headline { font-size: 22px; }
}
/* The guide's Start here paths (guide.html .gd-paths): three common goals, three links each, one action. */
.gd-paths { margin: 0 0 24px; }
.gd-paths > ul { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; }
.gd-paths > ul > li { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); }
.gd-paths .gd-path-t { margin: 0; padding: 0; border: 0; font-size: 1.05rem; color: var(--text-hi, var(--text)); }
.gd-paths li p { margin: 0; color: var(--text-3); font-size: .9rem; }
.gd-paths ol { margin: 4px 0 8px; padding-left: 18px; display: grid; gap: 4px; flex: 1; align-content: start; font-size: .92rem; line-height: 1.35; }
.gd-paths ol a { color: var(--accent); }
.gd-path-go { align-self: flex-start; display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 8px;
    border: 1px solid var(--accent); color: var(--accent); font-weight: 700; text-decoration: none; white-space: nowrap; }
.gd-path-go:hover { background: var(--accent); color: var(--ink); }
@media (max-width: 720px) { .gd-paths > ul { grid-template-columns: minmax(0, 1fr); } .gd-path-go { min-height: 44px; } }
/* What's new search (js/changelog-find.js). */
.cl-find { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; max-width: 760px; margin: 14px 0 20px; padding: 10px 12px;
    border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); }
.cl-find label { font-weight: 700; color: var(--text-hi, var(--text)); }
.cl-find input { flex: 1 1 240px; min-width: 0; min-height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text-hi, var(--text)); font-size: 15px; }
.cl-find input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cl-find-n { color: var(--accent); font-weight: 700; font-size: 14px; }
details.cl[hidden] { display: none; }
details.cl.cl-only-hits li:not(.cl-hit):not(:has(.cl-hit)) { display: none; }
details.cl li.cl-hit { background: var(--accent-deep, transparent); box-shadow: inset 3px 0 0 var(--accent); border-radius: 4px; padding-left: 6px; }
/* Signed-in lobby rooms as cards (account.js paintLobby). */
#lobby .lobby-rooms .lr-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 10px 12px; margin-bottom: 8px; border-radius: 10px; }
#lobby .lobby-rooms .lr-t { grid-column: 1; font-size: 15px; font-weight: 700; color: var(--text-hi, var(--text)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#lobby .lobby-rooms .lr-m { grid-column: 1; font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#lobby .lobby-rooms .lr-chip { grid-column: 2; grid-row: 1 / 3; margin: 0; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-3);
    font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
#lobby .lobby-rooms .lr-chip.lr-live { border-color: var(--accent); background: var(--accent); color: var(--ink); }
#lobby .lobby-rooms .lr-chip.lr-soon { border-color: var(--accent); color: var(--accent); }
#lobby .lobby-auth:has(.lobby-rooms) { margin-top: 14px; padding-top: 12px; }
/* Past races (account.js sectionsHtml, ROOM_ARCHIVE) */
#lobby .lobby-past > summary { cursor: pointer; }
#lobby .lobby-rooms .lr-past .lr-card { margin-bottom: 2px; }
#lobby .lobby-rooms .lr-acts { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin: 0 0 10px; padding: 0 12px; font-size: 12.5px; color: var(--text-3); }
#lobby .lobby-rooms .lr-acts a, #lobby .lobby-rooms .lr-acts button { color: var(--accent); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
#lobby .lobby-rooms .lr-acts button { margin-left: auto; }

/* One state card for the My pages (calendar, recent races, fuel analysis): signed out, empty, error, loading. */
.state-card { margin: var(--s4) 0; padding: var(--s5) var(--s4); text-align: center; border: 1px dashed var(--line-3, var(--line-2)); border-radius: var(--radius); background: var(--panel); }
.state-card h2 { margin: 0 0 6px; padding: 0; border: 0; font-size: var(--fs-lead, 15px); color: var(--text-hi, var(--text)); }
.state-card p { margin: 0 auto; max-width: 46ch; color: var(--text-3); }
.state-card ul { list-style: none; margin: 10px auto 0; padding: 0; display: grid; gap: 4px; max-width: 46ch; font-size: var(--fs-small); color: var(--text-2); }
.state-card .state-act { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 14px; margin-top: var(--s4); }
.state-card .state-act .btn-primary, .state-card .state-act .btn-ghost { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
.state-card .state-act a:not(.btn-primary):not(.btn-ghost) { color: var(--accent); font-size: var(--fs-small); }
.state-card.is-error { border-color: var(--crit); }
.state-card[aria-busy="true"] { border-style: solid; color: var(--text-3); }

/* ======================================================================
   15. PAGE LAYOUT: width tiers, gutters, the 12 column grid, rails, card grids, priority columns (site redesign, #744)
   Source: StintLabs-research/feature-demos/site-redesign/_system/system.css. Pages opt in with <main class="sl-page">
   (Standard tier, 2800 cap) or .sl-page.read (Read tier, 1100); a page without it looks as it did.
   Media queries use the window width (the html zoom does not change them): 760 phone, 1100, 1500 desktop,
   1800 wide (the mockups' 2000 tier, moved so a 1920 screen gets it).
   ====================================================================== */
:root {
    --rank-bronze: #cd8a4e; --rank-silver: #c3cbd6; --rank-gold: #e6b93d; --rank-platinum: #7fd4e6;
    --cls-hyper: #e5484d; --cls-lmp2: #3e8ef7; --cls-lmp3: #a66cff; --cls-gt3: #f2a33a; --cls-gte: #e05fa8;
    --sl-gutter: clamp(10px, 2.4vw - 14px, 36px);   /* 10 on phone and tablet, 22 in a 1400 window, 36 from 1920 */
    --sl-gap: 12px; --sl-prose: 72ch; --sl-w-read: 1100px; --sl-w-std: 2800px; --sl-rail: 320px;
}
[data-theme="daylight"] {
    --rank-bronze: #98602a; --rank-silver: #6b7885; --rank-gold: #a87a00; --rank-platinum: #1f8a82;
    --cls-gt3: #c97a10; --cls-lmp3: #7f45d6;
}
.sl-page {
    --good: var(--dx-good, #4ade80); --purple: #c084fc; --team: #3e8ef7;
    --fs-micro: 11px; --fs-small: 12px; --fs-sm: 13px; --fs-body: 14px; --fs-md: 15px; --fs-title: 26px;
    --r-md: 6px; --r-lg: 10px; --r-pill: 999px; --h-sm: 28px; --h-md: 36px; --h-lg: 44px; --caps: .08em;
    --sl-ui: var(--v2-font-ui, system-ui, sans-serif); --sl-display: var(--v2-font-display, Bahnschrift, "Arial Narrow", system-ui, sans-serif);
    --font-ui: var(--sl-ui); --font-display: var(--sl-display); --fs-lg: 20px;
    --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 36px; --r-sm: 3px; --topbar: 0px;
    --sl-top: calc(var(--lmu-top, 0px) + 12px);     /* sticky rails pin under the bar (the top bar scrolls away on section pages) */
}
[data-theme="daylight"] .sl-page { --good: #0b7a3d; --purple: #7a2fc0; --team: #1f5fb0; }
/* The opted-in page drops the shell caps: #app (1400, 1800), .lmu-page (1300). */
#app:has(.sl-page) { max-width: none; padding: 0; }
.sl-page, .lmu-page.sl-page { max-width: var(--sl-w-std); margin: 0 auto; padding: var(--sl-gap) var(--sl-gutter) 40px; min-width: 0; box-sizing: border-box; }
.sl-page.read { max-width: var(--sl-w-read); }
.sl-prose { max-width: var(--sl-prose); }
.sl-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--sl-gap); align-items: stretch; }
.sl-grid > .c3 { grid-column: span 3; } .sl-grid > .c4 { grid-column: span 4; } .sl-grid > .c5 { grid-column: span 5; } .sl-grid > .c6 { grid-column: span 6; }
.sl-grid > .c7 { grid-column: span 7; } .sl-grid > .c8 { grid-column: span 8; } .sl-grid > .c9 { grid-column: span 9; } .sl-grid > .c12 { grid-column: span 12; }
.sl-rail-layout { display: grid; gap: var(--sl-gap); grid-template-columns: minmax(0, 1fr); align-items: start; }
.sl-rail-layout > * { min-width: 0; }
.sl-main, .sl-rail { display: grid; gap: var(--sl-gap); min-width: 0; align-content: start; }
.sl-cards { display: grid; gap: var(--sl-gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--sl-card, 340px)), 1fr)); }
.sl-cards.fit { grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--sl-card, 340px)), 1fr)); }
.sl-page [data-pri="2"], .sl-page [data-pri="3"], .sl-page [data-pri="4"] { display: none; }
.sl-page .only-wide { display: none; }   /* before the 1800 rule on purpose: the later rule must win */
@media (max-width: 760px) {
    .sl-grid > :is(.c3, .c4, .c5, .c6, .c7, .c8, .c9) { grid-column: span 12; }
    .sl-page, .lmu-page.sl-page { padding-inline: 10px; }
}
@media (min-width: 761px) and (max-width: 1499px) {
    .sl-grid > :is(.c3, .c4, .c5, .c6, .c7, .c8, .c9) { grid-column: span 6; }
    .sl-grid > .t12 { grid-column: span 12; }
    /* a rail stacked under the main column shows its cards as a row (.sl-rail.wrap) */
    .sl-rail.wrap { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
}
@media (min-width: 1100px) { .sl-page :is(th, td)[data-pri="2"] { display: table-cell; } }
@media (min-width: 1500px) {
    .sl-rail-layout { grid-template-columns: minmax(0, 1fr) var(--sl-rail); }
    .sl-rail-layout.left { grid-template-columns: var(--sl-rail) minmax(0, 1fr); }
    .sl-rail { position: sticky; top: var(--sl-top); max-height: calc(100vh - var(--sl-top) - 12px); overflow-y: auto; scrollbar-width: thin; }
    .sl-page :is(th, td)[data-pri="3"] { display: table-cell; }
}
@media (min-width: 1800px) {
    :root { --sl-rail: 360px; --sl-gap: 14px; }
    .sl-rail-layout.both { grid-template-columns: 260px minmax(0, 1fr) var(--sl-rail); }
    .sl-page :is(th, td)[data-pri="4"] { display: table-cell; }
    .sl-page .only-wide { display: revert; }
    .sl-page .sl-rail.only-wide { display: grid; }
}
@media (max-width: 1499px) { .sl-rail-layout.left > .sl-rail { order: -1; } }

/* ======================================================================
   16. PAGE COMPONENTS AND THE COLOR PASS (opted-in pages only: everything sits under .sl-page)
   Header band, tabs, filter bar and its fold, cards, rows, explainer, buttons, chips, tags, rank chips
   and rails (LMU data-rank, StintLab data-tier), class color, tables (priority columns, sort buttons, selected rows),
   number tiles, bars, steps, the answer, empty states, team bits, the series list, the strip, motion.
   ====================================================================== */
/* header band: eyebrow with a rule, h1, one sub line, the right side for numbers or two buttons; speed lines + circuit motif */
.sl-page .sl-head { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 24px; align-items: end; padding: 10px 14px 12px; border-radius: var(--r-lg); margin: 0 0 var(--sl-gap); isolation: isolate; }
.sl-page .sl-head::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
    background: linear-gradient(90deg, rgba(var(--accent-rgb), .14), rgba(var(--accent-rgb), .04) 40%, transparent 70%),
        repeating-linear-gradient(-24deg, transparent 0 18px, rgba(var(--accent-rgb), .07) 18px 19px);
    mask-image: linear-gradient(90deg, #000 30%, transparent 95%); -webkit-mask-image: linear-gradient(90deg, #000 30%, transparent 95%); }
.sl-page .sl-head .eb { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin: 0; font: 700 var(--fs-micro) var(--sl-display); letter-spacing: var(--caps); text-transform: uppercase; color: var(--text-3); }
.sl-page .sl-head .eb::after { content: ""; flex: 1; height: 1px; background: var(--v2-line); }
.sl-page .sl-head h1 { margin: 0; font: 600 var(--fs-title)/1.1 var(--sl-display); color: var(--text-hi); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; text-wrap: balance; }
.sl-page .sl-head .sub { margin: 2px 0 0; max-width: 62ch; color: var(--text-2); font-size: var(--fs-body); }
.sl-page .sl-head .right { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; justify-content: flex-end; color: var(--text-3); font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
.sl-page .sl-head .right .lmu-stats { white-space: normal; }
.sl-page .sl-head .track { display: block; position: absolute; left: 52%; top: -20px; height: 84px; width: 260px; z-index: -1; opacity: .28; color: var(--accent); pointer-events: none; }
@media (max-width: 1100px) { .sl-page .sl-head .track { display: none; } }
@media (max-width: 760px) { .sl-page .sl-head { grid-template-columns: minmax(0, 1fr); } .sl-page .sl-head .right { justify-content: flex-start; } }

/* section tabs, the second level tab row, the sticky filter bar and its fold */
.sl-page .tabs { position: relative; display: flex; gap: 2px; margin: 0 0 var(--sl-gap); border-bottom: 1px solid var(--v2-line); overflow-x: auto; scrollbar-width: none; }
.sl-page .tabs::-webkit-scrollbar { display: none; }
.sl-page .tabs :is(a, button) { flex: none; padding: 8px 14px 9px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-3); font: 650 13px var(--sl-ui); white-space: nowrap; text-decoration: none; }
.sl-page .tabs button { height: auto; min-height: 0; margin: 0 0 -1px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; box-shadow: none; cursor: pointer; }
.sl-page .tabs :is(a, button):hover { color: var(--text-hi); }
.sl-page .tabs :is(a, button):is([aria-current], [aria-selected="true"]) { color: var(--text-hi); border-bottom-color: var(--accent); }
.sl-page .sl-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 var(--sl-gap); }
.sl-page .sl-sub > p { margin: 0; color: var(--text-3); font-size: var(--fs-small); }
.sl-page .bar { position: sticky; top: var(--lmu-top, 0px); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 0 0 var(--sl-gap); padding: 9px 14px; border: 1px solid var(--v2-line); border-radius: var(--r-lg); background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(8px); }
.sl-page .bar.static { position: static; }
.sl-page .bar .l { font: 700 var(--fs-micro) var(--sl-display); letter-spacing: var(--caps); text-transform: uppercase; color: var(--text-3); margin-right: -8px; }
.sl-page :is(.bar, .strip) .end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sl-page .sl-fold { display: none; }       /* the folded bar under 760: <div class="sl-fold"><span class="sum">…</span><button>Filters</button></div> */
/* or: <span class="fold-sum"><span>…</span><button>Filters</button></span> and .fold groups the page opens */
.sl-page .bar .fold-sum { display: none; align-items: center; gap: 8px; width: 100%; min-width: 0; justify-content: space-between; color: var(--text-2); font-size: 13px; }
.sl-page .bar .fold-sum > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
    .sl-page .sl-fold { display: flex; align-items: center; gap: 8px; width: 100%; }
    .sl-page .sl-fold .sum { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-size: var(--fs-small); }
    .sl-page .bar.folded > :not(.sl-fold) { display: none; }
    .sl-page .bar .fold-sum { display: flex; }
    .sl-page .bar .fold { display: none; }
}
.sl-page .seg { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--v2-line); border-radius: var(--r-pill); background: var(--bg-2); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.sl-page .seg > * { flex: none; height: 24px; min-height: 0; margin: 0; padding: 0 11px; border: 0; border-radius: var(--r-pill); background: none; box-shadow: none; color: var(--text-2); font: 600 12px/24px var(--sl-ui); white-space: nowrap; }
.sl-page .seg > :is(.on, [aria-pressed="true"], [aria-selected="true"], [aria-current]) { background: var(--surface-3); color: var(--text-hi); }

/* card anatomy: .lift for the hover lift (cards that are or hold links), .hero for the page's one primary card */
.sl-page .card { position: relative; background: linear-gradient(180deg, color-mix(in srgb, #fff 2.5%, var(--v2-panel)), var(--v2-panel)); border: 1px solid var(--v2-line); border-radius: var(--r-lg); box-shadow: var(--v2-shadow-1); min-width: 0; padding: 10px 12px 12px; display: flex; flex-direction: column; transition: transform var(--v2-med) var(--v2-ease), box-shadow var(--v2-med) var(--v2-ease), border-color var(--v2-med); }
.sl-page .card.lift:hover { transform: translateY(-1px); box-shadow: var(--v2-shadow-2); border-color: var(--v2-line-2); }
.sl-page .card.hero { background: linear-gradient(160deg, rgba(var(--accent-rgb), .16), rgba(var(--accent-rgb), .04) 45%, var(--v2-panel) 80%); border-color: rgba(var(--accent-rgb), .35);
    box-shadow: inset 0 3px 0 var(--accent), inset 0 1px 0 rgba(255,255,255,.08), 0 0 44px -14px rgba(var(--accent-rgb), .55), var(--v2-shadow-2); }
.sl-page .card.flat { background: var(--v2-panel); box-shadow: none; }
.sl-page .eyebrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; font: 700 var(--fs-micro) var(--sl-display); letter-spacing: var(--caps); text-transform: uppercase; color: var(--text-3); }
.sl-page .eyebrow :is(a, .more) { font: 600 var(--fs-small) var(--sl-ui); letter-spacing: 0; text-transform: none; color: var(--accent-soft, var(--accent)); }
.sl-page .eyebrow .n { font-weight: 600; letter-spacing: 0; color: var(--text-4); text-transform: none; margin-left: 2px; }
.sl-page .eyebrow.loose { margin: 4px 0 8px; }
.sl-page .row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--v2-line); color: inherit; text-decoration: none; }
.sl-page .row:first-child { border-top: 0; padding-top: 2px; }
.sl-page .row .t { grid-column: 1; grid-row: 1; font: 650 14px/1.25 var(--sl-display); color: var(--text-hi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-page .row .m { grid-column: 1; grid-row: 2; font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-page .row .r { grid-column: 2; grid-row: 1 / 3; display: flex; align-items: center; gap: 6px; }
.sl-page a.row:hover .t { color: var(--accent-soft, var(--accent)); }
.sl-page .row[data-cls] { padding-left: 10px; }
.sl-page .row[data-cls]::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: var(--cls); }
/* the explainer: a dl of terms in a card (rails) */
.sl-page .sl-explain { margin: 0; display: grid; gap: 8px; font-size: var(--fs-sm); }
.sl-page .sl-explain dt { font: 650 13px var(--sl-display); color: var(--text-hi); }
.sl-page .sl-explain dd { margin: 1px 0 0; color: var(--text-2); line-height: 1.45; }

/* buttons */
.sl-page .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--h-md); margin: 0; padding: 0 12px; border: 1px solid var(--line-3, var(--line-2)); border-radius: var(--r-md); background: linear-gradient(180deg, color-mix(in srgb, #fff 4%, var(--bg-2)), var(--bg-2)); box-shadow: none; color: var(--text); font: 600 13px var(--sl-display); white-space: nowrap; text-decoration: none; }
.sl-page .btn:hover { border-color: var(--accent); color: var(--text-hi); }
.sl-page .btn.primary { background: linear-gradient(180deg, color-mix(in srgb, #fff 12%, var(--accent)), var(--accent)); border-color: var(--accent); color: var(--ink, #060806); font-weight: 700; box-shadow: 0 6px 18px -8px rgba(var(--accent-rgb), .9), inset 0 1px 0 rgba(255,255,255,.25); }
.sl-page .btn.primary:hover { filter: brightness(1.06); }
.sl-page .btn.lg { min-height: var(--h-lg); padding: 0 18px; font-size: 15px; }
.sl-page .btn.sm { min-height: var(--h-sm); padding: 0 9px; font-size: var(--fs-small); }
.sl-page .btn.quiet { border-color: transparent; background: none; color: var(--text-2); }
.sl-page .btn.quiet:hover { background: var(--v2-hover); }
.sl-page .btn:is(.on, [aria-pressed="true"]) { border-color: var(--accent); color: var(--accent); }

/* chips: the word always printed, one hue per state; .tag kind chips (New, Faster, Fixed, Companion; a bare .tag is dashed) */
.sl-page .chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px; border: 1px solid var(--line-2); border-radius: var(--r-pill); color: var(--text-3); font: 700 10.5px var(--sl-display); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.sl-page .chip.live { border-color: var(--accent); background: var(--accent); color: var(--ink, #060806); box-shadow: 0 0 16px -4px rgba(var(--accent-rgb), .9); }
.sl-page .chip.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink, #060806); animation: sl-pulse 1.6s ease-out infinite; }
.sl-page .chip:is(.today, .rem) { border-color: var(--warn); color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.sl-page .chip.soon { border-color: var(--info); color: var(--info); background: color-mix(in srgb, var(--info) 10%, transparent); }
.sl-page .chip.team { border-color: var(--purple); color: var(--purple); background: color-mix(in srgb, var(--purple) 12%, transparent); }
.sl-page .chip.good { border-color: var(--good); color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
.sl-page .chip.crit { border-color: var(--crit); color: var(--crit); background: color-mix(in srgb, var(--crit) 12%, transparent); }
.sl-page .tag { --tg: var(--text-3); display: inline-flex; align-items: center; padding: 0 6px; border: 1px dashed color-mix(in srgb, var(--tg) 55%, transparent); border-radius: 4px; color: var(--tg); font: 700 10px/16px var(--sl-display); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.sl-page .tag:is(.new, .faster, .fixed, .companion) { border-style: solid; background: color-mix(in srgb, var(--tg) 10%, transparent); }
.sl-page .tag.new { --tg: var(--accent); } .sl-page .tag.faster { --tg: var(--good); } .sl-page .tag.fixed { --tg: var(--info); } .sl-page .tag.companion { --tg: var(--purple); }
@keyframes sl-pulse { 0% { box-shadow: 0 0 0 0 rgba(0,0,0,.35); } 100% { box-shadow: 0 0 0 7px rgba(0,0,0,0); } }

/* LMU ranks (data-rank, Bronze to Platinum) and StintLab's own ladder (data-tier, adds Diamond and Elite) set --rk */
.sl-page :is([data-rank="Bronze"], [data-tier="Bronze"]) { --rk: var(--rank-bronze); } .sl-page :is([data-rank="Silver"], [data-tier="Silver"]) { --rk: var(--rank-silver); }
.sl-page :is([data-rank="Gold"], [data-tier="Gold"]) { --rk: var(--rank-gold); } .sl-page :is([data-rank="Platinum"], [data-tier="Platinum"]) { --rk: var(--rank-platinum); }
.sl-page [data-tier="Diamond"] { --rk: #8fb4ff; } .sl-page [data-tier="Elite"] { --rk: #e879f9; }
[data-theme="daylight"] .sl-page [data-tier="Diamond"] { --rk: #2f5fc4; } [data-theme="daylight"] .sl-page [data-tier="Elite"] { --rk: #a21caf; }
.sl-page .rk { display: inline-flex; align-items: center; gap: 5px; padding: 0 7px 0 5px; border: 1px solid color-mix(in srgb, var(--rk, var(--line-2)) 55%, transparent); border-radius: var(--r-pill); background: color-mix(in srgb, var(--rk, var(--line-2)) 14%, transparent); color: var(--text-hi); font-size: var(--fs-small); font-weight: 650; white-space: nowrap; line-height: 18px; }
.sl-page .rk::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--rk, var(--line-2)); }
.sl-page .rk small { color: var(--text-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.sl-page .rk.lg { font-size: 14px; padding: 2px 10px 2px 8px; line-height: 20px; }
.sl-page .rk.lg::before { width: 9px; height: 9px; }
.sl-page .rail { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; height: 6px; }
.sl-page .rail i { display: block; border-radius: 2px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.sl-page .rail i.on { background: var(--rk); box-shadow: 0 0 8px -2px var(--rk); }
.sl-page .rail i.on:last-of-type { background: color-mix(in srgb, #fff 25%, var(--rk)); }
.sl-page .rail i.plan { background: none; box-shadow: inset 0 0 0 1px var(--rk); }   /* outlined: steps the plan reaches */
.sl-page .tint[data-rank] { background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--rk) 13%, transparent), transparent 60%), var(--v2-panel); }
.sl-page .pc { font: 600 22px/1 var(--sl-display); color: var(--text-hi); font-variant-numeric: tabular-nums; }
.sl-page [data-rank] .pc { color: var(--rk); }
.sl-page .pc-big { display: flex; align-items: baseline; gap: 10px; }
.sl-page .pc-big .pc { font-size: 34px; }

/* class color: data-cls on anything tied to a class; .cp is the pill (it always prints the class) */
.sl-page :is([data-cls="Hyper"], [data-cls="Hypercar"]) { --cls: var(--cls-hyper); } .sl-page [data-cls="LMP2"] { --cls: var(--cls-lmp2); }
.sl-page [data-cls="LMP3"] { --cls: var(--cls-lmp3); } .sl-page [data-cls="GT3"] { --cls: var(--cls-gt3); } .sl-page [data-cls="GTE"] { --cls: var(--cls-gte); }
.sl-page .cp { display: inline-flex; align-items: center; padding: 0 6px; border-radius: 4px; font: 700 10px var(--sl-display); letter-spacing: .04em; text-transform: uppercase; line-height: 15px; color: var(--text-hi); background: color-mix(in srgb, var(--cls, var(--text-3)) 22%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cls, var(--text-3)) 55%, transparent); }
.sl-page .card[data-cls]:not(.hero) { border-color: color-mix(in srgb, var(--cls) 35%, var(--v2-line)); }
.sl-page .card[data-cls].wash { background: linear-gradient(135deg, color-mix(in srgb, var(--cls) 16%, var(--v2-panel)), var(--v2-panel) 55%); }
.sl-page .card .pic { height: 120px; margin: -10px -12px 10px; border-radius: var(--r-lg) var(--r-lg) 0 0; background: linear-gradient(160deg, var(--surface-3), var(--bg-3)); background-size: cover; background-position: center; display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; font: 600 16px var(--sl-display); color: var(--text-hi); }
.sl-page .card[data-cls] .pic { background-image: linear-gradient(160deg, color-mix(in srgb, var(--cls) 45%, var(--bg-3)), var(--bg-3) 80%); }

/* tables: sticky head, zebra, hover, .k key column, .num right, .pick / aria-selected wash, .barc inline bar, sort buttons */
.sl-page .tbl { border: 1px solid var(--v2-line); border-radius: var(--r-lg); background: var(--v2-panel); overflow: auto; max-width: 100%; }
.sl-page .tbl table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.sl-page .tbl th { position: sticky; top: 0; z-index: 1; height: 36px; padding: 0 12px; background: var(--panel-2, var(--panel)); color: var(--text-3); font: 700 11px var(--sl-display); letter-spacing: var(--caps); text-transform: uppercase; text-align: left; border-bottom: 1px solid var(--line-3, var(--line-2)); white-space: nowrap; }
.sl-page .tbl th.num { text-align: right; }
.sl-page .tbl th button { min-height: 0; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.sl-page .tbl th button:hover, .sl-page .tbl th[aria-sort] button { color: var(--text-hi); }
.sl-page .tbl th[aria-sort="ascending"] button::after { content: " \25B4"; }
.sl-page .tbl th[aria-sort="descending"] button::after { content: " \25BE"; }
.sl-page .tbl td { height: 38px; padding: 0 12px; border-bottom: 1px solid var(--v2-line); color: var(--text-2); white-space: nowrap; vertical-align: middle; }
.sl-page .tbl tr:last-child td { border-bottom: 0; }
.sl-page .tbl tr:nth-child(even) td { background: var(--v2-zebra); }
.sl-page .tbl tr:hover td { background: var(--v2-hover); }
.sl-page .tbl td.k { color: var(--text-hi); font-weight: 650; }
.sl-page .tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.sl-page :is(.tbl, .kv) .up { color: var(--good); }
.sl-page :is(.tbl, .kv) .dn { color: var(--crit); }
.sl-page .tbl tr:is(.pick, [aria-selected="true"]) td { background: var(--v2-wash); }
.sl-page .tbl tr[data-cls] td:first-child { box-shadow: inset 3px 0 0 var(--cls); }
.sl-page .tbl .barc { position: relative; min-width: 140px; }
.sl-page .tbl .barc i { position: absolute; left: 12px; top: 50%; height: 6px; margin-top: -3px; border-radius: 3px; background: var(--accent); opacity: .7; }
.sl-page .sl-notes { display: grid; gap: 4px; margin: 2px 2px 0; color: var(--text-3); font-size: 12px; max-width: 90ch; }
.sl-page .foot-note { margin: 8px 2px 0; color: var(--text-3); font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
@media (max-width: 760px) { .sl-page .tbl :is(td.k, th:first-child) { position: sticky; left: 0; background: var(--panel); z-index: 1; } }
/* number tiles, bars, steps, the big number, the answer */
.sl-page .kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.sl-page .kv > div { padding: 8px 10px; border: 1px solid var(--v2-line); border-radius: 8px; background: var(--bg-2); min-width: 0; }
.sl-page .kv .k { display: block; font: 700 10px var(--sl-display); letter-spacing: var(--caps); text-transform: uppercase; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-page .kv .v { display: block; margin-top: 2px; font: 600 20px/1.1 var(--sl-display); color: var(--text-hi); font-variant-numeric: tabular-nums; }
.sl-page .kv .d { display: block; margin-top: 2px; font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-page .hbar { display: grid; grid-template-columns: 110px minmax(0, 1fr) 54px; gap: 8px; align-items: center; font-size: 12px; color: var(--text-2); padding: 3px 0; }
.sl-page .hbar i { display: block; height: 10px; border-radius: 3px; background: var(--info); }
.sl-page .hbar .num { text-align: right; color: var(--text-3); }
.sl-page .step { display: inline-grid; place-items: center; min-width: 28px; height: 20px; padding: 0 4px; border-radius: 4px; font: 700 11px var(--sl-display); font-variant-numeric: tabular-nums; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text-2); }
.sl-page .step.up { color: var(--good); background: color-mix(in srgb, var(--good) 14%, var(--bg-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 45%, transparent); }
.sl-page .step.dn { color: var(--crit); background: color-mix(in srgb, var(--crit) 14%, var(--bg-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--crit) 45%, transparent); }
.sl-page .step.dnf { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, var(--bg-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 45%, transparent); }
.sl-page .big { font: 600 30px/1 var(--sl-display); color: var(--text-hi); font-variant-numeric: tabular-nums; }
.sl-page .glow { color: var(--accent); text-shadow: 0 0 18px rgba(var(--accent-rgb), .55); }
.sl-page .answer h2 { margin: 0; font: 600 clamp(22px, 2vw, 32px)/1.2 var(--sl-display); color: var(--text-hi); text-wrap: balance; }
.sl-page .answer p { margin: 6px 0 0; max-width: 78ch; color: var(--text-2); font-size: 15px; }
/* empty, loading and error states */
.sl-page .empty { padding: 12px; border: 1px dashed var(--line-3, var(--line-2)); border-radius: var(--r-md); background: var(--bg-2); color: var(--text-3); font-size: var(--fs-sm); }
.sl-page .empty b { display: block; color: var(--text-hi); font: 600 var(--fs-md) var(--sl-display); margin-bottom: 2px; }
.sl-page .empty .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.sl-page .empty.err { border-color: color-mix(in srgb, var(--crit) 40%, var(--line-2)); }
.sl-page .skel { display: block; max-width: 100%; height: 12px; border-radius: 3px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sl-shimmer 1.4s linear infinite; }
@keyframes sl-shimmer { to { background-position: -200% 0; } }
/* team color: --team on the card; the team header (teams, leaderboards) */
.sl-page .team-h { display: flex; align-items: center; gap: 10px; margin: -10px -12px 10px; padding: 10px 12px; border-bottom: 1px solid color-mix(in srgb, var(--team) 25%, var(--v2-line)); background: linear-gradient(90deg, color-mix(in srgb, var(--team) 18%, transparent), transparent 70%); }
.sl-page .team-h .badge { width: 36px; height: 36px; border-radius: 8px; background: linear-gradient(135deg, var(--team), color-mix(in srgb, var(--team) 55%, #000)); color: #fff; display: grid; place-items: center; font: 700 12px var(--sl-display); flex: none; }
.sl-page .team-h .n { font: 650 16px/1.15 var(--sl-display); color: var(--text-hi); }
.sl-page .team-h .g { color: var(--text-3); font-size: 12px; }
.sl-page .team-h .btn { margin-left: auto; }
/* the series list (results, leaderboards) and the strip that names the pick */
.sl-page .serlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 6px; }
@media (min-width: 1500px) { .sl-page .sl-rail .serlist { grid-template-columns: minmax(0, 1fr); } }
.sl-page .serlist :is(a, button) { display: grid; gap: 1px; padding: 7px 10px; border: 1px solid var(--v2-line); border-radius: var(--r-md); color: var(--text-hi); font: 650 13px var(--sl-ui); }
.sl-page .serlist button { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 0; margin: 0; background: none; box-shadow: none; text-align: left; cursor: pointer; }
.sl-page .serlist button:hover { border-color: var(--v2-line-2); }
.sl-page .serlist :is(a, button):is(.on, [aria-pressed="true"]) { border-color: var(--accent); background: var(--v2-wash); }
.sl-page .serlist .grp { grid-column: 1 / -1; margin: 8px 0 0; font: 700 10px var(--sl-display); letter-spacing: var(--caps); text-transform: uppercase; color: var(--text-3); }
.sl-page .strip { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; margin: 0 0 var(--sl-gap); padding: 10px 14px; border-left: 3px solid var(--accent); border-radius: var(--r-md); background: var(--v2-panel); }
.sl-page .strip h2 { margin: 0; font: 600 20px/1.2 var(--sl-display); color: var(--text-hi); }
/* motion: the lift, the live pulse, the shimmer; all off for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .sl-page .card, .sl-page .card.lift:hover { transition: none; transform: none; }
    .sl-page .chip.live::before, .sl-page .skel { animation: none; }
}
/* the LMU tab bar takes the .tabs look on opted-in pages */
.sl-page .lmu-tabs { border-bottom-color: var(--v2-line); margin-bottom: var(--sl-gap); }

/* ======================================================================
   17. STAGE 2 ADDITIONS (#745: when to race, your split, rank up, tracks, car and track pages)
   Tokens and components those pages use that the shared layer above does not define. Still scoped under .sl-page.
   ====================================================================== */
.sl-page .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sl-page .num { font-variant-numeric: tabular-nums; }
.sl-page .muted { color: var(--text-3); }
.sl-page .small { font-size: var(--fs-small); }
.sl-page [hidden] { display: none !important; }
.sl-page .sel { display: inline-flex; align-items: center; gap: 18px; height: 30px; padding: 0 10px; border: 1px solid var(--line-3); border-radius: var(--r-md); background: var(--bg-2); color: var(--text); font: 600 12px var(--font-ui); white-space: nowrap; }
.sl-page .sel::after { content: "\25BE"; color: var(--text-3); font-size: 10px; }
.sl-page .inp { height: 30px; padding: 0 10px; border: 1px solid var(--line-3); border-radius: var(--r-md); background: var(--bg-2); color: var(--text); font: 12px var(--font-ui); }
.sl-page .search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--line-3); border-radius: var(--r-md); background: var(--bg-2); color: var(--text-4); font-size: 13px; max-width: 620px; }
.sl-page a.row:hover { text-decoration: none; }
.sl-page .row.done .t { color: var(--text-2); }
.sl-page .row.slot { grid-template-columns: 44px minmax(0, 1fr) auto; }
.sl-page .row.slot .d { grid-column: 1; grid-row: 1 / 3; text-align: center; border-radius: 6px; background: color-mix(in srgb, var(--cls, var(--accent)) 16%, transparent); box-shadow: inset 3px 0 0 var(--cls, var(--accent)); padding: 4px 0 4px 3px; }
.sl-page .row.slot .d b { display: block; font: 700 15px/1 var(--font-display); color: var(--text-hi); }
.sl-page .row.slot .d span { display: block; font: 600 10px var(--font-display); color: var(--text-3); margin-top: 2px; text-transform: uppercase; letter-spacing: .04em; }
.sl-page .row.slot .t, .sl-page .row.slot .m { grid-column: 2; } .sl-page .row.slot .r { grid-column: 3; }
.sl-page .row.slot[data-cls] { padding-left: 0; } .sl-page .row.slot[data-cls]::before { display: none; }
.sl-page .rk:not([data-rank]) { --rk: var(--line-3); }
.sl-page .serlist a .cp { justify-self: start; }
.sl-page .serlist a small { font-weight: 400; color: var(--text-3); font-size: 11px; }
.sl-page .strip span { color: var(--text-2); font-size: 13px; }
.sl-page .special { padding: 8px 10px; border: 1px solid color-mix(in srgb, var(--warn) 60%, transparent); border-radius: var(--r-md); background: linear-gradient(90deg, color-mix(in srgb, var(--warn) 18%, var(--bg-2)), color-mix(in srgb, var(--warn) 4%, var(--bg-2))); box-shadow: 0 0 30px -14px color-mix(in srgb, var(--warn) 70%, transparent); }
.sl-page .special .k { display: flex; gap: 8px; align-items: center; font: 700 var(--fs-micro) var(--font-display); letter-spacing: var(--caps); text-transform: uppercase; color: var(--warn); }
.sl-page .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-4); flex: none; display: inline-block; }
.sl-page .dot.on { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 25%, transparent); animation: sl-pulse-g 2s ease-out infinite; }
@keyframes sl-pulse-g { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 45%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }
.sl-page .flip { animation: sl-flip 360ms var(--v2-ease); }
@keyframes sl-flip { 0% { transform: translateY(-40%); opacity: 0; } 100% { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .sl-page .dot.on, .sl-page .flip { animation: none; }
    .sl-page * { scroll-behavior: auto !important; }
}
[data-theme="daylight"] .sl-page .eyebrow a, [data-theme="daylight"] .sl-page .eyebrow .more { color: var(--accent); }   /* accent-soft misses AA on the light panel */

