:root{--theme-background:#fdf4f8;--theme-surface:#fffdfe;--theme-text:#2c2428;--theme-muted:#6f5b63;--theme-accent:#f7cadd;--theme-sidebar:#fbe2ec;--theme-soft:#f7f4f5;--theme-accent-soft:#fef9fb;--theme-accent-text:#806973;--theme-on-accent:#000000;--theme-nav-text:#2c2428;--theme-border:#d5d2d3;--theme-success:#158049;--theme-warning:#a26000;--theme-danger:#c34343;--theme-chart-secondary:#a26000;--blue:var(--theme-accent);--line:var(--theme-border);--muted:var(--theme-muted);--nav:var(--theme-sidebar)}
@media(prefers-color-scheme:dark){:root{--theme-background:#1c161e;--theme-surface:#322632;--theme-text:#fefbfd;--theme-muted:#fdeff5;--theme-accent:#fadfeb;--theme-sidebar:#352735;--theme-soft:#3a2f3a;--theme-accent-soft:#423541;--theme-accent-text:#fadfeb;--theme-on-accent:#000000;--theme-nav-text:#fefbfd;--theme-border:#5b515b;--theme-success:#6ab08c;--theme-warning:#cb994f;--theme-danger:#e38989;--theme-chart-secondary:#cb994f;}}
html,body{background:var(--theme-background)!important;color:var(--theme-text)!important}body #app *,body #modal-root *{color:var(--theme-text)!important}#app .workspace,#app main,#app footer{background:var(--theme-background)!important}#app .panel,#app .metrics article,#app .dataset-card,#app .topbar,#app .auth,#app .auth-panel,#app .analysis-metrics,#modal-root .modal,#export-progress{background:var(--theme-surface)!important;border-color:var(--theme-border)!important}
#app :is(.muted,small,.eyebrow,.mini-label,.field,.section-heading>span,.pagination,.result-meta span,.result-meta small,.empty,.filter-note,.period-preview,.analysis-range,.scope-note,.compare-check,.record-detail dt,.chart-legend,.theme-color>span),#modal-root :is(small,.muted,.field,.record-detail dt){color:var(--theme-muted)!important}
#app :is(.metrics article>span,.metrics p,.concentration-grid span,.concentration-grid small,.mobile-filter-bar small,.analysis-table td::before,.data-panel td::before,.responsive-table td::before,.theme-preview .muted),#modal-root .compact-detail-table th{color:var(--theme-muted)!important}
#app :is(button,input,select,textarea),#modal-root :is(button,input,select,textarea),#export-progress button{background:var(--theme-surface)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}#app input::placeholder,#app textarea::placeholder,#modal-root input::placeholder,#modal-root textarea::placeholder{color:var(--theme-muted)!important;opacity:1}#app button:hover,#modal-root button:hover{background:var(--theme-soft)!important}#app button:disabled,#modal-root button:disabled{opacity:1!important;background:var(--theme-soft)!important;color:var(--theme-muted)!important}
#app :is(button.primary,.nav-item.active,.brand-mark,.mobile-filter-bar>.primary),#modal-root button.primary{background:var(--theme-accent)!important;color:var(--theme-on-accent)!important;border-color:var(--theme-accent)!important}#app :is(button.primary,.nav-item.active,.brand-mark) *,#modal-root button.primary *{color:var(--theme-on-accent)!important}#app .sidebar,#app .auth-brand,#app .official-nav-items{background:var(--theme-sidebar)!important;background-image:none!important}#app .sidebar *,#app .auth-brand *{color:var(--theme-nav-text)!important}#app .sidebar .nav-item,#app .sidebar button:hover{background:transparent!important}#app .sidebar .nav-item.active,#app .sidebar .nav-item.active *{background:var(--theme-accent)!important;color:var(--theme-on-accent)!important}#app .sidebar .brand-mark,#app .auth-brand .brand-mark{color:var(--theme-on-accent)!important}
#app :is(th,.pagination,.dataset-icon,.avatar,.badge,.period-shortcuts button,.intro-tags span,.analysis-tabs button.selected,.mobile-driver-switch button,.mobile-ai-actions button,.theme-preview,.theme-scheme-tabs .selected),#modal-root th{background:var(--theme-soft)!important;border-color:var(--theme-border)!important}#app tbody tr:hover,#modal-root tbody tr:hover{background:var(--theme-soft)!important}#app :is(th,td),#modal-root :is(th,td){border-color:var(--theme-border)!important}
#app :is(a,.text-button,.download-link,.analysis-tabs button.selected,.mobile-driver-switch button.selected,.theme-scheme-tabs .selected,.badge.blue,.dataset-icon,.avatar,.period-shortcuts button:hover){color:var(--theme-accent-text)!important}#app :is(.positive,.badge.green){color:var(--theme-success)!important}#app :is(.negative,.badge.red,.form-error,.error-text,.filter-error,button.danger),#modal-root :is(.form-error,button.danger){color:var(--theme-danger)!important}#app :is(.badge.orange,.live-label){color:var(--theme-warning)!important}#app button.danger.solid,#modal-root button.danger.solid{background:var(--theme-surface)!important;color:var(--theme-danger)!important;border-color:var(--theme-danger)!important}
#app .analysis-progress{background:var(--theme-accent-soft)!important;border-color:var(--theme-border)!important}#app .analysis-progress *{color:var(--theme-accent-text)!important}#app .analysis-progress button{color:var(--theme-text)!important}#app .markdown-body code,#app .theme-preview code{background:var(--theme-accent-soft)!important;color:var(--theme-accent-text)!important;border-color:var(--theme-border)!important}#app .markdown-body pre,#app .markdown-body blockquote{background:var(--theme-soft)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}#app .markdown-body pre code{background:transparent!important;color:var(--theme-text)!important}#app .gms-chart-tooltip,#app .gms-chart-tooltip *{background:var(--theme-surface)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}#toast,#toast.error{background:var(--theme-accent)!important;color:var(--theme-on-accent)!important}#export-progress,#export-progress *{color:var(--theme-text)!important}#app :is(input,select,textarea,button):focus-visible,#modal-root :is(input,select,textarea,button):focus-visible{outline:2px solid var(--theme-accent-text);outline-offset:2px;box-shadow:none}
.theme-color{display:grid;grid-template-columns:1fr 64px;align-items:center;gap:8px;padding:13px;border:1px solid var(--theme-border);border-radius:7px;font-size:13px;max-width:360px}.theme-color input[type=color]{width:64px;height:44px;min-height:44px;padding:2px;cursor:pointer;grid-column:2;grid-row:1/3}.theme-color code{font-size:12px;grid-column:1}.theme-preview{margin:16px 0;padding:16px;border:1px solid var(--theme-border);border-radius:7px}.theme-preview p{margin:10px 0}.theme-preview p:last-child{margin-bottom:0}#contrast-status{font-size:12px;line-height:1.7}.appearance-panel{max-width:600px}@media(max-width:760px){.theme-color{padding:10px;max-width:none}.theme-preview{padding:13px;margin:14px 0}.appearance-panel{padding:14px}}
.audit-description{white-space:normal;min-width:220px;line-height:1.7}@media(max-width:760px){.audit-description{min-width:0}}
.analysis-metrics .metric-mobile{display:none}@media(max-width:760px){.analysis-metrics .metric-mobile{display:block}.analysis-metrics .metric-desktop{display:none}}
#app button,#modal-root button{transition:none!important}#app .sidebar .nav-item.active:hover{background:var(--theme-accent)!important;color:var(--theme-on-accent)!important}#app .sidebar .nav-item.active span{background:transparent!important}
#app .sidebar .brand small,#app .auth-brand .brand small{color:var(--theme-nav-text)!important}

.cache-stamp{font-size:11px;margin:0 0 8px}.ai-actions{flex-wrap:wrap}

.theme-mode-switch{display:flex;align-items:center;gap:5px;white-space:nowrap;font-size:12px}
.theme-mode-switch select{width:100px;min-height:30px;padding:3px 6px;font-size:12px;cursor:pointer}
.theme-mode-field{max-width:360px;margin-top:15px}.theme-mode-field select{min-height:38px}
@media(max-width:760px){.theme-mode-switch{gap:3px;font-size:10px}.theme-mode-switch select{width:78px;min-height:28px;padding:3px;font-size:11px}.theme-mode-field{max-width:none}}
