/* The Oval Office — Six Nations 2026 stats page styles. */
        /* Page-only series colours for the Head to Head comparison (no shared token for a third chart series).
           Player 1 = brand violet, Player 3 = warning amber, Player 2 = cyan kept from the original chart. */
        :root {
            --h2h-p1: var(--color-accent);
            --h2h-p1-text: var(--color-accent-text);
            --h2h-p2: #06b6d4;
            --h2h-p2-text: #0e7490;
            --h2h-p3: var(--color-warning);
            --h2h-p3-text: var(--color-warning-ink);
        }
        @media (prefers-color-scheme: dark) {
            :root:not([data-theme="light"]) { --h2h-p2-text: #22d3ee; }
        }
        :root[data-theme="dark"] { --h2h-p2-text: #22d3ee; }

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

        body {
            background: var(--color-background);
            overflow-x: hidden;
            padding-top: 80px;
        }

        /* Header (colours from .site-header in components.css) */
        .site-header {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 1000;
            animation: slideDown 0.6s ease-out;
        }

        @keyframes slideDown {
            from { transform: translateY(-100%); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }

        .site-nav {
            max-width: 1400px;
            margin: 0 auto;
        }

        .logo {
            display: flex;
            align-items: center;
            text-decoration: none;
            flex-shrink: 0;
        }

        .logo img { height: auto; }

        .nav-links { flex-shrink: 0; }

        /* Main Container */
        .container {
            max-width: 1600px;
            margin: 0 auto;
            padding: 3rem 2rem;
        }

        .page-header {
            margin-bottom: 2rem;
        }

        .page-title {
            font-family: var(--font-display);
            font-size: 3rem;
            font-weight: 700;
            line-height: 1.15;
            color: var(--color-primary);
            margin-bottom: 0.5rem;
            letter-spacing: -0.01em;
        }

        .page-subtitle {
            color: var(--color-text-muted);
            font-size: 1.125rem;
        }

        /* Controls Section */
        .controls {
            background: var(--color-raised);
            border: 1px solid var(--color-hairline);
            border-radius: var(--radius-xl);
            padding: 2rem;
            margin-bottom: 2rem;
            box-shadow: var(--shadow-panel);
        }

        .controls-row {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr 1fr;
            gap: 1.5rem;
            margin-bottom: 1.5rem;
        }

        .controls-row:last-child {
            margin-bottom: 0;
        }

        .control-group {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .control-label {
            font-weight: 600;
            font-size: 0.875rem;
            color: var(--color-text);
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .price-slider-container {
            padding-top: 0.5rem;
        }

        .price-slider {
            width: 100%;
            height: 6px;
            border-radius: 3px;
            background: var(--color-border);
            -webkit-appearance: none;
            appearance: none;
        }

        .price-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: var(--color-action);
            cursor: pointer;
            box-shadow: var(--shadow-action);
        }

        .price-slider::-moz-range-thumb {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: var(--color-action);
            cursor: pointer;
            border: none;
            box-shadow: var(--shadow-action);
        }

        .price-range-display {
            font-size: 0.875rem;
            color: var(--color-accent-text);
            font-weight: 600;
            margin-top: 0.25rem;
            font-variant-numeric: tabular-nums;
        }

        .results-info {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            color: var(--color-text-muted);
            font-size: 0.95rem;
        }

        .btn-settings {
            padding: 0.6rem 1.2rem;
            background: var(--color-action);
            color: var(--color-on-action);
            border: none;
            border-radius: var(--radius-sm);
            font-weight: 600;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.3s ease;
            font-family: var(--font-body);
        }

        .btn-settings:hover {
            background: var(--color-action-hover);
            transform: translateY(-2px);
            box-shadow: var(--shadow-action-hover);
        }

        /* Table (look comes from .stats-table-wrap / .stats-table in components.css) */
        .stats-table-wrap {
            -webkit-overflow-scrolling: touch;
        }

        .stats-table th {
            cursor: pointer;
            user-select: none;
        }

        .stats-table th:hover {
            background: var(--color-accent-wash);
        }

        .stats-table th.sortable::after {
            content: '⇅';
            margin-left: 0.5rem;
            opacity: 0.5;
        }

        .stats-table th.sort-asc,
        .stats-table th.sort-desc {
            color: var(--color-accent-text);
        }

        .stats-table th.sort-asc::after {
            content: '↑';
            opacity: 1;
        }

        .stats-table th.sort-desc::after {
            content: '↓';
            opacity: 1;
        }

        .beta-badge {
            display: inline-block;
            background: var(--color-warning-fill);
            color: var(--color-on-action);
            padding: 2px 6px;
            border-radius: var(--radius-sm);
            font-size: 0.65rem;
            font-weight: 700;
            margin-left: 4px;
            vertical-align: middle;
            cursor: help;
        }

        .stats-table tbody tr {
            transition: background 0.2s ease;
        }

        .stats-table tbody tr:nth-child(even) {
            background: var(--color-accent-wash);
        }

        .stats-table tbody tr:hover,
        .stats-table tbody tr:nth-child(even):hover {
            background: var(--color-accent-tint);
        }

        .stats-table td {
            font-size: 0.95rem;
            text-align: center;
        }

        .stats-table td.player-cell {
            font-weight: 600;
            color: var(--color-primary);
            text-align: left;
        }

        .stats-table .flag {
            width: 22px;
            height: 15px;
            margin: 0;
            vertical-align: middle;
        }

        .stats-table td.price-positive {
            color: var(--color-success-text);
            font-weight: 700;
        }

        .stats-table td.price-negative {
            color: var(--color-danger-text);
            font-weight: 700;
        }

        .stats-table td.stat-best {
            font-weight: 700;
            color: var(--color-accent-text);
        }

        .loading {
            text-align: center;
            padding: 4rem;
            color: var(--color-text-muted);
        }

        .error {
            background: var(--color-danger-tint);
            color: var(--color-danger-text);
            padding: 1.5rem;
            border-radius: var(--radius-sm);
            margin: 2rem 0;
            white-space: normal;
        }

        .error a { color: var(--color-accent-text); text-decoration: underline; }

        /* Mobile Responsive */
        @media (max-width: 1024px) {
            .controls-row {
                grid-template-columns: 1fr 1fr;
            }
        }

        @media (max-width: 768px) {
            .nav-link {
                display: none;
            }

            .logo img { width: 180px; }

            .site-nav { padding: 1rem; }

            .nav-links { gap: 0.75rem; }

            .site-nav .btn { padding: 0.6rem 1rem; }

            .container {
                padding: 1.5rem 1rem;
            }

            .page-title {
                font-size: 2rem;
            }

            .controls-row {
                grid-template-columns: 1fr;
            }

            .stats-table {
                font-size: 0.85rem;
            }

            .stats-table th, .stats-table td {
                padding: 0.75rem 0.5rem;
            }
        }

        /* ── Nav Dropdown (look from components.css; positioning here) ── */
        .nav-dropdown { position: relative; }
        .nav-dropdown-menu {
            display: none;
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%);
            padding-top: 16px;
            z-index: 1000;
        }
        .nav-dropdown:hover .nav-dropdown-menu,
        .nav-dropdown:focus-within .nav-dropdown-menu { display: block; }
        .nav-dropdown-trigger { cursor: pointer; }

        /* ── CTA Banner ─────────────────────────────── */
        /* ── How to read these stats ── */
        .stats-snapshots { margin: 3rem 0 1rem; }
        .stats-snapshots h2 { font: 700 1.6rem/1.25 var(--font-display); color: var(--color-primary); margin: 2.25rem 0 0.5rem; }
        .stats-snapshots h3 { font: 700 1.15rem/1.3 var(--font-display); color: var(--color-primary); margin: 1.5rem 0 0.5rem; }
        .stats-snapshots p { color: var(--color-text-muted); margin-bottom: 0.75rem; }
        .stats-snapshots .stats-table-wrap { margin-bottom: 0.5rem; }
        .stats-table caption { caption-side: bottom; text-align: left; padding: 0.75rem 0.25rem 0; color: var(--color-text-muted); font-size: 0.85rem; }

        .stats-about { max-width: 820px; margin: 3rem auto 4rem; color: var(--color-text); line-height: 1.7; }
        .stats-about h2 { font: 700 1.6rem/1.25 var(--font-display); color: var(--color-primary); margin-bottom: 0.75rem; }
        .stats-about p { margin-bottom: 1rem; }
        .stats-about dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.25rem; margin: 1.25rem 0 1.5rem; }
        .stats-about dt { font-weight: 700; color: var(--color-primary); }
        .stats-about dd { margin: 0; color: var(--color-text-muted); }
        .stats-about a { color: var(--color-accent-text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
        @media (max-width: 600px) { .stats-about dl { grid-template-columns: 1fr; gap: 0.15rem; } .stats-about dd { margin-bottom: 0.6rem; } }

        .cta-banner {
            background: linear-gradient(135deg, var(--color-action) 0%, var(--color-action-hover) 100%);
            padding: 4rem 2rem;
            text-align: center;
            position: relative;
            overflow: hidden;
            color: var(--color-on-action);
        }
        .cta-banner-pattern {
            position: absolute;
            inset: 0;
            /* Decorative white stripe; the banner is violet in both themes. */
            background-image: repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255,255,255,.05) 35px, rgba(255,255,255,.05) 70px);
            opacity: 0.5;
        }
        .cta-banner-inner { max-width: 1200px; margin: 0 auto; position: relative; z-index: 1; }
        .cta-banner h2 { font-family: var(--font-display); font-size: 2.5rem; font-weight: 700; line-height: 1.15; color: var(--color-on-action); margin-bottom: 1rem; letter-spacing: -0.01em; }
        .cta-banner p { font-size: 1.25rem; color: var(--color-on-action); margin-bottom: 2rem; font-weight: 400; }
        .cta-banner a { color: var(--color-on-action); text-decoration: none; transition: opacity 0.3s; }
        .cta-banner a:hover { opacity: 0.8; }

        /* ── Footer (look from .site-footer in components.css) ── */
        .footer-inner { max-width: 1200px; margin: 0 auto; }

        /* ── Notify Modal (look from .notify-modal in components.css) ── */
        .notify-overlay {
            display: none; position: fixed; inset: 0;
            background: var(--color-overlay); backdrop-filter: blur(6px);
            z-index: 9999; align-items: center; justify-content: center; padding: 1rem;
        }
        .notify-overlay.open { display: flex; }
        .notify-modal {
            width: 100%;
            animation: modalSlideIn 0.3s ease;
        }
        @keyframes modalSlideIn {
            from { opacity: 0; transform: translateY(20px) scale(0.97); }
            to   { opacity: 1; transform: translateY(0) scale(1); }
        }
        .notify-modal .modal-sub { line-height: 1.5; }
        .notify-form-group { margin-bottom: 1rem; }
        .notify-form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--color-text); }
        .notify-form-group .notify-checkbox-label { display: flex; align-items: center; margin-bottom: 0; }
        .notify-checkbox-group { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.25rem; }
        .notify-checkbox-label {
            position: relative;
            gap: 0.7rem;
            padding: 0.75rem 1rem; border: 2px solid var(--color-border); border-radius: var(--radius-md);
            font-weight: 500; font-size: 0.92rem;
            transition: border-color 0.2s, background 0.2s;
        }
        .notify-checkbox-label:hover { background: var(--color-surface); border-color: var(--color-accent-soft); }
        .notify-checkbox-label .cb-text {
            flex: 1;
            align-self: center;
            line-height: 1.4;
        }
        /* Visually hidden but still keyboard-focusable */
        .notify-checkbox-label input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
        .notify-checkbox-label .checkmark {
            width: 20px; height: 20px; border: 2px solid var(--color-text-subtle); border-radius: 5px;
            display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.2s;
        }
        .notify-checkbox-label input:focus-visible ~ .checkmark { outline: 2px solid var(--color-focus); outline-offset: 2px; }
        .notify-checkbox-label input:checked ~ .checkmark { background: var(--color-action); border-color: var(--color-action); color: var(--color-on-action); }
        .notify-checkbox-label input:checked ~ .checkmark::after { content: '✓'; font-size: 12px; font-weight: 700; }
        .notify-checkbox-label.checked { border-color: var(--color-accent); background: var(--color-accent-tint); }
        .notify-submit-btn {
            padding: 0.9rem;
            border-radius: var(--radius-2xl);
            font-size: 1rem; font-weight: 700;
        }
        .notify-success { display: none; text-align: center; padding: 1rem 0; }
        .notify-success .success-icon { font-size: 3rem; margin-bottom: 1rem; }
        .notify-success h4 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; margin-bottom: 0.5rem; color: var(--color-primary); }
        .notify-success p { color: var(--color-text-muted); font-size: 0.95rem; }
        #notifyError { text-align: center; margin-top: 0.75rem; }

        /* ── Analysis Tabs (look from .tabs-pill / .tab-pill in components.css) ── */
        .tab-bar {
            margin-bottom: 2rem;
        }
        .tab-panel { display: none; }
        .tab-panel.active { display: block; }

        /* ── Per Round table ──────────────────────────────── */
        .round-cell {
            text-align: center;
            font-variant-numeric: tabular-nums;
            min-width: 52px;
        }
        .stats-table .round-cell.top-score { color: var(--color-accent-text); font-weight: 700; }
        .stats-table .round-cell.zero { color: var(--color-text-subtle); }
        .stats-table .round-empty { color: var(--color-text-muted); font-style: italic; }

        /* ── Head to Head ─────────────────────────────────── */
        .h2h-pickers {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1rem;
            margin-bottom: 2rem;
        }
        @media (max-width: 700px) { .h2h-pickers { grid-template-columns: 1fr; } }
        .h2h-picker-group label {
            display: block;
            font-size: 0.8rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 0.4rem;
        }
        .h2h-picker-group.p1 label { color: var(--h2h-p1-text); }
        .h2h-picker-group.p2 label { color: var(--h2h-p2-text); }
        .h2h-picker-group.p3 label { color: var(--h2h-p3-text); }
        /* Combobox (searchable dropdown) */
        .h2h-combo { position: relative; }
        .h2h-combo-input {
            width: 100%;
            padding: 0.7rem 2.2rem 0.7rem 1rem;
            border: 2px solid var(--color-border);
            border-radius: var(--radius-md);
            font-family: var(--font-body);
            font-size: 0.92rem;
            color: var(--color-text);
            transition: border-color 0.2s;
            /* Chevron stroke is slate-400, readable on both light and dark raised grounds */
            background: var(--color-raised) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
            box-sizing: border-box;
            cursor: text;
        }
        .h2h-combo-input::placeholder { color: var(--color-text-muted); opacity: 0.8; }
        .h2h-picker-group.p1 .h2h-combo-input { border-left: 4px solid var(--h2h-p1); }
        .h2h-picker-group.p2 .h2h-combo-input { border-left: 4px solid var(--h2h-p2); }
        .h2h-picker-group.p3 .h2h-combo-input { border-left: 4px solid var(--h2h-p3); }
        .h2h-picker-group.p1 .h2h-combo-input:focus { border-color: var(--h2h-p1); }
        .h2h-picker-group.p2 .h2h-combo-input:focus { border-color: var(--h2h-p2); }
        .h2h-picker-group.p3 .h2h-combo-input:focus { border-color: var(--h2h-p3); }
        .h2h-combo-list {
            display: none;
            position: absolute;
            top: calc(100% + 4px);
            left: 0; right: 0;
            background: var(--color-raised);
            border: 2px solid var(--color-border);
            border-radius: var(--radius-md);
            max-height: 220px;
            overflow-y: auto;
            z-index: 200;
            padding: 0.3rem 0;
            box-shadow: var(--shadow-dropdown);
            list-style: none;
            margin: 0;
        }
        .h2h-combo-list.open { display: block; }
        .h2h-combo-item {
            padding: 0.55rem 1rem;
            cursor: pointer;
            font-size: 0.88rem;
            color: var(--color-text);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .h2h-combo-item:hover,
        .h2h-combo-item.focused { background: var(--color-surface); }
        .h2h-combo-item.selected { font-weight: 700; background: var(--color-accent-tint); }
        .h2h-combo-empty {
            padding: 0.6rem 1rem;
            font-size: 0.85rem;
            color: var(--color-text-muted);
            font-style: italic;
        }

        .h2h-cards {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1rem;
            margin-bottom: 2rem;
        }
        @media (max-width: 700px) { .h2h-cards { grid-template-columns: 1fr; } }
        .h2h-card {
            background: var(--color-raised);
            border-radius: var(--radius-xl);
            padding: 1.5rem;
            border: var(--border-card) solid var(--color-border);
            min-height: 160px;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
        .h2h-card.p1 { border-top: var(--stripe-card) solid var(--h2h-p1); }
        .h2h-card.p2 { border-top: var(--stripe-card) solid var(--h2h-p2); }
        .h2h-card.p3 { border-top: var(--stripe-card) solid var(--h2h-p3); }
        .h2h-card.empty { display: flex; align-items: center; justify-content: center; color: var(--color-text-muted); font-size: 0.9rem; border-style: dashed; }
        .h2h-card-name {
            font-family: var(--font-display);
            font-size: 1.05rem;
            font-weight: 800;
            color: var(--color-primary);
            margin-bottom: 0.25rem;
        }
        .h2h-card-pos { font-size: 0.78rem; color: var(--color-text-muted); margin-bottom: 0.5rem; }
        .h2h-stat-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.85rem;
            padding: 0.3rem 0;
            border-bottom: 1px solid var(--color-border-subtle);
        }
        .h2h-stat-row:last-child { border-bottom: none; }
        .h2h-stat-label { color: var(--color-text-muted); font-weight: 500; }
        .h2h-stat-value { font-weight: 700; color: var(--color-primary); font-variant-numeric: tabular-nums; }
        .h2h-stat-value.highlight { color: var(--color-accent-text); }

        .h2h-chart-wrap {
            background: var(--color-raised);
            border: 1px solid var(--color-hairline);
            border-radius: var(--radius-xl);
            padding: 1.75rem;
            box-shadow: var(--shadow-panel);
        }
        .h2h-chart-wrap h3 {
            font-family: var(--font-display);
            font-size: 1rem;
            font-weight: 700;
            margin-bottom: 1.25rem;
            color: var(--color-primary);
        }
        .h2h-no-selection {
            text-align: center;
            padding: 3rem;
            color: var(--color-text-muted);
            font-size: 0.95rem;
        }

        /* Nations Championship stats */
        .fx-pill {
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
            padding: 0.12rem 0.45rem 0.12rem 0.28rem;
            border-radius: var(--radius-2xl);
            background: var(--color-surface);
            border: 1px solid var(--color-border);
            font-size: 0.75rem;
            font-weight: 700;
            letter-spacing: 0.02em;
            white-space: nowrap;
            color: var(--color-primary);
        }
        .fx-pill .flag { width: 18px; height: 12px; }
        .fx-side { color: var(--color-text-muted); font-weight: 600; }
        .nc-note {
            color: var(--color-text-muted);
            font-size: 0.9rem;
            margin-top: 0.35rem;
        }
        .stats-table tbody tr.nc-row { cursor: pointer; }
        .stats-table tbody tr.nc-row.is-open { outline: 2px solid var(--color-accent-soft); outline-offset: -2px; }
        .nc-detail {
            margin-top: 1.25rem;
            padding: 1.25rem 1.4rem 1.4rem;
            background: var(--color-raised);
            border: 1px solid var(--color-border);
            border-radius: var(--radius-xl);
            box-shadow: var(--shadow-panel);
        }
        .nc-detail[hidden] { display: none; }
        .nc-detail-head {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 1rem;
            margin-bottom: 0.85rem;
        }
        .nc-detail h2 {
            font: 800 1.35rem/1.2 var(--font-display);
            color: var(--color-primary);
            margin: 0;
        }
        .nc-detail h2 .flag { width: 28px; height: 19px; }
        .nc-detail-meta { color: var(--color-text-muted); margin: 0.25rem 0 0; }
        .nc-detail-close {
            background: transparent;
            border: 1px solid var(--color-border);
            border-radius: var(--radius-sm);
            color: var(--color-text);
            font: 600 0.85rem var(--font-body);
            padding: 0.35rem 0.7rem;
            cursor: pointer;
        }
        .nc-detail-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 0.4rem 1.5rem;
            margin: 0;
        }
        .nc-detail-grid div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.35rem 0; border-bottom: 1px solid var(--color-border-subtle); }
        .nc-detail-grid dt { color: var(--color-text-muted); font-weight: 500; }
        .nc-detail-grid dd { margin: 0; font-weight: 700; color: var(--color-primary); font-variant-numeric: tabular-nums; }
