/* ── Design tokens ── */
:root {
  /* Base Backgrounds (Off-black for depth) */
  --bg:           #0a0a0a;
  --surface:      #121212;
  --surface-h:    #1a1a1a;
  --surface-2:    #1f1f1f;
  --surface-3:    #262626;
  
  /* Borders - slightly softer */
  --border:       #262626;
  --border-2:     #333333;
  --border-glow:  rgba(255, 255, 255, 0.05);

  /* Typography */
  --text:         #f0f0f0;
  --text-2:       #a3a3a3;
  --text-3:       #525252;

  /* Accent Colors (Tuned for Dark Mode) */
  --red:          #e62429;
  --green:        #10b981;
  --yellow:       #f59e0b;
  --purple:       #a855f7;
  --blue:         #3b82f6;

  /* Tyre Colors */
  --tyre-soft:    #ef4444;
  --tyre-medium:  #f59e0b;
  --tyre-hard:    #e5e5e5;
  --tyre-inter:   #22c55e;
  --tyre-wet:     #3b82f6;

  /* Team Colors (Desaturated for WCAG/Halation) */
  --team-rbr:     #2563eb; /* Red Bull */
  --team-mer:     #14b8a6; /* Mercedes */
  --team-fer:     #dc2626; /* Ferrari */
  --team-mcl:     #f97316; /* McLaren */
  --team-ast:     #059669; /* Aston Martin */
  --team-alp:     #f472b6; /* Alpine */
  --team-wil:     #0ea5e9; /* Williams */
  --team-rbf:     #6366f1; /* RB */
  --team-sau:     #84cc16; /* Sauber */
  --team-haa:     #fafafa; /* Haas */

  /* Fonts */
  --f-ui:   'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', 'Space Grotesk', 'Consolas', monospace;

  /* Spacing & Layout */
  --s1: 2px; --s2: 4px; --s3: 6px; --s4: 10px;
  --s5: 16px; --s6: 24px; --s7: 40px;
  --nav-h: 52px; /* Slightly taller nav */
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #root { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-ui);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* ── Nav ── */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: var(--s5);
  padding: 0 var(--s6);
  background: rgba(18, 18, 18, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.app-nav::-webkit-scrollbar { display: none; }

.nav-logo {
  font-family: var(--f-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.nav-logo em { color: var(--red); font-style: normal; }

.nav-links { display: flex; gap: 2px; flex-shrink: 0; }

.nav-links a {
  padding: var(--s2) var(--s4);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  border-radius: 2px;
  transition: color 0.1s, background 0.1s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-h); }
.nav-links a.active { color: var(--text); background: var(--surface-2); }

.nav-utility {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-utility-link {
  padding: 3px 9px;
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 2px;
  transition: color 0.1s, border-color 0.1s, background 0.1s;
}
.nav-utility-link:hover {
  color: var(--text-2);
  border-color: var(--border-2);
  background: var(--surface-h);
}
.nav-utility-link.active {
  color: var(--text);
  border-color: var(--border-2);
  background: var(--surface-2);
}

/* ── Page ── */
.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: var(--s5) var(--s6);
}

/* ── Local data navigator ── */
.nav-panel {
  margin-bottom: var(--s5);
  padding-bottom: var(--s5);
  border-bottom: 1px solid var(--border);
}

.nav-panel-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s4);
  margin-bottom: var(--s5);
}

.nav-panel-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.year-list {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.year-btn {
  padding: 3px 10px;
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 2px;
  cursor: pointer;
}
.year-btn:hover { color: var(--text); border-color: var(--text-3); }
.year-btn.active {
  color: var(--text);
  border-color: var(--red);
  background: rgba(225, 6, 0, 0.08);
}

.nav-section { margin-bottom: var(--s5); }
.nav-section:last-child { margin-bottom: 0; }

.nav-section-meta {
  font-size: 12px;
  font-family: var(--f-mono);
  color: var(--text-3);
  padding: var(--s3) 0;
}

.nav-table td { white-space: normal; }

.nav-row-selected { background: var(--surface-h); }

.nav-sub {
  display: block;
  font-size: 10px;
  color: var(--text-3);
  margin-top: 2px;
}

.nav-action-btn {
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 2px;
  cursor: pointer;
}
.nav-action-btn:hover { color: var(--text); border-color: var(--text-3); }
.nav-action-btn.active {
  color: var(--text);
  border-color: var(--border-2);
  background: var(--surface-2);
}

.nav-action-primary {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}
.nav-action-primary:hover {
  color: #fff;
  background: #c50500;
  border-color: #c50500;
}

.coverage-dots {
  display: inline-flex;
  gap: 3px;
  margin-left: var(--s3);
  vertical-align: middle;
}

.coverage-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  opacity: 0.35;
}
.coverage-dot.on {
  background: var(--green);
  opacity: 1;
}

/* ── Session input bar ── */
.session-bar {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s5);
  flex-wrap: wrap;
}

.session-bar label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
}

.session-bar input {
  width: 110px;
  min-width: 80px;
  flex: 0 1 auto;
  padding: 4px var(--s3);
  background: var(--surface);
  border: 1px solid var(--border-2);
  color: var(--text);
  font-family: var(--f-mono);
  font-size: 13px;
  border-radius: 2px;
  outline: none;
}
.session-bar input:focus { border-color: var(--red); }

.session-bar button {
  padding: 4px var(--s5);
  background: var(--red);
  color: #fff;
  border: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: 2px;
  cursor: pointer;
}
.session-bar button:hover { background: #c50500; }

/* ── Race Hub header ── */
.rh-header {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--s4);
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s4);
}

.rh-title-group { flex: 1; min-width: 180px; }

.rh-meeting { font-size: 20px; font-weight: 700; line-height: 1.2; }

.rh-session {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 3px;
}

.rh-meta {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
  margin-top: var(--s3);
}

.rh-meta-item {
  font-size: 11px;
  font-family: var(--f-mono);
  color: var(--text-3);
}

/* badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-radius: 2px;
}
.badge-local   { background: rgba(57,199,58,.12); color: var(--green); border: 1px solid rgba(57,199,58,.25); }
.badge-partial { background: rgba(255,214,0,.12); color: var(--yellow); border: 1px solid rgba(255,214,0,.25); }
.badge-cancelled { background: rgba(255,107,53,.12); color: #ff8a5c; border: 1px solid rgba(255,107,53,.28); }
.badge-none    { background: rgba(80,80,80,.12); color: var(--text-3); border: 1px solid var(--border); }

/* ── Dataset strip ── */
.dataset-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s6);
}

.ds-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-family: var(--f-mono);
  color: var(--text-3);
}

.ds-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ds-dot-local   { background: var(--green); }
.ds-dot-missing { background: var(--text-3); opacity: 0.5; }

/* ── Section header ── */
.sec-header {
  display: flex;
  align-items: baseline;
  gap: var(--s4);
  margin-bottom: var(--s3);
}

.sec-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.sec-meta {
  font-size: 10px;
  font-family: var(--f-mono);
  color: var(--text-3);
}

/* ── Data sections ── */
.data-section { margin-bottom: var(--s7); }

.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Tables ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th {
  padding: var(--s2) var(--s3);
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table th.r { text-align: right; }
.data-table th.c { text-align: center; }

.data-table td {
  padding: var(--s2) var(--s3);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface-h); }
.data-table tbody tr.lap-fastest-row td,
.data-table tbody tr.lap-fastest-row .drv-num {
  color: var(--purple);
}

.data-table td.r { text-align: right; font-family: var(--f-mono); }
.data-table td.c { text-align: center; }
.data-table td.mono { font-family: var(--f-mono); }

/* ── Position badges ── */
.pos-p1 { color: #ffd700; font-weight: 700; font-family: var(--f-mono); }
.pos-p2 { color: #c0c0c0; font-weight: 700; font-family: var(--f-mono); }
.pos-p3 { color: #cd7f32; font-weight: 700; font-family: var(--f-mono); }
.pos-n  { color: var(--text-2); font-family: var(--f-mono); }

.pos-gain { color: var(--green); font-size: 11px; }
.pos-loss { color: var(--red);   font-size: 11px; }
.pos-same { color: var(--text-3); font-size: 11px; }

/* ── Driver cell ── */
.drv-cell {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.drv-bar {
  width: 3px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 1px;
}

.drv-code {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  min-width: 30px;
}

.drv-num {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--text-3);
  min-width: 18px;
}

/* ── Status labels ── */
.status-dnf { color: var(--red);    font-size: 10px; font-weight: 700; font-family: var(--f-mono); }
.status-dns { color: var(--text-3); font-size: 10px; font-weight: 700; font-family: var(--f-mono); }
.status-dsq { color: var(--yellow); font-size: 10px; font-weight: 700; font-family: var(--f-mono); }

/* ── Empty / loading states ── */
.empty-state {
  padding: var(--s7) 0;
  text-align: center;
  color: var(--text-3);
}
.empty-state-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: var(--s3);
}
.empty-state-desc { font-size: 12px; line-height: 1.7; }
.empty-state-desc code {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-3);
}

.loading-state {
  padding: var(--s7) 0;
  text-align: center;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--text-3);
}

.error-box {
  padding: var(--s4) var(--s5);
  background: rgba(225,6,0,.07);
  border: 1px solid rgba(225,6,0,.2);
  border-radius: 2px;
  color: #ff6b6b;
  font-size: 12px;
  margin-bottom: var(--s5);
}

/* ── Live timing ── */
.live-page { max-width: 1320px; }

.live-banner {
  padding: var(--s4) var(--s5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--red);
  border-radius: 8px;
  margin-bottom: var(--s5);
  background:
    linear-gradient(90deg, rgba(225, 6, 0, 0.12), transparent 28%),
    rgba(255, 255, 255, 0.025);
}

