:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #f0f0ed;
  --border: #e2e2dd;
  --text: #17171a;
  --muted: #6b6b73;
  --accent: #e10600;
  --accent-soft: #fde8e7;
  --link: #0b5cad;
  --c-stewards: #c2281d;
  --c-technical: #1f6fb5;
  --c-race_director: #8a5a00;
  --c-results: #2b7a3d;
  --c-admin: #6a4bb0;
  --c-other: #6b6b73;
  --o-penalty: #c2281d;
  --o-reprimand: #b45309;
  --o-warning: #a16207;
  --o-nfa: #3f7d4e;
  --o-other: #6b6b73;
  --o-deleted: #6b6b73;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111114; --surface: #1a1a1f; --surface-2: #232329; --border: #2e2e36;
    --text: #ececef; --muted: #9a9aa5; --accent: #ff3b30; --accent-soft: #3a1715; --link: #6cb2ff;
    --c-stewards: #ff6b5e; --c-technical: #5aa9ef; --c-race_director: #e0a43a; --c-results: #5cc274;
    --c-admin: #a98bf0; --c-other: #9a9aa5;
    --o-penalty: #ff6b5e; --o-reprimand: #f59e0b; --o-warning: #eab308; --o-nfa: #5cc274; --o-other: #9a9aa5; --o-deleted: #9a9aa5;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111114; --surface: #1a1a1f; --surface-2: #232329; --border: #2e2e36;
  --text: #ececef; --muted: #9a9aa5; --accent: #ff3b30; --accent-soft: #3a1715; --link: #6cb2ff;
  --c-stewards: #ff6b5e; --c-technical: #5aa9ef; --c-race_director: #e0a43a; --c-results: #5cc274;
  --c-admin: #a98bf0; --c-other: #9a9aa5;
  --o-penalty: #ff6b5e; --o-reprimand: #f59e0b; --o-warning: #eab308; --o-nfa: #5cc274; --o-other: #9a9aa5; --o-deleted: #9a9aa5;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
button, input, select { font: inherit; color: inherit; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; }
.logo { width: 6px; height: 32px; background: var(--accent); border-radius: 2px; flex: none; }
.brand h1 { font-size: 16px; margin: 0; letter-spacing: -.01em; }
.brand .sub { font-size: 12px; color: var(--muted); }
.views { display: flex; gap: 4px; }
.view-link { padding: 6px 12px; border-radius: 6px; color: var(--muted); font-weight: 500; }
.view-link:hover { background: var(--surface-2); text-decoration: none; }
.view-link.active { color: var(--text); background: var(--surface-2); }
.icon-btn {
  border: 1px solid var(--border); background: var(--surface); border-radius: 6px;
  width: 34px; height: 34px; cursor: pointer; flex: none;
}
.menu-btn { display: none; }

/* layout */
.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: calc(100vh - 55px); }
.sidebar {
  border-right: 1px solid var(--border); background: var(--surface);
  position: sticky; top: 55px; height: calc(100vh - 55px); overflow-y: auto; padding: 12px 8px;
}
.side-head { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 4px 10px 8px; }
.side-foot { font-size: 11px; color: var(--muted); padding: 12px 10px; }
.event-list { list-style: none; margin: 0; padding: 0; }
.event-list a {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 6px; align-items: center;
  padding: 7px 10px; border-radius: 6px; color: var(--text);
}
.event-list a:hover { background: var(--surface-2); text-decoration: none; }
.event-list a.active { background: var(--accent-soft); }
.event-list .rnd { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.event-list .cnt { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.main { padding: 20px 28px 60px; min-width: 0; max-width: 1200px; }
.scrim { display: none; }

/* event header */
.ev-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.ev-head h2 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.ev-head .meta { color: var(--muted); font-size: 13px; }
.ev-head .src { margin-left: auto; font-size: 13px; }

/* category cards */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-bottom: 14px; }
.cat {
  text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 8px;
  padding: 10px 12px; cursor: pointer; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.cat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--cc); }
