
        :root {
            --forest: #0f2418;
            --deep: #081710;
            --mint: #C5E8D1;
            --mint-soft: #E4F2E9;
            --sage: #2D5F48;
            --gold: #2d5f48;
            --gold-light: #e4f2e9;
            --serif: 'Playfair Display', Georgia, serif;
            --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }

        /* Skip link for keyboard users */
        .skip-link {
            position: absolute;
            top: -40px;
            left: 0;
            background: var(--forest);
            color: var(--mint);
            padding: 8px 16px;
            z-index: 100;
            font-size: 14px;
            transition: top 0.2s;
        }
        .skip-link:focus { top: 0; }

        :focus-visible {
            outline: 2px solid var(--gold);
            outline-offset: 2px;
        }
        button:focus:not(:focus-visible),
        a:focus:not(:focus-visible) { outline: none; }

        html, body { min-height: 0; }
        body {
            font-family: var(--sans);
            background: var(--mint-soft);
            color: var(--forest);
            line-height: 1.6;
            -webkit-font-smoothing: antialiased;
            overflow-y: auto;
            overflow-x: hidden;
        }

        /* ══════════════════════════════════════════════════
           HERO
           ══════════════════════════════════════════════════ */
        .rr-hero {
            position: relative;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            text-align: center;
            padding: 72px 24px 56px;
            background: var(--forest);
            overflow: hidden;
        }
        .rr-hero::before {
            content: '';
            position: absolute;
            inset: 0;
            background-image:
                linear-gradient(rgba(197, 232, 209, 0.03) 1px, transparent 1px),
                linear-gradient(90deg, rgba(197, 232, 209, 0.03) 1px, transparent 1px);
            background-size: 48px 48px;
            pointer-events: none;
        }
        .rr-hero::after {
            content: '';
            position: absolute;
            bottom: 0; left: 0; right: 0;
            height: 80px;
            background: linear-gradient(to bottom, transparent, var(--mint-soft));
            pointer-events: none;
        }
        .rr-hero-title {
            position: relative;
            font-family: var(--serif);
            font-size: clamp(2.2rem, 5.5vw, 3.8rem);
            font-weight: 900;
            line-height: 1.1;
            color: var(--mint);
            letter-spacing: -0.02em;
            margin-bottom: 16px;
        }
        .rr-hero-rule {
            position: relative;
            width: 60px;
            height: 2px;
            background: var(--gold);
            margin: 0 auto 20px;
            opacity: 0.7;
        }
        .rr-hero-sub {
            position: relative;
            font-family: var(--sans);
            font-size: 1rem;
            font-weight: 400;
            color: rgba(197, 232, 209, 0.9);
            max-width: 500px;
            line-height: 1.5;
        }

        /* ══════════════════════════════════════════════════
           STATS STRIP
           ══════════════════════════════════════════════════ */
        .stats-strip {
            display: flex;
            justify-content: center;
            gap: 40px;
            padding: 28px 24px;
            margin: 0 auto;
            max-width: 800px;
            flex-wrap: wrap;
        }

        .stat-item { text-align: center; }

        .stat-number {
            font-family: var(--serif);
            font-size: 28px;
            font-weight: 700;
            color: var(--sage);
            line-height: 1.2;
        }

        .stat-label {
            font-family: var(--sans);
            font-size: 11px;
            font-weight: 500;
            color: var(--sage);
            text-transform: uppercase;
            letter-spacing: 0.1em;
            opacity: 0.7;
        }

        /* ══════════════════════════════════════════════════
           FILTER BAR
           ══════════════════════════════════════════════════ */
        .filter-bar {
            display: flex;
            gap: 8px;
            margin: 8px auto 28px;
            max-width: 800px;
            padding: 0 24px;
            flex-wrap: wrap;
            justify-content: center;
        }

        .filter-btn {
            font-family: var(--sans);
            font-size: 12px;
            font-weight: 500;
            padding: 7px 18px;
            border: 1px solid rgba(45, 95, 72, 0.25);
            border-radius: 24px;
            background: transparent;
            color: var(--sage);
            cursor: pointer;
            transition: all 0.25s ease;
            letter-spacing: 0.02em;
        }

        .filter-btn:hover {
            border-color: var(--sage);
            background: rgba(45, 95, 72, 0.06);
            color: var(--forest);
        }

        .filter-btn.active {
            background: var(--sage);
            border-color: var(--sage);
            color: #fff;
        }

        /* ══════════════════════════════════════════════════
           RACE CARDS
           ══════════════════════════════════════════════════ */
        .race-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
            max-width: 800px;
            margin: 0 auto;
            padding: 0 24px 60px;
        }

        .race-card {
            background: #fff;
            border: 1px solid rgba(15, 36, 24, 0.08);
            border-radius: 12px;
            padding: 22px 26px;
            transition: all 0.25s ease;
            position: relative;
            overflow: hidden;
        }

        .race-card::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 3px;
            background: rgba(15, 36, 24, 0.08);
            transition: background 0.25s ease;
        }

        .race-card.gold-place::before {
            background: var(--gold);
        }

        .race-card.dnf-card::before {
            background: rgba(15, 36, 24, 0.15);
        }

        /* Landmark: a race that matters for reasons the placings don't capture.
           Set per race with `isLandmark`, never derived from finishing position. */
        .race-card.landmark-card {
            background: linear-gradient(90deg, rgba(197, 232, 209, 0.38), #fff 42%);
        }

        .race-card.landmark-card::before {
            background: var(--sage);
        }

        .race-card.pr-card {
            border-color: rgba(15, 36, 24, 0.15);
            background: linear-gradient(135deg, #fff 85%, var(--mint-soft));
        }

        .race-card.pr-card::before {
            background: var(--forest);
            width: 4px;
        }

        .race-card:hover {
            border-color: rgba(45, 95, 72, 0.15);
            box-shadow: 0 4px 20px rgba(15, 36, 24, 0.06);
        }

        .race-top {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 16px;
            flex-wrap: wrap;
        }

        .race-info {
            flex: 1;
            min-width: 200px;
        }

        .race-name {
            font-family: var(--serif);
            font-size: 17px;
            font-weight: 700;
            color: var(--forest);
            line-height: 1.3;
            margin-bottom: 4px;
        }

        .race-name a {
            color: inherit;
            text-decoration: none;
            transition: color 0.2s;
        }

        .race-name a:hover {
            color: var(--sage);
        }

        .race-meta {
            font-size: 13px;
            color: var(--sage);
            font-weight: 400;
            opacity: 0.7;
        }

        .race-meta span + span::before {
            content: '\00b7';
            margin: 0 8px;
            opacity: 0.4;
        }

        .race-stats {
            display: flex;
            gap: 20px;
            align-items: flex-start;
            flex-shrink: 0;
        }

        .race-time { text-align: right; }

        .time-value {
            font-family: var(--sans);
            font-size: 19px;
            font-weight: 600;
            color: var(--forest);
            letter-spacing: -0.01em;
        }

        .time-value.dnf {
            color: var(--sage);
            font-size: 14px;
            font-weight: 500;
            opacity: 0.6;
        }

        .time-label {
            font-size: 10px;
            color: var(--sage);
            text-transform: uppercase;
            letter-spacing: 0.08em;
            opacity: 0.5;
        }

        /* ── Placement badges ── */
        .placements {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-top: 10px;
        }

        .placement-badge {
            font-size: 11px;
            font-weight: 500;
            padding: 3px 10px;
            border-radius: 12px;
            background: var(--mint-soft);
            color: var(--sage);
            border: 1px solid rgba(45, 95, 72, 0.1);
        }

        .placement-badge.top-3 {
            background: var(--mint);
            color: var(--forest);
            border-color: rgba(45, 95, 72, 0.15);
        }

        .placement-badge.first-place {
            background: var(--gold);
            color: #fff;
            border-color: var(--gold);
        }

        .placement-badge.pr-badge {
            background: var(--forest);
            color: var(--mint);
            border-color: var(--forest);
            font-weight: 600;
            font-size: 12px;
            padding: 4px 14px;
            letter-spacing: 0.03em;
        }

        /* ── Race type tags ── */
        .race-type {
            font-family: var(--sans);
            font-size: 10px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            padding: 2px 8px;
            border-radius: 4px;
            margin-left: 10px;
            vertical-align: middle;
        }

        .type-marathon { background: var(--mint); color: var(--forest); }
        .type-half { background: #d4e8f5; color: #2a5a7a; }
        .type-short { background: var(--gold-light); color: #2d5f48; }
        .type-multi { background: #e4daf0; color: #5a3a7a; }

        /* ── Expandable notes ── */
        .race-note-toggle {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-family: var(--sans);
            font-size: 13px;
            font-weight: 600;
            color: var(--gold);
            background: rgba(45,95,72, 0.08);
            border: 1px solid rgba(45,95,72, 0.2);
            border-radius: 20px;
            cursor: pointer;
            padding: 6px 16px;
            margin-top: 10px;
            transition: all 0.25s ease;
            letter-spacing: 0.01em;
        }

        .race-note-toggle:hover {
            background: rgba(45,95,72, 0.15);
            border-color: var(--gold);
            color: var(--forest);
        }

        .race-note-toggle svg {
            width: 14px;
            height: 14px;
            transition: transform 0.2s ease;
        }

        .race-note-toggle.open svg {
            transform: rotate(180deg);
        }

        .race-note {
            font-size: 13px;
            color: var(--sage);
            line-height: 1.7;
            font-weight: 400;
            padding: 10px 0 4px;
            max-height: 0;
            overflow: hidden;
            opacity: 0;
            transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.2s ease;
        }

        .race-note.open {
            max-height: 300px;
            opacity: 1;
        }

        /* ── Toggle row ── */
        .toggle-row {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            align-items: center;
        }

        /* Quieter sibling of .race-note-toggle, for the data panel */
        .race-data-toggle {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-family: var(--sans);
            font-size: 13px;
            font-weight: 500;
            color: var(--sage);
            background: transparent;
            border: 1px solid rgba(45, 95, 72, 0.25);
            border-radius: 20px;
            cursor: pointer;
            padding: 6px 16px;
            margin-top: 10px;
            transition: all 0.25s ease;
            letter-spacing: 0.01em;
        }

        .race-data-toggle:hover {
            background: rgba(45, 95, 72, 0.07);
            border-color: var(--sage);
            color: var(--forest);
        }

        .race-data-toggle svg {
            width: 14px;
            height: 14px;
            transition: transform 0.2s ease;
        }

        .race-data-toggle.open svg { transform: rotate(180deg); }

        /* ── Data panel ── */
        .race-data {
            max-height: 0;
            overflow: hidden;
            opacity: 0;
            transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.25s ease;
            padding: 0;
        }

        .race-data.open {
            max-height: 1600px;
            opacity: 1;
            padding: 14px 0 2px;
        }

        .data-section-label {
            font-size: 10px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            color: var(--sage);
            opacity: 0.6;
            margin: 14px 0 8px;
        }
        .data-section-label:first-child { margin-top: 0; }

        /* Key/value facts grid */
        .fact-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            gap: 10px 16px;
            border-top: 1px solid rgba(15, 36, 24, 0.08);
            padding-top: 12px;
        }

        .fact-key {
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 0.07em;
            color: var(--sage);
            opacity: 0.6;
        }

        .fact-val {
            font-size: 14px;
            font-weight: 500;
            color: var(--forest);
            font-variant-numeric: tabular-nums;
        }

        /* Splits table */
        .splits-wrap {
            overflow-x: auto;
            border-top: 1px solid rgba(15, 36, 24, 0.08);
            padding-top: 12px;
            -webkit-overflow-scrolling: touch;
        }

        table.splits {
            border-collapse: collapse;
            width: 100%;
            font-size: 13px;
            font-variant-numeric: tabular-nums;
            min-width: 300px;
        }

        table.splits th {
            text-align: right;
            font-size: 10px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--sage);
            opacity: 0.65;
            padding: 0 0 7px 14px;
            white-space: nowrap;
        }
        table.splits th:first-child { text-align: left; padding-left: 0; }

        table.splits td {
            padding: 6px 0 6px 14px;
            text-align: right;
            color: var(--forest);
            border-top: 1px solid rgba(15, 36, 24, 0.05);
            white-space: nowrap;
        }
        table.splits td:first-child {
            text-align: left;
            padding-left: 0;
            color: var(--sage);
            font-weight: 500;
        }

        table.splits tr.final td {
            font-weight: 600;
            border-top: 1px solid rgba(45, 95, 72, 0.28);
        }

        table.splits td.missing { opacity: 0.35; }

        .split-note {
            font-size: 12px;
            color: var(--sage);
            opacity: 0.75;
            line-height: 1.6;
            margin-top: 10px;
        }

        .data-source {
            display: inline-block;
            margin-top: 12px;
            font-size: 12px;
            color: var(--sage);
            text-decoration: none;
            border-bottom: 1px solid rgba(45, 95, 72, 0.3);
            padding-bottom: 1px;
        }
        .data-source:hover { color: var(--forest); border-bottom-color: var(--sage); }

        /* ══════════════════════════════════════════════════
           UPCOMING
           ══════════════════════════════════════════════════ */
        .upcoming {
            max-width: 800px;
            margin: 0 auto;
            padding: 0 24px 4px;
        }

        .upcoming-label {
            font-size: 10px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.14em;
            color: var(--sage);
            opacity: 0.65;
            margin-bottom: 10px;
        }

        .upcoming-card {
            position: relative;
            background: linear-gradient(135deg, var(--mint-soft) 40%, #fff);
            border: 1px dashed rgba(45, 95, 72, 0.35);
            border-radius: 12px;
            padding: 20px 24px;
            overflow: hidden;
        }

        .upcoming-card::before {
            content: '';
            position: absolute;
            left: 0; top: 0; bottom: 0;
            width: 3px;
            background: var(--gold);
        }

        .upcoming-top {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 16px;
            flex-wrap: wrap;
        }

        .upcoming-name {
            font-family: var(--serif);
            font-size: 17px;
            font-weight: 700;
            color: var(--forest);
            line-height: 1.3;
            margin-bottom: 4px;
        }

        .upcoming-meta {
            font-size: 13px;
            color: var(--sage);
            opacity: 0.75;
        }
        .upcoming-meta span + span::before {
            content: '\00b7';
            margin: 0 8px;
            opacity: 0.4;
        }

        .countdown {
            text-align: right;
            flex-shrink: 0;
        }
        .countdown-num {
            font-family: var(--serif);
            font-size: 26px;
            font-weight: 700;
            color: var(--sage);
            line-height: 1.1;
        }
        .countdown-label {
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 0.09em;
            color: var(--sage);
            opacity: 0.6;
        }

        .upcoming-note {
            font-size: 13px;
            color: var(--sage);
            line-height: 1.65;
            margin-top: 12px;
        }

        .upcoming-cta {
            display: inline-block;
            margin-top: 14px;
            font-size: 13px;
            font-weight: 600;
            color: var(--gold);
            background: rgba(45,95,72, 0.08);
            border: 1px solid rgba(45,95,72, 0.25);
            border-radius: 20px;
            padding: 7px 18px;
            text-decoration: none;
            transition: all 0.25s ease;
        }
        .upcoming-cta:hover {
            background: rgba(45,95,72, 0.16);
            border-color: var(--gold);
            color: var(--forest);
        }

        /* ── No results ── */
        .no-results {
            text-align: center;
            padding: 40px 20px;
            color: var(--sage);
            font-size: 14px;
            font-weight: 400;
            opacity: 0.7;
        }

        /* ══════════════════════════════════════════════════
           RESPONSIVE
           ══════════════════════════════════════════════════ */
        @media (max-width: 640px) {
            .rr-hero { padding: 44px 20px 36px; }
            .rr-hero-title { font-size: 2rem; }
            .rr-hero-sub { font-size: 0.9rem; }

            .stats-strip {
                gap: 8px 4px;
                padding: 14px 8px;
            }
            .stat-number { font-size: 30px; }
            .stat-label { font-size: 11px; letter-spacing: 0.12em; }

            .filter-bar { gap: 8px; padding: 0 12px; margin-bottom: 20px; }
            .filter-btn { font-size: 14px; padding: 8px 18px; }

            .race-list { padding: 0 12px 40px; }
            .race-card { padding: 16px; }
            .race-top { flex-direction: column; gap: 8px; }
            .race-stats { width: 100%; }
            .race-name { font-size: 17px; }
            .race-type { margin-left: 0; display: block; width: fit-content; margin-top: 4px; font-size: 11px; }
            .race-meta { font-size: 13px; }
            .time-value { font-size: 20px; }
            .race-time { text-align: left; }
            .placements { gap: 5px; }
            .placement-badge { font-size: 12px; padding: 3px 10px; }
            .placement-badge.pr-badge { font-size: 12px; padding: 4px 12px; }
            .race-note-toggle { font-size: 13px; padding: 6px 16px; }
            .race-note { font-size: 14px; }

            .race-data-toggle { font-size: 13px; padding: 6px 16px; }
            .fact-grid { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 10px 12px; }
            .fact-val { font-size: 13px; }
            table.splits { font-size: 12px; }
            table.splits th, table.splits td { padding-left: 10px; }

            .upcoming { padding: 0 12px 4px; }
            .upcoming-card { padding: 16px; }
            .upcoming-top { flex-direction: column; gap: 8px; }
            .countdown { text-align: left; }
        }

        @media (prefers-reduced-motion: reduce) {
            .race-note, .race-data, .race-note-toggle svg,
            .race-data-toggle svg, .race-card, .filter-btn { transition: none; }
        }

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