.live-banner-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s5);
}

.live-banner-main {
  display: flex;
  align-items: center;
  gap: var(--s4);
  min-width: 0;
}

.live-banner h1 {
  font-size: 24px;
  line-height: 1.2;
}

.live-banner p {
  color: var(--text-2);
  font-size: 12px;
}

.live-session-board {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s4);
  flex-wrap: wrap;
  text-align: right;
}

.live-clock {
  min-width: 148px;
  color: var(--text);
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  text-align: right;
}

.live-phase-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 44px;
  padding: 0 var(--s3);
  border: 1px solid rgba(255, 214, 0, 0.36);
  border-radius: 4px;
  background: rgba(255, 214, 0, 0.14);
  color: var(--yellow);
  font-size: 18px;
  font-weight: 900;
}

.live-banner-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s2);
  flex-wrap: wrap;
  max-width: 280px;
  color: var(--text-2);
  font-size: 11px;
  font-family: var(--f-mono);
  text-transform: uppercase;
}

.live-weather-strip {
  display: flex;
  gap: var(--s4);
  align-items: center;
  flex-wrap: wrap;
  margin-top: var(--s3);
  padding-top: var(--s3);
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--f-mono);
}

.badge-wet {
  background: rgba(0,128,255,.14);
  color: #66aaff;
  border: 1px solid rgba(0,128,255,.26);
}

/* ── Live columns layout ── */
.live-columns {
  display: flex;
  flex-direction: column;
  gap: var(--s5);
}

.live-track-panel {
  margin-bottom: var(--s5);
}

.track-map-stage {
  position: relative;
  min-height: 360px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}

.track-map-svg {
  display: block;
  width: 100%;
  height: 360px;
}

.track-map-outline-shadow,
.track-map-outline {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.track-map-outline-shadow {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 5;
}

.track-map-outline {
  stroke: var(--surface-3);
  stroke-width: 2.4;
}

.track-car {
  cursor: pointer;
  outline: none;
}

.track-car circle {
  stroke: #050505;
  stroke-width: 0.7;
  transition: r 0.12s, opacity 0.12s, stroke 0.12s;
}

.track-car text {
  fill: #fff;
  font-family: var(--f-mono);
  font-size: 2.1px;
  font-weight: 800;
  pointer-events: none;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.85);
  stroke-width: 0.7;
}

.track-car:hover circle,
.track-car:focus-visible circle,
.track-car-selected circle {
  r: 3.7;
  stroke: #fff;
}

.track-car-inactive {
  opacity: 0.35;
  filter: grayscale(0.8);
}

.track-map-empty {
  display: grid;
  min-height: 160px;
  place-items: center;
  color: var(--text-3);
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
}

.track-map-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.track-telemetry {
  position: absolute;
  right: var(--s5);
  bottom: var(--s5);
  width: min(260px, calc(100% - 32px));
  padding: var(--s4);
  border: 1px solid var(--border-2);
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(10px);
}

.track-telemetry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  margin-bottom: var(--s3);
  color: var(--text-3);
  font-family: var(--f-mono);
  font-size: 10px;
  text-transform: uppercase;
}

.track-driver-code {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.track-telemetry dl {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--s3);
}

.track-telemetry dt {
  color: var(--text-3);
  font-family: var(--f-mono);
  font-size: 9px;
}

.track-telemetry dd {
  color: var(--text);
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 700;
  min-width: 0;
}

@media (min-width: 900px) {
  .live-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 318px;
    gap: var(--s5);
    align-items: start;
  }
}

/* ── Live status strip ── */
.live-status-strip {
  padding: var(--s2) var(--s5);
  font-size: 11px;
  font-family: var(--f-mono);
  margin-bottom: var(--s4);
  border-radius: 2px;
}

.live-status-warn {
  background: rgba(255,214,0,.06);
  border: 1px solid rgba(255,214,0,.2);
  color: var(--yellow);
}

.live-status-archive {
  background: rgba(70, 140, 255, 0.08);
  border: 1px solid rgba(70, 140, 255, 0.24);
  color: #8bb7ff;
}

/* ── Live empty state ── */
.live-empty-status {
  display: flex;
  justify-content: center;
  margin-bottom: var(--s4);
}

.live-archive-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  margin-top: var(--s5);
  min-height: 36px;
  padding: 0 var(--s4);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.live-archive-btn:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
}

.mono { font-family: var(--f-mono); }

.live-conn,
.live-state,
.track-status,
.tyre-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1;
  padding: 4px 7px;
  text-transform: uppercase;
  white-space: nowrap;
}

