
:root{
  --theme-bg:#ffffff;
  --theme-surface:#ffffff;
  --theme-surface-soft:#f7f9fa;
  --theme-surface-raised:#fbfcfd;
  --theme-text:#16212b;
  --theme-muted:#5c6973;
  --theme-line:#dce3e8;
}
html[data-theme="dark"]{
  --theme-bg:#0f1821;
  --theme-surface:#16212c;
  --theme-surface-soft:#131e28;
  --theme-surface-raised:#1a2632;
  --theme-text:#e8edf1;
  --theme-muted:#aeb9c3;
  --theme-line:#334250;
  color-scheme:dark;
}
html[data-theme="light"]{color-scheme:light}
html[data-theme="dark"] body{background:#0f1821;color:#e8edf1}
html[data-theme="dark"] a{color:#78b7e3}
html[data-theme="dark"] a:hover{color:#a6d0ee}
html[data-theme="dark"] .statebar{background:#121c25;border-bottom-color:#2c3a46;color:#c8d1d8}
html[data-theme="dark"] .statebar a{color:#a9cce5}
html[data-theme="dark"] .dot{box-shadow:0 0 0 4px rgba(210,157,54,.12)}
html[data-theme="dark"] .header{background:#141f29;border-bottom-color:#2d3a46}
html[data-theme="dark"] .brand{color:#edf2f5}
html[data-theme="dark"] .brand b span{color:#d58a93}
html[data-theme="dark"] .brand small{color:#aeb9c3}
html[data-theme="dark"] .brand img{border-color:#4a5965}
html[data-theme="dark"] .searchtop{border-color:#536474;background:#101a23}
html[data-theme="dark"] .searchtop input{background:#101a23;color:#e8edf1}
html[data-theme="dark"] .searchtop input::placeholder{color:#8f9da8}
html[data-theme="dark"] .searchtop button{background:#1b2833;border-left-color:#354553;color:#bcd6e8}
html[data-theme="dark"] .navwrap{background:rgba(8,30,48,.97)}
html[data-theme="dark"] .mega{background:#15212b;box-shadow:0 24px 70px rgba(0,0,0,.38)}
html[data-theme="dark"] .megagrid h3{color:#98a8b4}
html[data-theme="dark"] .megagrid a{color:#d3dee5}
html[data-theme="dark"] .crumb,html[data-theme="dark"] .route-title{color:#93a2ae}
html[data-theme="dark"] .hero h1,html[data-theme="dark"] .section h2,html[data-theme="dark"] h1,html[data-theme="dark"] h2,html[data-theme="dark"] h3,html[data-theme="dark"] h4{color:#edf1f4}
html[data-theme="dark"] .lead,html[data-theme="dark"] .section>.intro{color:#b7c2ca}
html[data-theme="dark"] .eyebrow{background:#291d22;border-color:#583640;color:#e5a7ae}
html[data-theme="dark"] .eyebrow:before{background:#d98590}
html[data-theme="dark"] .media,html[data-theme="dark"] .image{border-color:#3a4854;box-shadow:0 22px 58px rgba(0,0,0,.25)}
html[data-theme="dark"] .btn.alt{background:#1a2631;border-color:#526676;color:#dfeaf1!important}
html[data-theme="dark"] .meta{background:#334250;border-color:#334250}
html[data-theme="dark"] .meta>div{background:#17232e}
html[data-theme="dark"] .meta span{color:#9aa9b4}
html[data-theme="dark"] .card{border-color:#334250;background:linear-gradient(#17232e,#141f29);box-shadow:0 1px 2px rgba(0,0,0,.2)}
html[data-theme="dark"] .card:hover{box-shadow:0 16px 40px rgba(0,0,0,.28)}
html[data-theme="dark"] .card p,html[data-theme="dark"] .stat p,html[data-theme="dark"] .event p,html[data-theme="dark"] .image figcaption{color:#aeb9c3}
html[data-theme="dark"] .ico{background:#172b39;color:#84bfe8}
html[data-theme="dark"] .notice{background:#162935;border-color:#334d5e}
html[data-theme="dark"] .notice.warn{background:#2a2417;border-color:#5e4d25}
html[data-theme="dark"] .notice.danger{background:#2b1c21;border-color:#5e343b}
html[data-theme="dark"] .notice p{color:#b4c0c8}
html[data-theme="dark"] .tablewrap,html[data-theme="dark"] .stat,html[data-theme="dark"] .empty,html[data-theme="dark"] .page-search{border-color:#334250}
html[data-theme="dark"] .table th{background:#17232e;color:#9eacb7}
html[data-theme="dark"] .table td{border-bottom-color:#2c3a46}
html[data-theme="dark"] .chip{background:#24313c;color:#bdc7ce}
html[data-theme="dark"] .chip.warn{background:#332b18;color:#e6c56f}
html[data-theme="dark"] .chip.info{background:#172b39;color:#86c3eb}
html[data-theme="dark"] .chip.ok{background:#172a22;color:#84caa5}
html[data-theme="dark"] .empty{background:#141f29;color:#aab6bf}
html[data-theme="dark"] .timeline:before{background:#3b4a57}
html[data-theme="dark"] .event:before{background:#0f1821;border-color:#cf747f}
html[data-theme="dark"] .event b{color:#d58a93}
html[data-theme="dark"] .quote{color:#ccd5dc;border-left-color:#b95f6b}
html[data-theme="dark"] .footpre{background:#171d22;border-top-color:#313b43}
html[data-theme="dark"] .footer{background:#09243b}
html[data-theme="dark"] .sub{background:#071a2b}
html[data-theme="dark"] .search-dialog,html[data-theme="dark"] dialog{background:#16212c;color:#e8edf1}
html[data-theme="dark"] .dialog-head{border-bottom-color:#334250}
html[data-theme="dark"] .dialog-close{background:#25323d;color:#dce5eb}
html[data-theme="dark"] .dialog-search input{background:#101a23;color:#e8edf1;border-color:#526270}
html[data-theme="dark"] .dialog-result{border-top-color:#2e3d49}
html[data-theme="dark"] .dialog-result small{color:#9facb6}
html[data-theme="dark"] .preview-warning{background:#292317;border-bottom-color:#5b4c27;color:#e2d3a9}
html[data-theme="dark"] .preview-warning strong{color:#efcf7b}
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea{background:#101a23;color:#e8edf1;border-color:#526270}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#8897a3}
html[data-theme="dark"] code:not(.code){color:#d7e5ee}
html[data-theme="dark"] hr{border-color:#334250}
html[data-theme="dark"] ::selection{background:#315a78;color:#fff}

/* Institutional theme switcher */
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.theme-toggle{width:40px;height:40px;min-width:40px;border-radius:999px;border:1px solid #c8d2d9;background:#f7f9fa;color:#173d5b;display:grid;place-items:center;padding:0;position:relative;box-shadow:0 1px 2px rgba(8,34,56,.06);transition:background-color .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease,transform .16s ease}
.theme-toggle:hover{background:#eef3f6;border-color:#9fb0bd;box-shadow:0 5px 16px rgba(8,34,56,.1);transform:translateY(-1px)}
.theme-toggle:active{transform:translateY(0)}
.theme-toggle .theme-icon{position:absolute;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;transition:opacity .16s ease,transform .16s ease}
.theme-toggle .theme-icon-moon{fill:currentColor;stroke:none;opacity:1;transform:scale(1) rotate(0deg)}
.theme-toggle .theme-icon-sun{opacity:0;transform:scale(.72) rotate(-25deg)}
html[data-theme="dark"] .theme-toggle{background:#1d2a35;border-color:#405362;color:#e2c882;box-shadow:0 1px 2px rgba(0,0,0,.24)}
html[data-theme="dark"] .theme-toggle:hover{background:#24333f;border-color:#5a7182;box-shadow:0 6px 18px rgba(0,0,0,.28)}
html[data-theme="dark"] .theme-toggle .theme-icon-moon{opacity:0;transform:scale(.72) rotate(25deg)}
html[data-theme="dark"] .theme-toggle .theme-icon-sun{opacity:1;transform:scale(1) rotate(0deg)}
@media(max-width:800px){.header-in{gap:12px}.theme-toggle{width:38px;height:38px;min-width:38px}}
@media(max-width:520px){.header-in{gap:8px;padding-left:16px;padding-right:16px}.theme-toggle{width:36px;height:36px;min-width:36px}.theme-toggle .theme-icon{width:16px;height:16px}}
@media(prefers-reduced-motion:reduce){.theme-toggle,.theme-toggle .theme-icon{transition:none!important}}
@media print{.theme-toggle{display:none!important}html[data-theme="dark"] body{background:#fff!important;color:#111!important}}
