* { box-sizing: border-box; }
html, body { margin: 0; background: var(--surface-0); color: var(--ink); font-family: var(--font-sans); }
body { min-height: 100vh; }
.muted { color: var(--ink-muted); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { margin-right: var(--space-2); }
/* Logo: the dashboard's shift lights over the wordmark. The lights follow the revs while the PS5 is streaming. */
.logo { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; line-height: 1; user-select: none; }
.logo-lights { display: flex; flex-direction: column-reverse; gap: 2px; } /* a rev tower: green at the bottom, red on top */
.logo-lights i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .22; transition: opacity .08s; }
.logo-lights .g { color: var(--throttle); } .logo-lights .y { color: var(--accent); } .logo-lights .r { color: var(--brake); }
.logo-lights i.on { opacity: 1; }
.logo-lights.idle i { opacity: .85; } /* connected, engine not revving: a calm "on" look */
.logo-lights.limit i { color: var(--best-lap); opacity: 1; }
/* The logo: blue and red stripes (after the Gran Turismo colours), GT in ink, a red 7, DAILY in blue. */
.logo-mark { display: block; overflow: visible; }
.logo-mark .lm-blue { fill: #2f7bf5; } .logo-mark .lm-red, .logo-mark .lm-seven { fill: #e8232a; }
.logo-mark .lm-gt path { fill: var(--ink); } .logo-mark .lm-daily path { fill: #4d8ff7; }
.logo-word { height: 38px; width: auto; }
.pd-wordmark { height: 5.4vh; width: auto; margin: 0 auto; }
.pd-wordmark .lm-gt path { fill: #eef1f4; } .pd-wordmark .lm-daily path { fill: #4d8ff7; } /* the dashboard is always dark */
.pd-brand { display: flex; justify-content: center; }
.tabs { display: flex; gap: 2px; }
.tab { background: none; border: 0; padding: var(--space-2) 9px; white-space: nowrap; border-radius: var(--radius-md); color: var(--ink-muted); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
.top-right { margin-left: auto; display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: var(--space-1); padding: var(--space-1) var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-md); white-space: nowrap; }
.chip[data-state="on"] .dot { color: var(--throttle); }
.chip[data-state="off"] .dot { color: var(--ink-muted); }
.btn { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); cursor: pointer; }
.btn:hover { border-color: var(--ink-muted); }
.btn.small { padding: var(--space-1) var(--space-2); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.danger:not(:disabled):hover { border-color: var(--brake); }
.btn:disabled { opacity: .45; cursor: default; }

/* ---------- panels ---------- */
.view { padding: var(--space-4); display: grid; gap: var(--space-3); }
.panel { background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-4); min-width: 0; }
.panel { position: relative; }
.box-fs { position: absolute; top: calc(var(--space-4) - 5px); right: calc(var(--space-4) - 6px); z-index: 3; padding: 3px; min-width: 0; line-height: 0; opacity: .45; }
.box-fs:hover, .box-fs:focus-visible, .box-fs[aria-pressed="true"] { opacity: 1; }
.box-fs svg { width: 14px; height: 14px; display: block; }
main .panel > .panel-head { padding-right: 26px; }
/* A box shown full screen: it fills the screen and its contents stretch with it. */
.panel.maxed { width: 100vw; height: 100vh; max-width: none; max-height: none; border-radius: 0; border: 0; padding: var(--space-5, 24px);
  display: flex; flex-direction: column; overflow: auto; background: var(--surface-1); }
.panel.maxed { position: fixed; inset: 0; z-index: 60; }
body.box-maxed { overflow: hidden; }
.panel.maxed > .table-wrap, .panel.maxed > .map-wrap, .panel.maxed > .map-row, .panel.maxed > .act-wrap { flex: 1 1 0; min-height: 0; max-height: none; }
/* Maps fill their box exactly (a canvas would otherwise keep its old drawing size and push the box taller). */
.panel.maxed .map-wrap > .mapcanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); margin-bottom: var(--space-3); }
.row-between { display: flex; justify-content: space-between; align-items: baseline; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2) var(--space-4); margin: var(--space-3) 0 0; align-items: baseline; }
.kv dd { margin: 0; text-align: right; }
.unit { color: var(--ink-muted); margin-left: var(--space-1); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: var(--radius-sm); vertical-align: -1px; margin-right: var(--space-1); }
.sw.cold { background: var(--tyre-cold); } .sw.ok { background: var(--tyre-ok); } .sw.hot { background: var(--tyre-hot); }
.sw.line-ink { background: var(--ink); height: 3px; vertical-align: 3px; } .sw.line-best { background: var(--best-lap); height: 3px; vertical-align: 3px; }
.sw.hap { background: var(--haptic); border-radius: 50%; }
/* Car pictures (official GT7 thumbnails, 16:9 with room around the car) next to car names */
.car-thumb { height: 20px; width: 42px; object-fit: cover; object-position: center 58%; vertical-align: middle; margin: -4px 5px -4px 0;
  border-radius: 3px; background: radial-gradient(ellipse at 50% 60%, rgba(255,255,255,.22), rgba(255,255,255,0) 72%); }
.sw-shape { display: inline-block; width: 10px; height: 10px; vertical-align: -1px; margin-right: var(--space-1); }

/* ---------- view layouts ----------
   Wide screens: every tab fills the window exactly (header + view = 100% height, no page scroll).
   Narrow screens (phones/tablets in portrait): panels stack and the page scrolls. */
body { display: flex; flex-direction: column; }
.view { flex: 1; }
@media (min-width: 1000px) {
  body { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  .view { min-height: 0; overflow: hidden; }
  .view > .panel { min-height: 0; overflow: auto; }
}
/* Haptics & Motion */
.motion { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "hap map" "rig map"; align-items: stretch; }
.motion { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
.motion .haptics { grid-area: hap; display: flex; flex-direction: column; }
.motion .rig { grid-area: rig; display: flex; flex-direction: column; }
/* fill the left column: bigger meters, the rumble trace takes the remaining height */
.motion .hap-grid { gap: var(--space-3) var(--space-4); }
.motion .hap-grid .meter.h { height: 22px; }
.motion .channels { gap: var(--space-3) var(--space-4); }
.motion .channel .meter { height: 10px; }
.motion #hapTrace { flex: 1; min-height: 70px; height: auto; }
.motion .rig-grid { flex: 1; min-height: 0; }
.motion .rig-meters { align-content: space-evenly; }
.motion .rig-meters .meter.h { height: 20px; }
.motion .rig-acts { margin-top: 0; }
.motion .rig-controls { justify-content: space-evenly; }
.motion .hapmap { grid-area: map; display: flex; flex-direction: column; overflow: hidden; }
.motion .hapmap .mapcanvas { flex: 1; min-height: 0; height: auto; }
.lap-filter { display: flex; align-items: center; gap: var(--space-3); }
.lap-filter select { width: auto; padding: 2px var(--space-2); }
.setup-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin: 0 0 var(--space-2); }
.setup-row label { display: flex; align-items: center; gap: var(--space-2); }
.laps td.car { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.laps input.bb { width: 3em; padding: 1px var(--space-1); background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); font: inherit; color: inherit; }
.laps input.bb:hover, .laps input.bb:focus { border-color: var(--line); background: var(--surface-2); }
/* Track & Laps: map takes most of the screen */
.trackview { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-rows: minmax(0, 6.3fr) minmax(0, 3.7fr);
  grid-template-areas: "map laps" "tele car"; }
.trackview .car .readout-md { font-size: 17px; line-height: 20px; }
.trackview .car .kv { gap: var(--space-1) var(--space-3); }
.trackview .car .panel-head { margin-bottom: var(--space-2); }
.trackview .map { grid-area: map; display: flex; flex-direction: column; overflow: hidden; }
.trackview .car { grid-area: car; display: flex; flex-direction: column; }
.trackview .laps-panel { grid-area: laps; display: flex; flex-direction: column; }
.trackview .tele { grid-area: tele; display: flex; flex-direction: column; overflow: hidden; }
.trackview .mapcanvas { flex: 1; min-height: 0; height: auto; }
.map-wrap { position: relative; flex: 1; min-height: 0; display: flex; }
.map-wrap .mapcanvas { flex: 1; height: auto; cursor: grab; touch-action: none; }
.map-wrap .mapcanvas.dragging { cursor: grabbing; }
.survey-bar { position: absolute; left: var(--space-2); top: var(--space-2); right: var(--space-2); display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
  padding: var(--space-2); background: color-mix(in srgb, var(--surface-1) 90%, transparent); border: 1px solid var(--accent); border-radius: var(--radius-md); }
.survey-bar .label { color: var(--ink); }
.survey-meter { flex: 1; min-width: 80px; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.survey-meter span { display: block; height: 100%; width: 0; background: var(--accent); }
.map-zoom { position: absolute; left: var(--space-2); right: var(--space-2); bottom: var(--space-2); display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-1); pointer-events: none; }
.map-zoom > * { pointer-events: auto; }
.map-zoom .btn { min-width: 30px; }
.map-check { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.map-check input { margin: 0; accent-color: var(--accent); }
.map-zoom [data-zoom="follow"][aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.top-driver { display: flex; align-items: center; gap: var(--space-2); }
.top-driver select { width: auto; max-width: 160px; padding: 3px var(--space-2); }
.trackview .table-wrap { flex: 1; min-height: 0; max-height: none; }
.trackview .lanes-wrap { flex: 1; min-height: 0; margin-top: 0; }
.trackview .lanes { height: 100%; }
.car-body { flex: 1; min-height: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-4); align-items: stretch; }
.car-body.has-ers { grid-template-columns: auto minmax(0, 0.75fr) minmax(0, 1fr); }
.car-body:not(.has-ers) .ers { display: none; }
.ers { display: flex; flex-direction: column; gap: var(--space-1); min-height: 0; }
#torqueCanvas { flex: 1; min-height: 90px; width: 100%; }
.ers-rec { display: flex; justify-content: space-between; align-items: baseline; }
.ers .meter.h { height: 8px; flex: none; }
.fill.ers-fill { background: var(--clutch); }
#ersHint { margin: 0; }
.car-body .gforce { margin: 0; display: flex; flex-direction: column; align-items: center; gap: var(--space-1); min-height: 0; }
#gCanvas { flex: 1; min-height: 120px; width: 100%; aspect-ratio: 1; max-width: 100%; }
@media (max-width: 999px) {
  .motion, .trackview { grid-template-columns: 1fr; grid-template-rows: none; grid-template-areas: none; }
  .trackview > .panel, .motion > .panel { grid-area: auto; }
  .motion .hapmap { height: 60vh; }
  .trackview .map { height: 65vh; }
  .trackview .tele { height: 460px; }
  .trackview .table-wrap { max-height: 50vh; }
  #gCanvas { height: 220px; width: 220px; flex: none; }
}
@media (max-width: 700px) {
  .view { padding: var(--space-3); }
  .view > .panel { padding: var(--space-3); }
  .readout-xl { font-size: 64px; line-height: 64px; }
  .readout-lg { font-size: 32px; line-height: 36px; }
}

.hero-main { display: flex; gap: var(--space-8); align-items: flex-end; }
.gear-box { min-width: 96px; }
.sgear { color: var(--accent); margin-top: var(--space-1); }
.rpm-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--space-2); }
.rpm-bar { position: relative; height: 28px; background: var(--surface-2); border-radius: var(--radius-sm); overflow: hidden; }
.rpm-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--ink); }
.rpm-lights { position: absolute; inset: 0; display: flex; justify-content: flex-end; gap: 3px; padding: 3px; }
.rpm-lights i { flex: 0 0 auto; border-radius: var(--radius-sm); background: transparent; }
.rpm-bar.limiter .rpm-fill { background: var(--brake); animation: flash .12s steps(2) infinite; }
@keyframes flash { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .rpm-bar.limiter .rpm-fill { animation: none; } }

.delta-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--line); }
.delta.gain { color: var(--delta-gain); } .delta.loss { color: var(--delta-loss); }
.best { color: var(--best-lap) !important; }

.inputs-body { display: flex; gap: var(--space-3); align-items: stretch; }
.pedals { display: flex; gap: var(--space-2); }
.pedal { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); }
.meter { background: var(--surface-2); border-radius: var(--radius-sm); position: relative; overflow: hidden; }
.meter.v { width: 22px; height: 130px; }
.meter.v .fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.meter.h { height: 14px; }
.meter.h .fill { position: absolute; inset: 0 auto 0 0; width: 0; }
.meter.seg::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), var(--surface-1) calc(10% - 2px) 10%); }
.fill.throttle { background: var(--throttle); } .fill.brake { background: var(--brake); } .fill.clutch { background: var(--clutch); } .fill.haptic { background: var(--haptic); }
.trace { flex: 1; width: 100%; height: 150px; min-width: 0; display: block; }
.trace.short { height: 70px; margin-top: var(--space-3); }
.steer { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-3); }
.steer-bar { flex: 1; height: 8px; background: var(--surface-2); border-radius: var(--radius-sm); position: relative; }
.steer-bar::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line); }
.steer-mark { position: absolute; top: -3px; width: 4px; height: 14px; margin-left: -2px; left: 50%; background: var(--ink); border-radius: var(--radius-sm); }

.tyre-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.tyre { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--surface-2); border-left: 0; position: relative; overflow: hidden; }
.tyre::before { content: ""; position: absolute; inset: auto 0 0 0; height: 4px; background: var(--tcol, var(--line)); }
.legend-temps { margin-top: var(--space-3); }

.hap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2) var(--space-4); }
.hap-meter { display: flex; flex-direction: column; gap: var(--space-1); }
.channels { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2) var(--space-4); margin-top: var(--space-3); }
.channel { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--space-2); align-items: center; }
.channel .meter { grid-column: span 2; height: 6px; }
.hap-out { display: flex; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-3); }
.hap-out input { accent-color: var(--accent); }
.shaker-opts { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2) var(--space-3); align-items: center; margin-top: var(--space-3); }
.shaker-opts .span2 { grid-column: span 2; margin: 0; }
.dev-row { display: flex; gap: var(--space-2); min-width: 0; }
.dev-row select { flex: 1; min-width: 0; }
input[type=range] { accent-color: var(--accent); width: 100%; min-width: 0; }

/* ---------- rig ---------- */
.rig-grid { display: grid; grid-template-columns: 7fr 5fr; gap: var(--space-6); }
.rig-meters { display: grid; grid-template-columns: auto 1fr 4.5em; gap: var(--space-2) var(--space-3); align-items: center; align-content: start; }
.rig-meters .data-sm { text-align: right; }
.rig-acts { grid-column: span 3; display: grid; grid-template-columns: auto 1fr 4.5em; gap: var(--space-2) var(--space-3); align-items: center; margin-top: var(--space-2); }
.meter.bi::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--line); }
.meter .mark { position: absolute; top: -2px; bottom: -2px; width: 3px; margin-left: -1px; background: var(--ink); border-radius: 1px; left: 50%; }
.fill.accent { background: var(--accent); }
.rig-controls { display: flex; flex-direction: column; gap: var(--space-2); }
.rig-controls .row-wrap { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; }
.rig-controls input[type=checkbox] { accent-color: var(--accent); }
.input.num { width: 5.5em; padding: 2px var(--space-1); }
#rigArm[aria-pressed="true"] { background: var(--brake); border-color: var(--brake); color: var(--surface-0); }
#rigMsg { margin: 0; }
@media (max-width: 900px) { .rig-grid { grid-template-columns: 1fr; } }
.motion .rig-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-4); }
.event-log { list-style: none; padding: 0; margin: var(--space-2) 0 0; display: flex; gap: var(--space-2); flex-wrap: wrap; min-height: 22px; }
.event-log li { border: 1px solid var(--haptic); color: var(--ink); border-radius: var(--radius-md); padding: 1px var(--space-2); }

.mapcanvas { width: 100%; height: 340px; display: block; }
.car-kv { margin-top: 0; }
.gforce { display: flex; gap: var(--space-3); align-items: center; margin-top: var(--space-4); }

/* ---------- analysis ---------- */
.table-wrap { overflow-x: auto; max-height: 70vh; overflow-y: auto; }
table.laps { width: 100%; border-collapse: collapse; }
.laps th { text-align: left; color: var(--ink-muted); padding: var(--space-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface-1); font-weight: 600; }
.laps td { padding: var(--space-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.laps tbody tr { cursor: pointer; }
.laps tbody tr:hover { background: var(--surface-2); }
.laps tbody tr[aria-selected="true"] { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--ink); }
.laps input[type=radio] { accent-color: var(--best-lap); }
.lap-actions { display: flex; gap: var(--space-2); margin-top: var(--space-3); flex-wrap: wrap; }
.legend { display: flex; gap: var(--space-4); flex-wrap: wrap; }
.compare-body .mapcanvas { height: 300px; }
.map-key { margin-top: var(--space-2); }
.lanes-wrap { position: relative; margin-top: var(--space-4); }
.lanes { width: 100%; display: block; }
.tip { position: absolute; pointer-events: none; background: var(--surface-0); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-2); min-width: 170px; z-index: 2; }
.tip table { border-collapse: collapse; }
.tip td { padding: 1px var(--space-2) 1px 0; }
.tip .k { color: var(--ink-muted); }

/* ---------- dialog ---------- */
.dialog { color: var(--ink); max-width: 420px; width: calc(100% - 32px); }
.dialog::backdrop { background: rgb(0 0 0 / .55); }
.dialog form { display: flex; flex-direction: column; gap: var(--space-2); }
.input { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); width: 100%; }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }

/* ---------- Driver Dashboard: steering-wheel display ----------
   A dark housing with shift lights on top and purple shift-now lights on the wings; a flat black screen
   with plain sans-serif type, grey label cells and thin outlined boxes. Sized from the viewport (16:9). */
