:root {
  color-scheme: dark;
  --bg: #080a0c;
  --surface: #101316;
  --surface-2: #171b1f;
  --line: #2a3036;
  --line-soft: #1d2227;
  --text: #f4f4f0;
  --muted: #939ba3;
  --red: #ff3547;
  --red-dark: #c7192d;
  --lime: #c9ff3f;
  --shadow: 0 24px 80px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 85% 0%, rgba(255, 53, 71, .11), transparent 24rem),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 64px 64px, auto;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

button, select, input { font: inherit; }
button, select { color: inherit; }
button { cursor: pointer; }
.is-hidden { display: none !important; }
.sr-only {
  width: 1px;
  height: 1px;
  position: absolute;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.site-header {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 68px);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(8, 10, 12, .82);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -.04em;
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark { width: 30px; display: grid; gap: 3px; transform: skewX(-18deg); }
.brand-mark i { display: block; height: 4px; background: var(--red); }
.brand-mark i:nth-child(2) { width: 75%; }
.brand-mark i:nth-child(3) { width: 48%; }

.status-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.status-chip:hover { color: var(--text); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #ffb13b; box-shadow: 0 0 16px currentColor; }
.status-chip.online .status-dot { background: #64e58b; }
.status-chip.offline .status-dot { background: var(--red); }

main { max-width: 1580px; margin: auto; padding: 0 clamp(20px, 4vw, 68px) 100px; }
.hero { padding: clamp(70px, 10vw, 150px) 0 clamp(60px, 8vw, 110px); max-width: 1050px; }
.eyebrow, .step-label {
  margin: 0 0 12px;
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .19em;
}
.hero h1 {
  margin: 0;
  font-size: clamp(52px, 8.4vw, 126px);
  line-height: .86;
  letter-spacing: -.075em;
  text-transform: uppercase;
  font-weight: 950;
}
.hero h1 em { color: transparent; -webkit-text-stroke: 1px #666d73; font-style: italic; }
.hero-copy { color: var(--muted); max-width: 620px; font-size: clamp(16px, 2vw, 20px); margin: 34px 0 0; }

.session-finder { border-top: 1px solid var(--line); padding: 32px 0 52px; }
.section-heading, .panel-heading, .telemetry-heading, .session-banner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}
h2, h3, p { margin-top: 0; }
.section-heading h2, .panel-heading h2, .telemetry-heading h2, .session-banner h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 38px);
  letter-spacing: -.045em;
}
.finder-hint { color: var(--muted); font-size: 13px; max-width: 360px; text-align: right; margin: 0; }
.finder-grid { display: grid; grid-template-columns: .55fr 1.6fr 1fr auto; gap: 12px; margin-top: 30px; }
label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
select {
  appearance: none;
  width: 100%;
  min-height: 54px;
  margin-top: 8px;
  padding: 0 38px 0 16px;
  background-color: var(--surface);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px;
  border: 1px solid var(--line);
  border-radius: 2px;
  outline: none;
}
select:focus, button:focus-visible, input:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.primary-button {
  align-self: end;
  min-height: 54px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  border: 0;
  border-radius: 2px;
  background: var(--red);
  color: #fff;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .04em;
  transition: background .2s, transform .2s;
}
.primary-button:hover:not(:disabled) { background: #ff5261; transform: translateY(-1px); }
.primary-button:disabled { cursor: not-allowed; opacity: .35; }
.inline-message { min-height: 20px; margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.inline-message.error { color: #ff8791; }

.workspace { border-top: 1px solid var(--line); padding-top: 44px; scroll-margin-top: 86px; }
.session-banner { padding-bottom: 34px; align-items: center; }
.session-banner > div:first-child { align-self: center; min-width: 280px; }
.session-banner h2 { font-size: clamp(34px, 5vw, 66px); text-transform: uppercase; }
.session-banner p:last-child { color: var(--muted); margin: 8px 0 0; }
.session-stats { width: min(770px, 62vw); display: grid; grid-template-columns: minmax(350px, 1.2fr) minmax(280px, .8fr); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.session-insight { min-width: 0; padding: 17px 18px; background: var(--surface); }
.weather-insight { --weather-accent: #ee9a3d; background: linear-gradient(110deg, color-mix(in srgb, var(--weather-accent) 9%, var(--surface)) 0%, var(--surface) 58%); box-shadow: inset 2px 0 var(--weather-accent); }
.weather-insight.is-wet { --weather-accent: #4ca9ff; }
.insight-heading { display: flex; align-items: center; gap: 12px; }
.insight-heading > span:last-child { min-width: 0; }
.insight-heading small, .insight-heading strong { display: block; }
.insight-heading small { margin-bottom: 3px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.insight-heading strong { font-size: 14px; letter-spacing: -.01em; }
.weather-icon, .tyre-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-2); }
.weather-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.weather-icon.is-wet { color: #4ca9ff; }
.weather-icon.is-dry { color: #ee9a3d; }
.weather-insight .weather-icon { border-color: color-mix(in srgb, var(--weather-accent) 34%, var(--line)); background: color-mix(in srgb, var(--weather-accent) 8%, var(--surface-2)); }
.weather-metrics { display: grid; grid-template-columns: repeat(5, minmax(50px, 1fr)); gap: 8px; margin-top: 16px; }
.weather-metrics span { min-width: 0; }
.weather-metrics strong, .weather-metrics small { display: block; white-space: nowrap; }
.weather-metrics strong { font-size: 11px; }
.weather-metrics small { margin-top: 2px; color: var(--muted); font-size: 7px; letter-spacing: .08em; text-transform: uppercase; }
.session-insight.is-unavailable p, .tyre-message { margin: 14px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.tyre-icon { position: relative; }
.tyre-icon::before, .tyre-icon::after, .tyre-icon i { content: ""; position: absolute; border: 2px solid #d9dde0; border-radius: 50%; }
.tyre-icon::before { width: 22px; height: 22px; }
.tyre-icon::after { width: 14px; height: 14px; border-color: #737b82; }
.tyre-icon i { width: 5px; height: 5px; border: 0; background: #737b82; }
.tyre-allocation { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 13px; }
.tyre-pill { min-width: 0; display: grid; grid-template-columns: 13px minmax(0, 1fr); align-items: center; column-gap: 6px; padding: 7px; border: 1px solid var(--line-soft); background: var(--surface-2); }
.tyre-pill i { width: 12px; height: 12px; grid-row: 1 / 3; border: 3px solid var(--tyre-color); border-radius: 50%; box-shadow: 0 0 9px color-mix(in srgb, var(--tyre-color) 24%, transparent); }
.tyre-pill strong, .tyre-pill small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tyre-pill strong { font-size: 10px; }
.tyre-pill small { color: var(--muted); font-size: 7px; text-transform: uppercase; }
.session-compounds { margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--line-soft); color: var(--muted); }
.session-compounds > small { display: block; margin-bottom: 5px; font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.session-compounds > span { color: #b8c0c7; font-size: 10px; line-height: 1.6; }
.session-compounds i { width: 7px; height: 7px; display: inline-block; margin-right: 4px; border-radius: 50%; background: var(--tyre-color); vertical-align: 1px; }

.comparison-layout { border-top: 1px solid var(--line); }
.driver-panel { padding: 34px 0 36px; border-bottom: 1px solid var(--line); }
.panel-heading { align-items: flex-start; }
.panel-heading h2 { font-size: 28px; }
#selection-count { color: var(--muted); font-size: 12px; }
.driver-list { margin: 26px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2px; max-height: 330px; overflow-y: auto; padding-right: 8px; }
.driver-option {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 12px 10px;
  display: grid;
  grid-template-columns: 28px 46px 1fr auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  color: var(--text);
}
.driver-option:hover { background: var(--surface); }
.driver-option.selected { background: var(--surface-2); border-color: var(--line); }
.driver-stripe { width: 28px; height: 0; border-top: 3px solid var(--driver-color); }
.driver-stripe.dashed { border-top-style: dashed; }
.driver-code { font-size: 18px; font-weight: 950; font-style: italic; }
.driver-name { min-width: 0; }
.driver-name strong, .driver-name small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.driver-name strong { font-size: 13px; }
.driver-name small, .driver-best { color: var(--muted); font-size: 10px; }
.driver-best { text-align: right; }
.driver-best strong { color: var(--text); display: block; font-size: 12px; }
.selected-laps { display: grid; grid-template-columns: 150px minmax(0, 1fr) 250px; align-items: end; gap: 22px; border-top: 1px solid var(--line); padding-top: 22px; margin-top: 24px; }
.selected-laps h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 5px; }
.selected-laps-heading p { color: var(--muted); font-size: 10px; margin: 0; }
#lap-selectors { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 10px; }
.lap-selector { display: grid; grid-template-columns: 68px minmax(190px, 1fr); align-items: center; gap: 10px; margin-bottom: 10px; }
.lap-selector-driver { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lap-selector-driver .series-swatch { width: 24px; }
.lap-selector strong { font-style: italic; }
.lap-picker { position: relative; min-width: 0; }
.lap-picker-trigger { width: 100%; min-height: 42px; display: grid; grid-template-columns: minmax(0, 1fr) auto 10px; align-items: center; gap: 10px; padding: 0 13px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); text-align: left; }
.lap-picker-trigger > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.lap-picker-trigger > span small, .lap-picker-option > span small { margin-left: 8px; color: var(--red); font-size: 7px; font-style: normal; font-weight: 850; letter-spacing: .08em; white-space: nowrap; }
.lap-picker-trigger > strong, .lap-picker-option > strong { color: var(--tyre-color); font-size: 12px; font-style: normal; font-variant-numeric: tabular-nums; }
.lap-picker-trigger > i { width: 7px; height: 7px; border-right: 1px solid var(--muted); border-bottom: 1px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .16s; }
.lap-picker.is-open .lap-picker-trigger { border-color: #596169; }
.lap-picker.is-open .lap-picker-trigger > i { transform: rotate(225deg) translate(-2px, -1px); }
.lap-picker-menu { width: 100%; max-height: 280px; display: none; position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; overflow-y: auto; border: 1px solid #4a535c; background: var(--surface); box-shadow: 0 18px 42px rgba(0, 0, 0, .48); }
.lap-picker.is-open .lap-picker-menu { display: block; }
.lap-picker-option { width: 100%; min-height: 38px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 0 13px; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; color: var(--muted); text-align: left; }
.lap-picker-option:last-child { border-bottom: 0; }
.lap-picker-option:hover, .lap-picker-option.selected { background: var(--surface-2); color: var(--text); }
.lap-picker-option.selected { box-shadow: inset 2px 0 var(--driver-color); }
.lap-picker-option.unavailable { opacity: .48; cursor: not-allowed; }
.lap-picker-option.unavailable > strong { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.lap-picker-option > span { min-width: 0; display: flex; align-items: center; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.selection-actions { min-width: 0; }
.compare-button { width: 100%; min-height: 42px; margin: 0; padding-inline: 13px; gap: 12px; font-size: 12px; }
.compare-button > span:first-child { white-space: nowrap; }
.selection-actions .inline-message { margin: 10px 0 -20px; }

.telemetry-panel { min-width: 0; padding: 34px 0 60px; }
.telemetry-panel.empty { min-height: 670px; display: grid; place-items: center; }
.empty-telemetry { text-align: center; color: var(--muted); max-width: 430px; }
.empty-telemetry h2 { color: var(--text); font-size: 34px; margin-bottom: 10px; }
.empty-orbit { width: 120px; height: 120px; border: 1px solid var(--line); border-radius: 50%; margin: 0 auto 30px; display: grid; place-items: center; transform: rotate(-22deg); }
.empty-orbit::before, .empty-orbit::after { content: ""; position: absolute; border: 1px solid var(--line); border-radius: 50%; }
.empty-orbit::before { width: 80px; height: 80px; }
.empty-orbit::after { width: 46px; height: 46px; }
.empty-orbit span { width: 8px; height: 8px; background: var(--red); border-radius: 50%; transform: translate(56px); box-shadow: 0 0 18px var(--red); }
.telemetry-heading { align-items: flex-start; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; justify-content: flex-end; }
.legend-item { font-size: 11px; color: var(--muted); display: flex; gap: 7px; align-items: center; }
.legend-item i { width: 20px; height: 0; border-top: 3px solid var(--driver-color); }
.legend-item i.dashed { border-top-style: dashed; }
.lap-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--line); margin: 30px 0; border: 1px solid var(--line); }
.lap-card { background: var(--surface); padding: 16px; border-top: 3px solid var(--driver-color); }
.lap-card.dashed { border-top-style: dashed; }
.lap-card-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.lap-driver-key { display: flex; align-items: center; gap: 8px; }
.series-swatch { width: 25px; height: 0; border-top: 3px solid var(--driver-color); flex: 0 0 auto; }
.series-swatch.dashed { border-top-style: dashed; }
.lap-card strong { font-size: 24px; letter-spacing: -.04em; display: block; margin: 8px 0 10px; }
.sectors { display: flex; gap: 12px; color: var(--muted); font-size: 10px; }
.telemetry-workbench { display: grid; grid-template-columns: minmax(370px, 430px) minmax(0, 1fr); align-items: start; gap: 24px; }
.replay-dock { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow-y: auto; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); scrollbar-color: var(--line) var(--surface); scrollbar-width: thin; }
.track-stage, .live-stage { background: var(--surface); padding: 18px; min-width: 0; }
.chart-title { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.chart-title-actions { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.chart-reset { min-height: 24px; padding: 0 7px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.chart-reset:hover { border-color: #4a535c; background: var(--surface-2); color: var(--text); }
.track-toolbar { align-items: center; flex-wrap: wrap; }
.track-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.track-action { min-height: 28px; padding: 0 9px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.track-action:hover:not(:disabled) { color: var(--text); border-color: #4a535c; }
.track-action[aria-pressed="true"] { color: #fff; background: var(--red); border-color: var(--red); }
.track-action:disabled { cursor: not-allowed; opacity: .45; }
#track-canvas { width: 100%; height: clamp(270px, 36vh, 340px); display: block; }
.live-readout { margin-top: 20px; }
.live-driver { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 58px; border-bottom: 1px solid var(--line-soft); background: transparent; color: var(--text); align-items: stretch; }
.live-driver:hover, .live-driver.is-follow-target { background: var(--surface-2); }
.live-driver.is-follow-target { box-shadow: inset 2px 0 var(--driver-color); }
.live-driver-main { min-width: 0; display: grid; grid-template-columns: 25px 58px minmax(0, 1fr); gap: 8px; padding: 13px 8px; border: 0; background: transparent; color: var(--text); align-items: center; text-align: left; }
.live-driver-main > i { width: 25px; height: 0; border-top: 3px solid var(--driver-color); }
.live-driver-main > i.dashed { border-top-style: dashed; }
.live-driver-main > strong { min-width: 0; font-style: italic; }
.live-driver-main > strong small { width: max-content; display: block; margin-top: 4px; margin-left: -8px; color: var(--muted); font-size: 7px; font-style: normal; letter-spacing: .07em; white-space: nowrap; }
.driver-chart-toggle { min-width: 0; padding: 8px 6px; display: grid; place-content: center; gap: 6px; border: 0; border-left: 1px solid var(--line-soft); background: transparent; color: var(--muted); text-align: center; }
.driver-chart-toggle:hover { background: rgba(255, 255, 255, .035); color: var(--text); }
.driver-chart-toggle[aria-pressed="false"] { opacity: .42; }
.visibility-line { width: 26px; height: 0; margin: auto; border-top: 2px solid var(--driver-color); }
.visibility-line.dashed { border-top-style: dashed; }
.driver-chart-toggle > span { font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.driver-chart-toggle small { display: block; margin-top: 2px; font-size: 7px; color: inherit; }
.input-grid { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.input-grid span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.input-grid b { display: block; color: var(--text); font-size: 12px; margin-top: 2px; }
.replay-controls { display: grid; grid-template-columns: 44px minmax(0, 1fr) 136px; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); }
.icon-button { width: 44px; height: 44px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); }
.scrubber-label { display: none; }
input[type="range"] { accent-color: var(--red); width: 100%; }
.replay-controls select { min-width: 136px; min-height: 42px; margin: 0; padding-left: 12px; padding-right: 36px; font-size: 11px; }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.chart-block { grid-column: 1 / -1; background: var(--surface); padding: 18px; min-width: 0; }
.chart-block.chart-half { grid-column: span 1; }
.chart-block canvas { width: 100%; height: 210px; display: block; margin-top: 10px; cursor: crosshair; touch-action: none; }
.chart-block canvas.is-brushing { cursor: col-resize; }
.chart-half canvas { height: 160px; }
.chart-note { color: var(--muted); font-size: 11px; margin: 4px 0 0 48px; }
.telemetry-data { grid-column: 1 / -1; background: var(--surface); padding: 18px; }
.telemetry-data summary { width: fit-content; color: var(--text); cursor: pointer; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.telemetry-data-scroll { margin-top: 16px; overflow-x: auto; border: 1px solid var(--line); }
.telemetry-data table { width: 100%; min-width: 920px; border-collapse: collapse; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.telemetry-data caption { padding: 12px; color: var(--text); text-align: left; font-weight: 700; }
.telemetry-data th, .telemetry-data td { padding: 9px 11px; border-top: 1px solid var(--line-soft); text-align: left; white-space: nowrap; }
.telemetry-data th { color: var(--text); background: var(--surface-2); text-transform: uppercase; letter-spacing: .06em; }

.replay-fullscreen-open { overflow: hidden; }
.replay-dock:is(:fullscreen, .is-fullscreen) {
  width: 100%;
  height: 100%;
  max-height: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  grid-template-columns: minmax(300px, 370px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) 70px;
  background: var(--line);
  border: 0;
}
.replay-dock:is(:fullscreen, .is-fullscreen) .live-stage { grid-column: 1; grid-row: 1 / 3; overflow-y: auto; }
.replay-dock:is(:fullscreen, .is-fullscreen) .track-stage { grid-column: 2; grid-row: 1; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); padding: 24px; }
.replay-dock:is(:fullscreen, .is-fullscreen) #track-canvas { height: 100%; min-height: 0; }
.replay-dock:is(:fullscreen, .is-fullscreen) .replay-controls { grid-column: 2; grid-row: 2; padding: 12px 24px; }
.replay-dock:is(:fullscreen, .is-fullscreen) .track-toolbar { padding-bottom: 8px; }

.loading-layer { position: fixed; inset: 0; z-index: 50; background: rgba(5, 7, 8, .78); backdrop-filter: blur(14px); display: grid; place-items: center; padding: 20px; }
.loading-card { width: min(460px, 100%); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 36px; }
.loading-card h2 { font-size: 32px; margin-bottom: 10px; }
.loading-card > p:last-child { color: var(--muted); margin: 0; }
.loading-lines { height: 42px; display: flex; gap: 6px; align-items: flex-end; margin-bottom: 28px; }
.loading-lines i { width: 6px; background: var(--red); animation: pulse .8s ease-in-out infinite alternate; }
.loading-lines i:nth-child(1) { height: 40%; }
.loading-lines i:nth-child(2) { height: 100%; animation-delay: .12s; }
.loading-lines i:nth-child(3) { height: 66%; animation-delay: .24s; }
.loading-lines i:nth-child(4) { height: 28%; animation-delay: .36s; }
@keyframes pulse { to { height: 18%; opacity: .4; } }

footer { border-top: 1px solid var(--line-soft); padding: 28px clamp(20px, 4vw, 68px); display: flex; justify-content: space-between; gap: 24px; color: var(--muted); font-size: 10px; letter-spacing: .1em; }
footer a, .text-link, .info-page a { color: var(--text); text-underline-offset: 3px; }
.footer-links { text-align: right; }

.info-page { width: min(900px, 100%); margin-inline: auto; padding-top: clamp(70px, 10vw, 140px); }
.info-page h1, .not-found-page h1 { max-width: 850px; margin: 20px 0 28px; font-size: clamp(48px, 8vw, 92px); line-height: .94; letter-spacing: -.065em; }
.info-lead { max-width: 760px; color: var(--muted); font-size: clamp(18px, 2.4vw, 24px); line-height: 1.55; }
.info-page section { max-width: 760px; margin-top: 46px; padding-top: 28px; border-top: 1px solid var(--line); }
.info-page section h2 { margin: 0 0 12px; font-size: 24px; }
.info-page section p { margin: 0; color: var(--muted); line-height: 1.75; }
.info-updated { margin-top: 48px; color: var(--muted); }
.not-found-page { min-height: calc(100vh - 76px); display: grid; align-content: center; justify-items: start; }
.not-found-page > p:not(.eyebrow) { max-width: 620px; margin: 0 0 30px; color: var(--muted); font-size: 18px; line-height: 1.6; }
.not-found-page .primary-button { width: min(300px, 100%); text-decoration: none; }

@media (max-width: 1350px) {
  .session-banner { flex-direction: column; align-items: stretch; }
  .session-banner > div:first-child { align-self: auto; }
  .session-stats { width: 100%; }
}

@media (max-width: 1180px) {
  .finder-grid { grid-template-columns: 1fr 2fr; }
  .telemetry-workbench { grid-template-columns: 350px minmax(0, 1fr); gap: 18px; }
  #track-canvas { height: clamp(250px, 34vh, 310px); }
  .input-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-block.chart-half { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .selected-laps { grid-template-columns: 130px minmax(0, 1fr); }
  .selection-actions { grid-column: 2; }
  .telemetry-workbench { grid-template-columns: 1fr; }
  .replay-dock { position: relative; top: auto; max-height: none; overflow: visible; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); }
  .track-stage { grid-row: 1 / 3; }
  .input-grid { grid-template-columns: repeat(3, 1fr); }
  #track-canvas { height: 330px; }
  .chart-block.chart-half { grid-column: span 1; }
}

@media (max-width: 760px) {
  .site-header { height: 64px; }
  .hero { padding-top: 70px; }
  .section-heading, .session-banner, .telemetry-heading { align-items: flex-start; flex-direction: column; }
  .finder-hint { text-align: left; }
  .finder-grid { grid-template-columns: 1fr; }
  .driver-panel { padding-right: 0; }
  .driver-list { max-height: 440px; }
  .selected-laps { grid-template-columns: 1fr; }
  .session-stats { grid-template-columns: 1fr; }
  .weather-metrics { grid-template-columns: repeat(3, minmax(60px, 1fr)); }
  .selection-actions { grid-column: auto; }
  .replay-dock { grid-template-columns: 1fr; }
  .track-stage { grid-row: auto; }
  .replay-controls { grid-template-columns: 48px 1fr 110px; }
  .charts { grid-template-columns: 1fr; }
  .chart-block.chart-half { grid-column: 1 / -1; }
  footer { flex-direction: column; gap: 10px; }
  .replay-dock:is(:fullscreen, .is-fullscreen) { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) 70px minmax(190px, .55fr); overflow-y: auto; }
  .replay-dock:is(:fullscreen, .is-fullscreen) .track-stage { grid-column: 1; grid-row: 1; }
  .replay-dock:is(:fullscreen, .is-fullscreen) .replay-controls { grid-column: 1; grid-row: 2; }
  .replay-dock:is(:fullscreen, .is-fullscreen) .live-stage { grid-column: 1; grid-row: 3; }
}

@media (max-width: 440px) {
  .status-chip { font-size: 0; }
  .status-dot { width: 8px; height: 8px; }
  .hero h1 { font-size: 48px; }
  .session-insight { padding: 15px; }
  .weather-metrics { grid-template-columns: repeat(2, minmax(70px, 1fr)); }
  .tyre-allocation { grid-template-columns: 1fr; }
  .lap-selector { grid-template-columns: 58px minmax(0, 1fr); gap: 6px; }
  .live-driver { grid-template-columns: minmax(0, 1fr) 52px; }
  .live-driver-main { grid-template-columns: 22px 50px minmax(0, 1fr); gap: 6px; padding-inline: 6px; }
  .live-driver-main > i { width: 22px; }
  .input-grid { grid-template-columns: repeat(2, 1fr); }
  .replay-controls { grid-template-columns: 44px 1fr; }
  .replay-controls select { grid-column: 2; }
  .chart-title-actions { gap: 6px; flex-wrap: wrap; }
  #track-canvas { height: 270px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
