/* Theme controls are available before login and throughout portal navigation. */
.login-theme-toggle{position:fixed;right:22px;top:18px;z-index:40}
[data-theme-toggle] .icon{width:19px;height:19px;flex:none}
html[data-theme="dark"]{--blue:#79b4ff;--ink:#e8f0ff;--text:#afc0d8;--muted:#9cb0cb;--line:#334b6c;--green:#73d9b2;--glass:rgba(24,41,65,.86);color-scheme:dark}
html[data-theme="dark"] body{background:radial-gradient(ellipse at 78% 34%,#192e4b 4%,transparent 55%),linear-gradient(133deg,#101e32,#0c1626 58%,#142b47);background-attachment:fixed}
html[data-theme="dark"] body:before{opacity:.14}
html[data-theme="dark"] *{scrollbar-color:#4b668b #15243a}
html[data-theme="dark"] a:hover{color:#b6d6ff}
html[data-theme="dark"] :is(.sidebar,.portal-workspace,.login-page){background:#17283ec4;border-color:#354c69;box-shadow:0 18px 45px #0003,inset 0 1px #ffffff09}
html[data-theme="dark"] :is(.portal-header,.service-frame-head){background:#15273b91;border-color:#334861;color:#afc0d8}
html[data-theme="dark"] :is(.brand,.sidebar-account,.service-card,.stat-card,.settings-link,.search-result,.recent-letter){color:var(--ink)}
html[data-theme="dark"] :is(.brand small,.nav-label,.breadcrumb>span,.breadcrumb>.icon,.idea-box,.portal-footer,.portal-footer a,.section-label,.loading-line,.stat-label,.stat-card small,.recent-letter span span,.recent-letter small,.news-preview small,.field small,.news-card small,.request-meta,.settings-link small,.profile-card small,.search-result small,.login-visual>small,.login-form>.login-note){color:var(--text)}
html[data-theme="dark"] .side-nav a{color:#b6c7df}
html[data-theme="dark"] :is(.side-nav a:hover,.mobile-tabs a:hover){background:#254467;color:#d9eaff}
html[data-theme="dark"] :is(.side-nav a.active,.mobile-tabs a.active){background:#23476f;color:#b4d7ff;border-color:#486c95;box-shadow:0 4px 14px #0002}
html[data-theme="dark"] .side-separator{background:#344b67}
html[data-theme="dark"] :is(.sidebar-account,.recent-letter,.news-preview,.login-form>.login-note){border-color:#334a66}
html[data-theme="dark"] .avatar{background:linear-gradient(145deg,#31577f,#213c5d);border-color:#557496;color:#dcecff}
html[data-theme="dark"] :is(.icon-button,.search-bar){background:#15263cc9;border-color:#3c5270;color:#b7cae4}
html[data-theme="dark"] .icon-button:hover{background:#284668;color:#dfecff}
html[data-theme="dark"] .search-shortcut{background:#2b415e;color:#c0d0e6}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#91a6c2;opacity:1}
html[data-theme="dark"] :is(.panel,.document-card,.news-card,.request-card,.settings-link,.search-result,.stat-card,.service-card,.login-form){background:var(--glass);border-color:#354c6a;box-shadow:0 7px 24px #0002,inset 0 1px #ffffff06}
html[data-theme="dark"] :is(.stat-card:hover,.service-card:hover,.settings-link:hover,.search-result:hover){background:#243c5b;color:var(--ink)}
html[data-theme="dark"] .work-banner{background:linear-gradient(115deg,#243e60e6,#182d48e0);border-color:#3b577b;box-shadow:0 8px 24px #0002}
html[data-theme="dark"] .glass-orbit{border-color:#6196d92b;box-shadow:inset 6px 9px 14px #346dae22,6px 9px 25px #0002}
html[data-theme="dark"] .glass-orbit:after{border-color:#83b1ec1f;box-shadow:0 3px 8px #0002}
html[data-theme="dark"] .feature-icon{background:#204065b8;color:#8fc1ff;border-color:#3b6089}
html[data-theme="dark"] :is(.stat-symbol,.service-open){color:#8bbdff}
html[data-theme="dark"] .today-card{background:linear-gradient(140deg,#234875,#173555);border-color:#52739b;box-shadow:0 13px 25px #0003,inset 0 1px #ffffff0c}
html[data-theme="dark"] :is(.quick-links a,.notice,.profile-card,.login-services span){background:#1e3551b8;border-color:#3a5272;color:#bdd0e9}
html[data-theme="dark"] .field>span{color:#c4d6ef}
html[data-theme="dark"] :is(input:not(.search-bar input),select,textarea){background:#101f33;color:#e8f0ff;border-color:#415a7b;box-shadow:inset 0 1px 2px #0002}
html[data-theme="dark"] :is(input:not(.search-bar input):focus,select:focus,textarea:focus){background:#152b46;border-color:#82b8ff;box-shadow:0 0 0 3px #6caaff25}
html[data-theme="dark"] :is(input:disabled,select:disabled,textarea:disabled){background:#1a293c;color:#899fbc}
html[data-theme="dark"] .button{background:linear-gradient(145deg,#2477df,#195dbb);border-color:#5d9aea;color:#fff;box-shadow:0 5px 12px #0002}
html[data-theme="dark"] .button:hover{background:#2b78d8;color:#fff}
html[data-theme="dark"] .button.secondary{background:#213853;color:#c5defc;border-color:#486889;box-shadow:inset 0 1px #ffffff07}
html[data-theme="dark"] .button.secondary:hover{background:#2a496d}
html[data-theme="dark"] .button.green{background:#17694f;border-color:#419779;color:#e3fff3}
html[data-theme="dark"] .error{background:#462536;border-color:#92566b;color:#ffc1d0}
html[data-theme="dark"] .request-reply{background:#153e36;border-color:#32695c}
html[data-theme="dark"] .request-reply p{color:#b9e3d2}
html[data-theme="dark"] .status{background:#244971;color:#c3dfff}
html[data-theme="dark"] .status.closed{background:#1d4d3e;color:#a9e8cb}
html[data-theme="dark"] .service-frame{background:#112035}
html[data-theme="dark"] .mobile-tabs{background:#15273bec;border-color:#3c5575;box-shadow:0 -3px 25px #0004}
html[data-theme="dark"] .mobile-tabs a{color:#b6c9e2}
html[data-theme="dark"] .login-hero em{color:#87bdff}
html[data-theme="dark"] .skip-link{background:#192f4b;color:#e8f0ff}
html[data-theme="dark"] dialog{background:#172a42f5;border-color:#4b6485;color:var(--ink);box-shadow:0 25px 80px #0007}
html[data-theme="dark"] dialog::backdrop{background:#030a15aa}
html[data-theme="dark"] #portal-toast{background:#234a75;border-color:#6184ad;color:#edf5ff}
@media(max-width:760px){
  .header-actions{gap:5px}.header-actions>[data-theme-toggle]{width:32px;height:35px}
  .login-theme-toggle{right:20px;top:20px}
  html[data-theme="dark"] .sidebar{background:#14263ef7}
  html[data-theme="dark"] .frame-mode .portal-header{background:#172b43f2}
}
