:root{color-scheme:light;--bg:#f5f7fa}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:40px;flex-shrink:0;padding:8px 11px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);font-size:12px;font-weight:600;white-space:nowrap}
.theme-toggle svg{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.theme-toggle .theme-moon{display:none}
.auth-theme{display:flex;justify-content:flex-end;margin-bottom:22px}
:root[data-theme="dark"]{color-scheme:dark;--bg:#111820;--surface:#1b2531;--ink:#ecf1f7;--muted:#a7b6c8;--line:#344253;--blue:#83b4ff;color:var(--ink);background:var(--bg)}
:root[data-theme="dark"] .theme-toggle .theme-sun{display:none}
:root[data-theme="dark"] .theme-toggle .theme-moon{display:block}
:root[data-theme="dark"] :is(.auth-shell,.auth-panel){background:var(--bg)}
:root[data-theme="dark"] :is(.sidebar,.topbar,.card,.admin-stat,dialog,.modal-head,.detail-tabs,.calendar-cell,.theme-toggle,.date-chip,.skip:focus){background:var(--surface);border-color:var(--line);color:var(--ink)}
:root[data-theme="dark"] .bottom-nav{background:#1b2531f2;border-color:var(--line)}
:root[data-theme="dark"] :is(.auth-story,.sidebar-note,.control-device,.tactic-rule,.segmented,.calendar-cell.outside,th,.recovery-code){background:#15202c}
:root[data-theme="dark"] :is(.brand,.auth-content h1,.auth-card h2,.party-banner h2,.device-copy b,.party-find-row b,.detail-list dd,.stat-value,.rank-points,.match-score strong,.live-empty h3,.score-value,.record-score,.admin-stat strong,td strong,td .opponent,.compare b,.chart-summary b,.shot-list li b,.shot-totals b,.match-row strong,.license-line strong){color:var(--ink)}
:root[data-theme="dark"] :is(.nav-link,.button.text,.icon-button,.topbar-actions,.topbar-name,.field,.control-status,.control-meta,.empty,.auth-feature,.auth-content>p,.calendar-cell,.audit-list,.map-legend,.h2h span,.shot-list,.shot-totals,.match-row,td){color:#c1cedd}
:root[data-theme="dark"] :is(.page-heading p,.card-head p,.team p,.live-meta,.live-score small,.hint,.empty p,.stat-label,.stat-foot,.chart-axis,.chart-summary span,.rank-number,.rank-name small,.mini-heading span,.account-copy span,.sidebar-note p,.nav-label,.eyebrow,.auth-copyright,.auth-card .subtext,.auth-switch,.auth-success p,.field small,.calendar-week span,.calendar-cell .day-results,.calendar-legend,.detail-list dt,.device-copy p,.party-banner p,.party-card p,.party-find-row p,.admin-stat span,.admin-user small,.dialog-lead p,.match-score>p,.compare>div:first-child,.timeline li span,.timeline li small,.shot-list li small,.observed-note,.pending-tag,.manual-label,.squad-table td small,.audit-list small,.maintenance-item p,.page-footer,.card-foot){color:var(--muted)}
:root[data-theme="dark"] :is(.field input,.field select,.field textarea,.filter-input){background:#111b26;border-color:#4b5d71;color:var(--ink)}
:root[data-theme="dark"] .field input::placeholder{color:#8e9eb2}
:root[data-theme="dark"] :is(.button,.button.outline){background:#273648;color:#e1eaf5;border-color:#4b5d71}
:root[data-theme="dark"] :is(.button:hover,.icon-button:hover,.nav-link:hover,.calendar-cell:hover:not(:disabled)){background:#30435a;color:#f3f7fc}
:root[data-theme="dark"] .button.primary{background:#83b4ff;color:#112945;border-color:#83b4ff;box-shadow:none}
:root[data-theme="dark"] .button.primary:hover{background:#a1c7ff;color:#112945}
:root[data-theme="dark"] .button.text{background:transparent;border-color:transparent;color:#a9ccff}
:root[data-theme="dark"] :is(.button.danger,.pill.bad,.result.L,.form-error){background:#432931;color:#ffb1ba}
:root[data-theme="dark"] :is(.pill,.result.D,.result,.shot-kind){background:#2a3849;color:#c3d0df}
:root[data-theme="dark"] :is(.pill.good,.success-icon){background:#193c31;color:#8ddbb5}
:root[data-theme="dark"] :is(.pill.warning,.notice.warning){background:#403621;border-color:#6c5a35;color:#f1d49a}
:root[data-theme="dark"] :is(.nav-link.active,.segmented button.active,.avatar,.party-icon,.device-symbol,.auth-feature i,.empty-icon,.standby-icon,.team-symbol,.self-pill,.rank-item.mine .rank-name:after,.result.W,.shot-kind.goal,.pair-code){background:#233c59;color:#a9ccff}
:root[data-theme="dark"] :is(.auth-content h1 em,.auth-switch button,.color-blue,.stat-value.blue,.command-status,.detail-tabs button.active,.rank-item:first-child .rank-number,.live-label){color:#9bc5ff}
:root[data-theme="dark"] .detail-tabs button{color:var(--muted)}
:root[data-theme="dark"] .detail-tabs button.active{border-color:#9bc5ff;color:#9bc5ff}
:root[data-theme="dark"] :is(.inline-notice,.notice){background:#1c3047;border-color:#365574;color:#bdd5f4}
:root[data-theme="dark"] .calendar-cell{border-color:var(--line)}
:root[data-theme="dark"] .calendar-cell.selected{background:#213c5b;box-shadow:inset 0 0 0 2px #83b4ff}
:root[data-theme="dark"] .calendar-cell .day-count{color:#bdd8ff}
:root[data-theme="dark"] .calendar-cell.today .day-number{background:#83b4ff;color:#112945}
:root[data-theme="dark"] :is(td,.rank-item,.timeline li,.shot-list li,.match-row,.audit-list li,.live-meta){border-color:var(--line)}
:root[data-theme="dark"] .compare-track{background:#42546a}
:root[data-theme="dark"] .compare-track.neutral{background:#273648}
:root[data-theme="dark"] .compare-track i{background:#83b4ff}
:root[data-theme="dark"] .pitch{background:#1c342b;border-color:#416752;color:#50705d}
:root[data-theme="dark"] .player-dot small{color:#b1d4be}
:root[data-theme="dark"] .chart-svg>path[stroke]{stroke:#344253}
:root[data-theme="dark"] .color-red,:root[data-theme="dark"] .form-error,:root[data-theme="dark"] .integration-result.error{color:#ffb1ba}
:root[data-theme="dark"] .integration-result.success{color:#8ddbb5}
:root[data-theme="dark"] #toast{background:#dae7f6;color:#172b43}
/* Tier treatments remain scoped to the live information card. */
:root[data-theme="dark"] .live-card{background:linear-gradient(110deg,#1b2531 58%,#23364f)}
:root[data-theme="dark"] .live-card .live-meta b{color:#bdd8ff}
:root[data-theme="dark"] .live-card.tier-elite{background:linear-gradient(110deg,#242a2f 55%,#403522);border-color:#827047}
:root[data-theme="dark"] .live-card.tier-elite .score-value{color:#f1d49a}
:root[data-theme="dark"] .live-card.tier-high{background:linear-gradient(110deg,#222936 55%,#353051);border-color:#70658f}
@media(max-width:760px){.theme-toggle{min-height:44px;padding:9px}.topbar .theme-toggle [data-theme-label]{display:none}.topbar-actions>.avatar{display:none}.auth-theme{margin-bottom:18px}.auth-mobile-brand{margin-bottom:28px}}
