@font-face { font-family: "Titillium Web"; font-weight: 400; src: url("/fonts/TitilliumWeb-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Titillium Web"; font-weight: 700; src: url("/fonts/TitilliumWeb-Bold.ttf") format("truetype"); font-display: swap; }
/* Timing tower look only (loaded when used; OFL, fonts/Saira-IBMPlexMono-OFL.txt). */
@font-face { font-family: "Saira Condensed"; font-weight: 600; src: url("/fonts/font-saira-condensed-600.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Saira Condensed"; font-weight: 700; src: url("/fonts/font-saira-condensed-700.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; src: url("/fonts/font-ibm-plex-mono-500.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 600; src: url("/fonts/font-ibm-plex-mono-600.woff2") format("woff2"); font-display: swap; }

/* Colours (#55; black and grey with orange accents, owner 2026-10-30): dark is the default; light comes from the Preferences / footer switch or the device's setting
   (theme.js sets data-theme on <html> before the page draws). Board cards, the banner, the 3D viewer and the
   telemetry charts (owner: black in both) stay dark in both: they carry the dark tokens themselves (list below). */
:root, .board-card, .viewer3d, .banner, .tele-svg, .st-plot, .st-map, .st-focus-map, .st-xy {
  color-scheme: dark;
  --bg: #0a0b0d;
  --bg2: #15171b;
  --card: #1a1c20;                 /* solid: the page pattern stays behind the cards */
  --card-edge: rgba(255, 255, 255, 0.10);
  --text: #f2f3f5;
  --muted: #9a9ea8;
  --pink: #c02447;
  --cyan: #d4d4d8;
  --orange: #ff8a3d;
  --green: #00e676;
  --purple: #b56cff;
  --gold: #ffd166;
  /* The same accents as r, g, b for tints: rgba(var(--cyan-rgb), 0.1). */
  --pink-rgb: 192, 36, 71;
  --cyan-rgb: 212, 212, 216;
  --orange-rgb: 255, 138, 61;
  --green-rgb: 0, 230, 118;
  --purple-rgb: 181, 108, 255;
  --gold-rgb: 255, 209, 102;
  --ink-rgb: 255, 255, 255;        /* faint overlays, lines on charts */
  --base-rgb: 10, 10, 11;           /* see-through backgrounds of fields and tooltips */
  --pink-deep: #9a1c39;
  --pink-soft: #e0587a;
  --purple-soft: #cf9dff;
  --p2: #e4e4e7;
  --brake: #ff3b5c;
  --on-cyan: #111113;
  --on-gold: #1a1300;
  --on-green: #04140a;
  --pop: #18191d;                  /* menus, bell, pop-outs */
  --notice-bg: #202227;
  --sticky-bg: #121317;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  --shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.5);
  --glow: 0.6;                       /* 0 = no neon glow on text */
  --chart-bg: #000;
  --pill-on: var(--pink);
  --page-pattern: url("/assets/bg-circuit-dark.svg");   /* circuit traces and dots, as in the banner */
  --surface: #15161a;                /* solid fill of buttons, pills, tabs on the patterned page */
  --surface-hover: #24262b;
  --field: #0e0f12;                  /* menus and input fields */
  --switch-on: var(--pink);          /* a .switch that is on */
  --switch-knob: #fff;
  --accent-glow: 0 0 14px rgba(var(--pink-rgb), 0.45);   /* the slight glow round red buttons */
  --pill-on-glow: var(--accent-glow);
  --pill-on-text: #fff;
  --lap-me: #c02447;
  --lap-ref: #e4e4e7;
  --mini-even: #6b7280;
  --delta: #ffd166;
  --map-road: #2e2e33;
  --map-pit: #222226;
  --map-edge: rgba(232, 236, 248, 0.6);
  --map-start: #fff;
  --chip-on: #2a2c31;
  --tier-bronze: #e09a5a;
  --tier-silver: #d4dbef;
  --tier-gold: #ffd04a;
  --tier-diamond: #cf9bff;
  --speed-scale: linear-gradient(90deg, rgb(37,99,235), rgb(34,211,238), rgb(0,230,118), rgb(255,209,102), rgb(255,45,85));
  --page-glow: radial-gradient(1200px 600px at 85% -10%, rgba(160, 175, 210, 0.07), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(255, 255, 255, 0.03), transparent 60%);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eceef1;
  --bg2: #e4e6ea;
  --card: #fff;
  --card-edge: #d4d4d8;
  --text: #111113;
  --muted: #52525b;
  --pink: #c02447;
  --cyan: #3f3f46;
  --orange: #c2410c;
  --green: #047857;
  --purple: #7c3aed;
  --gold: #8a5a00;
  --pink-rgb: 192, 36, 71;
  --cyan-rgb: 63, 63, 70;
  --orange-rgb: 194, 65, 12;
  --green-rgb: 4, 120, 87;
  --purple-rgb: 124, 58, 237;
  --gold-rgb: 202, 138, 4;
  --ink-rgb: 17, 17, 19;
  --base-rgb: 255, 255, 255;
  --pink-deep: #9a1c39;
  --pink-soft: #c02447;
  --purple-soft: #6d28d9;
  --p2: #6b7280;
  --brake: #e11d48;
  --on-cyan: #fff;
  --on-gold: #fff;
  --on-green: #fff;
  --pop: #fff;
  --notice-bg: #fff;
  --sticky-bg: #f6f6f7;
  --shadow: 0 1px 2px rgba(15, 20, 48, 0.08), 0 12px 32px rgba(15, 20, 48, 0.10);
  --shadow-pop: 0 12px 32px rgba(30, 40, 90, 0.18);
  --glow: 0;
  --chart-bg: #fff;
  --pill-on: #111113;
  --page-pattern: url("/assets/bg-circuit-light.svg");
  --surface: #f4f5f7;
  --surface-hover: #e4e6ea;
  --field: #fff;
  --accent-glow: 0 0 10px rgba(var(--pink-rgb), 0.28);
  --pill-on-glow: none;
  --pill-on-text: #fff;
  --lap-me: #c02447;
  --lap-ref: #52525b;
  --mini-even: #9ca3af;
  --delta: #b45309;
  --map-road: #d4d4d8;
  --map-pit: #e4e4e7;
  --map-edge: rgba(20, 25, 60, 0.45);
  --map-start: #111113;
  --chip-on: #fff1e6;
  --tier-bronze: #9a5a1c;
  --tier-silver: #5f6b85;
  --tier-gold: #a16207;
  --tier-diamond: #7c3aed;
  --speed-scale: linear-gradient(90deg, rgb(37,99,235), rgb(8,145,178), rgb(5,150,105), rgb(217,119,6), rgb(220,38,38));
  --page-glow: radial-gradient(1200px 600px at 85% -10%, rgba(120, 135, 170, 0.06), transparent 60%);
}
.board-card, .viewer3d { color: var(--text); }
/* Light mode with depth (owner 2026-10-20: it looked flat; mock-up https://claude.ai/artifact/U4uLQyEPcog8xx2QW8pJxg):
   the menu bar is a dark band on top of the (dark) banner with a pink rule, tables get a tinted head, stripes and a
   gold P1 row. Pop-outs inside the menu keep the light tokens: only the bar's own links turn light. */
:root[data-theme="light"] .topnav { background: #121214; border-radius: 14px; padding: 4px 8px; box-shadow: inset 0 -3px 0 var(--pink), var(--shadow); }
:root[data-theme="light"] .topnav .bell, :root[data-theme="light"] .topnav .acct-btn, :root[data-theme="light"] .topnav .nav-toggle,
:root[data-theme="light"] .topnav > #account-nav > a:not(.primary), :root[data-theme="light"] .topnav > #account-nav > .link:not(.primary) { color: #e4e4e7; }
@media (min-width: 601px) {
  :root[data-theme="light"] .topnav > .nav-left > a { color: #e4e4e7; }
  :root[data-theme="light"] .topnav > .nav-left > a:hover, :root[data-theme="light"] .topnav > .nav-left > a[aria-current] { color: #fff; }
}
:root[data-theme="light"] thead th { background: #f4f4f5; }
:root[data-theme="light"] tbody tr:nth-child(even) { background: #fafafa; }
:root[data-theme="light"] tbody tr.p1 { background: #fff3d1; }
:root[data-theme="light"] tbody tr:hover { background: #f1f1f3; }

/* Neon (owner 2026-10-30): the site's first look (blue and purple with pink and cyan), kept as a choice when the
   standard look went black and grey. Same tokens as the old dark theme; its own banner. */
:root[data-look="neon"], :root[data-look="neon"] .board-card, :root[data-look="neon"] .viewer3d, :root[data-look="neon"] .banner, :root[data-look="neon"] .tele-svg, :root[data-look="neon"] .st-plot, :root[data-look="neon"] .st-map, :root[data-look="neon"] .st-focus-map, :root[data-look="neon"] .st-xy {
  color-scheme: dark;
  --bg: #070a1f;
  --bg2: #120a2e;
  --card: rgba(22, 26, 64, 0.72);
  --card-edge: rgba(120, 140, 255, 0.18);
  --text: #eef1ff;
  --muted: #8e97c7;
  --pink: #ff2d95;
  --cyan: #22d3ee;
  --orange: #ff8a3d;
  --green: #00e676;
  --purple: #b56cff;
  --gold: #ffd166;
  /* The same accents as r, g, b for tints: rgba(var(--cyan-rgb), 0.1). */
  --pink-rgb: 255, 45, 149;
  --cyan-rgb: 34, 211, 238;
  --orange-rgb: 255, 138, 61;
  --green-rgb: 0, 230, 118;
  --purple-rgb: 181, 108, 255;
  --gold-rgb: 255, 209, 102;
  --ink-rgb: 255, 255, 255;        /* faint overlays, lines on charts */
  --base-rgb: 7, 10, 31;           /* see-through backgrounds of fields and tooltips */
  --pink-deep: #b5126a;
  --pink-soft: #ff7ab8;
  --purple-soft: #cf9dff;
  --p2: #d9e1ff;
  --brake: #ff3b5c;
  --on-cyan: #04121a;
  --on-gold: #1a1300;
  --on-green: #04140a;
  --pop: #121733;                  /* menus, bell, pop-outs */
  --notice-bg: #1b2147;
  --sticky-bg: #10142e;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  --shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.5);
  --glow: 1;                       /* 0 = no neon glow on text */
  --chart-bg: #000;
  --pill-on: rgba(var(--cyan-rgb), 0.85);
  --page-pattern: none;
  --surface: rgba(var(--ink-rgb), 0.04);
  --surface-hover: rgba(var(--ink-rgb), 0.1);
  --field: rgba(var(--base-rgb), 0.6);
  --switch-on: var(--cyan);
  --switch-knob: var(--on-cyan);
  --accent-glow: none;
  --pill-on-glow: none;
  --pill-on-text: var(--on-cyan);
  --lap-me: #22d3ee;
  --lap-ref: #ff2d95;
  --mini-even: #6b7280;
  --delta: #ffd166;
  --map-road: #2a3152;
  --map-pit: #20263f;
  --map-edge: rgba(232, 236, 248, 0.6);
  --map-start: #fff;
  --chip-on: #1a2150;
  --tier-bronze: #e09a5a;
  --tier-silver: #d4dbef;
  --tier-gold: #ffd04a;
  --tier-diamond: #cf9bff;
  --speed-scale: linear-gradient(90deg, rgb(37,99,235), rgb(34,211,238), rgb(0,230,118), rgb(255,209,102), rgb(255,45,85));
  --page-glow: radial-gradient(1200px 600px at 85% -10%, rgba(181, 108, 255, 0.25), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(34, 211, 238, 0.12), transparent 60%);
}
:root[data-look="neon"], :root[data-look="neon"] .tele-svg, :root[data-look="neon"] .st-plot { --lap-x1: #00e676; --lap-x2: #ff8a3d; --lap-x3: #c0c7e6; --stat-a: #0a9fb8; --stat-b: #ff2d95; }
:root[data-look="neon"] .banner { background: url("/assets/banner-2026-10.jpg") left center / cover no-repeat #0b1150; box-shadow: 0 12px 40px rgba(var(--pink-rgb), 0.18); }
:root[data-look="neon"] .banner img { visibility: hidden; }

/* Looks (2026-10-20; owner: "not as a dark mode option", picked in Preferences → Look; theme.js sets data-look and
   keeps data-theme dark under it). Timing tower: black, yellow, purple for P1, green for your own lap, condensed
   headings and lap times in a typewriter font. Board cards, the banner and the 3D viewer keep their own look. */
:root[data-look="tower"] {
  --bg: #050505; --bg2: #000;
  --card: #0c0c0c; --card-edge: #262626;
  --text: #f2f2f2; --muted: #a3a3a3;
  --pink: #ffd400; --pink-rgb: 255, 212, 0; --pink-deep: #e0b900; --pink-soft: #ffe566;
  --cyan: #ffd400; --cyan-rgb: 255, 212, 0; --on-cyan: #000;
  --gold: #c77dff; --gold-rgb: 199, 125, 255;
  --green: #00e05a; --green-rgb: 0, 224, 90; --on-green: #000;
  --purple: #c77dff; --purple-rgb: 199, 125, 255; --purple-soft: #ddb0ff;
  --p2: #e5e5e5;
  --ink-rgb: 255, 255, 255; --base-rgb: 5, 5, 5;
  --pop: #111; --notice-bg: #161616; --sticky-bg: #0a0a0a; --chip-on: #262000;
  --shadow: none; --shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.6); --glow: 0;
  --page-glow: none;
  --pill-on: #ffd400; --pill-on-text: #000;
  --page-pattern: none; --surface: #111; --surface-hover: #1c1c1c; --field: #0a0a0a;
  --switch-on: #ffd400; --switch-knob: #000; --accent-glow: none; --pill-on-glow: none;
  --lap-me: #00e05a; --lap-ref: #c77dff; --delta: #ffd400;
}
:root[data-look="tower"] .tele-svg, :root[data-look="tower"] .st-plot { --lap-me: #00e05a; --lap-ref: #c77dff; --delta: #ffd400; }
:root[data-look="tower"] h1, :root[data-look="tower"] h2, :root[data-look="tower"] h3, :root[data-look="tower"] th,
:root[data-look="tower"] .topnav, :root[data-look="tower"] .btn, :root[data-look="tower"] .pill, :root[data-look="tower"] .rank {
  font-family: "Saira Condensed", "Titillium Web", system-ui, sans-serif; letter-spacing: 0.5px; }
:root[data-look="tower"] h1, :root[data-look="tower"] h2 { text-transform: uppercase; }
:root[data-look="tower"] .time, :root[data-look="tower"] td.num, :root[data-look="tower"] .tele-value {
  font-family: "IBM Plex Mono", ui-monospace, monospace; font-weight: 600; }
:root[data-look="tower"] .card, :root[data-look="tower"] .table-wrap { border-radius: 4px; backdrop-filter: none; }
:root[data-look="tower"] .topnav { background: #000; border-radius: 4px; padding: 4px 8px; box-shadow: inset 0 -2px 0 #ffd400; }
:root[data-look="tower"] .topnav .bell, :root[data-look="tower"] .topnav .acct-btn, :root[data-look="tower"] .topnav .nav-toggle,
:root[data-look="tower"] .topnav > #account-nav > a:not(.primary), :root[data-look="tower"] .topnav > #account-nav > .link:not(.primary) { color: #e5e5e5; }
@media (min-width: 601px) {
  :root[data-look="tower"] .topnav > .nav-left > a { color: #e5e5e5; }
  :root[data-look="tower"] .topnav > .nav-left > a:hover, :root[data-look="tower"] .topnav > .nav-left > a[aria-current] { color: #ffd400; }
}
:root[data-look="tower"] .btn.primary, :root[data-look="tower"] .topnav .link.primary { color: #000; background: #ffd400; box-shadow: none; }
:root[data-look="tower"] thead th { background: #141414; color: #ffd400; }
:root[data-look="tower"] tbody tr:nth-child(even) { background: #101010; }
:root[data-look="tower"] tbody tr.p1 { background: #26103a; }
:root[data-look="tower"] tbody tr:hover { background: #1c1c1c; }

/* Preferences → Look: one tile per look with a small preview in that look's own colours. */
.look-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.look-tile { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--card-edge); border-radius: 12px; cursor: pointer; }
.look-tile input { position: absolute; opacity: 0; pointer-events: none; }
.look-tile:has(input:checked) { border-color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan); }
.look-tile:has(input:focus-visible) { outline: 2px solid var(--cyan); outline-offset: 2px; }
.look-tile small { display: block; }
.look-preview { position: relative; height: 72px; border-radius: 8px; display: flex; align-items: flex-end; gap: 4px; padding: 8px; overflow: hidden; }
.look-preview i { flex: 1; height: 6px; border-radius: 3px; }
.look-preview b { position: absolute; top: 8px; left: 10px; font-size: 18px; }
.look-standard { background: linear-gradient(135deg, #0a0b0d 55%, #eceef1 55%); }
.look-standard b { color: #fff; font-family: "Titillium Web", system-ui, sans-serif; }
.look-standard i:nth-child(1) { background: #c02447; } .look-standard i:nth-child(2) { background: #d4d4d8; } .look-standard i:nth-child(3) { background: #111113; }
.look-neon { background: linear-gradient(135deg, #070a1f, #120a2e); }
.look-neon b { color: #fff; font-family: "Titillium Web", system-ui, sans-serif; }
.look-neon i:nth-child(1) { background: #ff2d95; } .look-neon i:nth-child(2) { background: #22d3ee; } .look-neon i:nth-child(3) { background: #b56cff; }
.look-tower { background: #000; box-shadow: inset 0 -2px 0 #ffd400; }
.look-tower b { color: #ffd400; font-family: "IBM Plex Mono", ui-monospace, monospace; }
.look-tower i:nth-child(1) { background: #ffd400; } .look-tower i:nth-child(2) { background: #00e05a; } .look-tower i:nth-child(3) { background: #c77dff; }

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Titillium Web", system-ui, sans-serif;
  background: var(--page-glow), var(--page-pattern), linear-gradient(180deg, var(--bg2), var(--bg) 40%);
  display: flex;
  flex-direction: column;
}

.banner { width: min(1100px, 100% - 32px); margin: 10px auto 0; overflow: hidden; border-radius: 18px; border: 1px solid var(--card-edge);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); background: #0a0b0d; }
.banner img { display: block; width: 100%; height: auto; aspect-ratio: 4.5 / 1; object-fit: cover; object-position: left center; }
@media (max-width: 600px) {
  .topnav { gap: 0 4px; margin-top: 6px; font-size: 15px; }
  .topnav a, .topnav .link { padding: 5px 6px; }
}

.topnav { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; width: min(1100px, 100% - 32px); margin: 10px auto 0; font-weight: 700; }
.topnav a, .topnav .link { color: var(--cyan); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; padding: 6px 8px; }
.topnav #account-nav, .topnav .nav-left { display: flex; gap: 6px; flex-wrap: wrap; }
.topnav .link.primary { color: #fff; background: linear-gradient(180deg, var(--pink), var(--pink-deep)); border-radius: 999px; padding: 6px 16px; box-shadow: var(--accent-glow), 0 6px 18px rgba(var(--pink-rgb), 0.35); }
.topnav .link.primary:hover, .topnav .link.primary:focus-visible { filter: brightness(1.12); }
/* Phones: one row (icon · Menu · bell · avatar). The site links fold into the Menu pop-out, the Lap Tracker download
   (a PC thing) leaves the menu, and the icon replaces the big banner (index.html gives phones an empty image,
   so the banner isn't downloaded). */
.nav-icon, .nav-toggle { display: none; }
@media (max-width: 600px) {
  .topnav { flex-wrap: nowrap; position: relative; }
  .topnav .nav-icon { display: inline-flex; padding: 0; flex: none; }
  .nav-icon img { width: 36px; height: 36px; border-radius: 9px; display: block; }
  /* The grey icon with the black-and-grey looks, the blue one with Neon. */
  :root[data-look="neon"] .nav-icon .icon-carbon, :root:not([data-look="neon"]) .nav-icon .icon-neon { display: none; }
  .topnav .nav-toggle { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; color: var(--cyan); background: none;
    border: 0; font: inherit; cursor: pointer; padding: 6px 10px; }
  .topnav .nav-left { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50; flex-direction: column;
    gap: 0; background: var(--pop); border: 1px solid var(--card-edge); border-radius: 14px; padding: 6px; box-shadow: var(--shadow-pop); }
  .topnav .nav-left.open { display: flex; }
  .topnav .nav-left a { padding: 10px 12px; border-radius: 8px; color: var(--text); }
  .topnav .nav-left a[aria-current] { color: var(--cyan); background: rgba(var(--cyan-rgb), 0.1); }
  .topnav .nav-pc { display: none; }
  .topnav #account-nav { flex-wrap: nowrap; align-items: center; }
  .acct-btn .acct-name { display: none; }
  .banner { display: none; }
  body > main { margin-top: 16px; }
  .topnav .link.primary { padding: 6px 12px; }
}

main { width: min(1100px, 100% - 32px); margin: 28px auto 40px; flex: 1; }

.card { border-radius: 18px; border: 1px solid var(--card-edge); background: var(--card); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 6px; font-size: 22px; }
/* hidden always wins: .btn and other display rules beat the browser's own [hidden] (the admin lists' More stayed
   visible after the last page, and a tap loaded page 1 again). */
[hidden] { display: none !important; }
.btn { display: inline-block; font: inherit; font-weight: 700; color: var(--text); text-decoration: none; cursor: pointer; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--card-edge); background: var(--surface); }
.btn.primary { color: #fff; border-color: transparent; background: linear-gradient(180deg, var(--pink), var(--pink-deep)); box-shadow: var(--accent-glow), 0 8px 20px rgba(var(--pink-rgb), 0.3); }
/* Hover on every button: plain ones get a lighter edge and fill, red ones get brighter. */
.btn:hover, .btn:focus-visible { border-color: rgba(var(--ink-rgb), 0.4); background: var(--surface-hover); }
.btn.primary:hover, .btn.primary:focus-visible { background: linear-gradient(180deg, var(--pink), var(--pink-deep)); filter: brightness(1.12); }
.btn:focus-visible, input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
input { font: inherit; color: var(--text); background: var(--field); border: 1px solid var(--card-edge); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row input { flex: 1 1 220px; }
.stack { display: grid; gap: 12px; max-width: 420px; }
.stack label { display: grid; gap: 6px; font-weight: 700; }
#code { text-transform: uppercase; letter-spacing: 3px; font-size: 22px; }
.rigs { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.rigs li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(var(--ink-rgb), 0.04); }
.steps { padding-left: 20px; line-height: 1.6; }
footer { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 16px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--card-edge); }
.muted { color: var(--muted); }
a { color: inherit; }

h1 { font-size: clamp(26px, 4vw, 40px); margin: 0 0 4px; letter-spacing: 0.5px; }
/* What crawlers and link previews read before the app draws (index.html); the app replaces it. */
.intro-static p { max-width: 72ch; line-height: 1.5; }
.subtitle { color: var(--muted); margin: 0 0 22px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; font-size: 14px; }

/* Board cards */
.boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.board-card {
  position: relative; overflow: hidden; display: block; text-decoration: none;
  border-radius: 18px; border: 1px solid var(--card-edge);
  background: linear-gradient(180deg, rgba(var(--base-rgb), 0.15), rgba(var(--base-rgb), 0.92) 60%), url("/assets/cars.jpg") center 35% / cover no-repeat #0a0b0d;
  min-height: 210px; padding: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.board-card:hover, .board-card:focus-visible { transform: translateY(-3px); border-color: var(--pink); box-shadow: 0 16px 40px rgba(var(--pink-rgb), 0.25); outline: none; }
.board-card .tag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: rgba(var(--pink-rgb), 0.85); }
.board-card .tag.cars { background: rgba(var(--cyan-rgb), 0.85); color: var(--on-cyan); margin-left: 6px; }
.board-card h2 { margin: 54px 0 6px; font-size: 28px; line-height: 1.1; }
.board-card .leader { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-weight: 700; }
.board-card .leader .time { font-size: 24px; color: var(--gold); text-shadow: 0 0 14px rgba(var(--gold-rgb), calc(0.45 * var(--glow))); font-variant-numeric: tabular-nums; }
.board-card .meta { color: var(--muted); font-size: 14px; margin-top: 4px; }
/* F1 cards with a track picture: the map sits in the picture's top half, so the whole picture is shown at full width
   from the top and the tags, name and P1 sit at the bottom over a dark fade (no thumbnail → the cars.jpg card above). */
.board-card.thumb {
  display: flex; flex-direction: column; min-height: 250px;
  background: linear-gradient(180deg, rgba(var(--base-rgb), 0) 42%, rgba(var(--base-rgb), 0.85) 66%, rgba(var(--base-rgb), 0.97) 80%),
    var(--thumb) center top / 100% auto no-repeat, rgb(var(--base-rgb));
}
.board-card.thumb .tags { margin-top: auto; }
.board-card.thumb .tag { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45); }
.board-card.thumb h2 { margin-top: 8px; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8); }

/* Board page */
.back { display: inline-block; margin-bottom: 14px; color: var(--cyan); text-decoration: none; font-weight: 700; }
.table-wrap { border-radius: 18px; border: 1px solid var(--card-edge); background: var(--card); backdrop-filter: blur(6px); overflow-x: auto; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 12px 14px; text-align: left; white-space: nowrap; }
th { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--card-edge); }
tbody tr { border-bottom: 1px solid rgba(var(--ink-rgb), 0.06); }
tbody tr:hover { background: rgba(var(--ink-rgb), 0.03); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rank { width: 56px; font-weight: 700; font-size: 18px; color: var(--muted); }
tr.p1 .rank { color: var(--gold); text-shadow: 0 0 12px rgba(var(--gold-rgb), calc(0.6 * var(--glow))); }
tr.p2 .rank { color: var(--p2); }
tr.p3 .rank { color: var(--orange); }
.driver { font-weight: 700; font-size: 18px; }
.driver small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.time { font-weight: 700; font-size: 18px; }
tr.p1 .time { color: var(--gold); }
.gap { color: var(--muted); }
.sector.best { color: var(--purple); font-weight: 700; text-shadow: 0 0 10px rgba(var(--purple-rgb), calc(0.5 * var(--glow))); }
/* Sector strip (boards with many sectors, e.g. the Nordschleife): a block per sector, purple = best on the board,
   brighter = closer to the best. */
.sector-strip { text-align: left; white-space: nowrap; }
th.sector-strip small { font-weight: 400; color: var(--muted); text-transform: none; }
.ss { display: inline-flex; gap: 2px; vertical-align: middle; }
.ss i { display: block; width: 8px; height: 16px; border-radius: 2px; }
.ss .ss-best { background: var(--purple); box-shadow: 0 0 6px rgba(var(--purple-rgb), calc(0.6 * var(--glow))); }
.ss .ss-1 { background: rgba(var(--ink-rgb), 0.85); }
.ss .ss-2 { background: rgba(var(--ink-rgb), 0.55); }
.ss .ss-3 { background: rgba(var(--ink-rgb), 0.32); }
.ss .ss-4 { background: rgba(var(--ink-rgb), 0.16); }
.ss .ss-none { border: 1px dashed rgba(var(--ink-rgb), 0.3); }
.board-sectors { margin-left: auto; }
.badges { display: flex; gap: 4px; flex-wrap: wrap; }
.badge { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; padding: 2px 7px; border-radius: 6px; background: rgba(var(--orange-rgb), 0.18); color: var(--orange); border: 1px solid rgba(var(--orange-rgb), 0.35); }
.badge.clean { background: rgba(var(--green-rgb), 0.12); color: var(--green); border-color: rgba(var(--green-rgb), 0.35); }
.badge.warn { background: rgba(var(--pink-rgb), 0.15); color: var(--pink); border-color: rgba(var(--pink-rgb), 0.4); }

.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--card-edge); border-radius: 18px; }

.mobile-only { display: none; }

@media (max-width: 640px) {
  .board-card h2 { margin-top: 40px; }
  .board-card.thumb h2 { margin-top: 8px; }
  /* Narrow screens: drop sectors, date and the assists column; assists move under the driver's name. */
  th.sector, td.sector, th.when, td.when, th.assists, td.assists, th.gapcol, td.gap { display: none; }
  .mobile-only { display: block; margin-top: 6px; }
  /* Preference: sector times on phones too (smaller, so the row still fits). */
  body.phone-sectors th.sector, body.phone-sectors td.sector { display: table-cell; font-size: 12px; padding: 10px 4px; }
  body:not(.phone-sectors) .board-sectors { display: none; }
  table { min-width: 0; }
  th, td { padding: 10px 8px; }
  td.driver { white-space: normal; }
  .rank { width: 32px; }
  footer { flex-direction: column; gap: 4px; }
}

.release + .release { border-top: 1px solid rgba(var(--ink-rgb), 0.08); margin-top: 12px; padding-top: 4px; }
.release h3 { margin: 12px 0 6px; font-size: 1.05rem; }

.badge.guest { background: rgba(var(--ink-rgb), 0.06); color: var(--muted); border-color: var(--card-edge); vertical-align: middle; margin-left: 4px; }
.rigs li.rig { display: block; }
.rig-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.guests { margin-top: 8px; }
.guest-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.guest-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px; background: rgba(var(--ink-rgb), 0.03); }
.claim-box { flex-basis: 100%; }
.qr { width: 180px; background: #fff; border-radius: 8px; padding: 6px; margin: 8px 0; }
.qr svg { display: block; width: 100%; height: auto; }
.btn.small { padding: 4px 12px; font-size: 0.9rem; }
.guests h3 { margin: 14px 0 4px; font-size: 1rem; }
.btn.danger { background: var(--surface); color: var(--pink); border: 1px solid var(--pink); box-shadow: none; }
.btn.danger:hover, .btn.danger:focus-visible { background: var(--surface-hover); }
.danger-zone { border-color: rgba(var(--pink-rgb), 0.35); }
.prose h2 { margin-top: 22px; }
.prose ul { padding-left: 20px; }
.prose li { margin: 6px 0; }
footer a { color: inherit; }
/* Inside the phone app (#202): the app's own tabs replace the site's navigation. */
.in-app .topnav, .in-app header.banner, .in-app footer, .in-app .cc-banner { display: none; }
/* …and reads like the app around it: the phone's own font, the app's flat background. */
.in-app body { font-family: -apple-system, system-ui, sans-serif; background: var(--bg); }
footer .footer-note { flex-basis: 100%; font-size: 12px; }
button.report { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0 2px; opacity: 0.6; }
button.report:hover { opacity: 1; color: var(--pink); }

/* --- Lap page ---------------------------------------------------------------------------------------------------- */
td.time a { color: inherit; text-decoration: none; border-bottom: 1px dashed rgba(var(--cyan-rgb), 0.5); }
td.time a:hover { color: var(--cyan); }
.laptime { color: var(--cyan); font-variant-numeric: tabular-nums; margin-left: 8px; }
.lap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(max(280px, calc((100% - 16px) / 2)), 1fr)); gap: 16px; }
/* Setup: a full-width row under Sectors and Car and conditions, its sections in up to 3 columns. */
.lap-grid > .lap-setup { grid-column: 1 / -1; }
.su-cols { columns: 3 240px; column-gap: 32px; }
.su-cols .su-group { break-inside: avoid; margin-bottom: 4px; }
.su-cols .su-group tr.su-section th { padding-top: 6px; }
.su-head { display: flex; align-items: baseline; gap: 4px; margin-bottom: 6px; }
.su-head h2 { margin: 0; }
.su-toggle { display: none; }
.lap-grid .card { margin: 0; }
.lap-body > .lap-grid { margin-bottom: 18px; }
/* Phones: telemetry right under the sectors, car/conditions and setup below it (owner, 2026-10-12). */
@media (max-width: 600px) {
  .lap-body { display: flex; flex-direction: column; gap: 16px; }
  .lap-body > .lap-grid { display: contents; }
  .lap-body .card { margin: 0; }
  .lap-body .telemetry-card { order: 1; }
  .lap-body .lap-car { order: 2; }
  /* Setup folded to one line until tapped open. */
  .su-fold .su-head { align-items: center; }
  .su-fold .su-head h2 { cursor: pointer; }
  .su-fold .su-toggle { display: block; margin-left: auto; background: none; border: 0; color: var(--cyan); font-size: 20px;
    line-height: 1; padding: 4px 8px; cursor: pointer; transition: transform 0.15s; }
  .su-fold.open .su-toggle { transform: rotate(180deg); }
  .su-fold:not(.open) .su-body { display: none; }
  .su-fold:not(.open) .su-head { margin-bottom: 0; }
  .su-cols { columns: 1; }
}
/* Admin → Visitors and use (#132, stats.js). Two series colours checked for colour-blind separation per theme. */
:root { --stat-a: #c02447; --stat-b: #a1a1aa; }
:root[data-theme="light"] { --stat-a: #c02447; --stat-b: #71717a; }
.stat-ctl { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-tile { border: 1px solid var(--card-edge); border-radius: 12px; padding: 10px 14px; }
.stat-label { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; }
.stat-up { color: var(--green); }
.stat-down { color: var(--pink); }
.stat-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 18px 24px; }
.stat-chart { margin: 0; min-width: 0; }
.stat-chart figcaption { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.stat-plot { position: relative; width: 100%; height: 150px; }
.stat-plot svg { display: block; touch-action: pan-y; }
.stat-bar.a { fill: var(--stat-a); }
.stat-bar.b { fill: var(--stat-b); }
.stat-plot g.hot .stat-bar { filter: brightness(1.25); }
.stat-hit { fill: transparent; }
.stat-grid { stroke: rgba(var(--ink-rgb), 0.08); stroke-width: 1; }
.stat-axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.stat-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.stat-key.a { background: var(--stat-a); }
.stat-key.b { background: var(--stat-b); }
.stat-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 18px 24px; margin-top: 22px; }
.stat-list h3 { margin: 0 0 8px; font-size: 14px; }
.stat-row { display: grid; grid-template-columns: minmax(0, 1fr) 30% 6ch; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; }
.stat-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-row-bar { display: block; height: 8px; }
.stat-row-fill { display: block; height: 8px; border-radius: 0 4px 4px 0; background: var(--stat-a); }
.stat-row-n { font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }
.stat-table { margin-top: 18px; }
.stat-table summary { cursor: pointer; color: var(--cyan); }
.stat-note { font-size: 12px; margin-top: 14px; }
.kv { width: 100%; min-width: 0; border-collapse: collapse; margin-bottom: 8px; }
.kv th { text-align: left; font-weight: 600; color: var(--muted); padding: 5px 12px 5px 0; vertical-align: top; white-space: normal;
  font-size: 11px; width: 42%; }
.kv td { padding: 5px 0; font-variant-numeric: tabular-nums; white-space: normal; text-align: right; }
.kv tbody tr:hover { background: none; }
.telemetry-card { margin-top: 16px; }
.tele-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; font-weight: 600; }
.tele-legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.swatch-me { background: var(--lap-me); }
.swatch-ref { background: var(--lap-ref); }
.tele-grid { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: 20px; align-items: start; }
.tele-map { position: sticky; top: 12px; }
.map-svg { width: 100%; height: auto; display: block; }
.map-track line { stroke-width: 4; stroke-linecap: round; vector-effect: non-scaling-stroke; }
/* The line: a ring, so it doesn't look like a car standing still. The compared car (ref) is drawn bigger, under
   this lap's car: side by side it shows as a ring around it instead of disappearing. */
.map-start { fill: none; stroke: var(--map-start); stroke-width: 2; vector-effect: non-scaling-stroke; }
.map-marker { stroke: var(--bg); stroke-width: 2; vector-effect: non-scaling-stroke; }
.map-marker.me { fill: var(--lap-me); }
.map-marker.ref { fill: var(--lap-ref); }
.map-marker.x1 { fill: var(--lap-x1); } .map-marker.x2 { fill: var(--lap-x2); } .map-marker.x3 { fill: var(--lap-x3); }
.map-scale { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.map-scale i { flex: 1; height: 6px; border-radius: 3px; background: var(--speed-scale); }
.map-scale-angle i { background: linear-gradient(90deg, rgb(56,140,255), rgb(90,98,128) 30%, rgb(255,138,61) 70%, rgb(255,45,85)); }
.tele-charts { position: relative; touch-action: pan-y; cursor: crosshair; user-select: none; }
.tele-chart { padding: 4px 0 6px; }
.tele-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 600; }
.tele-value { color: var(--text); font-variant-numeric: tabular-nums; }
.tele-value em { font-style: normal; color: var(--lap-ref); margin-left: 8px; }
.tele-svg { width: 100%; display: block; background: var(--chart-bg); border-radius: 6px; margin-top: 3px; box-shadow: inset 0 0 0 1px var(--card-edge); }
.tele-sector { stroke: rgba(var(--ink-rgb), 0.35); stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; }
.tele-sectors { position: relative; height: 18px; }
.tele-sectors span { position: absolute; transform: translateX(-50%); font-size: 12px; font-weight: 700; letter-spacing: 1px; color: var(--muted); }
.tele-line { fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.tele-shade { opacity: 0.45; stroke: none; }
.tele-zero { stroke: rgba(var(--ink-rgb), 0.2); stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.tele-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.tele-cursor { position: absolute; top: 0; bottom: 18px; width: 1px; background: rgba(var(--ink-rgb), 0.6); pointer-events: none; }
/* Light page, black charts: one cursor colour can't show on both, so it inverts what's under it. */
:root[data-theme="light"] .tele-cursor { background: #fff; mix-blend-mode: difference; }
.tele-hint { font-size: 13px; margin-top: 10px; }
.hidden { display: none !important; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.pill { padding: 4px 12px; border-radius: 999px; border: 1px solid rgba(var(--cyan-rgb), 0.35); background: var(--surface); color: var(--cyan);
  font: inherit; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; cursor: pointer; }
.pill:hover, .pill:focus-visible { border-color: var(--cyan); background: var(--surface-hover); outline: none; }
.pill.on { background: var(--pill-on); border-color: transparent; color: var(--pill-on-text); box-shadow: var(--pill-on-glow); }
.pill.on:hover, .pill.on:focus-visible { filter: brightness(1.15); }
a.pill { text-decoration: none; display: inline-block; }
.pill[aria-disabled="true"] { opacity: 0.45; cursor: default; }
/* Two kinds of buttons, never mixed up (owner 2026-10-18): pick ONE of a set = .seg (the pills joined in one bar, the
   chosen one filled), something ON or OFF = .switch (a small switch before the label, aria-pressed). In a row
   (.ctl-row) the choices sit left and the switches right. */
.ctl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.ctl-row .switches { display: flex; gap: 6px; margin-left: auto; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; background: var(--surface); border: 1px solid rgba(var(--cyan-rgb), 0.35); border-radius: 999px; }
.seg > .pill { border: 0; background: none; padding: 3px 11px; -webkit-tap-highlight-color: transparent; }
.seg > .pill:not(.on):hover, .seg > .pill:not(.on):focus-visible { background: rgba(var(--cyan-rgb), 0.15); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 5px; border-radius: 999px;
  border: 1px solid rgba(var(--ink-rgb), 0.2); background: var(--surface); color: var(--muted); font: inherit; font-size: 12px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.switch::before { content: ""; width: 24px; height: 14px; border-radius: 7px; background: rgba(var(--ink-rgb), 0.18); transition: background 0.15s; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; left: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--text); transition: transform 0.15s; }
.switch:hover, .switch:focus-visible { border-color: rgba(var(--ink-rgb), 0.45); background: var(--surface-hover); color: var(--text); outline: none; }
.switch[aria-pressed="true"] { color: var(--text); border-color: var(--switch-on); }
.switch[aria-pressed="true"]:hover, .switch[aria-pressed="true"]:focus-visible { border-color: var(--switch-on); box-shadow: var(--pill-on-glow); }
.switch[aria-pressed="true"]::before { background: var(--switch-on); box-shadow: var(--pill-on-glow); }
.switch[aria-pressed="true"]::after { transform: translateX(10px); background: var(--switch-knob); }
tr.old-season td { opacity: 0.5; }
.pace-card h3 { margin: 0 0 8px; font-size: 15px; }
.ibt-row h3 { margin: 0 0 8px; font-size: 15px; word-break: break-all; }
.ibt-row progress { width: 100%; }
.ibt-laps { margin: 6px 0 0; padding-left: 18px; }
.ibt-row .error { color: var(--pink); }
.pace-bars { width: 100%; height: 90px; display: block; margin-bottom: 10px; }
.pace-bars .core { fill: var(--cyan); }
.pace-bars .best { fill: var(--purple); }
.pace-bars .out { fill: var(--muted); opacity: 0.5; }
.tele-zoom-hint { font-size: 12px; margin-left: 6px; }
.tele-charts.dragging { cursor: grabbing; }
.tele-tip { position: absolute; z-index: 2; pointer-events: none; padding: 6px 9px; border-radius: 8px; font-size: 12px; line-height: 1.45;
  background: rgba(var(--base-rgb), 0.92); border: 1px solid var(--card-edge); white-space: nowrap; font-variant-numeric: tabular-nums; }
.c-me { color: var(--lap-me); }
.c-ref { color: var(--lap-ref); }
.mini-summary { margin: 0 0 12px; font-size: 14px; }
.mini-summary .link { background: none; border: 0; padding: 0; font: inherit; color: var(--cyan); text-decoration: underline; cursor: pointer; }
.mini-strip { cursor: zoom-in; }
.mini-block { stroke: var(--chart-bg); stroke-width: 1; vector-effect: non-scaling-stroke; }
.map-view { fill: none; stroke: rgba(var(--ink-rgb), 0.35); stroke-width: 12; stroke-linecap: round; stroke-linejoin: round; }
.map-modes { margin-bottom: 4px; }
.map-road { fill: none; stroke: var(--map-road); stroke-linecap: round; stroke-linejoin: round; }
.map-lines { display: none; }
.map-line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.map-line.me { stroke: var(--lap-me); }
.map-line.ref { stroke: var(--lap-ref); }
.map-line.x { stroke-dasharray: 5 4; stroke-width: 1.5; }
.map-line.x1 { stroke: var(--lap-x1); } .map-line.x2 { stroke: var(--lap-x2); } .map-line.x3 { stroke: var(--lap-x3); }
.map-svg.following .map-track { opacity: 0.18; }
.map-svg.following .map-lines { display: inline; }
.map-svg.following .map-view, .map-svg.following .map-start { display: none; }
.map-svg:not(.following) .map-edge { display: none; }
.map-corner { cursor: pointer; outline: none; }
.map-corner circle { fill: var(--pop); stroke: var(--muted); stroke-width: 1.6; }
.map-corner.me circle { stroke: var(--lap-me); }
.map-corner.ref circle { stroke: var(--lap-ref); }
.map-corner.near circle { stroke-dasharray: 3 2; }
.map-corner:hover circle, .map-corner:focus-visible circle, .map-corner.on circle { stroke-width: 2.6; fill: var(--chip-on); }
.mc-tick { stroke: rgba(var(--ink-rgb), 0.35); stroke-width: 1; }
.mc-num { fill: var(--text); font-size: 10px; font-weight: 700; text-anchor: middle; pointer-events: none; }
.mc-delta { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; fill: var(--muted);
  paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; }
.map-corner.me .mc-delta { fill: var(--lap-me); }
.map-corner.ref .mc-delta { fill: var(--lap-ref); }
.map-svg.following .map-corners { display: none; }
.replay { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--card-edge); }
.replay-bar { display: flex; align-items: center; gap: 8px; }
.replay-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(var(--cyan-rgb), 0.35); background: var(--surface); color: var(--cyan);
  font-size: 15px; line-height: 1; cursor: pointer; }
.replay-btn.play { background: var(--pink); border-color: var(--pink); color: #fff; }
.replay-btn { display: inline-grid; place-items: center; padding: 0; }
.replay-btn svg { width: 15px; height: 15px; }
.replay-btn.play svg { width: 17px; height: 17px; }
.map-under { margin: 4px 0 0; }
/* Player row: ⏮ ▶ time … Follow 1×. Very narrow phones: Follow and 1× drop to a line of their own, still on the right. */
.replay-bar { flex-wrap: wrap; row-gap: 8px; }
.replay-bar .switch { margin-left: auto; }
.replay-time { min-width: 0; }
@media (max-width: 400px) { .replay-bar { gap: 6px; } .replay-time { font-size: 16px; } }
.replay-btn:hover, .replay-btn:focus-visible { border-color: var(--cyan); outline: none; }
.replay-time { flex: 1; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 18px; }
.replay-seek { width: 100%; margin: 10px 0 6px; accent-color: var(--lap-me); }
.replay-modes { margin: 4px 0 10px; }
.replay-inputs { display: grid; gap: 6px; font-size: 13px; }
.ri { display: grid; grid-template-columns: minmax(60px, 1fr) 64px 32px 1fr 1fr 1fr; gap: 6px; align-items: center; }
.ri-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ri-num { font-variant-numeric: tabular-nums; text-align: right; }
.ri-gear { text-align: center; font-weight: 700; }
.ri-bar, .ri-steer { position: relative; height: 8px; border-radius: 4px; background: rgba(var(--ink-rgb), 0.08); overflow: hidden; }
.ri-bar i, .ri-steer i { position: absolute; top: 0; bottom: 0; left: 0; width: 0; border-radius: 4px; }
.ri-bar.thr i { background: var(--green); }
.ri-bar.brk i { background: var(--brake); }
.ri-steer i { background: var(--gold); }
.ri-steer::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: rgba(var(--ink-rgb), 0.4); }
.ri-gap { font-size: 13px; color: var(--muted); margin-top: 2px; }
@media (max-width: 760px) {
  .tele-grid { grid-template-columns: 1fr; }
  .tele-map { position: static; max-width: 360px; margin: 0 auto; }
}
.tele-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tele-head h2 { margin: 0; }
.tele-head .rival-note { flex-basis: 100%; margin: 0; font-size: 0.85em; }
.compare-pick { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--muted); min-width: 0; max-width: 100%; }
/* The select is as wide as its longest option; never wider than the card (phones). */
.compare-pick select { min-width: 0; max-width: 100%; flex: 1 1 auto; text-overflow: ellipsis; }
@media (max-width: 600px) { .compare-pick { flex: 1 1 100%; white-space: nowrap; } }
.compare-pick select { background: var(--field); color: var(--text); border: 1px solid var(--card-edge); border-radius: 8px;
  padding: 6px 10px; font: inherit; max-width: 100%; }
.compare-pick select option, .compare-pick select optgroup { background: var(--pop); color: var(--text); }
#telemetry.loading { opacity: 0.5; transition: opacity 0.2s; }
.tele-head + #telemetry { margin-top: 12px; }
.sector-time { font-weight: 700; padding: 1px 6px; border-radius: 5px; }
.sector-time.purple { color: #fff; background: rgba(var(--purple-rgb), 0.85); }
.sector-time.green { color: var(--on-green); background: var(--green); }
.sector-time.yellow { color: var(--on-gold); background: var(--gold); }
.sector-diff { display: inline-block; min-width: 62px; margin-left: 8px; font-size: 13px; font-weight: 700; text-align: right; }
.sector-diff.green { color: var(--green); }
.sector-diff.yellow { color: var(--gold); }
.sector-key { font-size: 12px; margin: 2px 0 14px; }
.sk { margin-left: 6px; }
.sk.purple { color: var(--purple); }
.sk.green { color: var(--green); }
.sk.yellow { color: var(--gold); }

/* Time Trial / Grand Prix tabs on the home page, with the weekend's sessions below */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.tabs .tab { padding: 8px 18px; border-radius: 999px; border: 1px solid rgba(var(--cyan-rgb), 0.35); color: var(--cyan); text-decoration: none; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; font-size: 14px; }
.tabs .tab:hover, .tabs .tab:focus-visible { border-color: var(--cyan); outline: none; }
.tabs .tab.on { background: var(--pink); border-color: var(--pink); color: #fff; }
.tabs.sub .tab { padding: 5px 14px; font-size: 13px; }
.tabs.sub .tab.on { background: rgba(var(--cyan-rgb), 0.85); border-color: transparent; color: var(--on-cyan); }
.tabs .count { opacity: 0.7; margin-left: 4px; }
/* STOCK / MOD next to the tags on a board card and in subtitles (Assetto Corsa). */
.board-card .badge, .subtitle .badge { display: inline-block; margin-left: 6px; vertical-align: middle; background-color: rgba(var(--base-rgb), 0.75); }

/* Game switch: one page per game. Bigger than the mode tabs below it, so it reads as "which game". */
.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 22px; }
.game {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 14px; text-decoration: none;
  border: 1px solid var(--card-edge); background: var(--surface); color: var(--text);
  border-bottom: 3px solid transparent; transition: border-color 0.15s ease, background 0.15s ease;
}
.game:hover, .game:focus-visible { border-color: var(--cyan); outline: none; }
.game .game-name { font-weight: 800; font-size: 18px; letter-spacing: 0.5px; }
.game .game-meta { color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.game.on { background: linear-gradient(rgba(var(--pink-rgb), 0.12), rgba(var(--pink-rgb), 0.12)), var(--surface); border-color: var(--pink); border-bottom-color: var(--pink); }
.game-ac.on { background: linear-gradient(rgba(var(--orange-rgb), 0.12), rgba(var(--orange-rgb), 0.12)), var(--surface); border-color: var(--orange); border-bottom-color: var(--orange); }
.game-acevo.on { background: linear-gradient(rgba(var(--green-rgb), 0.10), rgba(var(--green-rgb), 0.10)), var(--surface); border-color: var(--green); border-bottom-color: var(--green); }
.game-iracing.on { background: linear-gradient(rgba(var(--purple-rgb), 0.12), rgba(var(--purple-rgb), 0.12)), var(--surface); border-color: var(--purple); border-bottom-color: var(--purple); }

/* Other games' cards: no F1 photo; their own colours (AC orange, EVO green, iRacing purple; the cars tag is cyan) on a dark track-stripe pattern. */
.board-card.game-ac, .board-card.game-acevo, .board-card.game-iracing {
  background:
    linear-gradient(180deg, rgba(var(--base-rgb), 0.2), rgba(var(--base-rgb), 0.95) 65%),
    repeating-linear-gradient(115deg, rgba(var(--ink-rgb), 0.035) 0 14px, transparent 14px 28px),
    radial-gradient(circle at 85% 0%, var(--accent) 0%, transparent 60%),
    var(--bg2);
}
.board-card.game-ac { --accent: rgba(var(--orange-rgb), 0.55); }
.board-card.game-acevo { --accent: rgba(var(--green-rgb), 0.45); }
.board-card.game-ac .tag:not(.cars) { background: rgba(var(--orange-rgb), 0.9); color: #1a0d04; }
.board-card.game-acevo .tag:not(.cars) { background: rgba(var(--green-rgb), 0.85); color: #03170c; }
.board-card.game-iracing { --accent: rgba(var(--purple-rgb), 0.5); }
.board-card.game-iracing .tag:not(.cars) { background: rgba(var(--purple-rgb), 0.9); color: #fff; }
/* Boards as compact rows (preference boardView): no picture, two lines — track and tags left, P1 right. After the game
   colours above so it wins over their backgrounds; the game's colour stays as a stripe on the left. */
.boards.rows { grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 8px; }
.boards.rows .board-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name leader" "info leader"; align-items: center; gap: 2px 12px;
  min-height: 0; padding: 10px 14px; border-radius: 12px; background: rgb(var(--base-rgb)); border-left: 3px solid var(--accent, rgba(var(--pink-rgb), 0.85));
}
.boards.rows .board-card:hover, .boards.rows .board-card:focus-visible { transform: none; }
.boards.rows .board-card h2 { grid-area: name; margin: 0; font-size: 17px; text-shadow: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boards.rows .board-card .tags { grid-area: info; margin: 0; display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; }
.boards.rows .board-card .tag { flex: none; font-size: 10px; padding: 1px 7px; margin: 0; box-shadow: none; }
.boards.rows .board-card .tag.cars { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boards.rows .board-card .meta { display: none; }
.boards.rows .board-card .leader { grid-area: leader; flex-direction: column; align-items: flex-end; gap: 0; font-size: 14px; text-align: right; }
.boards.rows .board-card .leader .time { font-size: 18px; order: -1; }
.board-view { flex: none; }
@media (max-width: 520px) { .games { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); } .game { padding: 10px; } .game .game-name { font-size: 15px; } }
.c-purple { color: var(--purple); }
.ri-head { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: 0.5px; }
.ri-head span:nth-child(2) { text-align: right; }
.ri-head span:nth-child(3) { text-align: center; }
/* 3D replay viewer (web/replay3d.js) */
.viewer3d { position: relative; height: 460px; margin: 0 0 16px; border-radius: 14px; overflow: hidden; background: #0a0b0d;
  border: 1px solid var(--card-edge); }
.viewer3d:fullscreen { height: 100%; border-radius: 0; border: 0; }
.viewer3d.v3d-max { position: fixed; inset: 0; z-index: 50; height: auto; margin: 0; border-radius: 0; }
.v3d-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.v3d-msg { padding: 20px; margin: 0; }
.v3d-top { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; pointer-events: none; }
.v3d-top > * { pointer-events: auto; }
.v3d-cams, .v3d-target { background: rgba(var(--base-rgb), 0.7); flex-wrap: nowrap; }
.v3d-cams .pill, .v3d-target .pill { white-space: nowrap; }
.v3d-target .pill { max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
.v3d-target .pill.c-me:not(.on) { color: var(--lap-me); }
.v3d-target .pill.c-ref:not(.on) { color: var(--lap-ref); }
.v3d-target .pill.c-ref.on { background: var(--lap-ref); }
.v3d-right { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.v3d-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(var(--cyan-rgb), 0.35); background: rgba(var(--base-rgb), 0.7);
  color: var(--cyan); font-size: 15px; cursor: pointer; line-height: 1; }
.v3d-btn:hover, .v3d-btn:focus-visible { border-color: var(--cyan); outline: none; }
.v3d-bottom { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 10px; pointer-events: none; }
.v3d-bottom > * { pointer-events: auto; }
.v3d-target { min-width: 0; }
.v3d-time { font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; text-shadow: 0 1px 6px #000; }
.v3d-hint { font-size: 12px; }
@media (max-width: 760px) {
  /* Phone: the viewer stays on top while the charts scroll underneath. */
  .viewer3d { position: sticky; top: 0; z-index: 5; height: 40vh; margin: 0 0 12px; border-radius: 10px; }
  .v3d-cams { overflow-x: auto; min-width: 0; scrollbar-width: none; }
}
.map-road-real { fill: var(--map-road); stroke: none; }
.map-edge { fill: none; stroke: var(--map-edge); stroke-width: 1; vector-effect: non-scaling-stroke; }
.map-kerb { fill: #d6304f; stroke: none; }
.corner-name { display: block; font-weight: 400; font-size: 11px; color: var(--muted); white-space: nowrap; }
.map-kerb-stripes { fill: none; stroke: #f2f4fb; stroke-linecap: butt; }
.map-pit { fill: none; stroke: var(--map-pit); stroke-linecap: round; stroke-linejoin: round; }
.map-svg:not(.following) .map-kerb, .map-svg:not(.following) .map-kerb-stripes, .map-svg:not(.following) .map-pit { display: none; }
.tele-credit { font-size: 11px; margin-top: 4px; }
.v3d-credit { position: absolute; right: 12px; bottom: 10px; margin: 0; max-width: 55%; text-align: right; font-size: 10px; line-height: 1.3; color: rgba(238, 241, 255, 0.55); }
.v3d-credit a { color: inherit; }
@media (max-width: 760px) { .v3d-credit { max-width: 60%; font-size: 9px; bottom: 60px; } }   /* above the bottom bar */
/* Corner table (lap page) */
.corners { margin-top: 18px; }
.corners h3 { margin: 0 0 4px; font-size: 18px; }
.ct-intro { font-size: 13px; margin: 0 0 10px; max-width: 80ch; }
.ct-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--card-edge); }
.ct { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.ct th, .ct td { padding: 7px 12px; text-align: right; white-space: nowrap; }
.ct thead th { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); background: rgba(var(--ink-rgb), 0.03); }
.ct th[scope="row"], .ct thead th:first-child { text-align: left; }
.ct td span { display: block; line-height: 1.35; }
.ct tbody tr { border-top: 1px solid var(--card-edge); cursor: pointer; }
.ct tbody tr:hover, .ct tbody tr:focus-visible, .ct tbody tr.on { background: rgba(var(--cyan-rgb), 0.08); outline: none; }
.ct tr.gain th[scope="row"]::after { content: " ▲ most gained"; font-size: 11px; color: var(--lap-me); }
.ct tr.loss th[scope="row"]::after { content: " ▼ most lost"; font-size: 11px; color: var(--lap-ref); }
.ct-delta { font-weight: 700; }
/* What's new (#/news) and home teaser */
.news { display: grid; gap: 26px; }
.news-day { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 18px; align-items: start; }
.news-date { margin: 6px 0 0; font-size: 15px; color: var(--muted); position: sticky; top: 12px; }
.news-latest { display: inline-block; margin-top: 6px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; padding: 2px 9px;
  border-radius: 999px; background: var(--pink); color: #fff; }
.news-entries { display: grid; gap: 14px; min-width: 0; }
.news-entry { margin: 0; }
.news-entry h3 { margin: 6px 0 6px; font-size: 22px; }
.news-entry p { margin: 0 0 8px; max-width: 70ch; }
.news-entry ul { margin: 0 0 6px; padding-left: 20px; display: grid; gap: 4px; }
.news-tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 2px 9px;
  border-radius: 999px; border: 1px solid rgba(var(--cyan-rgb), 0.45); color: var(--cyan); }
.news-link { display: inline-block; margin-top: 4px; color: var(--cyan); font-weight: 700; text-decoration: none; }
.news-link:hover, .news-link:focus-visible { text-decoration: underline; }
.news-teaser { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 8px 14px; border-radius: 12px; color: var(--text);
  text-decoration: none; background: linear-gradient(90deg, rgba(var(--pink-rgb), 0.16), rgba(var(--cyan-rgb), 0.08)); border: 1px solid rgba(var(--pink-rgb), 0.35); }
.news-teaser b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-teaser .news-tag { flex: none; border-color: var(--pink); color: #fff; background: var(--pink); }
.news-teaser .muted { flex: none; font-size: 14px; }
.news-teaser-go { flex: none; color: var(--cyan); font-weight: 700; }
.news-teaser:hover b, .news-teaser:focus-visible b { text-decoration: underline; }
@media (max-width: 760px) {
  .news-day { grid-template-columns: 1fr; gap: 8px; }
  .news-date { position: static; }
}
/* Guide (#/guide) */
.guide { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.guide-toc { position: sticky; top: 12px; margin: 0; }
.guide-toc h2 { font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.guide-toc ol { margin: 0; padding-left: 20px; display: grid; gap: 5px; }
.guide-toc a { color: var(--cyan); text-decoration: none; }
.guide-toc a:hover, .guide-toc a:focus-visible { text-decoration: underline; }
.guide-body { display: grid; gap: 16px; min-width: 0; }
.guide-section { margin: 0; scroll-margin-top: 12px; }
.guide-section p, .guide-section li { max-width: 72ch; }
.guide-section ul.steps, .guide-section ol.steps { display: grid; gap: 7px; }
.badge-inline { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 1px; padding: 1px 7px; border-radius: 6px;
  border: 1px solid var(--card-edge); color: var(--muted); }
@media (max-width: 760px) {
  .guide { grid-template-columns: 1fr; }
  .guide-toc { position: static; }
}
/* Home: short pitch */
.pitch { margin: 4px 0 16px; }
.pitch-lead { margin: 0 0 6px; font-size: clamp(26px, 4vw, 36px); font-weight: 900; line-height: 1.1; text-wrap: balance; }
.pitch p:not(.pitch-lead) { margin: 0 0 12px; max-width: 72ch; color: var(--text); font-size: 17px; }
.pitch-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pitch-actions .btn { text-decoration: none; }
.pitch .pitch-short { display: none; }

.card h3 { margin: 18px 0 2px; font-size: 16px; }
/* My account → Preferences (preferences.js): one row per setting, name + hint left, control right. */
.pref-card h2 { margin-bottom: 4px; }
.pref-card .look-tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 8px 0; }
.pref-card .look-tile { gap: 6px; padding: 6px; }
.pref-card .look-preview { height: 48px; padding: 6px; }
.pref-card .look-preview b { top: 5px; left: 8px; font-size: 14px; }
.pref-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 20px; align-items: center; padding: 10px 0; border-top: 1px solid var(--card-edge); }
.pref-row:first-of-type { border-top: 0; }
.pref-label b { display: block; }
.pref-label small { display: block; font-size: 13px; line-height: 1.35; }
.pref-ctl { display: flex; justify-content: flex-end; }
.pref-ctl .pref-select { margin-top: 0; padding: 5px 8px; }
.pref-select { cursor: pointer; }
.pref-select:hover, .pref-select:focus-visible { border-color: rgba(var(--ink-rgb), 0.4); background-color: var(--surface-hover); }
.look-tile:hover { border-color: rgba(var(--ink-rgb), 0.4); }
.pref-switches { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
@media (max-width: 600px) {
  .pref-row { grid-template-columns: minmax(0, 1fr); }
  .pref-ctl, .pref-switches { justify-content: flex-start; }
}
.pref-select { font: inherit; color: var(--text); background: var(--field); border: 1px solid var(--card-edge); border-radius: 10px;
  padding: 8px 10px; margin-top: 6px; max-width: 100%; }

/* Home: board count + Order menu on one line */
.boards-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 22px; }
.boards-head .subtitle { margin: 0 auto 0 0; }
/* Phones: the count and the Cards/Rows switch on one line, Cars and Order side by side below it. */
@media (max-width: 600px) {
  .boards-head .subtitle { flex: 1 1 auto; }
  .boards-head .board-view { order: 1; }
  .boards-head .board-order { order: 2; flex: 1 1 40%; min-width: 0; }
  .boards-head .board-order select { flex: 1; min-width: 0; width: 100%; }
}
.board-order { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 700; }
.board-order select { font: inherit; font-weight: 600; color: var(--text); background: var(--card); border: 1px solid var(--card-edge);
  border-radius: 10px; padding: 6px 10px; }

/* Home: Your PBs (signed in) — a row of small cards, scrolls sideways on phones */
.pbs { margin: 0 0 16px; }
.pbs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pbs-head h2 { margin: 0 0 8px; font-size: 20px; }
.pbs-head a { color: var(--cyan); font-weight: 700; text-decoration: none; }
.pbs-links { display: inline-flex; gap: 16px; align-items: baseline; }
.pbs-links .link { color: var(--muted); font: inherit; font-weight: 600; font-size: 14px; background: none; border: 0; cursor: pointer; padding: 0; }
.pbs-links .link:hover, .pbs-links .link:focus-visible { color: var(--text); text-decoration: underline; }
.pbs-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 4px;
  scroll-snap-type: x mandatory; scrollbar-width: none; }
.pb { scroll-snap-align: start; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; color: var(--text);
  text-decoration: none; border: 1px solid var(--card-edge); background: var(--card); }
.pb:hover, .pb:focus-visible { border-color: var(--pink); outline: none; }
.pb-track { font-weight: 800; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-meta { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-time { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 4px; }
.pb-pos { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-pos b { color: var(--cyan); font-size: 16px; }
.pb-pos.p1 b { color: var(--pink); }
.pb-pos small { margin-right: 6px; }
@media (max-width: 600px) { .pbs-row { grid-auto-columns: 72%; } }
.ch-targets { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 6px 0 2px; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); }
.ch-target.won { color: var(--text); font-weight: 700; }
.challenge .pb-pos b { color: var(--text); }
@media (max-width: 600px) {
  .pitch .pitch-long, .pitch .pc-only, .news-teaser .muted { display: none; }
  .pitch .pitch-short { display: block; }
}
/* Home for visitors (#83): landing on "/" above the boards (landingHtml in app.js). */
.landing { margin: 4px 0 36px; }
.landing h2 { margin: 0 0 14px; font-size: clamp(24px, 3vw, 30px); line-height: 1.15; }
.landing p { line-height: 1.55; }
.land-kicker { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan); }
.land-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 28px 40px; margin: 8px 0 40px; }
.land-hero-text { flex: 1 1 380px; min-width: 0; }
.land-title { margin: 10px 0 14px; font-size: clamp(32px, 5vw, 54px); font-weight: 900; line-height: 1.05; text-wrap: balance; }
.land-lead { margin: 0 0 18px; max-width: 60ch; font-size: 18px; color: var(--text); }
.land-games { margin: 14px 0 0; font-size: 15px; color: var(--muted); }
.land-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.land-actions .btn { text-decoration: none; font-size: 17px; padding: 12px 20px; }
.land-shot { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--card-edge); background: #0a0b0d; }
.land-hero-shot { flex: 1 1 440px; min-width: 0; width: auto; max-width: 100%; }
.land-band { margin: 0 -16px 40px; padding: 32px 16px; border-block: 1px solid var(--card-edge); background: var(--surface); }
.land-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px 28px; }
.land-step h3 { margin: 8px 0 6px; font-size: 20px; }
.land-step p { margin: 0; color: var(--muted); }
.land-num { font-size: 38px; font-weight: 900; line-height: 1; color: var(--pink); }
.land-step:nth-child(2) .land-num { color: var(--cyan); }
.land-step:nth-child(3) .land-num { color: var(--gold); }
.land-whos { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 0 0 40px; }
.land-who { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.land-who h3 { margin: 0; font-size: 21px; }
.land-who p { margin: 0; color: var(--muted); flex: 1; }
.land-who:nth-child(1) .land-kicker { color: var(--pink); }
.land-who:nth-child(3) .land-kicker { color: var(--gold); }
.land-features { display: flex; flex-direction: column; gap: 40px; }
.land-row { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 36px; }
.land-row.flip { flex-wrap: wrap-reverse; flex-direction: row-reverse; }
.land-row > .land-copy { flex: 1 1 320px; min-width: 0; }
.land-row > .land-shot, .land-row > .land-coach { flex: 1 1 440px; min-width: 0; width: auto; max-width: 100%; }
.land-copy p { margin: 0 0 10px; max-width: 60ch; }
.land-copy .land-kicker { margin-bottom: 8px; color: var(--purple); }
.land-coach { margin: 0; }
.land-coach ul { margin: 10px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; line-height: 1.5; }
.land-plans { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; }
.land-plans .land-copy { flex: 1 1 420px; min-width: 0; }
.phone-only { display: none; }
@media (max-width: 600px) {
  .land-actions .pc-only { display: none; }
  .land-actions .phone-only { display: inline-block; }
  .land-hero { margin-bottom: 28px; }
}

.guide-fig { margin: 14px 0 4px; }
.guide-fig img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--card-edge); background: #0a0b0d; }
.guide-fig figcaption { margin-top: 6px; font-size: 13px; color: var(--muted); }
.guide-figs { display: grid; grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.guide-fig.tall img { max-height: 560px; width: auto; max-width: 100%; margin: 0 auto; }
@media (max-width: 760px) { .guide-figs { grid-template-columns: 1fr; } }
.guide-figs.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .guide-figs.even { grid-template-columns: 1fr; } }
/* Coach tips (lap page) */
.coach { margin-top: 18px; }
.coach h3 { margin: 0 0 8px; font-size: 18px; }
.coach h3 .muted { font-size: 14px; font-weight: 400; }
.coach-tips { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.coach-tip { display: grid; gap: 3px; width: 100%; text-align: left; font: inherit; color: var(--text); cursor: pointer; padding: 10px 14px;
  border-radius: 10px; border: 1px solid var(--card-edge); border-left: 3px solid var(--pink); background: rgba(var(--pink-rgb), 0.06); }
.coach-tip:hover, .coach-tip:focus-visible { border-color: var(--pink); outline: none; }
.coach-tip b { color: var(--pink-soft); }
.coach-advice { color: var(--cyan); }
/* AI coach */
.ai-coach { display: grid; gap: 8px; margin-bottom: 12px; }
.ai-coach-btn { justify-self: start; border-color: rgba(var(--purple-rgb), 0.6); background: linear-gradient(180deg, rgba(var(--purple-rgb), 0.25), rgba(var(--purple-rgb), 0.08)); }
.ai-coach-btn:disabled { opacity: 0.6; cursor: wait; }
.ai-coach-note { font-size: 13px; }
/* While the AI coach works (owner 2026-10-22): a turning ring beside the text, and the button's stars turn. */
.ai-wait { display: flex; align-items: center; gap: 10px; color: var(--cyan); font-weight: 600; }
.ai-spin { width: 16px; height: 16px; flex-shrink: 0; border-radius: 50%; border: 2px solid rgba(var(--cyan-rgb), 0.25); border-top-color: var(--cyan); animation: ai-turn 0.8s linear infinite; }
.ai-star { display: inline-block; }
button:disabled .ai-star { animation: ai-turn 1.4s linear infinite; }
@keyframes ai-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ai-spin, button:disabled .ai-star { animation-duration: 3s; } }
.ai-coach-out p { margin: 0 0 8px; }
.ai-summary { font-size: 16px; }
.coach-tip.ai { border-left-color: var(--purple); background: rgba(var(--purple-rgb), 0.07); }
.coach-tip.ai b { color: var(--purple-soft); }
.ai-coach-foot { font-size: 12px; }
.ai-coach-out .link { background: none; border: 0; padding: 0; font: inherit; color: var(--cyan); text-decoration: underline; cursor: pointer; }
li.coach-tip { display: grid; gap: 4px; }
.ai-topic { text-transform: uppercase; letter-spacing: 1px; font-size: 12px; }
.ai-corners { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.coach-tip .ai-pin { align-self: flex-start; font-size: 13px; margin-top: 2px; }
.corner-chip { min-width: 28px; padding: 2px 8px; border-radius: 999px; border: 1px solid rgba(var(--purple-rgb), 0.6); background: none; color: var(--purple-soft);
  font: inherit; font-weight: 700; cursor: pointer; }
.corner-chip:hover, .corner-chip:focus-visible { background: rgba(var(--purple-rgb), 0.2); outline: none; }
/* Plans */
.plan-badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-decoration: none; border: 1px solid var(--card-edge); color: var(--muted); }
.plan-badge.plan-pro, .plan-badge.plan-elite, .plan-badge.plan-venue { border-color: var(--purple); color: var(--purple-soft); }
.acct-pop .plan-badge { margin-left: 6px; font-size: 11px; }
.plan-welcome { border-color: var(--purple); }
.pro-tag { display: inline-block; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  text-decoration: none; border: 1px solid var(--purple); color: var(--purple-soft); }
.pill.locked { opacity: 0.55; text-decoration: none; }
.signin-teaser { margin-top: 18px; }
.signin-teaser h3 { margin: 0 0 6px; }
.signin-teaser .link { background: none; border: 0; font: inherit; color: var(--cyan); text-decoration: underline; cursor: pointer; margin-left: 8px; }
.ct.plans th[scope="row"] { font-weight: 600; white-space: normal; }
.ct.plans td, .ct.plans thead th { text-align: center; }
.ct.plans thead th small { display: block; font-size: 10px; font-weight: 400; letter-spacing: 0.5px; text-transform: none; }
.ct.plans .current { background: rgba(var(--purple-rgb), 0.10); }
.ct.plans tbody tr { cursor: default; }
.pl-yes { color: var(--green); font-weight: 700; }
.pl-no { color: var(--muted); }
.plans-note { margin-top: 16px; }
.plans-note .link { background: none; border: 0; font: inherit; color: var(--cyan); text-decoration: underline; cursor: pointer; }
.founding-check { margin-right: 12px; font-size: 13px; color: var(--muted); white-space: nowrap; }

/* Profiles, friends and groups (social.js) */
textarea { font: inherit; color: var(--text); background: var(--field); border: 1px solid var(--card-edge); border-radius: 10px; padding: 10px 12px; width: 100%; resize: vertical; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 16px; }
.grid2 label { display: flex; flex-direction: column; gap: 4px; }
.grid2 input { width: 100%; }
.avatar { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; overflow: hidden; vertical-align: middle;
  background: linear-gradient(135deg, var(--pink), var(--purple)); border: 1px solid var(--card-edge); }
.avatar-initials { font-weight: 700; color: #fff; font-size: 0.9em; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar img:not([src]) { display: none; }
.profile-head { display: flex; gap: 18px; align-items: center; margin: 8px 0 18px; }
.profile-head h1 { margin: 0; }
.profile-head .avatar-initials { font-size: 32px; }
.profile-pic { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.profile-pic .avatar-initials { font-size: 26px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { border-radius: 14px; border: 1px solid var(--card-edge); background: var(--card); padding: 14px; text-align: center; }
.stat b { display: block; font-size: 24px; color: var(--cyan); }
.stat span { color: var(--muted); font-size: 13px; }
/* Driver rating (#38): tier badges and the rating card on a profile. */
.badge.tier-bronze { background: rgba(205, 127, 50, 0.16); color: var(--tier-bronze); border-color: rgba(205, 127, 50, 0.45); }
.badge.tier-silver { background: rgba(var(--ink-rgb), 0.08); color: var(--tier-silver); border-color: var(--card-edge); }
.badge.tier-gold { background: rgba(var(--gold-rgb), 0.15); color: var(--tier-gold); border-color: rgba(var(--gold-rgb), 0.45); }
.badge.tier-platinum { background: rgba(var(--cyan-rgb), 0.12); color: var(--cyan); border-color: rgba(var(--cyan-rgb), 0.4); }
.badge.tier-diamond { background: rgba(var(--purple-rgb), 0.16); color: var(--tier-diamond); border-color: rgba(var(--purple-rgb), 0.45); }
.rating-card { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; }
.rating-card .rating-value { font-size: 40px; font-weight: 800; color: var(--cyan); line-height: 1; }
.rating-card .rating-tier .badge { font-size: 13px; padding: 3px 10px; }
.rating-card .rating-next { color: var(--muted); font-size: 13px; margin-top: 6px; }
.rating-card svg { flex: 1 1 220px; min-width: 0; max-width: 100%; height: 64px; }
.rating-card svg polyline { fill: none; stroke: var(--cyan); stroke-width: 2; vector-effect: non-scaling-stroke; }
.rating-card svg line { stroke: var(--card-edge); stroke-width: 1; vector-effect: non-scaling-stroke; }
.badges-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.achievement { border-radius: 12px; border: 1px solid var(--card-edge); padding: 10px 12px; opacity: 0.55; display: flex; flex-direction: column; gap: 2px; }
.achievement.earned { opacity: 1; border-color: var(--gold); }
.achievement span, .achievement small { color: var(--muted); font-size: 13px; }
.people { list-style: none; padding: 0; margin: 6px 0 12px; }
.person { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--card-edge); flex-wrap: wrap; }
.person a { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.person .avatar-initials { font-size: 12px; }
.group { border-top: 1px solid var(--card-edge); padding-top: 10px; margin-top: 10px; }
/* Board page: the track name with the Track menu on the right; on phones the menu goes under the name, full width. */
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 4px; }
.board-head h1 { margin: 0; min-width: 0; }
.board-track select { max-width: 280px; }
@media (max-width: 600px) {
  .board-head { flex-wrap: wrap; }
  .board-track { flex: 1 1 100%; }
  .board-track select { flex: 1; min-width: 0; max-width: none; }
}
.board-filter { margin: -6px 0 12px; gap: 8px 16px; flex-wrap: wrap; }
a.driver-link { color: inherit; text-decoration: none; }
a.driver-link:hover { text-decoration: underline; }
table.vis select { width: 100%; max-width: 240px; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--cyan); text-decoration: underline; cursor: pointer; }
button.link.danger { color: var(--pink); }
/* Lap page, Wrong driver? (rig owner): under the Rig row of the car card. */
.driver-fix { margin-top: 6px; font-size: 14px; }
.driver-fix p { margin: 4px 0; }
.driver-fix-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.driver-fix-form select { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--card-edge); border-radius: 10px; padding: 6px 10px; margin-left: 6px; }
.driver-fix-form .row { display: flex; align-items: center; gap: 12px; }
select { font: inherit; color: var(--text); background: var(--field); border: 1px solid var(--card-edge); border-radius: 10px; padding: 8px 10px; }
select option { background: var(--pop); color: var(--text); }
label.btn input[type=file] { display: none; }
#profile-form.stack { max-width: 760px; }
#profile-form p .inline, #profile-form p label.inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; margin-left: 6px; }
#profile-form h3 { margin: 10px 0 0; }
#privacy-form.stack { max-width: 760px; }
#privacy-form .name-vis { display: grid; gap: 8px; margin-top: 8px; padding: 12px 14px; border: 1px solid var(--card-edge); border-radius: 12px; background: rgba(var(--base-rgb), 0.35); }
#privacy-form .name-vis .row { gap: 12px; align-items: center; }
#privacy-form .vis-head { justify-content: space-between; align-items: center; gap: 12px; margin-top: 6px; }
#privacy-form .vis-head h3 { margin: 0; }
#vis-all { width: 100%; max-width: 240px; color: var(--muted); }
#privacy-form > p.muted { margin: -6px 0 0; }
table.vis th { vertical-align: middle; }
#group-create { margin-top: 14px; }
/* The bell */
.bell-wrap { position: relative; display: inline-flex; }
.topnav .bell { position: relative; display: inline-flex; align-items: center; color: var(--cyan); background: none; border: 0; cursor: pointer; padding: 6px 8px; }
.bell-count { position: absolute; top: 0; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--pink); color: #fff;
  font-size: 11px; line-height: 17px; text-align: center; box-shadow: 0 0 10px rgba(var(--pink-rgb), 0.6); }
.bell-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; width: min(340px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto;
  background: var(--pop); border: 1px solid var(--card-edge); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-pop); font-weight: 400; }
.bell-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.bell-panel h3 { margin: 0; font-size: 15px; }
.bell-head .link { font-size: 13px; font-weight: 700; color: var(--cyan); }
/* Not .notice: that is the floating toast (app.js), position: fixed — it pulled the bell's lines out of the panel. */
.bell-panel .bell-item { position: relative; padding: 8px 0; border-bottom: 1px solid var(--card-edge); display: flex; flex-direction: column; gap: 6px;
  background: var(--pop); touch-action: pan-y; transition: transform 0.25s ease, opacity 0.25s ease, max-height 0.25s ease 0.15s; max-height: 400px; }
.bell-panel .bell-item[data-n-key] { padding-right: 26px; }
.bell-panel .bell-item.unread { border-left: 3px solid var(--pink); padding-left: 8px; }
.bell-panel .bell-item.dragging { transition: none; }
.bell-panel .bell-item.gone { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; border-bottom-width: 0; overflow: hidden; }
.bell-close { position: absolute; top: 4px; right: 0; width: 24px; height: 24px; border: 0; border-radius: 999px; background: none; color: var(--muted);
  font-size: 18px; line-height: 22px; cursor: pointer; padding: 0; }
.bell-close:hover, .bell-close:focus-visible { color: var(--text); background: rgba(var(--ink-rgb), 0.08); }
.bell-panel .bell-item a, .topnav .bell-panel a { color: var(--cyan); padding: 0; }
.bell-panel .row { display: flex; gap: 10px; align-items: center; }
.bell-panel .btn.small { padding: 5px 12px; font-size: 13px; }
.bell-panel .bell-more { display: block; margin-top: 8px; font-weight: 700; }
@media (max-width: 600px) { .bell-panel { position: fixed; left: 16px; right: 16px; width: auto; } }

/* My laps (#/laps, lap history) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.laps-pick label.inline, .laps-tools label.inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.laps-pick label.inline { flex: 1 1 100%; min-width: 0; }
.laps-pick select { flex: 1 1 auto; min-width: 0; width: 100%; max-width: 560px; text-overflow: ellipsis; }
.laps-tools { margin: 14px 0 10px; }
.laps-tools input[type="checkbox"] { flex: none; width: 18px; height: 18px; }
.laps-tools .spacer { flex: 1 1 auto; }
.laps-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 16px 0 0; }
.laps-summary > div { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--card-edge); background: var(--card); }
.laps-summary small { display: block; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.laps-summary b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; margin: 2px 0; }
.laps-summary span { font-size: 13px; }
.laps-table { min-width: 0; }
.claim-boards { min-width: 0; margin-bottom: 8px; }
.laps-table td.pick, .laps-table th.pick { width: 36px; padding-right: 0; }
.laps-table td.pick input { width: 18px; height: 18px; }
.laps-table .time { font-size: 16px; }
.laps-table td.status .badge { margin-right: 6px; }
.laps-table .tele-mark { font-size: 14px; }
.laps-table td.when small { display: block; font-size: 12px; }
.laps-table tr.day-row th { padding-top: 16px; font-size: 12px; color: var(--cyan); background: rgba(var(--ink-rgb), 0.02); white-space: normal; }
/* Columns as wide as their content; the status column (badges, 📈) takes what's left, so nothing spreads out. */
.laps-table th, .laps-table td { width: 1%; }
.laps-table th.status, .laps-table td.status { width: auto; }
.laps-table tr.day-row th, .laps-table tr.driver-row td { width: auto; }
.laps-table td.when .lap-driver { display: block; font-size: 12px; margin-top: 2px; }
.laps-table tr.driver-row td { white-space: normal; }
.laps-foot { font-size: 13px; margin-top: 10px; }
.laps-more { text-align: center; margin: 14px 0 0; }
@media (max-width: 640px) {
  .laps-table th.tyre, .laps-table td.tyre { display: none; }
  .laps-table td.when { display: table-cell; }
  .laps-table th.when { display: table-cell; }
  .laps-table th, .laps-table td { padding: 10px 5px; }
  .laps-table td.pick, .laps-table th.pick { width: 24px; }
  .laps-table .time { font-size: 15px; }
  /* Badges and the time/rig column wrap, so a row never needs sideways scrolling. */
  .laps-table td.status { white-space: normal; line-height: 1.9; }
  .laps-table td.status .badge { display: inline-block; white-space: nowrap; margin-right: 4px; font-size: 10px; padding: 1px 5px; line-height: 1.6; }
  .laps-table td.when { font-size: 13px; }
  .laps-table td.when small { max-width: 84px; overflow: hidden; text-overflow: ellipsis; }
  .laps-table td.del, .laps-table th.del { width: 28px; padding-right: 6px; }
  .laps-table .day-figures { display: block; margin-top: 2px; }
  .laps-tools .spacer { display: none; }
}
tr.gap-row td { text-align: center; color: var(--muted); padding: 4px; letter-spacing: 4px; }

/* My account: sections with a side menu (tabs on phones) */
.acct { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; align-items: start; }
.acct-nav { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: 16px; border: 1px solid var(--card-edge); background: var(--card); }
.acct-nav a { padding: 9px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
.acct-nav a:hover, .acct-nav a:focus-visible { background: rgba(var(--cyan-rgb), 0.08); outline: none; }
.acct-nav a.on { background: rgba(var(--cyan-rgb), 0.15); color: var(--cyan); }
.acct-body > .card:first-child { margin-top: 0; }
.acct-nav a:last-child { color: var(--muted); }
.acct-nav a.on:last-child { color: var(--cyan); }
@media (max-width: 760px) {
  .acct { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .acct-nav { position: static; flex-direction: row; overflow-x: auto; padding: 6px; scrollbar-width: none; }
  .acct-nav a { white-space: nowrap; padding: 7px 12px; }
}
.toggles { list-style: none; padding: 0; margin: 10px 0 0; }
.toggles li { padding: 10px 0; border-top: 1px solid var(--card-edge); }
.toggle { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.toggle input { flex: none; width: 20px; height: 20px; margin-top: 2px; }
.toggle small { display: block; font-size: 13px; }

/* Account menu (top right) */
.acct-menu { position: relative; display: inline-flex; }
.topnav .acct-btn { display: inline-flex; align-items: center; gap: 8px; color: var(--cyan); background: none; border: 0; font: inherit; cursor: pointer; padding: 4px 8px; }
.acct-btn .avatar { font-size: 11px; }
.acct-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 210px; display: flex; flex-direction: column;
  background: var(--pop); border: 1px solid var(--card-edge); border-radius: 14px; padding: 6px; box-shadow: var(--shadow-pop); }
.acct-pop[hidden] { display: none; }
.topnav .acct-pop a, .topnav .acct-pop .link { padding: 8px 12px; border-radius: 8px; text-align: left; font-weight: 600; color: var(--text); }
.topnav .acct-pop a:hover, .topnav .acct-pop .link:hover, .topnav .acct-pop a:focus-visible { background: rgba(var(--cyan-rgb), 0.1); outline: none; }
.acct-pop hr { border: 0; border-top: 1px solid var(--card-edge); margin: 4px 6px; }
@media (max-width: 600px) { .acct-pop { position: fixed; left: 16px; right: 16px; } }
#acct-admin { display: contents; }

/* Setups (#19) */
.su-help { font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.su-help label.inline { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.su-key, table.setups td.differs small { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; font-size: 12px; font-weight: 700;
  color: var(--on-gold); background: var(--gold); }
.su-wrap { max-width: 100%; }
table.setups { min-width: 0; }
table.setups th[scope="row"] { position: sticky; left: 0; z-index: 1; background: var(--sticky-bg); font-weight: 600; white-space: normal; min-width: 150px; }
table.setups thead th { text-transform: none; letter-spacing: 0; font-size: 13px; vertical-align: bottom; text-align: right; }
table.setups thead th a { display: block; color: var(--text); font-weight: 700; font-size: 14px; text-decoration: none; }
table.setups thead th .su-rank { display: block; color: var(--muted); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
table.setups thead th .su-time { display: block; color: var(--cyan); font-variant-numeric: tabular-nums; }
table.setups .ref { background: rgba(var(--gold-rgb), 0.06); }
table.setups .mine { background: rgba(var(--cyan-rgb), 0.08); }
table.setups tbody tr { cursor: default; }
table.setups tr.su-section th, .kv tr.su-section th { padding-top: 14px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--cyan); text-align: left; background: none; }
table.setups tr.su-info td { color: var(--muted); font-size: 13px; white-space: normal; }
.su-copy { font-size: 12px; margin-left: 8px; }
.assist-note { font-size: 13px; margin: 6px 0 0; }
.laps-table td.del, .laps-table th.del { width: 32px; padding-left: 0; text-align: center; }
.lap-del { color: var(--muted); font-size: 14px; }
.lap-del:hover, .lap-del:focus-visible { color: var(--pink); }
/* Guide: the achievements overview reads as name → how to earn it, left to right. */
table.kv.badge-list th { width: 34%; text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--text); font-weight: 700; }
table.kv.badge-list td { text-align: left; color: var(--muted); }
/* Driver rankings (#/drivers) */
.rank-tabs { flex-wrap: wrap; }
.rank-what { margin: 0 0 10px; }
.rank-table td.num { font-variant-numeric: tabular-nums; font-weight: 700; }
.rank-table tr.you td { background: rgba(var(--cyan-rgb), 0.08); }
.rank-note { margin-top: 12px; }

/* Pro checkout (billing.js) */
.buy-pro { margin: 12px 0 6px; }
p.ok { color: var(--green); }

/* Administration (finance.js) */
.ct.fin tr.fin-total th, .ct.fin tr.fin-total td { border-top: 1px solid var(--card-edge); font-weight: 700; }
.admin-test { border-color: var(--orange); }

/* Pro offers (#41) */
.pro-offer { font-size: 13px; font-weight: 700; color: var(--pink); text-decoration: none; white-space: nowrap; }
.pro-offer:hover { text-decoration: underline; }
.pro-card { border-color: rgba(var(--pink-rgb), 0.45); }
.pro-card h2 { margin-top: 0; }

/* New accounts closed (in development): greyed-out "Create account", a tap shows why. */
.signup-closed, .topnav .link.primary.signup-closed { background: rgba(var(--ink-rgb), 0.08) !important; color: var(--muted) !important; box-shadow: none !important; cursor: not-allowed; border-color: var(--card-edge); }
.notice { position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 1000; width: max-content; max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px; border-radius: 12px; background: var(--notice-bg); color: var(--text); border: 1px solid var(--card-edge);
  box-shadow: var(--shadow); font-weight: 600; }

/* Cookie banner (#58, consent.js), laid out like Cookiebot's: tabs, text, category switches, Deny / Allow selection /
   Allow all. Bottom of the screen, never covering more than it needs; scrolls itself on small screens. */
.cc-banner { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 1100; width: min(920px, calc(100vw - 24px));
  max-height: min(78vh, 640px); overflow-y: auto; border-radius: 16px; border: 1px solid var(--card-edge); background: var(--pop);
  color: var(--text); box-shadow: var(--shadow-pop); }
.cc-inner { padding: 6px 22px 18px; }
.cc-tabs { display: flex; border-bottom: 1px solid var(--card-edge); margin: 0 -22px 14px; padding: 0 12px; }
.cc-tab { flex: 1; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); font: inherit; font-weight: 700;
  padding: 12px 8px 10px; cursor: pointer; }
.cc-tab.on { color: var(--text); border-bottom-color: var(--pink); }
.cc-tab:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.cc-title { margin: 0 0 6px; font-size: 18px; }
.cc-panel p { margin: 0 0 10px; line-height: 1.5; font-size: 15px; }
.cc-panel a { color: var(--cyan); }
.cc-cat { border-bottom: 1px solid var(--card-edge); padding: 8px 0; }
.cc-cat summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.cc-count { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 999px; font-size: 12px; text-align: center;
  background: rgba(var(--ink-rgb), 0.08); color: var(--muted); }
.cc-cat-text, .cc-none { font-size: 14px; color: var(--muted); }
.cc-items { list-style: none; margin: 6px 0 4px; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.cc-items li { padding: 8px 10px; border-radius: 10px; background: rgba(var(--ink-rgb), 0.04); }
.cc-items small { color: var(--muted); }
.cc-bottom { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--card-edge); margin-top: 6px; padding-top: 14px; }
.cc-switches { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.cc-switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; cursor: pointer; }
.cc-switch.locked { cursor: default; opacity: 0.75; }
.cc-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cc-slider { position: relative; width: 38px; height: 22px; border-radius: 999px; background: rgba(var(--ink-rgb), 0.2); transition: background 0.15s; flex: none; }
.cc-slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.cc-switch input:checked + .cc-slider { background: var(--pink); }
.cc-switch input:checked + .cc-slider::after { transform: translateX(16px); }
.cc-switch input:focus-visible + .cc-slider { outline: 2px solid var(--cyan); outline-offset: 2px; }
.cc-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.cc-btn { font: inherit; font-weight: 700; padding: 9px 16px; border-radius: 10px; border: 2px solid var(--pink); background: var(--surface); color: var(--text); cursor: pointer; }
.cc-btn.cc-primary { background: var(--pink); color: #fff; }
.cc-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
@media (max-width: 600px) {
  .cc-banner { bottom: 8px; border-radius: 14px; }
  .cc-inner { padding: 4px 14px 14px; }
  .cc-tabs { margin: 0 -14px 12px; padding: 0 4px; }
  .cc-bottom { flex-direction: column; align-items: stretch; }
  .cc-buttons { display: grid; grid-template-columns: 1fr 1fr; }
  .cc-buttons .cc-primary { grid-column: 1 / -1; order: -1; }
}
.cookie-table td, .cookie-table th { white-space: normal; text-align: left; vertical-align: top; }
.cookie-table { min-width: 640px; }
.cc-page-count { font-size: 16px; font-weight: 400; }
.cookie-table tbody th { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); font-family: ui-monospace, Menlo, Consolas, monospace; }

/* Guided setup (#/setup, #61): steps one at a time, done ones collapsed with a tick; home card with chips. */
.setup-progress { height: 6px; border-radius: 999px; background: rgba(var(--ink-rgb), 0.08); margin: 0 0 18px; overflow: hidden; }
.setup-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--pink), var(--cyan)); transition: width 0.3s; }
.setup-steps { list-style: none; padding: 0; margin: 0; }
.setup-step { padding: 14px 20px; }
.setup-step.open { border-color: rgba(var(--cyan-rgb), 0.5); padding-bottom: 20px; }
.setup-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.setup-head h2 { margin: 0; font-size: 18px; }
.setup-step:not(.open) .setup-head h2 { color: var(--muted); }
.setup-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800;
  border: 1px solid var(--card-edge); }
.setup-step.open .setup-num { background: rgba(var(--cyan-rgb), 0.85); color: var(--on-cyan); border-color: transparent; }
.setup-step.done .setup-num { background: rgba(var(--green-rgb), 0.15); color: var(--green); border-color: rgba(var(--green-rgb), 0.4); }
.setup-sum { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setup-head .link { margin-left: auto; }
.setup-body { margin-top: 12px; }
.setup-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 12px; }
.setup-option { display: grid; gap: 4px; text-align: left; font: inherit; color: var(--text); cursor: pointer; padding: 14px;
  border-radius: 14px; border: 1px solid var(--card-edge); background: var(--surface); }
.setup-option:hover, .setup-option:focus-visible { border-color: var(--cyan); outline: none; }
.setup-option.on { border-color: var(--cyan); background: rgba(var(--cyan-rgb), 0.12); }
.setup-option .muted { font-size: 13px; }
.setup-table { border-collapse: collapse; margin: 4px 0 12px; width: auto; min-width: 0; }
.setup-table td { padding: 6px 16px 6px 0; border-bottom: 1px solid var(--card-edge); }
.setup-firstlap { display: inline-flex; flex-direction: column; gap: 2px; padding: 12px 16px; margin-bottom: 12px; border-radius: 14px;
  border: 1px solid rgba(var(--green-rgb), 0.45); background: rgba(var(--green-rgb), 0.06); max-width: 100%; }
.setup-card { border-color: rgba(var(--cyan-rgb), 0.45); }
.setup-card h2 { margin-top: 0; }
.setup-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.setup-chip { padding: 4px 12px; border-radius: 999px; font-size: 13px; color: var(--muted); border: 1px solid var(--card-edge); }
.setup-chip.done { color: var(--green); border-color: rgba(var(--green-rgb), 0.4); background: rgba(var(--green-rgb), 0.08); }

/* My progress (#64): line charts over the days driven. */
.prog-card h3 { margin: 18px 0 6px; font-size: 15px; }
.prog-sum { margin: 6px 0; }
.prog-card { margin-top: 16px; }
.prog-chart { max-width: 100%; height: auto; display: block; margin: 12px 0 6px; overflow: visible; }
.prog-axis { stroke: var(--card-edge); stroke-width: 1; }
.prog-grid { stroke: rgba(var(--ink-rgb), 0.07); stroke-width: 1; stroke-dasharray: 3 4; }
.prog-area { fill: currentColor; opacity: 0.1; stroke: none; }
.prog-tick { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.prog-s polyline { fill: none; stroke-width: 2.25; stroke-linejoin: round; stroke: currentColor; }
.prog-s circle { fill: currentColor; }
.prog-s.dashed polyline { stroke-dasharray: 6 5; stroke-width: 1.5; }
.prog-s.c-cyan, .prog-key.c-cyan { color: var(--cyan); }
.prog-s.c-purple, .prog-key.c-purple { color: var(--purple); }
.prog-s.c-pink, .prog-key.c-pink { color: var(--lap-ref); }
.prog-s.c-green, .prog-key.c-green { color: var(--green); }
.prog-key { display: inline-block; width: 14px; height: 3px; margin: 0 6px 3px 0; border-radius: 2px; background: currentColor; vertical-align: middle; }
.prog-legend, .prog-few { font-size: 13px; }
.prog-boards { list-style: none; margin: 8px 0 0; padding: 0; }
.prog-boards li + li { border-top: 1px solid var(--card-edge); }
.prog-boards a { display: flex; align-items: center; gap: 12px; padding: 10px 4px; color: inherit; text-decoration: none; border-radius: 8px; }
.prog-boards a:hover { background: rgba(var(--ink-rgb), 0.04); }
.prog-board-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.prog-board-name small { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prog-game { display: inline-block; margin-right: 8px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em; vertical-align: 2px; background: rgba(var(--cyan-rgb), 0.14); color: var(--cyan); }
.prog-board-meta { font-size: 12px; text-align: right; white-space: nowrap; line-height: 1.4; }
.prog-board-go { font-size: 22px; color: var(--muted); }
.prog-changes, .prog-find { margin: 8px 0 12px; padding-left: 20px; line-height: 1.7; }
.prog-corners th[scope="row"] { text-align: left; font-weight: 600; white-space: nowrap; }
.prog-corners td.num { white-space: nowrap; }
.c-better { color: var(--green); }
.c-worse { color: var(--lap-ref); }
.prog-spark { width: 80px; height: 22px; display: block; }
.prog-spark polyline { fill: none; stroke: var(--cyan); stroke-width: 1.5; }

/* Rig health (#69): a status line per rig, problems in orange, tips quieter. */
.rig-health { margin: 4px 0 8px; }
.rig-health p { margin: 0 0 6px; }
.health-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 6px; vertical-align: 1px; }
.health-dot.on { background: var(--green); box-shadow: 0 0 6px rgba(var(--green-rgb), 0.6); }
.c-good { color: var(--green); }
.health-list { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 8px; }
.health-list li { border-left: 3px solid rgba(var(--ink-rgb), 0.2); padding: 2px 0 2px 10px; display: grid; gap: 2px; }
.health-list li.problem { border-left-color: var(--orange); }
.health-list li span { color: var(--muted); font-size: 0.92em; }
.health-card { border: 1px solid rgba(var(--orange-rgb), 0.45); }

/* More laps in one comparison (#72, Pro): three extra colours, thinner lines, chips and the overview table. */
:root, .tele-svg, .st-plot, .st-map, .st-focus-map, .st-xy { --lap-x1: #00e676; --lap-x2: #22d3ee; --lap-x3: #60a5fa; }
:root[data-theme="light"] { --lap-x1: #047857; --lap-x2: #0e7490; --lap-x3: #2563eb; }
.tele-line.thin { stroke-width: 1.1; stroke-dasharray: 6 3; opacity: 0.9; }
.c-x1 { color: var(--lap-x1); } .c-x2 { color: var(--lap-x2); } .c-x3 { color: var(--lap-x3); }
.swatch-x1 { background: var(--lap-x1); } .swatch-x2 { background: var(--lap-x2); } .swatch-x3 { background: var(--lap-x3); }
.compare-more { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 0.92em; }
.extra-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; border-radius: 999px; background: rgba(var(--ink-rgb), 0.07); }
.extra-chip i { width: 10px; height: 10px; border-radius: 50%; }
.extra-chip.x1 i { background: var(--lap-x1); } .extra-chip.x2 i { background: var(--lap-x2); } .extra-chip.x3 i { background: var(--lap-x3); }
.extra-chip button { background: none; border: 0; color: var(--muted); font-size: 1.1em; cursor: pointer; padding: 0 6px; }
.similar-out { flex-basis: 100%; }
.similar-list { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 6px; }
.similar-list li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lap-overview { border-collapse: collapse; margin: 6px 0 10px; font-variant-numeric: tabular-nums; font-size: 0.92em; }
.lap-overview th, .lap-overview td { padding: 3px 10px 3px 0; text-align: left; }
.lap-overview td.best { color: var(--purple); font-weight: 700; }

/* Remarks pinned to a lap (#73): diamonds above the charts and on the map, a list card. */
:root { --remark-tip: var(--lap-me); --remark-good: var(--green); --remark-problem: var(--orange); }
.tele-remarks { position: relative; height: 16px; margin-bottom: 2px; }
.remark-pin { position: absolute; top: 3px; width: 10px; height: 10px; padding: 0; border: 0; transform: translateX(-50%) rotate(45deg); cursor: pointer; background: var(--remark-tip); }
.remark-pin.k-good, .map-remark.k-good { background: var(--remark-good); fill: var(--remark-good); }
.remark-pin.k-problem, .map-remark.k-problem { background: var(--remark-problem); fill: var(--remark-problem); }
.map-remark { fill: var(--remark-tip); stroke: var(--chart-bg); stroke-width: 1.5; }
.remark-pin.on { outline: 2px solid rgba(var(--ink-rgb), 0.8); }
.remark-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.remark-list li { position: relative; display: grid; gap: 2px; padding: 6px 28px 6px 10px; border-left: 3px solid var(--remark-tip); border-radius: 4px; }
.remark-list li.k-good { border-left-color: var(--remark-good); } .remark-list li.k-problem { border-left-color: var(--remark-problem); }
.remark-list li.on { background: rgba(var(--ink-rgb), 0.06); }
.remark-at { justify-self: start; font-size: 0.85em; }
.remark-del { position: absolute; right: 4px; top: 4px; background: none; border: 0; color: var(--muted); font-size: 1.1em; cursor: pointer; }
.remark-form { display: grid; gap: 6px; }
.remark-form textarea { width: 100%; resize: vertical; }

/* Home (#74): your last session and friends on track now. */
.last-session .ls-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.last-session h2 { margin: 0; }
.ls-day { color: var(--muted); font-size: 0.9em; white-space: nowrap; }
.ls-board { display: grid; gap: 2px; margin: 10px 0 14px; color: inherit; text-decoration: none; }
.ls-board b { color: var(--cyan); }
.ls-board span { color: var(--muted); font-size: 0.9em; }
.ls-board:hover b { text-decoration: underline; }
.ls-figs { display: grid; grid-template-columns: auto auto 1fr; gap: 0; margin: 0 0 16px; font-variant-numeric: tabular-nums;
  border-top: 1px solid rgba(var(--ink-rgb), 0.08); border-bottom: 1px solid rgba(var(--ink-rgb), 0.08); }
.ls-fig { display: grid; align-content: start; gap: 2px; padding: 10px 20px 10px 0; }
.ls-fig + .ls-fig { padding-left: 20px; border-left: 1px solid rgba(var(--ink-rgb), 0.08); }
.ls-fig b { font-size: 1.25em; }
.ls-label { color: var(--muted); font-size: 0.75em; text-transform: uppercase; letter-spacing: 0.08em; }
.ls-note { color: var(--muted); font-size: 0.85em; }
.ls-note.new-pb { color: var(--green); font-weight: 700; }
.ls-figs:last-child { margin-bottom: 0; border-bottom: 0; }
.ls-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.on-track { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 14px; font-size: 0.95em; }
.on-track-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(var(--green-rgb), 0.7); animation: on-track-pulse 2s ease-in-out infinite; }
@keyframes on-track-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .on-track-dot { animation: none; } }

/* Who sees what in sentences (#76): one line per audience, widest first. */
.privacy-story { list-style: none; padding: 0; margin: 4px 0 10px; display: grid; gap: 4px; }
.privacy-story li { padding-left: 14px; position: relative; }
.privacy-story li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.privacy-story .lvl-public::before { background: var(--orange); } .privacy-story .lvl-registered::before { background: var(--gold); }
.privacy-story .lvl-friends::before, .privacy-story .lvl-groups::before { background: var(--lap-me); }
.privacy-story .lvl-private::before { background: var(--green); }
.privacy-story .lvl-fixed { color: var(--muted); font-size: 0.92em; }

/* Track page (#77). */
.track-link { color: inherit; text-decoration: none; } .track-link:hover { text-decoration: underline; }
.track-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 760px) { .track-grid { grid-template-columns: 1fr; } }
.track-outline { width: 100%; height: min(520px, 70vh); display: block; }
.track-turn circle { fill: var(--pop); stroke: var(--lap-ref); stroke-width: 1.5; }
.track-turn text { fill: var(--ink, currentColor); font-size: 9px; font-weight: 700; text-anchor: middle; }
.track-holders, .track-corners { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 4px; }
.track-corners { list-style: none; padding: 0; }
.track-glance { list-style: none; padding: 0; }
.track-history { margin-top: 16px; max-width: 75ch; }
.track-history p { line-height: 1.6; }
.track-grid + .track-grid { margin-top: 16px; }
.track-board-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.track-board-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
/* Edges of a crowd map, coloured by what confirmed them. */
.track-outline polyline { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.track-outline .edge-g, .track-legend .edge-g::before { stroke: var(--green); background: var(--green); }
.track-outline .edge-k, .track-legend .edge-k::before { stroke: var(--orange); background: var(--orange); }
.track-outline .edge-a, .track-legend .edge-a::before { stroke: var(--purple); background: var(--purple); }
.track-outline .edge-n, .track-legend .edge-n::before { stroke: var(--muted); background: var(--muted); }
.track-outline .edge-n { stroke-dasharray: 3 3; }
.track-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.85em; color: var(--muted); margin: 8px 0 0; }
.track-legend span::before { content: ""; display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.track-state.map-ready b { color: var(--green); }
.track-state.map-growing b { color: var(--gold); }
.track-state.map-none b { color: var(--muted); }
.track-meter { display: inline-block; width: 60px; height: 6px; border-radius: 3px; background: rgba(var(--ink-rgb), 0.12); overflow: hidden; vertical-align: middle; }
.track-meter i { display: block; height: 100%; background: var(--gold); }
.map-ready .track-meter i { background: var(--green); }
.track-need { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 10px; align-items: center; margin: 0 0 12px; }
.track-need .track-meter { width: 100%; }
.track-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 12px; }
.track-facts dt { color: var(--muted); }
.track-facts dd { margin: 0; }
.track-data h3 { margin: 14px 0 4px; font-size: 1em; }
.track-intro { max-width: 70ch; color: var(--muted); }
/* A game page's intro and the words under a board (search pages, #86: the same text as SeoPages). */
.game-intro { max-width: 70ch; color: var(--muted); margin: -8px 0 18px; }
.board-about { max-width: 70ch; margin-top: 18px; font-size: 14px; }
.track-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.track-tile { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--card-edge);
  color: inherit; text-decoration: none; }
.track-tile:hover { border-color: rgba(var(--cyan-rgb), 0.5); }
.track-tile-map { display: flex; gap: 8px; align-items: center; font-size: 0.9em; }

/* Reactions to a lap (#77). */
.lap-social { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -4px 0 14px; }
.reactions { display: flex; flex-wrap: wrap; gap: 8px; }
.reactions[hidden] { display: none; }
.reaction { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; border: 1px solid rgba(var(--ink-rgb), 0.15);
  background: var(--surface); color: inherit; font: inherit; font-size: 0.9em; cursor: pointer; }
.reaction:disabled { cursor: default; }
.reaction.on { border-color: var(--lap-me); background: rgba(var(--cyan-rgb), 0.12); }
.reaction b { font-variant-numeric: tabular-nums; }

/* TT Nights (#124) */
.night-item { display: block; color: inherit; text-decoration: none; padding: 14px 18px; margin-bottom: 10px; }
.night-item:hover { border-color: rgba(var(--cyan-rgb), 0.5); }
.night-live { margin-left: 6px; vertical-align: middle; animation: night-pulse 1.6s ease-in-out infinite; }
@keyframes night-pulse { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .night-live { animation: none; } }
.night-now { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.night-now > div { display: flex; flex-direction: column; }
.night-driver { font-size: 34px; line-height: 1.1; }
.night-clock { font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.night-clock small { display: block; font-size: 14px; font-weight: 600; }
.night-updated { flex-basis: 100%; }
.night-round { margin-top: 26px; margin-bottom: 2px; }
.night-table { min-width: 560px; }
#night-share { margin-top: 26px; }   /* follows a table (latest laps / last round), which has no bottom margin */
@media (max-width: 600px) { .night-clock { text-align: left; } .night-driver { font-size: 28px; } }
.night-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 14px 18px; margin: 0 0 14px; border-radius: 16px;
  color: inherit; text-decoration: none; border: 1px solid rgba(var(--green-rgb), 0.45); background: rgba(var(--green-rgb), 0.08); }
.night-banner:hover { border-color: var(--green); }
.night-banner .night-live { margin-left: 0; }
.night-banner-go { margin-left: auto; color: var(--green); font-weight: 700; }
.night-awards-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.night-awards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 6px 0 18px; }
.night-award { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--card-edge); background: var(--card); }
.night-award > div { display: flex; flex-direction: column; min-width: 0; }
.night-award small { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.night-award b { font-size: 18px; }
.night-award-icon { font-size: 28px; }

/* Invite friends (#81): join link + code behind each invited friend who isn't on your rig yet. */
.invite-join { display: block; margin-top: 6px; }
.join-row { gap: 8px; align-items: center; flex-wrap: wrap; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--card-edge); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; }
.icon-btn:hover { border-color: var(--cyan); color: var(--cyan); }

/* While the app starts (theme.js sets html.js): a quiet placeholder instead of the text page, which stays for search
   engines and browsers without scripts. Fades in only when loading takes a moment, so a fast start shows no flash. */
.boot { display: none; }
.js .intro-static { display: none; }
.js .boot { display: block; opacity: 0; animation: boot-in .3s ease .35s forwards; }
.boot-line { height: 22px; width: 40%; margin: 6px 0 14px; border-radius: 8px; background: var(--card); }
.boot-line.wide { height: 34px; width: 65%; }
.boot-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 22px; }
.boot-cards div { height: 120px; border-radius: 14px; background: var(--card); }
.boot-line, .boot-cards div { animation: boot-pulse 1.4s ease-in-out infinite; }
@keyframes boot-in { to { opacity: 1; } }
@keyframes boot-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .boot-line, .boot-cards div { animation: none; } }
/* Telemetry for Free players and visitors (Pro since 2026-10-19): what it holds, the offer, a greyed-out 3D switch. */
.tele-locked p { margin: 0 0 10px; }
.switch:disabled { opacity: 0.45; cursor: not-allowed; }
.switch:disabled:hover { border-color: inherit; }

/* Telemetry Studio (#195, Elite; web/studio.js): the whole window, charts left, map and figures right. The charts keep
   the dark chart colours in both themes, like .tele-svg. */
body.studio-open { overflow: hidden; }
.studio { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); color: var(--text); --st-side: 340px; }
.studio.loading { cursor: progress; }
.studio.loading > * { opacity: 0.6; }   /* the page behind never shows through */
.st-load-error { color: var(--orange); font-size: 13px; }
.st-bar { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 14px; border-bottom: 1px solid var(--card-edge); }
.st-back { font-size: 20px; text-decoration: none; color: var(--cyan); padding: 0 4px; }
.st-title { display: flex; flex-direction: column; line-height: 1.15; }
.st-title .muted { font-size: 12px; }
.st-laps { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1 1 auto; }
.st-lap { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--card-edge); font-size: 13px; }
.st-lap i { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.st-lap .link { color: var(--text); font-size: 13px; }
.st-lap.ref { border-color: currentColor; }
.st-lap.ref .link { font-weight: 700; }
.st-x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; padding: 0 2px; }
.st-add select { font: inherit; font-size: 13px; }
.st-open { padding: 0; border: 1px solid var(--card-edge); border-radius: 14px; background: var(--pop); color: var(--text); box-shadow: var(--shadow-pop); width: min(640px, calc(100vw - 32px)); }
.st-open::backdrop { background: rgba(0, 0, 0, 0.55); }
.st-open-box { display: flex; flex-direction: column; max-height: min(720px, calc(100vh - 64px)); }
.st-open-box header, .st-open-box footer { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.st-open-box header h2 { margin: 0; font-size: 17px; }
.st-open-box header .muted { flex: 1; font-size: 13px; }
.st-open-box footer { justify-content: flex-end; border-top: 1px solid var(--card-edge); }
.st-open-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 0 16px 10px; border-bottom: 1px solid var(--card-edge); }
.st-open-search { flex: 1; min-width: 140px; font: inherit; font-size: 13px; }
.st-open-list { overflow-y: auto; padding: 6px 8px; min-height: 200px; }
.st-open-list h4 { margin: 10px 8px 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.st-open-row { display: grid; grid-template-columns: auto 1fr auto 76px; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 14px; font-variant-numeric: tabular-nums; }
.st-open-row:hover { background: rgba(var(--cyan-rgb), 0.08); }
.st-open-row.on { background: rgba(var(--cyan-rgb), 0.14); }
.st-open-row.full { opacity: 0.5; cursor: default; }
.st-open-row small { color: var(--muted); font-size: 12px; }
.st-open-gap { text-align: right; color: var(--delta); }
.st-open-gap.faster { color: var(--green); }
.st-c0 { color: var(--lap-me); } .st-c1 { color: var(--lap-ref); } .st-c2 { color: var(--lap-x1); } .st-c3 { color: var(--lap-x2); }
.st-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.st-btn { padding: 5px 12px; font-size: 13px; }
.st-pop { position: absolute; right: 14px; top: 100%; z-index: 2; overflow-y: auto; overscroll-behavior: contain; background: var(--pop); border: 1px solid var(--card-edge); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow-pop); min-width: 220px; }
.st-pop h3 { margin: 0 0 6px; font-size: 14px; }
.st-channel-list { list-style: none; margin: 0; padding: 0; }
/* Channels menu: the ready-made sets on top (owner 2026-10-24: a row of set buttons didn't say it belonged to Channels). */
.st-channels-btn b { color: var(--cyan); font-weight: 700; }
#st-channel-pop { width: min(360px, calc(100vw - 28px)); }
.st-sets { display: grid; gap: 4px; margin-bottom: 8px; }
.st-set { display: block; width: 100%; text-align: left; font: inherit; color: var(--text); background: none; border: 1px solid transparent;
  border-radius: 8px; padding: 5px 8px; cursor: pointer; }
.st-set:hover, .st-set:focus-visible { background: rgba(var(--cyan-rgb), 0.1); outline: none; }
.st-set.on { border-color: rgba(var(--cyan-rgb), 0.6); background: rgba(var(--cyan-rgb), 0.12); }
.st-set b { display: block; font-size: 14px; }
.st-set small { display: block; font-size: 12px; color: var(--muted); }
.st-channel-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 2px 0; }
.st-move { background: none; border: 1px solid var(--card-edge); color: var(--text); border-radius: 6px; cursor: pointer; padding: 0 6px; margin-left: 3px; }
.st-move:disabled { opacity: 0.3; cursor: default; }
.st-keys-pop dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: 13px; }
.st-keys-pop dt { font-family: "IBM Plex Mono", monospace; color: var(--cyan); }
.st-keys-pop dd { margin: 0; color: var(--muted); }
.st-main { flex: 1 1 auto; display: flex; min-height: 0; overflow: hidden; }
#st-note-card > p { font-size: 13px; margin: 4px 0; }
.st-left { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.st-player { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 6px 12px; border-top: 1px solid var(--card-edge); }
.st-player .replay-seek { flex: 1 1 160px; min-width: 120px; }
.st-player .replay-time { font-family: "IBM Plex Mono", monospace; font-size: 13px; min-width: 70px; }
.st-3d { flex: 0 0 44%; height: auto; min-height: 160px; margin: 0; border-radius: 0; }
.studio .viewer3d.v3d-max { z-index: 70; }
.st-hsplit { flex: 0 0 6px; cursor: row-resize; background: var(--card-edge); touch-action: none; }
.st-hsplit:hover, .st-hsplit:focus-visible { background: var(--cyan); outline: none; }
.st-plot { position: relative; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; background: var(--chart-bg); touch-action: none; user-select: none; cursor: crosshair; }
.st-charts { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.st-chart { position: relative; flex: 1 1 0; min-height: 40px; border-bottom: 1px solid rgba(var(--ink-rgb), 0.08); }
.st-chart canvas, .st-axis { display: block; width: 100%; height: 100%; }
.st-axis { flex: 0 0 34px; height: 34px; }
.st-label { position: absolute; left: 8px; top: 1px; font-size: 11px; color: var(--muted); pointer-events: none; text-transform: uppercase; letter-spacing: 0.5px; }
.st-label i { font-style: normal; text-transform: none; letter-spacing: 0; opacity: 0.8; }
.st-mark { position: absolute; top: 0; bottom: 34px; width: 0; border-left: 1px solid rgba(var(--ink-rgb), 0.55); pointer-events: none; }
.st-mark span { position: absolute; top: 0; left: 3px; font-size: 11px; font-weight: 700; color: var(--chart-bg); background: var(--text); border-radius: 3px; padding: 0 4px; }
.st-a, .st-b { border-left: 1px dashed var(--text); }
.st-span { position: absolute; top: 0; bottom: 34px; background: rgba(var(--ink-rgb), 0.06); pointer-events: none; }
.st-split { flex: 0 0 6px; cursor: col-resize; background: var(--card-edge); touch-action: none; }
.st-split:hover, .st-split:focus-visible { background: var(--cyan); outline: none; }
.st-side { flex: 0 0 var(--st-side); width: var(--st-side); min-width: 0; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.st-map { width: 100%; aspect-ratio: 4 / 3; background: var(--chart-bg); border-radius: 8px; cursor: pointer; }
.st-map-head { display: flex; justify-content: flex-end; margin-bottom: -4px; }
.st-ers-key { margin: -4px 0 0; font-size: 12px; }
.st-ers-use { color: var(--orange); font-weight: 600; }
.st-ers-charge { color: var(--green); font-weight: 600; }
.st-sectors { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.st-corner { font-size: 13px; color: var(--muted); }
.st-corner select { font: inherit; font-size: 13px; max-width: 170px; }
.st-table { min-width: 0; table-layout: fixed; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.st-table th, .st-table td { padding: 2px 5px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 12.5px; letter-spacing: 0; text-transform: none; border-bottom: 1px solid rgba(var(--ink-rgb), 0.06); }
.st-table th:first-child { width: 34%; text-align: left; color: var(--muted); font-weight: 400; }
.st-table tr:first-child th { font-weight: 700; }
.st-table tr:first-child th:first-child { border-bottom: 0; }
.st-table small { font-weight: 400; color: var(--muted); }
.st-ab h3 { margin: 0 0 4px; font-size: 14px; }
.st-ab p, .st-read p { margin: 4px 0 0; font-size: 12px; }
.studio:fullscreen { background: var(--bg); }
/* Notes (#195 phase 2): the lane above the charts, the open note's spot, the card in the side panel. Shape = kind
   (tip circle, AI diamond, remark square), colour = topic (--c, set in code). */
.st-notes { position: relative; flex: 0 0 28px; border-bottom: 1px solid rgba(var(--ink-rgb), 0.08); }
.st-notes .st-label { top: 7px; }
.st-note { position: absolute; width: 11px; height: 11px; margin-left: -5.5px; padding: 0; border: 1.5px solid var(--chart-bg); background: var(--c); cursor: pointer; border-radius: 2px; z-index: 1; }
.st-note.k-tip { border-radius: 50%; }
.st-note.k-ai { transform: rotate(45deg) scale(0.9); }
.st-note.k-wheel { border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.st-note:hover, .st-note:focus-visible, .st-note.on { outline: 2px solid var(--text); outline-offset: 1px; z-index: 2; }
.st-spot { border-left: 2px solid var(--c); }
.st-spot span { background: var(--c); color: var(--chart-bg); white-space: nowrap; }
.st-spot-ref { border-left-style: dashed; border-left-width: 1px; }
.st-spot-ref span { top: 16px; }
.studio.st-dragging, .studio.st-dragging * { user-select: none; -webkit-user-select: none; }
.st-note-close { background: none; border: 0; color: var(--muted); font: inherit; font-size: 18px; line-height: 1; padding: 0 0 0 8px; cursor: pointer; vertical-align: middle; }
.st-note-close:hover, .st-note-close:focus-visible { color: var(--text); outline: none; }
.st-note-box { border-top: 1px solid var(--card-edge); padding-top: 8px; }
.st-note-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.st-note-head h3 { margin: 0; font-size: 14px; }
.st-note-kinds { display: flex; flex-wrap: wrap; gap: 4px; }
.st-note-kinds .switch { font-size: 10px; letter-spacing: 0.5px; padding: 3px 8px 3px 4px; }
.st-note-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.st-note-card { border: 1px solid var(--card-edge); border-radius: 10px; padding: 8px 10px; background: rgba(var(--ink-rgb), 0.03); }
.st-note-card h4 { margin: 4px 0 2px; font-size: 14px; }
.st-note-card p { margin: 4px 0; font-size: 13px; }
.st-note-top { display: flex; justify-content: space-between; font-size: 12px; }
.st-note-kind { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; font-size: 11px; }
.st-note-kind i { width: 9px; height: 9px; background: var(--muted); border-radius: 2px; }
.st-note-kind.k-tip i { border-radius: 50%; }
.st-note-kind.k-ai i { transform: rotate(45deg) scale(0.85); }
.st-note-spot { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.st-note-spot i { width: 10px; height: 2px; }
.st-note-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.st-note-nav .btn { padding: 4px 10px; font-size: 12px; }
.st-note-nav .btn:disabled { opacity: 0.4; cursor: default; }
/* Views (#195 phase 3): corner focus above the charts; X-Y and histograms in their place. */
.st-focus { flex: 0 0 46%; min-height: 220px; display: flex; border-bottom: 1px solid var(--card-edge); }
.st-focus-map { flex: 1 1 60%; min-width: 0; height: 100%; display: block; background: var(--chart-bg); }
.st-focus-side { flex: 1 1 40%; min-width: 260px; overflow-y: auto; padding: 8px 12px; }
.st-focus-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.st-focus-head h3 { flex: 1 1 auto; margin: 0; font-size: 15px; text-align: center; }
.st-focus-head .btn { padding: 2px 10px; }
.st-focus-notes { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
.st-focus-notes i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.st-analysis { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; padding: 8px 12px; }
.st-xy-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 8px; font-size: 13px; }
.st-xy-bar select { font: inherit; font-size: 13px; }
.st-xy { flex: 1 1 auto; min-height: 260px; width: 100%; display: block; background: var(--chart-bg); border-radius: 8px; }
.st-cons-sum { margin: 0 0 10px; font-size: 13.5px; max-width: 900px; }
.st-cons-note { font-size: 12.5px; }
.st-table.st-cons { width: 100%; table-layout: auto; }
.st-table.st-cons th:first-child { width: auto; }
.st-table.st-cons th { text-align: right; }
.st-table.st-cons tr > th:first-child { text-align: left; }
.st-table.st-cons .st-cons-strip-h { text-align: left; }
.st-cons-strip { display: block; width: 100%; min-width: 140px; height: 18px; }
.st-cons-top th:first-child .link { color: var(--orange); font-weight: 700; }
.st-cons-top td { background: rgba(var(--cyan-rgb), 0.06); }
.st-setup { max-width: 1000px; }
.st-wear-table { margin-top: 18px; }
.st-table.st-setup-table { width: 100%; table-layout: auto; }
.st-table.st-setup-table th:first-child { width: auto; white-space: normal; }
.st-setup-table th small { display: block; font-size: 11.5px; color: var(--muted); }
.st-setup-table td small { color: var(--muted); }
.st-setup-table .st-setup-sec th { padding-top: 10px; text-align: left; color: var(--text); font-weight: 700; }
.st-hist { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.st-hist h3 { margin: 0 0 4px; font-size: 14px; }
.st-hist-table td { position: relative; text-align: left; }
.st-hbar { display: inline-block; height: 9px; min-width: 1px; max-width: calc(100% - 52px); background: currentColor; border-radius: 2px; vertical-align: middle; }
.st-pct { margin-left: 6px; color: var(--text); font-size: 12px; }
.st-math-head { margin-top: 10px !important; }
.st-math-form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; max-width: 330px; }
.st-math-form input { font: inherit; font-size: 13px; flex: 1 1 120px; min-width: 0; padding: 4px 6px; }
.st-math-form p { flex-basis: 100%; margin: 2px 0 0; font-size: 12px; }
.st-math-error { color: var(--brake); }
/* The lap page's way in: desktop only (phones keep the lap page). */
.tele-head .studio-btn { padding: 6px 14px; font-size: 14px; }
.st-tip { position: fixed; z-index: 90; max-width: 280px; padding: 6px 10px; border-radius: 8px; font-size: 13px; line-height: 1.35; pointer-events: none;
  background: var(--bg); color: var(--text); border: 1px solid var(--card-edge); box-shadow: var(--shadow); }
.st-tip[hidden] { display: none; }
.st-keys-btn { display: inline-flex; align-items: center; }
.st-keys-icon { fill: none; stroke: currentColor; stroke-width: 1.2; }
.st-tips-switch { font-size: 12px; }
.studio-start-phone { display: none; }
@media (max-width: 760px) { .studio-start-phone { display: block; } }
.studio-start-list td { vertical-align: middle; }
.lap-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.lap-tools .btn.small { padding: 5px 14px; }
/* Studio needs a computer screen: phones (and the phone app's site pages) get no way in. */
@media (max-width: 760px) { .studio-btn, .studio-link { display: none; } }

/* My account → Plan: Pro ↔ Elite on a running subscription (#195). */
.plan-switch { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--card-edge); border-radius: 10px; background: rgba(var(--ink-rgb), 0.03); }
.plan-switch p { margin: 4px 0; }
.plans-note h3 { margin: 12px 0 6px; font-size: 15px; }
