.theme-menu{position:relative;display:inline-block;margin-left:auto;font:14px/1.5 system-ui,sans-serif;flex-shrink:0;z-index:30}.theme-menu>summary{cursor:pointer;padding:8px 12px;border:1px solid #a9bdcc;border-radius:7px;list-style:none;background:#fff;color:#173047}.theme-choice{display:grid!important;gap:6px;min-width:180px;margin:0!important;font:14px/1.5 system-ui,sans-serif!important;color:inherit}.theme-choice select{width:100%;padding:8px;border:1px solid #a9bdcc;border-radius:6px;background:#fff;color:#173047;font:inherit}.theme-menu>.theme-choice{position:absolute;right:0;top:100%;padding:14px;background:#fff;color:#173047;border:1px solid #a9bdcc;border-radius:8px;box-shadow:0 8px 24px #0003}.theme-menu:not([open])>.theme-choice{display:none!important}.theme-floating{position:fixed;right:16px;bottom:16px}.theme-floating>.theme-choice{top:auto;bottom:100%}.account-menu .theme-choice{padding:8px 4px}.account-menu>div{min-width:220px}
html[data-theme=dark]{color-scheme:dark;--ink:#e4edf5;--muted:#b2c2d0;--line:#3b4f60;--green:#67d7c3;background:#101a25;color:#e4edf5}
html[data-theme=dark] body{background:#101a25;color:#e4edf5}
html[data-theme=dark] :is(.card,.stat,.profile-card,.incident-card,.panel,.suggestion,.commit-row,.auth-form,.auth-box,.topbar,.account-menu>div,.theme-menu>.theme-choice,.theme-menu>summary,.logo-card,dialog){background:#1b2b3a;color:#e4edf5;border-color:#3b4f60}
html[data-theme=dark] :is(main>section,.legal section,.ops-content>section){background:#1b2b3a;color:#e4edf5;border-color:#3b4f60}
html[data-theme=dark] :is(input,select,textarea){background:#13212e!important;color:#e4edf5!important;border-color:#587084!important}
html[data-theme=dark] input::placeholder,html[data-theme=dark] textarea::placeholder{color:#a5b7c6;opacity:1}
html[data-theme=dark] :is(button,.button,.secondary){background:#263e52;color:#e4edf5;border-color:#587084}
html[data-theme=dark] :is(button.primary,button.dark,a.primary,.button-navy){background:#17638a;color:#fff;border-color:#3986aa}
html[data-theme=dark] :is(button.quiet,.link-button){background:transparent;color:#bbd7eb}
html[data-theme=dark] :is(a,.brand,.label,h1,h2,h3,h4,strong,dt,dd,th,td){color:inherit}
html[data-theme=dark] a{color:#8fd5ff}
html[data-theme=dark] :is(.muted,.help,.foot,.eyebrow,.footer-note,.section-note,.profile-card p,.incident-card p,.suggestion p,.modal-body>p,.event p,.topbar,.topbar .right,.page-head p,.settings-data dt,small){color:#b2c2d0}
html[data-theme=dark] :is(.notice,.private-message,.payment-notice,.staff-note){background:#3c3322;color:#ffe0a1;border-color:#806c42}
html[data-theme=dark] :is(.error,.inline-error){color:#ffb6b6}
html[data-theme=dark] .error{background:#49262e;border-color:#955665}
html[data-theme=dark] :is(.badge,.participant-capacity){background:#173e35;color:#a5efce;border-color:#427f66}
html[data-theme=dark] .badge.warn{background:#49391f;color:#ffdc96}
html[data-theme=dark] .badge.neutral{background:#304455;color:#d1e1ed}
html[data-theme=dark] :is(.exercise-person-tag,.join-url,.recovery-dial,.nist-score,.avatar){background:#263e52;color:#e4edf5;border-color:#587084}
html[data-theme=dark] :is(table,th,td,.card-head,.modal-head,.action-item,header){border-color:#3b4f60}
html[data-theme=dark] :is(.hero,.auth-story,.sidebar,.ops-sidebar){background:#082b43;color:#f1f7fc}
html[data-theme=dark] :is(.hero p,.hero small,.hero .eyebrow,.auth-story p){color:#d1e5f3}
html[data-theme=dark] :is(.site-header,.site-footer,.intro-strip){background:#1b2b3a;color:#e4edf5}
html[data-theme=dark] :focus-visible{outline:3px solid #ffd277;outline-offset:3px}
html[data-theme=dark] input[type=checkbox],html[data-theme=dark] input[type=radio]{accent-color:#68c8ff}
html[data-theme=dark] :is(th,.nist-flow>div,.finding-text,.service-instructions-example,.mfa-secret,.recovery-codes,.person-check span,.roster-tag){background:#263e52;color:#e4edf5;border-color:#587084}
html[data-theme=dark] .person-check input:checked+span{background:#173e35;color:#a5efce;border-color:#67c7a1}
html[data-theme=dark] :is(.badge.danger,.deletion-warning){background:#49262e;color:#ffb6b6;border-color:#955665}
html[data-theme=dark] .sidebar .nav button{background:transparent;color:#b9cddd;border-color:transparent}
html[data-theme=dark] .sidebar .nav button.active{background:#ffffff18;color:#ffd47c;border-left:3px solid #ed9b12}
html[data-theme=dark] .topbar b{color:#e4edf5}
html[data-theme=dark] .training-chapter.active{background:#3c3322;color:#ffe0a1}
html[data-theme=dark] .participant-capacity{--capacity-color:#5ac893}
html[data-theme=dark] .participant-capacity.caution{--capacity-color:#efbe58}
html[data-theme=dark] .participant-capacity.low{--capacity-color:#f48c85}
html[data-theme=dark] :is(.bar,.chart-fill){background:#3b4f60}
html[data-theme=dark] .chart-fill::-webkit-progress-bar,html[data-theme=dark] .participant-capacity progress::-webkit-progress-bar{background:#3b4f60}
html[data-theme=dark] .how-section{background:#1b2b3a}
html[data-theme=dark] :is(.feature-number,.exercise-steps li>span){background:#3c3322;color:#ffe0a1;border-color:#806c42}
html[data-theme=dark] :is(.hero-description,.hero-footnote,.hero-copy p,.feature-card p,.exercise-steps p,.section-heading p){color:#b2c2d0}
@media(max-width:650px){.theme-menu{font-size:12px}.theme-menu>summary{padding:6px 8px}.theme-choice{min-width:170px}header:has(>.theme-menu){flex-wrap:wrap;gap:10px}}
@media print{.theme-menu,.theme-choice{display:none!important}html[data-theme=dark] body{background:#fff;color:#111}}

/* Portal sections can be nested in account/CRM containers, not only directly under main. */
html[data-theme=dark]:has(link[href^="/portal.css"]) section{background:#1b2b3a;color:#e4edf5;border-color:#3b4f60}
