:root {
  color-scheme: dark;
  --bg: #061117;
  --panel: #0a1a21;
  --panel-2: #0d2028;
  --panel-3: #112832;
  --line: rgba(221, 239, 235, 0.12);
  --line-strong: rgba(221, 239, 235, 0.23);
  --text: #edf4f0;
  --muted: #91a6a6;
  --faint: #5f7779;
  --paper: #f0eee5;
  --ink: #122127;
  --orange: #ff6c43;
  --orange-soft: #ffb199;
  --acid: #c6f36b;
  --teal: #4ed4bd;
  --blue: #71a7ff;
  --danger: #ff8b76;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
  --radius: 12px;
  --font-sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 72% -10%, rgba(44, 107, 112, 0.14), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: min(1900px, 100%);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 74px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 17, 23, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 238px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  color: var(--acid);
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.brand strong,
.brand small,
.event-lockup strong,
.event-lockup small,
.live-clock strong,
.live-clock small {
  display: block;
}

.brand strong {
  font-size: 14px;
  letter-spacing: 0.19em;
}

.brand small,
.event-lockup small,
.live-clock small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.event-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 26px;
  border-left: 1px solid var(--line);
}

.event-lockup strong {
  font-size: 12px;
  font-weight: 700;
}

.event-index {
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: 13px;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 19px;
}

.unit-switch {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.unit-switch span {
  padding: 6px 8px;
  color: var(--faint);
  font: 500 9px var(--font-mono);
  border-radius: 4px;
}

.unit-switch span:first-child {
  color: var(--ink);
  background: var(--acid);
}

.unit-switch.aviation span:first-child {
  color: var(--faint);
  background: transparent;
}

.unit-switch.aviation span:last-child {
  color: var(--ink);
  background: var(--acid);
}

.live-clock {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 116px;
}

.live-clock strong {
  font: 600 10px var(--font-mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 0 5px rgba(198, 243, 107, 0.1);
  animation: live-pulse 2.2s infinite;
}

.live-clock.stale .live-dot {
  background: var(--orange);
  box-shadow: none;
  animation: none;
}

@keyframes live-pulse {
  50% { box-shadow: 0 0 0 9px rgba(198, 243, 107, 0); }
}

.official-link {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: #dbe7e3;
  font-size: 11px;
  font-weight: 600;
  transition: border-color 160ms ease, background 160ms ease;
}

.official-link:hover {
  border-color: var(--acid);
  background: rgba(198, 243, 107, 0.05);
}

.official-link svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}

.source-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 26px;
  color: #1e2728;
  background: #f2b75c;
  font-size: 11px;
  font-weight: 600;
}

.source-alert[hidden] {
  display: none;
}

.source-alert svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}

.source-alert button {
  margin-left: auto;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 21px;
  cursor: pointer;
}

.race-grid {
  display: grid;
  grid-template-columns: 270px minmax(590px, 1fr) 318px;
  grid-template-rows: minmax(0, 1fr);
  height: clamp(640px, calc(100vh - 112px), 760px);
  min-height: 640px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.panel {
  min-width: 0;
  background: var(--panel);
}

.teams-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
}

.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.teams-heading {
  padding: 21px 18px 14px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font: 600 9px var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

.teams-heading h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1;
}

.team-count {
  min-width: 32px;
  padding: 4px 7px;
  color: var(--acid);
  border: 1px solid rgba(198, 243, 107, 0.25);
  border-radius: 5px;
  font: 600 10px var(--font-mono);
  text-align: center;
}

.team-search {
  position: relative;
  display: block;
  margin: 0 14px 11px;
}

.team-search svg {
  position: absolute;
  top: 10px;
  left: 11px;
  width: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.4;
}

.team-search input {
  width: 100%;
  height: 37px;
  padding: 0 10px 0 36px;
  outline: 0;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 11px;
}

.team-search input:focus {
  border-color: rgba(198, 243, 107, 0.55);
}

.team-search input::placeholder {
  color: var(--faint);
}

.segmented {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  background: rgba(4, 13, 17, 0.58);
}

