:root {
  color-scheme: dark;
  --ground: #07090c;
  --panel: rgba(12, 16, 21, 0.88);
  --line: rgba(255, 255, 255, 0.1);
  --muted: #8b95a3;
  --text: #e8ecf1;
  --amber: #ffb020;
  --cyan: #4fd1e8;
  --display: "Chakra Petch", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  color: var(--text);
  background: var(--ground);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overflow: hidden;
}
button,
select,
input {
  font: inherit;
}
button,
select {
  color: inherit;
  border: 1px solid var(--line);
  background: #ffffff04;
  border-radius: 3px;
  cursor: pointer;
}
button {
  height: 34px;
  padding: 0 10px;
  white-space: nowrap;
}
button:hover,
select:hover {
  background: #ffffff0d;
  border-color: #ffffff40;
}
button.active,
button[aria-pressed="true"] {
  color: var(--amber);
  border-color: #ffb02070;
  background: #ffb02012;
}
button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.3;
  cursor: default;
}
[hidden] {
  display: none !important;
}
small {
  color: var(--muted);
  font-size: 10px;
}
h1,
h2,
p {
  margin: 0;
}
h1,
h2,
button,
.eyebrow {
  font-family: var(--display);
}
h2 {
  font-size: 19px;
}
#app,
#scene,
#labels,
.vignette {
  position: absolute;
  inset: 0;
}
#scene canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.vignette {
  pointer-events: none;
  background: radial-gradient(
    ellipse at 52% 40%,
    transparent 30%,
    #07090c70 85%
  );
}
#labels {
  pointer-events: none;
  overflow: hidden;
}
.car-label {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
  font: 600 11px var(--display);
  background: #0c1015cc;
  padding: 3px 6px;
  border-left: 2px solid var(--team);
  white-space: nowrap;
}
header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  background: linear-gradient(#07090cfa, #07090c55);
  z-index: 4;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 700 15px var(--display);
  letter-spacing: 0.2em;
}
.brand svg {
  color: var(--amber);
}
#session-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 46px;
  padding: 0 12px;
  text-align: left;
}
#session-picker strong {
  font: 600 12px var(--display);
  letter-spacing: 0.06em;
}
#session-picker strong span {
  color: var(--muted);
}
#session-picker small {
  display: block;
  font: 9px var(--mono);
  margin-top: 4px;
}
.circuit-icon {
  width: 43px;
  height: 30px;
}
.country-flag {
  font-size: 22px;
  line-height: 1;
}
.race-status {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  font-family: var(--mono);
}
#race-lap {
  font-size: 17px;
}
#elapsed {
  font-size: 14px;
  color: #c9d0da;
}
#flag {
  font: 600 10px var(--display);
  border: 1px solid currentColor;
  padding: 6px 8px;
  border-radius: 2px;
  letter-spacing: 0.08em;
}
.view-tabs {
  display: flex;
}
.view-tabs button {
  border-radius: 0;
  font-size: 11px;
  padding: 0 11px;
}
#geek {
  font-size: 13px;
}
#info {
  font-size: 17px;
  border: 0;
  padding: 0 3px;
}
aside {
  position: absolute;
  top: 86px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 3px;
  padding: 14px;
}
.section-label,
.eyebrow {
  font: 600 10px var(--display);
  letter-spacing: 0.15em;
  color: var(--muted);
}
.section-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}
#tower {
  left: 24px;
  width: 222px;
  max-height: calc(100vh - 310px);
  overflow: auto;
  scrollbar-width: thin;
}
#drivers {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.driver-row {
  display: grid;
  grid-template-columns: 20px 33px 1fr 19px 20px;
  align-items: center;
  width: 100%;
  height: 26px;
  min-height: 26px;
  font-size: 12px;
  padding: 0 6px;
  gap: 5px;
  text-align: left;
  border: 1px solid transparent;
  border-left: 3px solid var(--team);
  background: transparent;
}
.driver-row .rank {
  font: 10px var(--mono);
  color: var(--muted);
}
.driver-row b {
  letter-spacing: 0.05em;
}
.driver-row .gap {
  text-align: right;
  font: 10px var(--mono);
  color: #bec6d0;
}
.driver-row.selected {
  background: #ffb02012;
  border-top-color: #ffb02040;
  border-bottom-color: #ffb02040;
  border-right-color: #ffb02040;
}
.driver-row.unavailable,
.driver-row.retired {
  opacity: 0.4;
}
.tyre-dot,
#compound {
  border: 1px solid currentColor;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  font: 600 10px var(--display);
}
.tyre-age {
  font: 9px var(--mono);
  color: var(--muted);
  text-align: right;
}
.tower-foot {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: 9px var(--display);
  color: var(--muted);
}
.tower-foot button {
  font-size: 9px;
  height: 25px;
  padding: 0 6px;
}
#stage-caption {
  position: absolute;
  top: 104px;
  left: 276px;
  pointer-events: none;
}
#stage-caption h1 {
  font-size: clamp(20px, 2.6vw, 42px);
  letter-spacing: 0.1em;
  font-weight: 500;
  margin: 8px 0;
  color: #dce1e8;
}
#stage-caption p {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.stage-rule {
  display: block;
  background: var(--amber);
  width: 32px;
  height: 2px;
  margin-top: 16px;
}
#telemetry {
  right: 24px;
  width: 272px;
  padding: 15px 18px;
  background: #0e1218b0;
  backdrop-filter: blur(16px);
}
#telemetry:before,
#telemetry:after {
  content: "";
  position: absolute;
  width: 11px;
  height: 11px;
  border: solid var(--amber);
}
#telemetry:before {
  top: -1px;
  left: -1px;
  border-width: 1px 0 0 1px;
}
#telemetry:after {
  bottom: -1px;
  right: -1px;
  border-width: 0 1px 1px 0;
}
.driver-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
#driver-number {
  font: 700 34px var(--display);
  color: var(--selected);
}
.driver-title h2 {
  letter-spacing: 0.08em;
}
.driver-title small {
  font-size: 10px;
}
#compound {
  margin-left: auto;
  width: 24px;
  height: 24px;
  font-size: 12px;
}
#instrument {
  width: 220px;
  height: 220px;
  margin: 7px auto -2px;
}
#instrument svg {
  width: 100%;
  height: 100%;
}
#dial-speed,
#dial-rpm {
  transform-origin: 125px 125px;
  transition: transform 0.12s linear;
}
.speed {
  display: flex;
  gap: 7px;
  align-items: baseline;
}
.speed > strong {
  font: 500 48px var(--mono);
  letter-spacing: -3px;
  line-height: 1.15;
}
.speed > span {
  font: 10px var(--display);
  color: var(--muted);
}
.gear {
  margin-left: auto;
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.gear small {
  font: 8px var(--display);
  letter-spacing: 0.1em;
}
.gear b {
  font: 500 27px var(--mono);
  color: var(--amber);
}
.rpm-line {
  display: flex;
  justify-content: space-between;
  font: 9px var(--display);
  letter-spacing: 0.08em;
  margin-top: 9px;
  color: var(--muted);
}
.rpm-line b {
  font: 11px var(--mono);
  color: var(--text);
}
.rpm-track,
.meter {
  height: 4px;
  background: #ffffff10;
  overflow: hidden;
}
.rpm-track {
  margin-top: 7px;
}
.rpm-track i,
.meter i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--amber);
}
.pedals {
  margin-top: 16px;
}
.pedals > div {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  font-size: 10px;
}
.pedals span {
  width: 25px;
  color: var(--muted);
  font-family: var(--display);
}
.pedals .meter {
  flex: 1;
}
.meter i {
  background: #2ed47a;
}
.brake i {
  background: #e8342c;
}
.pedals b {
  width: 32px;
  text-align: right;
  font: 10px var(--mono);
}
.driver-meta {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  margin-top: 15px;
  font: 9px var(--mono);
  color: var(--muted);
}
#drs[data-open="true"] {
  color: #2ed47a;
}
.gap-context {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.gap-context > span {
  display: flex;
  justify-content: space-between;
  font: 9px var(--display);
  color: var(--muted);
  letter-spacing: 0.08em;
}
.gap-context b {
  font: 11px var(--mono);
  color: #c9d0da;
}
#data-status {
  display: block;
  font: 9px var(--mono);
  color: #76818f;
  line-height: 1.6;
  margin-top: 12px;
}
#cameras {
  position: absolute;
  right: 24px;
  display: flex;
  gap: 5px;
}
#cameras button {
  font: 11px var(--display);
  height: 29px;
}
#battle {
  position: absolute;
  left: 50%;
  top: 26%;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  background: #0c1015de;
  padding: 10px 15px;
  font: 12px var(--mono);
  display: flex;
  align-items: center;
  gap: 13px;
}
#battle span {
  font: 10px var(--display);
  color: var(--amber);
  letter-spacing: 0.1em;
}
.race-control {
  position: absolute;
  left: 270px;
  right: 318px;
  bottom: 230px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  pointer-events: none;
}
.race-control > span {
  font: 9px var(--display);
  letter-spacing: 0.12em;
  color: var(--amber);
  white-space: nowrap;
}
#race-message {
  font: 10px var(--display);
  color: #aeb6c2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 28px 12px;
  background: linear-gradient(transparent, #07090cf5 12%);
  z-index: 3;
}
.timeline-row {
  display: flex;
  gap: 14px;
  align-items: center;
  font: 9px var(--mono);
  color: var(--muted);
  margin-top: 4px;
}
.seek-wrap {
  flex: 1;
  position: relative;
  min-width: 0;
}
#seek {
  width: 100%;
  height: 16px;
  margin: 0;
  accent-color: var(--amber);
  cursor: pointer;
}
#cue-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.cue-marker {
  position: absolute;
  top: 15px;
  width: 7px;
  min-width: 0;
  height: 7px;
  padding: 0;
  border: 0;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 0;
  background: #b6bdc8;
  pointer-events: auto;
}
.cue-marker:hover {
  background: var(--amber);
}
#lap-ticks {
  position: relative;
  height: 13px;
  margin: 3px 68px 0;
  font: 8px var(--mono);
  color: #6c7786;
}
#lap-ticks span {
  position: absolute;
  transform: translateX(-50%);
}
.transport {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 13px;
}
.play-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}
.play-controls > button:not(.primary) {
  width: 29px;
  border: 0;
  padding: 0;
  font-size: 18px;
  color: var(--muted);
}
#play {
  border-radius: 50%;
  border: 2px solid #e8342c;
  width: 49px;
  height: 49px;
  margin: 0 5px;
  background: radial-gradient(circle at 50% 35%, #30343d, #11151a 75%);
  box-shadow:
    0 0 0 4px #e8342c14,
    inset 0 -5px 10px #0008;
  font-size: 18px;
}
.rate-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
}
.rate-control small {
  font: 8px var(--display);
  letter-spacing: 0.12em;
  display: block;
}
.rate-knob {
  width: 34px;
  height: 34px;
  border: 1px solid #ffffff28;
  background: repeating-conic-gradient(#23272d 0deg 4deg, #14181e 4deg 10deg);
  border-radius: 50%;
  position: relative;
  box-shadow: inset 0 0 0 5px #171b21;
}
.rate-knob:after {
  content: "";
  position: absolute;
  width: 2px;
  height: 10px;
  background: var(--amber);
  top: 3px;
  left: 15px;
  transform-origin: 1px 14px;
  transform: rotate(var(--rate-angle, 0deg));
}
#rate {
  font: 12px var(--mono);
  border: 0;
  height: 24px;
  min-width: 45px;
}
#highlights {
  display: flex;
  gap: 7px;
  margin: auto;
}
#highlights button,
#tour {
  font: 11px var(--display);
  height: 30px;
}
#tour {
  border-color: #ffb02050;
  color: var(--amber);
}
.footnote {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font: 8px var(--mono);
  color: #65707f;
  margin-top: 12px;
}
.footnote i {
  display: inline-block;
  width: 4px;
  height: 4px;
  background: var(--amber);
  border-radius: 50%;
  margin: 0 8px;
}
#playback-mode {
  letter-spacing: 0.08em;
}
.key-hint {
  color: #778292;
}
#graph-tools {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  height: 25px;
}
#graph-tools .section-label {
  margin: 0 7px 0 0;
}
#graph-tools select,
.layer-picker {
  font: 10px var(--display);
  height: 24px;
}
#graph-tools button {
  height: 24px;
  padding: 0 6px;
}
.graph-car {
  font: 600 11px var(--display);
  margin-left: 10px;
}
.graph-hint {
  margin-left: auto;
  font: 9px var(--mono);
  color: #65707f;
}
.graph-layer {
  position: relative;
  height: 48px;
}
.graph-layer canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}
.graph-scale {
  position: absolute;
  top: 2px;
  left: 3px;
  pointer-events: none;
  font: 8px var(--mono);
  color: #9ba6b5;
  background: #07090ca0;
  padding: 2px 4px;
}
.layer-picker {
  position: absolute;
  right: 28px;
  top: 2px;
  background: #0c1015;
}
.layer-close {
  position: absolute;
  right: 0;
  top: 2px;
  padding: 0 5px;
  height: 23px;
}
.graph-layer + .graph-layer {
  margin-top: 4px;
  border-top: 1px solid var(--line);
}
#loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.loading-mark {
  font: 500 30px var(--display);
  letter-spacing: 0.3em;
}
.spinner {
  width: 28px;
  height: 28px;
  border: 1px solid #ffb02025;
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
#loading strong {
  font: 12px var(--display);
  letter-spacing: 0.1em;
  color: #b9c2cd;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* Modal surfaces */
dialog,
#diagnostics {
  border: 1px solid #ffffff25;
  background: #0e1218ed;
  backdrop-filter: blur(20px);
  color: var(--text);
  border-radius: 4px;
  box-shadow: 0 30px 120px #000b;
}
dialog::backdrop {
  background: #020407ac;
  backdrop-filter: blur(5px);
}
#sessions {
  width: min(1080px, 94vw);
  max-height: 90vh;
  padding: 24px;
}
.modal-title,
.diag-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.modal-title h2 {
  font-size: 29px;
  font-weight: 500;
  margin-top: 7px;
}
.modal-title button,
.diag-title button {
  font-size: 24px;
  border: 0;
}
.archive-body {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
}
.archive-map {
  position: relative;
  min-width: 0;
}
.year-badge {
  font: 11px var(--mono);
  color: var(--amber);
}
#world-map {
  margin-top: 24px;
}
#world-map svg {
  width: 100%;
  height: auto;
}
#world-map button {
  position: absolute;
}
#session-list {
  height: 390px;
  overflow: auto;
  scrollbar-width: thin;
  border-left: 1px solid var(--line);
  padding-left: 15px;
}
#session-list button {
  width: 100%;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 12px;
  height: 45px;
  border: 0;
  border-bottom: 1px solid #ffffff08;
  font-size: 11px;
}
#session-list button span:first-child {
  color: #65707f;
  font-family: var(--mono);
}
#session-list button small {
  margin-left: auto;
  font: 9px var(--mono);
}
#session-detail {
  padding: 20px;
  border: 1px solid var(--line);
  margin-top: 12px;
}
#session-detail h3 {
  font: 500 25px var(--display);
  margin: 5px 0 12px;
}
#session-detail p {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}
#session-detail button {
  color: var(--amber);
  font-size: 11px;
}
.modal-note {
  font: 10px var(--mono);
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 24px;
}
#diagnostics {
  position: fixed;
  right: 24px;
  top: 86px;
  bottom: 230px;
  width: 460px;
  z-index: 8;
  overflow: auto;
  padding: 22px;
  font-size: 12px;
  line-height: 1.7;
}
#diagnostics h3 {
  font: 600 11px var(--display);
  color: var(--cyan);
  margin-top: 20px;
}
#diagnostics p {
  color: #a8b3c2;
}
#diagnostics a {
  color: var(--amber);
}
#diagnostics select {
  font-size: 11px;
}
/* Driver views share a single clock and render surface. */
#split-panes {
  position: absolute;
  left: 260px;
  right: 20px;
  top: 86px;
  bottom: 240px;
  display: flex;
  pointer-events: none;
}
.driver-pane {
  position: relative;
  flex: 1;
  border-left: 1px solid #ffffff25;
  padding: 16px;
  min-width: 0;
}
.driver-pane:first-child {
  border-left: 0;
}
.driver-pane select {
  pointer-events: auto;
  background: #0c1015d9;
  font: 600 14px var(--display);
  border-left: 3px solid var(--team);
  padding: 7px;
  width: 110px;
}
.pane-hud {
  position: absolute;
  bottom: 10px;
  left: 15px;
  right: 15px;
  background: #0b0e14b8;
  padding: 14px;
  border-bottom: 2px solid var(--team);
}
.pane-speed {
  font: 500 42px var(--mono);
}
.pane-hud small {
  font: 10px var(--mono);
}
.pane-state {
  font: 10px var(--mono);
  margin-top: 7px;
  color: #b4bfce;
}
.view-driver #telemetry,
.view-split #telemetry,
.view-driver #stage-caption,
.view-split #stage-caption,
.view-driver #cameras,
.view-split #cameras,
.view-driver #battle,
.view-split #battle,
.view-driver #labels,
.view-split #labels {
  display: none !important;
}
.view-driver .race-control,
.view-split .race-control {
  right: 24px;
}
@media (min-height: 950px) {
  #tower {
    max-height: calc(100vh - 320px);
  }
  .driver-row {
    height: 31px;
    min-height: 31px;
  }
  #instrument {
    width: 250px;
    height: 250px;
  }
  #telemetry {
    width: 298px;
  }
}
@media (max-height: 800px) {
  #instrument {
    width: 160px;
    height: 160px;
  }
  .gap-context {
    display: none;
  }
  #telemetry {
    padding: 12px 15px;
  }
  #data-status {
    margin-top: 7px;
  }
  .driver-row {
    height: 23px;
    min-height: 23px;
  }
  #tower {
    padding: 10px;
  }
  .speed > strong {
    font-size: 40px;
  }
  .pedals {
    margin-top: 10px;
  }
}
@media (max-width: 1150px) {
  header {
    gap: 9px;
    padding: 0 16px;
  }
  .brand b {
    display: none;
  }
  #session-picker strong span {
    display: none;
  }
  .race-status {
    gap: 10px;
  }
  #tower {
    left: 16px;
    width: 195px;
  }
  .driver-row {
    grid-template-columns: 17px 30px 1fr 17px 15px;
    gap: 3px;
  }
  #telemetry {
    right: 16px;
    width: 240px;
  }
  #instrument {
    width: 195px;
    height: 195px;
  }
  #stage-caption {
    left: 233px;
  }
  #cameras {
    right: 16px;
  }
  .race-control {
    left: 235px;
    right: 275px;
  }
  #highlights {
    gap: 4px;
  }
  #highlights button {
    padding: 0 7px;
  }
  #split-panes {
    left: 220px;
  }
  .key-hint {
    display: none;
  }
}
@media (max-width: 850px) {
  header {
    height: 64px;
    gap: 8px;
  }
  #session-picker {
    gap: 6px;
    padding: 0 6px;
  }
  #session-picker strong {
    font-size: 10px;
  }
  .circuit-icon {
    width: 31px;
  }
  .country-flag,
  .brand,
  #session-picker small,
  #elapsed {
    display: none;
  }
  .race-status {
    margin-left: auto;
  }
  #race-lap {
    font-size: 12px;
  }
  #flag {
    font-size: 8px;
    padding: 4px;
  }
  #geek span {
    display: none;
  }
  .view-tabs button {
    padding: 0 7px;
  }
  #tower {
    top: 76px;
    width: 158px;
    padding: 9px;
  }
  .driver-row {
    grid-template-columns: 16px 28px 1fr 16px;
    gap: 2px;
    font-size: 11px;
  }
  .tyre-age {
    display: none;
  }
  .driver-row .gap {
    font-size: 9px;
  }
  .tower-foot {
    flex-wrap: wrap;
    gap: 6px;
  }
  #telemetry {
    top: 76px;
    width: 200px;
    padding: 12px;
  }
  #instrument {
    width: 170px;
    height: 170px;
  }
  .driver-title {
    gap: 8px;
  }
  #driver-number {
    font-size: 26px;
  }
  .driver-title h2 {
    font-size: 16px;
  }
  .driver-title small {
    font-size: 8px;
  }
  .speed > strong {
    font-size: 37px;
  }
  .gap-context {
    display: none;
  }
  .driver-meta {
    font-size: 8px;
    flex-wrap: wrap;
  }
  #data-status {
    font-size: 8px;
  }
  #stage-caption {
    left: 195px;
    top: 87px;
  }
  #stage-caption h1 {
    font-size: 18px;
  }
  #stage-caption p {
    font-size: 9px;
  }
  #stage-caption .eyebrow {
    font-size: 8px;
  }
  #battle {
    display: none !important;
  }
  .race-control {
    left: 190px;
    right: 232px;
  }
  .race-control > span {
    display: none;
  }
  #highlights {
    overflow: auto;
    max-width: 42vw;
  }
  #highlights button {
    font-size: 9px;
  }
  .transport {
    gap: 9px;
  }
  footer {
    padding: 15px 16px 10px;
  }
  .graph-hint {
    display: none;
  }
  #graph-tools {
    gap: 5px;
  }
  #graph-tools select {
    max-width: 114px;
  }
  .rate-control {
    margin-left: 0;
  }
  .rate-knob {
    display: none;
  }
  #tour {
    font-size: 9px;
    padding: 0 7px;
  }
  .play-controls {
    gap: 3px;
  }
  #split-panes {
    left: 180px;
    top: 76px;
  }
  .pane-speed {
    font-size: 26px;
  }
  .driver-pane {
    padding: 8px;
  }
  .driver-pane select {
    font-size: 11px;
    width: 80px;
  }
  .pane-hud {
    left: 7px;
    right: 7px;
    padding: 9px;
  }
  .pane-state {
    font-size: 8px;
  }
  .archive-body {
    grid-template-columns: 1fr 210px;
  }
}
@media (max-width: 600px) {
  header {
    padding: 0 10px;
    gap: 5px;
    flex-wrap: wrap;
    align-content: center;
    height: 84px;
  }
  #session-picker {
    height: 33px;
  }
  #session-picker strong {
    font-size: 10px;
  }
  #race-lap {
    font-size: 11px;
  }
  .race-status {
    gap: 8px;
  }
  .view-tabs {
    order: 5;
    width: calc(100% - 85px);
    margin-top: 2px;
  }
  .view-tabs button {
    height: 24px;
    flex: 1;
  }
  #geek {
    order: 6;
    height: 24px;
    width: 38px;
    margin-top: 2px;
  }
  #info {
    order: 7;
    height: 24px;
    width: 32px;
    margin-top: 2px;
  }
  .race-status #elapsed {
    display: none;
  }
  #tower {
    left: 10px;
    top: 97px;
    width: 105px;
    max-height: calc(100dvh - 340px);
    padding: 6px;
  }
  .driver-row {
    grid-template-columns: 16px 28px 1fr;
    height: 26px;
    min-height: 26px;
  }
  .driver-row .gap {
    display: none;
  }
  .tower-foot {
    font-size: 8px;
  }
  .tower-foot button {
    font-size: 8px;
    padding: 0 2px;
    width: 100%;
  }
  #telemetry {
    top: 97px;
    right: 10px;
    width: 133px;
    padding: 10px;
  }
  #instrument,
  .rpm-line,
  .rpm-track,
  .driver-title small,
  #compound,
  .gear small {
    display: none;
  }
  .driver-title {
    gap: 6px;
  }
  #driver-number {
    font-size: 22px;
  }
  .driver-title h2 {
    font-size: 16px;
  }
  #telemetry .section-label {
    font-size: 7px;
    letter-spacing: 0.04em;
  }
  .speed {
    gap: 4px;
    margin-top: 12px;
  }
  .speed > strong {
    font-size: 29px;
  }
  .speed > span {
    font-size: 7px;
  }
  .gear b {
    font-size: 20px;
  }
  .pedals > div {
    gap: 4px;
  }
  .pedals span {
    font-size: 8px;
    width: 21px;
  }
  .pedals b {
    font-size: 8px;
    width: 25px;
  }
  .driver-meta {
    gap: 7px;
    margin-top: 10px;
  }
  #data-status {
    font-size: 7px;
  }
  #cameras {
    right: 10px;
    gap: 3px;
  }
  #cameras button {
    font-size: 13px;
    padding: 0 8px;
  }
  #cameras button span {
    display: none;
  }
  #stage-caption {
    left: 130px;
    right: 153px;
    top: 106px;
  }
  #stage-caption h1 {
    font-size: 12px;
    line-height: 1.5;
    letter-spacing: 0.08em;
  }
  #stage-caption p,
  #stage-caption .eyebrow,
  .stage-rule {
    display: none;
  }
  .race-control {
    display: none;
  }
  footer {
    padding: 12px 10px 9px;
  }
  .graph-layer {
    height: 38px;
  }
  #graph-tools {
    gap: 3px;
  }
  #graph-tools .section-label {
    display: none;
  }
  #graph-tools select {
    max-width: 90px;
    font-size: 9px;
  }
  #graph-third {
    display: none;
  }
  .graph-car {
    margin-left: 3px;
    font-size: 10px;
  }
  .transport {
    flex-wrap: wrap;
    justify-content: space-between;
    margin-top: 15px;
  }
  .play-controls {
    gap: 3px;
  }
  #highlights {
    order: 3;
    width: 100%;
    max-width: none;
    justify-content: center;
    margin-top: 2px;
  }
  #highlights button {
    height: 24px;
    flex: 1;
  }
  #play {
    width: 42px;
    height: 42px;
    font-size: 16px;
  }
  .play-controls > button:not(.primary) {
    width: 26px;
  }
  .footnote {
    font-size: 7px;
  }
  .footnote #playback-mode {
    display: none;
  }
  .timeline-row {
    gap: 5px;
    font-size: 8px;
  }
  #lap-ticks {
    margin-left: 47px;
    margin-right: 47px;
  }
  #split-panes {
    left: 120px;
    right: 5px;
    top: 97px;
    flex-direction: column;
  }
  .driver-pane {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 5px;
  }
  .driver-pane select {
    font-size: 9px;
    padding: 3px;
    height: 24px;
    width: 75px;
  }
  .pane-hud {
    left: auto;
    right: 4px;
    bottom: 4px;
    padding: 6px;
    width: 125px;
  }
  .pane-speed {
    font-size: 22px;
  }
  .pane-state {
    font-size: 7px;
    margin-top: 2px;
  }
  .pane-hud small {
    font-size: 8px;
  }
  .archive-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  #session-list {
    height: 170px;
    border-left: 0;
    padding-left: 0;
  }
  #sessions {
    padding: 18px;
  }
  .modal-title {
    margin-bottom: 14px;
  }
  .modal-title h2 {
    font-size: 24px;
  }
  #world-map {
    margin-top: 8px;
  }
  #session-detail {
    padding: 12px;
  }
  #session-detail h3 {
    font-size: 19px;
  }
  #diagnostics {
    inset: 90px 10px 20px;
    width: auto;
  }
  .modal-note {
    font-size: 9px;
  }
  #graph-tools #graph-third {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
}
/* Persistent, compact IR status and opt-in data inspection. */
.ir-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  min-width: 0;
}
.ir-strip button {
  border: 0;
  background: transparent;
  padding: 0;
  height: 22px;
  text-align: left;
  font:
    10px ui-monospace,
    monospace;
  color: #a9c6ba;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.ir-strip select {
  font-size: 10px;
  height: 22px;
  max-width: 170px;
}
.ir-strip > span {
  font:
    9px ui-monospace,
    monospace;
  color: #94a8a1;
  white-space: nowrap;
}
.ir-timeline-wrap {
  position: relative;
  flex: 1;
  height: 34px;
  min-width: 0;
}
.ir-timeline-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.ir-timeline-wrap #seek {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 34px;
  margin: 0;
  opacity: 0.65;
  background: transparent;
}
#ir-pane {
  background: #102026f5;
  border: 1px solid #38524b;
  border-radius: 8px;
  padding: 9px 12px;
  margin-bottom: 6px;
  font:
    10px ui-monospace,
    monospace;
  max-height: 42vh;
  overflow: auto;
}
.ir-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ir-tools strong {
  margin-right: auto;
}
.ir-tools select {
  font-size: 10px;
  max-width: 150px;
}
.ir-tools button {
  font-size: 12px;
  height: 23px;
  min-width: 25px;
  padding: 0 5px;
}
#ir-proof {
  font-size: 9px;
  color: #819e90;
  margin: 6px 0;
  overflow-wrap: anywhere;
}
.ir-local-wrap {
  position: relative;
  height: 85px;
}
#ir-local {
  width: 100%;
  height: 67px;
  display: block;
}
#ir-local-axis {
  font-size: 9px;
  color: #8fa79c;
}
#ir-evaluated {
  display: block;
  white-space: pre-wrap;
  color: #bbd8c9;
  font-size: 10px;
  line-height: 1.6;
  margin: 5px 0;
}
.ir-table-wrap {
  max-height: 150px;
  overflow: auto;
}
#ir-pane table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
#ir-pane th {
  font-size: 9px;
  color: #849c91;
  font-weight: 500;
  position: sticky;
  top: 0;
  background: #102026;
}
#ir-pane td {
  padding: 1px 5px;
}
#ir-pane td button {
  font:
    10px ui-monospace,
    monospace;
  height: 18px;
  min-height: 0;
  border: 0;
  background: transparent;
  padding: 0;
}
#ir-pane .ir-current {
  background: #25443a;
  color: #d4f6df;
}
#ir-pane .ir-next {
  background: #1c3037;
  color: #aed5ed;
}
@media (max-width: 600px) {
  .ir-strip {
    flex-wrap: wrap;
    gap: 3px;
  }
  .ir-strip button {
    flex-basis: 100%;
    font-size: 9px;
  }
  .ir-strip select {
    margin-left: auto;
  }
  .ir-tools {
    flex-wrap: wrap;
  }
  .ir-tools strong {
    font-size: 10px;
  }
  .ir-tools select {
    max-width: 110px;
  }
  #ir-pane {
    padding: 6px;
    max-height: 38vh;
  }
  #ir-evaluated {
    font-size: 9px;
  }
}
/* Inspection is opt-in; its graph stays within the modal. */
#ir-inspector {
  display: none;
}
body.geek-on #ir-inspector {
  display: block;
}
.ir-strip {
  margin: 8px 0 0;
}
.ir-strip button,
.ir-strip > span {
  color: var(--cyan);
  font-family: var(--mono);
}
.ir-strip select {
  display: none;
}
#ir-pane {
  position: fixed;
  z-index: 10;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: min(850px, 94vw);
  max-height: calc(100dvh - 130px);
  background: #0e1218f5;
  border: 1px solid #4fd1e84d;
  backdrop-filter: blur(18px);
  padding: 20px;
  box-shadow: 0 20px 100px #000d;
}
#ir-pane th {
  background: #0e1218;
}
#ir-pane .ir-current {
  background: #4fd1e817;
  color: var(--cyan);
}
#ir-pane .ir-next {
  background: #ffffff06;
}
#ir-proof,
#ir-local-axis {
  color: var(--muted);
}
#ir-evaluated {
  color: #b6d3db;
}
.ir-timeline-wrap {
  height: 16px;
}
.ir-timeline-wrap #seek {
  height: 16px;
  opacity: 1;
}
.ir-timeline-wrap #ir-timeline {
  display: none;
}
#ir-pane .ir-tools {
  flex-wrap: wrap;
}
#ir-pane .ir-tools strong {
  color: var(--cyan);
}
#tower {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#tower .section-label,
.tower-foot {
  flex-shrink: 0;
}
#drivers {
  overflow: auto;
  scrollbar-width: thin;
  min-height: 0;
}
.driver-row {
  height: var(--row-height, 26px);
  min-height: var(--row-height, 26px);
}
@media (max-height: 800px) and (min-width: 851px) {
  #instrument {
    height: 133px;
    width: 133px;
  }
  .driver-title {
    gap: 9px;
  }
  #telemetry {
    padding: 10px 15px;
  }
  .speed > strong {
    font-size: 37px;
  }
  .pedals {
    margin-top: 8px;
  }
  .pedals > div {
    margin-top: 8px;
  }
  .driver-meta {
    margin-top: 10px;
  }
  #data-status {
    margin-top: 7px;
    font-size: 8px;
  }
  #telemetry .section-label {
    margin-bottom: 8px;
  }
}
#diagnostics {
  margin: 0;
  left: auto;
}
#ir-pane {
  margin: 0;
  right: auto;
  bottom: auto;
}
#ir-pane::backdrop,
#diagnostics::backdrop {
  background: #020407ad;
  backdrop-filter: blur(4px);
}
@media (max-width: 600px) {
  #diagnostics {
    left: 10px;
  }
}
#telemetry {
  overflow: auto;
  scrollbar-width: thin;
}
#cameras {
  z-index: 4;
}
#cameras button {
  background: #0b1018ed;
}
@media (min-width: 851px) and (min-height: 801px) and (max-height: 1000px) {
  #instrument {
    width: 180px;
    height: 180px;
  }
  .gap-context {
    margin-top: 10px;
    padding-top: 8px;
    gap: 5px;
  }
}
@media (max-width: 600px) {
  #graph-tools #graph-third {
    display: block;
    max-width: 77px;
  }
  #graph-tools select {
    max-width: 87px;
  }
  #graph-tools {
    gap: 3px;
  }
  .graph-scale {
    font-size: 7px;
  }
}