.live-conn-connected,
.live-state-on,
.track-green { background: rgba(57,199,58,.12); color: var(--green); border: 1px solid rgba(57,199,58,.25); }
.live-conn-connecting { background: rgba(255,214,0,.12); color: var(--yellow); border: 1px solid rgba(255,214,0,.25); }
.live-conn-disconnected,
.live-conn-error,
.live-state { background: rgba(225,6,0,.10); color: #ff6b6b; border: 1px solid rgba(225,6,0,.24); }
.track-yellow,
.track-sc { background: rgba(255,214,0,.12); color: var(--yellow); border: 1px solid rgba(255,214,0,.25); }
.track-red { background: rgba(225,6,0,.12); color: #ff6b6b; border: 1px solid rgba(225,6,0,.25); }
.track-vsc { background: rgba(194,120,255,.12); color: var(--purple); border: 1px solid rgba(194,120,255,.25); }

.live-tower { 
  font-variant-numeric: tabular-nums; 
  border-collapse: separate;
  border-spacing: 0 3px;
}
.live-tower th {
  border-bottom: none !important;
  padding-bottom: 12px;
}
.live-tower td {
  border-bottom: none !important;
}
.live-tower tbody tr {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.live-tower tbody tr:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: scale(1.005) translateX(4px);
}
.live-tower tbody tr td:first-child {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}
.live-tower tbody tr td:last-child {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}
.live-tower .in-pit td { background: rgba(0, 80, 160, 0.2) !important; }
.live-tower .pit-out td { background: rgba(57, 199, 58, 0.15) !important; }
.live-tower .retired td { opacity: 0.5; filter: grayscale(80%); }
.live-tower .danger-row td {
  background: rgba(225, 6, 0, 0.095);
}
.live-tower .danger-row td:first-child {
  box-shadow: inset 3px 0 0 rgba(225, 6, 0, 0.78);
}
.live-tower .flying-row td {
  background: rgba(194, 120, 255, 0.055);
}
.live-tower .flying-row td:first-child {
  box-shadow: inset 3px 0 0 rgba(194, 120, 255, 0.68);
}
.live-tower .danger-row.flying-row td:first-child {
  box-shadow: inset 3px 0 0 rgba(225, 6, 0, 0.78), inset 6px 0 0 rgba(194, 120, 255, 0.68);
}

.cutoff-separator td {
  padding: 6px var(--s3) !important;
  background: transparent !important;
  border-radius: 0 !important;
  border-top: 1px dashed rgba(225, 6, 0, 0.78) !important;
  border-bottom: none !important;
  color: #ff8a8a;
  font-size: 10px;
  font-family: var(--f-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cutoff-separator span,
.cutoff-separator strong,
.cutoff-separator em {
  margin-right: var(--s4);
  font-style: normal;
}

.cutoff-separator strong {
  color: var(--text);
}

.cutoff-separator em {
  color: #ffb0b0;
}

/* Race Control Panel & Animations */
.panel-glass {
  background: rgba(20, 20, 20, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 16px;
  backdrop-filter: blur(12px);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.panel-glass .sticky-header {
  position: sticky;
  top: -16px;
  background: rgba(20, 20, 20, 0.9);
  padding: 16px 0 12px 0;
  margin-top: -16px;
  z-index: 10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
}

.rc-hlt {
  font-weight: 700;
  padding: 0 2px;
  border-radius: 2px;
}
.rc-hlt-car {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}
.rc-hlt-bad {
  color: #ff6b6b;
  background: rgba(225, 6, 0, 0.15);
}
.rc-hlt-warn {
  color: var(--yellow);
  background: rgba(255, 214, 0, 0.15);
}
.rc-hlt-ok {
  color: var(--green);
  background: rgba(57, 199, 58, 0.15);
}

.panel-glass .sticky-header {
  position: sticky;
  top: -16px;
  background: rgba(20, 20, 20, 0.9);
  padding: 16px 0 12px 0;
  margin-top: -16px;
  z-index: 10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
}

@keyframes flash-rc {
  0% { background: rgba(255, 255, 255, 0.2); transform: scale(1.02); }
  100% { background: transparent; transform: scale(1); }
}
.rc-item-new {
  animation: flash-rc 2.5s ease-out forwards;
}

@keyframes flash-rc-yellow {
  0% { background: rgba(255, 214, 0, 0.35); transform: scale(1.03); box-shadow: 0 0 15px rgba(255, 214, 0, 0.5); }
  100% { background: rgba(255, 214, 0, 0.05); transform: scale(1); box-shadow: 0 0 0 transparent; }
}
.rc-item-yellow {
  animation: flash-rc-yellow 2.5s ease-out forwards;
}

@keyframes flash-rc-red {
  0% { background: rgba(225, 6, 0, 0.4); transform: scale(1.03); box-shadow: 0 0 15px rgba(225, 6, 0, 0.6); }
  100% { background: rgba(225, 6, 0, 0.05); transform: scale(1); box-shadow: 0 0 0 transparent; }
}
.rc-item-red {
  animation: flash-rc-red 2.5s ease-out forwards;
}
.pos-delta { font-family: var(--f-mono); color: var(--text-3); }
.pos-delta.pos-gain { color: var(--green); }
.pos-delta.pos-loss { color: var(--red); }
.lap-pb { color: var(--green); }
.lap-ob { color: var(--purple); }
.badge-pit     { background: rgba(0,128,255,.14); color: #66aaff;        border: 1px solid rgba(0,128,255,.26); }
.badge-out     { background: rgba(225,6,0,.12);   color: #ff6b6b;        border: 1px solid rgba(225,6,0,.24); }
.badge-flying  { background: rgba(194,120,255,.14); color: var(--purple); border: 1px solid rgba(194,120,255,.26); }
.badge-knocked { background: rgba(225,6,0,.12);   color: #ff6b6b;        border: 1px solid rgba(225,6,0,.24); }
.badge-cutoff  { background: rgba(255,214,0,.12); color: var(--yellow);  border: 1px solid rgba(255,214,0,.25); }
.badge-risk    { background: rgba(225,6,0,.14);   color: #ff8a8a;        border: 1px solid rgba(225,6,0,.28); }

.tyre-soft { background: var(--tyre-soft); color: #fff; }
.tyre-medium { background: var(--tyre-medium); color: #111; }
.tyre-hard { background: var(--tyre-hard); color: #111; }
.tyre-inter { background: var(--tyre-inter); color: #fff; }
.tyre-wet { background: var(--tyre-wet); color: #fff; }
.tyre-unknown { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border-2); }

/* ── Track status banner ── */
.track-banner {
  display: flex;
  align-items: baseline;
  gap: var(--s4);
  width: 100%;
  padding: var(--s3) var(--s5);
  margin-bottom: var(--s5);
  border: 1px solid var(--border-2);
  border-left-width: 3px;
  border-radius: 2px;
  font-family: var(--f-mono);
}

.track-banner-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.track-banner-detail {
  font-size: 11px;
  opacity: 0.75;
  min-width: 0;
}

.track-banner-green   { background: rgba(57,199,58,.08);   border-color: rgba(57,199,58,.3);   color: var(--green); }
.track-banner-yellow  { background: rgba(255,214,0,.12);   border-color: rgba(255,214,0,.4);   color: var(--yellow); }
.track-banner-sc      { background: rgba(255,152,0,.12);   border-color: rgba(255,152,0,.4);   color: #ffb84d; }
.track-banner-vsc     { background: rgba(194,120,255,.12); border-color: rgba(194,120,255,.4); color: var(--purple); }
.track-banner-red     { background: rgba(225,6,0,.14);     border-color: rgba(225,6,0,.5);     color: #ff6b6b; animation: track-banner-pulse 1.6s ease-in-out infinite; }
.track-banner-unknown { background: var(--surface-2);      border-color: var(--border-2);      color: var(--text-2); }

@keyframes track-banner-pulse {
  0%, 100% { background: rgba(225,6,0,.14); }
  50%      { background: rgba(225,6,0,.26); }
}

/* ── Weather strip items ── */
.weather-item {
  display: inline-flex;
  align-items: baseline;
  gap: var(--s2);
  white-space: nowrap;
}
.weather-k { color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; font-size: 9px; }
.weather-v { color: var(--text-2); font-family: var(--f-mono); font-size: 11px; }

/* ── Gap trend sparkline ── */
.gap-spark {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  color: var(--text-3);
  line-height: 1;
}
.gap-spark-empty { color: var(--text-3); }
.gap-spark-svg { display: block; }
.gap-spark.trend-closing { color: var(--green); }
.gap-spark.trend-opening { color: #ff6b6b; }
.gap-spark.trend-steady  { color: var(--text-3); }

.trend-arrow { font-size: 8px; line-height: 1; }
.trend-arrow-closing { color: var(--green); }
.trend-arrow-opening { color: #ff6b6b; }

.spark-cell { line-height: 0; }

.sector-time {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 58px;
  padding: 2px 5px;
  border-radius: 3px;
}
.sector-active {
  background: rgba(255, 214, 0, 0.08);
}
.sector-personal {
  background: rgba(57, 199, 58, 0.1);
}
.sector-overall {
  background: rgba(194, 120, 255, 0.12);
}

/* ── Battle highlighting ── */
.live-tower tr.battle-row td { background: rgba(255,214,0,.045); }
.live-tower tr.battle-row td:first-child { box-shadow: inset 2px 0 0 rgba(255,214,0,.55); }

.battle-chips {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
  margin-bottom: var(--s3);
}

.battle-chips-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.battle-chip {
  padding: 2px 7px;
  font-size: 11px;
  border-radius: 2px;
  background: rgba(255,214,0,.08);
  border: 1px solid rgba(255,214,0,.25);
  color: var(--yellow);
  white-space: nowrap;
}

/* ── Pinned drivers ── */
.live-tower tr.pinnable { cursor: pointer; }
.live-tower tr.pinned-row td { background: rgba(0,128,255,.08); }
.live-tower tr.pinned-row td:first-child { box-shadow: inset 2px 0 0 rgba(0,128,255,.55); }
.live-tower tr.battle-row.pinned-row td:first-child {
  box-shadow: inset 2px 0 0 rgba(0,128,255,.55), inset 4px 0 0 rgba(255,214,0,.55);
}

.pin-mark { color: #66aaff; font-size: 10px; line-height: 1; }

.pinned-strip {
  display: flex;
  gap: var(--s3);
  flex-wrap: wrap;
  margin-bottom: var(--s5);
}

.pinned-card {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s2) var(--s4);
  background: var(--surface);
  border: 1px solid rgba(0,128,255,.26);
  border-radius: 2px;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}
.pinned-card:hover { background: var(--surface-h); border-color: rgba(0,128,255,.45); }
.pinned-card .drv-bar { height: 16px; }

.pinned-pos { font-size: 11px; color: var(--text-2); }
.pinned-gap { font-size: 11px; color: var(--text-2); min-width: 44px; text-align: right; }
.pinned-nodata { font-size: 10px; color: var(--text-3); font-family: var(--f-mono); }
.pinned-unpin { color: var(--text-3); font-size: 12px; line-height: 1; }
.pinned-card:hover .pinned-unpin { color: #ff6b6b; }
.pinned-card-missing { border-color: var(--border-2); opacity: 0.75; }

/* ── Stint history ── */
.stint-seq {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.stint-item { display: inline-flex; align-items: center; gap: 2px; }
.stint-arrow { color: var(--text-3); font-size: 9px; margin-right: 2px; }

.stint-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  font-family: var(--f-mono);
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
}

.stint-laps {
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--text-3);
}

.stint-empty { color: var(--text-3); font-family: var(--f-mono); }

.live-rc { margin-bottom: var(--s7); }

.live-rc-list {
  border-top: 1px solid var(--border);
}

.live-rc-scroll {
  max-height: 320px;
  overflow-y: auto;
}

.live-rc-row {
  display: flex;
  align-items: baseline;
  gap: var(--s3);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  flex-wrap: wrap;
}

.rc-time,
.rc-lap {
  color: var(--text-3);
  flex-shrink: 0;
  font-family: var(--f-mono);
  font-size: 11px;
}

.rc-message { flex: 1; min-width: 0; }

.rc-flag {
  flex-shrink: 0;
  padding: 1px 5px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.rc-flag-green    { background: rgba(57,199,58,.15);    color: var(--green);  border-color: rgba(57,199,58,.3); }
.rc-flag-yellow   { background: rgba(255,214,0,.15);    color: var(--yellow); border-color: rgba(255,214,0,.3); }
.rc-flag-red      { background: rgba(225,6,0,.15);      color: #ff6b6b;       border-color: rgba(225,6,0,.3); }
.rc-flag-sc       { background: rgba(255,214,0,.15);    color: var(--yellow); border-color: rgba(255,214,0,.3); }
.rc-flag-vsc      { background: rgba(194,120,255,.15);  color: var(--purple); border-color: rgba(194,120,255,.3); }
.rc-flag-chequered { background: rgba(200,200,200,.10); color: var(--text-2); border-color: var(--border-2); }
.rc-flag-blue     { background: rgba(67,156,255,.15);   color: #66aaff;       border-color: rgba(67,156,255,.3); }
.rc-flag-black    { background: rgba(10,10,10,.55);      color: var(--text-2); border-color: rgba(255,255,255,.18); }
.rc-flag-drs      { background: rgba(0,212,255,.13);     color: #00d4ff;       border-color: rgba(0,212,255,.28); }
.rc-flag-other    { background: var(--surface-2);         color: var(--text-2); border-color: var(--border-2); }

.race-control-row {
  position: relative;
}

.race-control-row td:first-child {
  border-left: 3px solid transparent;
}

.race-control-row.rc-flag-green td:first-child { border-left-color: var(--green); }
.race-control-row.rc-flag-yellow td:first-child,
.race-control-row.rc-flag-sc td:first-child { border-left-color: var(--yellow); }
.race-control-row.rc-flag-red td:first-child { border-left-color: var(--red); }
.race-control-row.rc-flag-vsc td:first-child { border-left-color: var(--purple); }
.race-control-row.rc-flag-blue td:first-child { border-left-color: #66aaff; }
.race-control-row.rc-flag-drs td:first-child { border-left-color: #00d4ff; }
.race-control-row.rc-flag-chequered td:first-child { border-left-color: var(--text-2); }

.race-control-row.rc-flag-yellow td,
.race-control-row.rc-flag-sc td {
  background: rgba(255,214,0,.035);
}

.race-control-row.rc-flag-red td {
  background: rgba(225,6,0,.045);
}

.race-control-row.rc-flag-green td {
  background: rgba(57,199,58,.03);
}

.rc-time-cell {
  color: var(--text-3);
}

.rc-event-pill {
  align-items: center;
  display: inline-flex;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  vertical-align: middle;
}

.rc-event-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
}

.rc-scope {
  color: var(--text-3);
  margin-left: 6px;
}

.rc-message-cell {
  white-space: normal;
}

.rc-category {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
  font-family: var(--f-mono);
}

.missing-notice {
  padding: var(--s4) var(--s5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-3);
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: var(--s4);
}
.missing-notice code {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-3);
}

/* ── Data Library ── */
.dl-page {
  max-width: none;
  padding: 0;
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  flex-direction: column;
}

.dl-page-header {
  padding: var(--s5) var(--s6);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dl-page-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.dl-page-title {
  font-size: 16px;
  font-weight: 700;
}

.dl-page-sub {
  font-size: 11px;
  color: var(--text-3);
}

.dl-page-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s5);
  flex-wrap: wrap;
  padding: var(--s4) var(--s6);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.dl-banner-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dl-banner-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s5);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.dl-banner-stats em {
  font-style: normal;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-2);
  margin-right: 4px;
}
.dl-banner-stats em.dl-stat-full { color: var(--green); }
.dl-banner-stats em.dl-stat-partial { color: var(--yellow); }
.dl-banner-stats em.dl-stat-cancelled { color: #ff8a5c; }

.dl-footer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
}
.dl-footer-back { color: var(--text-3); }
.dl-footer-back:hover { color: var(--text); }

.dl-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  flex: 1;
  min-height: 0;
}

.dl-nav {
  border-right: 1px solid var(--border);
  padding: var(--s5);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s5);
}

.season-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.season-row {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: 7px var(--s3);
  border-radius: 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: var(--f-mono);
}
.season-row:hover { background: var(--surface-h); color: var(--text); }
.season-row.active { background: var(--surface-2); color: var(--text); }

.dl-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border: 1px solid var(--border);
}

.dl-stat {
  padding: var(--s3);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dl-stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}

.dl-stat-val {
  font-family: var(--f-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-2);
}
.dl-stat-full { color: var(--green); }
.dl-stat-partial { color: var(--yellow); }
.dl-stat-cancelled { color: #ff8a5c; }

.dl-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.dl-content-header {
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: var(--s3) var(--s5);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.dl-content-title {
  font-size: 13px;
  font-weight: 700;
}

.dl-content-meta {
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--f-mono);
}

.dl-content-body {
  display: grid;
  grid-template-columns: 1fr 340px;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.dl-round-scroll {
  overflow-y: auto;
  border-right: 1px solid var(--border);
}

.rounds-table tbody tr {
  cursor: pointer;
}
.dl-row-selected { background: var(--surface-h); }

.session-icons {
  display: flex;
  gap: 3px;
  align-items: center;
  flex-wrap: wrap;
}

.session-icon {
  min-width: 14px;
  height: 14px;
  padding: 0 2px;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  font-family: var(--f-mono);
}
.session-icon.si-full { background: rgba(57,199,58,0.2); color: var(--green); }
.session-icon.si-partial { background: rgba(255,214,0,0.2); color: var(--yellow); }
.session-icon.si-cancelled { background: rgba(255,107,53,0.18); color: #ff8a5c; }
.session-icon.si-missing { background: rgba(50,50,50,0.5); color: var(--text-3); }

.dl-detail-wrap {
  overflow-y: auto;
}

.dl-detail {
  padding: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

.detail-header {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--border);
}

.detail-header-row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
}

.detail-title {
  font-size: 14px;
  font-weight: 700;
}

.detail-meta {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--f-mono);
}

.session-detail-row {
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--border);
}
.session-detail-row:last-of-type { border-bottom: none; }

.session-detail-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s3);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  flex-wrap: wrap;
}

.session-detail-key {
  font-weight: 400;
  color: var(--text-3);
}

.session-detail-coverage {
  font-weight: 400;
  color: var(--text-2);
  margin-left: auto;
}

.ds-detail-table { font-size: 11px; }
.ds-detail-table th { font-size: 9px; }

.session-cli { margin-top: var(--s3); }

.dl-cli-section { margin-top: var(--s3); }

.cli-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: var(--s4);
}

.cli-comment {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--text-3);
  margin-bottom: var(--s2);
}

.cli-cmd-row {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.cli-cmd {
  flex: 1;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text);
  word-break: break-all;
}

.cli-copy-btn {
  flex-shrink: 0;
  padding: 2px 8px;
  background: none;
  border: 1px solid var(--border-2);
  border-radius: 2px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}
.cli-copy-btn:hover {
  border-color: var(--green);
  color: var(--green);
}

.cli-spacer { height: var(--s4); }

.dl-footer-link {
  padding: var(--s4) var(--s6);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
}
.dl-footer-link a:hover { color: var(--text); }

.dl-page .empty-state,
.dl-page .missing-notice,
.dl-page .loading-state,
.dl-page .error-box {
  margin: var(--s5) var(--s6);
}

.dl-page .dl-cli-section {
  margin: 0 var(--s6) var(--s6);
}

/* ── Tab bar ── */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s5);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.1s;
  margin-bottom: -1px;
  flex-shrink: 0;
}
.tab-btn:hover { color: var(--text-2); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--red); }

/* ── Dataset status view ── */
.ds-legend {
  display: flex;
  align-items: center;
  gap: var(--s5);
  margin-bottom: var(--s5);
  font-size: 12px;
  color: var(--text-2);
}
.ds-legend code {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-3);
}

/* ── Strategy / position views ── */
.analysis-notice {
  padding: var(--s4) var(--s5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-2);
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: var(--s5);
  max-width: 560px;
}
.analysis-notice strong { color: var(--text); }
.analysis-notice code { font-family: var(--f-mono); font-size: 11px; color: var(--text-3); }

/* ── Command Center ── */
.cc-page {
  max-width: 1160px;
  margin: 0 auto;
  padding: var(--s5) var(--s6);
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  flex-direction: column;
  gap: var(--s6); /* slightly more gap for the main sections */
  --gp-accent: var(--red);
}

.cc-hero {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

.cc-dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: var(--s6);
}

@media (min-width: 900px) {
  .cc-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 65fr) minmax(0, 35fr);
    gap: var(--s6);
    align-items: start;
  }
}

.cc-dashboard-main {
  position: relative;
  z-index: 1;
}

.cc-dashboard-panel {
  background: rgba(18, 18, 18, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: var(--s6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02), 0 8px 32px rgba(0,0,0,0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: var(--s6);
}

.cc-ambient-aura {
  position: absolute;
  top: 0;
  left: -5%;
  width: 110%;
  height: 100%;
  background: radial-gradient(ellipse at center, var(--aura-accent, var(--red)) 0%, transparent 70%);
  filter: blur(120px);
  opacity: 0.45;
  z-index: -1;
  pointer-events: none;
}

.cc-dashboard-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--s6);
}

/* Championship Snapshot Widget */
.cc-champ-snapshot {
  display: flex;
  flex-direction: column;
}
.cc-champ-header {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: var(--s4);
  margin-bottom: var(--s3);
}
.cc-champ-link {
  color: var(--text-3);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.1s;
}
.cc-champ-link:hover { color: var(--text); }

.cc-champ-group-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: var(--s3) 0 var(--s2);
  padding-left: var(--s2);
}

.cc-champ-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cc-champ-row {
  display: grid;
  grid-template-columns: 105px 1fr auto;
  align-items: center;
  padding: var(--s3) var(--s4);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  font-size: 13px;
  transition: background 0.1s;
}
.cc-champ-row:hover {
  background: rgba(255, 255, 255, 0.05);
}
.cc-champ-left {
  display: flex;
  align-items: center;
  gap: var(--s4);
}
.cc-champ-form {
  display: flex;
  align-items: center;
  justify-content: center;
}
.cc-champ-color {
  width: 3px;
  height: 16px;
  border-radius: 2px;
  box-shadow: 0 0 4px currentColor;
}
.cc-champ-name { font-weight: 600; color: var(--text); }

.cc-champ-right {
  display: grid;
  grid-template-columns: 45px 35px;
  align-items: center;
  gap: var(--s2);
  text-align: right;
}
.cc-champ-pts { font-weight: 700; color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.cc-champ-gap { color: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }

.cc-topbar {
  display: flex;
  align-items: center;
  gap: var(--s5);
  flex-wrap: wrap;
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--border);
}

.cc-topbar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.cc-topbar-meta {
  font-size: 11px;
  color: var(--text-2);
}

.cc-live-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  margin-left: auto;
  font-size: 11px;
  font-family: var(--f-mono);
  color: var(--text-2);
  white-space: nowrap;
}

.cc-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  flex-shrink: 0;
}
.cc-live-dot.live {
  background: var(--red);
  box-shadow: 0 0 6px rgba(225, 6, 0, 0.6);
}

.badge-live {
  background: rgba(225, 6, 0, 0.15);
  color: var(--red);
  border: 1px solid rgba(225, 6, 0, 0.35);
}

/* GP identity band */
.cc-weekend-band {
  display: flex;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  min-height: 124px;
}

.cc-band-accent {
  width: 4px;
  background: var(--gp-accent);
  box-shadow: 0 0 12px var(--gp-accent);
  flex-shrink: 0;
}

.cc-band-body {
  flex: 1;
  padding: var(--s5);
  min-width: 0;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at top right, color-mix(in srgb, var(--gp-accent) 15%, transparent), transparent 60%),
    linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px),
    var(--surface);
  background-size: 100% 100%, 20px 20px, 20px 20px, 100% 100%;
}

.cc-band-body::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.3) 100%);
  pointer-events: none;
}