.segmented button {
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.segmented button.active {
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.segmented.compact {
  width: fit-content;
}

.segmented.compact button {
  padding: 5px 9px;
  font: 500 9px var(--font-mono);
}

#teamFilter {
  margin: 0 14px 10px;
}

.team-list {
  flex: 1;
  min-height: 0;
  padding: 0 8px 10px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.team-row {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}

.team-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.team-row.primary {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.055);
}

.rank-num {
  color: var(--faint);
  font: 500 10px var(--font-mono);
}

.team-row.primary .rank-num {
  color: var(--acid);
}

.team-row__main {
  min-width: 0;
}

.team-row__title,
.team-row__meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.team-row__title strong {
  font: 600 11px var(--font-mono);
}

.team-row__title i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--team-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--team-color) 18%, transparent);
}

.team-row__title .landed-label {
  color: var(--faint);
  font: 500 8px var(--font-mono);
  text-transform: uppercase;
}

.team-row__meta {
  margin-top: 5px;
  color: var(--muted);
  font: 400 8px var(--font-mono);
}

.team-row__meta span + span::before {
  content: "·";
  margin-right: 6px;
  color: var(--faint);
}

.compare-toggle {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.compare-toggle::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: transparent;
}

.team-row.compared .compare-toggle {
  border-color: var(--team-color);
}

.team-row.compared .compare-toggle::after {
  background: var(--team-color);
}

.team-skeleton {
  height: 47px;
  margin: 6px;
  border-radius: 7px;
  background: linear-gradient(100deg, rgba(255,255,255,.025), rgba(255,255,255,.065), rgba(255,255,255,.025));
  background-size: 200% 100%;
  animation: skeleton 1.6s infinite;
}

.empty-list {
  padding: 18px 12px;
  color: var(--faint);
  font: 400 9px/1.5 var(--font-mono);
  text-align: center;
}

@keyframes skeleton {
  to { background-position: -200% 0; }
}

.compare-dock {
  min-height: 64px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: #09171d;
}

.compare-dock strong,
.compare-dock span {
  display: block;
}

.compare-dock strong {
  font-size: 10px;
}

.compare-dock span {
  margin-top: 3px;
  color: var(--faint);
  font: 400 8px var(--font-mono);
}

.compare-dock > button {
  grid-column: 2;
  grid-row: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 500 8px var(--font-mono);
  cursor: pointer;
}

.compare-swatches {
  grid-column: 1 / -1;
  display: flex;
  gap: 5px;
  height: 4px;
}

.compare-swatches i {
  flex: 1;
  max-width: 46px;
  height: 3px;
  border-radius: 2px;
  background: var(--swatch);
}

.flight-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 82px;
  min-height: 0;
  background: #07151c;
}

.flight-stage {
  position: relative;
  min-height: 555px;
  overflow: hidden;
  background: #0b1a21;
}

.map-view,
.wind-vector-overlay,
.three-view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.wind-raster-source {
  position: absolute;
  width: 720px;
  height: 720px;
  visibility: hidden;
  pointer-events: none;
}