.pdash { background: radial-gradient(120% 90% at 50% 0%, #1d2430 0%, #0b0d11 60%); padding: 2vh 1.5vw; display: flex; align-items: center; justify-content: center; }
.pd-unit { --pd-line: #4a4f55; --pd-cell: #5b6066; --pd-ink: #f5f6f7; --pd-dim: #9aa0a6; --pd-orange: #f39a1e; --pd-teal: #2bb3c0;
  --pd-green: #2fe05a; --pd-yellow: #f2e01a; --pd-red: #ff2a2a; --pd-purple: #d63af5;
  width: 100%; height: 100%; max-width: calc((100vh - 64px) * 2.15); display: flex; align-items: stretch;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; color: var(--pd-ink); }
.pd-wing { width: 4.2%; display: flex; flex-direction: column; justify-content: center; gap: 2.4vh; align-items: center;
  background: linear-gradient(180deg, #24262a, #141518); margin: 9vh 0 14vh; }
.pd-wing.left { border-radius: 40px 0 0 60px; } .pd-wing.right { border-radius: 0 40px 60px 0; }
.pd-wing i { width: 2.6vh; height: 2.6vh; border-radius: 50%; background: #2a2330; box-shadow: inset 0 0 0 1px #3a3340; }
.pd-unit.shiftnow .pd-wing i { background: var(--pd-purple); box-shadow: 0 0 1.6vh var(--pd-purple); }
.pd-body { flex: 1; min-width: 0; display: flex; flex-direction: column; background: linear-gradient(180deg, #26282c 0%, #17181b 30%, #111214 100%);
  border-radius: 7vh 7vh 4vh 4vh; padding: 1.6vh 2.2vw 3.2vh; box-shadow: 0 2vh 6vh rgba(0,0,0,.6), inset 0 1px 0 #3a3d42; }
.pd-leds { display: flex; justify-content: center; gap: 1.1vw; padding: .4vh 0 .6vh; }
.pd-leds i { width: 3.4vh; height: 3.4vh; border-radius: 50%; background: #1d1f22; box-shadow: inset 0 0 0 1px #33363b; }
.pd-leds i.on.g { background: var(--pd-green); box-shadow: 0 0 1.4vh var(--pd-green); }
.pd-leds i.on.y { background: var(--pd-yellow); box-shadow: 0 0 1.4vh var(--pd-yellow); }
.pd-leds i.on.r { background: var(--pd-red); box-shadow: 0 0 1.4vh var(--pd-red); }
.pd-leds.limit i { background: var(--pd-purple); box-shadow: 0 0 1.6vh var(--pd-purple); animation: flash .12s steps(2) infinite; }
.pd-brand { margin-bottom: 1vh; }

.pd-screen { flex: 1; min-height: 0; background: #000; border-radius: .8vh; padding: 1.8vh 1.4vw 2vh;
  display: grid; gap: 1.4vh 1vw;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr) minmax(0, 2fr) minmax(0, 2.6fr) minmax(0, .6fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "title title speed lap pos" "chips table gear timing icons" "info info tyres right icons"; }
.pd-box { border: 2px solid var(--pd-line); border-radius: .9vh; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.pd-head { background: var(--pd-cell); color: var(--pd-ink); text-align: center; font-size: 2.3vh; padding: .5vh 0; }
.pd-row { display: grid; grid-template-columns: auto 1fr; border: 2px solid var(--pd-line); border-radius: .9vh; overflow: hidden; }
.pd-k { background: var(--pd-cell); padding: .5vh .9vw; font-size: 2.5vh; display: flex; align-items: center; white-space: nowrap; }
.pd-v { padding: .5vh .9vw; font-size: 2.8vh; text-align: right; font-variant-numeric: tabular-nums; display: flex; align-items: center; justify-content: flex-end; white-space: nowrap; }

.pd-title { grid-area: title; display: flex; align-items: center; gap: 1vw; color: var(--pd-red); font-size: 2.8vh; text-transform: uppercase; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pd-light { color: #3a3d42; font-size: 2.6vh; letter-spacing: -.1em; } .pd-light.on { color: #8fd2ff; }
.pd-speed { grid-area: speed; flex-direction: row; justify-content: center; align-items: baseline; gap: .6vw; padding: .4vh 0; }
#speed { font-size: 6vh; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pd-unitlbl { font-size: 1.8vh; color: var(--pd-dim); }
.pd-lap { grid-area: lap; align-self: center; justify-self: start; min-width: 60%; }
.pd-pos { grid-area: pos; align-self: center; justify-self: end; border: 2px solid var(--pd-teal); border-radius: .9vh; padding: .7vh 1vw; font-size: 2.8vh; white-space: nowrap; }

.pd-chips { grid-area: chips; display: flex; flex-direction: column; gap: 1.2vh; }
.pd-chip { display: flex; justify-content: space-between; align-items: center; border: 2px solid var(--pd-line); border-radius: .9vh; padding: .6vh .7vw; font-size: 2.5vh; }
.pd-chip b { color: #33363b; font-weight: 400; }
.pd-chip.on { border-color: var(--pd-orange); } .pd-chip.on b { color: var(--pd-orange); }
#lampLim.on { border-color: var(--pd-purple); } #lampLim.on b { color: var(--pd-purple); }
.pd-table { grid-area: table; display: flex; flex-direction: column; gap: .5vh; min-height: 0; overflow: hidden; }
.pd-table .pd-row { flex: 1; min-height: 0; grid-template-columns: 58% 1fr; }
.pd-gearbox { grid-area: gear; align-items: center; justify-content: center; position: relative; }
.pd-gear { font-size: 30vh; line-height: .9; font-weight: 400; }
.pd-gearbox.shift { border-color: var(--pd-purple); } .pd-gearbox.shift .pd-gear { color: #f0c8ff; }
.pd-shift { position: absolute; top: 1vh; right: 1vw; color: var(--pd-purple); font-size: 2.6vh; }
.pd-rpm { position: absolute; bottom: .8vh; color: var(--pd-dim); font-size: 2.2vh; font-variant-numeric: tabular-nums; }
.pd-rpm.hot { color: var(--pd-red); }
.pd-timing { grid-area: timing; display: flex; flex-direction: column; gap: 1vh; min-height: 0; }
.pd-laptime { flex: 1.25; }
.pd-big { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 7.4vh; font-variant-numeric: tabular-nums; }
.pd-pair { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: .8vw; min-height: 0; }
.pd-mid { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 4.2vh; font-variant-numeric: tabular-nums; }
.pd-unit .delta.gain { color: var(--pd-green); } .pd-unit .delta.loss { color: var(--pd-red); }
.pd-icons { grid-area: icons; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3vh; }
.pd-ico { color: #2c2f33; font-size: 3.2vh; } .pd-ico.on { color: var(--pd-yellow); }
#lampLights.on { color: #8fd2ff; } #lampWarn.on { color: var(--pd-purple); }

.pd-info { grid-area: info; align-self: end; display: flex; flex-direction: column; gap: .6vh; padding-bottom: .4vh; }
.pd-carimg { height: 11vh; }
.pd-carimg:empty { display: none; }
.car-thumb.dash { height: 100%; width: auto; max-width: 100%; object-fit: contain; object-position: left center; margin: 0; background: none; border-radius: 0; filter: drop-shadow(0 .4vh .6vh rgba(0,0,0,.6)); }
.car-head { display: inline-flex; align-items: center; gap: var(--space-2); }
.car-thumb.head { height: 34px; width: 72px; margin: -8px 0; }
.pd-small { font-size: 2.3vh; color: var(--pd-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-tyres { grid-area: tyres; border-color: var(--pd-orange); }
.pd-tyres .pd-head { background: var(--pd-orange); color: #111; text-transform: uppercase; }
.pd-tgrid { display: grid; grid-template-columns: 1fr 1fr; padding: .6vh .6vw; gap: .2vh .6vw; }
.pd-tgrid > span { text-align: center; font-size: 3.8vh; font-variant-numeric: tabular-nums; }
.pd-tgrid > span.cold { color: #6fb6ff; } .pd-tgrid > span.hot { color: #ff6a5a; }
.pd-right { grid-area: right; display: flex; flex-direction: column; gap: .8vh; justify-content: center; }
.pd-right .pd-row { grid-template-columns: 55% 1fr; }
.pd-right .pd-row.big .pd-k, .pd-right .pd-row.big .pd-v { font-size: 3.2vh; padding-top: .8vh; padding-bottom: .8vh; }
.pd-right .pd-row.best .pd-v { color: #c49cff; }

@media (max-width: 999px) {
  .pdash { padding: var(--space-2); display: block; }
  .pd-unit { max-width: none; height: auto; }
  .pd-wing { display: none; }
  .pd-body { border-radius: 24px; padding: 12px; }
  .pd-leds { gap: 4px; } .pd-leds i { width: 4.5vw; height: 4.5vw; }
  .pd-wordmark { height: 28px; }
  .pd-screen { grid-template-columns: 1fr 1fr; grid-template-rows: none;
    grid-template-areas: "title pos" "speed lap" "gear gear" "timing timing" "chips table" "tyres right" "info info"; }
  .pd-gearbox { min-height: 40vh; } .pd-gear { font-size: 34vw; }
  .pd-icons { display: none; }
  .pd-big { font-size: 10vw; } .pd-mid { font-size: 6vw; }
  .pd-k, .pd-v, .pd-chip, .pd-head, .pd-small, .pd-title, .pd-pos { font-size: 14px; }
  .pd-tgrid > span { font-size: 18px; } #speed { font-size: 36px; }
}
/* Laps table: tighter cells so all columns fit the right-hand column at 16:9 */
.trackview .laps th, .trackview .laps td { padding: var(--space-1) 5px; }
.trackview .laps td.car { max-width: 92px; }
.laps td.car { overflow: hidden; text-overflow: ellipsis; }
.laps select.drv { max-width: 100px; padding: 1px 2px; background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); font: inherit; color: inherit; }
.laps select.drv:hover, .laps select.drv:focus { border-color: var(--line); background: var(--surface-2); }
.laps input[type=checkbox] { accent-color: var(--accent); }
.setup-row select { width: auto; padding: 2px var(--space-2); }
.driver-list { list-style: none; padding: 0; margin: var(--space-3) 0; display: flex; flex-direction: column; gap: var(--space-2); max-height: 40vh; overflow: auto; }
.driver-list li { display: flex; gap: var(--space-2); align-items: center; }
.driver-list input { flex: 1; }
.add-driver { display: flex; gap: var(--space-2); }
.add-driver input { flex: 1; }

/* Carbon-fibre housing for the Driver Dashboard: a 2×2 twill weave from gradients, with a glossy sheen on top. */
.pd-unit { --carbon:
    linear-gradient(27deg, #101010 5px, transparent 5px) 0 5px / 20px 20px,
    linear-gradient(207deg, #101010 5px, transparent 5px) 10px 0 / 20px 20px,
    linear-gradient(27deg, #363636 5px, transparent 5px) 0 10px / 20px 20px,
    linear-gradient(207deg, #363636 5px, transparent 5px) 10px 5px / 20px 20px,
    linear-gradient(90deg, #1b1b1b 10px, transparent 10px) 0 0 / 20px 20px,
    linear-gradient(#1d1d1d 25%, #1a1a1a 25%, #1a1a1a 50%, transparent 50%, transparent 75%, #303030 75%, #303030) 0 0 / 20px 20px,
    #131313; }
.pd-body { background:
    linear-gradient(165deg, rgba(255,255,255,.13) 0%, rgba(255,255,255,.04) 28%, rgba(0,0,0,0) 45%, rgba(0,0,0,.2) 100%),
    var(--carbon);
  box-shadow: 0 2vh 6vh rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.18), inset 0 0 0 1px rgba(255,255,255,.05); }
.pd-wing { background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(0,0,0,.35)), var(--carbon); }
.pd-screen { box-shadow: 0 0 0 3px #0a0a0a, 0 0 0 4px rgba(255,255,255,.08); }

/* Full screen on the Driver Dashboard: no app bar, the dashboard uses the whole screen.
   Moving the mouse shows an exit button for a few seconds (Esc also works). */
body.fs-driver .top { display: none; }
body.fs-driver .pd-unit { max-width: calc(100vh * 2.15); }
.fs-exit { position: fixed; top: 12px; right: 12px; z-index: 10; opacity: 0; pointer-events: none; transition: opacity .3s; }
body.fs-driver .fs-exit.show { opacity: .9; pointer-events: auto; }
body:not(.fs-driver) .fs-exit { display: none; }

/* ---------- Monitors (?screen=N) and the Screens dialog ---------- */
body.screen-mode { height: 100dvh; overflow: hidden; }
body.screen-mode .top, body.screen-mode .box-fs, body.screen-mode .fs-exit { display: none !important; }
.screen-grid { position: fixed; inset: 0; display: grid; gap: var(--space-3); padding: var(--space-3); background: var(--surface-0); }
.screen-cell { display: flex !important; flex-direction: column; min-width: 0; min-height: 0; padding: 0 !important; grid-template: none !important; background: none; }
.screen-cell > .panel { flex: 1 1 0; min-height: 0; grid-area: auto !important; display: flex; flex-direction: column; overflow: hidden; }
.screen-cell > .panel > .table-wrap, .screen-cell > .panel > .map-wrap, .screen-cell > .panel > .map-row, .screen-cell > .panel > .act-wrap { flex: 1 1 0; min-height: 0; max-height: none; }
.screen-cell .map-wrap > .mapcanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.screen-cell.pdash { position: relative; overflow: hidden; border-radius: var(--radius-lg); }
.screen-empty { grid-column: 1 / -1; align-self: center; justify-self: center; max-width: 520px; text-align: center; display: grid; gap: var(--space-3); }
.dialog.profile-dlg { width: min(560px, 94vw); max-width: none; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-2); }
.profile-grid label { display: flex; flex-direction: column; gap: 4px; }
.profile-bb { max-height: 30vh; }
.lap-notice { margin: 0 0 var(--space-2); padding: 4px 8px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink-muted); }
.pf-shown { display: flex; flex-direction: column; gap: 4px; } .pf-shown .readout-md { color: var(--ink); text-transform: none; }
.drv-name { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.add-driver input { min-width: 0; flex: 1; }
.profile-bb input.bb { width: 64px; }
/* Drivers window: wide enough for name, country and buttons on one line */
#driversDlg.dialog { width: min(720px, 94vw); max-width: none; }
.driver-list li { flex-wrap: nowrap; }
.driver-list li .btn { flex: none; white-space: nowrap; }
.drv-flag { flex: none; font-size: 20px; line-height: 1; cursor: default; }
.add-driver .btn { flex: none; }
.dialog.screens-dlg { width: min(640px, 94vw); max-width: none; }
.screens-dlg form { display: grid; gap: var(--space-2); }
.screens-dlg .table-wrap { max-height: 40vh; }
.screens-table select { width: 100%; }
.screen-links { display: grid; gap: var(--space-1); margin: var(--space-2) 0; }
.screen-link { display: grid; grid-template-columns: 90px 64px minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); }
.screen-link code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Sounds */
.dialog.sound-dlg { width: min(520px, 94vw); max-width: none; }
.snd-master { display: flex; align-items: center; gap: 6px; }
.snd-list { list-style: none; margin: var(--space-2) 0; padding: 0; display: grid; gap: 4px; max-height: 50vh; overflow-y: auto; }
.snd-list li { display: flex; align-items: center; gap: var(--space-2); justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--line); }
.snd-list label { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; cursor: pointer; }
.snd-list input, .snd-master input { accent-color: var(--accent); }

/* Notice while a page (shared view, monitor) reloads itself */
.reload-notice { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgb(8 10 13 / .72); backdrop-filter: blur(3px); }
.reload-notice[hidden] { display: none; }
.rn-box { width: min(420px, 88vw); padding: 20px 22px; border-radius: var(--radius-lg); background: var(--surface-1); border: 1px solid var(--line); box-shadow: 0 12px 40px rgb(0 0 0 / .45); }
.rn-title { color: var(--accent); }
.rn-text { margin: 6px 0 14px; color: var(--ink); }
.rn-bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.rn-bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.rn-bar i.rn-wait { width: 35%; animation: rn-slide 1.2s ease-in-out infinite; }
@keyframes rn-slide { from { transform: translateX(-100%); } to { transform: translateX(290%); } }

/* ---------- Paddock ---------- */
.paddockview:not([hidden]) { display: flex; flex-direction: column; gap: var(--space-3); } /* (never override [hidden]: other pages would show it) */
.paddockview > .pk-sec { flex: 1; min-height: 0; }
.paddockview > .pk-sec[hidden] { display: none !important; }
.pk-nav { display: flex; align-items: center; gap: 4px; flex: none; }
.pk-tab { background: var(--surface-1); border: 1px solid var(--line); color: var(--ink-muted); padding: 6px 14px; border-radius: var(--radius-md); cursor: pointer; }
.pk-tab[aria-selected="true"] { background: var(--surface-2); color: var(--ink); border-color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.pk-where { margin-left: auto; }
.setupview, .stratview { display: grid; gap: var(--space-3); grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: minmax(0, 1fr); }
.notesview { display: grid; grid-template-rows: minmax(0, 1fr); }
.setupview > .panel, .stratview > .panel, .notesview > .panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.setupview .table-wrap, .stratview .table-wrap { flex: 1; min-height: 0; max-height: none; }
.su-table tbody tr { cursor: pointer; } .su-table tr[aria-selected="true"] { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.su-active { color: var(--throttle); font-weight: 600; white-space: nowrap; }
.su-form { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-3); align-content: start; padding-right: 4px; }
.su-name, .su-notes { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; }
.su-group { border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); margin: 0; min-width: 0; }
.su-group legend { padding: 0 4px; }
.su-pairs { display: grid; grid-template-columns: minmax(0, 1fr) 80px 80px; gap: 4px 8px; align-items: center; }
.su-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px 10px; margin-top: 6px; }
.su-fields label { display: flex; flex-direction: column; gap: 3px; }
.su-pairs input, .su-fields input, .su-fields select { width: 100%; min-width: 0; }
.st-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--space-2) var(--space-3); overflow-y: auto; }
.st-form label { display: flex; flex-direction: column; gap: 4px; }
.st-pair { display: flex; gap: 6px; } .st-pair input { flex: 1 1 60px; min-width: 60px; } .st-pair select { flex: 0 0 auto; width: auto; }
.st-plans tbody tr { cursor: pointer; } .st-plans tr[aria-selected="true"] { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.st-plans tr.st-bad { cursor: default; color: var(--ink-muted); }
.st-plan { display: grid; gap: 6px; margin-top: var(--space-3); flex: none; }
.st-stint { display: grid; grid-template-columns: 70px 110px minmax(0, 1fr) 190px; gap: var(--space-2); align-items: center; padding: 6px 8px; background: var(--surface-2); border-radius: var(--radius-md); }
.nt-form { display: flex; gap: var(--space-2); margin-bottom: var(--space-3); flex: none; } .nt-form input { flex: 1; min-width: 0; } .nt-form select { flex: 0 0 auto; width: auto; } .nt-form .btn { flex: none; }
.nt-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: grid; gap: 6px; align-content: start; }
.nt-list li { display: flex; align-items: center; gap: var(--space-2); padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius-md); }
.nt-corner { flex: none; font: 700 13px/1 var(--font-display); padding: 3px 7px; border-radius: 4px; background: var(--accent); color: var(--on-accent); }
.nt-text { flex: 1; min-width: 0; } .nt-by { flex: none; white-space: nowrap; }
@media (max-width: 999px) { .setupview, .stratview { grid-template-columns: 1fr; grid-template-rows: none; } .st-stint { grid-template-columns: 1fr 1fr; } }

/* ---------- Coach ---------- */
.coachview { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "sum map" "corners corners"; }
.coachview > .panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.co-summary { grid-area: sum; overflow-y: auto !important; } .co-map { grid-area: map; } .co-corners { grid-area: corners; }
.coachview .table-wrap { flex: 1; min-height: 0; max-height: none; }
.co-controls { display: inline-flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; justify-content: flex-end; }
.co-controls select { max-width: 280px; }
.co-controls input { accent-color: var(--accent); vertical-align: -2px; }
.co-vs { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-3); }
.co-vs > div:not(.co-gap):not(.co-car) { display: flex; flex-direction: column; gap: 2px; }
.co-vs .best { color: var(--best-lap); }
.co-gap { font: 700 26px/1 var(--font-display); }
.co-gap.loss, .co-table .loss, .co-loss { color: var(--brake); } .co-gap.gain, .co-table .gain { color: var(--throttle); }
.co-car { margin-left: auto; display: flex; align-items: center; } .co-car .car-thumb { width: 64px; height: 30px; }
.co-top { display: grid; gap: var(--space-2); }
.co-tip { padding: var(--space-2) var(--space-3); background: var(--surface-2); border-radius: var(--radius-md); border-left: 3px solid var(--brake); }
.co-tip p { margin: 4px 0 0; }
.co-tip-head { display: flex; align-items: center; gap: var(--space-2); }
.co-rank { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--brake); color: #fff; font: 700 12px/1 var(--font-display); }
.co-loss { margin-left: auto; font: 700 16px/1 var(--font-display); }
.co-table td.co-tipcell { white-space: normal; min-width: 260px; color: var(--ink-muted); }
.co-table tr.co-hot td:first-child { box-shadow: inset 3px 0 0 var(--brake); }
.drv-guest { white-space: nowrap; color: var(--ink-muted); }
/* Live cue on the Driver Dashboard */
.pd-cue { position: absolute; left: 50%; top: 7.6vh; transform: translateX(-50%); z-index: 5; padding: .6vh 1.6vh; border-radius: .8vh;
  background: rgba(10, 12, 15, .88); border: 2px solid var(--pd-orange); color: #fff; font: 700 3.4vh/1.1 "Barlow Condensed", sans-serif;
  letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; box-shadow: 0 .6vh 1.6vh rgba(0,0,0,.6); }
@media (max-width: 999px) { .coachview { grid-template-columns: 1fr; grid-template-rows: none; grid-template-areas: none; } .coachview > .panel { grid-area: auto; } .co-map { height: 50vh; } .pd-cue { font-size: 18px; } }

/* ---------- Leaderboard ---------- */
.boardview { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: minmax(0, 1fr); }
.boardview > .panel { display: flex; flex-direction: column; min-height: 0; }
.boardview .table-wrap { flex: 1; min-height: 0; max-height: none; }
.lb-tracks tbody tr { cursor: pointer; }
.lb-tracks tbody tr:hover { background: var(--surface-2); }
.lb-tracks tbody tr.sel { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.lb-live { color: var(--throttle); }
/* Keyboard: the list you're in, and the row the arrow keys are on */
.kb-list:focus { outline: none; }
.panel:has(> .kb-list:focus), .panel:has(.kb-list:focus) { border-color: var(--accent); }
.kb-list tr.kb { box-shadow: inset 3px 0 0 var(--accent); background: var(--surface-2); }
.kb-list:not(:focus) tr.kb:not([aria-selected="true"]):not(.sel) { box-shadow: none; background: none; }
.lb-table td.name { max-width: 220px; }
.lb-table td.pos { font-weight: 700; }
.lb-table tr.me td { color: var(--accent); }
.lb-table td.best { color: var(--best-lap); font-weight: 600; }
.lb-controls { display: inline-flex; align-items: center; gap: var(--space-1); }
.lb-controls select { max-width: 260px; }
.lb-podium { display: flex; gap: var(--space-3); margin-bottom: var(--space-3); }
.lb-podium:empty { display: none; }
.lb-step { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--space-2); background: var(--surface-2); border-radius: var(--radius-md); border-top: 3px solid var(--line); text-align: center; }
.trophy { width: 16px; height: 16px; vertical-align: middle; margin: -3px 5px -3px 0; }
.trophy.big { width: 22px; height: 22px; margin: -4px 2px 0 0; }
.trophy path { fill: currentColor; stroke: currentColor; }
.trophy path[fill="none"] { fill: none; }
.trophy.t1 { color: #e8b923; } .trophy.t2 { color: #b8c2cc; } .trophy.t3 { color: #c47a3d; }
.lb-step.p1 { border-top-color: #e8b923; } .lb-step.p2 { border-top-color: #b8c2cc; } .lb-step.p3 { border-top-color: #c47a3d; }
.lb-step .caption, .lb-who { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-place { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.lb-who { font-weight: 600; }
.car-thumb.podium { width: 150px; height: 64px; margin: 0; }
@media (max-width: 999px) { .boardview { grid-template-columns: 1fr; grid-template-rows: none; } .boardview .table-wrap { max-height: 50vh; } .car-thumb.podium { width: 96px; height: 44px; } }

/* ---------- Driver Info ---------- */
.statsview { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr);
  grid-template-rows: auto minmax(0, 1fr) minmax(0, .62fr);
  grid-template-areas: "tiles tiles tiles" "tracks cars races" "activity activity style"; }
.st-tiles { grid-area: tiles; } .st-tracks { grid-area: tracks; } .st-cars { grid-area: cars; } .st-races { grid-area: races; }
.st-activity { grid-area: activity; display: flex; flex-direction: column; overflow: hidden; } .st-style { grid-area: style; }
.statsview > .panel:not(.st-tiles) { display: flex; flex-direction: column; }
.statsview .table-wrap { flex: 1; min-height: 0; max-height: none; }
.stat-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: var(--space-3); }
.stat { display: flex; flex-direction: column; gap: 2px; padding: var(--space-2) var(--space-3); background: var(--surface-2); border-radius: var(--radius-md); min-width: 0; }
.stat .readout-lg { font-size: 30px; line-height: 36px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .caption { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-who { display: inline-flex; align-items: center; gap: var(--space-1); }
.st-who select { max-width: 240px; }
.st-table td, .st-table th { padding: var(--space-1) 6px; }
.st-table .num { text-align: right; }
.st-table td.name { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.st-table tbody tr { cursor: default; }
.st-kv { margin: 0; }
.act-wrap { position: relative; flex: 1; min-height: 0; }
#stActivity { width: 100%; height: 100%; display: block; }
@media (max-width: 1300px) { .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 999px) {
  .statsview { grid-template-columns: 1fr; grid-template-rows: none; grid-template-areas: none; }
  .statsview > .panel { grid-area: auto; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-activity { height: 260px; }
  .statsview .table-wrap { max-height: 50vh; }
}

/* ---------- menu bar: who is driving ---------- */
.top-center { margin: 0 auto; display: flex; align-items: center; gap: var(--space-2); }
.top-right { margin-left: 0; }
.top-center { position: relative; }
.car-thumb.seat { width: 88px; height: 40px; margin: 0; }
.seat-num { align-self: flex-end; margin-bottom: 4px; padding: 1px 7px; border-radius: 5px; background: #f5f6f7; color: #0a0c0f; border: 2px solid var(--accent);
  font: 800 22px/1.1 var(--font-display); letter-spacing: .02em; font-style: italic; }
.seat-car:empty { display: none; }
.seat-menu { position: fixed; z-index: 70; display: flex; flex-direction: column; padding: 4px; background: var(--surface-1); border: 1px solid var(--line);
  border-radius: var(--radius-md); box-shadow: 0 8px 24px rgb(0 0 0 / .35); max-height: 60vh; overflow-y: auto; }
.seat-opt { all: unset; box-sizing: border-box; display: block; padding: 6px 10px; border-radius: var(--radius-sm); font: 500 14px/1.3 var(--font-sans); color: var(--ink); cursor: pointer; white-space: nowrap; }
.seat-opt:hover, .seat-opt:focus-visible { background: var(--surface-2); outline: none; }
.seat-opt[aria-selected="true"] { color: var(--accent); }
.seat-manage { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-sm) var(--radius-sm); color: var(--ink-muted); }
#manageDrivers { display: none; } /* opened from the seat menu (Manage drivers…) */
.seat { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; cursor: pointer; }
.seat-label { font-size: 10px; line-height: 1; letter-spacing: .12em; }

.driver-big { appearance: none; -webkit-appearance: none; background: transparent; border: 0; border-bottom: 2px solid var(--accent); border-radius: 0;
  font: 700 30px/1.1 var(--font-display); letter-spacing: .05em; text-transform: uppercase; color: var(--ink); padding: 0 22px 2px 2px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 9px) 55%, calc(100% - 3px) 55%; background-size: 6px 6px; background-repeat: no-repeat; }
.driver-big option { font: 400 15px var(--font-sans); text-transform: none; color: var(--ink); background: var(--surface-1); }
.driver-list .country-sel, .add-driver .country-sel { flex: 0 0 170px; width: 170px; }
.pd-flag { font-size: 3.2vh; margin-right: .6vw; }

/* ---------- Driver Dashboard in 3D: tilted unit, bevelled carbon housing with thickness, recessed glass screen,
   domed LED lenses, screws and rotary knobs. ---------- */
.pdash { perspective: 1800px; perspective-origin: 50% 20%; }
.pd-unit { transform: translateY(-2vh) rotateX(6deg) scale(.92); transform-style: preserve-3d; filter: drop-shadow(0 4vh 3vh rgba(0,0,0,.65)); }
.pd-body { position: relative;
  background:
    radial-gradient(120% 70% at 28% -10%, rgba(255,255,255,.2), rgba(255,255,255,0) 55%),
    linear-gradient(165deg, rgba(255,255,255,.1) 0%, rgba(255,255,255,.03) 30%, rgba(0,0,0,0) 48%, rgba(0,0,0,.3) 100%),
    var(--carbon);
  box-shadow:
    inset 0 2px 1px rgba(255,255,255,.28), inset 0 -4px 8px rgba(0,0,0,.7), inset 2px 0 2px rgba(255,255,255,.06), inset -2px 0 2px rgba(0,0,0,.5),
    0 0 0 2px #050505, 0 1.4vh 0 #070707, 0 1.4vh 0 2px #030303, 0 3vh 4vh rgba(0,0,0,.6); }
.pd-wing { position: relative;
  background: radial-gradient(90% 60% at 50% 0%, rgba(255,255,255,.14), transparent 60%), linear-gradient(180deg, rgba(255,255,255,.08), rgba(0,0,0,.4)), var(--carbon);
  box-shadow: inset 0 2px 1px rgba(255,255,255,.2), inset 0 -4px 8px rgba(0,0,0,.7), 0 1.4vh 0 #060606, 0 3vh 4vh rgba(0,0,0,.5); }
.pd-brand { filter: drop-shadow(0 -1px 0 rgba(0,0,0,.9)) drop-shadow(0 1px 0 rgba(255,255,255,.12)); } /* embossed lettering */
.pd-screen { position: relative;
  box-shadow: inset 0 0 0 2px #000, inset 0 1.2vh 2vh rgba(0,0,0,.9), 0 0 0 3px #0b0b0b, 0 0 0 4px rgba(255,255,255,.07), 0 -2px 0 4px rgba(0,0,0,.6); }
.pd-screen::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(112deg, rgba(255,255,255,.075) 0%, rgba(255,255,255,.025) 32%, rgba(255,255,255,0) 33%), radial-gradient(80% 50% at 50% 0%, rgba(255,255,255,.04), transparent 70%); }
/* LEDs: domed lenses in a dark bezel ring */
.pd-leds i, .pd-wing i { background: radial-gradient(circle at 35% 30%, #4a4d52 0 6%, #1c1e21 45%, #0c0d0e 100%); box-shadow: 0 0 0 2px #070707, 0 0 0 3px rgba(255,255,255,.08), inset 0 -2px 3px rgba(0,0,0,.8); }
.pd-leds i.on.g { background: radial-gradient(circle at 35% 30%, #fff 0 7%, #8dff9f 20%, #22d84a 50%, #0d7a24 100%); box-shadow: 0 0 0 2px #070707, 0 0 1.6vh #2fe05a; }
.pd-leds i.on.y { background: radial-gradient(circle at 35% 30%, #fff 0 7%, #fff7a0 20%, #f2e01a 50%, #8a7d00 100%); box-shadow: 0 0 0 2px #070707, 0 0 1.6vh #f2e01a; }
.pd-leds i.on.r { background: radial-gradient(circle at 35% 30%, #fff 0 7%, #ff9a9a 20%, #ff2a2a 50%, #8a0000 100%); box-shadow: 0 0 0 2px #070707, 0 0 1.6vh #ff2a2a; }
.pd-leds.limit i, .pd-unit.shiftnow .pd-wing i { background: radial-gradient(circle at 35% 30%, #fff 0 7%, #f2b8ff 20%, #d63af5 50%, #6b0f80 100%); box-shadow: 0 0 0 2px #070707, 0 0 1.8vh #d63af5; }
/* screws in the housing corners, rotary knobs under the wing lights */
.pd-screw { position: absolute; width: 1.6vh; height: 1.6vh; border-radius: 50%;
  background: linear-gradient(45deg, transparent 44%, #1a1a1a 45% 55%, transparent 56%), radial-gradient(circle at 35% 30%, #d9dde1, #7b8187 60%, #3a3e42);
  box-shadow: 0 0 0 1px #050505, 0 1px 1px rgba(255,255,255,.15); }
.pd-screw.tl { top: 2.2vh; left: 3vh; } .pd-screw.tr { top: 2.2vh; right: 3vh; } .pd-screw.bl { bottom: 1.2vh; left: 3vh; } .pd-screw.br { bottom: 1.2vh; right: 3vh; }
.pd-knob { width: 4.2vh; height: 4.2vh; border-radius: 50%; margin-top: 1vh;
  background: radial-gradient(circle at 50% 50%, #2a2c30 0 42%, transparent 43%), repeating-conic-gradient(#3b3f45 0 6deg, #15171a 6deg 12deg);
  box-shadow: 0 0 0 2px #070707, 0 .6vh .8vh rgba(0,0,0,.7), inset 0 1px 1px rgba(255,255,255,.2); }
@media (max-width: 999px) { .pdash { perspective: none; } .pd-unit { transform: none; } .pd-screw, .pd-knob { display: none; } .top-center { order: 3; width: 100%; justify-content: center; } }

/* app menu: restart / quit */
.app-menu { position: relative; }
.app-menu summary { list-style: none; cursor: pointer; }
.app-menu summary::-webkit-details-marker { display: none; }
.app-menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-2); min-width: 150px; }
.app-menu-list .danger:hover { border-color: var(--brake); color: var(--brake); }
.app-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(0,0,0,.7); }
.app-overlay .panel { max-width: 420px; text-align: center; }

/* Driver Dashboard: face-on (flat to the screen) while keeping the moulded depth */
.pdash { perspective: none; }
.pd-unit { transform: none; }
.pdash { padding-bottom: 4vh; }

/* ---------- online sharing ---------- */
.share-toggle { display: inline-flex; align-items: center; gap: var(--space-1); cursor: pointer; padding: var(--space-1) var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-md); }
.share-toggle input { accent-color: var(--accent); }
.share-info { display: inline-flex; align-items: center; gap: var(--space-2); }
.share-info a { color: var(--accent); }
.shared-only { display: none; }
/* Viewers of the shared link: everything that changes something is hidden or disabled. */
.shared .shared-only { display: inline-flex; color: var(--throttle); }
.shared .owner-only, .shared .lap-actions, .shared .rig-controls > :not(#rigMsg), .shared .hap-out, .shared #shakerOpts,
.shared .setup-row label, .shared .setup-row .muted:last-child, .shared #checkAll { display: none !important; }
.shared .driver-big { background-image: none; cursor: default; padding-right: 2px; opacity: 1; }
.shared .driver-big:disabled { color: var(--ink); }
.shared #rigMsg::before { content: "Live view · "; }
.btn.icon { font-size: 16px; line-height: 16px; min-width: 36px; padding: var(--space-2); }

/* sectors */
.laps td.sec { font-variant-numeric: tabular-nums; }
.laps td.sec.best { color: var(--best-lap); font-weight: 600; }
#idealLap { color: var(--best-lap); }
.sector-live { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.sector-live .gain { color: var(--throttle); } .sector-live .loss { color: var(--brake); }
.sector-live b { font-weight: 600; color: var(--ink-muted); margin-right: 2px; }

/* Laps table at 16:9: compact cells; Driver column hidden while one driver is selected */
.trackview .laps th, .trackview .laps td { padding: var(--space-1) 3px; }
.trackview .laps td.car { max-width: 84px; }
.trackview .laps select.drv { max-width: 84px; }
.laps.one-driver th:nth-child(9), .laps.one-driver td:nth-child(9) { display: none; }
.trackview .laps td.car { max-width: 72px; }
.trackview .laps select.drv { max-width: 62px; }
.trackview .laps td.sec { font-size: 11px; }
.trackview .laps td:nth-child(5) { font-size: 11px; }
.trackview .laps input.bb { width: 2.6em; }
/* Laps table: fixed column widths (they scale with the panel), so it never overflows whatever is in the rows */
.trackview table.laps { table-layout: fixed; width: 100%; }
.trackview table.laps td { overflow: hidden; text-overflow: ellipsis; }
.trackview table.laps th:nth-child(1) { width: 4%; }   /* select */
.trackview table.laps th:nth-child(2) { width: 8%; }   /* lap */
.trackview table.laps th:nth-child(3) { width: 13%; }  /* on */
.trackview table.laps th:nth-child(4) { width: 10%; }  /* time */
.trackview table.laps th:nth-child(5) { width: 9%; }   /* gap */
.trackview table.laps th:nth-child(6), .trackview table.laps th:nth-child(7), .trackview table.laps th:nth-child(8) { width: 7.5%; } /* sectors */
.trackview table.laps th:nth-child(9) { width: 10%; }  /* driver */
.trackview table.laps th:nth-child(10) { width: 11%; } /* car */
.trackview table.laps th:nth-child(11) { width: 6%; }  /* brake bias */
.trackview table.laps th:nth-child(12) { width: 4%; }  /* ref */
.trackview .laps td.car, .trackview .laps select.drv { max-width: none; width: 100%; }
.trackview .laps input.bb { width: 100%; }

/* Menu bar: compact icon buttons so everything fits on one line on a 1600 px wide screen */
.top-right .btn.icon { min-width: 30px; padding-inline: 6px; }
.top-center { gap: 6px; }

/* event legend row under each live map head (same on both maps) */
.ev-row { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0 0 var(--space-2); }
.ev-row .legend { gap: var(--space-2); }

/* teams */
.team-chip { display: inline-flex; align-items: center; gap: 1.5px; flex: none; vertical-align: middle;
  font: 600 10px/14px "JetBrains Mono", monospace; letter-spacing: 0.08em; color: var(--ink-muted); }
.team-chip i { display: inline-block; width: 2.5px; height: 11px; background: var(--tc); transform: skewX(-14deg); border-radius: 0.5px; }
.team-chip i + i { background: var(--tc2); margin-right: 4px; }
.dialog.team-dlg { width: min(860px, 96vw); max-width: none; }
.team-grid { grid-template-columns: repeat(4, 1fr); }
.tm-livery { display: flex; flex-direction: column; gap: 4px; }
.tm-livery span { display: flex; gap: var(--space-2); }
.tm-livery input[type="color"] { width: 44px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: none; cursor: pointer; }
.tm-roster, .tm-entries { max-height: 30vh; overflow: auto; margin-bottom: var(--space-2); }
.tm-roster td:first-child { width: 28px; }
.tm-entries .tm-num { width: 52px; }
.tm-entries .tm-car { max-width: 260px; }
.tm-crew { display: flex; flex-wrap: wrap; gap: 2px var(--space-3); }
.tm-crew label { white-space: nowrap; }
.cat { font: 700 9px/14px "JetBrains Mono", monospace; padding: 0 4px; border-radius: 3px; border: 1px solid currentColor; }
.cat-platinum { color: #b8c4d0; } .cat-gold { color: #e0b43a; } .cat-silver { color: #9aa4af; } .cat-bronze { color: #c07a45; }
.dialog-actions .spacer { flex: 1; }
@media (max-width: 700px) { .team-grid { grid-template-columns: 1fr 1fr; } }

/* map + g-force column */
.map-row { display: flex; flex: 1; min-height: 0; gap: var(--space-2); }
.map-row > .map-wrap { flex: 1; min-width: 0; }
.gstrip { flex: none; overflow-y: auto; overflow-x: hidden; border-left: 1px solid var(--line); padding-left: var(--space-2); max-width: 46%; }
.gstrip table { border-collapse: collapse; font: 400 11px/1.25 "JetBrains Mono", monospace; }
.gstrip thead th { position: sticky; top: 0; background: var(--surface-1); font: 600 11px "Barlow Condensed", sans-serif; color: var(--ink-muted); letter-spacing: 0.04em; padding: 1px 4px; text-align: center; }
.gstrip thead tr.sub th { top: 15px; font: 400 9px "JetBrains Mono", monospace; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.gstrip thead th.ref, .gstrip td.ref { color: var(--best-lap); }
.gstrip tbody th { font: 700 10px "JetBrains Mono", monospace; color: var(--ink-muted); text-align: left; padding: 2px 6px 2px 0; }
.gstrip td { text-align: right; padding: 2px 4px; white-space: nowrap; }
.gstrip td.me { color: var(--ink); font-weight: 600; }
.gstrip td.me + td.ref { padding-right: 10px; }
.gstrip tbody tr { cursor: default; border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
.gstrip tbody tr:hover { background: var(--surface-2); }
.gstrip td i { font-style: normal; font-size: 8px; margin-left: 2px; vertical-align: 1px; }
.gstrip td i.up { color: var(--throttle); } .gstrip td i.dn { color: var(--brake); }
.gstrip p { margin: 2px 0; max-width: 180px; }
@media (max-width: 700px) { .map-row { flex-direction: column; } .gstrip { border-left: 0; padding-left: 0; max-width: none; max-height: 200px; } }
.team-grid .input { width: 100%; box-sizing: border-box; }

/* Drivers and Teams pages */
.rosterview { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.rosterview > .panel { display: flex; flex-direction: column; min-height: 0; }
.rosterview .table-wrap, .rosterview .team-cards { flex: 1; min-height: 0; max-height: none; overflow: auto; }
.rosterview .add-driver { max-width: 760px; margin: var(--space-2) 0; }
.rosterview .add-driver .country-sel { flex: 0 0 190px; }
.drv-table .drv-row { cursor: pointer; }
.drv-table .drv-row:hover, .drv-table .drv-row:focus-visible { background: var(--surface-2); outline: none; }
.drv-table td.acts { text-align: right; white-space: nowrap; }
.drv-table td.acts .btn + .btn { margin-left: var(--space-1); }
.drv-table .drv-flag { font-size: 18px; vertical-align: -2px; }
.seat-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--throttle); box-shadow: 0 0 6px var(--throttle); vertical-align: 1px; }
/* GT7 ratings */
.rt { display: inline-block; font: 700 10px/16px "JetBrains Mono", monospace; padding: 0 5px; border-radius: 3px; margin-right: 3px; white-space: nowrap;
  border: 1px solid var(--line); color: var(--ink); background: var(--surface-2); }
.rt[data-v="S"] { border-color: #e0b43a; color: #e0b43a; }
.rt[data-v="A+"], .rt[data-v="A"] { border-color: var(--throttle); color: var(--throttle); }
.rt[data-v="B"] { border-color: var(--clutch); color: var(--clutch); }
.rt[data-v="D"], .rt[data-v="E"] { color: var(--ink-muted); }
.gr-cat { display: inline-block; font: 700 10px/16px "JetBrains Mono", monospace; padding: 0 5px; border-radius: 3px; background: var(--ink); color: var(--surface-0); margin-left: 6px; vertical-align: middle; }
/* team cards */
.team-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: var(--space-3); align-content: start; grid-auto-rows: max-content; padding: 2px; }
.team-card { position: relative; border: 1px solid var(--line); border-radius: var(--radius-md, 8px); background: var(--surface-1); padding: var(--space-3); padding-top: calc(var(--space-3) + 8px); display: flex; min-height: min-content; flex-direction: column; gap: var(--space-1); }
.tc-livery { position: absolute; left: 0; right: 0; top: 0; height: 8px; border-radius: var(--radius-md, 8px) var(--radius-md, 8px) 0 0; background: linear-gradient(100deg, var(--tc) 0 62%, var(--tc2) 62% 72%, var(--tc) 72%); }
.team-card header { display: flex; align-items: center; gap: var(--space-2); cursor: pointer; }
.tc-flag { font-size: 20px; line-height: 1; }
.tc-name { font: 700 18px/1.1 "Barlow Condensed", sans-serif; letter-spacing: 0.02em; }
.tc-h { margin-top: var(--space-2); }
.tc-roster, .tc-entries { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tc-roster li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tc-role { margin-left: auto; font-size: 12px; }
.tc-entries li { display: flex; align-items: center; gap: var(--space-2); }
.tc-num { font: 800 18px "Barlow Condensed", sans-serif; min-width: 38px; padding: 0 4px; text-align: center; border-radius: 4px; background: #f5f6f7; color: #0a0c0f; border: 2px solid var(--tc); }
.tc-car { line-height: 1.3; }
.team-card footer { display: flex; gap: var(--space-1); justify-content: flex-end; margin-top: auto; padding-top: var(--space-2); }
/* pen next to the seat */
.seat-edit { all: unset; cursor: pointer; align-self: flex-end; margin-bottom: 6px; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--ink-muted); }
.seat-edit svg { width: 15px; height: 15px; }
.seat-edit:hover { color: var(--accent); background: var(--surface-2); }
.seat-edit:focus-visible { outline: 2px solid var(--accent); }

/* event legend: chips like the map buttons */
.ev-toggles { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); }
.ev-row .ev-toggle.btn { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; text-decoration: none; opacity: 1; padding-left: 6px; }
.ev-row .ev-toggle .ev-icon { width: 15px; height: 15px; flex: none; }
.ev-row .ev-toggle .ev-icon text { font: 800 9px "JetBrains Mono", monospace; text-anchor: middle; }
.ev-row .ev-toggle[aria-pressed="false"] { opacity: 0.45; text-decoration: line-through; }
.ev-row .ev-toggle[aria-pressed="false"] .ev-icon { filter: grayscale(1); }
.ev-row .ev-note { margin-left: var(--space-1); }

/* home: background art, hero, KPI tiles, coach, recent laps */
.homeview { position: relative; isolation: isolate; grid-template-rows: auto auto auto auto; align-content: start; overflow: auto;
  background-color: var(--surface-0);
  background-image: radial-gradient(ellipse at 75% 20%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.018) 0 2px, transparent 2px 4px), repeating-linear-gradient(-45deg, rgba(0,0,0,0.25) 0 2px, transparent 2px 4px); }
.home-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.homeview .panel { background: color-mix(in srgb, var(--surface-1) 78%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.home-hero { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) var(--space-2) var(--space-2); }
.hh-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hh-who { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-3); }
.hh-name { font: 800 44px/1 "Barlow Condensed", sans-serif; letter-spacing: 0.01em; text-transform: uppercase; color: var(--ink); }
.hh-flag { font-size: 30px; line-height: 1; }
.hh-num { font: 800 26px/1 "Barlow Condensed", sans-serif; padding: 2px 10px; border-radius: 6px; background: #f5f6f7; color: #0a0c0f; border: 3px solid var(--accent); }
.hh-team { display: inline-flex; align-items: center; gap: 6px; font: 600 15px "Barlow Condensed", sans-serif; color: var(--ink-muted); }
.hh-team .team-chip i { height: 15px; width: 3px; }
.hh-rt { display: inline-flex; gap: 2px; }
.hh-car-name { font: 600 17px "Barlow Condensed", sans-serif; color: var(--ink-muted); letter-spacing: 0.02em; }
.hh-car { flex: none; width: min(34vw, 420px); }
.hh-car img { width: 100%; height: auto; display: block; filter: drop-shadow(0 18px 24px rgba(0,0,0,0.55)); }
.home-ready { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.ready-chip { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: var(--space-2); padding: 5px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface-1) 80%, transparent); border: 1px solid var(--line); cursor: pointer; min-height: 30px; backdrop-filter: blur(6px); }
.ready-chip:disabled { cursor: default; }
.ready-chip:not(:disabled):hover { border-color: var(--accent); }
.ready-chip:focus-visible { outline: 2px solid var(--accent); }
.rc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-muted); flex: none; }
.ready-chip[data-state="ok"] .rc-dot { background: var(--throttle); box-shadow: 0 0 6px var(--throttle); }
.ready-chip[data-state="warn"] .rc-dot { background: var(--accent); }
.ready-chip[data-state="bad"] .rc-dot { background: var(--brake); box-shadow: 0 0 6px var(--brake); }
.ready-chip[data-state="off"] { opacity: 0.7; }
.rc-label { color: var(--ink-muted); font-size: 11px; }
.rc-value { font-weight: 600; white-space: nowrap; }
.home-kpi-head { display: flex; align-items: baseline; gap: var(--space-3); padding: 0 var(--space-1); }
.home-kpis { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-2); }
.kpi { position: relative; display: flex; flex-direction: column; gap: 4px; padding: var(--space-3); min-width: 0; overflow: hidden;
  border-radius: var(--radius-md, 8px); border: 1px solid var(--line); background: color-mix(in srgb, var(--surface-1) 78%, transparent); backdrop-filter: blur(6px); }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line); }
.kpi-best::before { background: var(--best-lap); } .kpi-rec::before { background: #e0b43a; }
.kpi-label { color: var(--ink-muted); font-size: 11px; }
.kpi-value { font: 600 clamp(20px, 2.1vw, 30px)/1.1 "JetBrains Mono", monospace; color: var(--ink); white-space: nowrap; }
.kpi-best .kpi-value { color: var(--best-lap); }
.kpi-sub { font-size: 12px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .good, .home-coach .good { color: var(--throttle); } .kpi .bad { color: var(--brake); }
.kpi-spark { width: 100%; height: 26px; margin-top: 2px; }
.home-empty { padding: var(--space-3); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "track stream" "coach recent"; gap: var(--space-3); align-items: stretch; }
.home-grid .home-track { grid-area: track; display: flex; flex-direction: column; min-height: 0; }
.home-track .map-row { flex: 1; min-height: 300px; }
.home-grid .home-stream { grid-area: stream; align-self: stretch; } /* the box hugs its 16:9 player */ .home-grid .home-coach { grid-area: coach; } .home-grid .home-recent { grid-area: recent; }
.home-grid.no-stream { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "track track" "coach recent"; }
.home-stream .panel-head .spacer { flex: 1; }
.home-stream .panel-head a { color: var(--accent); text-decoration: none; margin-right: var(--space-2); }
.hs-player { position: relative; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #000; }
.hs-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.hs-setup { padding: var(--space-2) 0; } .hs-setup .add-driver { max-width: 520px; }
.home-grid > .panel { display: flex; flex-direction: column; min-height: 0; }
@media (max-width: 1300px) { .home-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 800px) { .home-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .home-grid, .home-grid.no-stream { grid-template-columns: 1fr; grid-template-areas: "track" "stream" "coach" "recent"; } .hh-name { font-size: 32px; } .hh-car { width: 40vw; } }
.home-tips { list-style: none; margin: 0 0 var(--space-2); padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.home-tips li { display: grid; grid-template-columns: auto auto 1fr; gap: 4px var(--space-2); align-items: baseline; }
.ht-turn { font: 700 13px "JetBrains Mono", monospace; color: var(--accent); }
.ht-loss { font: 600 12px "JetBrains Mono", monospace; color: var(--brake); }
.ht-tip { grid-column: 1 / -1; font-size: 13px; line-height: 1.35; color: var(--ink); }
.home-recent .table-wrap { max-height: 300px; }
.home-recent .car-thumb { width: 44px; height: 20px; }
.pb-star { color: var(--accent); }
.share-toggle.flash { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.home-recent td.name { white-space: nowrap; }
.hr-sub { display: block; font-weight: 400; }
.hr-mark { width: 18px; text-align: center; }
#brandHome { cursor: pointer; }

/* One quiet backdrop for every page: faint carbon fibre and the logo's blue / red stripes across the lower left corner,
   seen only in the gaps between boxes (boxes stay solid). Home draws its own, richer background on top. */
body {
  background-color: var(--surface-0);
  background-image:
    linear-gradient(59deg, transparent 0 9%, rgb(47 123 245 / 0.075) 9% 12%, transparent 12% 12.8%, rgb(232 35 42 / 0.075) 12.8% 15.8%, transparent 15.8%),
    repeating-linear-gradient(45deg, rgb(255 255 255 / 0.014) 0 2px, transparent 2px 4px),
    repeating-linear-gradient(-45deg, rgb(0 0 0 / 0.2) 0 2px, transparent 2px 4px);
  background-attachment: fixed;
}

/* live timing strip (Track & Laps) */
.live-timing { display: flex; align-items: stretch; gap: var(--space-2); margin-bottom: var(--space-2); flex-wrap: wrap; }
.live-timing[hidden] { display: none; }
.lt-block, .lt-sec { display: flex; flex-direction: column; justify-content: center; padding: 4px 10px; border-radius: 6px; background: var(--surface-2); min-width: 0; border-bottom: 3px solid transparent; }
.lt-k { font: 600 10px "Barlow Condensed", sans-serif; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.lt-block b, .lt-sec b { font: 600 17px/1.2 "JetBrains Mono", monospace; color: var(--ink); white-space: nowrap; }
.lt-d { font: 400 11px "JetBrains Mono", monospace; color: var(--ink-muted); white-space: nowrap; }
.lt-gap b { font-size: 24px; }
.lt-gap.gain b { color: var(--throttle); } .lt-gap.loss b { color: var(--brake); }
.lt-secs { display: grid; grid-template-columns: repeat(3, minmax(84px, 1fr)); gap: var(--space-1); flex: 1; min-width: 260px; }
.lt-sec.gain { border-bottom-color: var(--throttle); } .lt-sec.gain .lt-d { color: var(--throttle); }
.lt-sec.loss { border-bottom-color: var(--brake); } .lt-sec.loss .lt-d { color: var(--brake); }
.lt-sec.pb { border-bottom-color: var(--best-lap); background: color-mix(in srgb, var(--best-lap) 14%, var(--surface-2)); } .lt-sec.pb b, .lt-sec.pb .lt-d { color: var(--best-lap); }
.lt-sec.run { border-bottom-color: var(--accent); } .lt-sec.run b { color: var(--accent); }
.lt-sec.prev { opacity: 0.75; }


.live-badge { font: 700 10px/16px "JetBrains Mono", monospace; letter-spacing: 0.06em; color: #fff; background: #e91916; padding: 0 6px; border-radius: 3px; margin-right: var(--space-2); }
.live-badge[hidden] { display: none; }
.hs-player > iframe, .hs-player > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.home-stream .panel-head { align-items: center; flex-wrap: nowrap; gap: var(--space-2); }
.home-stream .panel-head > * { white-space: nowrap; flex: none; }
.home-stream .panel-head .live-badge { align-self: center; margin: 0; }
#homeStreamWho { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.hs-controls { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3); margin-top: var(--space-2); }
.hs-controls[hidden] { display: none; }
.hs-controls label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-size: 13px; }
.hs-controls input { accent-color: var(--accent); margin: 0; }
.hs-controls #ssFine { min-width: 44px; text-align: center; font-family: "JetBrains Mono", monospace; }
.sync-chip { color: #b48cff; border-color: #b48cff; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg[hidden] { display: none; }
.seg button { all: unset; cursor: pointer; padding: 2px 9px; font: 600 11px "Barlow Condensed", sans-serif; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-muted); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.hs-rec { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); flex-wrap: wrap; }
.hs-rec input { flex: 1; min-width: 180px; }
.hs-rec a { color: var(--accent); text-decoration: none; }
.hs-rec select { width: auto; flex: 0 0 auto; max-width: 160px; }
.hs-rec .btn { flex: none; }

/* online link: the app chooses what plays; viewers can't pause or seek (their sound switch stays below) */
.hs-player { position: relative; }
#homeStream { position: relative; }

/* past broadcasts (Recording mode) */
.hs-past { margin-bottom: var(--space-2); }
.hs-past-head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: 6px; }
.hs-past-head .spacer { flex: 1; }
.vod-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: var(--space-2); overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.vod-card { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 3px; scroll-snap-align: start; border-radius: 6px; padding: 4px; border: 1px solid transparent; }
.vod-card:hover { background: var(--surface-2); }
.vod-card[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.vod-card:focus-visible { outline: 2px solid var(--accent); }
.vod-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 4px; overflow: hidden; background: var(--surface-2); }
.vod-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vod-none { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; color: var(--ink-muted); }
.vod-dur { position: absolute; right: 4px; bottom: 4px; font: 600 10px "JetBrains Mono", monospace; background: rgba(0,0,0,0.75); color: #fff; padding: 0 4px; border-radius: 3px; }
.vod-title { font-size: 12px; line-height: 1.25; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hs-other { margin-bottom: var(--space-2); } .hs-other summary { cursor: pointer; }
.hs-api code { font-size: 11px; background: var(--surface-2); padding: 0 4px; border-radius: 3px; }
.hs-api a { color: var(--accent); } .hs-api .bad { color: var(--brake); }
.hs-api input { flex: 1; min-width: 160px; }

/* Home: live bar (shift lights + lap, gap, sectors) */
.home-live { --pd-green: #2fe05a; --pd-yellow: #f2e01a; --pd-red: #ff2a2a; --pd-purple: #d63af5;
  display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); border-radius: var(--radius-lg); border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-1) 80%, transparent); backdrop-filter: blur(6px); }
.home-leds { gap: clamp(6px, 1.4vw, 18px); padding: 2px 0 4px; }
.home-leds i { width: clamp(14px, 2.2vw, 28px); height: clamp(14px, 2.2vw, 28px); }
.home-timing { margin: 0; }
.home-timing .lt-block, .home-timing .lt-sec { padding: 6px 14px; }
.home-timing .lt-block b, .home-timing .lt-sec b { font-size: clamp(18px, 1.9vw, 26px); }
.home-timing .lt-gap b { font-size: clamp(24px, 2.6vw, 36px); }
.home-timing .lt-k { font-size: 11px; } .home-timing .lt-d { font-size: 12px; }
.home-timing .lt-secs { grid-template-columns: repeat(3, minmax(110px, 1fr)); }

/* Home fits one 16:9 screen (no scrolling): top row = driver | live bar | car; KPIs; then map | stream | coach + recent.
   Sizes follow the window height. Phones keep the stacked, scrolling layout. */
@media (min-width: 1000px) {
  .homeview { grid-template-rows: auto auto auto minmax(0, 1fr); overflow: hidden; gap: clamp(6px, 1.2vh, 12px); padding: clamp(8px, 1.4vh, 16px) var(--space-4); }
  .home-hero { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr) auto; align-items: center; gap: var(--space-4); padding: 0 var(--space-1); }
  .hh-main { gap: 2px; }
  .hh-name { font-size: clamp(22px, 3.8vh, 42px); }
  .hh-flag { font-size: clamp(18px, 2.8vh, 30px); }
  .hh-num { font-size: clamp(16px, 2.4vh, 26px); padding: 1px 8px; }
  .hh-car-name { font-size: clamp(13px, 1.7vh, 17px); }
  .hh-car { width: clamp(130px, 15vw, 280px); }
  .home-ready { margin-top: 4px; gap: 6px; }
  .ready-chip { min-height: 24px; padding: 2px 10px; }
  .home-live { padding: clamp(6px, 1vh, 12px); gap: clamp(4px, 0.8vh, 8px); min-width: 0; }
  .home-leds i { width: clamp(10px, 2.3vh, 26px); height: clamp(10px, 2.3vh, 26px); }
  .home-timing .lt-block, .home-timing .lt-sec { padding: clamp(3px, 0.6vh, 6px) 12px; }
  .home-timing .lt-block b, .home-timing .lt-sec b { font-size: clamp(15px, 2.4vh, 26px); }
  .home-timing .lt-gap b { font-size: clamp(19px, 3.2vh, 34px); }
  .home-timing .lt-secs { grid-template-columns: repeat(3, minmax(90px, 1fr)); min-width: 0; }
  .kpi { padding: clamp(5px, 1vh, 12px) var(--space-3); gap: 2px; }
  .kpi-value { font-size: clamp(16px, 2.8vh, 28px); }
  .kpi-spark { height: clamp(12px, 2.2vh, 26px); }
  .home-grid { min-height: 0; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.35fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "track stream coach" "track stream recent"; }
  .home-grid.no-stream { grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); grid-template-areas: "track coach" "track recent"; }
  .home-grid > .panel { min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
  .home-grid .home-stream { align-self: stretch; }
  .home-track .map-row { min-height: 0; }
  #homeCoach { flex: 1; min-height: 0; overflow: auto; }
  .home-recent .table-wrap { flex: 1; min-height: 0; max-height: none; overflow: auto; }
  .home-stream .hs-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  /* the stream stays 16:9, as big as the box allows */
  .hs-stage { flex: 1; min-height: 0; container-type: size; display: flex; justify-content: center; align-items: flex-start; }
  .hs-stage .hs-player { width: min(100cqw, calc(100cqh * 16 / 9)); aspect-ratio: 16 / 9; height: auto; }
  .vod-strip { grid-auto-columns: 140px; }
}
@media (min-width: 1000px) {
  .home-timing { flex-wrap: nowrap; }
  .home-timing .lt-secs { grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; flex: 1 1 0; }
  .home-timing .lt-block { flex: none; }
  .home-timing .lt-sec, .home-timing .lt-block { overflow: hidden; }
  .hh-car { width: clamp(120px, 13vw, 260px); }
}
/* menu bar: tighter, so it is one row on a 1080p screen and two short rows on a 720p one */
@media (min-width: 1000px) {
  .top { padding: 6px 14px; gap: 10px; row-gap: 4px; }
  .tabs .tab { padding: 6px 7px; letter-spacing: 0.03em; }
  .driver-big { font-size: 22px !important; }
  .seat-label { font-size: 9px; }
  .top-right { gap: 6px; }
  .share-toggle .label { font-size: 11px; }
}
/* Coach: the summary runs down the whole left side (map and corner table on the right), so it fits one screen */
@media (min-width: 1000px) {
  .coachview { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-areas: "sum map" "sum corners"; }
}
/* Driver Info on one screen: the 8 tiles in one row, sized to the window height; tighter driving-style list */
@media (min-width: 1000px) {
  .stat-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: var(--space-2); }
  .stat { padding: clamp(4px, 0.8vh, 8px) var(--space-2); }
  .stat .readout-lg { font-size: clamp(18px, 3vh, 30px); line-height: 1.2; }
  .st-kv { row-gap: clamp(2px, 0.6vh, 8px); }
  .st-kv dd { font-size: clamp(15px, 2.4vh, 22px); }
}
@media (min-width: 1000px) {
  .st-kv { grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); column-gap: var(--space-3); align-items: baseline; }
  .statsview { grid-template-rows: auto minmax(0, 1fr) minmax(0, .7fr); }
}
/* Haptics & Motion on one screen: spacing and meters follow the window height; the rumble trace takes what is left */
@media (min-width: 1000px) {
  .motion .hap-grid { gap: clamp(4px, 1vh, 12px) var(--space-4); }
  .motion .hap-grid .meter.h { height: clamp(12px, 2.2vh, 22px); }
  .motion .channels { gap: clamp(4px, 1vh, 12px) var(--space-4); margin-top: clamp(4px, 1vh, 12px); }
  .motion .haptics .trace { flex: 1 1 0; min-height: 28px; height: auto; }
  .motion .haptics .event-log { margin-top: 4px; }
  .motion .rig-meters { gap: clamp(3px, 0.8vh, 8px) var(--space-3); }
  .motion .rig-meters .meter.h { height: clamp(10px, 2vh, 20px); }
  .motion .rig-controls { gap: clamp(4px, 0.8vh, 8px); }
  .motion .panel { padding: clamp(8px, 1.6vh, 16px); }
}
@media (min-width: 1000px) {
  .motion #hapTrace { min-height: 18px; }
  .motion .haptics .trace.short { margin-top: clamp(4px, 1vh, 12px); }
}
/* short windows (720p): the haptic event log gives its line to the rest */
@media (min-width: 1000px) and (max-height: 780px) { .motion .haptics .event-log { display: none; } }
@media (min-width: 1000px) {
  .motion .rig-acts { gap: clamp(3px, 0.8vh, 8px) var(--space-3); }
  .motion .rig-controls .btn { padding-top: clamp(2px, 0.5vh, 6px); padding-bottom: clamp(2px, 0.5vh, 6px); }
}

/* online link: no coach box on Home (coaching stays in the app); recent laps take the whole third column */
@media (min-width: 1000px) {
  .home-grid.no-coach { grid-template-areas: "track stream recent" "track stream recent"; }
  .home-grid.no-coach.no-stream { grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); grid-template-areas: "track recent" "track recent"; }
}
@media (max-width: 999px) { .home-grid.no-coach { grid-template-areas: "track" "stream" "recent"; } .home-grid.no-coach.no-stream { grid-template-areas: "track" "recent"; } }

/* Home's bottom row: map | stream (wider) | this session (+ coach in the app). The session figures as a compact list. */
.home-grid .home-session { grid-area: session; }
.home-session .home-kpis { display: flex; flex-direction: column; gap: 4px; overflow: auto; min-height: 0; flex: 1; }
.home-session .kpi { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: var(--space-2); row-gap: 0; padding: 5px 10px 5px 12px; backdrop-filter: none; background: var(--surface-2); }
.home-session .kpi-label { grid-column: 1; font-size: 10px; }
.home-session .kpi-value { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: clamp(15px, 2.2vh, 22px); }
.home-session .kpi-sub { grid-column: 1; font-size: 11px; }
.home-session .kpi-spark { grid-column: 1 / -1; height: 18px; }
@media (min-width: 1000px) {
  .home-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) minmax(0, 0.8fr); grid-template-rows: minmax(0, 1.25fr) minmax(0, 1fr);
    grid-template-areas: "track stream session" "track stream coach"; }
  .home-grid.no-coach { grid-template-areas: "track stream session" "track stream session"; }
  .home-grid.no-stream { grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); grid-template-areas: "track session" "track coach"; }
  .home-grid.no-coach.no-stream { grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); grid-template-areas: "track session" "track session"; }
  .homeview { grid-template-rows: auto minmax(0, 1fr); }
}
@media (max-width: 999px) {
  .home-grid, .home-grid.no-stream { grid-template-areas: "track" "stream" "session" "coach"; }
  .home-grid.no-coach { grid-template-areas: "track" "stream" "session"; } .home-grid.no-coach.no-stream { grid-template-areas: "track" "session"; }
}
@media (min-width: 1000px) {
  .home-grid { grid-template-columns: minmax(0, 0.85fr) minmax(0, 2fr) minmax(0, 0.78fr); }
}
.home-session .panel-head { flex-wrap: nowrap; min-width: 0; }
.home-session #homeSessWho { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the live bar under the stream, exactly as wide as the video */
.hs-col { display: flex; flex-direction: column; gap: var(--space-2); width: 100%; }
.hs-col .hs-player { width: 100%; aspect-ratio: 16 / 9; }
.hs-col .home-live { width: 100%; box-sizing: border-box; }
.hero-live-slot { min-width: 0; } .hero-live-slot.empty { display: none; }
@media (min-width: 1000px) {
  .hs-stage .hs-col { width: min(100cqw, calc((100cqh - var(--lb, 120px) - var(--space-2)) * 16 / 9)); }
  .hs-stage .hs-col .hs-player { width: 100%; }
  .home-hero { grid-template-columns: minmax(0, max-content) minmax(0, 1fr) auto; }
  .hero-live-slot.empty + .hh-car { grid-column: 3; }
}
/* smaller screens: Home's map keeps its room (its per-turn g-force table stays on Track & Laps) */
@media (min-width: 1000px) and (max-width: 1799px) {
  .home-track .gstrip { display: none !important; }
  .home-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr) minmax(0, 0.8fr); }
}

/* This session: the figures fill the box; big numbers sized to the room they have, a colour per figure */
.home-session .home-kpis { container-type: size; flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: clamp(3px, 0.9cqh, 8px); }
.home-session .kpi { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-content: center;
  column-gap: var(--space-2); padding: 0 12px 0 16px; border-radius: 8px; background: linear-gradient(90deg, color-mix(in srgb, var(--kc, var(--line)) 14%, var(--surface-2)), var(--surface-2) 60%); border: 1px solid color-mix(in srgb, var(--kc, var(--line)) 30%, transparent); }
.home-session .kpi::before { width: 4px; background: var(--kc, var(--line)); border-radius: 8px 0 0 8px; }
.home-session .kpi-label { font-size: clamp(9px, 2.4cqh, 13px); letter-spacing: 0.08em; color: color-mix(in srgb, var(--kc, var(--ink-muted)) 55%, var(--ink-muted)); }
.home-session .kpi-value { font-size: min(clamp(15px, 6.4cqh, 40px), 12cqw); font-weight: 700; letter-spacing: -0.01em; color: var(--kv, var(--ink)); }
.home-session .kpi-sub { font-size: clamp(9px, 2.1cqh, 12px); }
.home-session .kpi-spark { grid-column: 1 / -1; height: clamp(10px, 3cqh, 26px); }
.home-session .kpi-last { --kc: var(--ink-muted); }
.home-session .kpi-best { --kc: var(--best-lap); --kv: var(--best-lap); }
.home-session .kpi-pot { --kc: var(--throttle); --kv: var(--throttle); }
.home-session .kpi-pb { --kc: var(--accent); --kv: var(--accent); }
.home-session .kpi-cons { --kc: var(--clutch); }
.home-session .kpi-rec { --kc: #e0b43a; --kv: #e0b43a; }
.home-session .kpi-laps { --kc: var(--ink-muted); }
@media (min-width: 1000px) {
  .home-grid { grid-template-rows: minmax(0, 1.9fr) minmax(0, 1fr); }
}
.home-session .kpi-value { font-size: min(clamp(15px, 7.6cqh, 44px), 12.5cqw); }

/* Home: the essential session tiles in the top row (above the stream); Track (+ Coach) | stream below */
.hero-mid { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.hero-kpis .home-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-2); container-type: inline-size; height: auto; flex: none; overflow: visible; }
.hero-kpis .kpi { grid-template-columns: 1fr; grid-template-rows: auto auto auto; padding: clamp(5px, 0.9vh, 10px) 12px clamp(5px, 0.9vh, 10px) 15px; align-content: center; }
.hero-kpis .kpi-label { font-size: 10px; }
.hero-kpis .kpi-value { grid-column: 1; grid-row: auto; font-size: clamp(16px, 3cqw, 32px); line-height: 1.15; }
.hero-kpis .kpi-sub { font-size: 11px; }
@media (min-width: 1000px) {
  .home-grid { grid-template-columns: minmax(340px, 1fr) minmax(0, 1.4fr); grid-template-rows: minmax(0, 2.2fr) minmax(0, 1fr); grid-template-areas: "track stream" "coach stream"; }
  .home-grid.no-coach { grid-template-areas: "track stream" "track stream"; }
  .home-grid.no-stream { grid-template-columns: minmax(0, 1fr); grid-template-areas: "track" "coach"; }
  .home-grid.no-coach.no-stream { grid-template-columns: minmax(0, 1fr); grid-template-areas: "track" "track"; }
  .home-track .gstrip { display: block !important; } /* the wider Track box has room for the per-turn g-forces again */
}
@media (min-width: 1000px) and (max-width: 1399px) { .home-track .gstrip { display: none !important; } .hero-kpis .home-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 999px) {
  .hero-kpis .home-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-grid, .home-grid.no-stream { grid-template-areas: "track" "stream" "coach"; }
  .home-grid.no-coach { grid-template-areas: "track" "stream"; } .home-grid.no-coach.no-stream { grid-template-areas: "track"; }
}
@media (min-width: 1000px) and (max-width: 1399px) {
  .home-hero .hh-car { display: none; }
  .home-hero { grid-template-columns: minmax(0, max-content) minmax(0, 1fr); }
  .hero-kpis .kpi { padding-left: 12px; padding-right: 8px; }
  .hero-kpis .kpi-label, .hero-kpis .kpi-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.hero-kpis .kpi { min-width: 0; overflow: hidden; }
/* top-row tiles: compact (narrower, smaller numbers), lined up on the right above the stream */
.hero-kpis .home-kpis { grid-template-columns: repeat(6, minmax(0, 150px)); justify-content: end; gap: 6px; }
.hero-kpis .kpi { padding: 4px 8px 4px 12px; }
.hero-kpis .kpi-label { font-size: 9px; }
.hero-kpis .kpi-value { font-size: clamp(14px, 1.15vw, 21px); }
.hero-kpis .kpi-sub { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hs-player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.hs-cap select { max-width: 260px; }

.pf-gs { grid-column: 1 / -1; margin: 0; }
.rosterview .panel-head .spacer { flex: 1; }
#gsStatus .good { color: var(--throttle); } #gsStatus .bad { color: var(--brake); }
/* top speed in the live timing strip */
.lt-v { font: 600 11px "JetBrains Mono", monospace; color: var(--ink-muted); white-space: nowrap; }
.lt-v small { font-weight: 400; opacity: 0.75; }
.lt-v.up { color: var(--throttle); } .lt-v.dn { color: var(--brake); }
.home-timing .lt-v { font-size: clamp(10px, 1.3vh, 12px); }
.home-session .kpi-top { --kc: var(--clutch); --kv: var(--clutch); }

.sec-edit { display: flex; align-items: center; gap: var(--space-2); padding: 6px 10px; margin-bottom: var(--space-2); border-radius: 6px; border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); }
.sec-edit[hidden] { display: none; }
.sec-edit .spacer { flex: 1; }

/* A test lap saved from a replay */
.replay-tag { font: 600 9px/1 "JetBrains Mono", monospace; letter-spacing: .06em; padding: 2px 4px; border-radius: 3px; border: 1px solid var(--ink-muted); color: var(--ink-muted); vertical-align: 1px; }


/* Looking for the PS5 (the app only): in the middle until the telemetry is back */
.ps5-overlay .panel { display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-6) var(--space-6) var(--space-4); }
.ps5-pulse { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); margin-bottom: var(--space-2); animation: ps5pulse 1.4s ease-out infinite; }
.ps5-overlay[data-state="found"] .ps5-pulse { background: var(--throttle); }
.ps5-overlay[data-state="blocked"] .ps5-pulse { background: var(--brake); animation: none; }
@keyframes ps5pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 100% { box-shadow: 0 0 0 18px transparent; } }
.ps5-overlay #ps5OverlayHide { margin-top: var(--space-2); }

/* Navigation grouped by purpose: LIVE · RACING · TEAM (settings and equipment in the ⚙ menu) */
.tabs { align-items: center; gap: 0; }
.tab-group { display: flex; align-items: center; gap: 2px; }
.tab-group + .tab-group { margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--line); }
.tab-gl { font: 700 10px/1 var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); opacity: .85; margin-right: 4px; }

/* Track (LIVE) and Laps (RACING): one set of panels in two arrangements; the Coach shares the Laps page */
.trackview { grid-template-rows: auto minmax(0, 6.3fr) minmax(0, 3.7fr); }
.trackview[data-mode="live"] { grid-template-rows: minmax(0, 6.3fr) minmax(0, 3.7fr); grid-template-areas: "map car" "tele car"; }
.trackview[data-mode="live"] .laps-panel, .trackview[data-mode="live"] .lap-subnav { display: none; }
.trackview[data-mode="laps"] { grid-template-areas: "nav nav" "map laps" "tele laps"; }
.trackview[data-mode="laps"] .car { display: none; }
.trackview .lap-subnav { grid-area: nav; }
.trackview[data-sub="coach"] > .panel { display: none; }
.trackview > .coachview { grid-column: 1 / -1; grid-row: 2 / 4; min-height: 0; }
.trackview > .coachview[hidden] { display: none; }

.roster-switch { margin-right: var(--space-3); }
.roster-switch .pk-tab { padding: 4px 12px; }
/* Track (live): map and telemetry only (the car readings are on the Wheel Dash; the Car box stays available for monitors) */
.trackview[data-mode="live"] { grid-template-columns: minmax(0, 1fr); grid-template-areas: "map" "tele"; }
.trackview .car { display: none; }

/* ---------- Modes: Pit (everything), Driver (the in-car screen), Spectator (what viewers see) ---------- */
.mode-switch { margin-right: 4px; }
.shared .mode-switch { display: none; }
/* Spectator: no settings, editing, sharing or Garage (the online link has always looked like this) */
[data-app-mode="spectator"] .owner-only, [data-app-mode="spectator"] .tab[data-view="paddock"] { display: none !important; }
/* Driver: nothing but the driving screen; a small bar appears when the mouse moves */
[data-app-mode="driver"] .top { display: none; }
[data-app-mode="driver"][data-dm="minimal"] main.view { display: none !important; }
.dm-bar { position: fixed; top: 10px; right: 10px; z-index: 60; display: none; gap: 8px; align-items: center; padding: 6px 8px; background: var(--panel-glass); border: 1px solid var(--line); border-radius: var(--radius-md); opacity: 0; transition: opacity var(--dur-out) var(--ease-out); }
[data-app-mode="driver"] .dm-bar { display: flex; }
.dm-bar.show { opacity: 1; }
/* Minimal layout: very large, readable at a glance from the rig */
.dm:not([hidden]) { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-rows: auto auto 1fr auto auto; gap: 2vh; padding: 3vh 4vw; background: var(--surface-0); font-family: var(--font-brand); }
.dm-leds { justify-self: center; width: min(92vw, 1400px); }
.dm-leds i { height: 3.2vh; }
.dm.shiftnow .dm-gear { color: var(--best-lap); }
.dm-top, .dm-bottom { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2vw; }
.dm-cell { display: flex; flex-direction: column; align-items: center; gap: .4vh; }
.dm-k { font: 600 clamp(12px, 1.8vh, 22px)/1 var(--font-brand); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-muted); }
.dm-v { font: 600 clamp(24px, 6vh, 72px)/1 var(--font-numbers); font-variant-numeric: tabular-nums; color: var(--ink); }
.dm-v.best { color: var(--sig-fastest); }
.dm-mid { display: flex; align-items: center; justify-content: center; gap: 5vw; }
.dm-gear { font: 800 clamp(80px, 28vh, 340px)/0.9 var(--font-brand); color: var(--brand); min-width: 1ch; text-align: center; }
.dm-speedbox { display: flex; flex-direction: column; align-items: flex-start; }
.dm-speed { font: 700 clamp(48px, 14vh, 180px)/1 var(--font-numbers); font-variant-numeric: tabular-nums; }
.dm-delta { align-self: center; justify-self: center; font: 700 clamp(48px, 13vh, 170px)/1 var(--font-numbers); font-variant-numeric: tabular-nums; color: var(--ink); }
.dm-delta.gain { color: var(--sig-improved); }
.dm-delta.loss { color: var(--sig-problem); }

/* Driver mode moments: big, brief, in their signal colour (slides in along the broadcast slant) */
.dm-moment { position: fixed; left: 50%; top: 14vh; z-index: 70; padding: 1.2vh 3vw; transform: translateX(-50%) skewX(var(--slant)) translateY(-14px); opacity: 0; pointer-events: none;
  font: 800 clamp(28px, 7vh, 96px)/1 var(--font-brand); letter-spacing: .06em; color: var(--on-brand); background: var(--brand); white-space: nowrap;
  transition: opacity var(--dur-out) var(--ease-in), transform var(--dur-out) var(--ease-in); }
.dm-moment.show { opacity: 1; transform: translateX(-50%) skewX(var(--slant)); transition: opacity var(--dur-in) var(--ease-out), transform var(--dur-in) var(--ease-out); }
.dm-moment[data-tone="fastest"] { background: var(--sig-fastest); }
.dm-moment[data-tone="improved"] { background: var(--sig-improved); }
.dm-moment[data-tone="warning"] { background: var(--sig-warning); }
.dm-moment[data-tone="problem"] { background: var(--sig-problem); color: #fff; }
:root:not([data-app-mode="driver"]) .dm-moment { display: none; }
.snd-list li { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; gap: var(--space-2); align-items: center; }

/* ---------- DROMO TV: broadcast graphics over the video. Sober (app) or energetic (Spectator, online link) ---------- */
.hs-player .dtv { position: absolute; inset: 0; pointer-events: none; z-index: 2; font-family: var(--font-brand); color: #eef1f4; container-type: size; }
.dtv [hidden] { display: none !important; }
.dtv .dtv-l, .dtv-l3 { position: absolute; background: var(--panel-glass); }
.dtv-tag { left: 2.5%; top: 4%; display: flex; height: 6.5cqh; font-size: 3.6cqh; font-weight: 700; letter-spacing: .14em; }
.dtv-tag .dtv-brand { background: var(--brand); color: var(--on-brand); padding: 0 1.4cqw; display: flex; align-items: center; }
.dtv-tag .dtv-live { background: var(--sig-problem); color: #fff; padding: 0 1cqw; display: flex; align-items: center; }
.dtv-lap { right: 2.5%; top: 4%; height: 6.5cqh; display: flex; align-items: center; gap: .8cqw; padding: 0 1.2cqw; font-size: 3.4cqh; font-weight: 700; letter-spacing: .1em; }
.dtv-lap b { font-family: var(--font-numbers); color: var(--brand); font-variant-numeric: tabular-nums; }
.dtv-timing { left: 2.5%; top: 14%; display: grid; grid-template-columns: auto auto 1fr; grid-template-rows: auto auto; min-width: 30cqw; }
.dtv-pos { grid-row: 1 / 3; background: var(--brand); color: var(--on-brand); font: 800 7cqh/1 var(--font-brand); padding: 0 1.2cqw; display: flex; align-items: center; }
.dtv-team { grid-row: 1 / 3; width: .6cqw; }
.dtv-who { display: flex; align-items: baseline; justify-content: space-between; gap: 1.5cqw; padding: .8cqh 1cqw 0; font-size: 3.6cqh; letter-spacing: .05em; }
.dtv-gap { font-family: var(--font-numbers); font-variant-numeric: tabular-nums; font-weight: 600; }
.dtv-gap.gain { color: var(--sig-improved); } .dtv-gap.loss { color: var(--sig-problem); }
.dtv-secs { display: flex; gap: .4cqw; padding: .6cqh 1cqw .8cqh; }
.dtv-secs i { font-style: normal; flex: 1; text-align: center; font-size: 2.3cqh; letter-spacing: .1em; padding: .2cqh 0; background: #2b313b; color: #9aa4af; }
.dtv-secs i.done { background: #eef1f4; color: #0c0e12; } .dtv-secs i.improved { background: var(--sig-improved); color: #0c0e12; } .dtv-secs i.fastest { background: var(--sig-fastest); color: #0c0e12; }
.dtv-map { right: 2.5%; top: 14%; width: 20cqw; height: 15cqw; border-top: 3px solid var(--brand); }
.dtv-driver { right: 2.5%; top: calc(16% + 15cqw); width: 20cqw; padding: .8cqh .8cqw; font-size: 2.4cqh; font-weight: 700; letter-spacing: .08em; }
.dtv-tyres { display: grid; grid-template-columns: 1fr 1fr; gap: .3cqw; margin-bottom: .8cqh; }
.dtv-tyres i { font-style: normal; text-align: center; font-family: var(--font-numbers); color: #0c0e12; background: var(--sig-improved); }
.dtv-tyres i.cold { background: #5aa9ff; } .dtv-tyres i.hot { background: var(--sig-problem); color: #fff; }
.dtv-fuel { display: flex; justify-content: space-between; } .dtv-fuel b { font-family: var(--font-numbers); }
.dtv-bar { height: .6cqh; background: #2b313b; margin-top: .4cqh; } .dtv-bar i { display: block; height: 100%; background: var(--brand); }
.dtv-l3 { left: 6%; right: 6%; bottom: 6%; height: 11cqh; display: flex; opacity: 0; transform: translateX(-4%); transition: opacity var(--dur-out) var(--ease-in), transform var(--dur-out) var(--ease-in); }
.dtv-l3.show { opacity: 1; transform: none; transition: opacity var(--dur-in) var(--ease-out), transform var(--dur-in) var(--ease-out); }
.dtv-l3-pos { background: var(--brand); color: var(--on-brand); width: 9cqh; display: flex; align-items: center; justify-content: center; font: 800 6cqh/1 var(--font-brand); }
.dtv-l3-pos:empty { display: none; }
.dtv-l3-team { width: 1.4cqh; }
.dtv-l3-main { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 0 2cqw; }
.dtv-l3-kicker { font-size: 2.6cqh; letter-spacing: .22em; color: var(--brand); font-weight: 700; }
.dtv-l3-main b { font-size: 4.6cqh; letter-spacing: .05em; } .dtv-l3-main b span { font-size: 2.8cqh; color: #9aa4af; font-weight: 600; letter-spacing: .1em; }
.dtv-l3-time { display: flex; flex-direction: column; justify-content: center; align-items: flex-end; padding: 0 1.6cqw; background: #1a1e25; }
.dtv-l3-time b { font: 700 4.6cqh/1 var(--font-numbers); font-variant-numeric: tabular-nums; }
.dtv-l3-time span { font-size: 1.9cqh; letter-spacing: .16em; color: #6b7480; margin-top: .4cqh; }
.dtv-l3[data-tone="fastest"] .dtv-l3-time { background: var(--sig-fastest); color: #0c0e12; } .dtv-l3[data-tone="fastest"] .dtv-l3-time span { color: #2a2340; }
.dtv-l3[data-tone="improved"] .dtv-l3-kicker { color: var(--sig-improved); } .dtv-l3[data-tone="problem"] .dtv-l3-kicker { color: var(--sig-problem); }
/* energetic: slanted shapes (spectators); sober: square, calmer (the app) */
.dtv[data-style="energetic"] .dtv-tag, .dtv[data-style="energetic"] .dtv-lap, .dtv[data-style="energetic"] .dtv-timing, .dtv[data-style="energetic"] ~ * .dtv-l3 { transform: skewX(var(--slant)); }
.dtv[data-style="energetic"] .dtv-tag > *, .dtv[data-style="energetic"] .dtv-lap > *, .dtv[data-style="energetic"] .dtv-timing > * { transform: skewX(calc(-1 * var(--slant))); }
.dtv[data-style="energetic"] .dtv-l3.show { transform: skewX(var(--slant)); }
.dtv[data-style="energetic"] .dtv-l3 > * { transform: skewX(calc(-1 * var(--slant))); }
.dtv[data-style="sober"] .dtv-team { width: .3cqw; } .dtv[data-style="sober"] .dtv-l3-team { width: .6cqh; }
.dtv-layers-btn { position: absolute; right: 8px; bottom: 8px; z-index: 3; opacity: .55; transition: opacity .2s; font: 600 11px var(--font-brand); letter-spacing: .1em; text-transform: uppercase; background: var(--panel-glass); color: var(--ink); border: 1px solid var(--line); padding: 3px 8px; border-radius: 4px; cursor: pointer; }
.hs-player:hover .dtv-layers-btn { opacity: 1; }
.dtv-layers { position: absolute; right: 8px; bottom: 36px; z-index: 4; display: grid; gap: 4px; padding: 8px 10px; }
.dtv-layers[hidden] { display: none; }
.dtv-defaults { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; margin: 4px 0 8px; }
.dtv-l3-main b, .dtv-l3-main .dtv-l3-kicker { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dtv-l3-main { min-width: 0; }
[data-app-mode="spectator"] .hs-controls { display: none !important; } /* (stream calibration is the broadcaster's) */
.dtv-layers-btn.open { opacity: 1; }
.dtv-layers [data-done] { justify-self: end; margin-top: 4px; }
/* Living with Twitch's own controls (they appear on hover): the lower-thirds and the Layers button stay above
   Twitch's control strip, and our graphics fade back while the mouse is over the video so its buttons read clearly */
.dtv-l3 { bottom: calc(48px + 2%); }
.dtv-layers-btn { bottom: 54px; }
.dtv-layers { bottom: 84px; }
/* (the graphics stay at full strength: they are the broadcast) */
.dm-cue { position: fixed; left: 50%; bottom: 26vh; transform: translateX(-50%); z-index: 55; padding: 1vh 2.4vw; background: var(--panel-glass); border-left: 6px solid var(--brand); font: 700 clamp(22px, 5vh, 64px)/1.1 var(--font-brand); letter-spacing: .04em; color: var(--ink); white-space: nowrap; }
.dm-cue[hidden] { display: none; }
:root:not([data-app-mode="driver"]) .dm-cue, :root[data-app-mode="driver"]:not([data-dm="minimal"]) .dm-cue { display: none; }

/* ---------- TV view (Spectator → Dashboard, and the online link): the video is the screen, graphics float over it ---------- */
html.tv body { overflow: hidden; }
html.tv .top { position: fixed; top: 0; left: 0; right: 0; z-index: 80; background: var(--panel-glass); transform: translateY(-100%); transition: transform var(--dur-out) var(--ease-in); }
html.tv.peek .top { transform: none; transition: transform var(--dur-in) var(--ease-out); }
html.tv #view-home { position: fixed; inset: 0; z-index: 40; display: block !important; padding: 0; margin: 0; background: #000; overflow: hidden; }
html.tv #view-home > :not(#homeGrid) { display: none !important; }
html.tv #homeGrid { display: block !important; position: absolute; inset: 0; }
html.tv #homeGrid > :not(#homeStreamBox) { display: none !important; }
html.tv #homeStreamBox { position: absolute; inset: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: #000 !important; backdrop-filter: none; -webkit-backdrop-filter: none; display: flex; align-items: center; justify-content: center; }
html.tv #homeStreamBox > .panel-head, html.tv #homeStreamCtl, html.tv #homeLive { display: none !important; }
html.tv #homeStream, html.tv #homeStream .hs-stage, html.tv #homeStream .hs-col { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 0; margin: 0; gap: 0; }
html.tv #homeStream .hs-player { width: min(100vw, calc(100vh * 16 / 9)) !important; height: auto; aspect-ratio: 16 / 9; border-radius: 0; flex: none; }

/* ---------- Driver mode, Minimal: a race steering-wheel display (crisp tiles, the gear block in brand amber) ---------- */
.dm.dmw:not([hidden]) { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 2.2vh; padding: 3.5vh 3vw 4vh; background: #07080a; }
.dmw .dm-leds { display: flex; gap: .5vw; justify-self: stretch; width: auto; padding: 0 6vw; }
.dmw .dm-leds i { flex: 1; height: 3.4vh; border-radius: 3px; background: #1b1f25; box-shadow: none; opacity: 1; }
.dmw .dm-leds i.on.g { background: var(--sig-improved); box-shadow: 0 0 1.4vh rgba(46, 230, 166, .55); }
.dmw .dm-leds i.on.y { background: var(--brand); box-shadow: 0 0 1.4vh rgba(255, 176, 32, .55); }
.dmw .dm-leds i.on.r { background: var(--sig-problem); box-shadow: 0 0 1.4vh rgba(255, 75, 62, .6); }
.dmw .dm-leds.limit i { background: var(--sig-fastest); box-shadow: 0 0 1.6vh rgba(192, 132, 252, .7); }
.dmw-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); gap: 1vw; min-height: 0; }
.dmw-side { display: grid; grid-template-rows: 1fr 1fr; gap: 1vw; min-height: 0; }
.dmw-tile { display: flex; flex-direction: column; justify-content: center; gap: .8vh; padding: 1.4vh 1.6vw; background: #12151a; border: 1px solid #1f242c; border-radius: 6px; min-width: 0; }
.dmw .dm-k { font: 700 clamp(11px, 1.9vh, 22px)/1 var(--font-brand); letter-spacing: .2em; text-transform: uppercase; color: #8b95a1; }
.dmw .dm-v { font: 600 clamp(26px, 7vh, 88px)/1 var(--font-numbers); font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.dmw-delta.gain { background: #0d261f; border-color: #145a45; } .dmw-delta.gain .dm-k, .dmw-delta.gain .dm-v { color: var(--sig-improved); }
.dmw-delta.loss { background: #2a1210; border-color: #6b2620; } .dmw-delta.loss .dm-k, .dmw-delta.loss .dm-v { color: var(--sig-problem); }
.dmw-gear { display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--brand); border-radius: 8px; color: var(--on-brand); min-height: 0; }
.dmw .dm-gear { font: 800 clamp(90px, 34vh, 400px)/.82 var(--font-brand); color: var(--on-brand); }
.dm.dmw.shiftnow .dmw-gear { background: var(--sig-fastest); }
.dmw-speed { display: flex; align-items: baseline; gap: .6vw; }
.dmw .dm-speed { font: 700 clamp(28px, 8vh, 100px)/1 var(--font-numbers); font-variant-numeric: tabular-nums; color: var(--on-brand); }
.dmw-gear .dm-k { color: rgba(10, 12, 15, .65); }
.dmw-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1vw; }
.dmw-row .dm-v { font-size: clamp(22px, 5.5vh, 68px); }
.dmw-best .dm-v { color: var(--sig-fastest); }
/* The graphics button is always reachable (brighter on hover); in the TV view it sits top right, under the lap counter */
.dtv-layers-btn:hover, .dtv-layers-btn.open { opacity: 1; }
html.tv .dtv-layers-btn { top: 11.5%; bottom: auto; right: 2.5%; }
html.tv .dtv-layers { top: calc(11.5% + 30px); bottom: auto; right: 2.5%; }
html.tv .dtv-map { top: calc(14% + 32px); } html.tv .dtv-driver { top: calc(16% + 15cqw + 32px); }
.st-table td.gain { color: var(--sig-improved); } .st-table td.loss { color: var(--sig-problem); }
.race-row { cursor: pointer; } .race-row:hover td { background: var(--surface-2); }
.race-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; border: 1px solid var(--accent); border-radius: var(--radius-md); font: 600 12px var(--font-brand); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.race-chip[hidden] { display: none; }
.race-chip button { all: unset; cursor: pointer; padding: 0 6px; color: var(--ink-muted); } .race-chip button:hover { color: var(--ink); }

/* DROMO's own video controls (Twitch's are switched off) */
.dtv-ctl { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: linear-gradient(transparent, rgba(5, 6, 8, .85)); opacity: 0; transition: opacity var(--dur-out) var(--ease-in); }
.dtv-ctl.show, .dtv-ctl:focus-within { opacity: 1; transition: opacity var(--dur-in) var(--ease-out); }
.dtv-ctl button { all: unset; cursor: pointer; font: 700 16px/1 var(--font-brand); color: #eef1f4; padding: 4px 6px; border-radius: 4px; }
.dtv-ctl button:hover { background: rgba(255, 255, 255, .12); } .dtv-ctl button:focus-visible { outline: 2px solid var(--brand); }
.dtv-ctl input[type="range"] { width: 110px; accent-color: var(--brand); }
.dtv-ctl-live { font: 700 11px var(--font-brand); letter-spacing: .14em; color: var(--sig-problem); }
.dtv-ctl .spacer { flex: 1; }
/* the lower-thirds no longer need to leave room for Twitch's strip */
.dtv-l3 { bottom: 6%; }
/* (the video box stretches its blocks to full size: not the controls bar nor the graphics menu) */
.hs-player > .dtv-ctl { top: auto; height: auto; width: auto; inset: auto 0 0 0; }
.hs-player > .dtv-layers { inset: auto; width: auto; height: auto; right: 8px; bottom: 84px; }
html.tv .hs-player > .dtv-layers { top: calc(11.5% + 30px); bottom: auto; right: 2.5%; }

/* ---------- DROMO TV, cleaner: smaller graphics at the edges, like real broadcasts (the picture is the race) ---------- */
.dtv-tag { left: 2%; top: 3%; height: 4.4cqh; font-size: 2.4cqh; }
.dtv-tag .dtv-brand { padding: 0 1cqw; } .dtv-tag .dtv-live { padding: 0 .7cqw; }
.dtv-lap { right: 2%; top: 3%; height: 4.4cqh; font-size: 2.3cqh; padding: 0 .9cqw; gap: .6cqw; }
.dtv-timing { left: 2%; top: 9.5%; min-width: 21cqw; }
.dtv-pos { font-size: 4.6cqh; padding: 0 .8cqw; }
.dtv-who { font-size: 2.4cqh; padding: .5cqh .8cqw 0; gap: 1cqw; }
.dtv-secs { padding: .4cqh .8cqw .5cqh; gap: .3cqw; } .dtv-secs i { font-size: 1.6cqh; }
.dtv-map { right: 2%; top: 9.5%; width: 13cqw; height: 9.75cqw; border-top-width: 2px; }
.dtv-driver { right: 2%; top: calc(10.5% + 9.75cqw); width: 13cqw; padding: .5cqh .6cqw; font-size: 1.7cqh; }
.dtv-tyres { margin-bottom: .5cqh; } .dtv-bar { height: .45cqh; }
.dtv-l3 { left: 4%; right: auto; width: min(56%, 72cqh * 1.4); bottom: 7%; height: 7.2cqh; }
.dtv-l3-pos { width: 6cqh; font-size: 3.8cqh; } .dtv-l3-team { width: 1cqh; }
.dtv-l3-main { padding: 0 1.4cqw; } .dtv-l3-kicker { font-size: 1.8cqh; } .dtv-l3-main b { font-size: 3cqh; } .dtv-l3-main b span { font-size: 1.9cqh; }
.dtv-l3-time { padding: 0 1.2cqw; } .dtv-l3-time b { font-size: 3cqh; } .dtv-l3-time span { font-size: 1.3cqh; }
html.tv .dtv-layers-btn { top: 8.5%; } html.tv .hs-player > .dtv-layers { top: calc(8.5% + 30px); }
html.tv .dtv-map { top: calc(9.5% + 28px); } html.tv .dtv-driver { top: calc(10.5% + 9.75cqw + 28px); }

/* ---------- The DROMO wordmark (option B): DROMO in white, the product in a slanted amber block ---------- */
.dromo-word { display: inline-flex; align-items: center; gap: 7px; }
.dw-name { font: 400 17px/1 Michroma, var(--font-brand); letter-spacing: .16em; color: var(--ink); }
.dw-block { width: 18px; height: 17px; background: var(--brand); transform: skewX(var(--slant)); }
.logo .logo-word { display: none; }
/* on the video: the channel bug, DROMO on glass + TV in the amber block + LIVE */
.dtv-tag .dtv-brand { background: var(--panel-glass); color: var(--ink); display: flex; align-items: stretch; padding: 0 0 0 1cqw; gap: .8cqw; }
.dtv-tag .dtv-brand .dw-name { font-size: 2cqh; display: flex; align-items: center; letter-spacing: .16em; }
.dtv-tag .dw-tv { display: flex; align-items: center; padding: 0 .9cqw; background: var(--brand); color: var(--on-brand); font: 800 2.6cqh/1 var(--font-brand); letter-spacing: .04em; transform: skewX(var(--slant)); margin-right: .5cqw; }
.dtv[data-style="energetic"] .dtv-tag .dw-tv { transform: none; } /* (the energetic tag is already slanted as a whole) */

/* ---------- DROMO logo: letters fading amber → white, then four slanted stripes building up ---------- */
#logoLights { display: none; }
.dromo-word .dw-name { display: inline-flex; }
.dromo-word .dw-name i { font-style: normal; transition: color 60ms linear; }
.dromo-word .dw-name i:nth-child(1) { --c: #ffb020; } .dromo-word .dw-name i:nth-child(2) { --c: #ffc85a; } .dromo-word .dw-name i:nth-child(3) { --c: #ffdc95; }
.dromo-word .dw-name i:nth-child(4) { --c: #f2e6cf; } .dromo-word .dw-name i:nth-child(5) { --c: #eef1f4; }
.dromo-word .dw-name i { color: var(--c); }
.dw-stripes { display: inline-flex; gap: 3px; align-items: center; margin-left: 2px; }
.dw-stripes i { display: block; width: 6px; height: 17px; background: var(--brand); transform: skewX(var(--slant)); transition: opacity 60ms linear; }
.dw-stripes i:nth-child(1) { --o: .16; } .dw-stripes i:nth-child(2) { --o: .38; } .dw-stripes i:nth-child(3) { --o: .65; } .dw-stripes i:nth-child(4) { --o: 1; }
.dw-stripes i { opacity: var(--o); }
.dromo-word .dw-block { display: none; }
/* revving: what isn't lit yet dims; on the limiter everything flashes purple */
.dromo-word.revving .dw-name i:not(.on) { color: #3a3f47; }
.dromo-word.revving .dw-stripes i:not(.on) { opacity: .12; }
.dromo-word.limit .dw-name i, .dromo-word.limit .dw-stripes i { animation: logoLimit .14s steps(1) infinite; }
.dromo-word.limit .dw-stripes i { opacity: 1; }
@keyframes logoLimit { 50% { color: var(--sig-fastest); background: var(--sig-fastest); } }

/* Channel bug: DROMO on glass, then TV and LIVE as two slanted blocks stuck together */
.dtv .dtv-tag, .dtv[data-style="energetic"] .dtv-tag { transform: none; background: none; }
.dtv[data-style="energetic"] .dtv-tag > * { transform: none; }
.dtv-tag .dtv-brand { padding-right: 0; gap: .9cqw; }
.dtv-tag .dw-tv, .dtv[data-style="energetic"] .dtv-tag .dw-tv { transform: skewX(var(--slant)); margin: 0 0 0 .2cqw; }
.dtv-tag .dtv-live { transform: skewX(var(--slant)); margin-left: -1px; }
.dtv-tag .dw-tv > span, .dtv-tag .dtv-live > span { display: inline-block; transform: skewX(calc(-1 * var(--slant))); }

/* the logo in the broadcast's channel bug, sized to the picture */
.dtv-tag .dtv-word { gap: .7cqh; }
.dtv-tag .dtv-word .dw-name { font: 400 2cqh/1 Michroma, var(--font-brand); letter-spacing: .16em; }
.dtv-tag .dtv-word .dw-stripes { gap: .4cqh; margin-left: 0; }
.dtv-tag .dtv-word .dw-stripes i { width: .9cqh; height: 2.5cqh; }

/* ---------- DROMO TV: the channel bug stands out, the race graphics step back further ---------- */
.dtv-tag { height: 5.6cqh; }
.dtv-tag .dtv-word .dw-name { font-size: 2.7cqh; }
.dtv-tag .dtv-word .dw-stripes i { width: 1.2cqh; height: 3.3cqh; }
.dtv-tag .dtv-word .dw-stripes { gap: .5cqh; }
.dtv-tag .dw-tv { font-size: 3.4cqh; padding: 0 1.1cqw; }
.dtv-tag .dtv-live { font-size: 3cqh; padding: 0 1cqw; }
.dtv-lap { height: 3.4cqh; font-size: 1.8cqh; padding: 0 .7cqw; }
.dtv-timing { top: 11%; min-width: 16cqw; }
.dtv-pos { font-size: 3.5cqh; padding: 0 .6cqw; }
.dtv-who { font-size: 1.9cqh; padding: .4cqh .6cqw 0; }
.dtv-secs i { font-size: 1.25cqh; } .dtv-secs { padding: .3cqh .6cqw .4cqh; }
.dtv-map { top: 8%; width: 10cqw; height: 7.5cqw; }
.dtv-driver { top: calc(9% + 7.5cqw); width: 10cqw; font-size: 1.35cqh; padding: .4cqh .5cqw; }
.dtv-l3 { width: min(44%, 60cqh * 1.4); height: 5.6cqh; bottom: 6%; }
.dtv-l3-pos { width: 4.8cqh; font-size: 3cqh; } .dtv-l3-team { width: .8cqh; }
.dtv-l3-kicker { font-size: 1.4cqh; } .dtv-l3-main b { font-size: 2.3cqh; } .dtv-l3-main b span { font-size: 1.5cqh; }
.dtv-l3-time b { font-size: 2.3cqh; } .dtv-l3-time span { font-size: 1.05cqh; }
html.tv .dtv-map { top: calc(8% + 28px); } html.tv .dtv-driver { top: calc(9% + 7.5cqw + 28px); }
html.tv .dtv-layers-btn { top: 7%; } html.tv .hs-player > .dtv-layers { top: calc(7% + 30px); }
/* LIVE: a straight block whose left edge follows the TV block's slant (no gap under it) */
.dtv-tag .dtv-live { transform: none; margin-left: calc(-5.6cqh * 0.2493); padding-left: calc(1cqw + 5.6cqh * 0.2493); clip-path: polygon(calc(5.6cqh * 0.2493) 0, 100% 0, 100% 100%, 0 100%); }
.dtv-tag .dtv-live > span { transform: none; }

/* ---------- DROMO TV, softened: slightly rounded corners, a hint of depth, glass that lets the picture through ---------- */
.dtv { --dtv-r: 4px; --dtv-glass: rgba(12, 14, 18, 0.82); }
.dtv .dtv-l, .dtv-l3, .dtv-l3 > :first-child { border-radius: var(--dtv-r); }
.dtv .dtv-timing, .dtv .dtv-map, .dtv .dtv-driver, .dtv .dtv-lap, .dtv-l3 { background: var(--dtv-glass); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 2px 10px rgba(0, 0, 0, .35); overflow: hidden; }
.dtv .dtv-pos, .dtv-l3-pos { border-radius: var(--dtv-r) 0 0 var(--dtv-r); }
.dtv-l3-time { border-radius: 0 var(--dtv-r) var(--dtv-r) 0; }
.dtv-secs i { border-radius: 2px; }
.dtv-tyres i { border-radius: 2px; }
.dtv-bar, .dtv-bar i { border-radius: 2px; }
.dtv-tag .dtv-brand { background: var(--dtv-glass); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-radius: var(--dtv-r) 0 0 var(--dtv-r); box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.dtv-tag .dw-tv { border-radius: 2px 0 0 2px; }
.dtv-tag .dtv-live { border-radius: 0 var(--dtv-r) var(--dtv-r) 0; }
.dtv-tag .dtv-word .dw-stripes i { border-radius: 1px; }
.dtv-map { border-top-width: 0; box-shadow: inset 0 2px 0 var(--brand), 0 2px 10px rgba(0, 0, 0, .35); }

/* Square on the left (softly rounded), cut on the slant on the right (the stripes' angle, its corners rounded too): the
   channel bug, the lap box and the timing box. The slanted end is a mask (it clips the glass and its blur too); --h is
   the box's height, the cut is --h × tan 14°. In the energetic style these boxes stay straight on the left as well. */
.dtv, .hs-player { --dtv-end: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 49.93 100' preserveAspectRatio='none'%3E%3Cpath d='M-15 10H37.14L17.2 90H-15Z' stroke='%23000' stroke-width='20' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.dtv-tag .dtv-live { --h: 5.6cqh; }
.dtv .dtv-lap { --h: 3.4cqh; }
.dtv .dtv-timing { --h: 6.5cqh; }
.dtv-tag .dtv-live, .dtv .dtv-lap, .dtv .dtv-timing {
  -webkit-mask: linear-gradient(#000 0 0) left / calc(100% - var(--h) * 0.33) 100% no-repeat, var(--dtv-end) right / calc(var(--h) * 0.4993) 100% no-repeat;
  mask: linear-gradient(#000 0 0) left / calc(100% - var(--h) * 0.33) 100% no-repeat, var(--dtv-end) right / calc(var(--h) * 0.4993) 100% no-repeat;
}
.dtv-tag .dtv-brand { border-radius: var(--dtv-r) 0 0 var(--dtv-r); }
.dtv-tag .dtv-live { border-radius: 0; padding-right: calc(1cqw + 5.6cqh * 0.2493); clip-path: polygon(calc(5.6cqh * 0.2493) 0, 100% 0, 100% 100%, 0 100%); }
.dtv .dtv-lap { border-radius: var(--dtv-r) 0 0 var(--dtv-r); padding-right: calc(.7cqw + 3.4cqh * 0.2493); }
.dtv .dtv-timing { border-radius: var(--dtv-r) 0 0 var(--dtv-r); padding-right: calc(6.5cqh * 0.2493); }
.dtv .dtv-timing .dtv-pos { border-radius: var(--dtv-r) 0 0 var(--dtv-r); }
.dtv[data-style="energetic"] .dtv-lap, .dtv[data-style="energetic"] .dtv-timing, .dtv[data-style="energetic"] .dtv-lap > *, .dtv[data-style="energetic"] .dtv-timing > * { transform: none; }

/* Lap and timing boxes a size smaller; the timing box also shows the field size and the last and best laps */
.dtv-lap { height: 2.8cqh; font-size: 1.5cqh; padding-left: .6cqw; gap: .5cqw; }
.dtv .dtv-lap { --h: 2.8cqh; padding-right: calc(.6cqw + 2.8cqh * 0.2493); }
.dtv-timing { min-width: 13.5cqw; }
.dtv .dtv-timing { padding-right: calc(var(--h) * 0.2493); }
.dtv-pos { font-size: 2.9cqh; padding: 0 .5cqw; }
.dtv-pos small { font-size: .5em; opacity: .75; margin-left: .1em; }
.dtv-who { font-size: 1.6cqh; padding: .35cqh .5cqw 0; }
.dtv-secs i { font-size: 1.05cqh; } .dtv-secs { padding: .25cqh .5cqw .3cqh; }
.dtv-times { grid-column: 3; display: flex; justify-content: space-between; gap: .8cqw; padding: 0 .5cqw .35cqh; font-size: 1.05cqh; letter-spacing: .08em; color: #9aa4af; }
.dtv-times b { font-family: var(--font-numbers); font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; letter-spacing: 0; margin-left: .3em; }
.dtv-pos { grid-row: 1 / 4; } .dtv-team { grid-row: 1 / 4; }

/* A size smaller again: the channel bug (4.2cqh high) and the lap box (2.3cqh) */
.dtv-tag { height: 4.2cqh; }
.dtv-tag .dtv-word .dw-name { font-size: 2cqh; }
.dtv-tag .dtv-word .dw-stripes i { width: .9cqh; height: 2.5cqh; } .dtv-tag .dtv-word .dw-stripes { gap: .38cqh; }
.dtv-tag .dtv-brand { padding-left: .8cqw; gap: .7cqw; }
.dtv-tag .dw-tv { font-size: 2.55cqh; padding: 0 .8cqw; }
.dtv-tag .dtv-live { --h: 4.2cqh; font-size: 2.25cqh; margin-left: calc(-4.2cqh * 0.2493); padding-left: calc(.75cqw + 4.2cqh * 0.2493); padding-right: calc(.75cqw + 4.2cqh * 0.2493); clip-path: polygon(calc(4.2cqh * 0.2493) 0, 100% 0, 100% 100%, 0 100%); }
.dtv-lap { height: 2.3cqh; font-size: 1.25cqh; gap: .4cqw; padding-left: .5cqw; }
.dtv .dtv-lap { --h: 2.3cqh; padding-right: calc(.5cqw + 2.3cqh * 0.2493); }

/* The lower-third, like every box: square on the left, cut on the slant on the right (never slanted as a whole) */
.dtv-l3 { --h: 5.6cqh; border-radius: var(--dtv-r) 0 0 var(--dtv-r);
  -webkit-mask: linear-gradient(#000 0 0) left / calc(100% - var(--h) * 0.33) 100% no-repeat, var(--dtv-end) right / calc(var(--h) * 0.4993) 100% no-repeat;
  mask: linear-gradient(#000 0 0) left / calc(100% - var(--h) * 0.33) 100% no-repeat, var(--dtv-end) right / calc(var(--h) * 0.4993) 100% no-repeat; }
.dtv-l3-time { border-radius: 0; padding-right: calc(1.2cqw + 5.6cqh * 0.2493); }
.dtv[data-style="energetic"] .dtv-l3, .dtv[data-style="energetic"] .dtv-l3.show, .dtv[data-style="energetic"] .dtv-l3 > * { transform: none; }
.dtv[data-style="energetic"] .dtv-l3:not(.show) { transform: translateX(-4%); }

/* DROMO's video controls: a glass box like the graphics (square left, slanted right), bottom left */
.hs-player > .dtv-ctl { --h: 34px; inset: auto auto 2% 2%; height: var(--h); padding: 0 calc(12px + var(--h) * 0.2493) 0 8px; gap: 4px;
  background: rgba(12, 14, 18, 0.82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-radius: 4px 0 0 4px;
  -webkit-mask: linear-gradient(#000 0 0) left / calc(100% - var(--h) * 0.33) 100% no-repeat, var(--dtv-end) right / calc(var(--h) * 0.4993) 100% no-repeat;
  mask: linear-gradient(#000 0 0) left / calc(100% - var(--h) * 0.33) 100% no-repeat, var(--dtv-end) right / calc(var(--h) * 0.4993) 100% no-repeat; }
.dtv-ctl .spacer { display: none; }
.dtv-ctl button { font: 700 14px/1 var(--font-brand); color: var(--ink); padding: 5px 7px; border-radius: 3px; }
.dtv-ctl button:hover { background: rgba(255, 176, 32, .18); color: var(--brand); }
.dtv-ctl input[type="range"] { width: 90px; }
.dtv-ctl-live { font: 700 11px var(--font-brand); letter-spacing: .14em; margin: 0 4px; }

/* REPLAY after LIVE when the game shows a replay: same slant, white on glass */
.dtv-tag .dtv-replay { --h: 4.2cqh; display: flex; align-items: center; margin-left: calc(-4.2cqh * 0.2493 + 2px); padding: 0 calc(.75cqw + 4.2cqh * 0.2493); font: 700 2.25cqh/1 var(--font-brand); letter-spacing: .14em; color: var(--ink); background: var(--dtv-glass); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  clip-path: polygon(calc(4.2cqh * 0.2493) 0, 100% 0, 100% 100%, 0 100%);
  -webkit-mask: linear-gradient(#000 0 0) left / calc(100% - var(--h) * 0.33) 100% no-repeat, var(--dtv-end) right / calc(var(--h) * 0.4993) 100% no-repeat;
  mask: linear-gradient(#000 0 0) left / calc(100% - var(--h) * 0.33) 100% no-repeat, var(--dtv-end) right / calc(var(--h) * 0.4993) 100% no-repeat; }
.dtv-tag .dtv-replay[hidden] { display: none; }

/* Session type in the lap box: RACE / TIME TRIAL */
.dtv-kind { color: #9aa4af; letter-spacing: .12em; margin-right: .3em; } .dtv-kind:empty { display: none; }

/* Standby: the video paused under dark glass; what's happening, today's numbers, the sponsor's slot */
.dtv-standby { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 1.6cqh; background: rgba(8, 10, 14, .78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); text-align: center; }
.dtv.standby .dtv-standby:not([hidden]) { display: flex; }
.dtv.standby .dtv-tag { z-index: 2; } /* (the channel bug stays on air) */
.dtv.standby .dtv-lap, .dtv.standby .dtv-timing, .dtv.standby .dtv-map, .dtv.standby .dtv-driver, .dtv.standby .dtv-l3 { visibility: hidden; }
.dtv-sb-kicker { font: 700 1.9cqh/1 var(--font-brand); letter-spacing: .3em; color: var(--brand); }
.dtv-sb-title { font: 800 6.4cqh/1 var(--font-brand); letter-spacing: .04em; color: var(--ink); }
.dtv-sb-name { font: 700 2.4cqh/1 var(--font-brand); letter-spacing: .1em; color: var(--ink); } .dtv-sb-name span { color: #9aa4af; font-weight: 600; margin-left: .5em; }
.dtv-sb-stats { display: flex; gap: .8cqw; margin-top: 1.2cqh; }
.dtv-sb-tile { --h: 7cqh; height: var(--h); min-width: 13cqw; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 0 calc(1.2cqw + var(--h) * 0.2493) 0 1.2cqw; background: var(--dtv-glass); border-radius: var(--dtv-r) 0 0 var(--dtv-r); border-left: 3px solid var(--brand);
  -webkit-mask: linear-gradient(#000 0 0) left / calc(100% - var(--h) * 0.33) 100% no-repeat, var(--dtv-end) right / calc(var(--h) * 0.4993) 100% no-repeat;
  mask: linear-gradient(#000 0 0) left / calc(100% - var(--h) * 0.33) 100% no-repeat, var(--dtv-end) right / calc(var(--h) * 0.4993) 100% no-repeat; }
.dtv-sb-tile span { font: 600 1.3cqh/1 var(--font-brand); letter-spacing: .16em; color: #9aa4af; }
.dtv-sb-tile b { font: 700 3.4cqh/1.1 var(--font-numbers); font-variant-numeric: tabular-nums; color: var(--ink); margin-top: .5cqh; }
.dtv-sb-ad { --h: 8cqh; position: absolute; bottom: 7%; height: var(--h); display: flex; align-items: center; gap: 1.2cqw; padding: 0 calc(2cqw + var(--h) * 0.2493) 0 2cqw; background: var(--brand); color: var(--on-brand); border-radius: var(--dtv-r) 0 0 var(--dtv-r);
  -webkit-mask: linear-gradient(#000 0 0) left / calc(100% - var(--h) * 0.33) 100% no-repeat, var(--dtv-end) right / calc(var(--h) * 0.4993) 100% no-repeat;
  mask: linear-gradient(#000 0 0) left / calc(100% - var(--h) * 0.33) 100% no-repeat, var(--dtv-end) right / calc(var(--h) * 0.4993) 100% no-repeat; }
.dtv-sb-ad[hidden] { display: none; }
.dtv-sb-ad span { font: 700 1.5cqh/1 var(--font-brand); letter-spacing: .24em; opacity: .75; }
.dtv-sb-ad b { font: 800 4.2cqh/1 var(--font-brand); letter-spacing: .08em; }

/* The logo's end (LIVE, REPLAY) cut as crisply as the TV block's edge: the same slant with only a hint of rounding
   (the softer end of the other boxes reads as a rounded rectangle at this height) */
.dtv-tag .dtv-live, .dtv-tag .dtv-replay {
  -webkit-mask: linear-gradient(#000 0 0) left / calc(100% - var(--h) * 0.33) 100% no-repeat, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 49.93 100' preserveAspectRatio='none'%3E%3Cpath d='M-15 4H44.81L21.88 96H-15Z' stroke='%23000' stroke-width='8' stroke-linejoin='round'/%3E%3C/svg%3E") right / calc(var(--h) * 0.4993) 100% no-repeat;
  mask: linear-gradient(#000 0 0) left / calc(100% - var(--h) * 0.33) 100% no-repeat, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 49.93 100' preserveAspectRatio='none'%3E%3Cpath d='M-15 4H44.81L21.88 96H-15Z' stroke='%23000' stroke-width='8' stroke-linejoin='round'/%3E%3C/svg%3E") right / calc(var(--h) * 0.4993) 100% no-repeat; }

/* ---------- the race engineer: what he says, as a radio subtitle (Driver mode) ---------- */
.dm-radio { position: fixed; left: 50%; top: 4vh; transform: translateX(-50%); z-index: 56; max-width: 80vw; padding: .8vh 1.6vw .8vh 1.2vw; background: var(--panel-glass); border-radius: 6px; border-left: 4px solid var(--brand); font: 600 clamp(16px, 3vh, 34px)/1.25 var(--font-brand); letter-spacing: .02em; color: var(--ink); text-align: left; }
.dm-radio::before { content: 'RADIO'; margin-right: .7em; padding: .05em .45em; border-radius: 3px; background: var(--brand); color: #111; font-size: .6em; letter-spacing: .12em; vertical-align: .25em; }
.dm-radio[hidden], :root:not([data-app-mode="driver"]) .dm-radio { display: none; }
.eng-title { margin-top: var(--space-3); }
.eng-row { display: flex; align-items: center; gap: 8px; margin: var(--space-2) 0; }
.eng-row select { flex: 1; }

/* Settings: your channel online */
.tunnel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tunnel-grid label { display: flex; flex-direction: column; gap: 4px; }
.tunnel-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; }

/* Live track maps during standby: the map steps aside for a message */
[data-live-map].standby > canvas { visibility: hidden; }
[data-live-map].standby::before, [data-live-map].standby::after { position: absolute; left: 0; right: 0; text-align: center; pointer-events: none; }
[data-live-map].standby::before { content: attr(data-sb-title); top: calc(50% - 1.4em); font: 800 clamp(20px, 3vw, 40px)/1 var(--font-brand); letter-spacing: .06em; color: var(--ink); }
[data-live-map].standby::after { content: attr(data-sb-sub); top: calc(50% + .6em); font: 700 clamp(11px, 1vw, 14px)/1 var(--font-brand); letter-spacing: .26em; color: var(--brand); }

/* =====================================================================================================================
   THE SHAPE RULE (visual pass): every object is a diamond, its ends on the 14° slant; an end is square only where it
   lines up with the edge of its container (the screen, or the box it sits in). Small items: a full slanted end, as wide
   as --cut (≈ height × tan 14°). Large boxes: the same slant as a short corner cut (top-left for the left end,
   bottom-right for the right end), so they don't lose their width.
     .sh-l  square left, slanted right      .bx-l  large box: square left, cut bottom-right
     .sh-r  slanted left, square right      .bx-r  large box: cut top-left, square right
     .sh-d  both ends slanted               .bx-d  large box: both corners cut
   ===================================================================================================================== */
:root { --cut: 9px; --tip-w: 13px; --tip-h: 52px; }
.sh-l { clip-path: polygon(0 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%); border-radius: 3px 0 0 3px; }
.sh-r { clip-path: polygon(var(--cut) 0, 100% 0, 100% 100%, 0 100%); border-radius: 0 3px 3px 0; }
.sh-d { clip-path: polygon(var(--cut) 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%); }
.bx-l { clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--tip-h)), calc(100% - var(--tip-w)) 100%, 0 100%); border-radius: 5px 0 0 5px; }
.bx-r { clip-path: polygon(var(--tip-w) 0, 100% 0, 100% 100%, 0 100%, 0 var(--tip-h)); border-radius: 0 5px 5px 0; }
.bx-d { clip-path: polygon(var(--tip-w) 0, 100% 0, 100% calc(100% - var(--tip-h)), calc(100% - var(--tip-w)) 100%, 0 100%, 0 var(--tip-h)); }

/* ---------- Driver mode (Minimal), in the shape language: flush to the screen's edges ---------- */
.dm.dmw:not([hidden]) { padding: 3vh 0 0; gap: 1.6vh; background: #050607; }
.dmw .dm-leds { padding: 0; gap: .4vw; }
.dmw .dm-leds i { border-radius: 2px; }
.dmw-grid, .dmw-row { gap: 1.1vw; }
.dmw { --tip-w: 1.6vh; --tip-h: 6vh; }
.dmw-tile { background: rgba(14, 17, 21, .95); border: 0; border-radius: 0; padding: 1.4vh 2.2vw; box-shadow: inset .45vh 0 0 var(--brand); gap: 1vh; }
.dmw-grid > .dmw-side:first-child .dmw-tile, .dmw-row .dmw-tile:first-child { clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--tip-h)), calc(100% - var(--tip-w)) 100%, 0 100%); }
.dmw-grid > .dmw-side:last-child .dmw-tile, .dmw-row .dmw-tile:last-child { clip-path: polygon(var(--tip-w) 0, 100% 0, 100% 100%, 0 100%, 0 var(--tip-h)); padding-left: 2.8vw; }
.dmw-row .dmw-tile:nth-child(2) { clip-path: polygon(var(--tip-w) 0, 100% 0, 100% calc(100% - var(--tip-h)), calc(100% - var(--tip-w)) 100%, 0 100%, 0 var(--tip-h)); padding-left: 2.8vw; }
.dmw-gear { border-radius: 0; clip-path: polygon(var(--tip-w) 0, 100% 0, 100% calc(100% - var(--tip-h)), calc(100% - var(--tip-w)) 100%, 0 100%, 0 var(--tip-h)); }
.dmw .dm-k { color: #9aa4af; letter-spacing: .22em; }
.dmw .dm-v { font-weight: 700; font-size: clamp(30px, 9vh, 120px); }
.dmw .dm-v small { font-size: .45em; color: #9aa4af; margin-left: .06em; }
.dmw-row .dm-v { font-size: clamp(24px, 6.5vh, 84px); }
.dmw-row .dmw-tile:nth-child(2) { box-shadow: inset .45vh 0 0 #3a414c; }
.dmw-best { box-shadow: inset .45vh 0 0 var(--sig-fastest) !important; }
.dmw-row .dmw-tile:first-child { box-shadow: inset .45vh 0 0 #3a414c; }
.dmw-delta { box-shadow: inset .45vh 0 0 #3a414c; }
.dmw-delta.gain { background: rgba(14, 17, 21, .95); box-shadow: inset .45vh 0 0 var(--sig-improved); }
.dmw-delta.loss { background: rgba(14, 17, 21, .95); box-shadow: inset .45vh 0 0 var(--sig-problem); }
.dmw-delta.gain .dm-k, .dmw-delta.loss .dm-k { color: #9aa4af; }
/* the radio subtitle and the coach's corner tip: diamonds in the middle of the screen, their tag taking the slant */
.dm-radio { --cut: 1.6vh; top: 5.5vh; border: 0; border-radius: 0; padding: 0 2.4vw 0 0; display: flex; align-items: center; gap: 1.2vw; min-height: 6vh; background: rgba(14, 17, 21, .96); box-shadow: 0 .8vh 3vh rgba(0, 0, 0, .6); clip-path: polygon(var(--cut) 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%); }
.dm-radio:not([hidden]) { display: flex; }
.dm-radio::before { align-self: stretch; display: flex; align-items: center; margin: 0; padding: 0 1.2vw 0 1.6vw; border-radius: 0; font: 800 clamp(11px, 2vh, 22px)/1 var(--font-brand); letter-spacing: .18em; vertical-align: 0; }
.dm-cue { --cut: 1.8vh; border-left: 0; padding: 1.2vh 3vw; clip-path: polygon(var(--cut) 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%); background: rgba(14, 17, 21, .96); box-shadow: inset 0 -.4vh 0 var(--brand); }
.dm.dmw:not([hidden]) { padding-bottom: 2.5vh; }
.dmw-grid { margin-top: 6.5vh; } /* (a lane for the radio subtitle, between the LEDs and the tiles) */
.dm-radio { top: 6.6vh; min-height: 5.6vh; }
.dmw .dmw-gear .dm-k { color: rgba(10, 12, 15, .6); }
.dm-cue { bottom: 19vh; }

/* ---------- visual pass, step 2: the header and navigation in the shape language ---------- */
.top { --cut: 8px; gap: 10px; padding: 0; min-height: 56px; background: linear-gradient(#07080a, #0b0d10); border-bottom: 1px solid #1c2128; }
/* the logo meets the screen's left edge: square left; the mode block next to it, a diamond */
.top .brand { align-self: stretch; display: flex; align-items: center; margin: 0; padding: 0 14px 0 18px; background: rgba(255, 255, 255, .03); }
.top .mode-switch { --cut: 10px; display: flex; align-self: center; margin: 0 6px 0 -6px; gap: 0; border: 0; background: none; padding: 0; }
.top .mode-switch button { display: none; height: 40px; align-items: center; padding: 0 18px 0 20px; border: 0; border-radius: 0; background: rgba(255, 255, 255, .06); color: #c9d0d7; font: 800 17px/1 var(--font-brand); letter-spacing: .1em; text-transform: uppercase; clip-path: polygon(var(--cut) 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%); margin-left: -4px; cursor: pointer; }
.top .mode-switch button[aria-pressed="true"] { display: flex; background: var(--brand); color: var(--on-brand); }
.top .mode-switch button[aria-pressed="true"]::after { content: '▾'; font-size: 12px; margin-left: 7px; opacity: .7; }
.top .mode-switch:hover button, .top .mode-switch:focus-within button { display: flex; }
.top .mode-switch:hover button[aria-pressed="true"]::after, .top .mode-switch:focus-within button[aria-pressed="true"]::after { content: none; }
.top .mode-switch button:not([aria-pressed="true"]):hover { background: rgba(255, 176, 32, .22); color: var(--brand); }
/* navigation: every tab a diamond; the selected one amber; group names in amber caps */
.top .tabs { gap: 0; }
.top .tab-group { gap: 3px; }
.top .tab-group + .tab-group { margin-left: 10px; padding-left: 0; border-left: 0; }
.top .tab-gl { font: 700 10px/1 var(--font-brand); letter-spacing: .24em; color: var(--brand); opacity: 1; margin: 0 6px 0 0; }
.top .tab { height: 32px; display: flex; align-items: center; padding: 0 15px; border-radius: 0; background: rgba(255, 255, 255, .045); color: #c9d0d7; font: 700 13px/1 var(--font-brand); letter-spacing: .1em; text-transform: uppercase; clip-path: polygon(var(--cut) 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%); }
.top .tab:hover { background: rgba(255, 176, 32, .16); color: var(--ink); }
.top .tab[aria-selected="true"] { background: var(--brand); color: var(--on-brand); }
/* the seat, the status chips, the toggles and buttons: diamonds */
.top .chip, .top .share-toggle, .top .top-right > .btn, .top .top-right > details > summary, .top .share-info .btn { --cut: 8px; height: 32px; display: inline-flex; align-items: center; border: 0; border-radius: 0; padding: 0 14px; background: rgba(255, 255, 255, .055); clip-path: polygon(var(--cut) 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%); font: 700 12px/1 var(--font-brand); letter-spacing: .12em; text-transform: uppercase; }
.top .top-right > .btn.icon, .top .top-right > details > summary.icon { min-width: 40px; justify-content: center; padding: 0 12px; font-size: 15px; letter-spacing: 0; }
.top .top-right { gap: 4px; align-self: stretch; }
/* the last control meets the screen's right edge: square right */
.top .top-right > details:last-child > summary { height: 100%; min-height: 56px; padding: 0 18px 0 20px; clip-path: polygon(var(--cut) 0, 100% 0, 100% 100%, 0 100%); background: rgba(255, 255, 255, .04); }
.top .top-center { gap: 8px; }
.top .seat-num { --cut: 6px; align-self: center; margin: 0; padding: 4px 12px; border: 0; border-radius: 0; background: var(--brand); color: var(--on-brand); font: 800 20px/1 var(--font-numbers); clip-path: polygon(var(--cut) 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%); }
.top [hidden], .top .shared-only { display: none !important; }
.shared .top .shared-only:not([hidden]) { display: inline-flex !important; }
@media (min-width: 1600px) { .top { flex-wrap: nowrap; } .top .top-center { margin: 0 auto; } }
/* menu items: on hover they grow a little and turn amber */
.top .tab, .top .mode-switch button { transition: transform 140ms var(--ease-out, ease-out), background-color 140ms, color 140ms; }
.top .tab:hover, .top .mode-switch button:not([aria-pressed="true"]):hover { transform: scale(1.12); background: var(--brand); color: var(--on-brand); position: relative; z-index: 2; }
.top .tab[aria-selected="true"]:hover { transform: scale(1.12); }
@media (prefers-reduced-motion: reduce) { .top .tab:hover, .top .mode-switch button:hover { transform: none; } }
@media (max-width: 1599px) { .top .tabs { padding: 6px 14px; } }

/* ---------- soft diamonds: the slanted ends with lightly rounded corners (like the DROMO TV boxes), as a mask, so
   they work at any width; --h is the item's height. .soft-d both ends · .soft-l square left · .soft-r square right ---------- */
:root { --end-r: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 49.93 100' preserveAspectRatio='none'%3E%3Cpath d='M-15 10H37.14L17.2 90H-15Z' stroke='%23000' stroke-width='20' stroke-linejoin='round'/%3E%3C/svg%3E"); --end-l: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 49.93 100' preserveAspectRatio='none'%3E%3Cg transform='rotate(180 24.965 50)'%3E%3Cpath d='M-15 10H37.14L17.2 90H-15Z' stroke='%23000' stroke-width='20' stroke-linejoin='round'/%3E%3C/g%3E%3C/svg%3E"); }
.soft-d, .top .tab, .top .mode-switch button, .top .chip, .top .share-toggle, .top .top-right > .btn, .top .top-right > details:not(:last-child) > summary, .top .share-info .btn, .top .seat-num, .live-badge {
  clip-path: none !important;
  -webkit-mask: var(--end-l) left / calc(var(--h, 32px) * .4993) 100% no-repeat, linear-gradient(#000 0 0) center / calc(100% - var(--h, 32px) * .66) 100% no-repeat, var(--end-r) right / calc(var(--h, 32px) * .4993) 100% no-repeat;
  mask: var(--end-l) left / calc(var(--h, 32px) * .4993) 100% no-repeat, linear-gradient(#000 0 0) center / calc(100% - var(--h, 32px) * .66) 100% no-repeat, var(--end-r) right / calc(var(--h, 32px) * .4993) 100% no-repeat; }
.soft-l { -webkit-mask: linear-gradient(#000 0 0) left / calc(100% - var(--h, 32px) * .33) 100% no-repeat, var(--end-r) right / calc(var(--h, 32px) * .4993) 100% no-repeat; mask: linear-gradient(#000 0 0) left / calc(100% - var(--h, 32px) * .33) 100% no-repeat, var(--end-r) right / calc(var(--h, 32px) * .4993) 100% no-repeat; }
.soft-r, .top .top-right > details:last-child > summary { clip-path: none !important; -webkit-mask: var(--end-l) left / calc(var(--h, 56px) * .4993) 100% no-repeat, linear-gradient(#000 0 0) right / calc(100% - var(--h, 56px) * .33) 100% no-repeat; mask: var(--end-l) left / calc(var(--h, 56px) * .4993) 100% no-repeat, linear-gradient(#000 0 0) right / calc(100% - var(--h, 56px) * .33) 100% no-repeat; }
.top .tab, .top .chip, .top .share-toggle, .top .top-right > .btn, .top .top-right > details > summary, .top .share-info .btn { --h: 32px; padding-left: 16px; padding-right: 16px; }
.top .mode-switch button { --h: 40px; padding: 0 20px 0 22px; }
.top .top-right > details:last-child > summary { --h: 56px; }
.top .seat-num { --h: 28px; padding: 4px 14px; }
.live-badge { --h: 18px; padding: 0 10px; border-radius: 0; font: 800 11px/18px var(--font-brand); letter-spacing: .12em; background: var(--sig-problem); }

/* the mode switch: on the right, labelled, all three visible (it's who the screen is for, not a menu group) */
.top .mode-switch { margin: 0 8px 0 0; align-items: center; }
.top .mode-switch button, .top .mode-switch:hover button, .top .mode-switch:focus-within button { display: flex; }
.top .mode-switch button { --h: 32px; height: 32px; margin-left: -3px; padding: 0 15px; font: 700 12px/1 var(--font-brand); letter-spacing: .12em; }
.top .mode-switch button[aria-pressed="true"]::after { content: none; }
.top .mode-gl { font: 700 10px/1 var(--font-brand); letter-spacing: .24em; color: var(--ink-muted); text-transform: uppercase; margin-right: 8px; }
/* menu groups set apart again */
.top .tab-group + .tab-group { margin-left: 12px; padding-left: 12px; border-left: 1px solid #262c35; }
.top .brand { padding-right: 18px; margin-right: 6px; }
/* one line at 1920: tighter tabs and controls */
.top .tab { padding: 0 12px; font-size: 12.5px; letter-spacing: .08em; }
.top .tab-group { gap: 2px; }
.top .tab-group + .tab-group { margin-left: 8px; padding-left: 8px; }
.top .tab-gl { margin-right: 4px; letter-spacing: .2em; }
.top .top-right { flex-wrap: nowrap; gap: 3px; }
.top .top-right > .btn.icon, .top .top-right > details > summary.icon { min-width: 36px; padding: 0 10px; }
.top .mode-switch button { padding: 0 13px; }
.top .top-center { gap: 6px; }
@media (min-width: 1600px) { .top .top-center { margin: 0 auto; flex-shrink: 1; min-width: 0; } }

/* the standby screen's ad: beside the card (a reel is tall), a diamond frame against the right edge */
.dtv-sb-media { position: absolute; right: 0; top: 50%; transform: translateY(-50%); height: 72cqh; aspect-ratio: 9 / 16; background: #000; border-radius: 0 6px 6px 0; overflow: hidden; clip-path: polygon(var(--tip-w, 13px) 0, 100% 0, 100% 100%, 0 100%, 0 var(--tip-h, 52px)); box-shadow: inset 4px 0 0 var(--brand); }
.dtv-sb-media[hidden] { display: none; }
.dtv-sb-media[data-kind="wide"] { height: auto; width: 46cqw; aspect-ratio: 16 / 9; }
.dtv-sb-media iframe, .dtv-sb-media video, .dtv-sb-media img { width: 100%; height: 100%; border: 0; display: block; object-fit: cover; }
.dtv.standby .dtv-standby:has(.dtv-sb-media:not([hidden])) > :not(.dtv-sb-media):not(.dtv-sb-ad) { transform: translateX(-14cqw); }
/* REPLAY: a solid block (white, dark text) so it reads at any size, even in the Dashboard's small player */
.dtv-tag .dtv-replay { background: #eef1f4; color: #0a0c0f; backdrop-filter: none; -webkit-backdrop-filter: none; margin-left: calc(-4.2cqh * 0.2493 + 1px); font-weight: 800; }
/* the logo's stripes: equal at any size (whole pixels: fractions blurred them unevenly) and in even steps of light */
.dw-stripes i:nth-child(1) { --o: .25; } .dw-stripes i:nth-child(2) { --o: .5; } .dw-stripes i:nth-child(3) { --o: .75; } .dw-stripes i:nth-child(4) { --o: 1; }
.dtv-tag .dtv-word .dw-stripes i { width: max(2px, round(.9cqh, 1px)); height: round(2.5cqh, 1px); }
.dtv-tag .dtv-word .dw-stripes { gap: max(2px, round(.38cqh, 1px)); }
.dw-stripes i { height: 18px; } /* (even height: on whole pixels, so the faint stripes don't look shorter) */
/* the stripes' fill builds up (25/50/75/100%), and each has a fine amber outline, so all four read as the same size
   (on dark, faint shapes look smaller than bright ones) */
.dw-stripes i { opacity: 1; background: color-mix(in srgb, var(--brand) calc(var(--o) * 100%), transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 80%, transparent); }
.dromo-word.revving .dw-stripes i:not(.on) { opacity: .45; background: color-mix(in srgb, var(--brand) 8%, transparent); }
.dromo-word.limit .dw-stripes i { box-shadow: none; }
.dw-stripes i { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 35%, transparent); } /* (a lighter outline) */