.cc-band-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  gap: var(--s6);
  min-width: 0;
}

.cc-band-decal {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.9;
  color: var(--text);
  opacity: 0.9;
  align-self: center;
  flex-shrink: 0;
}

.cc-band-titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cc-band-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.cc-kind {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cc-kind-live { color: var(--red); }
.cc-kind-current { color: var(--text); }
.cc-kind-next { color: var(--text-2); }
.cc-kind-recent { color: var(--text-3); }

.cc-band-name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-top: 4px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.cc-band-sub {
  font-size: 11px;
  color: var(--text-3);
}

.cc-band-dates {
  color: var(--text-2);
}

.cc-countdown-block {
  flex-shrink: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding-left: var(--s6);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
  min-width: 200px;
}

.cc-cd-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.cc-cd-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.cc-cd-live { color: var(--red); }
.cc-cd-current { color: var(--text); }
.cc-cd-done { color: var(--text-2); }

.cc-cd-sub {
  font-size: 11px;
  color: var(--text-3);
}

/* Primary actions */
.cc-actions-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--s4);
}

.cc-pri-action {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--s5) var(--s5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  border-left: 3px solid var(--gp-accent);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s, background 0.2s, border-color 0.2s;
  min-width: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.cc-pri-action:hover {
  transform: translateY(-2px) scale(1.01);
  background: var(--surface-h);
  border-color: rgba(255, 255, 255, 0.15);
  border-left-color: var(--gp-accent);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.cc-pri-action.is-live {
  border-left-color: var(--red);
  background: rgba(225, 6, 0, 0.08);
}
.cc-pri-action.is-live:hover {
  background: rgba(225, 6, 0, 0.12);
  box-shadow: 0 8px 24px rgba(225, 6, 0, 0.25);
}

.cc-pri-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.cc-pri-meta {
  font-size: 11px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Schedule strip */
.cc-schedule { display: flex; flex-direction: column; gap: var(--s3); }

.cc-session-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--s3);
}

.cc-session-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--s4);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  min-width: 0;
  transition: transform 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.cc-session-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.cc-session-card.is-current {
  border-color: rgba(225, 6, 0, 0.6);
  background: linear-gradient(135deg, rgba(225, 6, 0, 0.12), rgba(225, 6, 0, 0.02));
  box-shadow: 0 0 16px rgba(225, 6, 0, 0.15);
}
.cc-session-card.is-next {
  border-color: rgba(255, 214, 0, 0.4);
  background: linear-gradient(135deg, rgba(255, 214, 0, 0.08), rgba(255, 214, 0, 0.01));
}
.cc-status-done { opacity: 0.78; }

