:root{color-scheme:light;--app-bg:#f7f8fa;--app-panel:#fff;--app-input:#fff;--app-soft:#f1f4f7;--app-text:#263647;--app-muted:#697a8b;--app-line:#e1e6ec;--app-accent:#4279c3;--app-on-accent:#fff}
:root[data-theme=dark]{color-scheme:dark;--app-bg:#15171a;--app-panel:#202328;--app-input:#191d22;--app-soft:#292e36;--app-text:#e0e6ed;--app-muted:#a1aebd;--app-line:#373e48;--app-accent:#8abaff;--app-on-accent:#152139;--line:var(--app-line);--soft:var(--app-soft);--muted:var(--app-muted);background:var(--app-bg);color:var(--app-text)}
body:not(.translator-page):not(.speech-page){--tr-bg:var(--app-bg);--tr-panel:var(--app-panel);--tr-text:var(--app-text);--tr-muted:var(--app-muted);--tr-line:var(--app-line);--tr-soft:var(--app-soft);--tr-accent:var(--app-accent)}
html[data-theme=dark] body:not(.translator-page):not(.speech-page){background:var(--app-bg);color:var(--app-text)}
html[data-theme=dark] :is(.control-panel,.model-card,.evaluation-panel,.history-stats>div,.tooltip,dialog){background-color:var(--app-panel);border-color:var(--app-line);color:var(--app-text)}
html[data-theme=dark] :is(.control-top,.control-main,.control-bottom,.transcript-section,.card-heading,.metrics,.card-footer,.access-user,.history-provider details,footer){border-color:var(--app-line)}
html[data-theme=dark] :is(.control-bottom,.transcript-section.source-section,.speaker-tools,.history-table th,.segmented,dialog pre,code){background-color:var(--app-soft);color:var(--app-muted);border-color:var(--app-line)}
html[data-theme=dark] :is(.history-table td,.history-table th){border-color:var(--app-line)}
html[data-theme=dark] :is(.history-table small,.history-table time,.history-pagination,.intro p,.auth-gate>p,.device-menu-note,.user-duration-group legend,.history-reason summary,.reference-grid label,.input-control label,.text-button,.copy-button,.model-name,.speaker-guide,.transcript-section h4,.provider-info h3,.cost-provider-list p){color:var(--app-muted)}
html[data-theme=dark] :is(input:not([type=checkbox]):not([type=radio]):not([type=range]),textarea,select,.reading-mode-label select,.speaker-tools select,.language-selectors select,.history-filters input){background-color:var(--app-input);color:var(--app-text);border-color:var(--app-line)}
html[data-theme=dark] :is(input,textarea)::placeholder{color:#8694a5}
html[data-theme=dark] :is(.secondary,.icon-button,.sample-chip,.settings-trigger){background-color:var(--app-panel);color:var(--app-text);border-color:var(--app-line)}
html[data-theme=dark] :is(.secondary,.sample-chip,.icon-button,.settings-trigger):hover{background-color:var(--app-soft)}
html[data-theme=dark] .button.primary{background:#337953;color:#fff}
html[data-theme=dark] .button.primary:hover{background:#3c8c62}
html[data-theme=dark] :is(.state-pill,.card-status){background:#303740;color:#bcc7d4;border-color:var(--app-line)}
html[data-theme=dark] :is(.state-pill.live,.card-status.ready,.card-status.done){background:#253c30;color:#b7dfbc}
html[data-theme=dark] :is(.card-status.error,.stop,.service-control,.notice.error,.microphone-toast){background:#48232c;color:#ffdce2;border-color:#995061}
html[data-theme=dark] :is(.service-control p,.service-control small){color:#efbbc4}
html[data-theme=dark] :is(.card-status.draining,.card-status.connecting){background:#3c3423;color:#dfc993}
html[data-theme=dark] .notice{background:#343125;border-color:#635b3b;color:#e1d6a4}
html[data-theme=dark] .notice.demo{background:#22334b;border-color:#3a5579;color:#bfd7f5}
html[data-theme=dark] :is(.partial,.utterance-text .partial){background:#293b31;color:#b9d5bf}
html[data-theme=dark] :is(.diff-reference,.diff-block ins){background:#25402d;color:#b7dfb9}
html[data-theme=dark] :is(.diff-error,.diff-block del){background:#47282a;color:#f0b4ab}
html[data-theme=dark] .model-card{--accent-soft:#3c2e23}
html[data-theme=dark] .model-card.openai{--accent-soft:#273d30}
html[data-theme=dark] .model-card.gemini{--accent-soft:#29324a}
html[data-theme=dark] .segmented button.selected{background:var(--app-panel);color:var(--app-text)}
html[data-theme=dark] .auth-gate{color:var(--app-text)}
html[data-theme=dark] .auth-gate h1.selah-auth-brand{color:var(--app-text)}
html[data-theme=dark] .auth-gate:is(.auth-checking,.selah-sign-in) h1.selah-auth-brand{-webkit-text-fill-color:transparent}
html[data-theme=dark] #playground-settings{--menu-hover:var(--app-soft)}
/* Retain compact transparent selects inside all settings menus. */
html[data-theme=dark] .settings-menu .settings-row select{background-color:transparent;color:var(--app-muted);border:0}
.theme-toggle-row{position:relative}
.theme-toggle-row input{position:absolute;right:15px;width:32px;height:22px;opacity:0;margin:0;cursor:pointer}
.theme-switch{margin-left:auto;width:30px;height:18px;flex:none;border-radius:20px;background:var(--app-line);position:relative;pointer-events:none}
.theme-switch::after{content:'';position:absolute;left:3px;top:3px;width:12px;height:12px;border-radius:50%;background:#fff;transition:transform .15s}
.theme-toggle-row input:checked+.theme-switch{background:var(--app-accent)}
.theme-toggle-row input:checked+.theme-switch::after{transform:translateX(12px)}
.theme-toggle-row:has(input:focus-visible){outline:2px solid var(--app-accent);outline-offset:-2px}
/* Audience/OBS output must retain its transparent canvas. */
html:has(.speech-page[data-output=overlay]){background:transparent!important}

html[data-theme=dark] #users-query{background-color:var(--app-input);color:var(--app-text);border-color:var(--app-line)}
/* Selah media and shared chrome use the same persistent palette. */
html[data-theme=dark] :is(.video-module,.video-dialog,.output-panel,.video-button,.dialog-close,.app-settings){background:var(--app-panel);color:var(--app-text);border-color:var(--app-line)}
html[data-theme=dark] :is(.output-heading,.output-cost,.job-metadata>div,.video-tabs,.history-row,.file-panel,.result-toolbar,.cloning-record){border-color:var(--app-line)}
html[data-theme=dark] :is(.muted,.file-formats,.job-metadata dt,.cost-details summary,.navigation-status){color:var(--app-muted)}
html[data-theme=dark] .video-button.primary{background:var(--app-accent);color:var(--app-on-accent)}
html[data-theme=dark] :is(.app-notice,.app-error-toast){background:#48232c;color:#ffdce2;border-color:#995061}
html[data-theme=dark] :is(.video-module pre,.speaker-example,.video-dialog pre){background:var(--app-input);color:var(--app-text)}
.theme-menu-toggle{display:flex;align-items:center;justify-content:space-between;width:100%;border:0;border-radius:8px;padding:10px 12px;background:transparent;color:inherit;text-align:left;font:inherit;cursor:pointer}
.theme-menu-toggle::after{content:'';width:28px;height:17px;background:var(--app-line);border-radius:12px;box-shadow:inset 12px 0 0 2px var(--app-muted)}
.theme-menu-toggle[aria-pressed=true]::after{background:var(--app-accent);box-shadow:inset -12px 0 0 2px var(--app-on-accent)}
.theme-menu-toggle:hover{background:var(--app-soft)}
html[data-theme=dark] :is(.field-label,.file-control>span,.progress-area,.speaker-voices>div,.history-row dt){color:var(--app-muted)}
html[data-theme=dark] :is(.followup-record,.cost-details){border-color:var(--app-line)}
html[data-theme=dark] .file-panel.dragging{background:#23334a;outline-color:var(--app-accent)}
/* Match the header language chevron: 6px arms and a 1.5px stroke. */
select{appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m2 4 4 4 4-4' fill='none' stroke='%23748091' stroke-opacity='.7' stroke-width='1.5'/%3E%3C/svg%3E")!important;background-repeat:no-repeat!important;background-position:right 10px center!important;background-size:12px 12px!important;padding-right:32px!important}

html[data-theme=dark] .video-tabs button[aria-selected=true]{background:transparent;color:#fff;font-weight:700;border-bottom-color:#fff}
