/* Shared with the static regulation document. White is the existing default. */
:root{--surface-alt:#f5f7f5;--button-bg:#3d5145;--button-ink:#fff;--bar:#a9bdb0;--bar-leader:#315641}
:root[data-theme="dark"]{color-scheme:dark;--bg:#101413;--surface:#191f1c;--surface-alt:#222a25;--ink:#edf2ee;--muted:#adb9b0;--line:#3b4840;--accent:#acd3b5;--accent-soft:#293d31;--gold:#dfba6e;--red:#f39890;--shadow:0 10px 32px #0003;--button-bg:#355942;--bar:#748f7c;--bar-leader:#b1d8bb;--paper:var(--surface);--soft:var(--surface-alt)}
:root[data-theme="gray"]{color-scheme:dark;--bg:#282b2a;--surface:#343936;--surface-alt:#3d4440;--ink:#f3f5f3;--muted:#c1c9c3;--line:#606b63;--accent:#bedbc5;--accent-soft:#47594d;--gold:#ebc781;--red:#ffaca5;--shadow:0 10px 32px #0002;--button-bg:#3d5d48;--bar:#94ab9a;--bar-leader:#c0dfc8;--paper:var(--surface);--soft:var(--surface-alt)}
html[data-theme]:not([data-theme="white"]) body{background:var(--bg);color:var(--ink)}
html[data-theme]:not([data-theme="white"]) :is(.category-card,.menu-panel,.menu-button,.clear,.live-refresh,.chart-card,.score-filter-card,.score-card,.pilot-picker-pop,.pilot-picker>summary,.profile-card,.profile-clear,.campaign-card,.campaign-section,.campaign-empty,.room-card,.stage-card,.stage-fact,.past-stages,.zgt-driver-card,.zgt-menu,.zgt-intro .official,.official,.stats,.toolbar,.rank,.driver){background:var(--surface);border-color:var(--line)}
html[data-theme]:not([data-theme="white"]) :is(input,select){background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme]:not([data-theme="white"]) :is(th,.driver-head,.rank-head,.pilot-actions button,.stage-status,.stage-figure,.stage-figure img,.score-field select:disabled,.stage-personal-result.pending,.zgt-car,.zgt-avatar,.profile-save.is-saved){background:var(--surface-alt);border-color:var(--line);color:var(--muted)}
html[data-theme]:not([data-theme="white"]) :is(.stage-meta,.campaign-live,.race-note,.campaign-you,.stage-personal-result){background:var(--accent-soft);border-color:var(--line);color:var(--accent)}
html[data-theme]:not([data-theme="white"]) :is(td,.zgt-car,.zgt-next,.zgt-driver-card,.zgt-avatar,.category-card,.stage-figure figcaption){border-color:var(--line)}
html[data-theme]:not([data-theme="white"]) :is(.event,.legend-item,.legend-item b,.stage-note,.stage-weather,.stage-qualifying,.stage-pit,.menu-close){color:var(--muted)}
html[data-theme]:not([data-theme="white"]) :is(tbody tr:hover,.pilot-option:hover,.profile-save.is-saved:hover){background:var(--surface-alt)}
html[data-theme]:not([data-theme="white"]) :is(.profile-save,.stage-status.next){background:var(--button-bg);border-color:var(--button-bg);color:#fff}
html[data-theme]:not([data-theme="white"]) .profile-save.is-saved{background:var(--surface-alt);border-color:var(--line);color:var(--muted)}
html[data-theme]:not([data-theme="white"]) .campaign-meter{background:var(--surface-alt)}
html[data-theme]:not([data-theme="white"]) .campaign-meter span{background:var(--accent)}
html[data-theme]:not([data-theme="white"]) :is(.score-svg .score-axis,.chart-svg .axis-label,.chart-svg .driver-label){fill:var(--muted)}
html[data-theme]:not([data-theme="white"]) :is(.score-svg .score-name,.score-svg .score-value,.chart-svg .value-label){fill:var(--ink)}
html[data-theme]:not([data-theme="white"]) :is(.score-svg .score-grid,.chart-svg .grid){stroke:var(--line)}
html[data-theme]:not([data-theme="white"]) .score-svg .score-future{fill:var(--surface-alt)}
html[data-theme]:not([data-theme="white"]) .score-svg .score-future-label{fill:var(--muted)}
html[data-theme]:not([data-theme="white"]) .score-svg .score-bar{fill:var(--bar)}
html[data-theme]:not([data-theme="white"]) .score-svg .score-bar.leader{fill:var(--bar-leader)}
html[data-theme]:not([data-theme="white"]) .score-svg .score-end-label{paint-order:stroke;stroke:var(--surface);stroke-width:2px;filter:brightness(1.6)}
html[data-theme]:not([data-theme="white"]) :is(.score-svg .score-line,.score-svg .score-marker,.score-svg .score-absence,.evolution-legend i){filter:brightness(1.6)}
html[data-theme]:not([data-theme="white"]) :is(.campaign-method a,.body a){color:var(--accent)}
html[data-theme]:not([data-theme="white"]) :is(.score-error,.stage-load-error){background:#412a2a;color:#ffb8af;border-color:#915b56}
html[data-theme]:not([data-theme="white"]) .stage-note{background:var(--surface-alt);border-left-color:var(--gold)}
html[data-theme]:not([data-theme="white"]) .trend.up{color:#91d5a5}
html[data-theme]:not([data-theme="white"]) .trend.down{color:#ff9d95}
html[data-theme]:not([data-theme="white"]) :is(input,select):focus{box-shadow:0 0 0 3px var(--accent-soft);border-color:var(--accent)}
/* Regulation text stays live HTML; official images keep their original colors. */
html[data-theme]:not([data-theme="white"]) :is(.hero,.contents,.body,.stage,.editor-note){background:var(--surface);border-color:var(--line)}
html[data-theme]:not([data-theme="white"]) :is(.stage h3,.stage .config,.stage figcaption){background:var(--surface-alt);color:var(--ink);border-color:var(--line)}
a:focus-visible,button:focus-visible,select:focus-visible,summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.profile-appearance h3{margin:0 0 7px;font-size:17px}.profile-appearance p{color:var(--muted);font-size:12px}.profile-appearance select{width:100%;min-height:44px;border:1px solid var(--line);border-radius:7px;padding:0 12px;background:var(--surface);color:var(--ink)}.profile-appearance label{display:block;margin:12px 0 6px;font-size:12px;font-weight:650}.theme-status{margin:9px 0 0}
.campaign-method{margin-top:14px;font-size:12px;color:var(--muted)}.campaign-method summary{cursor:pointer;color:var(--accent);font-weight:650}.campaign-method p{line-height:1.6}.campaign-interval{font-size:12px;margin-top:8px;color:var(--muted)}.campaign-rivals td:nth-child(2){white-space:normal;overflow-wrap:anywhere}.campaign-live{white-space:normal}.campaign-card .campaign-value{overflow-wrap:anywhere}
.campaign-shell{min-width:0;grid-template-columns:minmax(0,1fr)}#campaignContent{min-width:0}.campaign-rivals{table-layout:fixed}.campaign-rivals :is(th,td){white-space:normal;overflow-wrap:anywhere}.campaign-rivals :is(th,td):nth-child(1){width:36px}.campaign-rivals :is(th,td):nth-child(3){width:48px;max-width:none}.campaign-rivals :is(th,td):nth-child(4){width:62px}
@media(max-width:390px){.campaign-value{font-size:19px}}
/* Local-only pilot photo; original image colors are preserved in all themes. */
.zgt-avatar{overflow:hidden}.zgt-avatar img{display:block;width:100%;height:100%;object-fit:cover}.zgt-avatar img[hidden],.zgt-avatar span[hidden],.profile-photo-preview img[hidden],.profile-photo-preview span[hidden]{display:none}
.profile-photo-field{display:flex;align-items:flex-start;gap:18px;padding-bottom:20px;margin-bottom:20px;border-bottom:1px solid var(--line);min-width:0}.profile-photo-preview{width:84px;height:84px;flex:none;display:grid;place-items:center;overflow:hidden;border:1px solid var(--line);border-radius:50%;background:var(--accent-soft);color:var(--accent);font-size:35px}.profile-photo-preview img{display:block;width:100%;height:100%;object-fit:cover}.profile-photo-controls{flex:1;min-width:0}.profile-photo-controls>label{display:block;font-size:12px;font-weight:700;margin:0 0 8px;color:var(--ink)}.profile-photo-controls input[type=file]{display:block;width:100%;max-width:100%;min-width:0;color:var(--muted);font-size:12px;background:transparent;border:0;padding:0}.profile-photo-controls input::file-selector-button{min-height:42px;margin-right:8px;padding:0 12px;border:1px solid var(--line);border-radius:7px;background:var(--surface);color:var(--ink);font:inherit;cursor:pointer}.profile-photo-controls .profile-clear{margin-top:10px}.profile-photo-controls .profile-status{margin-top:9px}.profile-save:disabled{opacity:.55;cursor:wait}
@media(max-width:420px){.profile-photo-field{gap:12px;flex-wrap:wrap}.profile-photo-preview{width:72px;height:72px}.profile-photo-controls{flex-basis:100%}}
/* The compact identity beside the logo applies only to My Profile. */
body.profile-mode .zgt-league-row{gap:18px}body.profile-mode .zgt-league-row>.zgt-profile-button{align-self:stretch;align-items:center;gap:12px}body.profile-mode .zgt-league-row .zgt-driver-meta{display:flex;flex-direction:column;gap:2px}body.profile-mode .zgt-league-row .zgt-driver-meta>span+span:before{content:none}body.profile-mode .zgt-league-row .zgt-identity{flex:1;min-width:0}body.profile-mode .zgt-league-row .zgt-identity>strong{overflow-wrap:anywhere}body.profile-mode .zgt-league-row .zgt-menu{margin-left:auto}body.profile-mode .zgt-driver-card{display:none}
@media(max-width:620px){body.profile-mode .zgt-league-row{gap:12px}body.profile-mode .zgt-league-row>.zgt-profile-button{gap:8px}body.profile-mode .zgt-league-row .zgt-avatar{width:36px;height:36px;font-size:18px}body.profile-mode .zgt-league-row .zgt-identity>strong{font-size:15px}body.profile-mode .zgt-league-row .zgt-driver-meta{font-size:11px}}
@media(max-width:360px){body.profile-mode .zgt-league-row{gap:8px}body.profile-mode .zgt-league-row .zgt-league-logo{height:38px}body.profile-mode .zgt-league-row>.zgt-profile-button{gap:6px}body.profile-mode .zgt-league-row .zgt-avatar{width:28px;height:28px;font-size:15px}body.profile-mode .zgt-league-row .zgt-identity>strong{font-size:13px}body.profile-mode .zgt-league-row .zgt-driver-meta{font-size:10px}}