.cc-session-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
}

.cc-session-abbrev {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 2px 8px;
  min-width: 28px;
  text-align: center;
}

.cc-session-status {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
  padding: 2px 6px;
  border-radius: 4px;
}
.cc-status-pill-live { 
  background: rgba(225, 6, 0, 0.15);
  color: var(--red); 
  border: 1px solid rgba(225, 6, 0, 0.3);
  animation: pulse-live 2s infinite;
}
@keyframes pulse-live {
  0% { box-shadow: 0 0 0 0 rgba(225, 6, 0, 0.4); }
  70% { box-shadow: 0 0 0 4px rgba(225, 6, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(225, 6, 0, 0); }
}
.cc-status-pill-upcoming { 
  background: rgba(255, 214, 0, 0.15);
  color: var(--yellow); 
  border: 1px solid rgba(255, 214, 0, 0.3);
}
.cc-status-pill-done { 
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-3); 
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.cc-session-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-session-time {
  font-size: 10px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-session-cov {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-3);
  margin-top: 2px;
}

.cc-cov-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  flex-shrink: 0;
}
.cc-cov-local { background: var(--green); }
.cc-cov-partial { background: var(--yellow); }
.cc-cov-none { background: var(--text-3); opacity: 0.5; }

/* Recent weekends strip */
.cc-season-calendar { display: flex; flex-direction: column; gap: var(--s3); }

.cc-calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--s4);
}

.cc-calendar-card {
  --gp-card-accent: var(--red);
  position: relative;
  min-height: 148px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s4);
  overflow: hidden;
  background: rgba(18, 18, 18, 0.45);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.cc-calendar-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.cc-calendar-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: color-mix(in srgb, var(--gp-card-accent) 50%, rgba(255, 255, 255, 0.15));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 2px 12px color-mix(in srgb, var(--gp-card-accent) 20%, transparent);
  background: 
    radial-gradient(ellipse at top left, color-mix(in srgb, var(--gp-card-accent) 15%, transparent), transparent 70%),
    rgba(255, 255, 255, 0.05);
}

.cc-calendar-card:hover::before {
  opacity: 1;
}

.cc-calendar-card > * {
  position: relative;
  z-index: 1;
}

.cc-calendar-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gp-card-accent);
}

.cc-calendar-focus {
  border-color: color-mix(in srgb, var(--gp-card-accent) 66%, var(--border));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gp-card-accent) 22%, transparent);
}

.cc-calendar-past {
  filter: grayscale(0.85);
  opacity: 0.75;
}

.cc-calendar-past:hover {
  filter: grayscale(0.1);
  opacity: 1;
}

.cc-calendar-top,
.cc-calendar-id {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
}

.cc-calendar-round {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-3);
}

.cc-calendar-decal {
  position: absolute;
  bottom: -10px;
  right: -5px;
  font-size: 80px;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--gp-card-accent);
  opacity: 0.04;
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.cc-calendar-card:hover .cc-calendar-decal {
  opacity: 0.1;
  transform: scale(1.05) translate(-2px, -2px);
}

.cc-calendar-flag {
  font-size: 18px;
  line-height: 1;
}

.cc-calendar-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cc-calendar-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.cc-calendar-circuit,
.cc-calendar-date {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-calendar-circuit {
  font-size: 10px;
  color: var(--text-2);
}

.cc-calendar-date {
  font-size: 10px;
  color: var(--text-3);
}

.cc-recent { display: flex; flex-direction: column; gap: var(--s3); }

.cc-recent-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--s3);
}

.cc-recent-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--s3) var(--s4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: background 0.1s, border-color 0.1s;
  min-width: 0;
}
.cc-recent-card:hover {
  background: var(--surface-h);
  border-color: var(--border-2);
}

.cc-recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
}

.cc-recent-decal {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-2);
}

.cc-recent-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-recent-meta {
  font-size: 10px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-side-empty {
  font-size: 12px;
  color: var(--text-3);
  padding: var(--s4) 0;
}

.cc-action {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: background 0.1s, border-color 0.1s;
}
.cc-action:hover { background: var(--surface-h); border-color: var(--border-2); }
.cc-action-label { font-size: 13px; font-weight: 600; color: var(--text); }
.cc-action-meta { font-size: 11px; font-family: var(--f-mono); color: var(--text-3); }
.cc-action-live { border-left: 3px solid var(--red); }

/* Empty command center */
.cc-empty {
  max-width: 720px;
  gap: var(--s5);
}

.cc-empty-band {
  padding: var(--s6) var(--s5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.cc-empty-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.cc-empty-title {
  font-size: 22px;
  font-weight: 700;
}

.cc-empty-sub {
  font-size: 13px;
  color: var(--text-2);
  max-width: 56ch;
}

.cc-empty-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s3);
}

.mono { font-family: var(--f-mono); }

/* ── Race Hub Weekend Workspace ── */
.rh-page {
  max-width: 1160px;
  margin: 0 auto;
  padding: var(--s5) var(--s6);
  display: flex;
  flex-direction: column;
  gap: var(--s5);
  --gp-accent: var(--red);
}

.rh-topbar {
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--border);
}

.rh-topbar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.rh-topbar-spacer { flex: 1; }

.rh-switcher-toggle {
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--f-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
  transition: color 0.1s, border-color 0.1s, background 0.1s;
}
.rh-switcher-toggle:hover {
  color: var(--text);
  border-color: var(--border-2);
  background: var(--surface-h);
}
.rh-switcher-toggle.active {
  color: var(--text);
  border-color: var(--gp-accent);
  background: var(--surface-h);
}

/* GP identity band (compact) */
.rh-identity {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  min-height: 96px;
}

.rh-identity-accent {
  width: 5px;
  background: var(--gp-accent);
  flex-shrink: 0;
}

.rh-identity-body {
  flex: 1;
  padding: var(--s4) var(--s5);
  display: flex;
  align-items: center;
  gap: var(--s5);
  min-width: 0;
}

.rh-identity-decal {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.9;
  color: var(--text);
  opacity: 0.9;
  flex-shrink: 0;
}

.rh-identity-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rh-identity-name {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
}

.rh-identity-sub {
  font-size: 11px;
  color: var(--text-3);
}

.rh-identity-dates { color: var(--text-2); }

/* Session rail */
.rh-session-rail {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  gap: var(--s3);
  padding-bottom: var(--s2);
}
.rh-session-rail::-webkit-scrollbar { height: 4px; }
.rh-session-rail::-webkit-scrollbar-thumb { background: var(--border-2); }

.rh-session-chip {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto;
  gap: 2px var(--s3);
  flex: 0 0 auto;
  min-width: 168px;
  padding: var(--s3) var(--s4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: background 0.1s, border-color 0.1s;
}
.rh-session-chip:hover {
  background: var(--surface-h);
  border-color: var(--border-2);
}
.rh-session-chip.active {
  background: rgba(225, 6, 0, 0.05);
  border-color: var(--gp-accent);
  box-shadow: inset 3px 0 0 var(--gp-accent);
}

.rh-session-chip .rh-session-abbrev {
  grid-row: 1 / span 3;
  align-self: center;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 4px 7px;
  min-width: 36px;
  text-align: center;
}
.rh-session-chip.active .rh-session-abbrev {
  color: var(--gp-accent);
  border-color: var(--gp-accent);
}

.rh-session-chip .rh-session-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rh-session-chip .rh-session-time {
  font-size: 10px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rh-session-chip .rh-session-cov {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--text-3);
}

/* Active session sub-bar */
.rh-active-bar {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--s4);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--border);
}
.rh-active-bar .rh-active-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.rh-active-bar .rh-active-meta,
.rh-active-bar .rh-active-cov {
  font-size: 11px;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.rh-active-bar .rh-active-key {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.05em;
}

/* Race Story sub-controls */
.rh-story-controls {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 2px;
  margin-bottom: var(--s4);
  overflow: hidden;
}
.rh-story-btn {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--surface);
  border: none;
  border-right: 1px solid var(--border);
  cursor: pointer;
  transition: color 0.1s, background 0.1s;
}
.rh-story-btn:last-child { border-right: none; }
.rh-story-btn:hover { color: var(--text-2); }
.rh-story-btn.active {
  color: var(--text);
  background: var(--surface-h);
  box-shadow: inset 0 -2px 0 var(--gp-accent);
}