.cat .n { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.cat .l { font-size: 12px; color: var(--muted); }
.cat[aria-pressed="true"] { border-color: var(--cc); background: color-mix(in srgb, var(--cc) 9%, var(--surface)); }
.cat[aria-pressed="false"].dim { opacity: .55; }
.cat:disabled { opacity: .35; cursor: default; }

/* toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.toolbar input[type=search], .toolbar select {
  height: 34px; border: 1px solid var(--border); background: var(--surface); border-radius: 6px; padding: 0 10px;
}
.toolbar input[type=search] { flex: 1 1 220px; min-width: 0; }
.toolbar label.chk { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; white-space: nowrap; }
.toolbar .spacer { flex: 1; }
.btn {
  height: 34px; border: 1px solid var(--border); background: var(--surface); border-radius: 6px;
  padding: 0 12px; cursor: pointer;
}
.btn:hover { background: var(--surface-2); }

/* sections */
.section { margin-bottom: 26px; }
.section-h { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.section-h .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--cc); }
.section-h .c { color: var(--muted); font-weight: 400; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }

/* document rows */
.doc { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--border); align-items: baseline; }
.doc:first-child { border-top: 0; }
.doc .num { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; padding-left: 12px; white-space: nowrap; }
.doc .line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.doc.recalled .t { text-decoration: none; }
.doc.recalled .subj { text-decoration: line-through; }
.doc .t { min-width: 0; }
.doc .t a { color: var(--text); font-weight: 500; }
.doc .t a:hover { color: var(--link); }
.doc .when { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.doc.recalled .t { text-decoration: line-through; color: var(--muted); }
.doc.superseded { opacity: .6; }
.tagline { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pill {
  display: inline-block; font-size: 11px; line-height: 18px; padding: 0 7px; border-radius: 9px;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.pill.cat-pill { color: var(--cc); background: color-mix(in srgb, var(--cc) 12%, transparent); }
.pill.o-penalty { color: var(--o-penalty); background: color-mix(in srgb, var(--o-penalty) 13%, transparent); }
.pill.o-reprimand { color: var(--o-reprimand); background: color-mix(in srgb, var(--o-reprimand) 13%, transparent); }
.pill.o-warning { color: var(--o-warning); background: color-mix(in srgb, var(--o-warning) 13%, transparent); }
.pill.o-nfa { color: var(--o-nfa); background: color-mix(in srgb, var(--o-nfa) 13%, transparent); }
.pill.o-other, .pill.o-deleted { color: var(--o-other); }

/* stewards rulings */
.ruling { padding: 12px 14px; border-top: 1px solid var(--border); display: grid; grid-template-columns: 52px minmax(0,1fr) auto; gap: 12px; }
.ruling:first-child { border-top: 0; }
.ruling .who { font-weight: 600; }
.ruling .who .team { font-weight: 400; color: var(--muted); }
.ruling .type { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.type-Summons { color: var(--muted); }
.type-Infringement, .type-Corrected { color: var(--o-penalty); }
.type-Decision { color: var(--o-nfa); }
.type-Report, .type-Stewards, .type-Right, .type-Hearing { color: var(--c-technical); }
.ruling .fact { margin-top: 3px; }
.ruling .outcome { margin-top: 6px; padding: 6px 10px; background: var(--surface-2); border-radius: 6px; border-left: 3px solid var(--oc, var(--border)); }
.ruling .outcome b { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; margin-right: 6px; }
.ruling details { margin-top: 6px; font-size: 13px; }
.ruling details summary { cursor: pointer; color: var(--muted); }
.ruling details p { margin: 6px 0 0; white-space: pre-wrap; }
.ruling .rel { font-size: 12px; color: var(--muted); margin-top: 6px; }
.ruling .rel a { margin-right: 6px; }
.flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--accent) 18%, transparent); } to { background: transparent; } }

/* penalties view */
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; box-shadow: var(--shadow); }
.stat .n { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--muted); }
.tbl-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 7px 12px; border-top: 1px solid var(--border); white-space: nowrap; }
thead th { border-top: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; cursor: pointer; user-select: none; background: var(--surface); }
thead th.sorted::after { content: " ↓"; }
thead th.sorted.asc::after { content: " ↑"; }
td.num, th.num { text-align: right; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--surface-2); }
tbody tr.sel { background: var(--accent-soft); }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.ev-link { font-size: 12px; color: var(--muted); }

