:root{--surface:#fff;--soft:#f3f7f5;--accent:#158567;--accent-ink:#fff;--secondary:#5e726b}
:root[data-theme=dark]{color-scheme:dark;--bg:#10191e;--surface:#1b282f;--soft:#23343b;--ink:#e3eeef;--muted:#a9bac1;--secondary:#b0c3c5;--line:#35464e;--nav:#0c151a;--source-warning:#edb57f}
.theme-controls,.theme-controls label{display:flex;align-items:center;gap:8px}.theme-controls{flex-wrap:wrap;gap:12px;font-size:12px;color:var(--ink)}.theme-controls label{margin:0}.theme-controls select{font:inherit;border:1px solid var(--line);padding:6px;border-radius:5px;background:var(--surface);color:var(--ink)}.theme-controls input[type=color]{width:30px;height:28px;padding:2px;border:1px solid var(--line);border-radius:5px;background:var(--surface);cursor:pointer}
.actions{flex-wrap:wrap;justify-content:flex-end}.page-heading{gap:18px}
header,.panel,.stats article,.instrument-card,.button,.table-actions input,.field input{background:var(--surface);color:var(--ink);border-color:var(--line)}
.button.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.instrument-card.active{background:color-mix(in srgb,var(--accent) 12%,var(--surface));border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.nav.active{background:color-mix(in srgb,var(--accent) 28%,var(--nav));color:#fff}.nav.active:before,.indicator{background:var(--accent)}
.period-tabs .selected,.filterbar .selected{background:var(--accent);color:var(--accent-ink)}
.source-cards a,.textbutton:hover{color:var(--accent)}
dialog{background:var(--surface)!important;color:var(--ink)!important;border-color:var(--accent)!important}dialog::backdrop{background:#0008}
[data-theme=dark] :is(.rule-visual,.source-cards article,.data-info,.period-tabs,th,.badge.neutral,.tag,.counter,input[readonly],.alert-row.unread){background:var(--soft);color:var(--secondary)}
[data-theme=dark] :is(td,.section-note,.rule-item p,.rule-foot,.source-cards p,.source-cards span,.industry,.breadcrumb b,.page-heading p,.stats small,.stats article>div,.chart-footer,.chart-footer>span:first-child,.filterbar,.filterbar b,.table-footer,footer,.textbutton,.field small,.form-bottom span,.rule-visual span,.alert-row p,.alert-row time){color:var(--secondary)}
[data-theme=dark] :is(td,.rule-item,.chart-footer){border-color:var(--line)}
[data-theme=dark] td:first-child b{color:var(--ink)}
[data-theme=dark] :is(tbody tr:hover,tbody tr.row-selected){background:var(--soft)}
[data-theme=dark] .banner{background:#283425;border-color:#46553b;color:#d1d9b5}[data-theme=dark] .banner button{color:#d1d9b5}
[data-theme=dark] .error{background:#422825;color:#ffc4b7;border-color:#73443c}
[data-theme=dark] .chart svg [stroke="#eef2ef"]{stroke:var(--line)}
[data-theme=dark] .chart svg text[stroke="#fff"]{stroke:var(--surface)}
[data-theme=dark] .chart svg circle[fill="#fff"]{fill:var(--surface)}
[data-theme=dark] .chart svg text{fill:#b8c8cf}
[data-theme=dark] .green{color:#6ed5ae!important}[data-theme=dark] .down{color:#6ed5ae}[data-theme=dark] .up{color:#f48b87}
@media(max-width:980px){header{height:auto;min-height:76px;padding-top:12px;padding-bottom:12px;gap:12px;flex-wrap:wrap}.header-right{gap:12px;flex-wrap:wrap}.actions{justify-content:flex-start}}
@media(max-width:680px){.theme-controls{gap:8px}.theme-controls label{font-size:11px}.header-right .avatar{display:none}.page-heading .actions{gap:6px}.actions .button{padding:9px 10px}}