.wind-vector-overlay {
  z-index: 3;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.three-view {
  display: none;
  background:
    radial-gradient(circle at 48% 34%, rgba(39, 81, 91, 0.36), transparent 36%),
    linear-gradient(180deg, #07151b 0%, #0a2028 100%);
  cursor: grab;
  touch-action: none;
}

.three-view:active {
  cursor: grabbing;
}

.flight-stage.mode-3d .map-view {
  display: none;
}

.flight-stage.mode-3d .three-view {
  display: block;
}

.flight-stage.mode-3d .wind-vector-overlay,
.flight-stage.mode-3d .wind-controls,
.flight-stage.mode-3d .wind-map-legend,
.flight-stage.mode-3d .leader-ring-readout,
.flight-stage.mode-3d .map-key {
  opacity: 0;
  pointer-events: none;
}

.flight-stage.mode-3d .three-presets {
  display: flex;
}

.map-loading {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: #07151c;
  transition: opacity 300ms ease, visibility 300ms ease;
}

.map-loading.ready {
  opacity: 0;
  visibility: hidden;
}

.map-loading strong {
  font-size: 12px;
}

.map-loading small {
  color: var(--muted);
  font: 400 9px var(--font-mono);
}

.loading-orbit {
  width: 35px;
  height: 35px;
  margin-bottom: 7px;
  border: 1px solid rgba(198, 243, 107, 0.18);
  border-top-color: var(--acid);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.map-title {
  position: absolute;
  z-index: 5;
  top: 22px;
  left: 24px;
  max-width: 310px;
  pointer-events: none;
  text-shadow: 0 2px 12px #061117;
}

.map-title h2 {
  margin: 0 0 4px;
  font-size: 21px;
  letter-spacing: -0.025em;
}

.map-title > span {
  color: #b8cac7;
  font: 400 9px var(--font-mono);
}

.view-switch {
  position: absolute;
  z-index: 5;
  top: 20px;
  right: 22px;
}

.three-presets {
  position: absolute;
  z-index: 6;
  top: 66px;
  right: 64px;
  display: none;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: rgba(6, 17, 23, 0.82);
  backdrop-filter: blur(10px);
}

.three-presets button {
  padding: 6px 8px;
  font: 500 8px var(--font-mono);
}

.three-presets button.active {
  background: rgba(198, 243, 107, 0.14);
  color: var(--acid);
}

.wind-controls {
  position: absolute;
  z-index: 6;
  top: 82px;
  left: 24px;
  display: flex;
  align-items: stretch;
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(6, 17, 23, 0.84);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(11px);
  transition: opacity 180ms ease;
}

.wind-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px 0 0 5px;
  background: transparent;
  color: var(--muted);
  font: 600 8px var(--font-mono);
  cursor: pointer;
}

.wind-toggle svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
}

.wind-toggle.active {
  color: var(--ink);
  background: var(--acid);
}

.wind-layer-select {
  display: flex;
  align-items: center;
}

.wind-layer-select select {
  height: 30px;
  max-width: 136px;
  padding: 0 24px 0 8px;
  border: 0;
  outline: 0;
  appearance: none;
  color: #dbe7e3;
  background:
    linear-gradient(45deg, transparent 50%, #7e9695 50%) calc(100% - 10px) 12px/4px 4px no-repeat,
    linear-gradient(135deg, #7e9695 50%, transparent 50%) calc(100% - 6px) 12px/4px 4px no-repeat;
  font: 500 8px var(--font-mono);
  cursor: pointer;
}

.wind-layer-select select:disabled {
  opacity: 0.4;
  cursor: default;
}

.wind-layer-select option {
  color: var(--text);
  background: #0a1a21;
}

.wind-data-status {
  display: flex;
  align-items: center;
  max-width: 155px;
  padding: 0 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  color: #99afad;
  font: 400 7px var(--font-mono);
  white-space: nowrap;
}

.wind-data-status.loading::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border: 1px solid rgba(198, 243, 107, 0.25);
  border-top-color: var(--acid);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.wind-map-legend {
  position: absolute;
  z-index: 5;
  right: 22px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 5px;
  background: rgba(6, 17, 23, 0.74);
  color: #a7b9b6;
  font: 400 7px var(--font-mono);
  backdrop-filter: blur(9px);
  transition: opacity 180ms ease;
}

.wind-map-legend i {
  width: 82px;
  height: 5px;
  background: linear-gradient(90deg, #626fb5, #4a94a9, #53a553, #a79d51, #a16c5c, #af5088);
}

.leader-ring-readout {
  position: absolute;
  z-index: 5;
  top: 124px;
  left: 24px;
  display: grid;
  gap: 2px;
  min-width: 174px;
  padding: 8px 10px;
  border: 1px solid rgba(198, 243, 107, 0.22);
  border-radius: 6px;
  background: rgba(6, 17, 23, 0.78);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
  pointer-events: none;
  transition: opacity 180ms ease;
}

.leader-ring-readout > span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font: 500 7px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.leader-ring-readout > span i {
  width: 10px;
  height: 10px;
  border: 1px dashed var(--acid);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(198, 243, 107, 0.35);
}

.leader-ring-readout strong {
  color: #eef6f1;
  font: 600 10px var(--font-mono);
}

.leader-ring-readout small {
  color: #839a99;
  font: 400 7px var(--font-mono);
}

.wind-controls.off + .wind-map-legend,
.wind-map-legend.off {
  opacity: 0;
}

.view-switch button {
  padding: 7px 11px;
  font: 500 9px var(--font-mono);
}

.map-tools {
  position: absolute;
  z-index: 5;
  top: 72px;
  right: 22px;
  display: grid;
  gap: 5px;
}

.map-tools button {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 6px;
  background: rgba(6, 17, 23, 0.82);
  cursor: pointer;
  backdrop-filter: blur(9px);
}

.map-tools button:hover {
  border-color: var(--acid);
}

.map-tools svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}

.map-key {
  position: absolute;
  z-index: 5;
  left: 22px;
  bottom: 18px;
  display: flex;
  gap: 15px;
  padding: 7px 9px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  background: rgba(6, 17, 23, 0.72);
  color: #acbfbc;
  font: 400 8px var(--font-mono);
  backdrop-filter: blur(10px);
}

.wind-map-legend + .map-key {
  max-width: calc(100% - 250px);
}

.map-key span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.key-line {
  width: 16px;
  height: 2px;
  background: var(--orange);
}

.key-line.field {
  height: 1px;
  background: rgba(255, 255, 255, 0.35);
}

.key-ring {
  width: 14px;
  height: 8px;
  border: 1px dashed var(--acid);
  border-radius: 50%;
}

.key-dot {
  width: 6px;
  height: 6px;
  border: 1px solid #fff;
  border-radius: 50%;
}

.orbit-hint {
  position: absolute;
  z-index: 5;
  right: 22px;
  bottom: 18px;
  color: var(--muted);
  font: 400 8px var(--font-mono);
  pointer-events: none;
}

.orbit-hint[hidden] { display: none; }

.maplibregl-map {
  font-family: var(--font-sans);
}

.maplibregl-ctrl-bottom-left,
.maplibregl-ctrl-bottom-right {
  opacity: 0.5;
  font-size: 8px;
}

.maplibregl-popup-content {
  min-width: 170px;
  padding: 10px 12px;
  border: 1px solid rgba(198, 243, 107, 0.25);
  border-radius: 7px;
  background: #0b1b22;
  color: var(--text);
  box-shadow: var(--shadow);
}

.maplibregl-popup-tip {
  border-top-color: #0b1b22 !important;
}

.map-popup strong,
.map-popup span {
  display: block;
}

.map-popup strong {
  font: 600 11px var(--font-mono);
}

.map-popup span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.timeline {
  display: grid;
  grid-template-columns: 42px 1fr 64px;
  align-items: center;
  gap: 12px;
  padding: 9px 18px;
  border-top: 1px solid var(--line);
  background: #091920;
}

.play-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(198, 243, 107, 0.38);
  border-radius: 50%;
  background: rgba(198, 243, 107, 0.07);
  color: var(--acid);
  cursor: pointer;
}

.play-button svg {
  width: 18px;
  fill: currentColor;
}

.play-button .icon-pause,
.play-button.playing .icon-play {
  display: none;
}

.play-button.playing .icon-pause {
  display: block;
}

.timeline-main {
  position: relative;
  min-width: 0;
}

.timeline-events {
  position: absolute;
  right: 0;
  bottom: 5px;
  left: 0;
  height: 4px;
  pointer-events: none;
}

.timeline-events i {
  position: absolute;
  top: 0;
  width: 1px;
  height: 4px;
  background: rgba(237, 244, 240, 0.28);
}

.timeline-labels {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 8px;
  color: var(--faint);
  font: 400 8px var(--font-mono);
}

.timeline-labels strong {
  color: var(--text);
  font-size: 9px;
  font-weight: 500;
}

.timeline-labels button {
  justify-self: end;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--acid);
  font: 500 8px var(--font-mono);
  cursor: pointer;
}

.timeline-labels button i {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--acid);
}