/* Contact pattern adapted from manim-wasm; compact footer, native modal. */
.maker-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 10px auto 0;
  padding: 5px 10px;
  min-height: 28px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font: 10px var(--mono);
}
.maker-link span { color: var(--amber); }
.maker-link:hover { border-color: #ffb02050; }
#support-panel {
  width: min(480px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  overflow: auto;
  padding: 28px;
  border: 1px solid #ffffff26;
  border-radius: 14px;
  background: #0e1218;
  color: var(--text);
  box-shadow: 0 24px 80px #0008;
}
.contact-dialog::backdrop { background: #07090ccc; backdrop-filter: blur(5px); }
.support-heading { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.support-heading h2 { margin: 6px 0 0; font: 500 30px var(--display); }
#support-close { font-size: 24px; line-height: 1; min-width: 32px; }
#support-description { margin: 18px 0 24px; font: 13px/1.6 var(--display); color: var(--muted); }
#contact-form { display: grid; gap: 10px; }
#contact-form label { font: 13px var(--display); }
#contact-form label span { color: var(--muted); font-size: 11px; margin-left: 5px; }
#contact-form input, #contact-form textarea {
  width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid #ffffff26;
  border-radius: 5px; background: #07090c; color: #e8ecf1; font: 14px/1.5 var(--display);
}
#contact-form textarea { resize: vertical; min-height: 110px; max-height: 35dvh; }
#contact-email { margin-bottom: 7px; }
#contact-form .form-note, #contact-status { margin: 0; color: var(--muted); font: 11px/1.6 var(--mono); }
#contact-submit { height: auto; min-height: 42px; display: flex; justify-content: space-between; padding: 11px 12px; border-color: #ffb02070; color: var(--amber); }
#contact-status:empty { display: none; }
#contact-status[data-state="error"] { color: #ff8989; }
#contact-status[data-state="success"] { color: #8cd8bf; }
.contact-direct { display: grid; gap: 6px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #ffffff1a; font: 12px var(--display); color: var(--muted); }
.support-email { color: #e8ecf1; overflow-wrap: anywhere; }
.maker-profiles { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 20px; font: 12px var(--display); }
.maker-profiles a { color: var(--muted); text-decoration: none; }
.maker-profiles a:hover { color: var(--amber); }
@media (max-width: 600px) {
  #support-panel { padding: 20px; }
  .maker-link { margin-top: 6px; padding: 4px 6px; font-size: 9px; }
}

#contact-message:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
