/* RACE FACE brand system — FAST. FEARLESS. FOCUSED.
   Aggressive, dark, monochrome + race red. Tokens + Bootstrap overrides + cockpit components.
   Fonts (Inter + Rajdhani) are loaded via <link> in App.razor. */
:root {
  /* Override Bootstrap Reboot's `scroll-behavior:smooth` — combined with Blazor's same-document scroll-reset
     on navigation it ANIMATED the scroll-to-top (you'd see the list scroll up before a page opened). Instant. */
  scroll-behavior: auto;
  --bg: #0A0A0A;       /* brand black */
  --s1: #161618;       /* card — charcoal */
  --s2: #1E1F22;       /* raised */
  --s3: #2A2B2F;       /* overlay */
  --line: rgba(255,255,255,.10);
  --line-2: rgba(255,255,255,.16);
  --hi: #F5F6F7;
  --mid: #B7BCC4;
  --low: #80858E;      /* steel gray */
  --effort: #E30613;   /* RACE RED — primary / you / interactive */
  --effort-ink: #FFFFFF;
  --data: #D7DDE5;     /* metrics / accents — steel-white */
  --good: #3FD17A;
  --warn: #F5B642;
  --bad: #F2545B;
  --gold: #F5B642; --silver: #C2C6D2; --bronze: #CD7F46;
  --r-md: 10px; --r-lg: 14px;
  --font-display: 'Rajdhani', 'Inter', system-ui, sans-serif;  /* condensed sporty headlines */
}

html, body {
  background: var(--bg);
  color: var(--hi);
  font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}
.num { font-variant-numeric: tabular-nums; }
h1, h2, h3, h4, h5 { color: var(--hi); font-family: var(--font-display); font-weight: 600; letter-spacing: .015em; }
h1, h2 { text-transform: uppercase; letter-spacing: .03em; font-weight: 700; }
/* Unified paragraph typography — every <p> shares one compact, consistent size/leading
   (p.small beats Bootstrap's .small so helper paragraphs don't render a size larger). */
p, p.small { font-size: 12px; line-height: 1.5; }
a { color: var(--effort); text-decoration: none; }
a:hover { color: #ff3b47; }
.text-secondary { color: var(--mid) !important; }
.text-muted { color: var(--low) !important; }
.text-success { color: var(--good) !important; }
.text-danger { color: var(--bad) !important; }
.text-warning { color: var(--warn) !important; }
.small, .form-text { color: var(--mid); }

/* Series "race cards" on the standings landing */
.rs-series-card { display: flex; flex-direction: column; gap: 10px; height: 100%; padding: 16px; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--hi); text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.rs-series-card:hover { border-color: var(--effort); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(227,6,19,.16), 0 8px 24px rgba(0,0,0,.4); }
.rs-series-top { display: flex; justify-content: space-between; align-items: center; color: var(--data); }
.rs-series-year { font-family: var(--font-display); color: var(--effort); font-size: 33px; font-weight: 700; line-height: 1; letter-spacing: 0; }
.rs-series-top .bi { font-size: 22px; opacity: .45; }
.rs-series-logo { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; display: block; }
.rs-series-card.past .rs-series-logo { opacity: .72; }
/* Past seasons read as secondary so the current (latest) season's cards stand out. */
.rs-series-card.past { opacity: .82; }
.rs-series-card.past .rs-series-top { color: var(--mid); }
.rs-series-card.past .rs-series-year { color: var(--mid); font-weight: 700; }
.rs-series-card.past:hover { opacity: 1; }
.rs-series-name { font-size: 17px; font-weight: 600; line-height: 1.25; color: var(--hi); }
.rs-series-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.rs-series-chips span { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 12px; background: rgba(255,255,255,.06); color: var(--data); }
.rs-series-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--low); border-top: 1px solid var(--line); padding-top: 10px; }
.rs-series-body { display: flex; flex-direction: column; gap: 10px; flex: 1; color: var(--hi); text-decoration: none; }
.rs-series-go { color: var(--mid); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.rs-series-go:hover { color: var(--effort); }
.rs-series-linked { display: inline-flex; align-items: center; gap: 4px; color: var(--good); font-weight: 700; }
.rs-series-link { display: inline-flex; align-items: center; gap: 4px; color: var(--data); font-weight: 600; }
.rs-series-link:hover { color: #ff3b47; }
.rs-series-foot-left { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.rs-series-dep { display: inline-flex; align-items: center; gap: 4px; color: var(--low); font-weight: 600; }

/* Ride-map overlay controls (gradient / speed / elevation + direction) */
.rf-map-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 8px; font-size: 13px; color: var(--low); }
.rf-map-controls label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.rf-map-controls input[type=checkbox] { accent-color: var(--data); margin: 0; }
.rf-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--low); }
.rf-legend-bar { width: 110px; height: 8px; border-radius: 4px; border: 1px solid var(--line); }
.rf-arrow { background: transparent !important; border: 0 !important; }