.timeline input[type="range"] {
  --progress: 100%;
  width: 100%;
  height: 14px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.timeline input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--orange) var(--progress), rgba(255,255,255,.13) var(--progress));
}

.timeline input[type="range"]::-moz-range-track {
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,.13);
}

.timeline input[type="range"]::-moz-range-progress {
  height: 3px;
  background: var(--orange);
}

.timeline input[type="range"]::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  appearance: none;
  border: 2px solid #07151c;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 2px rgba(255,108,67,.35);
}

.timeline input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 2px solid #07151c;
  border-radius: 50%;
  background: var(--orange);
}

.playback-speed {
  text-align: right;
}

.playback-speed span {
  display: block;
  margin-bottom: 4px;
  color: var(--faint);
  font: 400 7px var(--font-mono);
  text-transform: uppercase;
}

.playback-speed button {
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 600 10px var(--font-mono);
  cursor: pointer;
}

.strategy-panel {
  min-width: 0;
  min-height: 0;
  padding: 22px 22px 17px;
  overflow-y: auto;
  background: var(--paper);
  color: var(--ink);
}

.strategy-panel .eyebrow {
  color: #667579;
}

.strategy-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-chip,
.window-chip {
  padding: 4px 7px;
  border: 1px solid rgba(18, 33, 39, 0.17);
  border-radius: 5px;
  color: #496166;
  font: 600 8px var(--font-mono);
  text-transform: uppercase;
}

