/* ========================================
   FONTS
   ======================================== */

@font-face {
    font-family: 'Google Sans';
    src: url('../fonts/GoogleSans-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Google Sans';
    src: url('../fonts/GoogleSans-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Google Sans';
    src: url('../fonts/GoogleSans-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Timing-tower faces (Saira Condensed display, JetBrains Mono numerics),
   SELF-HOSTED: the Google Fonts <link> died on mobile content blockers /
   in-app browsers, silently falling back to system faces. latin +
   latin-ext subsets, woff2, ~213 KiB total, font-display swap. */
/* JetBrains Mono 500 latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* JetBrains Mono 500 latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* JetBrains Mono 600 latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* JetBrains Mono 600 latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* JetBrains Mono 700 latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* JetBrains Mono 700 latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Saira Condensed 500 latin-ext */
@font-face {
  font-family: 'Saira Condensed';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/saira-condensed-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Saira Condensed 500 latin */
@font-face {
  font-family: 'Saira Condensed';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/saira-condensed-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Saira Condensed 600 latin-ext */
@font-face {
  font-family: 'Saira Condensed';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/saira-condensed-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Saira Condensed 600 latin */
@font-face {
  font-family: 'Saira Condensed';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/saira-condensed-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Saira Condensed 700 latin-ext */
@font-face {
  font-family: 'Saira Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/saira-condensed-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Saira Condensed 700 latin */
@font-face {
  font-family: 'Saira Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/saira-condensed-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Saira Condensed 800 latin-ext */
@font-face {
  font-family: 'Saira Condensed';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/saira-condensed-800-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Saira Condensed 800 latin */
@font-face {
  font-family: 'Saira Condensed';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/saira-condensed-800-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ========================================
   BASE & VARIABLES
   ======================================== */

/* Global default font size: drop the root to 14px so all rem-based type,
   buttons, and spacing scale down ~12% (the site read too large). Body keeps
   a readable ~14px via the 1rem body var below. */
html {
    font-size: 14px;
}

:root {
    --bs-body-font-size: 1rem;
    --bs-card-border-width: 0;
    --bs-list-group-border-width: 0;
    --bs-table-border-width: 0;
    --accent: #3b82f6;
    --accent-subtle: rgba(59, 130, 246, 0.08);
    /* Brand the Bootstrap primary to the site accent so buttons, links and
       focus rings match the rest of the UI (was the default #0d6efd). */
    --bs-primary: #3b82f6;
    --bs-primary-rgb: 59, 130, 246;
    --surface-elevated: #ffffff;
    --surface-subtle: #f8fafc;
    --border-subtle: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --nav-height: 56px;
}

body {
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h4 {
    font-size: 1.0rem;
}

/* ========================================
   BUTTONS (cohesive, branded, less "default")
   ======================================== */
.btn {
    --bs-btn-font-weight: 500;
    --bs-btn-border-radius: 0.5rem;
    --bs-btn-padding-y: 0.45rem;
    --bs-btn-padding-x: 0.95rem;
    /* Force the site font onto every button — native button/.btn elements
       otherwise fall back to a system font, which is why the search button
       (font-family: inherit) looked right and the rest looked off. */
    font-family: inherit;
    letter-spacing: 0.005em;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn-sm { --bs-btn-border-radius: 0.45rem; --bs-btn-padding-y: 0.3rem; --bs-btn-padding-x: 0.7rem; }
.btn-lg { --bs-btn-border-radius: 0.6rem; }

.btn-primary {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: #2f6fe0;
    --bs-btn-hover-border-color: #2f6fe0;
    --bs-btn-active-bg: #2563eb;
    --bs-btn-active-border-color: #2563eb;
    --bs-btn-disabled-bg: var(--accent);
    --bs-btn-disabled-border-color: var(--accent);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.10);
}
.btn-primary:hover { box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35); }

/* "Soft" buttons: a subtle fill + crisp border instead of a thin ghost
   outline, so they read as finished buttons next to the solid search button. */
.btn-outline-primary {
    --bs-btn-color: var(--accent);
    --bs-btn-bg: rgba(59, 130, 246, 0.10);
    --bs-btn-border-color: rgba(59, 130, 246, 0.30);
    --bs-btn-hover-bg: var(--accent);
    --bs-btn-hover-border-color: var(--accent);
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #2563eb;
    --bs-btn-active-border-color: #2563eb;
    --bs-btn-active-color: #fff;
}

.btn-outline-secondary {
    --bs-btn-color: var(--text-primary);
    --bs-btn-bg: var(--surface-subtle);
    --bs-btn-border-color: var(--border-subtle);
    --bs-btn-hover-bg: var(--surface-elevated);
    --bs-btn-hover-color: var(--text-primary);
    --bs-btn-hover-border-color: var(--text-tertiary);
    --bs-btn-active-bg: var(--surface-subtle);
    --bs-btn-active-color: var(--text-primary);
}

/* ========================================
   LIGHT THEME
   ======================================== */

[data-bs-theme="light"] {
    --bs-body-bg: #ffffff;
    --bs-card-bg-custom: #f8fafc;
    --bs-table-hover-bg-custom: #f1f5f9;
    --bs-border-color: #e2e8f0;
    --surface-elevated: #ffffff;
    --surface-subtle: #f8fafc;
    --border-subtle: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
}

[data-bs-theme="light"] .navbar-custom {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
}

[data-bs-theme="light"] .card,
[data-bs-theme="light"] .list-group-item {
    background-color: var(--bs-card-bg-custom);
}

/* Homepage Tools row */
.tools-section { margin-top: 2.75rem; margin-bottom: 2.75rem; }
.tool-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.05rem 1.2rem;
    border: 1px solid var(--border-subtle);
    border-radius: 0.7rem;
    background-color: var(--surface-elevated);
    text-decoration: none;
    height: 100%;
    min-height: 76px;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.tool-card:hover { border-color: var(--bs-primary); transform: translateY(-2px); }
.tool-card .bi { font-size: 1.8rem; color: var(--bs-primary); flex-shrink: 0; }
.tool-card-title {
    display: block; color: var(--text-primary);
    font-family: var(--font-display); font-weight: 700;
    text-transform: uppercase; letter-spacing: .01em; font-size: 1.2rem;
    line-height: 1.1;
}
.tool-card-sub { display: block; font-size: 0.92rem; color: var(--text-secondary); line-height: 1.3; margin-top: 0.15rem; }
.tool-card .bi { transition: transform .15s ease; }
.tool-card:hover .bi { transform: scale(1.08); }

/* Community Pulse — live homepage band */
.pulse-band {
    position: relative;
    overflow: hidden;
    margin: 1.25rem 0 0.25rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    background: var(--surface-elevated);
}
/* Ambient telemetry wave — sits behind the content, clipped to the band. */
.pulse-canvas {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    z-index: 0; pointer-events: none;
}
.pulse-band > *:not(.pulse-canvas) { position: relative; z-index: 1; }
.pulse-head { margin-bottom: 0.65rem; }
.pulse-live {
    display: inline-flex; align-items: center; gap: 0.45rem;
    font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase;
    letter-spacing: 0.1em; color: var(--text-tertiary);
}
.pulse-dot {
    width: 7px; height: 7px; border-radius: 50%; background: #ef4444;
    box-shadow: 0 0 0 0 rgba(239,68,68,0.6); animation: pulse-glow 2s infinite;
}
@keyframes pulse-glow {
    0%   { box-shadow: 0 0 0 0 rgba(239,68,68,0.55); }
    70%  { box-shadow: 0 0 0 7px rgba(239,68,68,0); }
    100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}
.pulse-stats {
    display: flex; flex-wrap: wrap; gap: 1.75rem;
    padding-bottom: 0.85rem; margin-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
}
.pulse-stat { display: flex; flex-direction: column; line-height: 1.1; }
.pulse-num {
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(1.5rem, 4vw, 2rem); color: var(--text-primary);
    letter-spacing: -0.01em;
}
.pulse-lbl {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-tertiary); margin-top: 0.15rem;
}
/* Discipline tabs for the per-category highlights. */
.pulse-cat-tabs {
    display: flex; flex-wrap: wrap; gap: 0.4rem;
    margin-bottom: 0.7rem;
}
.pulse-cat-tab {
    font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--text-secondary);
    background: var(--surface-subtle); border: 1px solid var(--border-subtle);
    border-radius: 999px; padding: 0.3rem 0.7rem; cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.pulse-cat-tab:hover { color: var(--text-primary); border-color: var(--text-tertiary); }
.pulse-cat-tab.active {
    color: var(--accent); border-color: var(--accent);
    background: rgba(59, 130, 246, 0.10); font-weight: 600;
}
/* Per-category highlights — uniform card grid (--cat set inline per panel). */
.pulse-cat-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}
@media (max-width: 575.98px) {
    .pulse-cat-panel { grid-template-columns: 1fr; }
}
.pulse-card {
    display: flex; align-items: center; gap: 0.65rem;
    padding: 0.65rem 0.8rem;
    background: var(--surface-subtle); border: 1px solid var(--border-subtle);
    border-radius: 12px; text-decoration: none;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.pulse-card:hover {
    border-color: var(--cat, var(--accent));
    background: var(--surface-elevated);
    transform: translateY(-1px);
}
.pulse-card-icon {
    flex-shrink: 0; width: 2rem; height: 2rem; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.95rem; color: var(--cat, var(--accent));
    background: color-mix(in srgb, var(--cat, var(--accent)) 16%, transparent);
}
.pulse-card-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.pulse-card-lbl {
    font-family: var(--font-mono); font-size: 0.58rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--cat, var(--accent)); margin-bottom: 0.12rem;
}
.pulse-card-val { font-size: 0.82rem; color: var(--text-secondary); }
.pulse-card-val strong { color: var(--text-primary); font-weight: 600; }

/* Head-to-head comparison */
.compare-table thead th {
    font-family: var(--font-display); text-transform: uppercase;
    font-size: clamp(1.2rem, 2.8vw, 1.55rem); letter-spacing: 0.01em;
    font-weight: 700; line-height: 1.15;
    border: 0 !important; padding-bottom: .6rem;
}
.compare-table thead th.text-muted {  /* the "Metric" middle header */
    font-family: var(--font-mono); font-size: .6rem; letter-spacing: .14em;
    font-weight: 600; color: var(--text-tertiary) !important; vertical-align: middle;
}
.compare-table tbody td { font-size: 0.95rem; padding-top: 0.95rem; padding-bottom: 0.95rem; vertical-align: middle; }
/* The two driver-value columns read as instrument numerics. */
.compare-table tbody td:first-child,
.compare-table tbody td:last-child {
    font-family: var(--font-mono); font-variant-numeric: tabular-nums;
    font-size: 1.3rem; font-weight: 600;
}
/* The centre metric label in mono caps. */
.compare-table tbody td:nth-child(2) {
    font-family: var(--font-mono); text-transform: uppercase;
    font-size: .76rem !important; letter-spacing: .1em; color: var(--text-secondary) !important;
}
.compare-table tbody tr { border-bottom: 1px solid var(--border-subtle); }
.compare-table tbody tr:last-child { border-bottom: 0; }
.compare-table tbody tr:hover { background: var(--surface-subtle); }
.compare-picker {
    position: relative;
    background:
        radial-gradient(130% 130% at 50% -25%, var(--accent-subtle), transparent 60%),
        var(--surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 2rem 1.75rem 1.75rem;
    box-shadow: 0 18px 48px -24px rgba(15, 23, 42, 0.35);
}
/* Two driver slots flanking a centred VS medallion. */
.vs-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: end;
    gap: 0.85rem;
}
.vs-slot { position: relative; min-width: 0; }
.vs-slot-label {
    display: block; margin-bottom: 0.45rem; padding-left: 0.15rem;
    font-family: var(--font-mono); text-transform: uppercase;
    letter-spacing: 0.12em; font-size: 0.62rem; font-weight: 600;
    color: var(--text-tertiary);
}
.vs-input-wrap { position: relative; }
.vs-input-icon {
    position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%);
    color: var(--text-tertiary); font-size: 0.95rem; pointer-events: none;
    transition: color 0.15s ease;
}
.compare-picker .cmp-search {
    height: 52px; border-radius: 12px;
    padding-left: 2.55rem; padding-right: 1rem;
    background-color: var(--surface-subtle);
    border: 1.5px solid var(--border-subtle);
    font-size: 0.98rem; font-weight: 500; color: var(--text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.compare-picker .cmp-search::placeholder { color: var(--text-tertiary); font-weight: 400; }
.compare-picker .cmp-search:focus {
    background-color: var(--surface-elevated);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-subtle);
}
.vs-slot:focus-within .vs-input-icon { color: var(--accent); }
/* Selected-driver state: accent border + check, hide the search glyph. */
.vs-slot.is-selected .cmp-search {
    background-color: var(--surface-elevated);
    border-color: var(--accent);
    padding-left: 1rem; padding-right: 2.5rem; font-weight: 600;
}
.vs-slot.is-selected .vs-input-icon { opacity: 0; }
.vs-slot-check {
    position: absolute; right: 0.9rem; top: 50%;
    transform: translateY(-50%) scale(0.5);
    color: var(--accent); font-size: 1.15rem;
    opacity: 0; pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.vs-slot.is-selected .vs-slot-check { opacity: 1; transform: translateY(-50%) scale(1); }
/* Centre VS medallion (nudged to sit centred on the 52px inputs). */
.vs-divider { display: flex; align-items: center; justify-content: center; margin-bottom: 3px; }
.vs-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #2563eb);
    color: #fff; font-family: var(--font-display);
    font-weight: 700; font-size: 1rem; letter-spacing: 0.04em;
    border: 3px solid var(--surface-elevated);
    box-shadow: 0 6px 18px -4px rgba(59, 130, 246, 0.55);
}
/* Full-width Compare CTA: muted until both drivers chosen, then a glowing gradient. */
.cmp-go-btn {
    width: 100%; margin-top: 1.5rem; height: 50px;
    border-radius: 12px; font-size: 1rem; font-weight: 600;
}
.cmp-go-btn:disabled {
    background: var(--surface-subtle); border-color: var(--border-subtle);
    color: var(--text-tertiary); box-shadow: none; opacity: 1;
}
.cmp-go-btn:not(:disabled) {
    background: linear-gradient(135deg, var(--accent), #2563eb);
    border-color: transparent;
    box-shadow: 0 10px 26px -8px rgba(59, 130, 246, 0.6);
}
/* Autocomplete dropdown. */
.cmp-results {
    top: calc(100% + 6px); left: 0;
    padding: 0.3rem; border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background-color: var(--surface-elevated);
    box-shadow: 0 16px 40px -12px rgba(15, 23, 42, 0.35);
    overflow: hidden;
}
.cmp-results:empty { display: none; }
.cmp-results .list-group-item {
    display: flex; align-items: center; gap: 0.6rem;
    cursor: pointer; border: 0; border-radius: 8px;
    padding: 0.6rem 0.7rem; font-weight: 500;
    background-color: transparent; color: var(--text-primary);
}
.cmp-results .list-group-item i { color: var(--text-tertiary); font-size: 1.05rem; }
.cmp-results .list-group-item:hover,
.cmp-results .list-group-item:focus {
    background-color: var(--accent-subtle); color: var(--accent);
}
.cmp-results .list-group-item:hover i { color: var(--accent); }
@media (max-width: 575.98px) {
    .vs-grid { grid-template-columns: 1fr; gap: 0.5rem; }
    .vs-divider { margin: 0.15rem 0; }
    .compare-picker { padding: 1.5rem 1.25rem; }
}
.matchup-chip {
    display: inline-flex; align-items: center;
    padding: 0.4rem 0.85rem; border-radius: 999px;
    border: 1px solid var(--border-subtle); background-color: var(--surface-elevated);
    color: var(--text-primary); text-decoration: none; font-size: 0.875rem;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.matchup-chip:hover { border-color: var(--bs-primary); transform: translateY(-1px); }
.cat-pill {
    display: inline-flex; align-items: center;
    padding: 0.3rem 0.8rem; border-radius: 999px; font-size: 0.8rem; font-weight: 500;
    border: 1px solid var(--border-subtle); background-color: var(--surface-elevated);
    color: var(--text-secondary); text-decoration: none; transition: all 0.15s;
}
.cat-pill:hover { border-color: var(--bs-primary); color: var(--bs-primary); }
.cat-pill.active { background-color: var(--accent); border-color: var(--accent); color: #fff; }
.rank-badge {
    display: inline-flex; align-items: center; margin-bottom: 1.25rem;
    padding: 0.3rem 0.8rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600;
    color: var(--accent); background-color: var(--accent-subtle);
    border: 1px solid rgba(59, 130, 246, 0.25); text-decoration: none; transition: all 0.15s;
}
.rank-badge:hover { background-color: var(--accent); color: #fff; }

/* Driver profile header: keep the name + lede column narrow so the action
   buttons (and the Top N% chip stacked beneath them) sit clearly on the right. */
.driver-header-info { max-width: 40rem; }

/* Chart surfaces: white panel in light mode, elevated dark surface in dark mode,
   so transparent Chart.js canvases don't show the gray card background. */
.chart-surface {
    background-color: var(--surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 0.5rem;
    padding: 0.5rem;
}

[data-bs-theme="light"] .table {
    --bs-table-bg: var(--bs-card-bg-custom);
    --bs-table-hover-bg: var(--bs-table-hover-bg-custom);
    --bs-table-striped-bg: var(--bs-table-hover-bg-custom);
}

[data-bs-theme="light"] .race-results-table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--bs-table-hover-bg-custom);
    --bs-table-striped-bg: var(--bs-table-hover-bg-custom);
}
[data-bs-theme="light"] .race-results-table thead {
    background-color: transparent;
}
[data-bs-theme="light"] .race-results-table thead th {
    border-bottom: 1px solid var(--bs-border-color);
}

/* ========================================
   DARK THEME
   ======================================== */

[data-bs-theme="dark"] {
    --bs-body-bg: #0a0a0a;
    --bs-card-bg-custom: #141414;
    --bs-table-hover-bg-custom: #1e1e1e;
    --bs-border-color: #1e1e1e;
    --surface-elevated: #141414;
    --surface-subtle: #0f0f0f;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --accent-subtle: rgba(59, 130, 246, 0.12);
}

[data-bs-theme="dark"] .navbar-custom {
    background-color: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
}

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .list-group-item {
    background-color: var(--bs-card-bg-custom);
}

[data-bs-theme="dark"] .table {
    --bs-table-bg: var(--bs-card-bg-custom);
    --bs-table-hover-bg: var(--bs-table-hover-bg-custom);
    --bs-table-striped-bg: var(--bs-table-hover-bg-custom);
}

[data-bs-theme="dark"] .race-results-table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--bs-table-hover-bg-custom);
    --bs-table-striped-bg: var(--bs-table-hover-bg-custom);
}
[data-bs-theme="dark"] .race-results-table thead {
    background-color: transparent;
}
[data-bs-theme="dark"] .race-results-table thead th {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] #bd-theme.btn-link,
[data-bs-theme="dark"] .theme-toggle-btn {
    color: #fff;
}

[data-bs-theme="dark"] .dropdown-menu .bi {
    color: #fff;
}

[data-bs-theme="dark"] #bd-theme .bi {
    fill: #fff;
}

/* ========================================
   NAVIGATION
   ======================================== */

.navbar-custom {
    padding: 0.5rem 0;
    box-shadow: none;
    transition: background-color 0.2s;
    z-index: 1030;
}

.navbar-logo {
    height: 32px;
    width: auto;
}

.nav-link-custom {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: 0.4rem 0.75rem !important;
    border-radius: 6px;
    transition: background-color 0.15s, color 0.15s;
    text-decoration: none !important;
    color: var(--text-secondary) !important;
}

.nav-link-custom:hover {
    background-color: var(--accent-subtle);
    color: var(--accent) !important;
}

.theme-toggle-btn {
    border: none !important;
    border-radius: 6px;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.theme-toggle-btn:hover {
    opacity: 1;
}

/* Hide the dropdown caret on theme toggle */
.theme-toggle-btn::after {
    display: none;
}

/* Dropdown menus (theme switcher, etc.) — rounded padded items with a soft
   tinted selected state instead of Bootstrap's harsh full-bleed blue bar. */
.dropdown-menu {
    --bs-dropdown-bg: var(--surface-elevated);
    --bs-dropdown-border-color: var(--border-subtle);
    --bs-dropdown-border-radius: 12px;
    --bs-dropdown-link-color: var(--text-secondary);
    --bs-dropdown-link-hover-bg: var(--surface-subtle);
    --bs-dropdown-link-hover-color: var(--text-primary);
    --bs-dropdown-link-active-bg: rgba(59, 130, 246, 0.16);
    --bs-dropdown-link-active-color: var(--accent);
    padding: 0.35rem;
    box-shadow: 0 12px 32px -12px rgba(15, 23, 42, 0.45);
}
.dropdown-item {
    display: flex; align-items: center; gap: 0.55rem;
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
    font-size: 0.85rem; font-weight: 500;
}
.dropdown-item.active .bi,
.dropdown-item:active .bi { color: var(--accent) !important; }

@media (min-width: 992px) {
    .navbar-center-links {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin: 0;
    }

    .navbar-collapse {
        position: static;
    }
}

@media (max-width: 991.98px) {
    .navbar-logo {
        max-width: 130px;
        height: auto;
    }
}

/* ========================================
   LOGO THEME HANDLING
   ======================================== */

.logo-dark { display: none; }
.logo-light { display: inline-block; }
[data-bs-theme="dark"] .logo-dark { display: inline-block; }
[data-bs-theme="dark"] .logo-light { display: none; }

@media (prefers-color-scheme: dark) {
    [data-bs-theme="auto"] .logo-dark { display: inline-block; }
    [data-bs-theme="auto"] .logo-light { display: none; }
}

@media (prefers-color-scheme: light) {
    [data-bs-theme="auto"] .logo-dark { display: none; }
    [data-bs-theme="auto"] .logo-light { display: inline-block; }
}

/* ========================================
   MAIN CONTENT
   ======================================== */

main.container {
    margin-top: 24px;
}

/* ========================================
   CARDS
   ======================================== */

.card {
    border: none !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.06);
    border-radius: 10px;
}

[data-bs-theme="dark"] .card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.card-header {
    padding: 1.25rem 1.25rem;
}

.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5 {
    font-size: 0.9rem;
    font-weight: 600;
}

.list-group-item h5 {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Mobile race result cards should have borders */
.mobile-race-card {
    border: 1px solid var(--bs-border-color) !important;
}

/* ========================================
   HERO LANDING PAGE
   ======================================== */

.hero-landing {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 0;
}

.hero-logo-wrapper {
    margin-bottom: 1rem;
}

.hero-logo {
    max-width: 420px;
    width: 100%;
    height: auto;
}

.hero-subtitle {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    margin-bottom: 2.5rem;
    letter-spacing: 0.01em;
}

.hero-search-wrapper {
    max-width: 520px;
    margin: 0 auto;
}

.hero-famous-driver {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 1.5em;
}

.famous-driver-cycle-link {
    color: var(--accent);
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.3s, transform 0.3s;
}

.famous-driver-cycle-link:hover {
    text-decoration: underline;
    color: var(--accent);
}

.hero-nav-links {
    margin-top: 2.5rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.hero-nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 1rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-secondary);
    background-color: var(--surface-subtle);
    border: 1px solid var(--border-subtle);
    transition: all 0.15s;
}

.hero-nav-pill:hover {
    color: var(--accent);
    border-color: var(--accent);
    background-color: var(--accent-subtle);
}

.hero-nav-pill i {
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .hero-logo {
        max-width: 260px;
    }
    .hero-subtitle {
        font-size: 0.8rem;
    }
}

/* ========================================
   SEARCH BAR
   ======================================== */

.search-bar {
    display: flex;
    align-items: center;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background-color: var(--surface-elevated);
    padding: 0.25rem 0.25rem 0.25rem 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    gap: 0.5rem;
}

.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.search-bar-icon {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.search-bar-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.9rem;
    flex: 1;
    padding: 0.5rem 0;
    color: var(--text-primary);
    font-family: inherit;
    min-width: 0;
}

.search-bar-input::placeholder {
    color: var(--text-tertiary);
}

.search-bar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: none;
    background-color: var(--accent);
    color: white;
    padding: 0.5rem 1.1rem;
    border-radius: 9px;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.15s, transform 0.1s;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-bar-btn:hover {
    background-color: #2563eb;
}

.search-bar-btn:active {
    transform: scale(0.97);
}

.search-bar-btn-icon {
    font-size: 0.8rem;
}

/* Legacy support for old search-input-group */
.search-input-group {
    border-radius: .375rem;
    overflow: hidden;
    border: var(--bs-border-width) solid var(--bs-border-color);
}

.search-input-group:focus-within {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.search-input-group .form-control {
    border: 0;
    box-shadow: none;
}

.search-input-group .btn {
    border: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

@media (max-width: 576px) {
    .search-bar {
        padding: 0.2rem 0.2rem 0.2rem 0.75rem;
    }
    .search-bar-input {
        font-size: 0.85rem;
    }
    .search-bar-btn-text {
        display: none;
    }
}

/* ========================================
   SEARCH RESULTS PAGE
   ======================================== */

.search-results-hero {
    padding: 3rem 0 4rem;
}

.search-page-logo {
    height: 36px;
    width: auto;
}

/* Homepage top nav — sits beside the in-hero logo, aligned with the search bar. */
.search-page-nav { gap: 0.15rem; }
.search-page-nav .nav-link-custom { white-space: nowrap; }

.search-results-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: var(--text-tertiary);
}

.search-results-query {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0.25rem 0 0;
    color: var(--text-primary);
}

.search-result-count {
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.search-results-list-new {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-result-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background-color: var(--surface-elevated);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.search-result-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
    color: inherit;
    transform: translateY(-1px);
}

.search-result-card-inner {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    gap: 0.85rem;
}

.search-result-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background-color: var(--accent-subtle);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.search-result-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-id {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.search-result-arrow {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: transform 0.15s, color 0.15s;
}

.search-result-card:hover .search-result-arrow {
    color: var(--accent);
    transform: translateX(2px);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state-icon {
    font-size: 2rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
    display: block;
}

.empty-state-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* ========================================
   FAMOUS DRIVERS (Search Results)
   ======================================== */

.famous-drivers-section {
    margin-top: 2.5rem;
}
/* Directly under the search bar the chips are part of the search moment,
   not a distant section — sit close and give the pulse band room below */
.famous-drivers-under-search { margin-top: 1.1rem; margin-bottom: 2.2rem; }

.section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
}

.famous-drivers-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.famous-driver-chip {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-secondary);
    background-color: var(--surface-subtle);
    border: 1px solid var(--border-subtle);
    transition: all 0.15s;
}

.famous-driver-chip:hover {
    color: var(--accent);
    border-color: var(--accent);
    background-color: var(--accent-subtle);
}

/* Legacy famous-driver-card support */
.famous-driver-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: pointer;
    height: 100%;
    min-height: 80px;
    box-shadow: none !important;
}

.famous-driver-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

[data-bs-theme="dark"] .famous-driver-card {
    background-color: var(--bs-gray-800);
    border: 1px solid var(--bs-gray-700);
}

[data-bs-theme="dark"] .famous-driver-card:hover {
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1) !important;
}

[data-bs-theme="light"] .famous-driver-card {
    background-color: var(--bs-white);
    border: 1px solid var(--bs-gray-300);
}

/* ========================================
   FEATURED SERIES (Search Results)
   ======================================== */

.featured-series-section {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
}

.series-category-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.7rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--border-subtle);
    text-decoration: none;
    transition: color 0.15s;
}

.series-category-label:hover {
    color: var(--accent);
}

/* A small accent square per discipline gives each category its own identity so
   the list reads as distinct sections instead of one wall of text. */
.series-category-label::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 2px;
    background: var(--accent);
    flex: 0 0 auto;
}
.series-cat-block[data-cat="sports-car"]  .series-category-label::before { background: #34d399; }
.series-cat-block[data-cat="formula-car"] .series-category-label::before { background: #a78bfa; }
.series-cat-block[data-cat="oval"]        .series-category-label::before { background: #fbbf24; }
.series-cat-block[data-cat="dirt-oval"]   .series-category-label::before { background: #fb923c; }
.series-cat-block[data-cat="dirt-road"]   .series-category-label::before { background: #f87171; }

.series-link-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.series-link-item-new {
    font-size: 0.84rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.3rem 0.5rem;
    margin: 0 -0.5rem;
    border-radius: 6px;
    transition: color 0.12s, background 0.12s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.series-link-item-new:hover {
    color: var(--accent);
    background: var(--surface-subtle);
}

/* One block per category, every series listed. Series flow into as many
   responsive columns as fit so a 40-series category stays compact. */
.series-cat-block { margin-bottom: 2.25rem; }
.series-cat-block:last-child { margin-bottom: 0; }

.series-category-label .series-cat-count {
    margin-left: 0.5rem;
    font-size: 0.66rem;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--surface-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    padding: 0.05rem 0.45rem;
    vertical-align: middle;
}

.series-link-cols {
    display: block;          /* override the flex column for CSS multi-columns */
    columns: 240px;
    column-gap: 2rem;
}
.series-link-cols .series-link-item-new {
    display: block;
    break-inside: avoid;
    white-space: normal;     /* allow long series names to wrap, not clip */
    overflow: visible;
    text-overflow: clip;
    line-height: 1.3;
}

/* ========================================
   FOOTER
   ======================================== */

.site-footer {
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid var(--border-subtle);
}

.site-footer--landing {
    border-top: none;
    margin-top: 0;
    padding: 1.5rem 0;
}

.footer-logo {
    height: 22px;
    width: auto;
    opacity: 0.4;
}

.footer-copyright {
    font-size: 0.75rem;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}

.footer-link:hover {
    color: var(--text-primary);
}

.footer-nav-link {
    font-size: 0.75rem;
}

/* Columned footer: brand block + link columns, legal line beneath */
.footer-grid {
    display: grid; gap: 2rem 2.5rem;
    grid-template-columns: minmax(14rem, 1.4fr) repeat(3, minmax(8rem, 1fr));
}
@media (max-width: 860px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
}
.footer-brand .footer-logo { height: 24px; }
.footer-tag {
    color: var(--text-tertiary); font-size: .8rem; max-width: 18rem;
    margin: .7rem 0 1rem;
}
.footer-cta { font-size: .68rem; padding: .55rem .9rem; }
.footer-col { display: flex; flex-direction: column; gap: .45rem; }
.footer-col-h {
    font-family: var(--font-mono); font-size: .62rem; font-weight: 700;
    letter-spacing: .14em; text-transform: uppercase;
    color: var(--text-tertiary); margin-bottom: .25rem;
}
.footer-col .footer-link { font-size: .8rem; }
.footer-legal {
    display: flex; gap: .6rem 1.2rem; flex-wrap: wrap;
    margin-top: 2rem; padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-tertiary); font-size: .72rem;
}
.footer-legal .footer-disclaimer { opacity: .7; }

.bmc-btn {
    font-size: 0.7rem;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
}

/* Cookie banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 1rem;
    background-color: var(--surface-elevated);
    border-top: 1px solid var(--border-subtle);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

/* ========================================
   UPDATE NOTIFICATION BANNER
   ======================================== */

#update-banner {
    position: sticky;
    top: 70px;
    z-index: 1020;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#update-banner .btn-close {
    padding: 0.5rem;
}

[data-bs-theme="dark"] #update-banner {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ========================================
   DRIVER STATS PAGE
   ======================================== */

.driver-stats-page h2.driver-name, .race-results-page h2.display-5 {
    font-size: 1.75rem;
}

.driver-stats-page .card-title {
    font-size: 1rem;
}

.driver-name {
    font-size: 1.5rem !important;
}

.career-stats-text {
    font-size: 1.1rem !important;
}

h3.stat-value {
    font-size: 2rem !important;
    font-weight: 500;
}

@media (max-width: 767.98px) {
    h3.stat-value {
        font-size: 1.5rem !important;
        font-weight: 500;
    }
}

.driver-name-link {
    font-weight: 500;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */

.form-select {
    font-size: .875rem;
    padding-top: .25rem;
    padding-bottom: .25rem;
    padding-left: .5rem;
}

/* ========================================
   LICENSE PLATES
   ======================================== */

.license-plate {
    display: inline-block;
    padding: 0.2em 0.4em;
    font-size: 0.8em;
    font-weight: bold;
    color: #fff;
    border-radius: 0.2rem;
}

.license-r {
    background-color: #d9534f;
    border: 1px solid #d43f3a;
}

.license-d {
    background-color: #f0ad4e;
    border: 1px solid #eea236;
}

.license-c {
    background-color: #f0e44e;
    border: 1px solid #e5d936;
    color: #333;
    text-shadow: none;
}

.license-b {
    background-color: #5cb85c;
    border: 1px solid #4cae4c;
}

.license-a {
    background-color: #0275d8;
    border: 1px solid #025aa5;
}

.license-pro {
    background: linear-gradient(45deg, #f0e44e, #d9534f, #0275d8);
    border: 1px solid #aaa;
}

.license-p {
    background-color: #111;
    border: 1px solid #000;
}

.license-n {
    background-color: #777;
    border: 1px solid #666;
}

/* ========================================
   TABLES
   ======================================== */

.table tbody tr td {
    vertical-align: middle;
}

/* Race results list-group styling */
/* Race finishing-order list adopts the championship "timing" treatment. */
.race-results-list { font-family: var(--font-mono); }

/* On the bare page (no card), the race list mirrors the leaderboard timing
   table: each row a separated panel with an inset hairline + hover slide. */
.race-results-list .list-group-item:not(.fw-bold) {
    background: var(--surface-elevated) !important;
    box-shadow: inset 0 0 0 1px var(--border-subtle);
    border: 0 !important;
    border-radius: .55rem;
    margin-bottom: 4px;
    padding: 0.6rem 1rem;
    transition: transform .12s ease, box-shadow .12s ease;
}

.race-results-list .list-group-item:not(.fw-bold):hover {
    transform: translateX(3px);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, var(--border-subtle));
}

.race-results-list .list-group-item .row {
    margin-left: 0;
    margin-right: 0;
}

/* Car name is secondary info — smaller + muted so it doesn't compete with
   the driver names (and wraps less awkwardly in its narrow column). */
.race-results-list .car-cell {
    font-size: 0.78rem;
    line-height: 1.2;
    color: var(--text-secondary);
}

/* Lazy-refresh pill: a self-contained centered chip at the top of the
   recent-races card while the latest results load (stale driver page). A pill
   (not a full-width bar) reads cleanly at any width, including narrow phones. */
.races-refresh-bar {
    display: flex; align-items: center; justify-content: center; gap: 0.45rem;
    width: fit-content; max-width: calc(100% - 1.6rem);
    margin: 0.85rem auto;
    padding: 0.45rem 0.9rem;
    background: var(--surface-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
}
.races-refresh-label {
    font-family: var(--font-mono); font-size: 0.74rem;
    letter-spacing: 0.02em; color: var(--text-secondary);
    white-space: nowrap;
}

.race-results-list .list-group-item.fw-bold {
    font-family: var(--font-mono);
    font-weight: 600 !important;
    text-transform: uppercase;
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    color: var(--text-tertiary);
    background: transparent !important;
    border: 0 !important;
    padding: 0.2rem 1rem 0.4rem !important;
    margin-top: 0 !important;
}

/* Stats by category table */
/* Driver-profile tables adopt the championship "timing" treatment:
   separated rows with an inset hairline, hover slide, mono numerics, and
   condensed-mono uppercase headers. */
.stats-by-category-table {
    margin-bottom: 0 !important;
    border-collapse: collapse !important;
    font-family: var(--font-mono);
}

.stats-by-category-table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    color: var(--text-tertiary);
    border: 0 !important;
    background: transparent !important;
    padding: 0.2rem 1.25rem 0.65rem;
}

.stats-by-category-table tbody tr {
    background: transparent !important;
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color .12s ease;
}
.stats-by-category-table tbody tr:last-child { border-bottom: 0; }

.stats-by-category-table tbody tr:hover {
    background: var(--surface-subtle) !important;
}

.stats-by-category-table tbody td {
    border: 0 !important;
    background: transparent !important;
    padding: 0.7rem 1.25rem;
    vertical-align: middle;
}

.stats-by-category-table tbody td:first-child {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: .01em;
    color: var(--text-primary);
}

/* Splits table */
.splits-table th,
.splits-table td {
    padding: 0.5rem 1rem;
}

.splits-table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--bs-secondary-color);
    border-top: 1px solid var(--bs-border-color);
}

[data-bs-theme="light"] .splits-table thead {
    background-color: #f8f9fa;
}

[data-bs-theme="dark"] .splits-table thead {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="light"] .splits-table tbody tr {
    background-color: #ffffff;
}

[data-bs-theme="dark"] .splits-table tbody tr {
    background-color: var(--bs-card-bg-custom);
}

.splits-expand-row {
    background-color: #ffffff !important;
}

[data-bs-theme="dark"] .splits-expand-row {
    background-color: var(--bs-card-bg-custom) !important;
}

/* Race results table */
.race-results-table th,
.race-results-table td {
    padding: 0.75rem 1rem;
}

.race-results-table thead th {
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: var(--bs-secondary-color);
}

/* Recent Races Table */
/* Recent races + race-result tables share the championship "timing" look. */
.recent-races-table,
.race-results-table {
    margin-bottom: 0 !important;
    border-collapse: collapse !important;
    font-family: var(--font-mono);
}

.recent-races-table thead th,
.race-results-table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    color: var(--text-tertiary);
    border: 0 !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    background: transparent !important;
    padding: 0.85rem 1.25rem 0.55rem;
}

.recent-races-table tbody tr,
.race-results-table tbody tr {
    background: transparent !important;
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color .12s ease;
}
.recent-races-table tbody tr:last-child,
.race-results-table tbody tr:last-child { border-bottom: 0; }

.recent-races-table tbody tr:hover,
.race-results-table tbody tr:hover {
    background: var(--surface-subtle) !important;
}

.recent-races-table tbody td,
.race-results-table tbody td {
    border: 0 !important;
    background: transparent !important;
    padding: 0.7rem 1.25rem;
    vertical-align: middle;
}
/* Every TEXT column (date, series, track; league, championship, class)
   shares one type treatment — condensed display-face title with a
   smaller muted sub-line — so a row never mixes faces and sizes.
   Mono stays on the numeric columns only. */
.recent-races-table tbody td.rr-text,
.race-results-table .name-col { font-family: var(--font-display); font-weight: 600; font-size: 1rem; }

/* Most Raced (driver profile): timing-sheet top-5 lists — rank,
   condensed name, mono count, and a thin accent bar proportional to the
   column leader. Shares the races-table type treatment. */
.mr-col-label {
    font-family: var(--font-mono); font-weight: 600;
    text-transform: uppercase; font-size: 0.66rem;
    letter-spacing: 0.14em; color: var(--text-tertiary);
    padding-bottom: 0.55rem; margin-bottom: 0.1rem;
    border-bottom: 1px solid var(--border-subtle);
}
/* Columns match the tallest sibling (the two-line combo rows) on
   desktop: each column is a flex column and its rows share the surplus
   height evenly, so all three lists start and end on the same lines. */
.mr-col { display: flex; flex-direction: column; height: 100%; }
.mr-list { list-style: none; margin: 0; padding: 0;
    flex: 1; display: flex; flex-direction: column; }
.mr-list li {
    display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) auto;
    align-items: center; column-gap: 0.6rem; flex: 1 1 0;
    padding: 0.55rem 0 0.65rem; position: relative;
    border-bottom: 1px solid var(--border-subtle);
}
.mr-list li:last-child { border-bottom: 0; }
.mr-rank { font-family: var(--font-mono); font-size: 0.7rem;
    color: var(--text-tertiary); }
.mr-text { min-width: 0; }
.mr-name {
    font-family: var(--font-display); font-weight: 600; font-size: 0.98rem;
    line-height: 1.25; display: block;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mr-sub {
    font-family: var(--bs-body-font-family, sans-serif); font-weight: 400;
    font-size: 0.74rem; color: var(--text-tertiary); display: block;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mr-link { color: inherit; text-decoration: none; }
.mr-link:hover .mr-name { color: var(--accent); }
.mr-count { font-family: var(--font-mono); font-weight: 600;
    font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.mr-bar {
    position: absolute; left: 2.1rem; bottom: -1px; height: 2px;
    width: calc((100% - 2.1rem) * var(--mr-pct, 0));
    background: var(--accent); opacity: 0.4; border-radius: 1px;
}
.mr-list li:first-child .mr-bar { opacity: 0.9; }
.mr-list li:first-child .mr-count { color: var(--accent); }

/* ========================================
   RACE DETAIL ELEMENTS
   ======================================== */

.race-details-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.race-detail-value {
    font-size: 1.1rem;
    font-weight: 500;
}

.race-series-name {
    font-size: 1.1rem;
    font-weight: 600;
}

.race-track-info {
    font-size: 0.8rem;
}

.race-main-row {
    background-color: rgba(0,0,0,0.02);
}

[data-bs-theme="dark"] .race-main-row {
    background-color: rgba(255,255,255,0.03);
}

.race-main-row td {
    border-bottom: 0 !important;
}

.race-details-row td {
    padding: 0 !important;
}

.race-details-container {
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 1rem;
}

[data-bs-theme="dark"] .race-details-container {
    background-color: transparent;
}

.race-detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
}

.race-detail-label {
    font-weight: 600;
    color: var(--bs-secondary-color);
    font-size: 0.7rem;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

@media (max-width: 767.98px) {
    .stats-by-category-table {
        font-size: 0.8rem;
    }

    .race-track-info {
        font-size: 0.75rem;
    }

    .race-details-grid {
        gap: 0.5rem;
    }

    .race-detail-label {
        font-size: 0.6rem;
    }

    .race-detail-value {
        font-size: 1rem;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .col-md-5-cols {
        flex: 0 0 auto;
        width: 20%;
    }
}

/* ========================================
   STAT ITEMS
   ======================================== */

.stats-container {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    text-align: center;
}

.stat-item {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    flex: 0 0 20%;
    max-width: 20%;
}

.desktop-stat-separator {
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    height: 4px;
}

/* ========================================
   LINKS
   ======================================== */

a.text-reset {
    text-decoration: underline;
}

.link-black-underlined {
    color: var(--bs-body-color);
    text-decoration: underline;
    font-weight: 600;
}

.link-black-underlined:hover {
    color: var(--bs-body-color);
    text-decoration: underline;
    font-weight: 600;
}

/* Race results series link */
.race-series-link {
    text-decoration: underline;
}

[data-bs-theme="light"] .race-series-link {
    color: black;
}

[data-bs-theme="dark"] .race-series-link {
    color: white;
}

/* ========================================
   LOGOS
   ======================================== */

.main-logo {
    max-width: 400px;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .main-logo {
        max-width: 330px;
    }
}

.search-results-list {
    min-width: 300px;
    max-width: 600px;
    margin: 0 auto;
}

.famous-driver-item {
    padding: 0.5rem 1rem;
}

.famous-driver-link {
    font-size: 1.1rem;
}

/* ========================================
   ANIMATION
   ======================================== */

.spinner-animation {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   BADGES
   ======================================== */

.verified-badge {
    font-size: 0.8rem !important;
    padding: 0.2rem 0.5rem;
    border-radius: 50px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background-color: var(--accent) !important;
    color: white !important;
    border: 2px solid var(--accent);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.verified-badge i {
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .verified-badge {
        font-size: 0.7rem !important;
        padding: 0.4rem 0.6rem;
    }

    .verified-badge i {
        font-size: 0.8rem;
    }
}

/* ========================================
   TOOLTIPS
   ======================================== */

.tooltip .tooltip-inner {
    font-size: 0.6rem !important;
    max-width: 280px !important;
    line-height: 1.2 !important;
    padding: 0.3rem 0.5rem !important;
}

.tooltip .tooltip-inner a {
    color: #ffeb3b !important;
    text-decoration: underline !important;
}

.tooltip .tooltip-inner a:hover {
    color: #fff59d !important;
}

.tooltip:hover {
    visibility: visible !important;
    opacity: 1 !important;
}

/* ========================================
   CATEGORY TAGS
   ======================================== */

.category-text {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.category-formula-road {
    color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.1);
}

.category-sports-car {
    color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
}

.category-road {
    color: #6c757d;
    background-color: rgba(108, 117, 125, 0.1);
}

.category-oval {
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

.category-dirt-oval {
    color: #6f4f28;
    background-color: rgba(111, 79, 40, 0.1);
}

.category-dirt-road {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

/* ========================================
   STANDINGS TABLE
   ======================================== */

/* Series standings + series recent races (contained in cards) get the same
   clean hairline + mono treatment as the driver-profile tables, matching the
   leaderboard type scale. */
.standings-table,
.contained-data-table {
    font-family: var(--font-mono);
    border-collapse: collapse !important;
    margin-bottom: 0;
}
.standings-table thead th,
.contained-data-table thead th {
    font-weight: 600; text-transform: uppercase;
    font-size: 0.62rem; letter-spacing: 0.14em;
    color: var(--text-tertiary);
    border: 0 !important; background: transparent !important;
    padding: 0.2rem 1rem 0.65rem;
}
.standings-table tbody tr,
.contained-data-table tbody tr {
    background: transparent !important;
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color .12s ease;
}
.standings-table tbody tr:last-child,
.contained-data-table tbody tr:last-child { border-bottom: 0; }
.standings-table tbody tr:hover,
.contained-data-table tbody tr:hover { background: var(--surface-subtle) !important; }
.standings-table tbody td,
.contained-data-table tbody td {
    border: 0 !important; background: transparent !important;
    padding: 0.7rem 1rem; vertical-align: middle;
}
/* Driver/winner name columns read in the condensed display face, like the
   leaderboard driver column. */
.standings-table tbody td:nth-child(2),
.contained-data-table tbody td:nth-child(4) {
    font-family: var(--font-display); font-weight: 600; font-size: 1.02rem;
}

.standings-table .flag-icon {
    width: 1.2em;
    height: 0.9em;
    vertical-align: baseline;
}

@media (max-width: 768px) {
    .standings-table {
        font-size: 0.75rem;
    }

    .standings-table th {
        font-size: 0.65rem;
        padding: 0.5rem 0.25rem;
    }

    .standings-table td {
        padding: 0.5rem 0.25rem;
    }

    .standings-table th:nth-child(8),
    .standings-table td:nth-child(8),
    .standings-table th:nth-child(9),
    .standings-table td:nth-child(9) {
        display: none;
    }
}

/* ============================================================
   CHAMPIONSHIPS & LEADERBOARDS — "Timing Tower" design system
   Motorsport-instrument aesthetic: condensed display type,
   monospaced numerics, podium hierarchy, dense timing rows.
   Cohesive with the global accent + light/dark surface tokens.
   ============================================================ */
:root {
    --font-display: 'Saira Condensed', 'Google Sans', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
    --gold:   #f5c518;
    --silver: #cbd5e1;
    --bronze: #d08b54;
}
[data-bs-theme="dark"] { --silver: #aab4c2; }

/* ---- Hero band ------------------------------------------------ */
.lb-hero {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid var(--border-subtle);
    padding: 2.4rem 1.75rem 2rem;
    margin-bottom: 1.75rem;
    background:
        radial-gradient(120% 140% at 100% 0%,
            color-mix(in srgb, var(--accent-2, var(--accent)) 16%, transparent),
            transparent 55%),
        linear-gradient(180deg, var(--surface-elevated), var(--surface-subtle));
}
/* Pro hero banner: the league's photo under a legibility scrim; text
   inside is forced to light-on-dark in BOTH themes (it sits on an image) */
.lb-hero-banner {
    --text-primary: #f2f5f9; --text-secondary: #c9cfd8;
    --text-tertiary: #99a1ac; --border-subtle: rgba(255, 255, 255, .18);
    background:
        linear-gradient(180deg, rgba(8, 10, 14, .68), rgba(8, 10, 14, .82)),
        var(--lb-banner) center / cover no-repeat;
}
.lb-hero-banner::before { opacity: .35; }
.lb-hero::before {  /* diagonal speed lines */
    content: "";
    position: absolute; inset: 0;
    background-image: repeating-linear-gradient(
        -64deg, transparent 0 22px,
        color-mix(in srgb, var(--text-primary) 4%, transparent) 22px 24px);
    -webkit-mask-image: linear-gradient(105deg, #000, transparent 62%);
            mask-image: linear-gradient(105deg, #000, transparent 62%);
    pointer-events: none;
}
.lb-hero::after {  /* checkered flag corner */
    content: "";
    position: absolute; top: 0; right: 0; width: 120px; height: 120px;
    background-image:
        linear-gradient(45deg, color-mix(in srgb, var(--text-primary) 8%, transparent) 25%, transparent 25%, transparent 75%, color-mix(in srgb, var(--text-primary) 8%, transparent) 75%),
        linear-gradient(45deg, color-mix(in srgb, var(--text-primary) 8%, transparent) 25%, transparent 25%, transparent 75%, color-mix(in srgb, var(--text-primary) 8%, transparent) 75%);
    background-size: 18px 18px;
    background-position: 0 0, 9px 9px;
    -webkit-mask-image: radial-gradient(120px 120px at 100% 0%, #000, transparent 70%);
            mask-image: radial-gradient(120px 120px at 100% 0%, #000, transparent 70%);
    opacity: .6; pointer-events: none;
}
.lb-hero > * { position: relative; z-index: 1; }
.lb-eyebrow {
    font-family: var(--font-mono);
    font-size: .72rem; font-weight: 600; letter-spacing: .22em;
    text-transform: uppercase; color: var(--accent);
    display: inline-flex; align-items: center; gap: .5rem;
}
.lb-title {
    font-family: var(--font-display);
    font-weight: 800; letter-spacing: .005em; line-height: .98;
    text-transform: uppercase;
    font-size: clamp(2rem, 5vw, 3.25rem);
    color: var(--text-primary); margin: .35rem 0 .35rem;
}
.lb-sub { color: var(--text-secondary); max-width: 46rem; margin: 0; }
.lb-hero-logo {
    height: 56px; width: auto; object-fit: contain;
    filter: drop-shadow(0 4px 14px rgba(0,0,0,.25));
}

/* ---- Category chips ------------------------------------------- */
.cat-chip {
    display: inline-flex; align-items: center; gap: .4rem;
    font-family: var(--font-mono);
    font-size: .68rem; font-weight: 600; letter-spacing: .12em;
    text-transform: uppercase;
    padding: .28rem .6rem; border-radius: .4rem;
    border: 1px solid currentColor;
}
.cat-chip[data-cat="oval"]        { color:#3b82f6; }
.cat-chip[data-cat="sports-car"]  { color:#22c55e; }
.cat-chip[data-cat="formula-car"],
.cat-chip[data-cat="formula-road"]{ color:#ef4444; }
.cat-chip[data-cat="dirt-oval"]   { color:#d08b54; }
.cat-chip[data-cat="dirt-road"]   { color:#f59e0b; }
.cat-chip[data-cat="road"]        { color:#94a3b8; }
.cat-chip .dot { width:.5rem; height:.5rem; border-radius:50%; background:currentColor; }

/* ---- Championship index grid --------------------------------- */
.champ-cat-label {
    font-family: var(--font-display);
    text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
    font-size: 1.05rem; color: var(--text-primary);
    display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem;
}
.champ-cat-label::after {
    content: ""; flex: 1; height: 1px;
    background: linear-gradient(90deg, var(--border-subtle), transparent);
}
.champ-card {
    display: flex; align-items: center; gap: .85rem;
    padding: .8rem .9rem; height: 100%;
    border: 1px solid var(--border-subtle); border-radius: .7rem;
    background: var(--surface-elevated); text-decoration: none;
    position: relative; overflow: hidden;
    transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.champ-card::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--accent); transform: scaleY(0); transform-origin: bottom;
    transition: transform .16s ease;
}
.champ-card:hover {
    transform: translateY(-2px); border-color: var(--accent);
    box-shadow: 0 10px 26px -16px rgba(59,130,246,.7);
}
.champ-card:hover::before { transform: scaleY(1); }
.champ-card .series-logo,
.champ-card .series-logo-placeholder {
    width: 34px; height: 34px; object-fit: contain; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.champ-card-name {
    font-weight: 600; color: var(--text-primary); line-height: 1.2;
    display: block;
}
.champ-card-meta {
    font-family: var(--font-mono); font-size: .68rem; letter-spacing: .08em;
    text-transform: uppercase; color: var(--text-tertiary);
}
.champ-card .bi-chevron-right { color: var(--text-tertiary); transition: transform .14s ease; }
.champ-card:hover .bi-chevron-right { transform: translateX(3px); color: var(--accent); }

/* ---- Season hub cards ---------------------------------------- */
.season-card {
    display: flex; flex-direction: column; gap: .35rem;
    padding: 1rem 1.1rem; height: 100%;
    border: 1px solid var(--border-subtle); border-radius: .7rem;
    background: var(--surface-elevated); text-decoration: none;
    transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.season-card:hover {
    transform: translateY(-2px); border-color: var(--accent);
    box-shadow: 0 12px 28px -18px rgba(59,130,246,.7);
}
.season-card-year {
    font-family: var(--font-display); font-weight: 800; font-size: 1.7rem;
    line-height: 1; color: var(--text-primary); text-transform: uppercase;
}
.season-card-q {
    font-family: var(--font-mono); font-size: .72rem; font-weight: 600;
    letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}
.season-card-foot {
    margin-top: auto; padding-top: .6rem;
    color: var(--text-tertiary); font-size: .8rem;
    display: flex; align-items: center; gap: .4rem;
}
.season-card.is-current { border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle)); }
.season-live {
    font-family: var(--font-mono); font-size: .62rem; font-weight: 700;
    letter-spacing: .14em; text-transform: uppercase;
    color: #22c55e; display: inline-flex; align-items: center; gap: .35rem;
}
.season-live .dot { width:.5rem; height:.5rem; border-radius:50%; background:#22c55e;
    box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: livePulse 1.8s infinite; }
@keyframes livePulse { 70%{ box-shadow:0 0 0 6px rgba(34,197,94,0);} 100%{box-shadow:0 0 0 0 rgba(34,197,94,0);} }

/* ---- Podium (top 3) ------------------------------------------ */
.podium {
    display: grid; grid-template-columns: 1fr 1.18fr 1fr;
    align-items: end; gap: .9rem; margin-bottom: 1.5rem;
}
.podium-card {
    position: relative; border: 1px solid var(--border-subtle);
    border-radius: .85rem; background: var(--surface-elevated);
    padding: 1.1rem 1rem 1rem; text-align: center; overflow: hidden;
    text-decoration: none; display: block;
    transition: transform .15s ease, box-shadow .15s ease;
}
.podium-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px -20px rgba(0,0,0,.6); }
.podium-card::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
    background: var(--tier, var(--accent));
}
.podium-card[data-pos="1"] { padding-top: 1.4rem; --tier: var(--gold);
    background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--gold) 16%, var(--surface-elevated)), var(--surface-elevated) 70%); }
.podium-card[data-pos="2"] { --tier: var(--silver); }
.podium-card[data-pos="3"] { --tier: var(--bronze); }
.podium-pos {
    font-family: var(--font-display); font-weight: 800; line-height: 1;
    font-size: 2.4rem; color: var(--tier, var(--accent));
}
.podium-card[data-pos="1"] .podium-pos { font-size: 3rem; }
.podium-crown { font-size: 1.1rem; color: var(--gold); margin-bottom: .2rem; }
.podium-leader-tag {
    font-family: var(--font-mono); font-size: .58rem; font-weight: 700;
    letter-spacing: .16em; text-transform: uppercase; color: #22c55e;
    margin-bottom: .15rem;
}
.podium-name {
    font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
    letter-spacing: .01em; font-size: 1.05rem; color: var(--text-primary);
    margin: .5rem 0 .1rem; line-height: 1.05;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.podium-pts {
    font-family: var(--font-mono); font-weight: 700; font-size: 1.5rem;
    color: var(--text-primary); margin-top: .35rem;
}
.podium-pts small { font-size: .6rem; font-weight: 600; letter-spacing: .12em;
    text-transform: uppercase; color: var(--text-tertiary); display: block; margin-top: .1rem; }
.podium-line {
    font-family: var(--font-mono); font-size: .72rem; color: var(--text-secondary);
    margin-top: .55rem; display: flex; justify-content: center; gap: .9rem; flex-wrap: wrap;
}
.podium-line b { color: var(--text-primary); font-weight: 700; }

/* ---- Timing-tower table -------------------------------------- */
.timing {
    width: 100%; border-collapse: separate; border-spacing: 0 4px;
    font-family: var(--font-mono);
}
.timing thead th {
    font-size: .62rem; font-weight: 600; letter-spacing: .14em;
    text-transform: uppercase; color: var(--text-tertiary);
    padding: .2rem .6rem .5rem; text-align: right; white-space: nowrap;
}
.timing thead th.col-driver { text-align: left; }
.timing tbody tr { transition: transform .12s ease; }
/* Row fill AND outline live on the CELLS — anything painted on the tr
   (background or inset shadow) ignores the corner cells' border-radius
   and pokes out square at the four row corners. */
.timing tbody td {
    background: var(--surface-elevated);
    border-block: 1px solid var(--border-subtle);
    transition: border-color .12s ease;
}
.timing tbody td:first-child { border-left: 1px solid var(--border-subtle); }
.timing tbody td:last-child  { border-right: 1px solid var(--border-subtle); }
.timing tbody tr:hover { transform: translateX(3px); }
.timing tbody tr:hover td {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border-subtle));
}
/* Reserve the 3px hover shift inside scroll wrappers — otherwise the shifted
   row overflows the wrapper by 3px and macOS pops a horizontal scrollbar.
   Every .timing table's scroll wrapper must be .table-responsive (never a
   raw overflow-x div) so this reservation applies. */
.table-responsive { padding-right: 3px; }
.timing tbody td { padding: .5rem .6rem; text-align: right; vertical-align: middle; white-space: nowrap; }
.timing tbody td:first-child { border-radius: .55rem 0 0 .55rem; }
.timing tbody td:last-child  { border-radius: 0 .55rem .55rem 0; }
.timing .col-pos {
    width: 52px; text-align: center; font-weight: 700; font-size: .95rem;
    color: var(--text-secondary); position: relative;
}
.timing tr[data-tier="1"] .col-pos { color: var(--gold); }
.timing tr[data-tier="2"] .col-pos { color: var(--silver); }
.timing tr[data-tier="3"] .col-pos { color: var(--bronze); }
/* Podium rows: the gold/silver/bronze position number (above) is the whole
   treatment — row tints and gradients read as overpowering. */
.timing .col-driver {
    text-align: left; font-family: var(--font-display); font-weight: 600;
    font-size: 1.02rem; letter-spacing: .01em;
}
.timing .col-driver a { color: var(--text-primary); text-decoration: none; }
.timing .col-driver a:hover { color: var(--accent); }
.timing .col-driver .flag-icon { width: 1.1em; height: .8em; margin-left: .45rem; opacity: .9; vertical-align: middle; }
.timing .col-pts { color: var(--text-primary); font-weight: 700; font-size: 1rem; }
.timing .col-gap { color: var(--text-tertiary); font-size: .82rem; }
.timing .col-num { color: var(--text-secondary); }
/* Numeric columns shrink to content (nowrap keeps them readable) so spare
   width pools in the driver column instead of scattering the numbers
   across a wide viewport. */
.timing td.col-pts, .timing td.col-gap, .timing td.col-num {
    width: 1%; padding-inline: .95rem;
}
.timing .col-num.win { color: var(--text-primary); font-weight: 700; }
.timing .ir-badge {
    font-family: var(--font-mono); font-weight: 700; font-size: .8rem;
    color: var(--accent); background: var(--accent-subtle);
    padding: .12rem .45rem; border-radius: .35rem;
}
@media (max-width: 768px) {
    .podium { grid-template-columns: 1fr; }
    .podium-card[data-pos="1"] { order: -1; }
    .timing .hide-sm { display: none; }
    .timing thead th.hide-sm { display: none; }
}

/* ---- Sticky season / class selector bar ---------------------- */
.lb-selectbar {
    display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
    margin-bottom: 1.25rem;
}
.lb-select {
    font-family: var(--font-mono); font-size: .8rem; font-weight: 600;
    letter-spacing: .04em; border-radius: .5rem; border: 1px solid var(--border-subtle);
    background: var(--surface-elevated); color: var(--text-primary);
    padding: .45rem 2rem .45rem .75rem;
}

/* Typeahead series filter: lives beside the category select and shares its
   pit-board metrics. The letters that match light up in each card name
   (mark.lb-hit), so the list explains itself while it narrows. */
.lb-typeahead {
    position: relative; display: flex; align-items: center;
    flex: 1 1 15rem; max-width: 23rem;
}
.lb-typeahead > .bi-search {
    position: absolute; left: .7rem; font-size: .8rem;
    color: var(--text-tertiary); pointer-events: none;
}
.lb-filter {
    width: 100%; font-family: var(--font-mono); font-size: .8rem;
    font-weight: 600; letter-spacing: .04em; border-radius: .5rem;
    border: 1px solid var(--border-subtle); background: var(--surface-elevated);
    color: var(--text-primary); padding: .45rem 2.3rem .45rem 2rem;
    transition: border-color .14s ease, box-shadow .14s ease;
}
.lb-filter::placeholder { color: var(--text-tertiary); font-weight: 500; }
.lb-filter:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.lb-filter::-webkit-search-cancel-button,
.lb-filter::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.lb-ta-clear {
    position: absolute; right: .3rem; border: 0; background: transparent;
    color: var(--text-tertiary); padding: .3rem .5rem; border-radius: .35rem;
    line-height: 1; font-size: .75rem; cursor: pointer;
}
.lb-ta-clear:hover { color: var(--accent); }
.lb-ta-kbd {
    position: absolute; right: .55rem; pointer-events: none;
    font-family: var(--font-mono); font-size: .66rem; line-height: 1;
    color: var(--text-tertiary); border: 1px solid var(--border-subtle);
    border-radius: .3rem; padding: .18rem .38rem; background: var(--surface-subtle);
}
.lb-typeahead:focus-within .lb-ta-kbd,
.lb-typeahead.has-value .lb-ta-kbd { display: none; }
@media (hover: none) { .lb-ta-kbd { display: none; } }
mark.lb-hit {
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    box-shadow: inset 0 -1.5px 0 var(--accent);
    color: inherit; padding: 0; border-radius: 2px;
}
.lb-filter-empty {
    font-family: var(--font-mono); font-size: .8rem; color: var(--text-secondary);
    border: 1px dashed var(--border-subtle); border-radius: .6rem;
    padding: 1.1rem 1.25rem; margin-bottom: 1.5rem;
}
.lb-filter-empty b { color: var(--text-primary); }
.lb-filter-reset {
    border: 0; background: transparent; color: var(--accent);
    font: inherit; font-weight: 600; padding: 0; margin-left: .35rem;
    text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.classpill {
    font-family: var(--font-mono); font-size: .72rem; font-weight: 600;
    letter-spacing: .06em; text-transform: uppercase;
    padding: .4rem .8rem; border-radius: 999px; text-decoration: none;
    border: 1px solid var(--border-subtle); color: var(--text-secondary);
    background: var(--surface-elevated); transition: all .14s ease;
}
.classpill:hover { border-color: var(--accent); color: var(--accent); }
.classpill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---- Breadcrumb --------------------------------------------- */
.lb-crumb {
    font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em;
    text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 1rem;
}
.lb-crumb a { color: var(--text-secondary); text-decoration: none; }
.lb-crumb a:hover { color: var(--accent); }
.lb-crumb .sep { margin: 0 .5rem; opacity: .5; }

/* ============================================================
   SITEWIDE ADOPTION of the timing-tower design language
   (display headings, mono numerics, card hovers, hero bands)
   Defined after the championship system so the font vars exist.
   ============================================================ */

/* --- Display type on headings & page titles --- */
h1, .h1, h2, .h2, h3, .h3,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6,
.driver-name, .page-title, .card-title, .series-category-label {
    font-family: var(--font-display);
    letter-spacing: .004em;
}
/* Condensed faces read better a touch heavier */
h1, .h1, h2, .h2, .display-4, .display-5, .display-6,
.driver-name, .page-title { font-weight: 700; }

/* --- Mono, tabular numerics for stats --- */
.stat-value, h3.stat-value, .career-stats-text, .stat-num, .mono,
.metric-value, .big-number {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

/* --- Section labels match the championship eyebrow --- */
.section-label, .series-category-label {
    font-family: var(--font-mono);
    letter-spacing: .14em;
    text-transform: uppercase;
}

/* --- Universal card: subtle life on hover --- */
.card { transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
a.card, .card-hover, .hover-lift { cursor: pointer; }
a.card:hover, .card-hover:hover, .hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px -20px rgba(0,0,0,.55);
    border-color: var(--accent) !important;
}

/* --- Reusable page hero (alias of the championship hero) --- */
.page-hero {
    position: relative; overflow: hidden;
    border-radius: 1rem; border: 1px solid var(--border-subtle);
    padding: 2rem 1.75rem; margin-bottom: 1.5rem;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(59,130,246,0.14), transparent 55%),
        linear-gradient(180deg, var(--surface-elevated), var(--surface-subtle));
}
.page-hero::before {
    content: ""; position: absolute; inset: 0;
    background-image: repeating-linear-gradient(-64deg, transparent 0 22px,
        color-mix(in srgb, var(--text-primary) 4%, transparent) 22px 24px);
    -webkit-mask-image: linear-gradient(105deg, #000, transparent 62%);
            mask-image: linear-gradient(105deg, #000, transparent 62%);
    pointer-events: none;
}
.page-hero > * { position: relative; z-index: 1; }

/* --- Stat tiles (driver profile / series / team) get the instrument feel --- */
.stat-card, .stat-item {
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.stat-card:hover, .stat-item:hover { transform: translateY(-2px); }

/* --- Race results header stat strip (timing-tower chips) --- */
.race-stat-strip { display: flex; flex-wrap: wrap; gap: .5rem; }
.race-stat {
    font-family: var(--font-mono); font-size: .76rem;
    padding: .32rem .65rem; border-radius: .45rem;
    border: 1px solid var(--border-subtle); background: var(--surface-subtle);
    color: var(--text-secondary);
}
.race-stat b {
    color: var(--text-tertiary); font-weight: 600; font-size: .62rem;
    letter-spacing: .1em; text-transform: uppercase; margin-right: .35rem;
}

/* --- Race highlights strip (winner / fastest lap / hard charger) --- */
.race-highlights { display: flex; flex-wrap: wrap; gap: .5rem; }
.race-highlight {
    font-size: .82rem;
    padding: .4rem .7rem; border-radius: .5rem;
    border: 1px solid var(--border-subtle); background: var(--surface-subtle);
    color: var(--text-secondary);
}
.race-highlight b {
    color: var(--text-tertiary); font-weight: 600; font-size: .6rem;
    letter-spacing: .08em; text-transform: uppercase; margin: 0 .3rem;
}

/* --- Race results table --- */
.race-results-table { font-size: .88rem; }
.race-results-table thead th {
    font-size: .66rem; letter-spacing: .06em; text-transform: uppercase;
    color: var(--text-tertiary); font-weight: 600; white-space: nowrap;
    border-bottom: 1px solid var(--border-subtle);
}
.race-results-table td {
    border-bottom: 1px solid var(--border-subtle); vertical-align: middle;
    white-space: nowrap;
}
.race-results-table tbody tr:hover { background: var(--surface-subtle); }

/* --- Driver profile name reads bigger inside the hero band --- */
.page-hero .driver-name {
    font-size: clamp(1.6rem, 4vw, 2.4rem) !important;
    text-transform: uppercase; line-height: 1;
}

/* --- Loading indicators: mono "telemetry" label + accent spinner --- */
#loading-spinner p,
#race-results-content p.loading-label,
.lb-loading-text {
    font-family: var(--font-mono) !important;
    text-transform: uppercase;
    letter-spacing: .18em;
    font-size: .72rem;
    color: var(--text-tertiary) !important;
    margin-top: 1rem !important;
}
#loading-spinner .spinner-border,
.lb-loading .spinner-border {
    color: var(--accent);
    width: 2.2rem; height: 2.2rem; border-width: .2em;
}

/* --- Mobile: tighten the timing-style driver tables so they fit ~360px --- */
@media (max-width: 575.98px) {
    .stats-by-category-table,
    .recent-races-table {
        border-spacing: 0 3px;
        font-size: .82rem;
    }
    .stats-by-category-table thead th,
    .recent-races-table thead th { padding: .15rem .55rem .4rem; font-size: .56rem; letter-spacing: .1em; }
    .stats-by-category-table tbody td,
    .recent-races-table tbody td { padding: .5rem .55rem; }
    .stats-by-category-table tbody td:first-child { font-size: .9rem; }
    .recent-races-table tbody td:nth-child(2) { font-size: .88rem; }
    /* keep the Results button compact */
    .recent-races-table .btn-sm { --bs-btn-padding-x: .5rem; --bs-btn-padding-y: .25rem; font-size: .72rem; }
}

/* ========================================
   SERIES SEASON SCHEDULE
   ======================================== */
.schedule-list { display: flex; flex-direction: column; }
.schedule-week {
    display: grid;
    grid-template-columns: 3.5rem 1fr auto;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
}
.schedule-week:last-child { border-bottom: none; }
.schedule-week--current {
    background: var(--surface-subtle);
    box-shadow: inset 3px 0 0 var(--accent);
}
.schedule-week-num { display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem; }
.sw-num { font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem; color: var(--text-secondary); line-height: 1; }
.schedule-week--current .sw-num { color: var(--accent); }
.sw-badge {
    font-family: var(--font-mono); font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--accent); border: 1px solid var(--accent); border-radius: 999px;
    padding: 0.22rem 0.55rem; white-space: nowrap;
    margin-left: 0.6rem; vertical-align: middle; position: relative; top: -1px;
}
.schedule-week-track { display: flex; flex-direction: column; min-width: 0; }
.sw-track { font-family: var(--font-display); font-weight: 600; color: var(--text-primary); }
.sw-config { font-size: 0.8rem; color: var(--text-tertiary); }
.schedule-week-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.1rem; text-align: right; }
.sw-date { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-secondary); }
.sw-len { font-size: 0.75rem; color: var(--text-tertiary); }
@media (max-width: 575.98px) {
    .schedule-week { grid-template-columns: 2.75rem 1fr; }
    .schedule-week-meta { grid-column: 2; align-items: flex-start; flex-direction: row; gap: 0.7rem; }
}

/* This Week index */
.tw-block { margin-bottom: 2.25rem; }
.tw-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.1rem 1.5rem;
}
.tw-row {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    padding: 0.5rem 0.6rem;
    margin: 0 -0.6rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.12s;
}
.tw-row:hover { background: var(--surface-subtle); }
.tw-series { font-family: var(--font-display); font-weight: 700; color: var(--text-primary); font-size: 0.98rem; letter-spacing: .01em; }
.tw-track { font-size: 0.8rem; color: var(--text-secondary); }
.tw-config { color: var(--text-tertiary); }

/* Series page -> schedule link card */
.schedule-link-card {
    display: flex; align-items: center; gap: 0.9rem;
    padding: 0.9rem 1.1rem;
    border: 1px solid var(--border-subtle); border-radius: 0.6rem;
    background: var(--surface-elevated); text-decoration: none;
    transition: border-color .15s ease, transform .15s ease;
}
.schedule-link-card:hover { border-color: var(--bs-primary); transform: translateY(-2px); }
.schedule-link-card > .bi:first-child { font-size: 1.5rem; color: var(--bs-primary); flex-shrink: 0; }
.schedule-link-title { display: block; font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .01em; color: var(--text-primary); font-size: 0.98rem; }
.schedule-link-sub { display: block; font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.1rem; }

/* Login prompt on race results — a glowing dark callout with an animated canvas
   aurora behind it. Fixed dark gradient in both themes so the glow always pops. */
.race-login-prompt {
    position: relative;
    overflow: hidden;
    margin-bottom: 1.1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(99, 102, 241, 0.45);
    background: linear-gradient(135deg, #0a0e1c 0%, #131a30 55%, #0d1424 100%);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.10), 0 6px 24px rgba(59, 130, 246, 0.18);
    animation: rlp-pulse 4.5s ease-in-out infinite;
}
@keyframes rlp-pulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(99,102,241,0.10), 0 6px 22px rgba(59,130,246,0.14); }
    50%      { box-shadow: 0 0 0 1px rgba(99,102,241,0.22), 0 8px 34px rgba(59,130,246,0.34); }
}
.race-login-prompt .rlp-glow {
    /* inset:0 fills the parent via offsets — NO percentage height, which iOS
       Safari can resolve against an auto-height parent and blow the canvas up to
       full viewport height. display:block avoids inline descender space. */
    position: absolute; inset: 0; display: block;
    z-index: 0; pointer-events: none; opacity: 0.9;
}
.race-login-prompt .rlp-inner {
    position: relative; z-index: 1;
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem;
}
.race-login-prompt .rlp-icon {
    flex-shrink: 0; font-size: 1.15rem; color: #a5b4fc;
    filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.7));
}
.race-login-prompt .rlp-text {
    margin-right: auto; color: #e8ecff; font-size: 0.9rem; font-weight: 500;
}
.race-login-prompt .rlp-cta {
    white-space: nowrap; flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem; font-weight: 700; text-decoration: none;
    color: #fff; border-radius: 0.5rem;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.55);
    transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.race-login-prompt .rlp-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 22px rgba(59, 130, 246, 0.8);
}
.race-login-prompt .rlp-close {
    background: none; border: 0; color: #cbd5e1;
    opacity: 0.6; cursor: pointer; flex-shrink: 0;
    font-size: 1.25rem; line-height: 1; padding: 0 0.15rem;
}
.race-login-prompt .rlp-close:hover { opacity: 1; }
@media (max-width: 576px) {
    /* Compact stacked layout; drop the canvas entirely (decorative only) and use
       a static gradient so there's zero chance of a canvas height blowup. */
    .race-login-prompt {
        background: linear-gradient(135deg, #101733, #1a2247);
        animation: none;
    }
    .race-login-prompt .rlp-glow { display: none; }
    .race-login-prompt .rlp-inner {
        flex-wrap: wrap; gap: 0.5rem; padding: 0.7rem 0.85rem;
    }
    .race-login-prompt .rlp-text { margin-right: 0; flex-basis: 100%; font-size: 0.85rem; }
    .race-login-prompt .rlp-cta { flex: 1 1 auto; justify-content: center; }
    .race-login-prompt .rlp-close {
        position: absolute; top: 0.35rem; right: 0.5rem; font-size: 1.1rem;
    }
}
@media (prefers-reduced-motion: reduce) {
    .race-login-prompt { animation: none; }
}
/* Light mode: the canvas aurora uses 'lighter' compositing, which washes out on
   white — hide it and use a soft animated indigo gradient with dark text instead. */
[data-bs-theme="light"] .race-login-prompt {
    background: linear-gradient(135deg, #eef2ff 0%, #e7e9ff 30%, #e0f2fe 60%, #eef2ff 100%);
    background-size: 300% 300%;
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.08), 0 4px 18px rgba(99, 102, 241, 0.18);
    animation: rlp-pulse 4.5s ease-in-out infinite, rlp-shift 9s ease infinite;
}
@keyframes rlp-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
[data-bs-theme="light"] .race-login-prompt .rlp-glow { display: none; }
[data-bs-theme="light"] .race-login-prompt .rlp-text { color: #1e293b; }
[data-bs-theme="light"] .race-login-prompt .rlp-icon {
    color: #6366f1; filter: drop-shadow(0 0 5px rgba(99, 102, 241, 0.45));
}
[data-bs-theme="light"] .race-login-prompt .rlp-close { color: #475569; }
@media (prefers-reduced-motion: reduce) {
    [data-bs-theme="light"] .race-login-prompt { animation: none; }
}

/* Login-gated (protected EEA) profile: blur + lock the content behind the modal
   so it can't be read/interacted with until the viewer logs in. */
#driver-stats-content.gate-blur {
    filter: blur(7px);
    pointer-events: none;
    user-select: none;
    transition: filter 0.2s ease;
}

/* ---- League platform pages (public site + /manage) ------------ */
/* Signature: the pit-wall control strip — one monospace bar under the
   hero carrying section nav + season/championship/week context, in place
   of stacked Bootstrap tabs and selects. */
/* Section NAV is a tab rail — pages, not filters. Filters (below, in
   .lg-controls) keep the chip/select look; the two must never match. */
.lg-tabs {
    display: flex; gap: 1.7rem; margin-bottom: 1rem; overflow-x: auto;
    border-bottom: 1px solid var(--border-subtle);
    scrollbar-width: none;
}
.lg-tabs::-webkit-scrollbar { display: none; }
.lg-tab {
    font-family: var(--font-mono); font-size: .72rem; font-weight: 600;
    letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
    color: var(--text-tertiary); text-decoration: none;
    padding: .55rem .1rem .6rem; border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.lg-tab:hover { color: var(--text-primary); }
.lg-tab.active { color: var(--text-primary); border-bottom-color: var(--accent); }

/* ── Shared disclosure nav (/manage .mg-disc; the public league rail
   stays a horizontally scrollable .lg-tabs row on phones — it has few
   items and does not need a menu): the help-center/admin responsive
   pattern (.hc-nav/.adm-nav): a <details> rendered OPEN always (a
   closed <details> hides its children at the browser level, so CSS
   alone cannot re-show them on desktop); an inline script collapses it
   under the nav's breakpoint, where the summary becomes the disclosure
   button, and re-opens it if the viewport crosses back up (rotation).
   No-JS small screens just see it expanded. Desktop hides the summary
   and keeps the nav's existing sidebar look via its media queries
   (breakpoint 992 for manage). The summary names the CURRENT section;
   active items reuse the league's own --accent, so Pro branding
   carries through. ── */
.disc-nav > summary {
    cursor: pointer; font-family: var(--font-mono); font-size: .72rem;
    font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--text-secondary); padding: .55rem .7rem;
    border: 1px solid var(--border-subtle); border-radius: .5rem;
    list-style: none;
}
.disc-nav > summary::-webkit-details-marker { display: none; }
.disc-nav > summary::after { content: ' ▾'; opacity: .55; }
.disc-nav[open] > summary::after { content: ' ▴'; }

.lg-controls {
    display: flex; flex-wrap: wrap; align-items: center; gap: .55rem 1.4rem;
    padding: .55rem .8rem; margin-bottom: 1.35rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle); border-radius: .8rem;
}
/* A league with one season and one championship has nothing to filter —
   don't render an empty strip (:empty fails on whitespace, :has doesn't). */
.lg-controls:not(:has(*)) { display: none; }
/* Control clusters wrap as UNITS (sections / season / championships / week)
   — no mid-group breaks, no orphaned separators. */
.lg-group {
    display: inline-flex; flex-wrap: wrap; align-items: center;
    gap: .45rem .55rem;
}
.lg-controls .sep {
    width: 1px; height: 1.55rem; background: var(--border-subtle);
    margin: 0 .3rem; flex: none;
}
.lg-controls .lb-select { margin: 0; }
.lg-controls .classpill { padding: .34rem .75rem; }
@media (max-width: 575px) { .lg-controls .sep { display: none; } }

/* Section pills: the current page reads like the lit sector on a pit board */
.lg-section-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── /manage admin-panel chrome: compact breadcrumb header (the hero
   stays on the public site — this is a tool), grouped sticky sidebar on
   desktop, the same nav folded behind a .disc-nav disclosure on
   mobile (pattern comments live with .disc-nav above) ── */
.mg-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: .5rem 1.5rem; flex-wrap: wrap;
    padding: .3rem 0 .9rem; margin-bottom: 1.4rem;
    border-bottom: 1px solid var(--border-subtle);
}
.mg-head h1 {
    font-size: 1.12rem; font-weight: 700; letter-spacing: -.01em; margin: 0;
}
.mg-head h1 a { color: var(--text-primary); text-decoration: none; }
.mg-head h1 a:hover { color: var(--accent); }
.mg-head .sep { color: var(--text-tertiary); font-weight: 400; margin: 0 .4rem; }
.mg-head .crumb { color: var(--text-secondary); font-weight: 600; }
.mg-head-meta { font-size: .82rem; color: var(--text-tertiary); }

/* Page title block at the top of each content column (GitHub settings
   style): a real heading + at most one short muted line, with room for
   the page's ONE primary action on the right (Stripe pattern — rare
   actions collapse behind it instead of sitting open on the page). */
.mg-page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: .6rem 1rem; flex-wrap: wrap; margin-bottom: 1.1rem;
}
.mg-page-head h2 {
    font-size: 1.3rem; font-weight: 700; letter-spacing: -.01em; margin: 0;
}
.mg-page-head p {
    color: var(--text-tertiary); font-size: .85rem; margin: .3rem 0 0;
}
/* Cards fill the content column, and content fills its card — pages get
   width from multi-column card grids or toolbar-row forms, never from a
   narrow form floating in a stretched card. */

/* Rules editor: one panel, sections divided by hairlines (GitHub
   settings), Form/JSON swap in place via the panel-head toggle */
.mg-rule-sec { padding: 1.5rem 0 1.6rem; border-top: 1px solid var(--border-subtle); }
.mg-rule-sec:first-child { border-top: 0; padding-top: .3rem; }
.mg-rule-sec > .mg-card-h { margin-bottom: .45rem; }
.mg-rule-sec:last-child { padding-bottom: .4rem; }
/* One plain sentence under each section title: what the rule IS */
.mg-sec-desc {
    color: var(--text-secondary); font-size: .88rem; line-height: 1.55;
    margin: 0 0 1.15rem;
}

/* Editor + sticky live-summary rail (label + compact value pairs,
   updating as the form changes). The side CELL must stretch the full
   row height — align-items:start would shrink it to the card and leave
   the sticky card no room to travel while the page scrolls. */
.mg-edit-layout {
    display: grid; grid-template-columns: 1fr; gap: 1.4rem;
}
@media (min-width: 1200px) {
    .mg-edit-layout { grid-template-columns: minmax(0, 1fr) 17.5rem; }
    .mg-edit-side .card { position: sticky; top: 4.75rem; }
}
.mg-facts-col { flex-direction: column; gap: 1.35rem; }
.mg-facts-col > span { max-width: none; white-space: pre-line; line-height: 1.55; }
/* Section-group eyebrow between card clusters on mixed-topic pages */
.mg-group-h {
    font-family: var(--font-mono); font-size: .62rem; font-weight: 600;
    letter-spacing: .16em; text-transform: uppercase;
    color: var(--text-tertiary); margin: 1.7rem 0 .6rem;
}
.mg-group-h:first-child { margin-top: 0; }

/* Admin tables speak DATA, not the public timing-tower display voice:
   one size for cells, names in the body face, quiet mono row actions. */
.mg .timing tbody td { font-size: .85rem; }
.mg .timing .col-driver {
    font-family: inherit; font-size: .9rem; font-weight: 600;
    letter-spacing: 0;
}
.mg-rowlink {
    font-family: var(--font-mono); font-size: .66rem; font-weight: 600;
    letter-spacing: .1em; text-transform: uppercase;
    color: var(--text-secondary); text-decoration: none; white-space: nowrap;
}
.mg-rowlink:hover { color: var(--accent); }
/* Quiet in-row POST actions: link-weight, state color only on hover —
   the status badge carries the row's color, not the button */
.mg .btn.mg-act {
    background: transparent; border: 0; color: var(--text-secondary);
    padding: .2rem .35rem;
}
.mg .btn.mg-act:hover { color: var(--accent); background: transparent; }
.mg .btn.mg-act-danger:hover { color: #ef4444; }
/* Week separators inside the single season-calendar table */
.mg .timing tr.mg-week-row td,
.mg .timing tr.mg-week-row:hover td {
    background: transparent; border-color: transparent;
    font-family: var(--font-mono); font-size: .64rem; font-weight: 600;
    letter-spacing: .16em; text-transform: uppercase;
    color: var(--text-tertiary); text-align: left;
    padding: .9rem .6rem .15rem 0;
}
.mg .timing tr.mg-week-row:hover { transform: none; }


.mg-layout { display: grid; grid-template-columns: 1fr; gap: 1.4rem; }
.mg-main { min-width: 0; }
.mg-nav { display: flex; flex-direction: column; gap: .15rem; }
.mg-nav a {
    font-family: var(--font-mono); font-size: .72rem; font-weight: 600;
    letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
    color: var(--text-secondary); text-decoration: none;
    padding: .48rem .65rem; border-left: 2px solid transparent;
    border-radius: 0 .45rem .45rem 0;
}
.mg-nav a:hover { color: var(--text-primary); }
.mg-nav a.active {
    color: var(--text-primary); border-left-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 9%, transparent);
}
.mg-nav a.mg-nav-help { color: var(--text-tertiary); margin-top: .5rem; }
.mg-nav a.mg-nav-help:hover { color: var(--text-primary); }
/* Contextual help link in the manage header meta row (never floated:
   a float here once wrapped whole dashboards around it). */
.mg-help { color: var(--text-tertiary); text-decoration: none; }
.mg-help:hover { color: var(--accent); }
@media (min-width: 992px) {
    .mg-layout { grid-template-columns: 12.5rem minmax(0, 1fr); gap: 2.2rem; }
    /* The details wrapper is the grid child now — sticky lives on it */
    .mg-disc { position: sticky; top: 4.75rem; align-self: start; }
    .mg-disc > summary { display: none; }
}
@media (max-width: 991.98px) {
    /* Disclosure list: keep the sidebar's column + left accent bar,
       swap the mono eyebrows for readable body-face rows */
    .mg-nav { padding: .55rem 0; }
    .mg-nav a {
        font-family: inherit; font-size: .92rem; font-weight: 500;
        letter-spacing: 0; text-transform: none;
        color: var(--text-secondary); padding: .5rem .7rem;
    }
}

/* Manage stat strip — data readout, not card chrome */
.mg-stats {
    display: flex; flex-wrap: wrap; gap: 2.2rem;
    font-family: var(--font-mono); margin-bottom: 1.9rem;
}
.mg-stats b { font-size: 1.75rem; font-weight: 700; display: block; line-height: 1.1; }
.mg-stats .mg-stat-label {
    font-size: .66rem; font-weight: 600; letter-spacing: .16em;
    text-transform: uppercase; color: var(--text-tertiary);
}
.mg-stats a { text-decoration: none; }
.mg-stats a:hover b { color: var(--accent); }
.mg-stats b { color: var(--text-primary); }

/* ── /manage design system: one panel language, site-voice buttons ──
   Scoped to .mg so the public site is untouched. */
.mg .card {
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle); border-radius: .9rem;
}
.mg .card-body { padding: 1.25rem 1.4rem; }
.mg-panel-head {
    display: flex; justify-content: space-between; align-items: center;
    gap: 1rem; flex-wrap: wrap; padding: .8rem 1.4rem;
    border-bottom: 1px solid var(--border-subtle);
    /* One head height whether or not the head carries buttons — a
       text-only head (Live summary) must match a buttoned one (Rules) */
    min-height: 3.4rem;
}
.mg-panel-head .mg-card-h { margin-bottom: 0; }
.mg-panel-actions { display: flex; gap: .5rem; }
/* Bootstrap's dark-theme .text-muted (rgba(222,226,230,.75)) is nearly
   body-bright; side notes in /manage must whisper, not compete with the
   heading beside them. !important matches Bootstrap's own. */
.mg .text-muted { color: var(--text-tertiary) !important; }

/* Buttons in the site's own voice (mono pit-board), not stock pills */
.mg .btn {
    font-family: var(--font-mono); font-size: .7rem; font-weight: 700;
    letter-spacing: .09em; text-transform: uppercase;
    border-radius: .5rem; padding: .5rem .85rem; line-height: 1.15;
}
.mg .btn-primary { background: var(--accent); border-color: var(--accent); }
.mg .btn-outline-primary {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}
.mg .btn-outline-primary:hover { background: var(--accent); color: #fff;
    border-color: var(--accent); }
.mg .btn-outline-secondary { color: var(--text-secondary);
    border-color: var(--border-subtle); background: transparent; }
.mg .btn-outline-secondary:hover { color: var(--accent);
    border-color: var(--accent); background: transparent; }
.mg .btn-outline-danger {
    color: #ef4444; border-color: color-mix(in srgb, #ef4444 40%, transparent);
}
.mg .btn-outline-danger:hover { background: #ef4444; border-color: #ef4444; }

/* Alerts: quiet bordered notes, not full-color boxes */
.mg .alert {
    background: color-mix(in srgb, var(--text-primary) 4%, transparent);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--accent);
    color: var(--text-secondary); border-radius: .6rem;
}
.mg .alert-danger { border-left-color: #ef4444; }
.mg .alert-warning { border-left-color: #f59e0b; }
.mg .alert-info { border-left-color: var(--accent); }

/* Raw-JSON editor: same dark editor ground as the marketing showcase, in
   both themes — syntax-painted on a <pre> behind the transparent textarea
   (identical metrics, synced scroll), caret and selection stay native. */
/* Selector carries .mg-json-wrap so these beat the generic
   .mg .form-control rules declared later in the file — a plain .mg-json
   loses font-size/color to them and the paint layer drifts out of sync. */
.mg .mg-json-wrap .mg-json, .mg .mg-json-wrap .mg-json:focus {
    background: transparent; color: transparent; caret-color: #e6edf3;
    border-color: rgba(255, 255, 255, .12);
    font-family: var(--font-mono); font-size: .8rem; line-height: 1.65;
}
.mg .mg-json::selection { background: rgba(56, 139, 253, .45); color: transparent; }
.mg .mg-json-wrap .mg-json:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.mg-json-wrap { position: relative; }
.mg-json-wrap .mg-json { position: relative; z-index: 1; display: block; }
.mg-json-hl {
    position: absolute; inset: 0; z-index: 0; margin: 0; overflow: hidden;
    background: #0d1117; color: #9da7b3;
    border: 1px solid transparent; border-radius: .55rem;
    padding: .55rem .8rem;
    font-family: var(--font-mono); font-size: .8rem; line-height: 1.65;
}
.mg-json-hl code {
    font-family: inherit; font-size: inherit; color: inherit;
    white-space: pre-wrap; word-break: break-word; display: block;
}
.mg-json-hl .jk { color: #7ee787; }   /* keys */
.mg-json-hl .js { color: #a5d6ff; }   /* string values */
.mg-json-hl .jn { color: #79c0ff; }   /* numbers */
.mg-json-hl .jb { color: #ff7b72; }   /* true / false / null */
.mg .btn-outline-secondary.active {
    color: var(--accent); border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}

/* Flush lp-card variant: header row + padded body (public panels) */
/* .lp-card.lp-card-flush (two classes) so this beats the base .lp-card
   padding, which is declared LATER in the file — with a lone .lp-card-flush
   selector every flush panel silently gained 1.3rem of dead padding. */
.lp-card.lp-card-flush { padding: 0; overflow: hidden; }
.lp-card-flush .mg-panel-head { background: transparent; }
.lp-card-flush .lp-card-pad { padding: 1rem 1.35rem 1.2rem; }

/* Stats: dense category blocks inside one panel per car class */
.lg-stats-grid {
    display: grid; gap: 1.2rem 1.8rem;
    /* There are always six record categories: size the tracks so they
       pack evenly on desktop instead of orphaning the last one. */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.lg-stat-table td { padding: .32rem .5rem; font-size: .8rem; }

.stat-incidents { color: #ef4444; }

/* Record book, multiclass leagues: per-class blocks inside one card.
   The class heading keeps the .mg-h eyebrow language but is promoted
   (secondary ink + accent class strip, echoing the season pages' class
   markers) so it scans apart from the tertiary category labels. */
.lg-class-h {
    font-family: var(--font-mono); font-size: .72rem; font-weight: 700;
    letter-spacing: .18em; text-transform: uppercase;
    color: var(--text-secondary);
    border-left: 3px solid var(--accent); padding-left: .55rem;
    margin-bottom: .8rem;
}
.lg-class-block + .lg-class-block { margin-top: 1.35rem; }

/* Narrow centered section that KEEPS the section cadence (inline
   margin:0 auto would override the margin-top rule — that bug once ate
   the space under History import) */
.lp-narrow { max-width: 56rem; margin-inline: auto; }

/* Paddock feature cards: each opens with a mini visual in the timing
   language (sparkline, tower, podium, histogram, grid, class strips) */
.pd-card { display: flex; flex-direction: column; }
.pd-card .lp-league-cta { margin-top: auto; padding-top: .6rem; display: inline-block; }
.pd-viz {
    height: 122px; margin-bottom: .9rem; padding: .55rem .65rem;
    background: color-mix(in srgb, var(--text-primary) 4%, transparent);
    border: 1px solid var(--border-subtle); border-radius: .6rem;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.pd-viz canvas { width: 100% !important; height: 100% !important; }
.pd-mini { width: 100%; align-self: flex-start; }
.pd-mini th { font-family: var(--font-mono); font-size: .58rem;
    letter-spacing: .1em; color: var(--text-tertiary); text-transform: uppercase;
    padding: 0 .4rem .15rem; text-align: right; }
.pd-mini td { padding: .22rem .4rem; font-size: .74rem; }
.pd-drop { text-decoration: line-through; color: var(--text-tertiary); }
.pd-bars { display: flex; align-items: flex-end; gap: .3rem;
    width: 100%; height: 100%; }
.pd-bars span { flex: 1; border-radius: .2rem .2rem 0 0;
    background: linear-gradient(180deg, var(--accent),
        color-mix(in srgb, var(--accent) 45%, transparent)); }
.pd-podium { display: flex; align-items: flex-end; gap: .5rem;
    width: 100%; height: 100%; padding: 0 .5rem; }
.pd-step { flex: 1; border-radius: .35rem .35rem 0 0; position: relative;
    display: flex; flex-direction: column; align-items: center;
    justify-content: flex-start; gap: .3rem; padding-top: .45rem;
    background: color-mix(in srgb, var(--text-primary) 7%, transparent);
    border: 1px solid var(--border-subtle); border-bottom: none; }
.pd-step b { font-family: var(--font-mono); font-size: 1.1rem; }
.pd-p1 { height: 92%; border-top: 3px solid #d4a017; }
.pd-p1 b { color: #d4a017; }
.pd-p2 { height: 68%; border-top: 3px solid #9ca3af; }
.pd-p2 b { color: #9ca3af; }
.pd-p3 { height: 52%; border-top: 3px solid #b36c33; }
.pd-p3 b { color: #b36c33; }
.pd-classes { display: flex; flex-direction: column; gap: .45rem; width: 100%; }
.pd-class { display: flex; align-items: center; gap: .6rem;
    padding: .35rem .6rem; border-radius: .4rem;
    border-left: 3px solid var(--cls, var(--border-subtle));
    background: color-mix(in srgb, var(--text-primary) 5%, transparent); }
.pd-class-name { font-family: var(--font-mono); font-size: .62rem;
    letter-spacing: .08em; text-transform: uppercase;
    color: var(--text-secondary); min-width: 6.5rem; }
.pd-class-pts { margin-left: auto; font-family: var(--font-mono);
    font-size: .78rem; font-weight: 700; }
.pd-split { font-family: var(--font-mono); font-size: .62rem;
    border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
    color: var(--accent); border-radius: .3rem; padding: .12rem .4rem; }

/* Season Wrapped stat tiles, organized as labeled story rows (the
   season / results / rating & strength). Wrapping FLEX, not grid: tile
   count varies per driver, so a rigid grid strands orphans — flex lets
   each group's tiles grow to fill its row. */
.wr-groups { margin: 1.4rem 0; display: flex; flex-direction: column; gap: 1.05rem; }
.wr-group-label {
    font-family: var(--font-mono); font-size: .62rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .14em;
    color: var(--text-tertiary); display: block; margin-bottom: .45rem;
}
.wr-grid { display: flex; flex-wrap: wrap; gap: .7rem; }
.wr-grid .wr-stat { flex: 1 1 160px; }
.wr-stat {
    background: var(--surface-elevated); border: 1px solid var(--border-subtle);
    border-radius: .8rem; padding: 1rem 1.1rem; text-align: center;
    display: flex; flex-direction: column; gap: .15rem; justify-content: center;
}
.wr-stat b { font-family: var(--font-mono); font-size: 1.9rem;
    font-weight: 700; line-height: 1.1; }
.wr-stat span { color: var(--text-tertiary); font-size: .78rem; }
.wr-big b { font-size: 2.5rem; color: var(--accent); }
/* Wrapped fact tiles: textual facts (home series, track, car, leagues)
   in the same tile language as the stat grid, left-aligned with a micro
   label, display-face value and muted sub-line. */
.wr-facts { display: grid; gap: .7rem;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.wr-fact {
    background: var(--surface-elevated); border: 1px solid var(--border-subtle);
    border-radius: .8rem; padding: .85rem 1rem;
    display: flex; flex-direction: column; gap: .2rem; min-width: 0;
}
.wr-fact-label { font-family: var(--font-mono); font-size: .62rem;
    font-weight: 600; text-transform: uppercase; letter-spacing: .12em;
    color: var(--text-tertiary); display: flex; align-items: center; gap: .4rem; }
.wr-fact-label .bi { color: var(--accent); font-size: .8rem; }
.wr-fact-value { font-family: var(--font-display); font-weight: 700;
    font-size: 1.12rem; line-height: 1.25; overflow-wrap: anywhere; }
.wr-fact-value a { color: inherit; text-decoration: none; }
.wr-fact-value a:hover { color: var(--accent); }
.wr-fact-sub { font-size: .78rem; color: var(--text-tertiary); }
.wr-fact-sub .wr-rank { font-family: var(--font-mono); font-weight: 700;
    color: var(--accent); font-size: .85rem; }
.wr-gold b { color: #d4a017; }
.wr-up b { color: #3fb950; }
.wr-down b { color: #ef4444; }

/* Admin section nav (shared across /admin pages) — same responsive
   pattern as the help center nav (.hc-nav): a <details> rendered open,
   collapsed by script on small screens where the summary becomes the
   disclosure. Desktop hides the summary and shows the usual mono
   underline tab row; Tools is a nested <details> (dropdown on desktop,
   indented disclosure group on mobile). */
.adm-nav { margin: .35rem 0 1.1rem; }
.adm-nav > summary {
    cursor: pointer; font-family: var(--font-mono); font-size: .72rem;
    font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--text-secondary); padding: .5rem .65rem;
    border: 1px solid var(--border-subtle); border-radius: .5rem;
    list-style: none;
}
.adm-nav > summary::-webkit-details-marker { display: none; }
.adm-nav nav a, .adm-nav-tools > summary {
    color: var(--text-tertiary); text-decoration: none; cursor: pointer;
    list-style: none;
}
.adm-nav nav a:hover,
.adm-nav-tools > summary:hover { color: var(--text-primary); }
.adm-nav-tools > summary::-webkit-details-marker { display: none; }
.adm-nav-tools > summary::after { content: ' ▾'; opacity: .6; }
@media (min-width: 861px) {
    .adm-nav > summary { display: none; }
    .adm-nav nav { display: flex; flex-wrap: wrap; gap: .25rem;
        border-bottom: 1px solid var(--border-subtle); }
    .adm-nav nav a, .adm-nav-tools > summary {
        display: block;
        font-family: var(--font-mono); font-size: .72rem; font-weight: 600;
        text-transform: uppercase; letter-spacing: .1em;
        padding: .45rem .7rem .55rem; border-bottom: 2px solid transparent;
        margin-bottom: -1px;
    }
    .adm-nav nav a.active,
    .adm-nav-tools > summary.active {
        color: var(--accent); border-bottom-color: var(--accent); }
    .adm-nav-tools { position: relative; }
    .adm-nav-menu {
        position: absolute; left: 0; top: 100%; z-index: 40;
        min-width: 13rem; padding: .35rem;
        display: flex; flex-direction: column;
        background: var(--surface-elevated);
        border: 1px solid var(--border-subtle); border-radius: .6rem;
        box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    }
    .adm-nav-menu a {
        border-bottom: 0; margin-bottom: 0;
        padding: .4rem .55rem; border-radius: .4rem;
    }
    .adm-nav-menu a:hover {
        background: color-mix(in srgb, var(--accent) 9%, transparent); }
}
@media (max-width: 860px) {
    .adm-nav nav { display: flex; flex-direction: column; gap: .1rem;
        padding: .5rem 0; }
    .adm-nav nav a, .adm-nav-tools > summary {
        font-size: .84rem; color: var(--text-secondary);
        padding: .28rem .55rem; border-left: 2px solid transparent;
        border-radius: 0 .4rem .4rem 0;
    }
    .adm-nav nav a.active {
        color: var(--text-primary); border-left-color: var(--accent);
        background: color-mix(in srgb, var(--accent) 9%, transparent);
    }
    .adm-nav-tools > summary.active { color: var(--text-primary); }
    .adm-nav-menu { display: flex; flex-direction: column; gap: .1rem;
        padding-left: .8rem; }
}

/* Shared admin footer: the page close — two labeled groups reusing the
   hub's sector-rail headers (.adm-group-h: mono eyebrow + hairline to
   the edge) over auto-fit pill grids: the object browser (with
   row-estimate badges on the big tables) and the operator tools. */
.adm-foot { margin-top: 3.25rem; }
.adm-foot-group { margin-top: 1.4rem; }
.adm-foot-group:first-child { margin-top: 0; }
.adm-foot-links {
    display: grid; gap: .5rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr));
}
.adm-foot-pill {
    display: flex; align-items: center; gap: .5rem;
    min-height: 2.6rem; padding: .45rem .8rem;
    font-family: var(--font-mono); font-size: .72rem; font-weight: 600;
    letter-spacing: .03em; text-decoration: none;
    color: var(--text-secondary);
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle); border-radius: .6rem;
}
.adm-foot-pill:hover {
    color: var(--text-primary);
    border-color: color-mix(in srgb, var(--accent) 40%, var(--border-subtle));
}
.adm-foot-count {
    margin-left: auto; color: var(--text-tertiary);
    font-size: .88em; font-weight: 400;
}

/* Pricing page */
.pr-plan { display: flex; flex-direction: column; }
.pr-plan .lp-card-pad { display: flex; flex-direction: column; flex: 1; }
.pr-plan .pr-features { margin-bottom: 1rem; }
.pr-plan .lp-btn { margin-top: auto; align-self: flex-start; }

.pr-price { font-size: 1.05rem; color: var(--text-secondary); margin-bottom: 1rem; }
.pr-price b { font-size: 2rem; font-family: var(--font-mono); font-weight: 700;
    color: var(--text-primary); }
.pr-save {
    font-family: var(--font-mono); font-size: .62rem; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase; color: #3fb950;
    white-space: nowrap; display: inline-block;
    border: 1px solid color-mix(in srgb, #3fb950 45%, transparent);
    border-radius: 999px; padding: .2rem .55rem; margin-left: .5rem;
    vertical-align: middle;
}
.pr-founder {
    max-width: 34rem; margin: 1.2rem auto 0; padding: .8rem 1.1rem;
    border: 1px dashed color-mix(in srgb, #e8a13a 60%, transparent);
    border-radius: .8rem; color: var(--text-secondary); font-size: .95rem;
    background: color-mix(in srgb, #e8a13a 7%, transparent);
}
.pr-founder strong { color: var(--text-primary); }
.pr-founder-count {
    display: inline-block; font-family: var(--font-mono); font-size: .72rem;
    font-weight: 700; color: #e8a13a; white-space: nowrap;
    padding: .1rem .45rem; border-radius: .35rem;
    background: color-mix(in srgb, #e8a13a 14%, transparent);
}
.pr-founder-badge {
    display: inline-block; font-family: var(--font-mono); font-size: .6rem;
    font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    padding: .22rem .5rem; border-radius: .35rem; line-height: 1;
    color: #1a1205; background: linear-gradient(135deg, #f5c84b, #e8a13a);
    margin-right: .5rem; vertical-align: middle;
}
.pr-price s { color: var(--text-tertiary); font-size: 1.1rem;
    font-family: var(--font-mono); margin-right: .15rem; }
.pr-save-founder {
    color: #e8a13a; border-color: color-mix(in srgb, #e8a13a 50%, transparent);
}
.pr-pro-card { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.pr-features { list-style: none; margin: 0 0 .5rem; padding: 0; }
.pr-features li {
    color: var(--text-secondary); font-size: .93rem; padding: .3rem 0 .3rem 1.6rem;
    position: relative; text-wrap: pretty;
}
.pr-features li::before {
    content: '✓'; position: absolute; left: .1rem; color: var(--accent);
    font-weight: 700;
}
/* Plan comparison: a spec sheet in the timing voice. Group rows carry the
   mono eyebrow, values are real words rather than a checkmark wall, and
   the Pro column keeps the pro card's accent tint. */
.pr-compare-scroll { overflow-x: auto; }
.pr-compare { width: 100%; min-width: 34rem; border-collapse: collapse; font-size: .93rem; }
.pr-compare th, .pr-compare td { padding: .55rem 1rem; vertical-align: top; }
.pr-compare .pr-col { width: 11.5rem; text-align: center; }
.pr-compare thead th {
    font-family: var(--font-display); font-size: 1.02rem; font-weight: 700;
    color: var(--text-primary); border-bottom: 1px solid var(--border-subtle);
    padding-top: .95rem; padding-bottom: .75rem;
}
.pr-compare tbody td {
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary); text-wrap: pretty;
}
.pr-compare tbody td.pr-col {
    color: var(--text-secondary); font-size: .88rem;
}
.pr-compare .pr-group td {
    font-family: var(--font-mono); font-size: .62rem; font-weight: 700;
    letter-spacing: .14em; text-transform: uppercase; color: var(--text-tertiary);
    padding: 1.2rem 1rem .35rem; border-bottom: none;
}
.pr-compare tbody tr:last-child td { border-bottom: none; }
.pr-yes { color: var(--accent); font-size: 1.05rem; line-height: 1; }
.pr-no { color: var(--text-tertiary); }
/* Small screens: no sideways scroll. Each feature stacks full-width with
   the two plan values side by side beneath it, labeled inline (the
   thead is hidden, so the labels ride on the cells). */
@media (max-width: 620px) {
    .pr-compare { min-width: 0; }
    .pr-compare thead { display: none; }
    .pr-compare tbody tr {
        display: grid; grid-template-columns: 1fr 1fr;
        padding: .55rem .25rem;
        border-bottom: 1px solid var(--border-subtle);
    }
    .pr-compare tbody tr:last-child { border-bottom: none; }
    .pr-compare tbody td, .pr-compare tbody td.pr-col {
        display: block; border-bottom: none; padding: .15rem .35rem;
        width: auto;
    }
    .pr-compare tbody td:first-child { grid-column: 1 / -1; }
    .pr-compare tbody td.pr-col { text-align: left; }
    .pr-compare td.pr-col::before {
        content: 'Standard'; display: block;
        font-family: var(--font-mono); font-size: .58rem; font-weight: 700;
        letter-spacing: .12em; text-transform: uppercase;
        color: var(--text-tertiary); margin-bottom: .1rem;
    }
    .pr-compare td.pr-col:last-child::before { content: 'Pro'; }
    .pr-compare .pr-group { border-bottom: none; }
    .pr-compare .pr-group td { padding: 1rem .35rem .1rem; }
}

/* Pricing v3: open hero, two clean plan cards with ONE visually primary
   plan (Pro: accent border, soft glow, Most popular flag, solid CTA),
   huge mono price digits straight on the card, sentence-case microcopy.
   Mono caps are reserved for kickers; no nested boxes, no tints. */
.prc-hero { padding: 1.2rem 0 .4rem; }
.prc-hero .lp-sub { font-size: 1.1rem; }
.prc-toggle {
    display: inline-flex; margin-top: 1.4rem; padding: .3rem;
    border: 1px solid var(--border-subtle); border-radius: 999px;
    background: var(--surface-elevated);
}
.prc-toggle-btn {
    display: inline-flex; align-items: center; gap: .45rem;
    border: 0; background: transparent; color: var(--text-secondary);
    font-size: .92rem; font-weight: 600; line-height: 1;
    padding: .6rem 1.2rem; border-radius: 999px; cursor: pointer;
    transition: color .12s ease;
}
.prc-toggle-btn:hover { color: var(--text-primary); }
.prc-toggle-btn.active { background: var(--accent); color: #fff; }
.prc-toggle-save {
    font-family: var(--font-mono); font-size: .6rem; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase;
    padding: .22rem .5rem; border-radius: 999px;
    background: rgba(63, 185, 80, .18); color: #3fb950;
}
.prc-toggle-btn.active .prc-toggle-save { background: rgba(255, 255, 255, .2); color: #fff; }

.prc-plans {
    display: grid; grid-template-columns: 1fr; gap: 1.25rem;
    max-width: 74rem; margin-inline: auto;
}
@media (min-width: 768px) {
    .prc-plans { grid-template-columns: 1fr 1fr; align-items: stretch; }
}
/* All three plans on one row at desktop — a 2-col grid orphaned the
   'most popular' Pro card onto its own row below the fold */
@media (min-width: 1100px) {
    .prc-plans { grid-template-columns: repeat(3, 1fr); }
}
.prc-plan {
    position: relative; display: flex; flex-direction: column;
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle); border-radius: 1.1rem;
    padding: 2rem 2rem 1.6rem;
}
.prc-featured {
    border-color: color-mix(in srgb, var(--accent) 60%, transparent);
    box-shadow: 0 18px 50px -18px color-mix(in srgb, var(--accent) 45%, transparent);
}
.prc-flag {
    position: absolute; top: -.75rem; left: 50%; transform: translateX(-50%);
    font-family: var(--font-mono); font-size: .62rem; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
    color: #fff; background: var(--accent);
    padding: .3rem .8rem; border-radius: 999px;
}
.prc-kicker {
    font-family: var(--font-mono); font-size: .64rem; font-weight: 700;
    letter-spacing: .14em; text-transform: uppercase;
    color: var(--text-tertiary); margin: 0 0 .3rem;
}
.prc-featured .prc-kicker { color: var(--accent); }
.prc-name {
    font-family: var(--font-display, inherit); font-weight: 700;
    font-size: 1.45rem; margin: 0 0 1.1rem;
}
.prc-price { font-family: var(--font-mono); color: var(--text-secondary); line-height: 1; }
.prc-price b {
    font-size: 3.1rem; font-weight: 700; color: var(--text-primary);
    letter-spacing: -.03em;
}
.prc-price s { color: var(--text-tertiary); font-size: 1.25rem; margin-right: .4rem; }
.prc-per { font-size: 1rem; margin-left: .3rem; }
.prc-meta { color: var(--text-secondary); font-size: .92rem; margin: .55rem 0 0; }
.prc-who {
    color: var(--text-primary); font-weight: 600; font-size: .98rem;
    margin: 1.15rem 0 .5rem; padding-top: 1.1rem;
    border-top: 1px solid var(--border-subtle);
}
.prc-plan .pr-features { margin-bottom: 1.4rem; }
.prc-plan .pr-features li { font-size: .95rem; padding-top: .38rem; padding-bottom: .38rem; }
.prc-cta {
    display: block; width: 100%; text-align: center;
    margin-top: auto; padding-top: .85rem; padding-bottom: .85rem;
}
.prc-trust {
    margin: .75rem 0 0; text-align: center;
    color: var(--text-tertiary); font-size: .82rem;
}
.prc-addon {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem 1.5rem; flex-wrap: wrap; padding: 1.4rem 1.6rem;
}
.prc-addon > div { flex: 1 1 24rem; min-width: 0; }
.prc-addon-price {
    font-family: var(--font-mono); color: var(--text-secondary);
    white-space: nowrap;
}
.prc-addon-price b {
    font-size: 1.9rem; font-weight: 700; color: var(--text-primary);
}

.pr-faq { display: grid; gap: 1.1rem 2rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.pr-faq h3 { font-size: 1rem; font-weight: 700; margin-bottom: .35rem; }
.pr-faq p { color: var(--text-secondary); font-size: .93rem; margin: 0; }

/* ── Account page: the signed-in driver's home base ─────────────────── */
.ac { max-width: 44rem; }
.ac-head {
    display: flex; flex-wrap: wrap; justify-content: space-between;
    align-items: flex-end; gap: 1rem 1.5rem; margin-bottom: 2rem;
}
.ac-name {
    font-family: var(--font-display, inherit); font-weight: 800;
    font-size: clamp(1.9rem, 4vw, 2.5rem); line-height: 1.05;
    margin: .3rem 0 .45rem;
}
.ac-id {
    display: inline-block; font-family: var(--font-mono); font-size: .72rem;
    font-weight: 600; letter-spacing: .05em; color: var(--text-tertiary);
    border: 1px solid var(--border-subtle); border-radius: .4rem;
    padding: .25rem .55rem;
}
.ac-sub { color: var(--text-secondary); margin: -1.2rem 0 1.8rem; }
.ac-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.ac-card {
    background: var(--surface-elevated); border: 1px solid var(--border-subtle);
    border-radius: .9rem; padding: 1.5rem 1.6rem;
}
.ac-card + .ac-card { margin-top: 1.25rem; }
.ac-card h2 {
    font-family: var(--font-display, inherit); font-weight: 700;
    font-size: 1.1rem; margin-bottom: 1rem;
}
.ac-card h2 .bi { color: var(--accent); }
.ac-hint { color: var(--text-secondary); font-size: .88rem; }
.ac-status { color: var(--text-secondary); }
.ac-status .bi { color: #3fb950; margin-right: .4rem; }
.ac-chip {
    display: inline-block; font-family: var(--font-mono); font-size: .6rem;
    font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: var(--text-secondary); background: var(--surface-subtle);
    border: 1px solid var(--border-subtle); border-radius: 999px;
    padding: .22rem .55rem; vertical-align: middle;
}
.ac-chip-owner {
    color: #1a1205; background: linear-gradient(135deg, #f5c84b, #e8a13a);
    border-color: transparent;
}
.ac-choice {
    display: flex; gap: .8rem; align-items: flex-start; cursor: pointer;
    border: 1px solid var(--border-subtle); border-radius: .7rem;
    padding: 1rem 1.1rem; margin-bottom: .8rem; transition: border-color .12s ease;
}
.ac-choice:hover { border-color: var(--text-tertiary); }
.ac-choice:has(input:checked) {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.ac-choice input { margin-top: .2rem; flex-shrink: 0; }
.ac-choice-sub {
    display: block; color: var(--text-secondary); font-size: .88rem;
    margin-top: .25rem;
}
.ac-leagues { display: flex; flex-direction: column; }
.ac-league-row {
    display: flex; justify-content: space-between; align-items: center;
    gap: 1rem; padding: .75rem .1rem;
    border-bottom: 1px solid var(--border-subtle);
}
.ac-league-row:last-child { border-bottom: 0; padding-bottom: .1rem; }
.ac-league-row:first-child { padding-top: .1rem; }
.ac-league-name a {
    font-family: var(--font-display, inherit); font-weight: 600;
    font-size: 1.05rem; color: var(--text-primary); text-decoration: none;
    margin-right: .5rem;
}
.ac-league-name a:hover { color: var(--accent); }
.ac-btn-sm { padding: .5rem .9rem; font-size: .66rem; }
.ac-email-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.ac-email-row .form-control { max-width: 20rem; }
/* Post-login email ask: the skip action stays deliberately quiet */
.ac-skip {
    background: none; border: 0; padding: 0; cursor: pointer;
    color: var(--text-tertiary); font-size: .85rem;
    text-decoration: underline; text-underline-offset: 3px;
}
.ac-skip:hover { color: var(--text-secondary); }
.ac-discord {
    display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
    margin-top: 1.25rem; padding-top: 1.25rem;
    border-top: 1px solid var(--border-subtle);
}

/* PRO badge: the paid-tier gold, used wherever bespoke work is surfaced */
.mg-pro {
    display: inline-block; font-family: var(--font-mono); font-size: .58rem;
    font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    padding: .18rem .45rem; border-radius: .35rem; line-height: 1;
    color: #1a1205; background: linear-gradient(135deg, #f5c84b, #e8a13a);
    vertical-align: middle; margin-left: .35rem;
    transform: translateY(-1px);
}
.mg-plugin-link { text-decoration: none; color: var(--text-secondary); }
.mg-plugin-link:hover { color: var(--accent); }
/* Plugin entries share ONE type scale with the card's mg-help intro —
   mixing card-title sizes and the public rules-list here read amateur */
.mg-plugin-name {
    font-size: .95rem; font-weight: 700; color: var(--text-primary);
    line-height: 1.55; margin: 0 0 .35rem;
}
.mg-plugin-name span {
    font-weight: 400; font-size: .88rem; color: var(--text-tertiary);
}
.mg-plugin-notes { margin: 0; padding-left: 1.15rem; }
.mg-plugin-notes li {
    color: var(--text-secondary); font-size: .9rem; line-height: 1.55;
}
.mg-plugin-notes li + li { margin-top: .3rem; }
.mg-plugin-notes li::marker { color: var(--text-tertiary); }

/* Fact strip: labeled values instead of a dot-separated run-on line */
.mg-facts { display: flex; flex-wrap: wrap; gap: .6rem 2.2rem; }
.mg-facts > span {
    display: flex; flex-direction: column; gap: .15rem;
    font-size: .88rem; color: var(--text-secondary); max-width: 22rem;
}
.mg-facts b {
    font-family: var(--font-mono); font-size: .62rem; font-weight: 600;
    letter-spacing: .14em; text-transform: uppercase;
    color: var(--text-tertiary);
}

/* Seamless title edit: reads as a heading, edits like a field. The save
   button only appears while editing. */
.mg-title-form { display: inline-flex; align-items: center; gap: .35rem; }
.mg-title-form input.form-control {
    background: transparent; border-color: transparent;
    font-weight: 700; font-size: 1.05rem; color: var(--text-primary);
    padding: .15rem .45rem .15rem 0; box-shadow: none;
}
.mg-title-form input.form-control:hover {
    border-color: var(--border-subtle); padding-left: .45rem;
}
.mg-title-form input.form-control:focus {
    background: color-mix(in srgb, var(--text-primary) 5%, transparent);
    border-color: var(--accent); padding-left: .45rem;
}
.mg-title-form .btn { visibility: hidden; }
.mg-title-form:focus-within .btn, .mg-title-form:hover .btn { visibility: visible; }

/* Card/section TITLES: real headings. (The mono eyebrow .mg-h below is
   for labels above a heading — never for a card's own title.) */
.mg-card-h {
    font-size: 1.08rem; font-weight: 700; letter-spacing: -.01em;
    color: var(--text-primary); margin-bottom: .65rem;
}

/* Card section headers in /manage: eyebrow style, not bold prose */
.mg-h {
    font-family: var(--font-mono); font-size: .7rem; font-weight: 600;
    letter-spacing: .18em; text-transform: uppercase;
    color: var(--text-tertiary); margin-bottom: .8rem;
}

/* 'Add championship' card: dashed like the other 'add one' tiles */
.mg-add-card {
    border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
    background: color-mix(in srgb, var(--text-primary) 3%, transparent);
}

/* Scoring pages: readable helper text (not Bootstrap 'small' soup) and
   mono micro-labels on builder fields, matching the public rules page. */
.mg-help { color: var(--text-secondary); font-size: .9rem; line-height: 1.55; }
#builder .form-label {
    font-family: var(--font-mono); font-size: .64rem; font-weight: 600;
    letter-spacing: .13em; text-transform: uppercase;
    color: var(--text-tertiary); margin-bottom: .3rem;
}
#builder .card-body { padding: 1.1rem 1.4rem 1.3rem; }
.mg-split-head {
    display: flex; gap: .5rem; margin-bottom: .35rem;
    font-family: var(--font-mono); font-size: .62rem; font-weight: 600;
    letter-spacing: .13em; text-transform: uppercase; color: var(--text-tertiary);
}
/* Single-table mode: the split-number column is meaningless — hide it
   (input and header cell), leaving "Points from P1 down" as the label. */
#builder[data-pmode="single_table"] .table-row .tkey { display: none; }
#builder[data-pmode="single_table"] .mg-split-head .tkey-head { display: none; }
.mg-tb-ord {
    display: grid; place-items: center; width: 1.7rem; height: 1.7rem;
    flex: 0 0 auto; font-family: var(--font-mono); font-size: .7rem;
    font-weight: 700; color: var(--text-tertiary);
    border: 1px solid var(--border-subtle); border-radius: .45rem;
}

/* Collapsed season history on the dashboard */
.mg-seasons-more summary {
    font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em;
    text-transform: uppercase; color: var(--text-secondary); cursor: pointer;
    padding: .5rem 0;
}
.mg-seasons-more summary:hover { color: var(--accent); }

/* ---- League landing + creation wizard ------------------------- */
.lp { padding: 1.2rem 0 3rem; }
.lp-hero { padding: 3rem 2.2rem 2.6rem; }
.lp-title {
    font-family: var(--font-display, inherit); font-weight: 800;
    font-size: clamp(2.2rem, 5.5vw, 3.6rem); line-height: 1.04;
    letter-spacing: -.02em; margin: .35rem 0 .8rem;
}
.lp-sub { color: var(--text-secondary); font-size: 1.05rem; max-width: 34rem; }
.lp-tower {
    background: var(--surface-elevated); border: 1px solid var(--border-subtle);
    border-radius: .9rem; padding: 1rem 1.1rem .7rem;
}
.lp-tower-head {
    display: flex; gap: .7rem; align-items: baseline; flex-wrap: wrap;
    font-family: var(--font-mono); font-size: .72rem; color: var(--text-secondary);
    margin-bottom: .55rem;
}
.lp-live { color: var(--accent); font-weight: 700; text-transform: uppercase;
    letter-spacing: .14em; display: inline-flex; align-items: center; gap: .35rem; }
.lp-live .dot { width: .5em; height: .5em; border-radius: 50%;
    background: currentColor; animation: lp-pulse 2s infinite; }
@keyframes lp-pulse { 50% { opacity: .35; } }
.lp-tower .timing tbody tr {
    animation: lp-row .5s both; animation-delay: calc(var(--i) * 90ms);
}
@keyframes lp-row { from { opacity: 0; transform: translateX(-10px); } }
@media (prefers-reduced-motion: reduce) {
    .lp-tower .timing tbody tr { animation: none; }
    .lp-live .dot { animation: none; }
}
.lp-tower-caption {
    font-family: var(--font-mono); font-size: .68rem;
    color: var(--text-tertiary); margin: .6rem 0 0;
}
/* Discord-chat mock for the bot page (/discord): same tower shell,
   message rows instead of a timing table */
.dc-msg { display: flex; gap: .65rem; padding: .45rem 0; }
.dc-msg + .dc-msg { border-top: 1px solid var(--border-subtle); }
.dc-avatar {
    flex: 0 0 auto; width: 2.1rem; height: 2.1rem; border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 18%, var(--surface-elevated));
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem;
}
.dc-body { min-width: 0; flex: 1; }
.dc-author {
    font-size: .82rem; font-weight: 700; color: var(--text-primary);
    display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap;
}
.dc-bot {
    font-size: .58rem; font-weight: 700; letter-spacing: .06em;
    background: var(--accent); color: #fff; border-radius: .25rem;
    padding: .05rem .3rem; text-transform: uppercase;
}
.dc-time { font-family: var(--font-mono); font-size: .62rem;
    font-weight: 400; color: var(--text-tertiary); }
.dc-embed {
    margin-top: .35rem; padding: .55rem .75rem;
    border-left: 3px solid var(--accent);
    background: color-mix(in srgb, var(--surface-elevated) 55%, transparent);
    border-radius: .35rem; font-size: .82rem; color: var(--text-secondary);
}
.dc-embed-title { font-weight: 700; color: var(--text-primary);
    margin-bottom: .35rem; }
.dc-line { padding: .12rem 0; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; }
.dc-line code { font-size: .72rem; }
.dc-line .lp-skel { margin-left: .15rem; }
.dc-link { color: var(--accent); text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.dc-plain { margin-top: .25rem; font-size: .82rem;
    color: var(--text-secondary); }
/* A rendered card image inside a mocked bot embed (Discord shows
   attachments with soft corners under the embed text). */
.dc-card { display: block; width: 100%; height: auto;
    border-radius: .45rem; margin: .3rem 0 .35rem; }
.dc-embed .dc-card + .dc-line { white-space: normal; }
/* /driver + /compare reply mock: slash-command reference line,
   mini stat tiles and the head-to-head grid */
.dc-cmd { font-family: var(--font-mono); font-size: .62rem;
    color: var(--text-tertiary); margin-bottom: .12rem; }
.dc-cmd b { color: var(--accent); font-weight: 600; }
.dc-statgrid { display: flex; gap: .45rem; flex-wrap: wrap;
    margin: .15rem 0 .35rem; }
.dc-stat { flex: 1 1 0; min-width: 5.4rem; text-align: center;
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    border: 1px solid var(--border-subtle); border-radius: .4rem;
    padding: .35rem .3rem; }
.dc-stat b { display: block; font-size: .95rem; letter-spacing: -.01em;
    color: var(--text-primary); font-variant-numeric: tabular-nums; }
.dc-stat span { font-family: var(--font-mono); font-size: .58rem;
    color: var(--text-tertiary); text-transform: uppercase;
    letter-spacing: .08em; }
.dc-vs { display: grid; grid-template-columns: 1fr auto 1fr;
    gap: .12rem .7rem; margin: .15rem 0 .35rem;
    font-variant-numeric: tabular-nums; font-size: .82rem;
    color: var(--text-secondary); }
.dc-vs-label { font-family: var(--font-mono); font-size: .58rem;
    color: var(--text-tertiary); text-transform: uppercase;
    letter-spacing: .08em; align-self: center; text-align: center; }
.dc-vs-a { text-align: right; }
.dc-vs-b { text-align: left; }
.dc-vs .win { color: var(--text-primary); font-weight: 700; }
/* Bot guide (/discord/guide): command reference rows */
.dg-cmd { display: flex; gap: 1.2rem; padding: .8rem 0; }
.dg-cmd + .dg-cmd { border-top: 1px solid var(--border-subtle); }
.dg-cmd-sig { flex: 0 0 15rem; min-width: 0; }
.dg-cmd-sig code { font-size: .85rem; word-break: break-word; }
.dg-cmd-desc { color: var(--text-secondary); font-size: .92rem; }
.dg-cmd-opts { margin-top: .3rem; display: flex; flex-direction: column;
    gap: .15rem; font-size: .8rem; color: var(--text-tertiary); }
.dg-cmd-opts code { font-size: .75rem; }
@media (max-width: 640px) {
    .dg-cmd { flex-direction: column; gap: .35rem; }
    .dg-cmd-sig { flex-basis: auto; }
}
/* Help center (/help): documentation layout — sidebar of all guides,
   article with on-this-page TOC and prev/next pager */
.hc { padding: 1.5rem 0 2rem; }
.hc-head { margin-bottom: 1.6rem; }
.hc-head h1 {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem); font-weight: 800;
    letter-spacing: -.02em; margin: .35rem 0;
}
.hc-head p { max-width: 44rem; margin: 0; }
.hc-head .sep { opacity: .4; padding: 0 .25rem; }
.hc-layout {
    display: grid; gap: 2.2rem;
    grid-template-columns: 15rem minmax(0, 1fr);
    align-items: start;
}
@media (max-width: 860px) {
    .hc-layout { grid-template-columns: 1fr; gap: 1.2rem; }
}
/* Sidebar: <details> so mobile gets a disclosure; desktop forces open
   and hides the summary */
.hc-nav summary {
    cursor: pointer; font-family: var(--font-mono); font-size: .72rem;
    font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--text-secondary); padding: .5rem .65rem;
    border: 1px solid var(--border-subtle); border-radius: .5rem;
    list-style: none;
}
.hc-nav summary::-webkit-details-marker { display: none; }
@media (min-width: 861px) {
    .hc-nav summary { display: none; }
    .hc-nav { position: sticky; top: 1rem; }
}
.hc-nav nav { display: flex; flex-direction: column; gap: .1rem;
    padding: .5rem 0; }
.hc-nav-h {
    font-family: var(--font-mono); font-size: .6rem; font-weight: 700;
    letter-spacing: .14em; text-transform: uppercase;
    color: var(--text-tertiary); margin: .9rem 0 .25rem;
}
.hc-nav nav .hc-nav-h:first-child { margin-top: 0; }
.hc-nav nav a {
    font-size: .84rem; color: var(--text-secondary); text-decoration: none;
    padding: .28rem .55rem; border-left: 2px solid transparent;
    border-radius: 0 .4rem .4rem 0;
}
.hc-nav nav a:hover { color: var(--text-primary); }
.hc-nav nav a.active {
    color: var(--text-primary); border-left-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 9%, transparent);
}
/* Hub: one row per guide */
.hc-hub-group { margin-bottom: 1.8rem; }
.hc-hub-row {
    display: block; text-decoration: none; padding: .65rem .8rem;
    border: 1px solid var(--border-subtle); border-radius: .6rem;
    margin-bottom: .5rem; background: var(--surface-elevated);
}
.hc-hub-row:hover { border-color: var(--accent); }
.hc-hub-title { display: block; font-weight: 700; color: var(--text-primary); }
.hc-hub-desc { display: block; font-size: .85rem; color: var(--text-secondary); }
/* On this page */
.hc-toc {
    border: 1px solid var(--border-subtle); border-radius: .6rem;
    padding: .8rem 1rem; margin-bottom: 1.2rem;
    background: var(--surface-elevated);
}
.hc-toc .hc-nav-h { margin-top: 0; }
.hc-toc ul { list-style: none; margin: 0; padding: 0; }
.hc-toc ul ul { padding-left: .9rem; }
.hc-toc a {
    display: block; font-size: .84rem; color: var(--text-secondary);
    text-decoration: none; padding: .14rem 0;
}
.hc-toc a:hover { color: var(--accent); }
/* Pager */
.hc-pager {
    display: flex; justify-content: space-between; gap: 1rem;
    margin-top: 1.6rem;
}
.hc-pager-link {
    text-decoration: none; color: var(--text-primary); font-weight: 600;
    border: 1px solid var(--border-subtle); border-radius: .6rem;
    padding: .6rem .9rem; background: var(--surface-elevated);
}
.hc-pager-link:hover { border-color: var(--accent); color: var(--text-primary); }
.hc-pager-link .hc-nav-h { display: block; margin: 0 0 .1rem; }
.hc-pager-next { text-align: right; margin-left: auto; }
.hc-article {
    padding: 1.6rem 1.8rem; background: var(--surface-elevated);
    border: 1px solid var(--border-subtle); border-radius: .9rem;
}
.hc-article h2 {
    font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em;
    margin: 1.6rem 0 .6rem;
}
.hc-article h2:first-child { margin-top: 0; }
.hc-article h3 { font-size: 1.05rem; font-weight: 700; margin: 1.2rem 0 .5rem; }
.hc-article p, .hc-article li { color: var(--text-secondary); font-size: .97rem; }
.hc-article ul, .hc-article ol { padding-left: 1.3rem; }
.hc-article li { margin-bottom: .35rem; }
.hc-article code {
    background: color-mix(in srgb, var(--accent) 9%, transparent);
    border-radius: .3rem; padding: .08rem .3rem; font-size: .85em;
}
.hc-article table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.hc-article th, .hc-article td {
    border-bottom: 1px solid var(--border-subtle); padding: .45rem .5rem;
    text-align: left; font-size: .92rem;
}
/* Platform admin (/admin): the metrics hub. Sector-rail group headers
   (mono eyebrow + a hairline running to the edge, like lit sectors on a
   pit board) over auto-fit tile bands — each group's tiles share the
   row evenly on desktop and reflow to 2-up, then 1-up, on phones. */
.adm-group { margin-top: 2rem; }
.adm-group:first-of-type { margin-top: .4rem; }
.adm-group-head {
    display: flex; align-items: center; gap: .7rem; margin-bottom: .55rem;
}
.adm-group-head .adm-group-h { flex: 1; margin-bottom: 0; }
.adm-group-h {
    display: flex; align-items: center; gap: .7rem;
    font-family: var(--font-mono); font-size: .68rem; font-weight: 700;
    letter-spacing: .16em; text-transform: uppercase;
    color: var(--text-secondary); margin: 0 0 .55rem;
}
/* The rail: every group heading runs its hairline to the edge. */
.adm-group-h::after {
    content: ''; flex: 1; border-top: 1px solid var(--border-subtle); }
.adm-group-link {
    font-family: var(--font-mono); font-size: .64rem; font-weight: 600;
    letter-spacing: .08em; text-transform: uppercase;
    color: var(--text-tertiary); text-decoration: none;
    padding: .45rem .5rem; margin: -.45rem -.5rem; /* bigger tap target */
    white-space: nowrap;
}
.adm-group-link:hover { color: var(--accent); }
.adm-tiles {
    display: grid; gap: .6rem;
    /* auto-FILL (not -fit): ghost tracks stay, so a three-tile group keeps
       compact uniform tiles on wide screens instead of stretching each
       tile across the row. Every group gets the same tile width. */
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr));
    max-width: 100%;
}
/* Tile anatomy, timing-tower style: mono eyebrow label on top, big
   Saira Condensed digits as the message, sparkline tucked along the
   floor. DOM stays value-then-label (screen readers hear "1,234
   Users"); the eyebrow moves up visually via flex order. */
.adm-tile {
    position: relative;
    background: var(--surface-elevated); border: 1px solid var(--border-subtle);
    border-radius: .6rem; padding: .6rem .8rem .55rem;
    display: flex; flex-direction: column; min-width: 0;
}
.adm-tile b {
    font-family: var(--font-display); font-weight: 600;
    font-size: 2rem; line-height: 1.15;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}
.adm-tile span {
    order: -1;
    font-family: var(--font-mono); font-size: .75rem; font-weight: 600;
    letter-spacing: .08em; text-transform: uppercase;
    color: var(--text-secondary); margin-bottom: .1rem;
}
/* Each group's first metric is the lead: senior digits plus the accent
   sector bar down the left edge — the page's one accent moment. */
.adm-tile-lead b { font-size: 2.7rem; font-weight: 700; line-height: 1.05; }
.adm-tile-lead::before {
    content: ''; position: absolute; left: -1px; top: .65rem; bottom: .65rem;
    width: 3px; border-radius: 2px; background: var(--accent);
}
a.adm-tile { color: inherit; text-decoration: none; }
a.adm-tile:hover {
    border-color: color-mix(in srgb, var(--accent) 40%, var(--border-subtle)); }
/* The one status accent on the page: billing gone bad while the league
   still runs. Amber + icon + label — never color alone. Darker amber on
   the light surface so the big digits keep contrast. */
.adm-tile-warn { --adm-warn: #a16207; }
[data-bs-theme="dark"] .adm-tile-warn { --adm-warn: #d4a017; }
.adm-tile-warn,
a.adm-tile-warn:hover {
    border-color: color-mix(in srgb, var(--adm-warn) 55%, var(--border-subtle)); }
.adm-tile-warn b, .adm-tile-warn span .bi { color: var(--adm-warn); }
/* Tile sparkline: quiet single-hue bars tucked along the tile floor so
   the digits read first; hover a bar for its day's value (native
   <title>). margin-top:auto bottom-aligns it across the tile row. */
.adm-spark {
    width: 100%; height: 18px; margin-top: auto; padding-top: .45rem;
    fill: var(--accent); display: block;
}
.adm-spark rect { opacity: .35; }
.adm-tile:hover .adm-spark rect { opacity: .55; }
.adm-spark rect:hover { opacity: 1; }
/* Tappable admin rows: the whole row opens the object editor. */
tr.adm-row { cursor: pointer; }
tr.adm-row:hover td { background: var(--surface-elevated); }
/* Drill-down tables match the hub's readability treatment (.adm wraps
   every admin page; league /manage tables keep their own tuning):
   header rows speak the tile eyebrow's mono voice in secondary ink —
   no 8px tertiary murk — numerals set tabular so columns land, and
   each table's ONE key figure column wears the display face. */
.adm .timing thead th {
    font-size: .66rem; letter-spacing: .12em;
    color: var(--text-secondary); padding-bottom: .45rem;
}
.adm .timing tbody td { font-variant-numeric: tabular-nums; }
.adm .timing td.adm-key {
    font-family: var(--font-display); font-weight: 600;
    font-size: 1.12rem; color: var(--text-primary);
}
/* Sector-rail headings that navigate (object browser crumbs) stay in
   the rail's ink until hovered. */
.adm-group-h a { color: inherit; text-decoration: none; }
.adm-group-h a:hover { color: var(--accent); }
/* One section cadence for the whole page — no per-section drift */
.lp > section:not(:first-child) { margin-top: 3.25rem; }
.lp-card {
    height: 100%; background: var(--surface-elevated);
    border: 1px solid var(--border-subtle); border-radius: .9rem;
    padding: 1.3rem 1.35rem;
}
.lp-card p { color: var(--text-secondary); margin: 0; font-size: .95rem; }
.lp-card-h {
    font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em;
    color: var(--text-primary); margin-bottom: .55rem;
}
/* Steps as grid slots: the lamp row fills as the sequence advances
   (1 lit -> 2 lit -> 3 lit), echoing the wizard's own lights stepper */
.lp-step-card {
    height: 100%; background: var(--surface-elevated);
    border: 1px solid var(--border-subtle); border-radius: .9rem;
    padding: 1.25rem 1.3rem;
}
.lp-step-card p { color: var(--text-secondary); font-size: .92rem; margin: 0; }
.lp-step-card code { font-size: .85em; }
.lp-step-lamps { margin: 0 0 .85rem; gap: .45rem; }
.lp-step-lamps .wz-light { width: .8rem; height: .8rem; }

/* Final CTA: a contained band that bookends the hero — five lights on */
.lp-cta {
    padding: 3rem 2rem 2.8rem;
    background-image:
        radial-gradient(60% 130% at 50% 0%,
            color-mix(in srgb, var(--accent) 12%, transparent), transparent 72%);
    transition: background-image .6s ease;
}
.lp-cta-lights { justify-content: center; margin: 0 0 1.1rem; }
.lp-cta-lights .wz-light { width: .85rem; height: .85rem; }

/* Start procedure: when the band scrolls into view the lamps come on one
   by one, hold, then go out TOGETHER — lights out on the create button.
   JS drives armed -> lit -> go; without JS (or reduced motion) the band
   stays in its static all-on state above. */
.lp-cta-armed .wz-light {
    background: var(--surface-elevated); border-color: var(--border-subtle);
    box-shadow: none;
    transition: background .1s ease, border-color .1s ease, box-shadow .1s ease;
}
.lp-cta-lit .wz-light {
    background: var(--accent); border-color: var(--accent);
    box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 65%, transparent);
}
.lp-cta-lit .wz-light:nth-child(2) { transition-delay: .45s; }
.lp-cta-lit .wz-light:nth-child(3) { transition-delay: .9s; }
.lp-cta-lit .wz-light:nth-child(4) { transition-delay: 1.35s; }
.lp-cta-lit .wz-light:nth-child(5) { transition-delay: 1.8s; }
.lp-cta-go .wz-light:nth-child(n) {
    background: var(--surface-elevated); border-color: var(--border-subtle);
    box-shadow: none; transition-delay: 0s;
}
.lp-cta-go {
    background-image:
        radial-gradient(60% 130% at 50% 0%,
            color-mix(in srgb, #22c55e 14%, transparent), transparent 72%);
}

/* Wizard: grid-lights stepper (five lights, fill as steps complete) */
.wz-lights { display: flex; gap: .55rem; margin: .4rem 0 1.6rem; }
.wz-light {
    width: 2.4rem; height: .55rem; border-radius: 999px;
    background: var(--surface-elevated); border: 1px solid var(--border-subtle);
    transition: background .2s ease, border-color .2s ease;
}
.wz-light.on { background: var(--accent); border-color: var(--accent); }
.wz-section { margin-bottom: 1.6rem; }
.wz-slug-status { font-family: var(--font-mono); font-size: .75rem; }
.wz-slots { display: flex; flex-wrap: wrap; gap: .45rem; }
.wz-slot { cursor: pointer; }
.wz-slot small { opacity: .75; margin-left: .35rem; }
.wz-source { display: flex; gap: .45rem; }
.wz-source-pill { cursor: pointer; }
.wz-source-pill input { display: none; }
.wz-source-pill:has(input:checked) {
    background: var(--accent); border-color: var(--accent);
    color: var(--accent-contrast, #fff);
}
.wz-preset { cursor: pointer; display: block; }
.wz-preset input { display: none; }
.wz-preset .lp-card { border-width: 2px; }
.wz-preset input:checked + .lp-card { border-color: var(--accent); }

/* League forms (wizard .lp + manage .mg): the site's voice, not stock
   Bootstrap — mono eyebrow labels, surface-toned fields, accent focus. */
.lp .form-label, .mg .form-label {
    font-family: var(--font-mono); font-size: .66rem; font-weight: 600;
    letter-spacing: .14em; text-transform: uppercase;
    color: var(--text-tertiary); margin-bottom: .45rem;
}
.lp .form-control, .lp .form-select,
.mg .form-control, .mg .form-select {
    background: color-mix(in srgb, var(--text-primary) 4%, transparent);
    border: 1px solid var(--border-subtle); border-radius: .55rem;
    color: var(--text-primary); padding: .55rem .8rem; font-size: .92rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.lp textarea.form-control, .mg textarea.form-control { line-height: 1.55; }
.lp .form-control:focus, .lp .form-select:focus,
.mg .form-control:focus, .mg .form-select:focus {
    background: color-mix(in srgb, var(--text-primary) 6%, transparent);
    border-color: var(--accent); color: var(--text-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
    outline: none;
}
.lp .form-control::placeholder, .mg .form-control::placeholder {
    color: var(--text-tertiary); opacity: .7;
}
/* Data-typed fields read as telemetry */
.mg input[type="number"], .mg input[type="time"] {
    font-family: var(--font-mono); font-size: .88rem;
}
.mg .form-check-label { font-size: .9rem; color: var(--text-secondary); }

/* Per-field helper: ONE voice, always directly under its field. (Longer
   page/section prose stays .mg-help; parentheticals inside mono labels are
   banned — they end up shouting in uppercase.) */
.mg-hint {
    color: var(--text-tertiary); font-size: .8rem; line-height: 1.55;
    margin: .45rem 0 0;
}

/* The commit line: every form ends the same way — hairline rule, one
   pit-board verb, a quiet escape, and the action's consequence stated
   right where it's committed. */
.mg-actions {
    display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
    margin-top: 1.35rem; padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}
.mg-actions .mg-hint { margin: 0 0 0 auto; text-align: right; max-width: 24rem; }
@media (max-width: 575px) {
    .mg-actions .mg-hint { margin-left: 0; text-align: left; }
}

.mg .alert-success { border-left-color: #3fb950; }

/* Empty states: a contained invitation to act, not a gray alert */
.mg-empty {
    border: 1px dashed var(--border-subtle); border-radius: .8rem;
    padding: 1.6rem 1.4rem; text-align: center;
    color: var(--text-secondary); font-size: .92rem;
    background: color-mix(in srgb, var(--text-primary) 2%, transparent);
}

/* Sub-page head (adjustments / edit rules / preview): a mono back link
   over a real heading — the scoring drill-down reads as a hierarchy */
.mg-subhead { margin-bottom: .4rem; }
.mg-back {
    display: inline-block; font-family: var(--font-mono); font-size: .66rem;
    font-weight: 600; letter-spacing: .13em; text-transform: uppercase;
    color: var(--text-tertiary); text-decoration: none; margin-bottom: .35rem;
}
.mg-back:hover { color: var(--accent); }
.mg-subhead h2 {
    font-size: 1.3rem; font-weight: 700; letter-spacing: -.01em; margin: 0;
}

/* 'Make it yours' band on /leagues: three mini site mocks in different
   liveries (one light) — the theming pitch shown, not described */
.lp-theme-band {
    display: flex; align-items: center; gap: 1.5rem 2.5rem; flex-wrap: wrap;
    padding: 1.9rem 1.9rem 1.7rem;
}
.lp-theme-copy { flex: 1 1 20rem; max-width: 34rem; }
.lp-theme-viz {
    display: flex; gap: .9rem; flex: 1 1 18rem;
    justify-content: flex-end; flex-wrap: wrap;
}
.lp-theme-chip {
    width: 8.4rem; padding-bottom: .7rem; overflow: hidden;
    border-radius: .6rem; border: 1px solid var(--border-subtle);
    background: #10141b; color: #fff;
}
.lp-theme-chip.light {
    background: #f6f7f9; border-color: rgba(20, 20, 20, .14); color: #000;
}
.lp-theme-hero {
    display: block; height: 2.2rem;
    background:
        radial-gradient(130% 170% at 100% 0%,
            color-mix(in srgb, var(--b) 60%, transparent), transparent 62%),
        var(--a);
}
.lp-theme-row {
    display: block; height: .45rem; border-radius: 999px;
    margin: .55rem .65rem 0;
    background: color-mix(in srgb, currentColor 16%, transparent);
}
.lp-theme-chip .lp-theme-row:first-of-type {
    background: color-mix(in srgb, var(--a) 75%, currentColor 10%);
}

/* Powered-by upsell band on public league pages: quiet, one line,
   hidden for the league's own staff */
.lg-upsell {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; margin-top: 2.2rem;
    padding: .85rem 1.1rem; border: 1px dashed var(--border-subtle);
    border-radius: .8rem; background: color-mix(in srgb, var(--text-primary) 3%, transparent);
}
.lg-upsell-copy { color: var(--text-tertiary); font-size: .85rem; }
.lg-upsell-btn { font-size: .68rem; padding: .55rem .9rem; white-space: nowrap; }

/* League sites: the irstats navbar yields on scroll (slides away going
   down, returns on the first scroll up — league/base.html drives it) */
.nav-autohide { transition: transform .25s ease; }
.nav-autohide.nav-hidden { transform: translateY(-100%); }
@media (prefers-reduced-motion: reduce) { .nav-autohide { transition: none; } }

/* Races page hierarchy: the track is the headline; winners read as
   names one step down; dates and counts recede to quiet data */
.lg-races td.col-num { font-size: .82rem; }
.lg-races td.lg-winner-col {
    font-family: var(--font-display); font-size: .95rem; font-weight: 600;
    letter-spacing: .01em;
}

/* Races calendar: week chips + split sub-rows (one table per season) */
.lg-wk {
    display: inline-block; font-family: var(--font-mono); font-size: .68rem;
    font-weight: 700; letter-spacing: .04em; padding: .28rem .5rem;
    border-radius: .45rem; color: var(--text-secondary);
    background: color-mix(in srgb, var(--text-primary) 8%, transparent);
    border-left: 2px solid color-mix(in srgb, var(--accent-2, var(--accent)) 65%, transparent);
}
.timing tr.lg-split-row td,
.timing tr.lg-split-row:hover td {
    background: transparent; border-color: transparent;
}
.timing tr.lg-split-row:hover { transform: none; }
.lg-split-link {
    font-family: var(--font-mono); font-size: .8rem; font-style: italic;
    color: var(--text-tertiary) !important; font-weight: 400;
}
.lg-split-link:hover { color: var(--accent) !important; }
.timing .lg-winner-col a { color: var(--text-primary); text-decoration: none; }
.timing .lg-winner-col a:hover { color: var(--accent); }

/* Custom league logo (Pro) beside the hero title */
.lg-logo {
    height: 64px; width: auto; max-width: 140px; object-fit: contain;
    border-radius: .5rem; flex: 0 0 auto;
}
@media (max-width: 576px) { .lg-logo { height: 44px; } }

/* League outbound links (hero icon row on public league pages) */
.lg-links { display: flex; gap: .8rem; }
.lg-link { color: var(--text-tertiary); font-size: 1.05rem; text-decoration: none; }
.lg-link:hover { color: var(--accent); }

/* Homepage league callout */
.league-callout {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .8rem;
    margin: 1.1rem 0 0; padding: .8rem 1.1rem;
    background: var(--surface-elevated); border: 1px solid var(--border-subtle);
    border-radius: .8rem; text-decoration: none; color: var(--text-secondary);
    transition: border-color .15s ease;
}
.league-callout:hover { border-color: var(--accent); }
.league-callout-text { font-size: .88rem; }
.league-callout-cta {
    font-family: var(--font-mono); font-size: .78rem; font-weight: 700;
    color: var(--accent); margin-left: auto; white-space: nowrap;
}

/* Rules & Scoring page */
/* Rules & Scoring: rule groups flow as a readable grid, points get their
   own full-width band — a single left-clustered bullet ladder isn't
   scannable on a wide page. */
.rl-grid {
    display: grid; gap: 1.6rem 3rem;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
}
.rl-h {
    font-family: var(--font-mono); font-size: .68rem; font-weight: 600;
    letter-spacing: .16em; text-transform: uppercase;
    color: var(--text-tertiary); margin-bottom: .7rem;
}
.rl-text { color: var(--text-secondary); font-size: .95rem; line-height: 1.6; }
.rl-text-sub { color: var(--text-tertiary); font-size: .83rem; margin-bottom: .5rem; }
.rl-list { padding-left: 1.25rem; margin: 0; }
.rl-list li {
    margin-bottom: .55rem; color: var(--text-secondary);
    font-size: .95rem; line-height: 1.6;
}
.rl-list li::marker { color: var(--accent); }
.rl-list-lg li { font-size: 1rem; }
.rl-points-section {
    margin-top: 1.8rem; padding-top: 1.4rem;
    border-top: 1px solid var(--border-subtle);
}
.rl-points { display: flex; flex-wrap: wrap; gap: .4rem; }
.rl-pt {
    font-family: var(--font-mono); font-size: .82rem;
    background: var(--surface-elevated); border: 1px solid var(--border-subtle);
    border-radius: .5rem; padding: .3rem .6rem; white-space: nowrap;
}
.rl-pt b { color: var(--text-tertiary); font-weight: 600; margin-right: .4rem;
    font-size: .68rem; letter-spacing: .04em; }

/* Championship battle chart (standings page) */
.lg-battle {
    background: var(--surface-elevated); border: 1px solid var(--border-subtle);
    border-radius: .8rem; padding: .8rem .9rem .4rem; height: 248px;
    display: flex; flex-direction: column;
}
.lg-battle canvas { width: 100% !important; flex: 1; min-height: 0; }

/* Positions/Points view toggle, shared by the chart card variants */
.lg-battle-toggle { align-self: flex-end; margin-bottom: .35rem; }
.lg-battle-toggle .btn {
    font-size: .68rem; padding: .12rem .55rem; letter-spacing: .03em;
}
.mg-panel-head .lg-battle-toggle { align-self: center; margin-bottom: 0; }

/* Points grid heatmap: single-hue ramp, each cell vs its week's best.
   Alpha caps at 42% so the numbers stay readable on both themes; the
   sweep animation replays the season left to right on load. */
.timing tbody td.pts-heat {
    background: color-mix(in srgb, #f59e0b calc(var(--heat, 0) * 42%),
                          var(--surface-elevated));
}
[data-bs-theme="dark"] .timing tbody td.pts-heat {
    background: color-mix(in srgb, #d97706 calc(var(--heat, 0) * 42%),
                          var(--surface-elevated));
}
@media (prefers-reduced-motion: no-preference) {
    .timing tbody td.pts-heat {
        animation: pts-heat-in .45s ease-out both;
        animation-delay: calc(var(--col, 0) * 55ms);
    }
    @keyframes pts-heat-in {
        from { background-color: var(--surface-elevated); }
    }
}

/* Standings table: rank movement chips. Fixed two-slot layout inside
   the Pos cell (digits right, chip left) so rank numbers stay aligned
   whether or not a row moved this week. */
.col-pos .rk-num {
    display: inline-block; min-width: 1.5em; text-align: right;
}
.rk-move {
    display: inline-block; width: 2em; text-align: left;
    font-size: .62rem; font-weight: 700; letter-spacing: .02em;
    margin-left: .25rem; vertical-align: 1px; white-space: nowrap;
}
.rk-up  { color: #15803d; }
.rk-dn  { color: #b91c1c; }
.rk-new { color: var(--text-tertiary); text-transform: uppercase;
          font-size: .58rem; }
[data-bs-theme="dark"] .rk-up { color: #4ade80; }
[data-bs-theme="dark"] .rk-dn { color: #f87171; }

/* League directory cards on /leagues */
.lp-league-card {
    display: block; height: 100%; padding: 1.1rem 1.2rem;
    background: var(--surface-elevated); border: 1px solid var(--border-subtle);
    border-radius: .9rem; color: var(--text-primary); text-decoration: none;
    transition: border-color .15s ease, transform .15s ease;
}
.lp-league-card:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--text-primary); }
.lp-league-host {
    font-family: var(--font-mono); font-size: .68rem; color: var(--accent);
    white-space: nowrap;
}
.lp-league-top3 { margin-bottom: .5rem; }
.lp-league-top3 td { padding: .3rem .45rem; font-size: .78rem; }
.lp-league-cta {
    font-family: var(--font-mono); font-size: .74rem; font-weight: 700;
    color: var(--accent);
}
/* League browse table (/leagues/directory): a timing table over the
   whole grid. The mono voice stays on numbers and hosts; the prose-like
   detail cells (series, classes, championships, leaders) read in the
   body sans so the rows don't turn into a wall of terminal text. */
.lg-dir .lg-row { cursor: pointer; }
.lg-dir td.col-driver { min-width: 12rem; }
.lg-dir td.col-driver a { color: var(--text-primary); text-decoration: none; }
.lg-dir td.col-driver a:hover { color: var(--accent); }
.lg-dir .lg-host {
    display: block; font-family: var(--font-mono); font-size: .68rem;
    font-weight: 400; color: var(--accent); letter-spacing: 0;
}
.lg-dir td.col-list {
    white-space: normal; text-align: left;
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: .84rem; color: var(--text-secondary); line-height: 1.5;
    min-width: 9rem;
}
.lg-dir td.col-champs { min-width: 11rem; }
.lg-dir td.col-leader { min-width: 11rem; }
.lg-dir .lg-sub {
    display: block; font-size: .72rem; color: var(--text-tertiary);
}
.lg-chip {
    display: inline-block; font-size: .72rem; line-height: 1.3;
    padding: .12rem .55rem; margin: .12rem .25rem .12rem 0;
    border: 1px solid var(--border-subtle); border-radius: 999px;
    color: var(--text-secondary); white-space: nowrap;
}
.lg-dir .lg-leader {
    display: block; font-family: var(--font-display); font-weight: 600;
    font-size: .95rem; color: var(--text-primary); line-height: 1.25;
}
.lg-dir .lg-leader .lg-sub {
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
}
.lg-dir .lg-leader + .lg-leader { margin-top: .45rem; }
/* the three scale columns huddle together instead of scattering */
.lg-dir td.col-num, .lg-dir th.col-num-h { padding-inline: .7rem; }
.lg-dir th.lg-sort { cursor: pointer; user-select: none; }
.lg-dir th.lg-sort:hover { color: var(--text-secondary); }
.lg-dir th.lg-sort[data-dir]::after {
    content: ' ▴'; color: var(--accent); font-size: .85em;
}
.lg-dir th.lg-sort[data-dir="desc"]::after { content: ' ▾'; }
/* CTA row: same ghost treatment as the 'Your league' card */
.lg-dir .lg-cta-row td {
    border-style: dashed;
    border-color: color-mix(in srgb, var(--accent) 55%, transparent);
    background-image: linear-gradient(180deg,
        color-mix(in srgb, var(--accent) 8%, transparent), transparent 62%);
}
.lg-dir .lg-cta-row a { color: var(--accent); font-weight: 700; }

/* Homepage leagues section (above featured series) */
.home-leagues { margin: 2.6rem 0 1rem; }
.home-leagues-title {
    font-weight: 800; font-size: clamp(1.3rem, 3vw, 1.9rem);
    letter-spacing: -.01em; margin: .25rem 0 .4rem;
}

/* Fixed column grid for stacked per-week tables — every table shares the
   same column positions instead of auto-sizing to its own content. */
.timing-fixed { table-layout: fixed; }
.timing-fixed th, .timing-fixed td { overflow: hidden; text-overflow: ellipsis; }

/* Landing CTAs in the site's own voice (mono pit-board), not stock pills */
.lp-btn {
    display: inline-block; font-family: var(--font-mono); font-size: .78rem;
    font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    padding: .78rem 1.3rem; border-radius: .55rem; text-decoration: none;
    border: 1px solid transparent; transition: all .15s ease; line-height: 1;
}
.lp-btn-primary { background: var(--accent); color: #fff; }
.lp-btn-primary:hover { filter: brightness(1.12); color: #fff;
    transform: translateY(-1px); }
.lp-btn-ghost { border-color: var(--border-subtle); color: var(--text-primary); }
.lp-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
/* Hero-grade CTA size for the main league entry points */
.lp-btn-lg { font-size: .88rem; padding: 1rem 1.8rem; border-radius: .65rem; }

/* 'Your league' tile: a ghost timing tower — same anatomy as the live
   league cards (name row, meta line, top-3 table, CTA) so the grid
   aligns, but the standings are placeholders waiting to be earned. */
.lp-league-card-new {
    border: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent);
    background-image: linear-gradient(180deg,
        color-mix(in srgb, var(--accent) 8%, transparent), transparent 62%);
}
.lp-league-card-new:hover { border-style: solid; }
.lp-league-card-new .lp-league-host small { color: var(--text-tertiary); }
.lp-ghost td .lp-skel { margin-left: 0; }
.lp-league-card-new .lp-btn {
    display: block; text-align: center; margin-top: .15rem;
    padding: .7rem 1rem;
}

/* Copy emphasis: bold key phrases pop out of secondary-colored prose */
.lp-card strong, .lp-sub strong, .home-leagues p strong {
    color: var(--text-primary); font-weight: 700;
}

/* Wizard grid lights: five round lamps, not skeleton bars */
.wz-lights { gap: .7rem; margin: .6rem 0 1.9rem; }
.wz-light {
    width: 1.15rem; height: 1.15rem; border-radius: 50%;
    background: var(--surface-elevated); border: 1px solid var(--border-subtle);
}
.wz-light.on {
    background: var(--accent); border-color: var(--accent);
    box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 65%, transparent);
}

/* Rules-as-config showcase: an editor panel with real rulebooks.
   JSON colors reuse the page's own data palette (accent keys, chart
   green strings, chart amber numbers) — a timing screen, not an IDE. */
.lp-rules {
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 1rem; padding: 1.6rem 1.75rem;
}
.lp-rules-head {
    display: flex; justify-content: space-between; align-items: flex-end;
    gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem;
}
.lp-rules-tabs { display: flex; gap: .45rem; flex-wrap: wrap; }
.lp-rules-tab {
    font-family: var(--font-mono); font-size: .72rem; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase; cursor: pointer;
    padding: .55rem .95rem; border-radius: .55rem; line-height: 1;
    background: transparent; border: 1px solid var(--border-subtle);
    color: var(--text-secondary); transition: all .15s ease;
}
.lp-rules-tab:hover { border-color: var(--accent); color: var(--accent); }
.lp-rules-tab.active {
    border-color: var(--accent); color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.lp-rules-panel {
    display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 1.6rem; align-items: stretch;
}
.lp-rules-panel[hidden] { display: none; }
/* The editor is dark in BOTH themes — it's a timing screen, and the
   token colors are tuned for a dark ground. Fixed palette on purpose. */
.lp-json-wrap {
    background: #0d1117; border: 1px solid rgba(255, 255, 255, .09);
    border-radius: .9rem; overflow: hidden;
}
.lp-json-head {
    display: flex; justify-content: space-between; gap: 1rem;
    font-family: var(--font-mono); font-size: .68rem;
    color: #7d8590; padding: .6rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
}
.lp-json {
    margin: 0; padding: 1rem 1.1rem; overflow: auto; max-height: 460px;
    font-family: var(--font-mono); font-size: .8rem; line-height: 1.7;
    color: #9da7b3;
}
.lp-json .jk { color: #58a6ff; }
.lp-json .js { color: #3fb950; }
.lp-json .jn { color: #f59e0b; }
.lp-json .jb { color: #a855f7; }
.lp-rules-notes {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; justify-content: space-evenly;
    gap: .35rem;
}
.lp-rules-notes li {
    color: var(--text-secondary); font-size: .92rem;
    padding: .65rem 0 .65rem 1rem; border-left: 2px solid var(--border-subtle);
}
.lp-rules-notes li strong { color: var(--text-primary); }
.lp-rules-notes code {
    font-size: .82em; color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border-radius: .3rem; padding: .1rem .35rem;
}
/* Championship entry grid: each tile carries its one defining rule —
   the row itself demonstrates 'same races, own rulebook'. */
.lp-champs {
    margin-top: 1.7rem; padding-top: 1.4rem;
    border-top: 1px solid var(--border-subtle);
}
.lp-champs-head {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 1rem; flex-wrap: wrap;
}
.lp-champs-legend {
    font-family: var(--font-mono); font-size: .68rem;
    color: var(--text-tertiary); display: inline-flex;
    align-items: center; gap: .4rem;
}
.lp-champs-legend .dot {
    width: .5em; height: .5em; border-radius: 50%; background: var(--accent);
    box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 65%, transparent);
}
.lp-champs-grid {
    display: grid; gap: .6rem; margin-top: .9rem;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
}
.lp-champ {
    border: 1px solid var(--border-subtle); border-radius: .7rem;
    padding: .7rem .85rem; display: flex; flex-direction: column;
    gap: .2rem; color: var(--text-primary); text-decoration: none;
    background: color-mix(in srgb, var(--text-primary) 5%, transparent);
}
.lp-champ b {
    font-size: .92rem; display: inline-flex; align-items: center; gap: .45rem;
}
.lp-champ.live b::before {
    content: ''; width: .5em; height: .5em; border-radius: 50%;
    background: var(--accent); flex: none;
    box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 65%, transparent);
}
.lp-champ span {
    font-family: var(--font-mono); font-size: .67rem;
    color: var(--text-tertiary); line-height: 1.4;
}
.lp-champ-new {
    border: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent);
    transition: border-color .15s ease, background .15s ease;
}
.lp-champ-new b { color: var(--accent); }
.lp-champ-new:hover { border-style: solid; border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, transparent); }
@media (max-width: 991px) {
    .lp-rules-panel { grid-template-columns: 1fr; }
}

/* Marketing-surface surname redaction: a static block, deliberately
   inert (no shimmer — motion reads as 'loading'). */
.lp-skel {
    display: inline-block; height: .8em; border-radius: .25em;
    vertical-align: baseline; margin-left: .1em;
    background: color-mix(in srgb, var(--text-tertiary) 28%, transparent);
}

/* ---- Leagues marketing: graphical pass ------------------------- */
/* Wider canvas for the landing page */
main.lp-wide { max-width: min(1460px, 96%); }

/* Hero: accent wash behind the content + the five-lights motif */
.lp-hero {
    background-image:
        radial-gradient(55% 90% at 82% 8%,
            color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
        linear-gradient(115deg,
            color-mix(in srgb, var(--accent) 7%, transparent), transparent 45%);
}
.lp-hero-lights { margin: 0 0 1rem; }
.lp-hero-lights .wz-light { width: .85rem; height: .85rem; }
.lp-hero-lights .wz-light:nth-child(1) { animation: lp-light 1s .0s both; }
.lp-hero-lights .wz-light:nth-child(2) { animation: lp-light 1s .18s both; }
.lp-hero-lights .wz-light:nth-child(3) { animation: lp-light 1s .36s both; }
.lp-hero-lights .wz-light:nth-child(4) { animation: lp-light 1s .54s both; }
.lp-hero-lights .wz-light:nth-child(5) { animation: lp-light 1s .72s both; }
@keyframes lp-light { from { background: var(--surface-elevated);
    box-shadow: none; } }
@media (prefers-reduced-motion: reduce) {
    .lp-hero-lights .wz-light { animation: none; } }

/* Steps strip: numbered lamps */
.lp-step b {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.5rem; height: 1.5rem; border-radius: 50%;
    background: var(--accent); color: #fff; margin-right: .5rem;
}

/* Battle section: panel treatment */
.lp-battle-section {
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 1rem; padding: 1.6rem 1.75rem;
}

/* Homepage league band: rides the lb-hero chrome (stripes + checkered
   corner) so it reads as the site's own ad, not another list section */
.lb-hero.home-leagues .hl-founder {
    position: absolute; top: 1.15rem; right: 1.4rem; z-index: 1;
    font-size: .62rem; padding: .3rem .6rem;
}
/* When the band also shows the live league card on the right, keep the
   absolute founder badge clear of the card's top edge */
.lb-hero.home-leagues:has(.hl-founder) .lp-league-card { margin-top: 1.1rem; }
@media (max-width: 767px) {
    .lb-hero.home-leagues .hl-founder { position: static;
        display: inline-block; margin-bottom: .5rem; }
}
.lb-hero.home-leagues {
    position: relative;
    margin: 2.6rem 0 1rem; padding: 1.9rem 1.75rem 1.75rem;
    background-image:
        radial-gradient(50% 100% at 85% 0%,
            color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%);
}
.lb-hero.home-leagues .lp-league-card { background: color-mix(in srgb, var(--surface-elevated) 70%, transparent); }
/* EEA cookie-consent banner: small fixed card, hidden until the head
   script decides the visitor is EU with no stored choice. Both buttons
   equal size (accept must not outweigh decline). */
.consent-banner {
    position: fixed; z-index: 1080; left: 1rem; bottom: 1rem;
    max-width: 21rem; padding: .9rem 1rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle); border-radius: .75rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
}
.consent-banner .consent-text {
    font-size: .84rem; color: var(--text-secondary); margin: 0 0 .65rem;
}
.consent-actions { display: flex; gap: .5rem; }
.consent-actions .lp-btn { flex: 1 1 0; }
@media (max-width: 576px) {
    .consent-banner { left: .75rem; right: .75rem; max-width: none; }
}
/* Marketing Discord mock: show the top ~75% of the tall driver card,
   fading into the card's own background (#0a0c14) so the crop reads as
   a preview. Real replies and the bot guide show the full card. */
.dc-card-crop {
    position: relative; aspect-ratio: 1200 / 756; overflow: hidden;
    border-radius: .45rem; margin: .3rem 0 .35rem;
}
.dc-card-crop .dc-card { margin: 0; border-radius: 0; }
.dc-card-crop::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0;
    height: 3.5rem;
    background: linear-gradient(to bottom, rgba(10, 12, 20, 0), #0a0c14);
}