/* Overview tab */
.rh-overview { display: flex; flex-direction: column; gap: var(--s5); }

.rh-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s3);
}

.rh-stat-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gp-accent);
  border-radius: 4px;
  min-width: 0;
}
.rh-stat-card.rh-stat-empty { border-left-color: var(--border-2); }

.rh-stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.rh-stat-primary {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--f-mono);
  color: var(--text);
  line-height: 1.1;
}

.rh-stat-secondary {
  font-size: 12px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rh-stat-tertiary {
  font-size: 11px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rh-stat-highlight {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.rh-podium-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}
.rh-podium-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: var(--s3);
  align-items: baseline;
  font-size: 12px;
}
.rh-podium-pos { color: var(--text-3); }
.rh-podium-p1 .rh-podium-pos { color: #ffd700; font-weight: 700; }
.rh-podium-p2 .rh-podium-pos { color: #c0c0c0; font-weight: 700; }
.rh-podium-p3 .rh-podium-pos { color: #cd7f32; font-weight: 700; }
.rh-podium-driver { font-weight: 700; font-family: var(--f-mono); }
.rh-podium-gap { color: var(--text-3); font-size: 11px; }

.rh-overview-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s4);
}

.rh-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: var(--s4);
  min-width: 0;
}

.rh-empty-line { font-size: 11px; color: var(--text-3); }

.rh-condition-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
}
.rh-condition-chip {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 2px;
  min-width: 64px;
}
.rh-condition-chip.rh-condition-wet { border-color: var(--tyre-wet); }
.rh-condition-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.rh-condition-value {
  font-size: 13px;
  font-weight: 600;
  font-family: var(--f-mono);
  color: var(--text);
}

.rh-rc-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.rh-rc-row {
  display: grid;
  grid-template-columns: 50px 60px 1fr;
  gap: var(--s3);
  align-items: baseline;
  font-size: 11px;
}
.rh-rc-time { color: var(--text-3); }
.rh-rc-flag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}
.rh-rc-flag-yellow { color: var(--yellow); }
.rh-rc-flag-red { color: var(--red); }
.rh-rc-flag-green { color: var(--green); }
.rh-rc-flag-blue { color: #3a6cf5; }
.rh-rc-msg { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }

.rh-coverage-meter {
  height: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: var(--s3);
}
.rh-coverage-fill {
  height: 100%;
  background: var(--gp-accent);
  transition: width 0.2s ease-out;
}

.rh-inline-link {
  color: var(--text-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.rh-inline-link:hover { color: var(--text); }

/* Weekend switcher overlay panel */
.rh-switcher {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: var(--s4);
}
.rh-switcher-head {
  display: flex;
  align-items: center;
  gap: var(--s4);
  flex-wrap: wrap;
  margin-bottom: var(--s4);
}
.rh-switcher-years {
  display: flex;
  gap: var(--s2);
  margin-right: auto;
}
.rh-switcher-year {
  padding: 2px 8px;
  font-size: 11px;
  font-family: var(--f-mono);
  font-weight: 700;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
}
.rh-switcher-year:hover { color: var(--text-2); }
.rh-switcher-year.active {
  color: var(--text);
  border-color: var(--gp-accent);
  background: var(--surface-h);
}
.rh-switcher-close {
  padding: 3px 10px;
  font-size: 10px;
  font-family: var(--f-mono);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
}
.rh-switcher-close:hover { color: var(--text); border-color: var(--border-2); }
.rh-switcher-empty {
  font-size: 11px;
  color: var(--text-3);
  padding: var(--s3) 0;
}
.rh-switcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s3);
}
.rh-switcher-mtg {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.rh-switcher-mtg.current { border-color: var(--gp-accent); }
.rh-switcher-mtg-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  width: 100%;
  background: transparent;
  border: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.rh-switcher-mtg-head:hover { background: var(--surface-h); }
.rh-switcher-decal {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-2);
  min-width: 28px;
}
.rh-switcher-mtg-name {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rh-switcher-mtg-meta {
  font-size: 10px;
  color: var(--text-3);
}
.rh-switcher-sessions {
  display: flex;
  flex-direction: column;
  padding: 0 var(--s2) var(--s2);
}
.rh-switcher-session {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: var(--s3);
  align-items: center;
  padding: 4px 8px;
  background: transparent;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  color: inherit;
  text-align: left;
}
.rh-switcher-session:hover { background: var(--surface-h); }
.rh-switcher-session.active {
  background: rgba(225, 6, 0, 0.05);
  box-shadow: inset 3px 0 0 var(--gp-accent);
}
.rh-switcher-sess-abbrev {
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1px 4px;
}
.rh-switcher-sess-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rh-switcher-sess-cov {
  font-size: 10px;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Race Hub empty state */
.rh-empty { max-width: 720px; gap: var(--s5); }
.rh-empty-band {
  padding: var(--s6) var(--s5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gp-accent);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}
.rh-empty-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.rh-empty-title { font-size: 22px; font-weight: 700; }
.rh-empty-sub { font-size: 13px; color: var(--text-2); max-width: 56ch; }
.rh-empty-actions { display: flex; flex-wrap: wrap; gap: var(--s3); }
.rh-empty-action {
  padding: var(--s3) var(--s4);
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.rh-empty-action:hover { background: var(--surface-h); border-color: var(--border-2); }

@media (max-width: 900px) {
  .rh-overview-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .rh-page { padding: var(--s4); gap: var(--s4); }
  .rh-identity-body { padding: var(--s3) var(--s4); gap: var(--s3); }
  .rh-identity-decal { font-size: 28px; }
  .rh-identity-name { font-size: 17px; }
  .rh-session-chip { min-width: 152px; }
  .rh-stat-primary { font-size: 18px; }
  .rh-active-bar .rh-active-key { margin-left: 0; }
  .rh-switcher-grid { grid-template-columns: 1fr; }
}

/* Tablet */
@media (max-width: 900px) {
  .cc-band-row {
    flex-direction: column;
    gap: var(--s4);
  }
  .cc-band-decal { font-size: 44px; align-self: flex-start; }
  .cc-countdown-block {
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: var(--s4);
    align-items: flex-start;
    text-align: left;
    width: 100%;
  }
  .cc-actions-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Mobile ── */
@media (max-width: 640px) {
  .page { padding: var(--s3); }
  .app-nav { padding: 0 var(--s4); gap: var(--s3); }
  .nav-logo { font-size: 14px; }
  .nav-links a { padding: var(--s2) var(--s3); font-size: 11px; }
  .rh-meeting { font-size: 17px; }

  .session-bar input { flex: 1; max-width: 140px; }

  .live-banner-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s3);
  }
  .live-session-board {
    justify-content: flex-start;
    text-align: left;
    width: 100%;
  }
  .live-clock {
    min-width: 0;
    font-size: 26px;
    text-align: left;
  }
  .live-phase-pill {
    min-width: 48px;
    height: 38px;
    font-size: 16px;
  }
  .live-banner-meta {
    justify-content: flex-start;
    max-width: none;
    width: 100%;
  }
  .live-banner h1 { font-size: 19px; }
  .live-weather-strip { gap: var(--s3); }
  .live-rc-scroll { max-height: 220px; }

  .track-banner { padding: var(--s2) var(--s4); }
  .track-banner-label { font-size: 12px; }
  .track-banner-detail { display: none; }

  .battle-chips,
  .pinned-strip {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: var(--s2);
  }
  .battle-chips::-webkit-scrollbar,
  .pinned-strip::-webkit-scrollbar { display: none; }
  .pinned-card { flex-shrink: 0; }

  .dataset-strip {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: var(--s3);
    padding-bottom: var(--s2);
  }
  .dataset-strip::-webkit-scrollbar { display: none; }

  /* On narrow screens, hide lower-priority table columns */
  .hide-mobile { display: none; }
  .data-table { min-width: 100% !important; }
  .data-table th,
  .data-table td { padding: var(--s2); }
  .drv-code { min-width: 24px; }
  .drv-num { min-width: 14px; }

  .dl-layout { grid-template-columns: 1fr; }
  .dl-nav { border-right: none; border-bottom: 1px solid var(--border); }
  .season-list { flex-direction: row; flex-wrap: wrap; gap: var(--s2); }
  .dl-content-body { grid-template-columns: 1fr; }
  .dl-round-scroll { border-right: none; max-height: 40vh; }
  .dl-detail-wrap { border-top: 1px solid var(--border); }
  .dl-content-header { padding: var(--s3) var(--s4); }
  .dl-content-meta { font-size: 11px; }

  .cc-page { padding: var(--s4); gap: var(--s4); }
  .cc-topbar { gap: var(--s3); }
  .cc-live-pill { margin-left: 0; }
  .cc-band-body { padding: var(--s4); }
  .cc-band-name { font-size: 18px; }
  .cc-band-decal { font-size: 36px; }
  .cc-cd-value { font-size: 20px; }
  .cc-countdown-block { min-width: 0; }
  .cc-actions-row { grid-template-columns: 1fr; }
  .cc-empty-actions { grid-template-columns: 1fr; }
  .cc-empty-title { font-size: 19px; }
}

/* ── Command Center — Paddock Briefing preview strip ── */
.cc-briefing {
  margin-top: var(--s7);
}

.briefing-state {
  margin-top: var(--s4);
  color: var(--text-2);
  font-size: 12px;
}

.sec-action {
  font-size: 11px;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.1s;
  letter-spacing: 0.03em;
}
.sec-action:hover { color: var(--text); }

.cc-brief-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 16px;
  padding: 0 4px;
  margin-left: var(--s2);
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  font-family: var(--f-mono);
  vertical-align: middle;
}

.cc-brief-strip {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cc-brief-item {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  padding: var(--s3) var(--s4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  transition: background 0.1s, border-color 0.1s;
  cursor: pointer;
}
.cc-brief-item:hover {
  background: var(--surface-h);
  border-color: var(--border-2);
}
.cc-brief-item.is-read { opacity: 0.55; }

.cc-brief-item-meta {
  display: flex;
  gap: var(--s3);
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cc-brief-source { color: var(--text-2); font-weight: 700; }
.cc-brief-age   { color: var(--text-3); }

.cc-brief-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Briefing Full Page ── */
.bp-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--s6) var(--s7);
}

.bp-topbar {
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: var(--s5) 0 var(--s4);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s5);
}
.bp-topbar-label { font-size: 11px; color: var(--text-2); letter-spacing: 0.05em; }
.bp-topbar-meta  { font-size: 11px; color: var(--text-3); margin-left: auto; }

/* Category tabs */
.bp-cats {
  display: flex;
  gap: var(--s2);
  margin-bottom: var(--s5);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--s3);
}
.bp-cat {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--s4);
  background: none;
  border: 1px solid transparent;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  border-radius: 2px;
  transition: color 0.1s, border-color 0.1s, background 0.1s;
}
.bp-cat:hover { color: var(--text); background: var(--surface); }
.bp-cat.active {
  color: var(--text);
  border-color: var(--border-2);
  background: var(--surface);
}
.bp-cat-count {
  font-size: 10px;
  color: var(--text-3);
  font-family: var(--f-mono);
}