.status-chip.flying {
  color: #2b5f48;
  border-color: rgba(43, 95, 72, 0.25);
  background: rgba(102, 180, 118, 0.09);
}

.team-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 13px 0 18px;
}

.team-code {
  min-width: 62px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(18, 33, 39, 0.22);
  border-left: 5px solid var(--team-color, var(--orange));
  font: 600 13px var(--font-mono);
}

.team-hero h2 {
  margin: 0 0 3px;
  font-size: 13px;
  line-height: 1.25;
}

.team-hero p {
  margin: 0;
  color: #69787b;
  font-size: 9px;
}

.strategy-verdict {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 15px;
  border-top: 1px solid rgba(18, 33, 39, 0.14);
}

.verdict-index {
  color: var(--orange);
  font: 500 9px var(--font-mono);
}

.strategy-verdict p {
  margin: 0 0 2px;
  color: #6b7b7e;
  font: 500 8px var(--font-mono);
  text-transform: uppercase;
}

.strategy-verdict strong {
  display: block;
  font-size: 17px;
  letter-spacing: -0.025em;
}

.verdict-copy {
  min-height: 47px;
  margin: 10px 0 16px;
  color: #506167;
  font-size: 10px;
  line-height: 1.55;
}

.primary-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid rgba(18, 33, 39, 0.14);
  border-left: 1px solid rgba(18, 33, 39, 0.14);
}

.primary-kpis > div {
  min-height: 75px;
  padding: 10px;
  border-right: 1px solid rgba(18, 33, 39, 0.14);
  border-bottom: 1px solid rgba(18, 33, 39, 0.14);
}

.primary-kpis span,
.primary-kpis strong,
.primary-kpis small {
  display: block;
}

.primary-kpis span {
  color: #738084;
  font: 500 7px var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.primary-kpis strong {
  margin: 7px 0 4px;
  font: 600 17px var(--font-mono);
  letter-spacing: -0.06em;
}

.primary-kpis small {
  color: #657579;
  font-size: 8px;
}

.layer-gauge {
  margin: 17px 0 15px;
}

.section-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
}

.section-label span {
  color: #68777a;
  font: 500 8px var(--font-mono);
}

.section-label strong {
  font: 600 8px var(--font-mono);
}

.gauge-track {
  position: relative;
  height: 8px;
  background: #d3d5ce;
}

.gauge-bands {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #58ae95 0 17%, #8fc881 17% 33%, #e0c260 33% 50%, #e68a59 50% 67%, #9a7cb9 67% 83%, #6e7eaf 83%);
  opacity: 0.56;
}

.gauge-track i {
  position: absolute;
  top: -4px;
  left: 0;
  width: 3px;
  height: 16px;
  background: var(--ink);
  box-shadow: 0 0 0 2px var(--paper);
  transform: translateX(-1px);
  transition: left 250ms ease;
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: #839092;
  font: 400 7px var(--font-mono);
}

.insight-list {
  display: grid;
  gap: 6px;
}

.insight-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid rgba(18, 33, 39, 0.11);
}

.insight-item__icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #31484e;
  background: rgba(18, 33, 39, 0.07);
  font: 600 9px var(--font-mono);
}

.insight-item strong,
.insight-item span {
  display: block;
}

.insight-item strong {
  margin-bottom: 2px;
  font-size: 9px;
}

.insight-item span {
  color: #68777a;
  font-size: 8px;
  line-height: 1.4;
}

.insight-placeholder {
  height: 38px;
  background: rgba(18, 33, 39, 0.04);
}

.data-trust {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 9px;
  border: 1px solid rgba(18, 33, 39, 0.13);
  background: rgba(255, 255, 255, 0.3);
}

.data-trust svg {
  width: 21px;
  flex: 0 0 auto;
  fill: none;
  stroke: #447063;
  stroke-width: 1.3;
}

.data-trust p {
  margin: 0;
}

.data-trust strong,
.data-trust span {
  display: block;
}

.data-trust strong {
  font-size: 8px;
}

.data-trust span {
  margin-top: 2px;
  color: #718083;
  font-size: 7px;
  line-height: 1.35;
}

.analysis-deck {
  display: grid;
  grid-template-columns: minmax(500px, 1.65fr) minmax(290px, .72fr) minmax(320px, .9fr);
  min-height: 406px;
  border-bottom: 1px solid var(--line);
}

.opportunity-card {
  grid-column: 1 / -1;
  min-height: 362px;
  border-top: 1px solid var(--line);
  border-right: 0;
}

