/* Website palettes: shared variables cover every page, including dialogs and forms. */
html {
    --home-accent: #65d7bb;
    --home-strong: #e2ebf4;
    --home-soft: #101d28;
    --home-hover: #1b2b3b;
    --home-selected: #1a3438;
    --home-positive-bg: #153730;
    --home-positive-border: #28554a;
    --home-negative-bg: #3c242d;
    --home-negative-border: #62404b;
    --home-warning-bg: #292316;
    --home-warning-text: #ebc681;
    --home-warning-border: #8d6b32;
}
html[data-theme="ocean"] {
    --bg: #080f1d; --panel: #101e33; --panel-raised: #172943; --sidebar: #0b1629;
    --border: #2c405c; --text: #dce8fa; --muted: #97adc9; --teal: #77dbc2;
    --home-accent: #80b8ff; --home-strong: #e4efff; --home-soft: #0d192b;
    --home-hover: #1b304d; --home-selected: #223e60;
    --home-positive-bg: #193c37; --home-positive-border: #366158;
}
html[data-theme="graphite"] {
    --bg: #141414; --panel: #202020; --panel-raised: #2b2b2b; --sidebar: #191919;
    --border: #414141; --text: #e9e5dd; --muted: #b2aba0; --teal: #98d3b2;
    --home-accent: #e8c47b; --home-strong: #f7f0e3; --home-soft: #1a1a1a;
    --home-hover: #34312a; --home-selected: #443923;
    --home-positive-bg: #26372c; --home-positive-border: #47634f;
}
html[data-theme="ivory"] {
    color-scheme: light;
    --amber: #89600f;
    --teal: #147655; --red: #b93e52;
    --home-positive-bg: #e4f3eb; --home-positive-border: #a5d2b9;
    --home-negative-bg: #fce9ee; --home-negative-border: #dfadb7; --home-warning-bg: #fff3d5;
    --home-warning-text: #73500c; --home-warning-border: #c59639;
    --bg: #f5f0e7; --panel: #fffdf8; --panel-raised: #f8f3e9; --sidebar: #fcf8f0;
    --border: #ded2bf; --text: #43382c; --muted: #72624f;
    --home-accent: #895426; --home-strong: #49301c; --home-soft: #fbf6ed;
    --home-hover: #f3eada; --home-selected: #efdfc6;
}