/* Collapsible whose summary is styled as a button (hide the default disclosure marker) */
.rf-collapse > summary { list-style: none; cursor: pointer; }
.rf-collapse > summary::-webkit-details-marker { display: none; }
.rf-collapse > summary::marker { content: ""; }
.rf-chev { transition: transform .15s; }
.rf-collapse[open] > summary .rf-chev { transform: rotate(90deg); }
/* "Series participated" toggle: show a divider above it only once the list is expanded. */
.rf-collapse[open] > .rf-series-sum { border-top: 1px solid var(--line); padding-top: 10px; }

/* Row of action collapses (Add New Rider / Link an existing rider) sitting side by side;
   an open one spans the full width so its form isn't cramped, pushing the other to the next line. */
.rf-actionrow > details[open] { flex-basis: 100%; }

/* Surfaces */
.card, .rs-card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--hi); }
.list-group-item { background: var(--s1); border-color: var(--line); color: var(--hi); }
.list-group-item-action:hover { background: var(--s2); }

/* Tables */
.table { color: var(--hi); --bs-table-bg: transparent; --bs-table-color: var(--hi); }
.table > :not(caption) > * > * { background: transparent; color: var(--hi); border-bottom-color: var(--line); }
.table thead th { color: var(--low); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; border-bottom-color: var(--line-2); }
/* Compact variant — fits the Race Results 5 columns comfortably on narrow phones. */
.table.rs-tight { font-size: 14px; }
.table.rs-tight > :not(caption) > * > * { padding: .35rem .4rem; }
.table.rs-tight thead th { font-size: 12px; }

/* Forms */
.form-control, .form-select {
  background: var(--s1); color: var(--hi);
  border: 1px solid var(--line-2); border-radius: var(--r-md);
}
.form-control::placeholder { color: var(--low); }
.form-control:focus, .form-select:focus {
  background: var(--s1); color: var(--hi); border-color: var(--effort);
  box-shadow: 0 0 0 3px rgba(227,6,19,.25);
}
.form-select option { background: var(--s2); color: var(--hi); }
/* Keyboard focus ring — visible on the dark theme (mouse clicks don't trigger :focus-visible). */
a:focus-visible, button:focus-visible, .btn:focus-visible, [role="button"]:focus-visible, summary:focus-visible {
  outline: 2px solid var(--effort); outline-offset: 2px; border-radius: 5px;
}
.form-label, .form-check-label { color: var(--mid); }
.form-check-input { background: var(--s2); border-color: var(--line-2); }
.form-check-input:checked { background: var(--effort); border-color: var(--effort); }

/* Buttons */
.btn-primary { background: var(--effort); border-color: var(--effort); color: var(--effort-ink); font-weight: 500; }
.btn-primary:hover { background: #ff2b38; border-color: #ff2b38; color: var(--effort-ink); }
.btn-outline-primary { color: var(--effort); border-color: var(--effort); }
.btn-outline-primary:hover { background: var(--effort); color: var(--effort-ink); }
.btn-link { color: var(--data); }

/* Badges */
.badge.text-bg-primary { background: var(--effort) !important; color: var(--effort-ink) !important; }
.badge.text-bg-light { background: var(--s2) !important; color: var(--mid) !important; }

/* ---- Cockpit components ---- */
.rs-label { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--low); }

.rs-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.rs-chip { font-size: 12px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--mid); background: transparent; }
.rs-chip.on { background: var(--effort); border-color: var(--effort); color: var(--effort-ink); }