/* Card grid */
.bp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--s4);
  transition: grid-template-columns 0.2s;
}
.bp-grid.bp-grid-narrow {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.bp-empty {
  padding: var(--s7) 0;
  color: var(--text-2);
  font-size: 13px;
}
.bp-empty code {
  font-family: var(--f-mono);
  font-size: 11px;
  background: var(--surface);
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 2px;
}

.bp-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
}
.bp-pagination-top {
  margin-bottom: var(--s4);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--border);
}
.bp-pagination-bottom {
  justify-content: center;
  margin-top: var(--s5);
}
.bp-pagination-meta,
.bp-page-current {
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.bp-pagination-actions {
  display: flex;
  align-items: center;
  gap: var(--s3);
}
.bp-page-btn {
  min-width: 76px;
  padding: var(--s2) var(--s4);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 2px;
  color: var(--text-2);
  cursor: pointer;
  font-size: 12px;
}
.bp-page-btn:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface-h);
}
.bp-page-btn:disabled {
  color: var(--text-3);
  cursor: not-allowed;
  opacity: 0.45;
}

/* Individual card */
.bp-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
  user-select: none;
}
.bp-card:hover {
  border-color: var(--border-2);
  background: var(--surface-h);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}
.bp-card.bp-card-active {
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red), 0 4px 20px rgba(225, 6, 0, 0.15);
}
.bp-card.bp-card-read { opacity: 0.5; }

.bp-card-img-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-2);
}
.bp-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.bp-card:hover .bp-card-img { transform: scale(1.04); }

.bp-card-img.bp-card-img-fallback,
.bp-card-img-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--border) 100%);
}
.bp-card-img-initial {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-3);
  font-family: var(--f-mono);
}

.bp-video-badge {
  position: absolute;
  top: var(--s3);
  right: var(--s3);
  font-size: 10px;
  font-family: var(--f-mono);
  background: rgba(0,0,0,0.75);
  color: var(--text);
  padding: 2px 6px;
  border-radius: 2px;
  letter-spacing: 0.04em;
}

.bp-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding: var(--s4);
  flex: 1;
}

.bp-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.bp-card-source { color: var(--text-2); font-weight: 700; }
.bp-card-age    { color: var(--text-3); }

.bp-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bp-card-desc {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.bp-card-cat {
  font-size: 9px;
  color: var(--text-3);
  align-self: flex-start;
  padding: 1px 4px;
  border: 1px solid var(--border);
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Reader overlay backdrop */
.bp-reader-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 49;
}

/* Reader panel */
.bp-reader {
  position: fixed;
  top: var(--nav-h);
  right: 0;
  bottom: 0;
  width: min(640px, 92vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  z-index: 50;
  transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.bp-reader.open { transform: translateX(0); }

.bp-reader-toolbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s3) var(--s5);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 2;
}
.bp-reader-toolbar-meta {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.bp-reader-dot { margin: 0 var(--s2); }

.bp-reader-toolbar-actions {
  display: flex;
  align-items: center;
  gap: var(--s3);
}
.bp-reader-open {
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.1s;
  line-height: 1;
}
.bp-reader-open:hover { color: var(--text); }
.bp-reader-close {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.1s;
  line-height: 1;
}
.bp-reader-close:hover { color: var(--text); }

.bp-reader-video-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.bp-reader-video-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.bp-reader-video-desc {
  margin-bottom: var(--s5);
  padding: var(--s4);
  background: var(--surface-2);
  border-left: 3px solid var(--red);
  border-radius: 2px;
}

.bp-reader-hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.bp-reader-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bp-reader-content {
  padding: var(--s6) var(--s6) var(--s7);
}

.bp-reader-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: var(--s4);
}
.bp-reader-byline {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: var(--s5);
  letter-spacing: 0.04em;
}

.bp-reader-loading {
  color: var(--text-2);
  font-size: 13px;
  padding: var(--s6) 0;
}

.bp-reader-error {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  padding: var(--s5) 0;
  color: var(--text-2);
  font-size: 13px;
}
.bp-reader-fallback {
  color: var(--text-2);
  line-height: 1.6;
}
.bp-reader-ext-link {
  color: var(--text-2);
  text-decoration: underline;
  font-size: 12px;
}
.bp-reader-ext-link:hover { color: var(--text); }

/* Extracted article body */
.bp-reader-body {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
}
.bp-reader-body p   { margin-bottom: 1em; }
.bp-reader-body h1,
.bp-reader-body h2,
.bp-reader-body h3  { font-weight: 600; margin: 1.5em 0 0.5em; line-height: 1.3; }
.bp-reader-body h1  { font-size: 18px; }
.bp-reader-body h2  { font-size: 16px; }
.bp-reader-body h3  { font-size: 14px; }
.bp-reader-body a   { color: var(--text-2); text-decoration: underline; }
.bp-reader-body a:hover { color: var(--text); }
.bp-reader-body ul,
.bp-reader-body ol  { padding-left: 1.5em; margin-bottom: 1em; }
.bp-reader-body li  { margin-bottom: 0.3em; }
.bp-reader-body blockquote {
  border-left: 3px solid var(--border-2);
  padding-left: var(--s5);
  color: var(--text-2);
  margin: 1em 0;
}
.bp-reader-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: var(--s5) 0;
}
.bp-reader-body figure { margin: var(--s5) 0; }
.bp-reader-body figcaption {
  font-size: 11px;
  color: var(--text-3);
  margin-top: var(--s2);
}

@media (max-width: 600px) {
  .bp-grid { grid-template-columns: 1fr; }
  .bp-pagination {
    align-items: stretch;
    flex-direction: column;
  }
  .bp-pagination-actions,
  .bp-pagination-bottom {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    width: 100%;
  }
  .bp-page-current {
    align-self: center;
    text-align: center;
  }
  .bp-reader { width: 100vw; }
  .bp-reader-content { padding: var(--s5) var(--s5) var(--s7); }
}

/* ── Race Story Canvas ── */
.race-story-canvas {
  display: flex;
  flex-direction: column;
  gap: var(--s6);
}

.rs-chart-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--s2);
  padding: var(--s4) 0;
  overflow-x: auto;
}

.rs-field-list {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}

.rs-driver-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  padding: var(--s3) var(--s4);
  border: 1px solid var(--border);
  border-radius: var(--s1);
  transition: background 0.15s, border-color 0.15s;
}

.rs-driver-row:hover {
  background: var(--surface-h);
  border-color: var(--border-2);
}

.rs-driver-left {
  display: flex;
  align-items: center;
  gap: var(--s5);
  flex: 1;
}

.rs-pos-col {
  width: 24px;
  text-align: right;
  font-family: var(--f-mono);
  font-weight: 600;
  color: var(--text-2);
}

.rs-pos-p1 { color: var(--yellow); }
.rs-pos-p2 { color: var(--text); }
.rs-pos-p3 { color: var(--text); }

.rs-driver-cell {
  display: flex;
  align-items: center;
  gap: var(--s4);
  flex: 1;
  min-width: 0;
}

.rs-driver-color {
  width: 4px;
  height: 20px;
  border-radius: 2px;
  flex-shrink: 0;
}

.rs-driver-identity {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rs-driver-name {
  font-family: var(--f-mono);
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
}

.rs-driver-team {
  font-size: 11px;
  color: var(--text-2);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.rs-driver-right {
  display: flex;
  align-items: center;
  gap: var(--s6);
  text-align: right;
}

.rs-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--f-mono);
  font-size: 13px;
  line-height: 1.2;
}

