:root { color-scheme: light; }
#back-to-cabinets { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; margin-bottom: 12px; border-radius: 9px; font-size: 14px; font-weight: 650; text-decoration: none; color: #155947; }
#back-to-cabinets[hidden] { display: none; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; padding: 10px; border: 1px solid var(--line, #dbe4de); border-radius: 10px; color: #155947; background: #fff; cursor: pointer; align-self: center; margin-left: auto; }
.theme-toggle svg { display: block; width: 23px; height: 23px; }
.theme-toggle:hover { background: #e5f1e9; }
.theme-toggle:focus-visible { outline: 3px solid #357dce; outline-offset: 3px; }
.bar-inner:has(.theme-toggle) #account { margin-left: 0; }
.topbar > .theme-toggle { margin-right: 9px; }
@media(max-width: 480px) { .bar-inner { gap: 8px; } .bar-inner > .brand { font-size: 14px; } .bar-inner #account button { padding-inline: 10px; } }
html[data-theme='dark'] {
  color-scheme: dark; color: #edf5ef; background: #101a16;
  --ink: #edf5ef; --paper: #18261f; --canvas: #101a16; --line: #35473d;
  --muted: #adbdB3; --green: #70d7a7; --red: #ff968b; --loss: #ff968b;
  --light: #243d30; --amber: #f3c779; --forest: #173f30; --forest-2: #295b44;
  --shadow: 0 8px 30px #00000026;
  --theme-panel: #18261f; --theme-inset: #223229;
}
html[data-theme='dark'] body { background: var(--canvas); color: var(--ink); }
html[data-theme='dark'] :is(.bar,.panel,.report-card,.series-card,.card,.modal,.team-name-dialog,.mobile-nav,.report-export-options) { background: var(--theme-panel); color: var(--ink); border-color: var(--line); }
html[data-theme='dark'] :is(.metric,.series-stat,.mini-card,.series-player-card,.report-breakdown .report-kpi,.player-stat-grid>div,.closure-report,.plot,.frozen-series-card) { background: var(--theme-inset); color: var(--ink); }
html[data-theme='dark'] .series-chart-card { background: var(--theme-inset); }
html[data-theme='dark'] .series-chart { background: var(--theme-inset); }
html[data-theme='dark'] .series-logo { background: transparent; border-color: transparent; }
html[data-theme='dark'] :is(input,select,textarea,.select,.input,.field input,.field select) { color: var(--ink); background: #101d17; border-color: var(--line); }
html[data-theme='dark'] input::placeholder,html[data-theme='dark'] textarea::placeholder { color: #90a69a; }
html[data-theme='dark'] :is(button,.button) { background: #285c45; color: #f0fff5; border-color: var(--line); }
html[data-theme='dark'] :is(.secondary,.button.secondary,.theme-toggle,.password-toggle,.button:not(.primary):not(.danger)) { background: var(--theme-panel); color: #9de5bd; }
html[data-theme='dark'] :is(.theme-toggle,.password-toggle):hover { background: #2a4233; }
html[data-theme='dark'] .password-toggle { background: transparent; border: 0; }
html[data-theme='dark'] :is(a,.text-button) { color: #9de5bd; }
html[data-theme='dark'] #back-to-cabinets { color: #9de5bd; }
html[data-theme='dark'] :is(.brand,.sidebar a) { color: inherit; }
html[data-theme='dark'] :is(.badge,.status,.pill,.series-status.badge-closed,.check-pill,.report-preset) { background: #243d30; color: #c0d8ca; }
html[data-theme='dark'] :is(.report-preset.active,.series-player-filter.active,.check-pill:has(input:checked),.workspace-nav .button:not(.secondary)) { background: #2b6349; color: #f0fff5; border-color: #4d9d73; }
html[data-theme='dark'] :is(.warn,#notice,.notice,.pill.warning,.pill.pending) { background: #3c3019; color: #ffdfa1; border-color: #695332; }
html[data-theme='dark'] :is(.button.danger,.cash-check.bad) { background: #422925; color: var(--red); border-color: #6b443d; }
html[data-theme='dark'] :is(.cash-check.ok,.finance-approvals.ok,.good,.pill.success) { background: #203d2e; color: var(--green); }
html[data-theme='dark'] :is(.up,.positive) { color: var(--green) !important; }
html[data-theme='dark'] :is(.down,.negative) { color: var(--loss) !important; }
html[data-theme='dark'] :is(.metric-sub,.report-note,.series-kpi-label,.muted,.small,label,summary) { color: var(--muted); }
html[data-theme='dark'] :is(.queue-item,td,.ledger-row,.closure-report) { border-color: var(--line); }
html[data-theme='dark'] .report-export-options a:hover { background: #2a4233; }
html[data-theme='dark'] .mobile-nav .nav-button.active { color: var(--green); }
html[data-theme='dark'] :is(.nav-button,.modal-close,.text-button) { background: transparent; }
html[data-theme='dark'] .nav-button.active { background: var(--forest-2); color: #fff; }
html[data-theme='dark'] .progress { background: var(--line); }
/* SVG charts retain positive/negative semantics, including inline legacy colours. */
html[data-theme='dark'] .series-chart-result { stroke: none; paint-order: normal; }
html[data-theme='dark'] :is(.report-chart-tip rect,.chart-hover-box) { fill: #192b21; stroke: #638371; }
html[data-theme='dark'] :is(.report-chart-tip text:not([fill]),.chart-hover-label,.chart-hover-value,.chart-label,.chart-axis-label,.series-chart-axis,.series-chart-label) { fill: var(--muted); }
html[data-theme='dark'] :is(.chart-grid,.series-chart-grid,.report-grid-line) { stroke: var(--line); }
html[data-theme='dark'] :is(.chart-zero,.report-grid-zero) { stroke: #718c7a; }
html[data-theme='dark'] :is([stroke='#19704f'],.series-chart-line.positive) { stroke: #70d7a7; }
html[data-theme='dark'] :is([stroke='#b44535'],.series-chart-line.negative) { stroke: #ff968b; }
html[data-theme='dark'] [stroke='#4b50a5'] { stroke: #b3adff; }
html[data-theme='dark'] :is([fill='#19704f'],.series-chart-dot.positive,.series-chart-result.positive,.chart-hover-value.positive,.chart-hover-dot.positive,[style*='fill:#19704f']) { fill: #70d7a7 !important; }
html[data-theme='dark'] :is([fill='#b44535'],.series-chart-dot.negative,.series-chart-result.negative,.chart-hover-value.negative,.chart-hover-dot.negative,[style*='fill:#b44535']) { fill: #ff968b !important; }
html[data-theme='dark'] [fill='#4b50a5'] { fill: #b3adff; }
html[data-theme='dark'] :is([style*='color: rgb(25, 112, 79)'],[style*='color:#19704f']) { color: #70d7a7 !important; }
html[data-theme='dark'] :is([style*='color: rgb(180, 69, 53)'],[style*='color:#b44535']) { color: #ff968b !important; }
html[data-theme='dark'] .report-legend-pure { color: #b3adff; }
@media print { .theme-toggle { display: none; } }