.rs-row { display: flex; align-items: center; gap: 12px; padding: 10px 10px; border-radius: var(--r-md); }
.rs-row + .rs-row { border-top: 1px solid var(--line); }
.rs-rank { width: 22px; text-align: center; font-weight: 500; color: var(--low); }
.rs-row.r1 .rs-rank { color: var(--gold); } .rs-row.r2 .rs-rank { color: var(--silver); } .rs-row.r3 .rs-rank { color: var(--bronze); }
.rs-av { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--effort-ink); background: var(--s3); flex: 0 0 32px; }
.rs-row.r1 .rs-av { background: var(--gold); } .rs-row.r2 .rs-av { background: var(--silver); } .rs-row.r3 .rs-av { background: var(--bronze); }
.rs-row.r1 .rs-av, .rs-row.r2 .rs-av, .rs-row.r3 .rs-av { color: #14151A; }  /* dark ink on light medal avatars */
.rs-pts { text-align: right; font-size: 16px; font-weight: 500; color: var(--data); }
.rs-you { border: 1px solid rgba(227,6,19,.55); background: rgba(227,6,19,.10); }
.rs-you .rs-rank, .rs-you .rs-av { color: var(--effort); }
.rs-you .rs-av { background: var(--effort); color: var(--effort-ink); }
/* "Mine" — a row that is the signed-in user or one of their riders (standings). */
.rs-row.rs-mine { border: 1px solid rgba(63,209,122,.55); background: rgba(63,209,122,.10); }
.rs-row.rs-mine .rs-rank { color: var(--good); }
.rs-row.rs-mine .rs-av { background: var(--good); color: #06210f; }
.rs-mine-tag { display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--good); background: rgba(63,209,122,.16); border-radius: 8px; padding: 1px 7px; vertical-align: middle; }
.rs-tag { font-size: 9px; color: var(--effort); border: 1px solid var(--effort); border-radius: 4px; padding: 0 4px; }

.rs-hero { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; display: flex; align-items: flex-end; justify-content: space-between; }
.rs-hero-num { font-size: 38px; font-weight: 500; line-height: 1; }
.rs-tile { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; }
.rs-tile-num { font-size: 17px; font-weight: 500; }

/* App shell + bottom tab bar */
.rs-shell { min-height: 100vh; padding-bottom: calc(66px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.rs-topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: rgba(10,10,10,.92); backdrop-filter: blur(8px); z-index: 10; box-shadow: 0 8px 16px -6px rgba(0,0,0,.85); }
/* ---- Top-right hamburger menu (native <details> dropdown) ---- */
.rs-menu { position: relative; }
.rs-menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 9px; color: var(--hi); font-size: 22px; }
.rs-menu > summary::-webkit-details-marker { display: none; }
.rs-menu > summary::marker { content: ""; }
.rs-menu > summary:hover { background: var(--s2); }
.rs-menu[open] > summary { background: var(--s2); color: var(--effort); }
.rs-menu-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; background: var(--s1); border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: 0 12px 34px rgba(0,0,0,.55); padding: 6px; z-index: 30; display: flex; flex-direction: column; }
.rs-menu-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; color: var(--hi); text-decoration: none; background: none; border: none; width: 100%; text-align: left; font: inherit; font-size: 14px; cursor: pointer; }
.rs-menu-item:hover { background: var(--s2); color: var(--hi); }
.rs-menu-item i { color: var(--data); width: 18px; text-align: center; }
.rs-menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.rs-topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(to right, var(--effort), transparent); pointer-events: none; }
/* Tyre calc: fields locked to the chosen bike stay READABLE (browsers grey out plain disabled text on a dark theme). */
.form-control.rf-locked, .form-select.rf-locked { color: var(--hi); -webkit-text-fill-color: var(--hi); opacity: 1; background-color: var(--s2); border-style: dashed; cursor: default; }
.rs-brand { display: inline-flex; align-items: center; font-family: var(--font-display); font-weight: 700; font-style: italic; text-transform: uppercase; letter-spacing: .04em; font-size: 21px; color: var(--hi); }
.rs-brand .dot { color: var(--effort); font-style: normal; }
.rs-brand-mark { height: 26px; width: 26px; border-radius: 6px; margin-right: 9px; mix-blend-mode: screen; }
.rs-brand-logo { height: 30px; width: auto; display: block; }
/* Discreet "Dashboard" link in the mobile topbar (guardian roles) → wide desktop /guardian view. */
.rs-topbar-dash { color: var(--mid); text-decoration: none; font-size: 13px; display: inline-flex; align-items: center; gap: 5px; margin-right: 14px; }
.rs-topbar-dash:hover { color: var(--data); }
.rs-main { max-width: 880px; margin: 0 auto; padding: 16px; width: 100%; flex: 1 1 auto; display: flex; flex-direction: column; }
/* Persistent "your profile" bar under the top bar, on every screen. */
.rs-profilebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.rs-profilebar-id { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--hi); min-width: 0; }
.rs-profilebar-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.rs-profilebar-name { font-family: var(--font-display); font-size: 17px; font-weight: 600; letter-spacing: .02em; color: var(--hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-profilebar-name .rf-ln { color: var(--effort); margin-left: .3em; }  /* surname in race red */
.rs-profilebar-sub { font-size: 12px; color: var(--mid); }
.rs-profilebar-gear { flex: 0 0 auto; color: var(--data); font-size: 22px; line-height: 1; padding: 6px; text-decoration: none; }
.rs-profilebar-gear:hover { color: var(--hi); }
/* "Verify your email" nudge bar (unverified accounts) */
.rs-verifybar { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; background: rgba(245,182,66,.12); border-bottom: 1px solid rgba(245,182,66,.30); color: var(--warn); font-size: 13px; text-decoration: none; }
.rs-verifybar:hover { background: rgba(245,182,66,.18); color: var(--warn); }
/* Full-screen "generating avatar" loading overlay */
.rf-genoverlay { position: fixed; inset: 0; background: rgba(10,13,18,.82); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 100; }
.rf-genbox { display: flex; flex-direction: column; align-items: center; gap: 13px; color: var(--hi); text-align: center; max-width: 340px; padding: 28px 26px; background: linear-gradient(180deg, var(--s1), #11151b); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 30px 90px -30px rgba(0,0,0,.85); }
.rf-gentitle { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; font-size: 19px; color: var(--hi); }
.rf-gentext { font-size: 14px; color: var(--mid); min-height: 1.2em; transition: opacity .22s ease; }
.rf-gennote { font-size: 12px; color: var(--low); margin-top: 2px; }
.rf-genbox .rf-progress { width: 100%; }
.rf-spinner { width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--effort); animation: rf-spin .8s linear infinite; }
@keyframes rf-spin { to { transform: rotate(360deg); } }
/* Uploaded profile photo (falls back to the identicon when none is set). */
.rs-avatar-img { border-radius: 50%; object-fit: cover; flex: 0 0 auto; display: block; }
.rs-avatar-edit { position: relative; display: inline-block; line-height: 0; }
.rs-avatar-click { position: relative; display: inline-block; cursor: pointer; line-height: 0; }
.rs-avatar-cam { position: absolute; right: -2px; bottom: -2px; width: 20px; height: 20px; border-radius: 50%; background: var(--data); color: #06121a; display: flex; align-items: center; justify-content: center; font-size: 11px; border: 2px solid #0b0e13; }
/* Race Face card social-share buttons */
.rf-share { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; border: none; color: #fff; font-size: 20px; cursor: pointer; transition: transform .12s, filter .12s; }
.rf-share:hover { transform: translateY(-1px); filter: brightness(1.08); }
.rf-wa { background: #25D366; }
.rf-fb { background: #1877F2; }
.rf-ig { background: linear-gradient(45deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5); }
.rf-dl { background: var(--effort); }
.rf-vid { background: linear-gradient(45deg, #f43f5e, #a855f7); }
.rf-share:disabled { opacity: .85; cursor: default; transform: none; }
.rf-spin { display: inline-block; animation: rf-rot .8s linear infinite; }
@keyframes rf-rot { to { transform: rotate(360deg); } }
/* Story-video status line (keeps the round share buttons clean — no text crammed inside the 44px circle). */
.rf-vidstatus { display: none; align-items: center; gap: 9px; margin-top: 12px; font-size: 13px; color: var(--mid); }
.rf-vidstatus.show { display: inline-flex; }
.rf-vdot { width: 15px; height: 15px; flex: 0 0 auto; border: 2px solid var(--line-2); border-top-color: var(--effort); border-radius: 50%; animation: rf-spin .7s linear infinite; }
.rf-verr { color: #f87171; }
.rf-savebtn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border: none; border-radius: 999px; background: linear-gradient(45deg, #f43f5e, #a855f7); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; box-shadow: 0 6px 18px -6px rgba(168,85,247,.7); transition: filter .12s, transform .12s; }
.rf-savebtn:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* ---- Auth (sign in / create account) — split card: brand panel + form ---- */
.auth-split { display: flex; max-width: 860px; margin: 6vh auto; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: 0 24px 70px rgba(0,0,0,.45); }
.auth-brandpanel { flex: 1 1 0; min-width: 0; padding: 44px 38px; position: relative; display: flex; flex-direction: column; justify-content: center; background: linear-gradient(155deg, var(--s2), var(--bg)); }
.auth-brandpanel::after { content: ""; position: absolute; inset: 0; background: radial-gradient(110% 75% at 85% -5%, rgba(227,6,19,.20), transparent 60%); pointer-events: none; }
.auth-brand { font-family: var(--font-display); font-size: 30px; font-weight: 700; font-style: italic; text-transform: uppercase; letter-spacing: .05em; color: var(--hi); margin-bottom: 22px; position: relative; }
.auth-brand .dot { color: var(--effort); font-style: normal; }
.auth-hero { width: 100%; max-width: 380px; height: auto; display: block; margin: -4px 0 16px; mix-blend-mode: screen; }

/* ---- Brand flourishes: red speed slashes + "FAST. FEARLESS. FOCUSED." tagline ---- */
.rf-slashes { display: inline-block; width: 50px; height: 14px; background: repeating-linear-gradient(110deg, var(--effort) 0, var(--effort) 3px, transparent 3px, transparent 8px); transform: skewX(-12deg); }
.rf-tagline { font-family: var(--font-display); text-transform: uppercase; font-weight: 700; letter-spacing: .18em; color: var(--hi); font-size: 14px; display: inline-flex; align-items: center; gap: 0; }
.rf-tagline .dot { color: var(--effort); }
/* A centered brand strip (slashes + tagline + slashes) for page footers. */
.rf-brandstrip { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 26px 0 6px; opacity: .9; }
.rf-brandstrip .rf-slashes { width: 34px; }

/* Inline loading spinner (red top) — used by the RfLoading component wherever data is loading. */
.rf-load { display: inline-flex; align-items: center; gap: 10px; color: var(--mid); font-size: 13px; padding: 6px 0; }
.rf-load::before { content: ""; width: 18px; height: 18px; flex: 0 0 auto; border: 2px solid var(--line-2); border-top-color: var(--effort); border-radius: 50%; animation: rf-spin .7s linear infinite; }
/* Thin top progress bar for page-level loads. */
.rf-progress { height: 3px; border-radius: 2px; overflow: hidden; background: var(--line); position: relative; }
.rf-progress::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--effort); border-radius: 2px; animation: rf-indeterminate 1.1s ease-in-out infinite; }
@keyframes rf-indeterminate { 0% { left: -40%; } 100% { left: 100%; } }
.auth-tagline { font-family: var(--font-display); font-size: 40px; font-weight: 700; text-transform: uppercase; line-height: 1.04; color: var(--hi); margin: 0 0 14px; letter-spacing: .02em; position: relative; }
.auth-tagline em { color: var(--effort); font-style: normal; }
.auth-blurb { color: var(--mid); font-size: 15px; line-height: 1.5; position: relative; margin: 0 0 20px; }
.auth-feats { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; position: relative; }
.auth-feats li { color: var(--hi); font-size: 14px; display: flex; align-items: center; gap: 10px; }
.auth-feats i { color: var(--data); font-size: 16px; }
.auth-formpanel { flex: 1 1 0; min-width: 0; padding: 44px 38px; background: var(--s1); }
.auth-title { font-size: 26px; font-weight: 700; margin: 0 0 4px; color: var(--hi); }
.auth-sub { color: var(--mid); font-size: 14px; margin: 0 0 22px; }
.auth-form label { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 500; color: var(--mid); }
.auth-form .auth-field { margin-bottom: 14px; }
.auth-error { background: rgba(242,84,91,.12); border: 1px solid rgba(242,84,91,.32); color: #f7a6aa; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 16px; }
.auth-alt { margin-top: 20px; font-size: 14px; color: var(--mid); }
.auth-foot { text-align: center; color: var(--low); font-size: 12px; margin-top: 10px; }
@media (max-width: 680px) {
  /* margin:0 (not "0 auto") — .rs-main is itself a flex column, and auto cross-axis margins on a flex
     item disable align-items:stretch, shrink-wrapping .auth-split to its content width instead of filling
     the screen edge-to-edge as the stripped border/radius/shadow below already signal it should. */
  .auth-split { flex-direction: column; margin: 0; border: none; border-radius: 0; box-shadow: none; }
  .auth-brandpanel { padding: 26px 24px 20px; }
  .auth-tagline { font-size: 28px; }
  .auth-blurb, .auth-feats { display: none; }
  .auth-formpanel { padding: 26px 24px; }
}

/* ---- Realtime "now" line on the race-day timeline / fuelling schedule ---- */
.rf-nowline { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--effort); z-index: 3; pointer-events: none; transition: top .6s linear; }
.rf-nowline::before { content: ""; position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--effort); box-shadow: 0 0 6px var(--effort); }
.rf-nowlabel { position: absolute; right: 0; top: -9px; background: var(--effort); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 1px 6px; border-radius: 3px; }

/* ---- Collapsible season panel: the series card is the toggle; everything below it opens on click ---- */
.rf-seasonpanel > summary { list-style: none; cursor: pointer; }
.rf-seasonpanel > summary::-webkit-details-marker { display: none; }
.rf-seasonpanel > summary::marker { content: ""; }
/* Inline display:flex on some children (name row, .row tiles) overrides the UA closed-details hiding,
   so hide every non-summary child explicitly when collapsed. */
.rf-seasonpanel:not([open]) > :not(summary) { display: none !important; }
.rf-seasonpanel[open] .rf-seasonchev { transform: rotate(180deg); }
/* Non-selected seasons render as collapsed link cards that navigate (load) on click. */
.rf-seasonlink { display: block; text-decoration: none; }
.rf-seasonlink:hover .rs-card { background: var(--s2); }

/* ---- Draggable fuelling intakes on the race-day timeline (snap to the moment above) ---- */
.rf-drag-handle { touch-action: none; cursor: grab; }
.rf-tl-intake { position: relative; }
.rf-tl-intake.rf-dragging { opacity: .85; background: var(--s2); cursor: grabbing; }
[data-offset].rf-drop-after { box-shadow: inset 0 -2px 0 var(--effort); }

.rs-tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: #0E0E10; border-top: 1px solid var(--line); box-shadow: inset 0 2px 0 var(--low); padding: 4px 0 calc(6px + env(safe-area-inset-bottom)); z-index: 20; }
.rs-tab { flex: 1; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--low); font-size: 11px; font-weight: 500; text-decoration: none; }
.rs-tab .ico { font-size: 22px; }
.rs-tab.active { color: var(--effort); }

/* ---- GUARDIAN dashboard (desktop-first) — /guardian. Wide, fluid, two-column; collapses on phones. ---- */
.rf-dash-wide { max-width: 1440px; margin: 0 auto; width: 100%; }
/* Side rail (controls/summary) + fluid content. */
.rf-dash { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: start; }
.rf-dash-side { position: sticky; top: 84px; align-self: start; }
.rf-dash-content { min-width: 0; }
/* Dependant cards auto-fit into as many columns as fit; each is comfortable but never cramped. */
.rf-dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }
.rf-depcard { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.rf-depcard-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
/* Subsections inside a dependant card get a hairline divider for density without clutter. */
.rf-depsection { border-top: 1px solid var(--line); padding-top: 10px; }

/* Consent toggles (interactive — no SSR form). iOS-style switch reusing the cockpit palette. */
.rf-consent-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.rf-consent-row + .rf-consent-row { border-top: 1px solid var(--line); }
.rf-toggle { position: relative; width: 44px; height: 24px; flex: 0 0 auto; border-radius: 999px; border: 1px solid var(--line-2); background: var(--s2); cursor: pointer; padding: 0; transition: background .15s, border-color .15s; }
.rf-toggle:disabled { opacity: .5; cursor: not-allowed; }
.rf-toggle.on { background: var(--effort); border-color: var(--effort); }
.rf-toggle-knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--hi); transition: transform .15s; }
.rf-toggle.on .rf-toggle-knob { transform: translateX(20px); background: var(--effort-ink); }

/* Phone fallback: single column, no sticky rail. Keeps the dashboard usable on a phone too. */
@media (max-width: 900px) {
  .rf-dash { grid-template-columns: 1fr; gap: 18px; }
  .rf-dash-side { position: static; }
  .rf-dash-grid { grid-template-columns: 1fr; }
}

/* ---- super_admin ADMIN dashboard (page-level; the AdminLayout shell styles live in its scoped css) ---- */
.rf-admin-h1 { font-size: 26px; font-weight: 700; margin: 0 0 6px; }
.rf-admin-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0 24px; }
.rf-admin-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.rf-admin-quicklink { display: flex; gap: 14px; align-items: center; padding: 16px; text-decoration: none; color: inherit; }
.rf-admin-quicklink:hover { border-color: var(--effort); }
.rf-admin-quick-ico { font-size: 24px; color: var(--data); width: 36px; text-align: center; }
.rf-admin-quick-title { font-weight: 600; }

.rf-admin-panel { padding: 18px; margin-bottom: 18px; }
.rf-admin-panel-h { font-weight: 600; margin-bottom: 12px; }
.rf-admin-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.rf-admin-row label { display: flex; flex-direction: column; font-size: 13px; color: var(--mid); gap: 4px; }

.rf-admin-table { width: 100%; font-size: 14px; }
.rf-admin-table th { font-weight: 600; color: var(--mid); border-bottom: 1px solid var(--line); }
.rf-admin-table td { border-bottom: 1px solid var(--line); vertical-align: middle; }
.rf-admin-dim { opacity: .5; }

.rf-admin-planrow { display: flex; gap: 22px; flex-wrap: wrap; font-size: 15px; margin-bottom: 10px; }
.rf-admin-serieslist { columns: 2; font-size: 13px; color: var(--mid); margin: 6px 0 14px; }
.rf-admin-ok { border-color: var(--good); }
.rf-admin-err { color: var(--bad); font-size: 13px; margin-top: 6px; }
.rf-admin-warn { color: var(--warn); font-size: 13px; margin: 6px 0; }
.rf-admin-role { font-family: monospace; font-size: 13px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 7px; }
.rf-admin-progress { display: flex; align-items: center; gap: 8px; color: var(--mid); margin: 10px 0; }
.rf-admin-progress .spin { animation: rf-admin-spin 1s linear infinite; }
@keyframes rf-admin-spin { to { transform: rotate(360deg); } }

.rf-admin-modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 1100; padding: 16px; }
.rf-admin-modal { background: #fff; border-radius: var(--r-lg); padding: 22px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; }
.rf-admin-modal h3 { font-size: 19px; font-weight: 700; margin: 0 0 12px; }
.rf-admin-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--mid); margin-bottom: 12px; }
.rf-admin-check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 12px; }
.rf-admin-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

@media (max-width: 820px) {
  .rf-admin-tiles { grid-template-columns: repeat(2, 1fr); }
  .rf-admin-quick { grid-template-columns: 1fr; }
  .rf-admin-serieslist { columns: 1; }
}

/* ---- Legal / policy pages (prose) ---- */
.rf-legal { max-width: 760px; line-height: 1.6; }
.rf-legal h2 { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--hi); margin: 22px 0 6px; }
.rf-legal p, .rf-legal li { color: #C9CDD2; }
.rf-legal ul { padding-left: 20px; margin: 6px 0 10px; }
.rf-legal li { margin: 3px 0; }
.rf-legal a { color: var(--effort); text-decoration: none; }
.rf-legal a:hover { text-decoration: underline; }

/* ---- Footer (legal links) ---- */
.rf-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: auto 0 4px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: rgba(255,255,255,.45); }
.rf-footer a { color: rgba(255,255,255,.6); text-decoration: none; }
.rf-footer a:hover { color: var(--hi); text-decoration: underline; }
.rf-footer .rf-footer-copy { margin-left: auto; color: rgba(255,255,255,.35); }
@media (max-width: 560px) { .rf-footer .rf-footer-copy { margin-left: 0; flex-basis: 100%; } }

/* ---- Collapsible info cards (race-plan sections etc.) ---- */
details.rf-card-collapse > summary { list-style: none; cursor: pointer; display: flex; align-items: center; }
details.rf-card-collapse > summary::-webkit-details-marker { display: none; }
details.rf-card-collapse > summary > * { margin-bottom: 0; }
details.rf-card-collapse > summary::after { content: "\25BE"; margin-left: auto; padding-left: 10px; color: var(--mid); transition: transform .15s ease; }
details.rf-card-collapse[open] > summary::after { transform: rotate(180deg); }
/* Inline display:flex/grid on body children overrides the UA "closed details hides content" rule, so force it. */
details.rf-card-collapse:not([open]) > :not(summary) { display: none !important; }
