/* Accessibility palette: original brand colors retained for decorative accents. */
:root{--a11y-focus:#4356a5;--a11y-border:#68758d;--a11y-muted:#526077;--a11y-link:#3c4f9e}
html[data-ws-theme=dark]{--a11y-focus:#c4cdff;--a11y-border:#8797b3;--a11y-muted:#c3cde1;--a11y-link:#c4cdff;--ink:#edf0ff;--muted:#c3cde1;--paper:#111827;--border:#52627d;--lav:#283457;--accent:#c4cdff;--white:#1c2536;--green:#a8efc9;--red:#ffd1d6}
:where(button,a,input,select,textarea,summary,[tabindex]):focus-visible{outline:3px solid var(--a11y-focus)!important;outline-offset:3px!important;scroll-margin:12px}
:where(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]),select,textarea){border-color:var(--a11y-border)}
:where(input,textarea)::placeholder{color:var(--a11y-muted);opacity:1}
:where(.theme-switch){display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:40px;min-width:44px;padding:7px 12px;font:inherit;font-size:12px;font-weight:700;border:1px solid var(--a11y-border);border-radius:8px;color:#17243d;background:#fff;cursor:pointer;white-space:nowrap;flex-shrink:0}
.theme-switch-wrap{display:flex;justify-content:flex-end;padding:8px 16px;gap:8px;flex-wrap:wrap}
html[data-ws-theme=dark] .theme-switch{background:#202b40!important;color:#edf0ff!important;border-color:#8797b3!important}
.topbar .top-right{min-width:0}.private-top,.employee-header,.radar-nav,.managed-header,.billtop{flex-wrap:wrap}
@media(max-width:650px){.theme-switch{min-height:44px;padding:7px 9px;font-size:11px}.topbar .theme-switch{min-height:36px}.topbar .account-text{display:none}.topbar .top-right{gap:6px}.employee-header a{white-space:normal}.radar-nav{gap:12px}.theme-switch-wrap{padding:8px 14px}}
/* Light surfaces */
html:not([data-ws-theme=dark]) :is(.partner-label,.hb-group,.minor-note,.showcase-foot,.packet-caption,.crumb span,.radar-footer,.radar-overline,.muted-day,.muted-day .cal-day){color:#526077!important}
html:not([data-ws-theme=dark]) .login-side .overline{color:#c4cdff!important}
html:not([data-ws-theme=dark]) .partner-hero{background:#17243d!important;color:#fff!important}
html:not([data-ws-theme=dark]) .partner-hero :is(h3,strong,p){color:#edf0ff!important}
html:not([data-ws-theme=dark]) :is(.btn.primary,.partner-button.primary){background:#17243d;color:#fff;border-color:#17243d}
html:not([data-ws-theme=dark]) .employee-header .btn{background:#fff;color:#17243d;border-color:#8797b3}
html:not([data-ws-theme=dark]) .step b{color:#5268b5}
html:not([data-ws-theme=dark]) .mock-person b{color:#3c4f9e}
/* Dark mode: do not invert text without also changing its surface. */
html[data-ws-theme=dark] :is(.partner-nav .navlink,.staff-nav,.partner-label,.hb-group,.private-note,.staff-note,.command-description,.radar-overline,.radar-footer,.radar-muted,.radar-small,.radar-intro,.ai-state,.packet-caption,.onboard-muted,.muted-day,.muted-day .cal-day,.crumb span){color:#c3cde1!important}
html[data-ws-theme=dark] :is(.partner-nav .navlink.active,.staff-nav.active,.partner-nav .navlink:hover,.staff-nav:hover,.scope,.partner-pill,.packet-pill,.portal-tab.selected,.packet-person.selected,.packet-person:hover){color:#edf0ff!important;background:#34466f!important;border-color:#8797b3!important}
html[data-ws-theme=dark] :is(.partner-nav .navlink.active,.staff-nav.active){box-shadow:inset 3px 0 #c4cdff!important}
html[data-ws-theme=dark] :is(.partner-hero,.managed-shell .hero,.staff-message,.staff-shell .staff-row,.command-module,.onboarding-page,.employee-card,.employee-field,.packet-card,.packet-metric,.packet-person,.packet-step,.packet-action,.portal-tab,.packet-info,.radar-status,.staff-shell .panel,.release-panel,.site-header,.mega-menu,.partner-menu,.private-card,.staff-shell .private-cards button,.portal-choices a,.login-card,.demo-toolbar,.time-document){background:#1c2536!important;color:#edf0ff!important;border-color:#52627d!important}
html[data-ws-theme=dark] :is(.site-header,.mega-menu) :is(.logo,.nav-trigger,.nav-simple,.text-link,.menu-kicker,a,small){color:#edf0ff!important}
html[data-ws-theme=dark] :is(.mega-menu a:hover,.nav-trigger:hover,.nav-simple:hover){background:#34466f!important}
html[data-ws-theme=dark] :is(.employee-header,.employee-nav,.radar-nav){background:#111827!important;color:#edf0ff!important;border-bottom:1px solid #52627d}
html[data-ws-theme=dark] :is(.partner-hero,.employee-card,.packet-card,.radar-card,.staff-message) :is(p,small,label){color:#c3cde1!important}
html[data-ws-theme=dark] :is(.btn.primary,.btn-primary,.partner-button.primary,.packet-action.primary,.radar-btn,.billaction){background:#b6c2ff!important;color:#17243d!important;border-color:#b6c2ff!important}
html[data-ws-theme=dark] :is(.btn.primary,.btn-primary,.partner-button.primary,.packet-action.primary,.radar-btn,.billaction) :is(span,strong,b,small,svg){color:inherit!important}
html[data-ws-theme=dark] :is(.btn:not(.primary):not(.btn-primary),.partner-button:not(.primary),.packet-action:not(.primary),.employee-header .btn){background:#202b40!important;color:#edf0ff!important;border-color:#8797b3!important}
html[data-ws-theme=dark] :is(.btn.danger,.error,.partner-status.error,.radar-status.error){color:#ffd1d6!important}
html[data-ws-theme=dark] :is(.safe-demo,.packet-pill.warn,.pill.warn,.locked){background:#473721!important;color:#ffe0a6!important;border-color:#a78750!important}
html[data-ws-theme=dark] :is(.packet-pill.done,.pill.good,.partner-status:not(.error)){color:#a8efc9!important}
html[data-ws-theme=dark] :is(.radar-card,.private-shell,.managed-shell,.employee-main,.studio,.partner-shell) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea){background:#202b40!important;color:#edf0ff!important;border-color:#8797b3!important}
html[data-ws-theme=dark] :is(.packet-bar,.progress){background:#34466f!important}
html[data-ws-theme=dark] :is(.brand img,.staff-brand img,.partner-brand img,.managed-brand img,.employee-header img){background:#fff!important;border-radius:7px;padding:2px}
html[data-ws-theme=dark] .logo em{color:#c4cdff!important}
/* Branded calls to action use contrast-safe white or black set by the brand helper. */
html[data-ws-theme=dark] :is(.managed-shell,.live-firm-shell[data-branded]) .btn.primary{background:var(--firm-color)!important;color:var(--firm-on)!important;border-color:var(--firm-color)!important}
html[data-ws-theme=dark] .managed-brand .mark{background:var(--firm-color)!important;color:var(--firm-on)!important}
html[data-ws-theme=dark] :is(.hb-paper,.hb-paper-cover,.handbook-paper,.handbook-print,.preview-paper){background:#fff!important;color:#111!important;color-scheme:light}
html[data-ws-theme=dark] :is(.hb-paper,.hb-paper-cover,.handbook-paper,.handbook-print,.preview-paper) :is(p,h1,h2,h3,h4,span,li,b,strong,td,th,small,label,a){color:#111!important}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
@media print{.theme-switch,.theme-switch-wrap{display:none!important}html[data-ws-theme=dark] body{background:#fff!important;color:#17243d!important}html[data-ws-theme=dark] :is(#view,#commandReport,#view *,#commandReport *){background:transparent!important;color:#17243d!important;border-color:#aab3c5!important;box-shadow:none!important}}
/* Final contrast overrides: match component specificity and keep branded foregrounds. */
html:not([data-ws-theme=dark]) body :is(.avatar,.org-avatar,.mock-top b){color:#3c4f9e!important}
html:not([data-ws-theme=dark]) .hero-under>span{color:#526077!important}
html[data-ws-theme=dark] body :is(.btn.primary,.btn.btn-primary,.partner-button.primary,.packet-action.primary,.radar-btn,.billaction){color:#17243d!important;background:#b6c2ff!important;border-color:#b6c2ff!important}
html[data-ws-theme=dark] body :is(.btn.primary,.btn.btn-primary,.partner-button.primary,.packet-action.primary,.radar-btn,.billaction) :is(span,strong,b,small,svg){color:inherit!important}
html[data-ws-theme=dark] body :is(.staff-shell .staff-nav,.private-shell .staff-nav,.packet-metric span,.packet-step span,.hb-bigicon){color:#c3cde1!important}
html[data-ws-theme=dark] body :is(.staff-shell .staff-nav.active,.private-shell .staff-nav:hover){color:#edf0ff!important;background:#34466f!important}
html[data-ws-theme=dark] body :is(.onboard-brow,.packet-status,.packet-link,.packet-card a,.ai-draft summary){color:#c4cdff!important}
html[data-ws-theme=dark] body :is(.employee-welcome,.employee-wrap,section:has(>.employee-wrap)){background:#111827!important;color:#edf0ff!important}
html[data-ws-theme=dark] body :is(.staff-shell .ops-form,.staff-shell .private-top,.radar-form,.radar-status,.packet-form,.scope-grid label){background:#1c2536!important;color:#edf0ff!important;border-color:#8797b3!important}
html[data-ws-theme=dark] body :is(.staff-shell .private-top p,.packet-form label,.packet-check label,.packet-person strong,.employee-field strong,.employee-main .notice,.radar-item a){color:#c3cde1!important}
html[data-ws-theme=dark] body :is(.managed-shell,.live-firm-shell[data-branded]) .btn.primary{background:var(--firm-color)!important;color:var(--firm-on)!important;border-color:var(--firm-color)!important}
html[data-ws-theme=dark] body .radar-status.error{background:#482733!important;color:#ffd1d6!important}
html[data-ws-theme=dark] body :is(.staff-shell #mfaQR,.managed-brand img,.command-report-brand img){background:#fff!important}
html[data-ws-theme=dark] body .employee-header .theme-switch{background:#202b40!important;color:#edf0ff!important}
/* Form boundaries and additional states used by live account and report views. */
html body :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]),select,textarea){border-color:var(--a11y-border)!important}
html:not([data-ws-theme=dark]) body :is(.managed-shell,.live-firm-shell[data-branded]) .btn.primary{background:var(--firm-color)!important;color:var(--firm-on)!important;border-color:var(--firm-color)!important}
html[data-ws-theme=dark] body :is(.ops-metric,.ops-form,.ops-kv,.managed-shell .scope-grid label,.staff-shell .staff-message,.partner-demo-ai,.employee-main .row,.time-row,.report-summary,.report-card){background:#1c2536!important;color:#edf0ff!important;border-color:#52627d!important}
html[data-ws-theme=dark] body :is(.ops-metric small,.ops-kv small,.time-row small,.employee-main .row small,.employee-main .chat-bubble small,.staff-row small){color:#c3cde1!important}
html[data-ws-theme=dark] body :is(.ops-metric b,.ops-metric strong){color:#edf0ff!important}
html[data-ws-theme=dark] body .ops-state{color:#edf0ff!important;background:#34466f!important}
html[data-ws-theme=dark] body .ops-state.held{color:#ffe0a6!important;background:#473721!important}
html[data-ws-theme=dark] body .btn.danger{color:#ffd1d6!important}
html[data-ws-theme=dark] body :is(.btn.primary,.btn.btn-primary) :is(strong,small,span){color:inherit!important}
:where(.packet-card p,.minor-note,.private-note,.staff-note,.panel p,.record p,.radar-intro) a:not(.btn):not(.packet-action){text-decoration:underline;text-underline-offset:2px}