.opportunity-legend {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-top: 7px;
  color: var(--faint);
  font: 400 7px var(--font-mono);
}

.opportunity-legend i {
  width: 120px;
  height: 6px;
  background: linear-gradient(90deg, #263f69, #277c8e, #63a753, #d2b953, #e16b43);
}

.opportunity-wrap {
  position: relative;
  height: 242px;
  margin-top: 5px;
}

#opportunityCanvas {
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.opportunity-footnote {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font: 400 7px var(--font-mono);
}

.opportunity-footnote span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.opportunity-footnote .push-right {
  margin-left: auto;
}

.confidence-high,
.confidence-low {
  width: 8px;
  height: 8px;
  background: var(--teal);
}

.confidence-low {
  background: repeating-linear-gradient(135deg, #687f80 0 2px, transparent 2px 4px);
  border: 1px solid #687f80;
}

.performance-section {
  padding: 22px 26px 24px;
  border-bottom: 1px solid var(--line);
  background: #0c2028;
}

.performance-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 18px;
}

.performance-heading h2 {
  margin: 0;
  font-size: 19px;
}

.performance-heading h2 span {
  color: var(--acid);
  font-family: var(--font-mono);
}

.performance-heading > p {
  max-width: 570px;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
  text-align: right;
}

.performance-stats {
  display: grid;
  grid-template-columns: repeat(10, minmax(92px, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.performance-stat {
  min-height: 86px;
  padding: 11px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.performance-stat span,
.performance-stat strong,
.performance-stat small {
  display: block;
}

.performance-stat > span {
  min-height: 20px;
  color: var(--muted);
  font: 500 7px/1.35 var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.performance-stat strong {
  margin: 7px 0 4px;
  font: 600 15px var(--font-mono);
  letter-spacing: -0.04em;
}

.performance-stat small {
  color: var(--faint);
  font-size: 7px;
  line-height: 1.35;
}

.performance-detail {
  display: grid;
  grid-template-columns: minmax(430px, 1.2fr) minmax(380px, 1fr);
  gap: 26px;
  margin-top: 20px;
}

.occupancy-panel,
.craft-notes {
  min-width: 0;
}

.occupancy-panel .section-label span,
.occupancy-panel .section-label strong {
  color: var(--muted);
}

.occupancy-bars {
  display: grid;
  gap: 7px;
}

.occupancy-row {
  display: grid;
  grid-template-columns: 90px 1fr 68px;
  align-items: center;
  gap: 9px;
  min-height: 20px;
}

.occupancy-row > span,
.occupancy-row > strong {
  font: 400 8px var(--font-mono);
}

.occupancy-row > span {
  color: var(--muted);
  text-align: right;
}

.occupancy-row > strong {
  color: #b9c9c6;
  font-weight: 500;
}

.occupancy-track {
  height: 7px;
  background: rgba(255, 255, 255, 0.045);
}

.occupancy-track i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--occupancy-color);
  transition: width 250ms ease;
}

.craft-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.craft-note {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: start;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.018);
}

.craft-note > i {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(198,243,107,.09);
  color: var(--acid);
  font: 600 8px var(--font-mono);
  font-style: normal;
}

.craft-note strong,
.craft-note span {
  display: block;
}

.craft-note strong {
  margin-bottom: 3px;
  font-size: 9px;
}

.craft-note span {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
}

.analysis-card {
  position: relative;
  min-width: 0;
  padding: 20px 20px 15px;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.analysis-card:last-child {
  border-right: 0;
}

.analysis-heading {
  min-height: 42px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.analysis-heading h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.analysis-heading > :last-child {
  margin-left: auto;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px 11px;
  margin-left: auto;
  padding-top: 4px;
}

.chart-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font: 400 8px var(--font-mono);
}

.chart-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--legend);
}

.altitude-chart-wrap {
  position: relative;
  height: 285px;
  margin-top: 11px;
}

#altitudeChart {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-grid {
  stroke: rgba(221, 239, 235, 0.09);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.chart-label {
  fill: #6f8889;
  font: 8px var(--font-mono);
}

.chart-path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area {
  opacity: .08;
}

.chart-speed {
  fill: none;
  stroke: var(--orange-soft);
  stroke-width: 1.2;
  stroke-dasharray: 4 4;
  opacity: .7;
}

.chart-crosshair {
  stroke: rgba(255,255,255,.45);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  pointer-events: none;
}

.chart-tooltip,
.matrix-tooltip {
  position: absolute;
  z-index: 8;
  min-width: 130px;
  padding: 8px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(5, 15, 20, 0.94);
  color: var(--text);
  box-shadow: var(--shadow);
  font: 400 8px/1.5 var(--font-mono);
  pointer-events: none;
}

.chart-tooltip strong,
.matrix-tooltip strong {
  color: var(--acid);
}

.chart-footnote {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font: 400 7px var(--font-mono);
}

.chart-footnote span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.chart-footnote .push-right {
  margin-left: auto;
}

.solid-sample,
.dash-sample {
  width: 14px;
  height: 1px;
  background: var(--teal);
}

.dash-sample {
  background: repeating-linear-gradient(90deg, var(--orange-soft) 0 4px, transparent 4px 7px);
}

.window-chip {
  color: var(--muted);
  border-color: var(--line);
}

.analysis-intro {
  margin: 7px 0 13px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.wind-scale {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0 0 5px 66px;
  color: var(--faint);
  font: 400 7px var(--font-mono);
  text-align: right;
}

.wind-ladder {
  display: grid;
  gap: 7px;
}

.wind-row {
  display: grid;
  grid-template-columns: 58px 1fr 34px;
  align-items: center;
  gap: 8px;
  min-height: 27px;
  padding: 3px 0;
}

.wind-row.current {
  border-radius: 4px;
  background: rgba(198, 243, 107, 0.045);
}

.wind-row__label {
  color: #a5b8b5;
  font: 500 8px var(--font-mono);
  text-align: right;
}

.wind-row__track {
  position: relative;
  height: 8px;
  background:
    linear-gradient(90deg, transparent calc(33.333% - 1px), rgba(255,255,255,.08) 33.333%, transparent calc(33.333% + 1px), transparent calc(66.666% - 1px), rgba(255,255,255,.08) 66.666%, transparent calc(66.666% + 1px)),
    rgba(255, 255, 255, 0.035);
}

.wind-row__bar {
  width: 0;
  height: 100%;
  background: var(--bar-color, var(--teal));
  transition: width 260ms ease;
}

.wind-row__team {
  position: absolute;
  top: -3px;
  left: 0;
  width: 3px;
  height: 14px;
  background: var(--paper);
  box-shadow: 0 0 0 1px #07151c;
  transform: translateX(-1px);
}

.wind-row__value {
  color: var(--text);
  font: 500 8px var(--font-mono);
  text-align: right;
}

.wind-row__value small {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 6px;
}

.best-layer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
  padding: 10px;
  border: 1px solid rgba(198, 243, 107, 0.18);
  background: rgba(198, 243, 107, 0.04);
}

.best-layer__icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--acid);
  color: var(--ink);
  font-size: 15px;
}

