:root { --chart-total: #f8fafc; --chart-regular: #5eead4; --chart-market: #38bdf8; --chart-forecast: #c4a1ff; }
:root {
  --seat-regular: #22c55e;
  --seat-regular-border: #bbf7d0;
  --seat-regular-label: #052e16;
  --seat-marketplace: #38bdf8;
  --seat-marketplace-border: #bae6fd;
  --seat-marketplace-label: #082f49;
  --seat-unavailable: transparent;
  --seat-unavailable-border: #64717e;
  --seat-unavailable-label: #84909d;
  --seat-label: #e2e8f0;
  --stadium-section-outline: #0f172a;
  --stadium-section-highlight: #fff;
  --stadium-section-preview: #fff;
  --updates-accent: #fda4af;
  --updates-tint: #f43f5e18;
  --panel-surface: #292c2f;
  --panel-border: #464b50;
  --panel-text: #f1f2f3;
  --panel-shadow: none;
  --ui-muted: #aab8cd;
  --ui-border: #464b50;
  --ui-active: #29423e;
  --checkbox-accent: #5eead4;
  --checkbox-mark: #202224;
}
:root[data-theme="light"] {
  --updates-accent: #9f1239;
  --updates-tint: #f43f5e0d;
  --seat-regular: #15803d;
  --seat-regular-border: #166534;
  --seat-regular-label: #fff;
  --seat-marketplace: #0369a1;
  --seat-marketplace-border: #075985;
  --seat-marketplace-label: #fff;
  --seat-unavailable-border: #94a3b8;
  --seat-unavailable-label: #64748b;
  --seat-label: #263446;
  --stadium-section-preview: #a81735;
  --panel-surface: #ededea;
  --panel-border: #cdcfcc;
  --panel-text: #1b2026;
  --panel-shadow: 0 2px 8px #1b202605;
  --ui-muted: #536173;
  --ui-border: #cbcdca;
  --ui-active: #d4e8e4;
  --checkbox-accent: #bc1936;
  --checkbox-mark: #fff;
}
.app-nav .theme-toggle, .site-header .theme-toggle { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; padding: 8px; margin-left: auto; border: 1px solid #455063; border-radius: 9px; background: transparent; color: #e2e8f0; cursor: pointer; }
.theme-toggle svg { width: 21px; height: 21px; }
.theme-toggle .theme-moon { display: none; }
.theme-toggle:focus-visible { outline: 2px solid #38bdf8; outline-offset: 3px; }
:root[data-theme="light"] { background: #e0e0de; color: #1b2026; color-scheme: light; --chart-total: #1b2026; --chart-regular: #087f6b; --chart-market: #087caf; --chart-forecast: #7941ad; }
:root[data-theme="light"] body { background: #e0e0de; color: #1b2026; }
:root[data-theme="light"] .theme-toggle { color: #263446; border-color: #b7c2ce; background: #ededea; }
:root[data-theme="light"] .theme-sun { display: none; }
:root[data-theme="light"] .theme-moon { display: block; }
/* Surfaces and controls are separate from availability colours on the map. */
:root[data-theme="light"] :is(.summary-card, .empty-dashboard, .history-kpis article) { background: #ededea; color: #1b2026; border-color: #c8cbd0; box-shadow: none; backdrop-filter: none; }
:root[data-theme="light"] .summary-card-primary { border-top-color: #0d9488; }
:root[data-theme="light"] :is(.app-brand, .site-header .brand, h1, h2, h3, .section-name, .updates-page h1, .updates-detail h2, .update-card h3 a, .history-readout strong, .filter-empty strong) { color: #1b2026; }
:root[data-theme="light"] :is(.app-nav, .site-header, .updates-day-heading, .updates-more, .updates-detail article > header, .season-row, .kpi-footer) { border-color: #c8cbd0; }
:root[data-theme="light"] :is(.app-nav nav a, .site-header nav a) { color: #414b56; }
:root[data-theme="light"] :is(.app-nav nav a:hover, .site-header nav a:hover, .app-nav nav a[aria-current], .site-header nav a[aria-current]) { color: #1b2026; }
:root[data-theme="light"] :is(.app-nav nav a[aria-current], .site-header nav a[aria-current]) { border-bottom-color: #bc1936; }
:root[data-theme="light"] :is(.summary-date, .kpi-description, .kpi-footnote, .kpi-denominator, .kpi-heading h3, .history-note, .history-legend, .history-heading p:not(.panel-kicker), .history-kpis span, .history-kpis small, .history-controls label, .history-metric, .comparison-search, .history-chart-panel > p, .season-match span, .season-updated, .season-axis, .history-range-heading p, .history-range-ticks, .section-name span, .tribune-name, .filter-result, .muted-count, .snapshot-picker label, .snapshot-picker small, .updates-intro, .update-card > p, .updates-detail section p, .updates-detail li, .update-meta, .updates-back, .updates-more a, .updates-day-heading > span, .info-hint-text, .map-readout > span, .map-readout > div > span, .map-readout small) { color: #414b56; }
:root[data-theme="light"] :is(.panel-kicker, .eyebrow, .update-read) { color: #ab1735; }
:root[data-theme="light"] :is(.text-button, button.info-hint) { color: #414b56; }
:root[data-theme="light"] :is(button.info-hint:hover, button.info-hint[aria-expanded="true"], .text-button:hover) { color: #1b2026; background: #e9edf2; }
:root[data-theme="light"] :is(.match-card, .snapshot-picker, .history-range, .history-readout, .chart-tabs, .section-filters, .comparison-sections, .map-readout, .count-badge) { background: #e5e5e2; border-color: #cbd5df; color: #263446; }
:root[data-theme="light"] .match-card:hover { background: #e2e8ef; border-color: #8e9caf; }
:root[data-theme="light"] .match-card[aria-pressed="true"] { background: #ededea; border-color: #bc1936; box-shadow: inset 3px 0 #bc1936; }
:root[data-theme="light"] :is(input:not([type="checkbox"]), select, textarea, .history-controls input, .history-controls select, .history-metric select, .comparison-search input, .section-browser input, .section-browser select, .snapshot-picker select) { color-scheme: light; color: #1b2026; background: #ededea; border-color: #bac5d2; }
:root[data-theme="light"] input::placeholder { color: #687789; }
:root[data-theme="light"] :is(.secondary-button) { background: #e2e2df; border-color: #bac5d2; color: #263446; }
:root[data-theme="light"] :is(.secondary-button:hover) { background: #e6e9ed; }
:root[data-theme="light"] :is(.section-table th, .section-table th button, .history-table th, .pattern-table th) { background: #dfdfdc; color: #435267; }
:root[data-theme="light"] :is(td, th) { border-color: #d9e0e8; }
:root[data-theme="light"] .section-table tr.is-selected { background: #e8dce0; }
:root[data-theme="light"] :is(.free-count) { color: #087348; }
:root[data-theme="light"] .chart-tabs a { color: #414b56; }
:root[data-theme="light"] .chart-tabs a[aria-current] { background: #d7e7ee; color: #155873; }
:root[data-theme="light"] :is(.kpi-meter, .season-bar) { background: #e0e6ed; }
:root[data-theme="light"] .history-chart text { fill: #414b56; }
:root[data-theme="light"] .history-gridline { stroke: #d9e0e8; }
:root[data-theme="light"] .history-range-track { background: #dededb; }
:root[data-theme="light"] .history-range-shade { background: #52657b20; }
:root[data-theme="light"] .history-range-handle span { background: #efefec; color: #536b66; border-color: #9aacaa; }
:root[data-theme="light"] .history-range-selection { border-color: #9aacaa80; }
:root[data-theme="light"] :is(.chart-point-tooltip) { color: #263446; background: #ededea; border-color: #b7c5d3; box-shadow: 0 8px 24px #1b202620; }
:root[data-theme="light"] .chart-point-tooltip > strong { color: #1b2026; border-color: #c8cbd0; }
:root[data-theme="light"] :is(.updates-page) { color: #1b2026; }
:root[data-theme="light"] .update-meta > span { background: #fff0f2; border-color: #f0c5cf; color: #a11937; }
:root[data-theme="light"] .update-meta > .update-period { background: none; border: 0; color: #414b56; }
:root[data-theme="light"] .update-meta b { color: #a11937; }
:root[data-theme="light"] .source-status-warning { background: #fff6dc; color: #6d4a13; border-color: #dfbe70; }
:root[data-theme="light"] .error-box { background: #fff0f0; color: #991b1b; border-color: #f0b2b2; }
/* Availability colours remain identical in both themes. */
:root[data-theme="light"] .svg-map { background: #e1e1de; box-shadow: inset 0 0 0 1px #dce1e6; }
/* Static API documentation shares the same switch and persisted preference. */
:root[data-theme="light"] :is(.layout p, .layout li, .layout td, .layout footer, .layout aside nav a) { color: #414b56; }
:root[data-theme="light"] :is(.layout section, .layout details, .layout aside nav) { border-color: #c8cbd0; }
:root[data-theme="light"] :is(.layout .code, .layout .code-heading, .layout .endpoint-path, .layout .badges span, .layout th) { background: #e5e5e2; color: #263446; border-color: #cbd5df; }
:root[data-theme="light"] .layout .note { background: #e8f4ef; border-color: #0d9488; }
:root[data-theme="light"] :is(.layout pre, .layout .method) { color: #086943; }
:root[data-theme="light"] :is(.layout a, .layout p code, .layout li code, .layout td:first-child) { color: #12618c; }
:root[data-theme="light"] .layout button { color: #263446; background: #dde6ee; border-color: #aabccc; }
@media (max-width: 760px) {
  .app-nav .theme-toggle, .site-header .theme-toggle { order: 0; }
  .app-nav nav, .site-header nav { order: 1; }
}

:root { --series-0: #5eead4; --series-1: #38bdf8; --series-2: #fbbf24; --series-3: #fb7185; --series-4: #c084fc; --series-5: #a3e635; --series-6: #fb923c; --series-7: #818cf8; --series-8: #f472b6; --series-9: #22d3ee; }
:root[data-theme="light"] { --series-0: #087f6b; --series-1: #087caf; --series-2: #966700; --series-3: #c32d4b; --series-4: #8549ba; --series-5: #527b0c; --series-6: #b45208; --series-7: #5655bb; --series-8: #b43388; --series-9: #087b8c; }

:root[data-theme="light"] :is(.match-card-top, .match-card-bottom, .match-date > span, .match-teams > span, .archive-toggle span) { color: #414b56; }
:root[data-theme="light"] .match-date strong { color: #1b2026; }
:root[data-theme="light"] .match-card[aria-pressed="true"] .match-card-top > span:last-child { color: #ab1735; }
:root[data-theme="light"] :is(.match-card-bottom, .match-date) { border-color: #c8cbd0; }
:root[data-theme="light"] .match-ready { color: #087f6b; }
:root[data-theme="light"] .match-pending { color: #966700; }
:root[data-theme="light"] .match-empty { color: #414b56; }
:root[data-theme="light"] .kpi-value[style] { color: #1b2026 !important; }

/* Neutral dark surfaces: lighter than the page, without coloured glows. */
:root[data-theme="dark"], :root[data-theme="dark"] body { background: #202224; color: #f1f2f3; }
:root[data-theme="dark"] :is(.summary-card, .empty-dashboard, .history-kpis article) { background: #292c2f; border-color: #464b50; box-shadow: none; backdrop-filter: none; }
:root[data-theme="dark"] .summary-card-primary { border-top-color: #2dd4bf; }
:root[data-theme="dark"] :is(.match-card, .history-range, .history-readout, .chart-tabs, .section-filters, .comparison-sections, .map-readout, .count-badge) { background: #303438; border-color: #50565d; }
:root[data-theme="dark"] .match-card:hover { background: #383d42; }
:root[data-theme="dark"] .match-card[aria-pressed="true"] { background: #3a2c30; border-color: #ed8493; }
:root[data-theme="dark"] :is(.app-nav, .site-header, .match-card-bottom, .match-date, .match-archive, .updates-day-heading, .kpi-footer) { border-color: #464b50; }
:root[data-theme="dark"] :is(input:not([type="checkbox"]), select, textarea, .section-browser input, .section-browser select, .snapshot-picker select, .history-controls input, .history-controls select) { background: #24272a; border-color: #626970; color: #f1f2f3; }
:root[data-theme="dark"] :is(.secondary-button) { background: #383d42; border-color: #626970; color: #f1f2f3; }
:root[data-theme="dark"] :is(.section-table th, .section-table th button, .section-table td:first-child, .history-table th, .pattern-table th) { background: #303438; }
:root[data-theme="dark"] .section-table tr:hover { background: #383d42; }
:root[data-theme="dark"] :is(.section-table tr.is-selected, .section-table tr.is-selected td:first-child) { background: #2a423e; }
:root[data-theme="dark"] :is(.chart-point-tooltip) { background: #303438; border-color: #69727b; }
:root[data-theme="dark"] :is(.history-range-track) { background: #232629; }
:root[data-theme="dark"] .svg-map { background: #23292c; }
:root[data-theme="dark"] :is(.layout .code, .layout .code-heading, .layout .endpoint-path, .layout .badges span, .layout th) { background: #292c2f; border-color: #50565d; }
/* Explicit light text and table states; inherited dark colours were unreadable. */
:root[data-theme="light"] :is(.availability-legend-item, .capacity-cell, .empty-state, .section-filters legend, .section-filters label, .seat-source-legend, .history-table, .pattern-table, .comparison-sections, .history-range-heading strong) { color: #343e49; }
:root[data-theme="light"] .section-table td { color: #343e49; border-color: #c8cbd0; }
:root[data-theme="light"] .section-table td:first-child { background: #ededea; }
:root[data-theme="light"] .section-table th:first-child { background: #dfdfdc; }
:root[data-theme="light"] :is(.section-table tr:hover, .section-table tr:hover td:first-child) { background: #dce3df; }
:root[data-theme="light"] :is(.section-table tr.is-selected, .section-table tr.is-selected td:first-child) { background: #e8dce0; }
:root[data-theme="light"] .scarcity-notice { background: #fff3d1; color: #66470e; border-color: #a7730b; }
:root[data-theme="light"] .availability-swatch { border-color: #59636e; }
:root[data-theme="light"] :is(.section-table-scroll, .history-chart-scroll, .match-picker) { scrollbar-color: #808891 #dce3df; }
:root[data-theme="light"] .history-hit:focus { stroke: #7e4500; }
:root[data-theme="light"] :is(button, a, input, select, summary, [tabindex]):focus-visible { outline-color: #085c88; }
:root[data-theme="light"] input[type="checkbox"] { accent-color: #087660; }

:root[data-theme="dark"] .count-badge { color: #e2e8f0; }
:root[data-theme="light"] .season-regular { background: var(--chart-regular); }
:root[data-theme="light"] .season-marketplace { background: var(--chart-market); }

/* Light layout: restrained neutral surfaces and one red selection accent. */
:root[data-theme="light"] :is(.summary-card, .history-kpis article) { border-color: #cdcfcc; box-shadow: 0 2px 8px #1b202605; }
:root[data-theme="light"] .match-card { background: #ededea; border-color: #cbcdca; }
:root[data-theme="light"] .match-card:hover { background: #e3e3df; border-color: #9ea7b2; }
:root[data-theme="light"] .match-card[aria-pressed="true"] { background: #ededea; border-color: #bc1936; box-shadow: inset 3px 0 #bc1936; }
:root[data-theme="light"] :is(.match-card-bottom, .kpi-footer, .availability-legend, .snapshot-picker) { border-color: transparent; }

:root[data-theme="light"] .section-table-scroll { border-color: #cdcfcc; }
:root[data-theme="light"] .section-table td { border-color: #e9ecf0; }
:root[data-theme="light"] :is(.section-table tr.is-selected, .section-table tr.is-selected td:first-child) { box-shadow: none; }
:root[data-theme="light"] .section-table tr.is-selected td:first-child { box-shadow: inset 3px 0 #bc1936; }
:root[data-theme="light"] .chart-tabs a[aria-current] { box-shadow: 0 1px 4px #1b202610; }
:root[data-theme="light"] input[type="checkbox"] { accent-color: #bc1936; }
:root[data-theme="light"] .svg-map .availability-sections [aria-pressed="true"],
:root[data-theme="light"] .svg-map .availability-sections [block-id]:hover,
:root[data-theme="light"] .svg-map .availability-sections [block-id]:focus-visible { stroke: #a81735 !important; }

:root[data-theme="light"] .best-section-list button { background: #e5e5e2; color: #1b2026; border-color: #cbcdca; }
:root[data-theme="light"] .best-section-list button span { color: #414b56; }
:root[data-theme="light"] .best-section-list button[aria-pressed="true"] { background: #ededea; color: #1b2026; border-color: #bc1936; box-shadow: inset 3px 0 #bc1936; }
:root[data-theme="light"] .best-section-list button:hover { background: #dce3df; }