.rs-metric-label {
  font-family: var(--f-ui);
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (max-width: 640px) {
  .rs-driver-right {
    gap: var(--s4);
  }
  .rs-driver-team {
    display: none;
  }
}

/* Interactive Race Story Canvas elements */
.rs-driver-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: drawLine 2.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

.rs-pit-dot {
  opacity: 0;
  animation: fadeIn 0.5s ease-in-out 1.5s forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.rs-playhead {
  transition: x1 0.05s linear, x2 0.05s linear;
}

.rs-driver-row-hover {
  background: var(--surface-h);
  border-color: var(--border-2);
}

/* ══════════════════════ Championship Hub ══════════════════════ */
.champ-page {
  max-width: 1040px;
  margin: 0 auto;
  padding: var(--s5) var(--s6) 56px;
}

/* header */
.champ-header {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  padding-bottom: var(--s4);
  border-bottom: 1px solid var(--border);
}
.champ-title-row {
  display: flex;
  align-items: center;
  gap: var(--s4);
}
.champ-accent {
  width: 3px;
  height: 22px;
  background: var(--red);
  border-radius: 1px;
}
.champ-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
}
.champ-season {
  font-size: 11px;
  font-weight: 700;
  color: var(--bg);
  background: var(--red);
  padding: 2px 6px;
  border-radius: 2px;
  letter-spacing: 0.04em;
}
.champ-sub {
  font-size: 13px;
  color: var(--text-2);
}
.champ-tabs {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px;
  align-self: flex-start;
}
.champ-tab {
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--f-ui);
  border: none;
  border-radius: 2px;
  cursor: pointer;
  background: transparent;
  color: var(--text-2);
}
.champ-tab:hover {
  color: var(--text);
}
.champ-tab.is-active {
  background: var(--red);
  color: #fff;
  font-weight: 700;
}

/* stat rail */
.champ-stat-rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: var(--s5);
}
.champ-stat {
  background: var(--surface);
  padding: 12px 14px;
}
.champ-stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.champ-stat-value {
  font-size: 18px;
  font-weight: 700;
  margin-top: 4px;
  line-height: 1;
}
.champ-stat-sub {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 4px;
}

/* podium hero cards */
.champ-podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
}
.champ-podium-card {
  position: relative;
  background: linear-gradient(160deg, #161616, #101010);
  border: 1px solid var(--border);
  border-top: 2px solid var(--text-2);
  border-radius: 3px;
  padding: 16px;
  overflow: hidden;
}
.champ-podium-ghost {
  position: absolute;
  top: -18px;
  right: -6px;
  font-size: 84px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}
.champ-podium-inner {
  position: relative;
}
.champ-podium-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.champ-podium-team {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.champ-podium-id {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 10px;
}
.champ-podium-bar {
  width: 4px;
  height: 30px;
  border-radius: 1px;
  align-self: center;
}
.champ-podium-code {
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
}
.champ-podium-team-name {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}
.champ-podium-name {
  font-size: 13px;
  color: #b8b8b8;
  margin-top: 6px;
}
.champ-podium-pts {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 14px;
}
.champ-podium-pts-num {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.champ-podium-pts-unit {
  font-size: 11px;
  color: var(--text-3);
}
.champ-podium-gap {
  margin-left: auto;
  font-size: 12px;
}
.champ-podium-stats {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.champ-podium-stat-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.champ-podium-stat-label {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* contribution split */
.champ-contrib {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.champ-contrib-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg);
}
.champ-contrib-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.champ-contrib-row .champ-contrib-bar {
  flex: 1;
  max-width: 160px;
}
.champ-contrib-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: #b8b8b8;
}
.champ-contrib-legend em {
  color: var(--text-3);
  font-style: normal;
}
.champ-contrib-names {
  font-size: 11px;
  color: var(--text-2);
}
.champ-contrib-names em {
  color: var(--text-3);
  font-style: normal;
}

/* title math */
.champ-titlemath {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--red);
  border-radius: 3px;
  padding: 12px 16px;
}
.champ-titlemath-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  padding-top: 2px;
  white-space: nowrap;
}
.champ-titlemath-text {
  font-size: 13px;
  color: #b8b8b8;
}

/* tables */
.champ-scroll {
  margin-top: var(--s5);
  overflow-x: auto;
}
.champ-scroll::-webkit-scrollbar {
  height: 8px;
}
.champ-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.champ-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.champ-table-drivers {
  min-width: 760px;
}
.champ-table-teams {
  min-width: 680px;
}
.champ-table th {
  padding: 6px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}
.champ-table th.l,
.champ-table td.l {
  text-align: left;
}
.champ-table th.r,
.champ-table td.r {
  text-align: right;
}
.champ-table th.c,
.champ-table td.c {
  text-align: center;
}
.champ-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #1c1c1c;
}
.champ-table tbody tr:hover {
  background: var(--surface-h);
}
.champ-td-pts {
  font-weight: 700;
  color: var(--text);
}
.champ-td-muted {
  color: var(--text-2);
}
.champ-td-dim {
  color: var(--text-3);
}
.champ-td-team {
  font-size: 11px;
  color: var(--text-2);
}
.champ-drv {
  display: flex;
  align-items: center;
  gap: 5px;
}
.champ-drv-bar {
  width: 3px;
  height: 18px;
  border-radius: 1px;
}
.champ-drv-code {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  min-width: 34px;
}
.champ-drv-name {
  font-size: 12px;
  color: var(--text-2);
}
.champ-drv-num {
  font-size: 10px;
  color: var(--text-3);
}
.champ-team-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.champ-spark {
  display: block;
}
.champ-alive {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* progression chart */
.champ-progression {
  margin-top: 20px;
}
.champ-chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.champ-chart-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.champ-chart-meta {
  font-size: 11px;
  color: var(--text-2);
}
.champ-chart {
  background: #101010;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 14px;
  margin-top: 10px;
}
.champ-chart-svg {
  width: 100%;
  height: auto;
  display: block;
}
.champ-chart-axis {
  fill: var(--text-3);
  font-family: var(--f-mono);
  font-size: 11px;
}
.champ-chart-label {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 700;
}
.champ-chart-empty {
  margin-top: 20px;
  padding: 40px;
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
}
.champ-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
}
.champ-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.champ-legend-swatch {
  width: 14px;
  height: 2px;
  border-radius: 1px;
}
.champ-legend-code {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
}
.champ-legend-name {
  font-size: 11px;
  color: var(--text-2);
}
.champ-legend-total {
  font-size: 11px;
  color: var(--text-3);
}

/* empty state */
.champ-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-h) - 80px);
  text-align: center;
}
.champ-empty-eyebrow {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.champ-empty-title {
  font-size: 22px;
  font-weight: 700;
  margin-top: 10px;
}
.champ-empty-sub {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 8px;
  max-width: 460px;
}

@media (max-width: 720px) {
  .champ-stat-rail {
    grid-template-columns: repeat(2, 1fr);
  }
  .champ-podium {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════ Championship Simulator ══════════════════════ */
.champ-sim {
  margin-top: 20px;
}
.champ-sim-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
}
.champ-sim-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--f-ui);
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
}
.champ-sim-btn:hover {
  color: var(--text);
  border-color: var(--border-2);
}
.champ-sim-rounds {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 12px;
}
.champ-sim-round {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--f-mono);
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
}
.champ-sim-round:hover {
  color: var(--text);
}
.champ-sim-round.is-active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  font-weight: 700;
}
.champ-sim-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}
.champ-sim-editor {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 10px 12px 12px;
}
.champ-sim-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  margin-bottom: 8px;
}
.champ-sim-editor-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.champ-sim-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}
.champ-sim-slot-pos {
  width: 26px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
}
.champ-sim-slot-bar {
  width: 3px;
  height: 16px;
  border-radius: 1px;
  flex: none;
}
.champ-sim-select {
  flex: 1;
  min-width: 0;
  padding: 4px 6px;
  font-size: 11px;
  font-family: var(--f-mono);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
}
.champ-sim-select:focus {
  outline: none;
  border-color: var(--border-2);
}
.champ-sim-slot-pts {
  width: 32px;
  text-align: right;
  font-size: 11px;
  color: var(--text-3);
}
.champ-sim-table-wrap .champ-scroll {
  margin-top: 0;
}
.champ-sim-delta {
  font-size: 11px;
  font-weight: 700;
}
.champ-sim-delta.up {
  color: var(--green);
}
.champ-sim-delta.down {
  color: var(--red);
}
.data-table .pinnable:hover td {
  background: rgba(255, 255, 255, 0.05);
}

.interactive-row:hover td {
  background: rgba(255, 255, 255, 0.05);
}

.ko-line-p15 td, .ko-line-p10 td {
  border-bottom: 1px dashed var(--red) !important;
}

.txt-purple {
  color: var(--purple);
}

.txt-green {
  color: var(--green);
}

.txt-yellow {
  color: var(--yellow);
}
.champ-sim-row-moved td {
  background: rgba(255, 255, 255, 0.03);
}
.champ-sim-caption {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-3);
  max-width: 720px;
}
@media (max-width: 860px) {
  .champ-sim-grid {
    grid-template-columns: 1fr;
  }
}

/* ── UI/UX Revamp Styles ── */

/* Glassmorphism */
.glass-panel {
  background: rgba(18, 18, 18, 0.45);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Base Card Enhancements (Soft borders, inner shadow, hover) */
.ui-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 4px 12px rgba(0,0,0,0.4);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s;
}

.ui-card.interactive:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 24px rgba(0,0,0,0.6);
  border-color: var(--border-2);
}

/* Button & CTA Enhancements */
.ui-cta-primary {
  background: var(--red);
  color: #fff;
  border: none;
  font-weight: 600;
  border-radius: 4px;
  padding: 6px 12px;
  transition: all 0.2s;
  cursor: pointer;
}
.ui-cta-primary:hover {
  background: #f82f34;
  transform: translateY(-1px);
}
