/* Public-only palette. Dark colors remain the fallbacks at their point of use. */
:root[data-theme-changing] .public-site,
:root[data-theme-changing] .public-site *,
:root[data-theme-changing] .public-site *::before,
:root[data-theme-changing] .public-site *::after {
    transition: none !important;
}
:root[data-theme="light"] {
    color-scheme: light;
    --theme-canvas: #f5f6f8;
    --theme-surface: #fff;
    --theme-subtle: #f0f2f5;
    --theme-text: #24282f;
    --theme-muted: #616975;
    --theme-accent: #303640;
    --theme-accent-fill: #f4d35e;
    --theme-border: #dce0e5;
    --theme-highlight: #edf0f4;
    --theme-tint: rgba(36, 40, 47, 0.035);
    --theme-shadow: rgba(24, 32, 48, 0.06);
    --theme-selection: #fff6db;
    --theme-focus: #946b00;
    --theme-success: #27683b;
    --theme-danger: #b32929;
    --theme-info: #176187;
    --theme-overlay: rgba(24, 32, 48, 0.45);
}
.public-site .theme-toggle {
    display: inline-grid;
    place-items: center;
    min-height: 44px;
    width: 44px;
    padding: 8px;
    border: 1px solid var(--theme-border, #383522);
    border-radius: 8px;
    background: var(--theme-surface, #101010);
    color: var(--theme-text, #e0e0e0);
    font: inherit;
    font-size: 22px;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}
/* Reserve both labels' width and show the saved theme before DOMContentLoaded. */
.public-site .theme-toggle > span { grid-area: 1 / 1; }
.public-site .theme-label-light { visibility: hidden; }
:root[data-theme="light"] .public-site .theme-label-dark { visibility: hidden; }
:root[data-theme="light"] .public-site .theme-label-light { visibility: visible; }
.public-site .theme-toggle:hover { background: var(--theme-highlight, #211d08); }
.public-site .theme-toggle:focus-visible {
    outline: 2px solid var(--theme-accent, #ffd700);
    outline-offset: 3px;
}
.public-site .header-nav { flex-wrap: wrap; }
:root[data-theme="light"] .public-site { background: var(--theme-canvas); }
:root[data-theme="light"] .public-site :is(input, select, textarea) { color-scheme: light; }

/* Color marks an active choice; ordinary headings and scores stay neutral. */
:root[data-theme="light"] .public-site :is(
    .gender-tab.active,
    .playground-tab.active,
    .club-mode-tab.active,
    .category-chips a[aria-current="page"],
    .category-genders a[aria-current="page"],
    .standings-tabs a[aria-current="page"],
    .rating-search-mobile-tab[aria-selected="true"]
) {
    color: var(--theme-text);
    background: var(--theme-selection);
    border-color: var(--theme-focus);
}
:root[data-theme="light"] .public-site .rating-table tbody td.stage-points.best-stage {
    background: var(--theme-selection);
}
:root[data-theme="light"] .public-site :focus-visible { outline-color: var(--theme-focus); }
:root[data-theme="light"] .public-site :is(input, select, textarea):focus {
    border-color: var(--theme-focus);
}