.best-layer p {
  margin: 0;
}

.best-layer span,
.best-layer strong {
  display: block;
}

.best-layer p span {
  color: var(--muted);
  font: 400 7px var(--font-mono);
  text-transform: uppercase;
}

.best-layer strong {
  margin-top: 3px;
  font-size: 9px;
}

.info-button {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font: 500 9px var(--font-mono);
  cursor: pointer;
}

.matrix-wrap {
  position: relative;
  height: 255px;
  margin: 4px 4px 0 22px;
}

#matrixCanvas {
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.matrix-axis-label {
  position: absolute;
  color: var(--faint);
  font: 400 7px var(--font-mono);
}

.matrix-axis-label.x {
  right: 21px;
  bottom: 10px;
}

.matrix-axis-label.y {
  left: 9px;
  top: 58%;
  transform: rotate(-90deg) translateX(-50%);
  transform-origin: left top;
}

.method-footer {
  min-height: 94px;
  display: grid;
  grid-template-columns: 270px minmax(300px, 1fr) auto;
  align-items: center;
  gap: 34px;
  padding: 19px 26px;
  background: #07141a;
  color: var(--muted);
}

.method-footer > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-mark {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border: 1px solid var(--acid);
  border-radius: 50%;
  color: var(--acid);
  font: 600 12px var(--font-mono);
}

.method-footer p {
  margin: 0;
}

.method-footer strong,
.method-footer span {
  display: block;
}

.method-footer strong {
  color: var(--text);
  font-size: 9px;
}

.method-footer span {
  margin-top: 3px;
  font-size: 7px;
}

