:root{--surface:#fff;--surface-soft:#f7f9fb;--surface-raised:#fff;--field-bg:#fff;--field-ink:#1a2735;--focus:#f2c14e}
.theme-toggle{display:inline-flex;align-items:center;gap:7px;min-height:36px;margin:0;padding:7px 10px;border:1px solid #ffffff38;border-radius:999px;background:#ffffff12;color:#fff;font-size:12px;font-weight:750;line-height:1;white-space:nowrap}.theme-toggle:hover{background:#ffffff20}.theme-toggle [data-theme-icon]{font-size:16px;line-height:1}
html[data-theme="dark"]{color-scheme:dark;--bg:#0d1721;--ink:#e7eef5;--muted:#a7b5c3;--line:#344657;--surface:#17232e;--surface-soft:#1c2a36;--surface-raised:#1d2b38;--field-bg:#101b25;--field-ink:#edf4fa;--rose:#de789b;--gold:#e0b96f;--ok:#57c7a1;--danger:#ff8191;--focus:#f4c867}
html[data-theme="dark"] body{background:var(--bg);color:var(--ink)}
html[data-theme="dark"] main :is(h1,h2,h3,h4,legend,dt,dd){color:var(--ink)}
html[data-theme="dark"] main a:not(.button-link):not(.hero-action){color:#9fcdf1}
html[data-theme="dark"] :is(input,textarea,select){border-color:#46596b;background:var(--field-bg);color:var(--field-ink)}
html[data-theme="dark"] :is(input,textarea)::placeholder{color:#81909e;opacity:1}
html[data-theme="dark"] select{color-scheme:dark}
html[data-theme="dark"] :is(.card,.panel,.login,.attendance-metrics>div,.attendance-row,.queue-card,.case-row,.document-batch,.document-batch-card,.finance-panel,.finance-metrics article,.finance-case,.budget-card,.ps-card,.ps-panel){border-color:var(--line);background:var(--surface);color:var(--ink);box-shadow:0 8px 24px #0004}
html[data-theme="dark"] :is(.profile-question,.clinical-profile-grid>div,.exam-clinical-card,.exam-picker,.exam-category,.check-card,.check-option,.medical-identity-card,.cfm-exam-picker,.cfm-job-card,.remote-report-preview,.document-body-preview,.recorder,.empty,.secondary-tools,.document-options label,.bundle-list>details,.catalog-list>details,.clinical-summary-list>div){border-color:var(--line);background:var(--surface-soft);color:var(--ink)}
html[data-theme="dark"] :is(.check-card,.check-option,.segmented-options span,.clinical-anchor-nav a,.choice-pill){border-color:var(--line);background:var(--surface-raised);color:var(--ink)}
html[data-theme="dark"] :is(.check-card:hover,.check-option:hover,.clinical-anchor-nav a:hover){border-color:#6d8aa4;background:#223442}
html[data-theme="dark"] :is(.check-card:has(input:checked),.check-option:has(input:checked),.segmented-options input:checked+span,.choice-pill:has(input:checked)){border-color:var(--rose);background:#482b39;color:#ffd9e6;box-shadow:0 0 0 2px #de789b22}
html[data-theme="dark"] :is(.check-card,.check-option) small{color:#aebdcb!important}html[data-theme="dark"] :is(.check-card,.check-option):has(input:checked) small{color:#f1c4d4!important}
html[data-theme="dark"] :is(.document-category>strong,.cfm-exam-picker>legend,.medication-row legend,.profile-question legend,.exam-picker>summary,.medical-identity-card,.document-batch-header>div>strong,.document-builder summary,.catalog-admin summary){color:#d8e9f7}
html[data-theme="dark"] .clinical-anchor-nav{background:var(--bg)}
html[data-theme="dark"] :is(.badge,.status-pill,.workflow-chip,.exam-selection-counter){border-color:var(--line);background:#243746;color:#d8e9f7}
html[data-theme="dark"] .exam-selection-counter.has-selection{background:#183f35;color:#8ee0c4}
html[data-theme="dark"] :is(.notice,.review-callout){border-left-color:#62a5c2;background:#18313e;color:#cfe8f2}
html[data-theme="dark"] .notice.warning{border-left-color:#d0a14a;background:#3b321f;color:#f4dda8}
html[data-theme="dark"] .notice.success{border-left-color:var(--ok);background:#17382f;color:#a7e2ce}
html[data-theme="dark"] :is(.policy-note,.badge.rose){background:#3a2630;color:#f1c8d6}
html[data-theme="dark"] :is(.medical-lock,.alert.error,.clinical-status-cancelled){background:#442630;color:#ffbbc7}
html[data-theme="dark"] :is(.alert.success,.attendance-chip,.live-pill,.status-reviewed,.clinical-status-completed){background:#193c33;color:#9be2c9}
html[data-theme="dark"] :is(.consent,.finance-definition){border-color:#6f5930;background:#3a301e;color:#f3dfb6}
html[data-theme="dark"] .consent-policy{background:#3d2929;color:#f5d6d6}
html[data-theme="dark"] :is(.arrival-time,.status-draft,.clinical-status-in_progress){background:#1d354c;color:#b8dcfa}
html[data-theme="dark"] .clinical-status-waiting{background:#40351f;color:#f1d296}
html[data-theme="dark"] :is(button,.button-link){background:#24577e;color:#fff}
html[data-theme="dark"] :is(button:hover,.button-link:hover){background:#2e6d9e}
html[data-theme="dark"] button.secondary{border:1px solid #506273;background:#273744;color:#e5edf4}
html[data-theme="dark"] header{background:#0a1d30}
html[data-theme="dark"] :is(.hero,.clinical-hero,.finance-hero,.ps-hero){box-shadow:0 16px 36px #0006}
html[data-theme="dark"] code{color:#d9e8f5}
html[data-theme="dark"] hr{border-color:var(--line)}
@media(max-width:640px){.theme-toggle{margin-left:auto}.theme-toggle [data-theme-label]{display:none}.theme-toggle{width:38px;justify-content:center;padding:7px}}