@media (max-width: 860px) {
  .menu-btn { display: inline-block; }
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 55px; left: 0; bottom: 0; width: 270px; z-index: 30; height: auto;
    transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 30px rgba(0,0,0,.25);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 55px 0 0 0; background: rgba(0,0,0,.3); z-index: 25; }
  .main { padding: 16px 16px 60px; }
  .topbar { padding: 10px 16px; gap: 10px; }
  .brand .sub { display: none; }
  .view-link { padding: 6px 8px; font-size: 13px; }
  .doc, .ruling { grid-template-columns: 58px minmax(0,1fr); }
  .doc .when, .ruling .when { grid-column: 2; }
  .ev-head .src { margin-left: 0; }
}

/* track clock */
.clock { display: grid; grid-template-columns: auto auto; column-gap: 10px; align-items: baseline;
  padding: 4px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.clock[hidden] { display: none; }
.clock-label { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); grid-row: 1; }
.clock-time { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.clock-sub { font-size: 11px; color: var(--muted); grid-row: 2; grid-column: 1; white-space: nowrap; }

/* compact expandable stewards rows */
.section-h .spacer { flex: 1; }
.btn-sm { height: 26px; padding: 0 10px; font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 500; }
details.ruling { border-top: 1px solid var(--border); display: block; padding: 0; }
details.ruling:first-child { border-top: 0; }
details.ruling > summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 10px; padding: 9px 14px; align-items: baseline;
}
details.ruling > summary::-webkit-details-marker { display: none; }
details.ruling > summary:hover { background: var(--surface-2); }
details.ruling > summary .num { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; position: relative; padding-left: 12px; }
details.ruling > summary .num::before { content: "▸"; position: absolute; left: 0; color: var(--muted); transition: transform .15s; }
details.ruling[open] > summary .num::before { transform: rotate(90deg); }
details.ruling .line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-width: 0; }
details.ruling .line .type { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
details.ruling .line .who { font-weight: 600; white-space: nowrap; }
details.ruling .line .subj { min-width: 0; }
details.ruling .when { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
details.ruling.recalled .subj { text-decoration: line-through; color: var(--muted); }
details.ruling[open] { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.ruling-body { padding: 0 14px 12px 88px; display: grid; gap: 6px; }
.ruling-body .meta-line { color: var(--muted); }
.ruling-body .meta-line b { color: var(--text); }
.ruling-body .fact { margin: 0; }
.ruling-body .small { font-size: 12px; }
.ruling-body .outcome { margin: 0; }
.ruling-body .rel { margin: 0; }
.ruling-body .rel .sep { margin: 0 8px; }
.ruling-body details.sub { font-size: 13px; }
.ruling-body details.sub summary { cursor: pointer; color: var(--muted); }
.ruling-body details.sub p { margin: 6px 0 0; white-space: pre-wrap; }
.pill.ev-pill { background: var(--surface-2); color: var(--text); }

@media (max-width: 860px) {
  .clock { padding: 3px 8px; }
  .clock-sub, .clock-label { display: none; }
  .clock-time { font-size: 14px; grid-row: 1; }
  details.ruling > summary { grid-template-columns: 58px minmax(0, 1fr); }
  details.ruling > summary .when { grid-column: 2; }
  .ruling-body { padding: 0 14px 12px 16px; }
}
@media (max-width: 560px) {
  .brand > div { display: none; }
  .views .view-link { padding: 6px 6px; }
}

/* sync */
.sync { margin: 14px 8px 0; padding-top: 12px; border-top: 1px solid var(--border); display: grid; gap: 6px; }
.sync-btn { width: 100%; font-weight: 500; }
.sync-btn:disabled { opacity: .6; cursor: progress; }
.sync-status { font-size: 11px; color: var(--muted); min-height: 14px; }
.sync-status .bad, .bad { color: var(--o-penalty); }
.sync-token { font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px; display: grid; gap: 6px; }
.sync-token[hidden] { display: none; }
.sync-token p, .sync-token ol { margin: 0; }
.sync-token ol { padding-left: 18px; }
.sync-token input { height: 30px; border: 1px solid var(--border); background: var(--surface); border-radius: 6px; padding: 0 8px; width: 100%; }
.sync-actions { display: flex; gap: 6px; }

/* flat list: fixed-width category tag so titles line up */
.line > .cat-pill:first-child { min-width: 152px; text-align: center; }
@media (max-width: 860px) { .line > .cat-pill:first-child { min-width: 0; } }
.sync-auto { display: flex; gap: 6px; align-items: center; font-size: 11px; color: var(--muted); }

/* sessions panel */
.sessions { border-left: 1px solid var(--border); background: var(--surface); padding: 16px 14px;
  position: sticky; top: 55px; height: calc(100vh - 55px); overflow-y: auto; }
.sessions[hidden] { display: none; }
body.has-sessions .layout { grid-template-columns: 260px minmax(0, 1fr) 290px; }
.s-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; display: flex; flex-direction: column; gap: 2px; }
.s-title span { text-transform: none; letter-spacing: 0; font-size: 12px; }
.s-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.s-row { border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; background: var(--surface); }
.s-row.done { background: var(--surface-2); }
.s-row.done .s-name, .s-row.done .s-when { color: var(--muted); }
.s-row.live { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.s-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 8px; margin-bottom: 4px; }
.s-name { font-weight: 650; }
.s-when { font-size: 12.5px; font-variant-numeric: tabular-nums; display: grid; grid-template-columns: 62px 1fr; gap: 6px; align-items: baseline; }
.s-when b { font-weight: 600; }
.s-mine { color: var(--link); }
.s-sub { font-size: 12px; color: var(--muted); }
.s-tag { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-mine .s-tag { color: inherit; opacity: .8; }
.s-badge { font-size: 11px; white-space: nowrap; padding: 1px 7px; border-radius: 9px; }
.s-badge.done { color: var(--o-nfa); background: color-mix(in srgb, var(--o-nfa) 12%, transparent); }
.s-badge.next { color: var(--muted); background: var(--surface-2); }
.s-badge.live { color: #fff; background: var(--accent); display: inline-flex; align-items: center; gap: 5px; }
.s-badge.live i { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.s-note { font-size: 11px; color: var(--muted); margin: 10px 0 0; }
.s-empty { font-size: 13px; }

/* medium screens: sessions move above the documents as a horizontal strip */
@media (max-width: 1279px) {
  body.has-sessions .layout { grid-template-columns: 260px minmax(0, 1fr); }
  .sidebar { grid-row: 1 / span 2; }
  .sessions { grid-column: 2; grid-row: 1; position: static; height: auto; border-left: 0;
    border-bottom: 1px solid var(--border); padding: 12px 28px; }
  .main { grid-column: 2; grid-row: 2; }
  .s-list { grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); overflow-x: auto; padding-bottom: 4px;
    scroll-snap-type: x proximity; scroll-padding-left: 0; }
  .s-list > .s-row { scroll-snap-align: start; }
  /* room after the last card so it can scroll all the way to the left edge */
  .s-list { padding-right: calc(100% - 250px); }
  .s-when > span:last-child { white-space: nowrap; }
  .s-title { flex-direction: row; gap: 8px; align-items: baseline; }
  .s-note { display: none; }
}
@media (max-width: 860px) {
  body.has-sessions .layout { grid-template-columns: 1fr; }
  .sessions, .main { grid-column: 1; }
  .sessions { padding: 12px 16px; }
  /* phones: flex strip; the spacer after the last card is exactly the leftover width,
     so the last card can scroll to the left edge and no further */
  .s-list { display: flex; padding-right: 0; }
  .s-list > .s-row { flex: 0 0 max(260px, 86%); }
  .s-list::after { content: ""; flex: 0 0 calc(100% - max(260px, 86%) - 8px); }
}
.s-when.s-plain { display: block; }
.s-open { display: flex; align-items: center; justify-content: center; margin-top: 12px; width: 100%; font-weight: 500; color: var(--text); text-decoration: none; }
.s-open:hover { text-decoration: none; }
@media (max-width: 1279px) { .s-open { width: auto; display: inline-flex; margin-top: 8px; height: 30px; font-size: 13px; } }

/* championship switch (top of the events sidebar) */
.series-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; margin: 0 2px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }
.series-switch a { text-align: center; padding: 6px 0; border-radius: 6px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.series-switch a:hover { text-decoration: none; color: var(--text); }
.series-switch a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.series-switch a.active::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: middle; }

/* track weather */
.wx { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.wx-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.wx-table { table-layout: fixed; }
.wx-table th:first-child { width: 34%; }
.wx-table th, .wx-table td { padding: 6px 5px; text-align: right; border-top: 1px solid var(--border); white-space: nowrap; font-size: 12.5px; }
.wx-table thead th { border-top: 0; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; cursor: default; background: var(--surface-2); }
.wx-table tbody th { text-align: left; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.wx-table tbody tr { cursor: default; }
.wx-table tbody tr:hover { background: transparent; }
.wx-table td b { font-weight: 650; }
.wx-table tbody th small { font-size: 9.5px; opacity: .8; }
.wx-rain.light { color: var(--c-technical); font-weight: 600; }
.wx-rain.moderate { color: var(--o-reprimand); font-weight: 650; }
.wx-rain.heavy { color: var(--o-penalty); font-weight: 700; }
@media (max-width: 1279px) {
  .wx { max-width: 460px; }
  .wx .s-note { display: block; }
}

/* forecast rain chance on session cards */
.s-rain { margin-top: 6px; font-size: 12px; padding: 3px 8px; border-radius: 6px; display: inline-flex; gap: 5px; align-items: center;
  background: var(--surface-2); color: var(--muted); }
.s-rain span { font-size: 13px; }
.s-rain.mid { color: var(--c-technical); background: color-mix(in srgb, var(--c-technical) 12%, transparent); }
.s-rain.high { color: var(--o-penalty); background: color-mix(in srgb, var(--o-penalty) 12%, transparent); font-weight: 600; }

/* F2 pages use F2 blue as the accent (logo bar, selected round, switch dot, live badges, round banner). */
:root[data-series="f2"] { --accent: #089be2; --accent-soft: #e0f2fc; }
@media (prefers-color-scheme: dark) {
  :root[data-series="f2"]:not([data-theme="light"]) { --accent: #089be2; --accent-soft: #0b2c3d; }
}
:root[data-series="f2"][data-theme="dark"] { --accent: #089be2; --accent-soft: #0b2c3d; }

/* round / page title banner: series-coloured bar and tint */
.ev-head {
  border-left: 4px solid var(--accent); padding: 10px 14px 10px 14px; border-radius: 0 8px 8px 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%);
}
.ev-head > div:first-child > .meta:first-child { color: var(--accent); font-weight: 600; letter-spacing: .01em; }

/* "Group by type" toggle, sits at the end of the category cards */
.group-toggle {
  display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer;
  border: 1px dashed var(--border); background: transparent; border-radius: 8px; padding: 10px 12px; color: var(--text);
}
.group-toggle:hover { background: var(--surface-2); }
.group-toggle[aria-checked="true"] { border-style: solid; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.group-toggle .sw { flex: none; width: 34px; height: 20px; border-radius: 10px; background: var(--border); position: relative; transition: background .15s; }
.group-toggle .sw i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.group-toggle[aria-checked="true"] .sw { background: var(--accent); }
.group-toggle[aria-checked="true"] .sw i { transform: translateX(14px); }
.group-toggle .gt-text { display: flex; flex-direction: column; line-height: 1.25; }
.group-toggle .gt-text b { font-weight: 600; font-size: 13px; }
.group-toggle .gt-text small { font-size: 11.5px; color: var(--muted); }

/* F3 pages: F3 orange accent */
:root[data-series="f3"] { --accent: #f77331; --accent-soft: #feede3; }
@media (prefers-color-scheme: dark) {
  :root[data-series="f3"]:not([data-theme="light"]) { --accent: #f77331; --accent-soft: #3d2111; }
}
:root[data-series="f3"][data-theme="dark"] { --accent: #f77331; --accent-soft: #3d2111; }

/* Sky Sports F1 live coverage line on session cards */
.s-tv { margin-top: 6px; font-size: 12px; color: var(--text); display: block; line-height: 1.4; }
.s-tv b { font-weight: 600; }
.s-tv span { font-size: 12px; }

/* TV coverage on air now (coverage start -> session end) */
.s-tv.on-air { color: var(--accent); }
.s-tv.on-air b { font-weight: 700; letter-spacing: .02em; }
.s-tv.on-air i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  margin: 0 4px 1px 2px; vertical-align: middle; animation: pulse 1.2s ease-in-out infinite; }

/* monochrome TV icon (mdi:monitor) on the coverage line */
.s-tv .tv-ico { width: 1.1em; height: 1.1em; vertical-align: -0.18em; margin-right: 3px; }

/* series label beside the accent bar: phones only (the full title is hidden there) */
.brand-series { display: none; }
@media (max-width: 560px) {
  .brand-series { display: inline; font-weight: 800; font-size: 18px; letter-spacing: -.01em; color: var(--accent); margin: 0 6px 0 -2px; }
}
