/* Load LAST, after every component stylesheet. Missing/invalid theme and "dark"
 * keep the existing Carousel cascade verbatim. No fonts, SVGs, filters or assets
 * are replaced. Only the new theme picker is styled outside the light scopes.
 * UI palette text pairs are tested at >=4.5:1; control/focus edges at >=3:1.
 * Performance KPI colours belong to the server's data scale and remain intact.
 */
html[data-theme="light"] {
    --bg: #ffffff;
    --panel: #ffffff;
    --wash: #eaf0f4;
    --text: #1e2d36;
    --text-label: #374b56;
    --text-muted: #526570;
    --border: #7a8b95;
    --line: #d6dfe5;
    --theme-rail: #eaf0f4;
    --theme-accent: #166653;
    --theme-accent-hover: #10533f;
    --theme-accent-soft: #e4f2eb;
    --theme-accent-border: #608773;
}
html[data-theme="mist"] {
    --bg: #eff6f2;
    --panel: #fcfefc;
    --wash: #e3efe7;
    --text: #20372c;
    --text-label: #385344;
    --text-muted: #4f655a;
    --border: #748a7b;
    --line: #d0dfd5;
    --theme-rail: #e3efe7;
    --theme-accent: #146244;
    --theme-accent-hover: #104c36;
    --theme-accent-soft: #dceee2;
    --theme-accent-border: #5e826a;
}
html[data-theme="sand"] {
    --bg: #f7f3eb;
    --panel: #fffdf8;
    --wash: #f0e9dd;
    --text: #352c23;
    --text-label: #514335;
    --text-muted: #6b5e50;
    --border: #8e7e6d;
    --line: #e1d8ca;
    --theme-rail: #f0e9dd;
    --theme-accent: #7a4c22;
    --theme-accent-hover: #643c18;
    --theme-accent-soft: #f1e5d4;
    --theme-accent-border: #95734c;
}
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) {
    color-scheme: light;
    --bar-top: var(--panel);
    --bar-bottom: var(--panel);
    --nav-link: var(--text-label);
    --green: var(--theme-accent);
    --green-hover: var(--theme-accent-hover);
    --green-step: var(--theme-accent);
    --green-text: var(--theme-accent);
    --link: var(--theme-accent);
    --link-legacy: var(--theme-accent);
    --muted: var(--text-muted);
    --thead: var(--wash);
    --control-bg: var(--panel);
    --control-hover: var(--wash);
    --theme-picker-border: var(--border);
    --theme-on-accent: #ffffff;
    --theme-success: #166534;
    --theme-success-bg: #eaf5ed;
    --theme-success-border: #789e81;
    --theme-warning: #805000;
    --theme-warning-bg: #fff3d9;
    --theme-warning-border: #b58a3b;
    --danger: #b42332;
    --theme-danger-bg: #fff0f1;
    --theme-danger-border: #c36b76;
    --theme-info: #1c5c92;
    --theme-info-bg: #eaf3fc;
    --theme-info-border: #759ab9;
    --theme-special: #a0246d;
    --theme-shadow: 0 8px 28px rgb(24 38 31 / 14%);
    --theme-backdrop: rgb(25 35 30 / 35%);
}

