:root{--surface:#fff;--surface-soft:#f4f7fb;--heading:#122f52;--accent:#ec0030;--body:#263d55;--subtle:#5f7289;--outline:#dce5ee}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;flex-shrink:0;min-height:38px;padding:8px 11px;border:1px solid var(--outline);border-radius:8px;background:var(--surface);color:var(--heading);font-size:13px;font-weight:600;cursor:pointer;white-space:nowrap}
.theme-toggle:hover{background:var(--surface-soft)}.theme-toggle:focus-visible{outline:3px solid #7398f9;outline-offset:3px}
html[data-theme=dark]{--navy:#e2ecff;--ink:#e5edf7;--muted:#a4b5c9;--blue:#8eacff;--line:#2b3b50;--red:#ff6986;--bg:#0d1520;--green:#58d4af;--surface:#152131;--surface-soft:#1a293b;--heading:#e2ecff;--accent:#ff6b86;--body:#d0dbe9;--subtle:#a2b4c9;--outline:#314158;background:#0d1520;color:#e5edf7}
html[data-theme=dark] body{background:#0d1520;color:#e5edf7}
html[data-theme=dark] :is(.sidebar,.topbar,.metric,.panel,.file-row,.search,.patient-header,.receipt,.feedback-form,dialog){background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme=dark] .brand img{background:#eff4fb;border-radius:50%;padding:3px}
html[data-theme=dark] :is(.nav a,.bottom-note,.patient-label,.eyebrow,.metric-value span){color:#a4b5c9}
html[data-theme=dark] .nav a:hover,html[data-theme=dark] tr.clickable:hover{background:#1d2d43}
html[data-theme=dark] .nav a.active{background:#223657;color:#a9c0ff}
html[data-theme=dark] :is(.avatar,.facility-icon,.source-icon,.demo,.pill.gray){background:#25364b;color:#bfcee2}
html[data-theme=dark] :is(th,.insight,.action-strip){background:#1a2a40;color:var(--ink);border-color:var(--line)}
html[data-theme=dark] th{color:#a6b8cc}
html[data-theme=dark] :is(td,.source-row,.profile,.timeline,.review-actions,.patient-steps,.review-list>div,.patient-disclaimer){border-color:var(--line)}
html[data-theme=dark] :is(.select,.button,.patient-form textarea){background:#19283b;color:var(--ink);border-color:#3a4c64}
html[data-theme=dark] .button:hover{background:#23364e}
html[data-theme=dark] .button.primary{background:#3c63ce;border-color:#3c63ce;color:#fff}
html[data-theme=dark] .button.primary:hover{background:#4b74e3}
html[data-theme=dark] .button.ghost{color:#a6bfff;background:transparent}
html[data-theme=dark] .button.dark{background:#294160;color:#f3f7fc;border-color:#365679}
html[data-theme=dark] .risk{color:#ff859a}
html[data-theme=dark] .pill.risk{background:#482633;color:#ffacbd}
html[data-theme=dark] .pill.green,html[data-theme=dark] .step-dot{background:#173e36;color:#7cdec0}
html[data-theme=dark] .pill.blue{background:#25365c;color:#b2c7ff}
html[data-theme=dark] .timeline-step:not(:last-child):after{background:#2a534c}
html[data-theme=dark] .compare-card.patient{background:#221e2d;border-color:#644052}
html[data-theme=dark] .callout{background:#33291c;border-color:#675338;color:#e4c38f}
html[data-theme=dark] :is(.search input,.patient-form textarea){color:var(--ink)}
html[data-theme=dark] .search input::placeholder{color:#97abc3}
html[data-theme=dark] .chart text{fill:#a4b5c9}
html[data-theme=dark] .chart line{stroke:#2c3e55}
html[data-theme=dark] .chart circle{fill:#152131}
html[data-theme=dark] .chart :is(path,circle)[stroke="#315de5"]{stroke:#8daeff}
html[data-theme=dark] .chart :is(path,circle)[stroke="#127e64"]{stroke:#67d7b4}
html[data-theme=dark] #toast{background:#2e4562;color:#f5f8fc}
html[data-theme=dark] :is(.patient-intro>p,.patient-aside>p,.patient-purpose,.patient-disclaimer,.visit-card>div>span,.review-list dt,.patient-success>p,.receipt>span,.upload-area>p){color:#a4b5c9}
html[data-theme=dark] .review-list dd{color:#e0e9f5}
html[data-theme=dark] :is(.visit-card,.patient-steps span,.upload-area){background:#1c2d42;border-color:#354b66;color:#dbe6f6}
html[data-theme=dark] .patient-steps .current{color:#b1c7ff}
html[data-theme=dark] .patient-steps .current span{background:#416ddc;color:#fff}
html[data-theme=dark] .patient-steps .complete span{background:#1c473c;color:#87e1c4}
html[data-theme=dark] :is(.privacy-note,.success-icon){background:#17382f;color:#b3e6d5}
html[data-theme=dark] .aside-icon{background:#482333;color:#ff91aa}
html[data-theme=dark] .patient-purpose svg{color:#a4bcec}
html[data-theme=dark] .upload-area>svg{color:#a4bcec}
.patient-header .header-actions{display:flex;align-items:center;gap:16px}
@media(max-width:650px){.topbar{height:auto;min-height:58px;gap:10px}.top-right{gap:9px}.top-right .avatar{display:none}.top-right .demo{display:none}.theme-toggle{font-size:12px;padding:8px}.patient-header{gap:12px}.patient-header .header-actions .demo{display:none}.patient-label{padding-left:10px;margin-left:0}.patient-header .brand{gap:7px}}
html[data-theme=dark] .sidebar-bottom .secure{color:#a4b5c9}.topbar{column-gap:18px}.top-left{flex-shrink:0}
