.theme-picker{display:inline-flex;align-items:center;gap:7px;font-size:12px;white-space:nowrap;color:#536078}
.theme-picker select{font:inherit;min-height:36px;padding:6px 10px;border:1px solid #cbd3e1;border-radius:8px;background:#fff;color:#24334b;cursor:pointer}
.theme-picker select:focus-visible{outline:3px solid #7d91fa;outline-offset:3px}
main>header{gap:12px;flex-wrap:wrap;height:auto;min-height:72px;padding-top:12px;padding-bottom:12px}
.auth-panel-footer .theme-picker{display:flex;justify-content:center;margin-top:12px}
:root[data-theme=dark]{--surface:#141d2d;--raised:#1c283b;--line:#34435b;--text:#e6edf7;--muted:#afbed3;--accent:#b3bdff;color-scheme:dark}
html[data-theme=dark] body{background:#0c1320;color:var(--text)}
html[data-theme=dark] :is(.sidebar,header,.workspace,.card,.metric,.workspace-card,.workspace-metrics>div,.admin-stats>div,.user-table-card,.intake-card,.workflow-card,.pipeline-lead,.report-tile,.modal,.confirm-box,dialog,.deal-lead-bar,.deal-input-card,.deal-result-card,.deal-management,.deal-comps,.deal-empty,.article-search-card,.article-topic,.article-result,.article-reader,.auth-gate,.auth-panel){background:var(--surface);color:var(--text);border-color:var(--line)}
html[data-theme=dark] :is(input,select,textarea){background:var(--raised)!important;color:var(--text)!important;border-color:var(--line)!important;accent-color:#a4b2ff}
html[data-theme=dark] input::placeholder,html[data-theme=dark] textarea::placeholder{color:var(--muted);opacity:1}
html[data-theme=dark] :is(h1,h2,h3,h4,strong,b,label,td,.article-body,.crumb strong){color:var(--text)}
html[data-theme=dark] :is(p,small,th,dt,legend,.muted,.muted-text,.eyebrow,.workflow-muted,.workflow-message,.theme-picker,.article-attribution,.deal-footnote,.deal-heading p,.deal-lead-bar>span,.article-result span,.opportunity span,.workspace-metrics span,.contact small,.profile small,nav small){color:var(--muted)}
html[data-theme=dark] :is(td,th,fieldset,hr,.profile,.workspace-card-head,.table-toolbar,.workflow-table td,.workflow-table th,.opportunity,.deal-assignments p){border-color:var(--line)}
html[data-theme=dark] :is(nav button,.small-action,.cancel,.restore,.linkbtn,.article-back,.workflow-tabs button,.workflow-card button,.profile button,.checkout,.checkin){background:var(--raised);color:var(--accent);border-color:var(--line)}
html[data-theme=dark] :is(nav button.active,nav button:hover,.workflow-tabs button.active){background:#303d65;color:#e6eaff}
html[data-theme=dark] :is(.primary,.deal-button,.login-button,.feature-dialog button[type=submit]){background:#5864d8;color:white}
html[data-theme=dark] :is(.danger,.terminate){color:#ffb3bc}
html[data-theme=dark] .danger{background:#842c41}
html[data-theme=dark] :is(.form-error,.login-error,#deal-message.error,#connection-status.error){color:#ffb3bc!important}
html[data-theme=dark] :is(#connection-status:not(:empty),#deal-message:not(:empty)){background:#17392f;color:#9be4c8}
html[data-theme=dark] :is(#connection-status.error,#deal-message.error){background:#402334}
html[data-theme=dark] :is(.pipeline-column,.deal-hint,.deal-scenarios>div,.source,.restricted,.account-status.deactivated){background:var(--raised);color:var(--muted)}
html[data-theme=dark] :is(.account-status.active,.status.qualified,.online-pill){background:#153e33;color:#9be4c8}
html[data-theme=dark] :is(.status.new,.deal-badge,nav em){background:#303d65;color:#d3dbff}
html[data-theme=dark] :is(.status.contacted,.workflow-alert){background:#49351c;color:#f7d394}
html[data-theme=dark] .auth-story{background:radial-gradient(ellipse at 90% 20%,#172c4c,transparent 65%),#0e1728}
html[data-theme=dark] .auth-brand,html[data-theme=dark] .auth-story h2 span{color:#b3c5ff}
html[data-theme=dark] .auth-gate .login-card h1,html[data-theme=dark] .auth-story h2{color:var(--text)}
html[data-theme=dark] .auth-gate .login-card label{color:var(--muted)}
html[data-theme=dark] .auth-gate .login-card .login-error{color:#ffb3bc!important}
html[data-theme=dark] .auth-gate input:-webkit-autofill{-webkit-text-fill-color:var(--text);box-shadow:0 0 0 1000px var(--raised) inset}
html[data-theme=dark] .leaflet-popup-content-wrapper,html[data-theme=dark] .leaflet-popup-tip,html[data-theme=dark] .leaflet-bar a{background:var(--surface);color:var(--text)}
/* Keep geographic tiles and attribution unfiltered and readable. */
html[data-theme=dark] .leaflet-control-attribution{background:#ffffffed;color:#24334b}
html[data-theme=dark] a{color:#b3c5ff}
html[data-theme=dark] .leaflet-control-attribution a{color:#174c88}
html[data-theme=dark] :focus-visible{outline-color:#b3c5ff}
@media(max-width:640px){main>header{padding:12px 18px}.theme-picker{font-size:12px}.theme-picker select{min-height:44px}.auth-panel{padding-bottom:130px!important}}