/* taktora.css: shell, legacy components, positive/negative states. */
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .control-rail { background: var(--theme-rail); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.control-rail nav a:hover, .control-rail nav a.is-active, .usermenu-toggle .avatar, .lead-phone, .tag-chip) {
    background: var(--theme-accent-soft);
    color: var(--theme-accent);
    border-color: var(--theme-accent-border);
}
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .control-rail nav a.is-active { box-shadow: inset 3px 0 var(--theme-accent); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.login-brand small, .ico-ok, .call-dir.ok, .date-green) { color: var(--theme-success); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.ico-bad, .team-chip.is-blocked) { color: var(--danger); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.pen:hover, .modal-close, .modal-close:hover) { color: var(--link); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.btn, .tb-btn, .btn-dark, .pager .arrow) { border-color: var(--border); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.ui-new, .ui-legacy) .btn-primary {
    background: var(--theme-accent);
    border-color: var(--theme-accent);
    color: var(--theme-on-accent);
}
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.ui-new, .ui-legacy) .btn-primary:hover {
    background: var(--theme-accent-hover);
    border-color: var(--theme-accent-hover);
    color: var(--theme-on-accent);
}
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.ui-new, .ui-legacy) .btn-danger { color: var(--danger); border-color: var(--theme-danger-border); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .split .split-caret { border-left-color: var(--theme-on-accent); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .split .split-caret .caret { border-top-color: currentColor; }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .step.is-current .circle { color: var(--theme-on-accent); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.badge, .chip-green, .notice, .call-strip) {
    background: var(--theme-success-bg);
    color: var(--theme-success);
    border-color: var(--theme-success-border);
}
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .badge-off { background: var(--wash); color: var(--text-muted); border-color: var(--border); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .alert { background: var(--theme-info-bg); color: var(--theme-info); border-color: var(--theme-info-border); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.notice-warn, .alert-warn, .badge-draft) { background: var(--theme-warning-bg); color: var(--theme-warning); border-color: var(--theme-warning-border); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.notice-error, .alert-error, .badge-bad) { background: var(--theme-danger-bg); color: var(--danger); border-color: var(--theme-danger-border); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .notice strong { color: inherit; }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .notice a { color: inherit; text-decoration: underline; }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .switch { background: var(--border); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .switch.is-on { background: var(--theme-accent); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .switch::after { background: var(--theme-on-accent); box-shadow: none; }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.status-dot, .gray-dot, .softphone-status i) { background: var(--text-muted); box-shadow: none; }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.status-dot.is-on, .softphone-status[data-state="online"] i) { background: var(--theme-success); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.softphone-status[data-state="incall"] i, .tabs .tab .dot) { background: var(--theme-warning); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.softphone-status[data-state="error"] i, .softphone-status[data-state="nomic"] i) { background: var(--danger); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .team-presence::before { background: var(--text-muted); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .team-presence[data-state="available"]::before { background: var(--theme-success); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .team-presence[data-state="talking"]::before { background: var(--theme-info); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.team-presence[data-state="dialing"], .team-presence[data-state="wrapup"])::before { background: var(--theme-warning); }

/* controls.css + date-picker.css: portal popups inherit tokens from html. */
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(input, textarea)::placeholder { color: var(--text-muted); opacity: 1; }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(input, textarea, select):hover:not(:disabled):not([readonly]) { border-color: var(--text-muted); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(input, textarea, select):focus-visible {
    outline: 2px solid var(--theme-accent);
    outline-offset: 2px;
    border-color: var(--theme-accent);
    box-shadow: none;
}
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.ui-new, .ui-legacy) .btn:not(.btn-primary):not(:disabled):hover { background: var(--wash); border-color: var(--text-muted); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) body input:is([type="checkbox"], [type="radio"]):not([hidden]) { border-color: var(--border); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) body input:is([type="checkbox"], [type="radio"]):not([hidden]):checked,
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) body input[type="checkbox"]:not([hidden]):indeterminate { border-color: var(--theme-accent); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) body input[type="checkbox"]:not([hidden]):checked::after { border-color: var(--theme-on-accent); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) body input[type="checkbox"]:not([hidden]):indeterminate::after { background: var(--theme-on-accent); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) input[type="file"]::file-selector-button { background: var(--theme-accent-soft); color: var(--theme-accent); border-color: var(--theme-accent-border); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .tk-select-trigger:hover:not(:disabled) { background: var(--wash); border-color: var(--text-muted); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .tk-select-trigger[aria-expanded="true"] { border-color: var(--theme-accent); box-shadow: none; }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .tk-select-trigger[aria-invalid="true"] { border-color: var(--danger); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .tk-select-chevron { border-color: var(--text-muted); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .tk-select-popup { background: var(--panel); border-color: var(--border); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .tk-select-search:focus { border-color: var(--theme-accent); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .tk-select-options { scrollbar-color: var(--border) transparent; }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .tk-select-option.is-highlighted { background: var(--theme-accent-soft); color: var(--theme-accent); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.tk-date-popover, .reports) { color-scheme: light; }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .tk-date-grid .tk-date-button[aria-pressed="true"] { color: var(--theme-on-accent); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.dropdown-menu, .search-dropdown, .modal, .drawer, .tk-select-popup, .tk-date-popover, .tk-dialog, .transfer-dialog, .toast .notice) { box-shadow: var(--theme-shadow); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .tk-dialog { border-color: var(--border); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .tk-dialog-confirm { color: var(--theme-on-accent); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .tk-dialog::backdrop { background: var(--theme-backdrop); backdrop-filter: none; }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .overlay { background: var(--theme-backdrop); }

/* Attendance and audio controls live outside .ui-new / .ui-legacy as well. */
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.work-clock [data-work-toggle], .recording-player .recording-play) { background: var(--theme-accent-soft); border-color: var(--theme-accent-border); color: var(--theme-accent); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.work-clock [data-work-toggle]:hover:not(:disabled), .recording-player .recording-play:hover, .call-history .is-playing .recording-play) { background: var(--theme-accent-soft); border-color: var(--theme-accent); color: var(--theme-accent); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .work-clock[data-working="true"] [data-work-toggle] { background: var(--wash); color: var(--text); border-color: var(--border); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .work-clock [data-work-toggle]:disabled { background: var(--wash); color: var(--text-muted); border-color: var(--border); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .work-clock [data-work-state]::before { background: var(--theme-warning); box-shadow: none; }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .work-clock[data-working="true"] [data-work-state]::before { background: var(--theme-success); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .recording-player { background: var(--panel); border-color: var(--border); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .recording-player.is-playing { border-color: var(--theme-accent); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .recording-player :is(.recording-action, .recording-speed) { color: var(--text-muted); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .recording-player :is(.recording-action, .recording-speed):hover { background: var(--theme-accent-soft); color: var(--theme-accent); }
/* A hard stop depicts playback progress; this is not a decorative gradient. */
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .recording-range::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--theme-accent) var(--played, 0%), var(--border) var(--played, 0%)); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .recording-range::-moz-range-track { background: var(--border); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .recording-range::-webkit-slider-thumb { background: var(--theme-accent); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .recording-range::-moz-range-thumb { background: var(--theme-accent); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .history-meta span + span { border-color: var(--line); }

/* reports.css defines local tokens AND literal foregrounds/surfaces. */
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .reports {
    --report-panel: var(--panel);
    --report-line: var(--line);
    --report-muted: var(--text-muted);
    --report-mint: var(--theme-accent);
    color: var(--text);
}
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.reports-badge, .reports-note) { background: var(--theme-success-bg); color: var(--theme-success); border-color: var(--theme-success-border); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.reports-badge-warn, .reports-warning) { background: var(--theme-warning-bg); color: var(--theme-warning); border-color: var(--theme-warning-border); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .reports :is(input:not([type="checkbox"]):not([type="radio"]), select, .reports-multi) { background-color: var(--control-bg); color: var(--text); border-color: var(--border); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .reports input::placeholder { color: var(--text-muted); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .reports .reports-button { background: var(--wash); color: var(--text); border-color: var(--border); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .reports .reports-primary { background: var(--theme-accent); color: var(--theme-on-accent); border-color: var(--theme-accent); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .reports .reports-primary:hover:not(:disabled) { background: var(--theme-accent-hover); border-color: var(--theme-accent-hover); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .reports-disabled { color: var(--text-muted); border-color: var(--border); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.reports-report-switch a[aria-current], .reports-empty h2, .reports-empty h3) { color: var(--text); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.reports-table th, .reports-table tbody tr:hover, .reports-methodology ul) { background: var(--wash); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .reports-field-row.is-selected { background: var(--theme-accent-soft); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .reports-order-button { background: var(--panel); border-color: var(--border); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .report-bar meter { background: var(--line); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .report-bar meter::-webkit-meter-bar { background: var(--line); }

/* transfers.css, call-transfer.css. search.css already uses shared tokens;
 * its only literal is the shadow above. sheet-viewer.css keeps external content
 * white/light intentionally: the cross-origin document owns its formatting. */
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.transfer-notice, .transfer-dialog .transfer-message) { background: var(--theme-success-bg); color: var(--theme-success); border-color: var(--theme-success-border); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .transfer-dialog { border-color: var(--border); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .transfer-dialog [data-transfer-error] { color: var(--danger); }

/* earnings.css: solid surfaces, semantic badges and readable KPI figures. */
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.earnings-card, .earnings-panel) { background: var(--panel); border-color: var(--line); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.earnings-eyebrow, .earnings-pay .earnings-value) { color: var(--theme-accent); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.earnings-muted, .earnings-card p, .earnings-table th, .work-clock span) { color: var(--text-muted); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.earnings-card h2, .earnings-form label) { color: var(--text-label); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .earnings-pay { background: var(--theme-accent-soft); border-color: var(--theme-accent-border); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .earnings-table :is(th, td) { border-color: var(--line); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) :is(.earnings-badge, .earnings-help) { background: var(--theme-success-bg); color: var(--theme-success); border-color: var(--theme-success-border); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .earnings-badge.pending { background: var(--theme-warning-bg); color: var(--theme-warning); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .work-clock[data-working="true"] span { color: var(--theme-success); }
/* Same data scale, with discrete colour bands and no decorative gradient. */
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .earnings-scale { background: linear-gradient(to right, var(--danger) 0% 45%, var(--theme-warning) 45% 67%, var(--theme-success) 67% 94%, var(--theme-special) 94% 100%); }

/* Narrow exceptions for known inline colours. !important is ONLY used to beat
 * inline styles; no global [style] rewrite and no changes to runtime markup.
 * In particular, never override the performance KPI's server-computed colour:
 * it encodes the result, including intermediate values between scale anchors. */
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .hint[style*="color:#8e8e8e"] { color: var(--text-muted) !important; }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .sorter[style*="color:#54a4c7"] { color: var(--theme-accent) !important; }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) .alert[style*="background:#253c35"] { background: var(--theme-success-bg) !important; border-color: var(--theme-success-border) !important; color: var(--theme-success); }
html:is([data-theme="light"], [data-theme="mist"], [data-theme="sand"]) #softphone-enable-audio { background: var(--theme-accent-soft) !important; color: var(--theme-accent) !important; border-color: var(--theme-accent) !important; }

/* New theme picker, also available in unchanged dark Carousel. Local tokens
 * avoid adding any new dark global overrides. Native radios retain keyboard
 * selection, visible focus and a non-colour indication of the selected theme. */
.theme-trigger, .theme-popover {
    --picker-panel: var(--panel, #182328);
    --picker-text: var(--text, #e6f0ed);
    --picker-muted: var(--text-muted, #99aaae);
    --picker-border: var(--theme-picker-border, #687d7f);
    --picker-accent: var(--green, #8ee3bc);
    --picker-selected: var(--theme-accent-soft, #253c35);
    font: 14px/1.4 var(--font-new, system-ui, sans-serif);
    color: var(--picker-text);
}
button.theme-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 12px;
    background: var(--picker-panel);
    border: 1px solid var(--picker-border);
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
}
button.theme-trigger:hover, button.theme-trigger[aria-expanded="true"] { border-color: var(--picker-accent); }
button.theme-trigger:focus-visible { outline: 2px solid var(--picker-accent); outline-offset: 3px; }
.theme-popover {
    position: fixed;
    z-index: 10001;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px;
    background: var(--picker-panel);
    border: 1px solid var(--picker-border);
    border-radius: 12px;
    box-shadow: var(--theme-shadow, 0 8px 28px rgb(0 0 0 / 28%));
}
.theme-options { margin: 0; padding: 0; border: 0; min-width: 0; }
.theme-title { padding: 0 0 12px; font-size: 15px; font-weight: 600; }
.theme-option { display: flex; align-items: center; gap: 10px; padding: 12px 8px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; }
.theme-option + .theme-option { margin-top: 4px; }
.theme-option:hover { background: var(--wash); }
.theme-option:has(input:checked) { background: var(--picker-selected); border-color: var(--picker-accent); }
.theme-option:focus-within { outline: 2px solid var(--picker-accent); outline-offset: 2px; }
body .theme-popover .theme-option input[type="radio"] {
    appearance: auto;
    -webkit-appearance: radio;
    width: 17px;
    height: 17px;
    min-height: 17px;
    margin: 0;
    padding: 0;
    accent-color: var(--picker-accent);
    flex: none;
}
body .theme-popover .theme-option input[type="radio"]::after { display: none; }
.theme-caption { min-width: 0; }
.theme-caption strong, .theme-caption small { display: block; }
.theme-caption strong { font-size: 14px; font-weight: 600; }
.theme-caption small { color: var(--picker-muted); font-size: 12px; margin-top: 2px; }
.theme-hint { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--picker-border); color: var(--picker-muted); font-size: 12px; }
.theme-swatch { width: 30px; height: 30px; flex: none; border: 1px solid var(--swatch-ink); border-radius: 6px; background: var(--swatch-bg); position: relative; overflow: hidden; }
.theme-swatch::after { content: ""; position: absolute; inset: 6px; border-top: 3px solid var(--swatch-ink); border-bottom: 7px solid var(--swatch-accent); }
[data-theme-swatch="dark"] { --swatch-bg: #182328; --swatch-ink: #99aaae; --swatch-accent: #8ee3bc; }
[data-theme-swatch="light"] { --swatch-bg: #ffffff; --swatch-ink: #526570; --swatch-accent: #166653; }
[data-theme-swatch="mist"] { --swatch-bg: #e3efe7; --swatch-ink: #4f655a; --swatch-accent: #146244; }
[data-theme-swatch="sand"] { --swatch-bg: #f0e9dd; --swatch-ink: #6b5e50; --swatch-accent: #7a4c22; }
@media (pointer: coarse) { button.theme-trigger { min-height: 44px; } }
@media (forced-colors: active) {
    .theme-option:has(input:checked) { border-color: Highlight; }
    .theme-option:focus-within, button.theme-trigger:focus-visible { outline-color: Highlight; }
    .theme-swatch { display: none; }
}