.theme-picker {display:flex;align-items:center;justify-content:space-between;gap:18px;flex-wrap:wrap;padding:14px 17px;margin-bottom:20px;background:var(--panel);border:1px solid var(--border);border-radius:6px}
.theme-picker-title strong {display:block;font-size:12px;color:var(--text);font-weight:600}
.theme-picker-title>span {display:block;margin-top:3px;font-size:10px;color:var(--muted)}
.theme-picker-title b {font-weight:500;color:var(--home-accent)}
.theme-options {display:flex;gap:7px;flex-wrap:wrap}
.theme-options button {display:inline-flex;align-items:center;gap:7px;background:var(--home-soft);color:var(--muted);border:1px solid var(--border);border-radius:5px;padding:8px 10px;font-size:10px;min-height:34px}
.theme-options button:hover {background:var(--home-hover);color:var(--text)}
.theme-options button[aria-pressed="true"] {border-color:var(--home-accent);color:var(--home-accent);background:var(--home-selected)}
.theme-swatch {width:13px;height:13px;border:2px solid #ffffff88;border-radius:50%;flex-shrink:0}
[data-home-colour="ocean"] .theme-swatch {background:#80b8ff}
[data-home-colour="graphite"] .theme-swatch {background:#e8c47b}
[data-home-colour="ivory"] .theme-swatch {background:#efdfc6;border-color:#99764b}
html[data-theme] a {color:var(--home-accent)}
html[data-theme] :is(.brand,.skip-link) {color:var(--text)}
html[data-theme] :is(.brand-mark,.nav-item.active .nav-icon,.context-label,.research-note>span) {color:var(--home-accent)}
html[data-theme] .nav-item {color:var(--muted)}
html[data-theme] .nav-item.active {background:var(--home-selected);color:var(--home-accent)}
html[data-theme] .nav-item.active:before {background:var(--home-accent)}
html[data-theme] .nav-item:hover {background:var(--home-hover)}
html[data-theme] :is(.nav-icon,.nav-group,.breadcrumb,.breadcrumb span,.topbar-status,.avatar,.footer,.metric-card>span,.data-table th,.chart-axis text) {color:var(--muted);fill:var(--muted)}
html[data-theme] :is(.topbar,.data-table th,.workspace-label,.icon-button,.button.subtle,.comparison-grid>div) {background:var(--panel-raised);color:var(--text);border-color:var(--border)}
html[data-theme] :is(.brand small,.breadcrumb strong,.context-strip b,.data-table td,.data-table td strong,.symbol-name) {color:var(--text)}
html[data-theme] .data-table td .symbol-name {color:var(--home-strong)}
html[data-theme] :is(.context-strip,.economic-strip,.segmented,.inset .metric-card) {background:var(--home-soft);border-color:var(--border);color:var(--muted)}
html[data-theme] :is(.event-row,.economic-strip .net,.data-table td,.key-value) {border-color:var(--border)}
html[data-theme] .data-table tbody tr:hover td {background:var(--home-hover)}
html[data-theme] .badge.neutral {background:var(--panel-raised);border-color:var(--border);color:var(--muted)}
html[data-theme] :is(.badge.positive,.shock-value) {background:var(--home-positive-bg);border-color:var(--home-positive-border);color:var(--teal)}
html[data-theme] :is(.badge.warning,.demo-banner,.synthetic-indicator) {background:var(--home-warning-bg);border-color:var(--home-warning-border);color:var(--home-warning-text)}
html[data-theme] :is(.fixture-time,.fixture-time span,.notice strong,.notice span:not(.status-dot)) {color:var(--home-warning-text)}
html[data-theme] .reason {color:var(--teal)}
html[data-theme] .chart-grid path {stroke:var(--border)}
html[data-theme] :is(.button,.avatar) {border-color:var(--border)}
html[data-theme] .workspace-label .phase {color:var(--home-warning-text)}
html[data-theme] progress {background:var(--border)}
html[data-theme] progress::-webkit-progress-bar {background:var(--border)}
html[data-theme] :is(input,select) {background:var(--home-soft);color:var(--text);border-color:var(--border)}
html[data-theme] input::placeholder {color:var(--muted)}
html[data-theme] :is(.form-grid label,.check-list,.correlation-table th,.frame-timeline b,.data-table .reason-cell,.poor-performance p) {color:var(--muted)}
html[data-theme] :is(button,a,input,select):focus-visible {outline-color:var(--home-accent)}
html[data-theme] .button.primary {background:var(--home-accent);color:var(--bg);border-color:var(--home-accent)}
html[data-theme] .button.primary:hover {filter:brightness(1.12)}
html[data-theme] .button.subtle:hover {background:var(--home-hover)}
html[data-theme] .table-button {color:var(--home-accent)}
html[data-theme] .badge.negative {background:var(--home-negative-bg);border-color:var(--home-negative-border);color:var(--red)}
html[data-theme] .notice {background:var(--home-warning-bg);border-color:var(--home-warning-border)}
html[data-theme] :is(.segmented button.selected,.frame-timeline .current) {background:var(--home-selected);color:var(--home-accent)}
html[data-theme] .frame-timeline .current b {color:var(--home-accent)}
html[data-theme] .poor-performance {border-color:var(--home-negative-border)}
html[data-theme] dialog {background:var(--panel);border-color:var(--border);color:var(--text)}
html[data-theme] #detail-content pre {color:var(--text)}
html[data-theme] .toast {background:var(--home-positive-bg);border-color:var(--home-positive-border);color:var(--teal)}
html[data-theme] .table-scroll {scrollbar-color:var(--border) var(--panel)}
html[data-theme="ivory"] .button.primary {color:var(--panel)}
html[data-theme="ivory"] .corr-cell.diagonal {background:var(--panel-raised);color:var(--muted)}
html[data-theme="ivory"] .corr-strong-positive {background:#c9e6d6;color:#205c42}
html[data-theme="ivory"] .corr-positive {background:#e4f1e9;color:#32664e}
html[data-theme="ivory"] .corr-strong-negative {background:#f1cdd6;color:#7d2c40}
html[data-theme="ivory"] .corr-negative {background:#fae7ec;color:#874155}
@media(max-width:800px) {.theme-options {width:100%}.theme-options button {flex:1 1 130px;justify-content:center}.theme-picker {padding:14px}}