.method-note {
  max-width: 720px;
  font-size: 8px;
  line-height: 1.55;
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a {
  color: #b5c7c4;
  font: 500 8px var(--font-mono);
  border-bottom: 1px solid var(--line-strong);
}

.toast {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  max-width: 310px;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: rgba(8, 23, 29, 0.96);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 10px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: none;
}

@media (max-width: 1250px) {
  .race-grid {
    grid-template-columns: 250px minmax(540px, 1fr) 290px;
  }

  .strategy-panel {
    padding-inline: 17px;
  }

  .analysis-deck {
    grid-template-columns: 1.5fr .78fr;
  }

  .matrix-card {
    grid-column: 1 / -1;
    min-height: 370px;
    border-top: 1px solid var(--line);
  }

  .performance-stats {
    grid-template-columns: repeat(5, 1fr);
  }

  .matrix-wrap {
    height: 275px;
  }
}

@media (max-width: 1020px) {
  .topbar {
    gap: 18px;
  }

  .event-lockup {
    display: none;
  }

  .race-grid {
    height: auto;
    grid-template-columns: 240px 1fr;
    grid-template-rows: auto auto;
    overflow: visible;
  }

  .strategy-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 26px;
  }

  .strategy-topline,
  .team-hero,
  .strategy-verdict,
  .verdict-copy {
    grid-column: 1;
  }

  .primary-kpis,
  .layer-gauge,
  .insight-list,
  .data-trust {
    grid-column: 2;
  }

  .primary-kpis {
    grid-row: 1 / span 3;
    align-self: start;
    margin-top: 6px;
  }

  .layer-gauge {
    grid-row: 4;
  }

  .insight-list {
    grid-row: 5 / span 2;
  }

  .data-trust {
    grid-row: 7;
  }

  .analysis-deck {
    grid-template-columns: 1fr;
  }

  .analysis-card,
  .analysis-card:last-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .matrix-card {
    grid-column: auto;
  }

  .opportunity-card {
    grid-column: auto;
  }

  .performance-detail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 740px) {
  .topbar {
    position: relative;
    height: 65px;
    padding: 0 15px;
  }

  .brand {
    min-width: 0;
  }

  .brand small,
  .unit-switch,
  .official-link {
    display: none;
  }

  .header-actions {
    margin-left: auto;
  }

  .source-alert {
    padding-inline: 15px;
  }

  .race-grid {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .teams-panel {
    max-height: 330px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .team-list {
    min-height: 170px;
  }

  .flight-stage {
    min-height: 500px;
  }

  .flight-panel {
    min-height: 582px;
  }

  .map-title {
    top: 76px;
    left: 16px;
  }

  .wind-controls {
    top: 142px;
    right: 16px;
    left: 16px;
    width: fit-content;
    max-width: calc(100% - 32px);
  }

  .wind-data-status {
    display: none;
  }

  .wind-map-legend {
    right: 14px;
    bottom: 49px;
  }

  .view-switch {
    top: 16px;
    right: 16px;
  }

  .three-presets {
    top: 64px;
    right: 58px;
  }

  .three-presets button {
    padding-inline: 6px;
    font-size: 7px;
  }

  .map-tools {
    top: 65px;
    right: 16px;
  }

  .map-key {
    left: 14px;
    right: 14px;
    bottom: 13px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 11px;
  }

  .leader-ring-readout {
    display: none;
  }

  .orbit-hint {
    display: none !important;
  }

  .timeline {
    grid-template-columns: 38px 1fr;
    padding-inline: 12px;
  }

  .playback-speed {
    display: none;
  }

  .strategy-panel {
    display: block;
    padding: 20px;
  }

  .analysis-card {
    padding-inline: 14px;
  }

  .analysis-heading {
    flex-wrap: wrap;
  }

  .chart-legend {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }

  .chart-footnote .push-right {
    display: none;
  }

  .opportunity-wrap {
    height: 285px;
  }

  .opportunity-footnote {
    flex-wrap: wrap;
  }

  .opportunity-footnote .push-right {
    width: 100%;
    margin-left: 0;
    line-height: 1.5;
  }

  .performance-section {
    padding: 20px 14px;
  }

  .performance-heading {
    display: block;
  }

  .performance-heading > p {
    margin-top: 9px;
    text-align: left;
  }

  .performance-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .performance-detail {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .craft-notes {
    grid-template-columns: 1fr;
  }

  .method-footer {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 22px 16px;
  }

  .footer-links {
    justify-self: start;
  }
}

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