/*
 * BSRDMS adaptive dark interface
 * Loaded last so one accessible neutral system governs every authenticated module.
 * Official paper documents remain white to preserve their legal print appearance.
 */
html[data-theme=dark]{
 color-scheme:dark;
 --brand-page:#09111d!important;
 --brand-surface:#111c2b!important;
 --brand-text:#f3f6fb!important;
 --brand-muted:#aebdd0!important;
 --brand-line:#304158!important;
 --bg:#09111d!important;
 --page:#09111d!important;
 --card:#111c2b!important;
 --surface:#111c2b!important;
 --surface-2:#152235!important;
 --text:#f3f6fb!important;
 --ink:#f3f6fb!important;
 --muted:#aebdd0!important;
 --subtle:#aebdd0!important;
 --line:#304158!important;
 --stroke:#304158!important;
 --border:#304158!important;
 --ui-page:#09111d!important;
 --ui-border:#304158!important;
 --dark-canvas:#09111d;
 --dark-surface:#111c2b;
 --dark-raised:#172538;
 --dark-input:#0d1827;
 --dark-line:#304158;
 --dark-text:#f3f6fb;
 --dark-muted:#aebdd0;
 --dark-primary:color-mix(in srgb,var(--brand-primary,#397fd1) 72%,#8fc4ff);
 --dark-accent:color-mix(in srgb,var(--brand-accent,#d39b24) 76%,#ffe19a);
 --focus:color-mix(in srgb,var(--dark-primary) 48%,transparent);
 --shadow:0 14px 38px rgba(0,0,0,.28);
}

html[data-theme=dark],
html[data-theme=dark] body,
html[data-theme=dark] .page,
html[data-theme=dark] .content,
html[data-theme=dark] .management-page,
html[data-theme=dark] .enterprise-page,
html[data-theme=dark] .v14-page,
html[data-theme=dark] .office-admin-page,
html[data-theme=dark] .workspace-page,
html[data-theme=dark] .work-page,
html[data-theme=dark] .notes-page,
html[data-theme=dark] .settings-page{
 background:var(--dark-canvas)!important;
 color:var(--dark-text)!important;
}

html[data-theme=dark] body{
 scrollbar-color:#526781 #0b1422;
}
html[data-theme=dark] ::selection{background:color-mix(in srgb,var(--dark-primary) 46%,transparent);color:#fff}
html[data-theme=dark] *{scrollbar-color:#526781 #0b1422}
html[data-theme=dark] ::-webkit-scrollbar{width:11px;height:11px}
html[data-theme=dark] ::-webkit-scrollbar-track{background:#0b1422}
html[data-theme=dark] ::-webkit-scrollbar-thumb{background:#526781;border:3px solid #0b1422;border-radius:999px}

/* Navigation and application chrome */
html[data-theme=dark] .topbar,
html[data-theme=dark] .sheet-titlebar,
html[data-theme=dark] .sheet-toolbar,
html[data-theme=dark] .formula-bar,
html[data-theme=dark] .sheet-status{
 background:#0d1724!important;
 color:var(--dark-text)!important;
 border-color:var(--dark-line)!important;
 box-shadow:0 1px 0 #304158,0 8px 24px rgba(0,0,0,.15)!important;
}
html[data-theme=dark] .brand,
html[data-theme=dark] .brand-copy strong,
html[data-theme=dark] .nav-links a,
html[data-theme=dark] .logout-link,
html[data-theme=dark] .nav-toggle,
html[data-theme=dark] .sheet-titlebar input{
 color:var(--dark-text)!important;
}
html[data-theme=dark] .brand-copy small,
html[data-theme=dark] .nav-identity small{color:var(--dark-muted)!important}
html[data-theme=dark] .nav-links a:hover,
html[data-theme=dark] .nav-links a.active{
 background:color-mix(in srgb,var(--dark-primary) 16%,transparent)!important;
 color:#fff!important;
}
html[data-theme=dark] .nav-links a.active:after{background:var(--dark-accent)!important}
html[data-theme=dark] .header-profile{background:var(--dark-raised)!important;border-color:#526781!important;box-shadow:0 0 0 3px #0d1724!important}
html[data-theme=dark] .notification-bell:hover{background:color-mix(in srgb,var(--dark-accent) 15%,transparent)!important}
html[data-theme=dark] .nav-account{border-color:var(--dark-line)!important}
html[data-theme=dark] .nav-scrim{background:rgba(1,7,15,.82)!important;backdrop-filter:blur(3px)}
@media(max-width:1100px){
 html[data-theme=dark] .topbar nav{background:#0d1724!important;border-left:1px solid var(--dark-line)!important}
 html[data-theme=dark] .nav-links a{background:#142236!important;border:1px solid transparent}
 html[data-theme=dark] .nav-links a:hover,
 html[data-theme=dark] .nav-links a.active{border-color:#49617d!important}
}

/* Shared cards, panels and data surfaces */
html[data-theme=dark] :is(
 .panel,.dashboard-card,.metric-card,.security-stat,.result-card,.workspace-card,.workbook-row,
 .game-card,.office-search-card,.office-quick-card,.official-settings-card:not(.official-settings-card),
 .desktop-app-card,.profile-settings,.unit-stamp-settings,.theme-tile,.branding-studio,
 .records-summary article,.records-search-panel,.records-register,.file-request-form,
 .file-request-register,.task-card,.note-card,.dashboard-notes-widget>div>a,
 .leave-calendar article,.leave-person,.identity-guidance-grid article,.quick-action,
 .control-grid a,.queue-list>a,.queue-list>div,.rating-summary div,.detail-list div,
 .recipient-choice,.request-guidance,.mobile-visit-card,.school-stat,.school-card,
 .visit-card,.call-readiness,.readiness-grid>article,.device-test,.setup-columns>article,
 .admin-call-setup,.call-directory,.incoming-call,.meeting-person,.page-help
 ){
 background:var(--dark-surface)!important;
 color:var(--dark-text)!important;
 border-color:var(--dark-line)!important;
 box-shadow:0 10px 30px rgba(0,0,0,.2)!important;
}
html[data-theme=dark] :is(.quick-action,.control-grid a,.records-primary-actions>a,.office-quick-grid>a,.request-guidance,.detail-list div){
 background:var(--dark-raised)!important;
}
html[data-theme=dark] :is(.quick-action,.control-grid a,.records-primary-actions>a,.office-quick-grid>a):hover{
 background:color-mix(in srgb,var(--dark-primary) 18%,var(--dark-raised))!important;
 border-color:var(--dark-primary)!important;
 color:#fff!important;
}
html[data-theme=dark] :is(h1,h2,h3,h4,h5,h6,strong,b,.settings-heading h1,.settings-heading h2,.dashboard-card h2,.panel h2,.metric-card strong,.v14-metrics article strong){
 color:var(--dark-text);
}
html[data-theme=dark] :is(
 p,.muted,.section-head p,.dashboard-card>p,.metric-card span,.metric-card small,
 .v14-metrics article span,.v14-metrics article small,.control-grid a span,.queue-list span,
 .records-summary span,.records-summary small,.record-person small,.records-table td>small,
 .document-count,.request-submit p,.request-guidance small,.workbook-row small,
 .note-card time,.note-card>div,.mobile-visit-school p,.mobile-visit-card small,
 .mobile-visit-details dt,.timeline span,.search-help,.settings-heading p
 ){color:var(--dark-muted)!important}
html[data-theme=dark] .eyebrow,
html[data-theme=dark] .section-kicker{color:var(--dark-accent)!important}
html[data-theme=dark] a:not(.btn):not(.quick-action):not(.control-grid a){text-decoration-color:color-mix(in srgb,var(--dark-primary) 55%,transparent)}

/* Controls: clear boundaries, strong focus and readable disabled states */
html[data-theme=dark] :is(input,select,textarea,.secure-input,.note-search,.formula-bar input){
 background:var(--dark-input)!important;
 color:var(--dark-text)!important;
 border-color:#40536c!important;
 caret-color:#fff;
}
html[data-theme=dark] :is(input,textarea)::placeholder{color:#8191a7!important;opacity:1}
html[data-theme=dark] :is(input,select,textarea):hover{border-color:#58708e!important}
html[data-theme=dark] :is(input,select,textarea):focus,
html[data-theme=dark] :is(button,a):focus-visible{
 outline:3px solid var(--focus)!important;
 outline-offset:2px!important;
 border-color:var(--dark-primary)!important;
}
html[data-theme=dark] :is(input,select,textarea):disabled{
 background:#182334!important;color:#8797ab!important;border-color:#2a3a4e!important;opacity:1
}
html[data-theme=dark] select{color-scheme:dark}
html[data-theme=dark] option{background:#101b2a;color:#f3f6fb}
html[data-theme=dark] label{color:var(--dark-text)}
html[data-theme=dark] label small{color:var(--dark-muted)}
html[data-theme=dark] .password-wrap button,
html[data-theme=dark] .install-help-button,
html[data-theme=dark] .note-formatbar button,
html[data-theme=dark] .note-formatbar select,
html[data-theme=dark] .sheet-toolbar button,
html[data-theme=dark] .sheet-toolbar select{
 background:var(--dark-raised)!important;color:var(--dark-text)!important;border-color:#40536c!important
}

/* Buttons retain branding but gain dark-mode contrast */
html[data-theme=dark] .btn{
 background:var(--dark-raised)!important;color:var(--dark-text)!important;border-color:#40536c!important
}
html[data-theme=dark] :is(.btn.primary,.secure-signin-button,.install-app-button){
 background:var(--dark-primary)!important;color:#06111f!important;border-color:var(--dark-primary)!important;
 box-shadow:0 8px 22px color-mix(in srgb,var(--dark-primary) 24%,transparent)!important
}
html[data-theme=dark] .btn.danger{background:color-mix(in srgb,var(--brand-danger,#c84b4b) 22%,var(--dark-raised))!important;color:#ffb4ad!important;border-color:#b85d5a!important}
html[data-theme=dark] .btn:hover{filter:brightness(1.08)}
html[data-theme=dark] .hero-actions .btn,
html[data-theme=dark] .v14-hero .btn.light,
html[data-theme=dark] .enterprise-hero>.btn{
 background:#f8fafc!important;color:#142033!important;border-color:#fff!important
}

/* Data-table dark presentation moved to the v16.25.4 Design System.
   Records keeps its workflow-specific target highlight here. */
html[data-theme=dark] .records-table tbody tr:target{background:color-mix(in srgb,var(--dark-accent) 14%,var(--dark-surface))!important}

/* Status, alerts and informational emphasis */
html[data-theme=dark] .alert.success{background:#102c24!important;color:#9de8c1!important;border-color:#29674f!important}
html[data-theme=dark] :is(.alert.warning,.scan-note,.setup-warning){background:#302713!important;color:#ffe09a!important;border-color:#7b6326!important}
html[data-theme=dark] .alert.error{background:#321c22!important;color:#ffb4b8!important;border-color:#7c3944!important}
html[data-theme=dark] .status-draft{background:#28374a!important;color:#d5dfeb!important}
html[data-theme=dark] :is(.status-submitted,.priority-priority){background:#3a3018!important;color:#ffe09a!important;border-color:#806a2b!important}
html[data-theme=dark] :is(.status-unit_approved,.state-transferred){background:#172f4c!important;color:#a8d2ff!important}
html[data-theme=dark] :is(.status-director_approved,.state-active){background:#123326!important;color:#9de8c1!important}
html[data-theme=dark] :is(.status-queried,.priority-urgent){background:#381f25!important;color:#ffb4b8!important}
html[data-theme=dark] :is(.badge,.user-chip,.page-indicator){background:#1a3455!important;color:#b8d9ff!important}
html[data-theme=dark] .role-boundary,
html[data-theme=dark] .dual-role-card,
html[data-theme=dark] .access-grant,
html[data-theme=dark] .role-conversion-notice,
html[data-theme=dark] .records-safety-note,
html[data-theme=dark] .recipient-panel{
 background:color-mix(in srgb,var(--dark-accent) 10%,var(--dark-surface))!important;
 border-color:color-mix(in srgb,var(--dark-accent) 38%,var(--dark-line))!important;color:var(--dark-text)!important
}

/* Settings and branding studio */
html[data-theme=dark] .desktop-app-card{
 background:linear-gradient(135deg,#111c2b,#172538)!important;
}
html[data-theme=dark] .desktop-app-icon{background:color-mix(in srgb,var(--dark-primary) 24%,var(--dark-raised))!important;color:#dcecff!important}
html[data-theme=dark] .theme-tile.active{border-color:var(--dark-accent)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--dark-accent) 25%,transparent)!important}
html[data-theme=dark] .branding-layout,
html[data-theme=dark] .branding-savebar{background:var(--dark-surface)!important;border-color:var(--dark-line)!important}
html[data-theme=dark] .colour-field{background:var(--dark-raised)!important;border-color:var(--dark-line)!important}
html[data-theme=dark] .colour-field code{color:var(--dark-text)}
html[data-theme=dark] .brand-preview{background:var(--dark-canvas)!important;border-color:var(--dark-line)!important}
html[data-theme=dark] .preview-top,
html[data-theme=dark] .preview-cards i{
 background:var(--dark-surface)!important;color:var(--dark-text)!important;border-color:var(--dark-line)!important
}
html[data-theme=dark] .signature-preview{background:#f8fafc!important}

/* Search, notes, tasks and productivity */
html[data-theme=dark] .searchbox,
html[data-theme=dark] .records-search-box,
html[data-theme=dark] .office-searchbox{background:var(--dark-input)!important;border-color:#40536c!important}
html[data-theme=dark] .task-column{background:#0e1928!important;border-color:var(--dark-line)!important}
html[data-theme=dark] .task-card{background:var(--dark-raised)!important}
html[data-theme=dark] .note-editor-shell,
html[data-theme=dark] .note-content,
html[data-theme=dark] .note-editor header,
html[data-theme=dark] .note-formatbar{background:#0d1827!important;color:var(--dark-text)!important;border-color:var(--dark-line)!important}
html[data-theme=dark] .sheet-viewport{background:#0a1320!important}
html[data-theme=dark] .sheet-grid,
html[data-theme=dark] .sheet-cell{background:#111c2b!important;color:#f3f6fb!important;border-color:#304158!important}
html[data-theme=dark] .sheet-head{background:#172538!important;color:#c9d5e4!important;border-color:#40536c!important}
html[data-theme=dark] .sheet-cell.selected{background:#183454!important}

/* Collaboration and communication chrome */
html[data-theme=dark] :is(.collaboration-main,.chat-panel,.documents-panel,.channel-content,.message-composer,.docs-panel,.comments-panel){
 background:var(--dark-surface)!important;color:var(--dark-text)!important;border-color:var(--dark-line)!important
}
html[data-theme=dark] :is(.message,.thread-card,.history-item,.search-hit){border-color:var(--dark-line)!important}
html[data-theme=dark] .message-tools button,
html[data-theme=dark] .reaction{background:var(--dark-raised)!important;color:var(--dark-text)!important;border-color:#40536c!important}
html[data-theme=dark] .reaction.mine,
html[data-theme=dark] .reply-banner{background:#183454!important;color:#b8d9ff!important;border-color:#466d98!important}
html[data-theme=dark] .mention{background:#24466c!important;color:#d3e7ff!important}
html[data-theme=dark] :is(.meeting-directory-shell,.meeting-invite-dialog>div,.meeting-stage,.meeting-sidebar){
 background:#0c1725!important;color:var(--dark-text)!important;border-color:var(--dark-line)!important
}
html[data-theme=dark] .meeting-person:hover{background:#1a2c43!important}

/* Fixed assistance controls remain distinct without covering content */
html[data-theme=dark] .page-help-button{background:#4b0d2a!important;color:#fff!important;border:1px solid #9c4b70!important}
html[data-theme=dark] .office-call-launcher{background:#9b3035!important;color:#fff!important;border:1px solid #d76a6d!important}
html[data-theme=dark] footer{color:var(--dark-muted)!important}

/* Secure access screens and standalone workspaces */
html[data-theme=dark] .secure-access-login{
 background:linear-gradient(120deg,#07111d 0 52%,#0b1422 52%)!important;
}
html[data-theme=dark] .secure-login-panel,
html[data-theme=dark] .secure-panel-inner,
html[data-theme=dark] .login-card{background:var(--dark-surface)!important;color:var(--dark-text)!important}
html[data-theme=dark] .secure-intro,
html[data-theme=dark] .secure-session-strip,
html[data-theme=dark] .secure-support,
html[data-theme=dark] .authorised-use-notice p{color:var(--dark-muted)!important}
html[data-theme=dark] .authorised-use-notice{border-color:var(--dark-line)!important;background:var(--dark-raised)!important}
html[data-theme=dark] .login-body{background:var(--dark-canvas)!important}
html[data-theme=dark] .wellness-break-page{background:#09111d!important;color:var(--dark-text)!important}
html[data-theme=dark] .wellness-break-page main{background:var(--dark-surface)!important;border-color:var(--dark-line)!important}

/* Official paper and previews deliberately remain paper-white in either theme. */
html[data-theme=dark] :is(.official-letter,.certificate,.action-plan-paper,.letter-review-paper,.certificate-paper,.document-page,.ql-editor){
 background:#fff!important;color:#111!important;color-scheme:light
}
html[data-theme=dark] :is(.official-letter,.certificate,.action-plan-paper,.letter-review-paper,.certificate-paper,.document-page,.ql-editor) :is(h1,h2,h3,h4,h5,h6,strong,b,p,span,small,td,th){
 color:inherit;
}
html[data-theme=dark] :is(.official-letter,.certificate,.action-plan-paper,.letter-review-paper,.certificate-paper,.document-page,.ql-editor) table,
html[data-theme=dark] :is(.official-letter,.certificate,.action-plan-paper,.letter-review-paper,.certificate-paper,.document-page,.ql-editor) :is(thead,tbody,tr,th,td){
 background:#fff!important;color:#111!important;border-color:#aaa!important;color-scheme:light
}
html[data-theme=dark] .certificate-page,
html[data-theme=dark] .letter-review-page{background:#202a38!important}

@media(max-width:760px){
 html[data-theme=dark] .settings-heading{background:transparent!important}
 html[data-theme=dark] .desktop-app-card{box-shadow:0 12px 32px rgba(0,0,0,.28)!important}
 html[data-theme=dark] .mobile-visit-card{background:var(--dark-surface)!important}
}

@media(prefers-contrast:more){
 html[data-theme=dark]{--dark-line:#61748d;--dark-muted:#c8d2df}
 html[data-theme=dark] :is(.panel,.dashboard-card,.metric-card,input,select,textarea,.btn){border-width:2px!important}
}

/* ========================================================================== 
   BSRDMS 17.3.33 — Professional cross-platform dark interface
   Final theme layer. Inspired by platform dark-appearance principles:
   neutral tonal surfaces, restrained accents, clear elevation, strong focus,
   and semantic status colour. Official paper remains light below.
   ========================================================================== */
html[data-theme="dark"]{
  color-scheme:dark;
  --dark-canvas:#0a0f16;
  --dark-canvas-soft:#0d131c;
  --dark-surface:#111925;
  --dark-surface-2:#151f2d;
  --dark-raised:#1a2636;
  --dark-raised-2:#203047;
  --dark-input:#0e1723;
  --dark-hover:#223249;
  --dark-selected:#173756;
  --dark-line:#2b3b50;
  --dark-line-strong:#40546d;
  --dark-text:#f4f7fb;
  --dark-text-2:#d6deea;
  --dark-muted:#9dacbf;
  --dark-muted-2:#7f90a5;
  --dark-primary:#72b7ff;
  --dark-primary-strong:#4aa0f5;
  --dark-primary-container:#153654;
  --dark-accent:#f0c66a;
  --dark-success:#62d7a4;
  --dark-warning:#f0c66a;
  --dark-danger:#ff8f91;
  --dark-info:#8ec5ff;
  --dark-overlay:rgba(2,7,14,.76);
  --dark-shadow-1:0 1px 2px rgba(0,0,0,.32),0 0 0 1px rgba(255,255,255,.025);
  --dark-shadow-2:0 8px 24px rgba(0,0,0,.28),0 1px 2px rgba(0,0,0,.34);
  --dark-shadow-3:0 20px 56px rgba(0,0,0,.48),0 0 0 1px rgba(255,255,255,.035);
  --focus:rgba(114,183,255,.42);
  --bg:var(--dark-canvas)!important;
  --page:var(--dark-canvas)!important;
  --card:var(--dark-surface)!important;
  --surface:var(--dark-surface)!important;
  --surface-2:var(--dark-surface-2)!important;
  --text:var(--dark-text)!important;
  --ink:var(--dark-text)!important;
  --muted:var(--dark-muted)!important;
  --subtle:var(--dark-muted)!important;
  --line:var(--dark-line)!important;
  --stroke:var(--dark-line)!important;
  --border:var(--dark-line)!important;
  --ui-page:var(--dark-canvas)!important;
  --ui-border:var(--dark-line)!important;
  accent-color:var(--dark-primary-strong);
}

html[data-theme="dark"] body{
  background:var(--dark-canvas)!important;
  color:var(--dark-text)!important;
  -webkit-font-smoothing:antialiased;
}
html[data-theme="dark"] body::selection,
html[data-theme="dark"] ::selection{background:rgba(74,160,245,.42);color:#fff}

/* Cross-platform application chrome */
html[data-theme="dark"] :is(.pwa-titlebar,.bsrdms-native-titlebar){
  background:#0a1725!important;color:#eef5fd!important;border-color:#24384f!important;
}
html[data-theme="dark"] .app-connectivity-bar{
  background:rgba(17,25,37,.94)!important;color:var(--dark-text)!important;
  border:1px solid var(--dark-line)!important;box-shadow:var(--dark-shadow-2)!important;
  backdrop-filter:blur(18px) saturate(125%);
}
html[data-theme="dark"] .connectivity-state small{color:var(--dark-muted)!important}
html[data-theme="dark"] .connectivity-state i{box-shadow:0 0 0 4px rgba(98,215,164,.10)!important}
html[data-theme="dark"] :is(.connectivity-actions button,.offline-outbox-count){
  background:var(--dark-raised)!important;color:var(--dark-text)!important;border-color:var(--dark-line)!important;
}
html[data-theme="dark"] :is(.connectivity-actions button,.offline-outbox-count):hover{background:var(--dark-hover)!important;border-color:var(--dark-line-strong)!important}

/* Sidebar and mobile application shell */
html[data-theme="dark"] .app-sidebar{
  background:linear-gradient(180deg,#0d2438 0%,#0b2033 60%,#0a1b2b 100%)!important;
  border-color:#294158!important;box-shadow:16px 0 44px rgba(0,0,0,.28)!important;
}
html[data-theme="dark"] :is(.sidebar-profile-header,.sidebar-account){border-color:rgba(147,174,203,.18)!important}
html[data-theme="dark"] .sidebar-identity{background:rgba(255,255,255,.065)!important;border-color:rgba(163,190,218,.22)!important}
html[data-theme="dark"] .sidebar-workspace-search{background:rgba(255,255,255,.055)!important;border-color:rgba(163,190,218,.18)!important;color:#f3f7fc!important}
html[data-theme="dark"] .sidebar-workspace-search:hover{background:rgba(255,255,255,.095)!important;border-color:rgba(163,190,218,.32)!important}
html[data-theme="dark"] .sidebar-section-label{color:#8fa6be!important}
html[data-theme="dark"] .desktop-nav-links a,
html[data-theme="dark"] .mobile-drawer-links a,
html[data-theme="dark"] .sidebar-account-link{color:#eef5fb!important}
html[data-theme="dark"] .desktop-nav-links a:hover,
html[data-theme="dark"] .mobile-drawer-links a:hover,
html[data-theme="dark"] .sidebar-account-link:hover{background:rgba(255,255,255,.075)!important}
html[data-theme="dark"] .desktop-nav-links a.active,
html[data-theme="dark"] .mobile-drawer-links a.active{background:rgba(126,183,239,.17)!important;border-color:rgba(155,202,244,.22)!important;color:#fff!important}
html[data-theme="dark"] .nav-glyph,
html[data-theme="dark"] .sidebar-account-icon{background:rgba(255,255,255,.07)!important;color:#dbeaf8!important}
html[data-theme="dark"] .desktop-nav-links a.active .nav-glyph{background:rgba(240,198,106,.18)!important;color:#ffe29d!important}
html[data-theme="dark"] .sidebar-collapse{background:rgba(255,255,255,.055)!important;border-color:rgba(163,190,218,.18)!important;color:#f3f7fc!important}
html[data-theme="dark"] .mobile-appbar{background:rgba(13,23,36,.96)!important;color:var(--dark-text)!important;border-color:var(--dark-line)!important;backdrop-filter:blur(18px)}
html[data-theme="dark"] :is(.mobile-search-link,.mobile-notification,.nav-toggle){color:var(--dark-text)!important;background:transparent!important}

/* Layered surfaces — use tone/elevation instead of pure black */
html[data-theme="dark"] :is(
  .panel,.dashboard-card,.metric-card,.workspace-card,.workbook-row,.theme-tile,.desktop-app-card,
  .settings-card,.settings-panel,.profile-settings,.official-settings-card,.branding-studio,.branding-layout,
  .security-stat,.result-card,.records-register,.records-search-panel,.records-summary article,.file-request-form,
  .file-request-register,.task-card,.note-card,.request-guidance,.detail-list div,.recipient-choice,
  .knowledge-library-card,.knowledge-editor-card,.knowledge-publish-card,.knowledge-detail-card,.knowledge-metadata-card,.knowledge-version-card,
  .workspace-search-console,.people-directory-card,.forms-home-page .panel,.form-responses-page .panel,
  .forms-empty,.forms-shared-list,.scheduled-meeting-card,.meeting-empty,.meeting-setup-notice,
  .announcement-card,.calendar-toolbar,.calendar-primary,.calendar-agenda,.calendar-sidebar,
  .permission-form,.request-route-card,.professional-request-layout>aside,.action-plan-builder,.simplified-builder,
  .feature-access-card,.feature-control-card,.feature-policy-card,.profile-photo-field,.profile-settings-main
){
  background:var(--dark-surface)!important;color:var(--dark-text)!important;
  border-color:var(--dark-line)!important;box-shadow:var(--dark-shadow-1)!important;
}
html[data-theme="dark"] :is(
  .metric-card,.calendar-metrics article,.announcement-metrics article,.people-metrics article,.forms-metrics article,
  .response-metric-grid article,.v14-metrics article,.records-summary article,.security-stat
){background:var(--dark-surface-2)!important}
html[data-theme="dark"] :is(.panel,.workspace-card,.dashboard-card,.scheduled-meeting-card,.announcement-card,.knowledge-version-card):hover{
  border-color:var(--dark-line-strong)!important;
}

/* Page-specific canvases that historically hard-code a light background */
html[data-theme="dark"] :is(
 .announcements-page,.district-calendar-page,.web-meetings-page,.forms-home-page,.form-builder-page,.form-responses-page,
 .workspace-search-page,.people-page,.knowledge-page,.work-page,.feature-access-page,.permission-page,
 .action-plan-builder,.simplified-builder,.management-page,.enterprise-page,.v14-page,.office-admin-page,
 .workspace-page,.settings-page,.notes-page,.page
){background:var(--dark-canvas)!important;color:var(--dark-text)!important}

/* Typography hierarchy */
html[data-theme="dark"] :is(h1,h2,h3,h4,h5,h6,.section-head strong,.card-title,.dialog-title){color:var(--dark-text)!important}
html[data-theme="dark"] :is(p,.muted,.subtle,.section-head p,.card-subtitle,.dialog-subtitle,.help-text,.hint){color:var(--dark-muted)!important}
html[data-theme="dark"] a:not(.btn):not(.sidebar-workspace-search):not(.sidebar-account-link):not(.desktop-nav-links a):not(.mobile-drawer-links a){color:#94c9ff}

/* Forms and fields */
html[data-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea,[contenteditable="true"],.preview-input){
  background:var(--dark-input)!important;color:var(--dark-text)!important;border-color:var(--dark-line-strong)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] :is(input,textarea)::placeholder{color:#75869b!important;opacity:1}
html[data-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea,[contenteditable="true"]):hover{border-color:#536c88!important}
html[data-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea,[contenteditable="true"]):focus{
  border-color:var(--dark-primary-strong)!important;outline:3px solid rgba(74,160,245,.26)!important;outline-offset:1px!important;
}
html[data-theme="dark"] :is(input,select,textarea):disabled,
html[data-theme="dark"] :is(input,select,textarea)[readonly]{background:#151e2a!important;color:#8594a8!important;border-color:#29384a!important}
html[data-theme="dark"] select option{background:#111925!important;color:#f4f7fb!important}
html[data-theme="dark"] :is(fieldset,.form-section,.form-grid,.field-group){border-color:var(--dark-line)!important}
html[data-theme="dark"] :is(label,legend){color:var(--dark-text-2)!important}
html[data-theme="dark"] :is(label small,.field-help,.form-help){color:var(--dark-muted)!important}

/* Buttons and interaction states */
html[data-theme="dark"] :is(.btn,button:not(.unstyled):not(.nav-scrim)){
  border-color:var(--dark-line-strong);
}
html[data-theme="dark"] .btn:not(.primary):not(.danger):not(.light):not(.ghost),
html[data-theme="dark"] :is(.meeting-create-shell,.forms-template-dialog,.form-share-dialog,.recipient-dialog,.response-detail-dialog) button:not(.primary){
  background:var(--dark-raised)!important;color:var(--dark-text)!important;border-color:var(--dark-line-strong)!important;
}
html[data-theme="dark"] .btn.primary,
html[data-theme="dark"] :is(.secure-signin-button,.meeting-primary,.word-review-button){
  background:#246faf!important;color:#fff!important;border-color:#377fbc!important;box-shadow:0 7px 20px rgba(24,104,174,.26)!important;
}
html[data-theme="dark"] .btn.primary:hover,
html[data-theme="dark"] :is(.secure-signin-button,.meeting-primary,.word-review-button):hover{background:#2b78b8!important;filter:none!important}
html[data-theme="dark"] .btn.ghost{background:transparent!important;color:var(--dark-text-2)!important;border-color:var(--dark-line-strong)!important}
html[data-theme="dark"] .btn.danger{background:#3a2026!important;color:#ffb7b8!important;border-color:#76434b!important}
html[data-theme="dark"] :is(button,a,[role="button"]):focus-visible{outline:3px solid rgba(114,183,255,.42)!important;outline-offset:2px!important}

/* Tables and structured lists */
html[data-theme="dark"] :is(.table-wrap,.records-register,.data-table-wrap,.sheet-table-wrap,.panel) table{
  background:var(--dark-surface)!important;color:var(--dark-text)!important;border-color:var(--dark-line)!important;
}
html[data-theme="dark"] :is(.table-wrap,.records-register,.data-table-wrap,.sheet-table-wrap,.panel) thead th{
  background:#182536!important;color:#c8d5e5!important;border-color:var(--dark-line-strong)!important;
}
html[data-theme="dark"] :is(.table-wrap,.records-register,.data-table-wrap,.sheet-table-wrap,.panel) tbody :is(td,th){border-color:var(--dark-line)!important;color:var(--dark-text-2)!important}
html[data-theme="dark"] :is(.table-wrap,.records-register,.data-table-wrap,.sheet-table-wrap,.panel) tbody tr:nth-child(even){background:rgba(255,255,255,.018)!important}
html[data-theme="dark"] :is(.table-wrap,.records-register,.data-table-wrap,.sheet-table-wrap,.panel) tbody tr:hover{background:rgba(114,183,255,.065)!important}
html[data-theme="dark"] :is(.empty-state,.empty,.no-results){color:var(--dark-muted)!important}

/* Dialogs, dropdowns, menus, popovers */
html[data-theme="dark"] :is(dialog,.modal,.modal-card,.dialog-card,.popover,.dropdown-menu,.context-menu,.sheet-context-menu){
  background:var(--dark-surface-2)!important;color:var(--dark-text)!important;border-color:var(--dark-line-strong)!important;box-shadow:var(--dark-shadow-3)!important;
}
html[data-theme="dark"] :is(dialog,.modal)::backdrop{background:var(--dark-overlay)!important;backdrop-filter:blur(4px)}
html[data-theme="dark"] :is(.dropdown-menu,.context-menu,.sheet-context-menu) :is(button,a):hover{background:var(--dark-hover)!important;color:#fff!important}
html[data-theme="dark"] hr{border-color:var(--dark-line)!important}

/* Semantic states — restrained and accessible */
html[data-theme="dark"] :is(.alert.success,.status-success,.success-banner){background:#112c25!important;color:#a4e9ca!important;border-color:#2e6a57!important}
html[data-theme="dark"] :is(.alert.warning,.warning-banner,.status-warning){background:#322914!important;color:#f6dc98!important;border-color:#786128!important}
html[data-theme="dark"] :is(.alert.error,.error-banner,.status-error){background:#351d24!important;color:#ffb9bb!important;border-color:#7d4049!important}
html[data-theme="dark"] :is(.alert.info,.info-banner,.status-info){background:#132b43!important;color:#b5d8ff!important;border-color:#355f88!important}
html[data-theme="dark"] :is(.status,.badge,.chip,.tag){box-shadow:none!important}

/* Heroes remain branded, but reduce glare in dark appearance */
html[data-theme="dark"] :is(.management-hero,.v14-hero,.enterprise-hero,.workspace-hero,.forms-hero,.responses-hero,.meeting-hub-hero,.district-calendar-hero,.knowledge-hero,.workspace-search-hero,.people-hero,.leave-permission-hero,.permission-hero,.memo-hero){
  filter:saturate(.88) brightness(.88);box-shadow:0 14px 34px rgba(0,0,0,.28)!important;
}
html[data-theme="dark"] :is(.management-hero,.v14-hero,.enterprise-hero,.workspace-hero,.forms-hero,.responses-hero,.meeting-hub-hero,.district-calendar-hero,.knowledge-hero,.workspace-search-hero,.people-hero,.leave-permission-hero,.permission-hero,.memo-hero) :is(h1,h2,h3,p,span,strong,small){filter:none}

/* District Calendar */
html[data-theme="dark"] .calendar-month-grid{background:var(--dark-surface)!important;border-color:var(--dark-line)!important}
html[data-theme="dark"] .calendar-weekdays{background:#151f2d!important;border-color:var(--dark-line)!important}
html[data-theme="dark"] .calendar-weekdays b{color:var(--dark-muted)!important}
html[data-theme="dark"] .calendar-day{background:#111925!important;border-color:#263649!important;color:var(--dark-text)!important}
html[data-theme="dark"] .calendar-day:hover{background:#17263a!important}
html[data-theme="dark"] .calendar-day.is-empty{background:#0d141e!important;color:#5f7084!important}
html[data-theme="dark"] .calendar-day.is-today{box-shadow:inset 0 0 0 2px #4b9fe8!important;background:#142a40!important}
html[data-theme="dark"] .calendar-event{background:#1a2a3d!important;color:var(--dark-text-2)!important;border-color:#31465f!important}
html[data-theme="dark"] .calendar-source-filter{background:var(--dark-surface-2)!important;border-color:var(--dark-line)!important}

/* Announcements */
html[data-theme="dark"] .announcement-card{background:var(--dark-surface)!important}
html[data-theme="dark"] .announcement-card:target{background:#16283b!important;box-shadow:0 0 0 2px rgba(114,183,255,.28)!important}
html[data-theme="dark"] .announcement-copy>p{color:var(--dark-muted)!important}
html[data-theme="dark"] :is(.announcement-details,.announcement-attachment,.announcement-ack-progress){background:var(--dark-surface-2)!important;border-color:var(--dark-line)!important;color:var(--dark-text-2)!important}

/* Meetings and calls */
html[data-theme="dark"] .meeting-hub-toolbar{background:transparent!important}
html[data-theme="dark"] .scheduled-meeting-card{background:var(--dark-surface)!important}
html[data-theme="dark"] .meeting-date-tile{background:#18344f!important;color:#dcecff!important;border-color:#345a7d!important}
html[data-theme="dark"] .meeting-create-dialog::backdrop{background:var(--dark-overlay)!important}
html[data-theme="dark"] .meeting-create-shell{background:var(--dark-surface)!important;color:var(--dark-text)!important;border-color:var(--dark-line-strong)!important;box-shadow:var(--dark-shadow-3)!important}
html[data-theme="dark"] .meeting-create-shell>header{background:linear-gradient(135deg,#102c48,#174d79)!important;color:#fff!important;border-color:#2b5f87!important}
html[data-theme="dark"] .meeting-form-body{background:var(--dark-surface)!important}
html[data-theme="dark"] .meeting-check{background:var(--dark-surface-2)!important;border-color:var(--dark-line)!important}
html[data-theme="dark"] .meeting-create-shell>footer{background:#0f1824!important;border-color:var(--dark-line)!important}
html[data-theme="dark"] .office-call-hub .call-hub-shell{background:var(--dark-surface)!important;border-color:var(--dark-line)!important;box-shadow:var(--dark-shadow-3)!important}
html[data-theme="dark"] :is(.office-call-hub .call-hub-view,.office-call-hub .call-log-panel,.office-call-hub .call-frequent-panel){background:var(--dark-surface-2)!important;border-color:var(--dark-line)!important}

/* Forms Studio */
html[data-theme="dark"] :is(.builder-canvas,.builder-inspector,.builder-sidebar){background:var(--dark-canvas-soft)!important;border-color:var(--dark-line)!important}
html[data-theme="dark"] :is(.question-card,.form-question-card,.builder-question,.form-card){background:var(--dark-surface)!important;color:var(--dark-text)!important;border-color:var(--dark-line)!important;box-shadow:var(--dark-shadow-1)!important}
html[data-theme="dark"] :is(.forms-template-dialog,.form-share-dialog,.recipient-dialog,.response-detail-dialog){background:var(--dark-surface-2)!important;color:var(--dark-text)!important;border-color:var(--dark-line-strong)!important}
html[data-theme="dark"] .theme-picker button{background:var(--dark-raised)!important;color:var(--dark-text)!important;border-color:var(--dark-line)!important}
html[data-theme="dark"] .theme-picker button.active{border-color:var(--dark-primary)!important;background:var(--dark-primary-container)!important}

/* Documents Studio: application chrome dark, actual paper intentionally light */
html[data-theme="dark"] .documents-studio-body{background:#0a0f16!important;color:var(--dark-text)!important}
html[data-theme="dark"] :is(.word-appbar,.word-menubar,.word-ribbon,.word-statusbar,.word-navigation-pane,.comments-panel){background:#111925!important;color:var(--dark-text)!important;border-color:var(--dark-line)!important}
html[data-theme="dark"] :is(.word-ribbon-group,.word-style-gallery button,.word-icon-button,.word-share-button){border-color:var(--dark-line)!important;color:var(--dark-text-2)!important}
html[data-theme="dark"] :is(.word-style-gallery button,.word-icon-button):hover{background:var(--dark-hover)!important;color:#fff!important}
html[data-theme="dark"] .word-workspace{background:#080d13!important}
html[data-theme="dark"] .word-ruler{background:#182230!important;border-color:#35475d!important;color:#aebbd0!important}
html[data-theme="dark"] .word-navigation-pane :is(button,a):hover{background:var(--dark-hover)!important}
html[data-theme="dark"] .word-statusbar input[type="range"]{accent-color:var(--dark-primary-strong)}

/* Spreadsheet workspace */
html[data-theme="dark"] :is(.gs-app,.sheet-app,.spreadsheet-app){background:var(--dark-canvas)!important;color:var(--dark-text)!important}
html[data-theme="dark"] :is(.sheet-titlebar,.sheet-menubar,.sheet-toolbar,.formula-bar,.sheet-tabs,.sheet-status){background:#111925!important;color:var(--dark-text)!important;border-color:var(--dark-line)!important}
html[data-theme="dark"] :is(.gs-cell,.sheet-cell){background:#111925!important;color:#eef3f9!important;border-color:#2b3b50!important}
html[data-theme="dark"] :is(.gs-row-header,.gs-col-header,.sheet-head){background:#172332!important;color:#bac8d8!important;border-color:#35485f!important}
html[data-theme="dark"] :is(.gs-cell.active-cell,.gs-cell.selected,.sheet-cell.selected){background:#173754!important;box-shadow:inset 0 0 0 2px #5ca9ef!important}
html[data-theme="dark"] :is(.gs-grid,.sheet-viewport){background:#0a1018!important}
html[data-theme="dark"] :is(.sheet-menu,.sheet-dropdown,.sheet-context-menu){background:#172231!important;color:var(--dark-text)!important;border-color:var(--dark-line-strong)!important;box-shadow:var(--dark-shadow-3)!important}

/* Search, people, knowledge, tasks, plans and permissions */
html[data-theme="dark"] :is(.workspace-search-group,.workspace-search-start,.knowledge-grid,.task-column,.route-selector,.request-mode-switch){background:var(--dark-surface-2)!important;border-color:var(--dark-line)!important;color:var(--dark-text)!important}
html[data-theme="dark"] :is(.search-hit,.people-card,.knowledge-card,.task-card,.approval-stage){background:var(--dark-surface)!important;border-color:var(--dark-line)!important;color:var(--dark-text)!important}
html[data-theme="dark"] .request-mode-switch>a{background:var(--dark-raised)!important;color:var(--dark-text-2)!important;border-color:var(--dark-line)!important}
html[data-theme="dark"] .request-mode-switch>a[aria-current="page"]{background:var(--dark-primary-container)!important;color:#dcecff!important;border-color:#3f78a8!important}

/* Settings and profile */
html[data-theme="dark"] :is(.appearance-theme-card,.profile-photo-field,.profile-settings .profile-preview,.profile-info-grid>label){background:var(--dark-surface)!important;border-color:var(--dark-line)!important;color:var(--dark-text)!important}
html[data-theme="dark"] .appearance-theme-card.active{background:#162c43!important;border-color:#4c91cb!important;box-shadow:0 0 0 3px rgba(114,183,255,.12)!important}
html[data-theme="dark"] .profile-photo-field-icon{background:#173754!important;color:#cce5ff!important}
html[data-theme="dark"] .profile-photo-select{background:#246faf!important;color:#fff!important;border-color:#377fbc!important}
html[data-theme="dark"] .profile-photo-adjust{background:var(--dark-raised)!important;color:var(--dark-text)!important;border-color:var(--dark-line-strong)!important}
html[data-theme="dark"] .profile-crop-dialog{background:var(--dark-surface)!important;color:var(--dark-text)!important;border-color:var(--dark-line-strong)!important;box-shadow:var(--dark-shadow-3)!important}
html[data-theme="dark"] .profile-crop-stage-wrap{background:#05090e!important}

/* Notification centre */
html[data-theme="dark"] :is(.notification-centre,.notification-workspace){background:var(--dark-canvas)!important}
html[data-theme="dark"] :is(.notification-card,.notification-item,.notification-summary-card,.notification-filterbar){background:var(--dark-surface)!important;color:var(--dark-text)!important;border-color:var(--dark-line)!important}
html[data-theme="dark"] :is(.notification-card,.notification-item).unread{background:#13263a!important;border-color:#315879!important}

/* Secure login and security screens */
html[data-theme="dark"] .secure-access-login{background:radial-gradient(circle at 28% 12%,rgba(44,91,129,.18),transparent 38%),#090f16!important}
html[data-theme="dark"] :is(.secure-login-shell,.secure-login-panel,.secure-panel-inner,.login-card){background:var(--dark-surface)!important;color:var(--dark-text)!important;border-color:var(--dark-line)!important}
html[data-theme="dark"] :is(.secure-calendar-panel,.secure-briefing-panel){background:linear-gradient(145deg,#0c2944,#102a45 54%,#2d3224)!important;color:#f6f9fc!important}
html[data-theme="dark"] :is(.briefing-card,.briefing-feed,.district-briefing-card){background:rgba(8,18,29,.45)!important;border-color:rgba(204,224,242,.17)!important;color:#fff!important}
html[data-theme="dark"] .secure-support{background:#0f1722!important;color:var(--dark-muted)!important;border-color:var(--dark-line)!important}
html[data-theme="dark"] .authorised-use-notice{background:var(--dark-surface-2)!important;border-color:var(--dark-line)!important;color:var(--dark-text-2)!important}
html[data-theme="dark"] .setup-details{background:var(--dark-surface-2)!important;border-color:var(--dark-line)!important;color:var(--dark-text)!important}
html[data-theme="dark"] .setup-details span,
html[data-theme="dark"] .setup-help{color:var(--dark-muted)!important}

/* System appearance on compact/mobile devices */
@media(max-width:900px){
 html[data-theme="dark"] .page{background:var(--dark-canvas)!important}
 html[data-theme="dark"] .app-sidebar{box-shadow:28px 0 70px rgba(0,0,0,.55)!important}
 html[data-theme="dark"] .nav-scrim{background:rgba(0,5,12,.78)!important;backdrop-filter:blur(3px)}
 html[data-theme="dark"] :is(.modal,.dialog-card,dialog[open]){border-color:#40546d!important}
}

/* Higher contrast: keep hierarchy but strengthen text/strokes */
@media(prefers-contrast:more){
 html[data-theme="dark"]{
   --dark-text:#fff;--dark-text-2:#f2f5f9;--dark-muted:#c7d2df;
   --dark-line:#53677f;--dark-line-strong:#7087a2;--focus:rgba(132,199,255,.62);
 }
 html[data-theme="dark"] :is(input,select,textarea,.btn,.panel,.dashboard-card,.metric-card){border-width:2px!important}
}

/* Keep official/legal print/document paper genuinely white. */
html[data-theme="dark"] :is(
 .official-letter,.certificate,.action-plan-paper,.letter-review-paper,.certificate-paper,
 .document-page,.internal-memo-paper,.permission-request-paper,.memo-document-paper,
 .certificate-approved-master,.official-document-paper
){background:#fff!important;color:#101418!important;color-scheme:light!important;filter:none!important}
html[data-theme="dark"] :is(
 .official-letter,.certificate,.action-plan-paper,.letter-review-paper,.certificate-paper,
 .document-page,.internal-memo-paper,.permission-request-paper,.memo-document-paper,.official-document-paper
) :is(h1,h2,h3,h4,h5,h6,p,span,strong,b,small,li,td,th,label){color:inherit!important}

/* Additional specialist workspaces with historically literal light surfaces. */
html[data-theme="dark"] :is(.feature-catalogue,.feature-policy-panel){background:var(--dark-surface)!important;border-color:var(--dark-line)!important;box-shadow:var(--dark-shadow-1)!important}
html[data-theme="dark"] .feature-catalogue>header,
html[data-theme="dark"] .feature-policy-heading{background:var(--dark-surface-2)!important;border-color:var(--dark-line)!important}
html[data-theme="dark"] .feature-policy-heading p,
html[data-theme="dark"] .feature-access-item small,
html[data-theme="dark"] .policy-section-title p,
html[data-theme="dark"] .grant-box>header small,
html[data-theme="dark"] .people-grant-list small,
html[data-theme="dark"] .feature-policy-footer span{color:var(--dark-muted)!important}
html[data-theme="dark"] .feature-access-item{color:var(--dark-text-2)!important}
html[data-theme="dark"] .feature-access-item:hover{background:var(--dark-hover)!important}
html[data-theme="dark"] .feature-access-item.active{background:var(--dark-primary-container)!important;color:#fff!important;box-shadow:inset 3px 0 #72b7ff!important}
html[data-theme="dark"] .feature-access-icon{background:var(--dark-raised)!important;color:#b8dcff!important}
html[data-theme="dark"] :is(.policy-choice span,.grant-box,.role-chip-grid span,.people-search,.people-grant-list,.feature-policy-footer){background:var(--dark-surface-2)!important;border-color:var(--dark-line)!important;color:var(--dark-text-2)!important}
html[data-theme="dark"] .policy-choice input:checked+span{background:var(--dark-primary-container)!important;border-color:#4c91cb!important;box-shadow:0 0 0 2px rgba(114,183,255,.12)!important}
html[data-theme="dark"] .role-chip-grid input:checked+span{background:#246faf!important;border-color:#4c91cb!important;color:#fff!important}
html[data-theme="dark"] .people-grant-list>label{border-color:var(--dark-line)!important}

html[data-theme="dark"] :is(.report-register-metrics>div,.report-register-card,.report-register-filters,.report-builder-main,.report-builder-side>*,.report-submit-card,.report-control-rail>section,.report-control-rail>form,.report-preview-toolbar){background:var(--dark-surface)!important;color:var(--dark-text)!important;border-color:var(--dark-line)!important;box-shadow:var(--dark-shadow-1)!important}
html[data-theme="dark"] .report-register-table th{background:var(--dark-surface-2)!important;color:var(--dark-muted)!important}
html[data-theme="dark"] .report-register-table td{border-color:var(--dark-line)!important;color:var(--dark-text-2)!important}
html[data-theme="dark"] :is(.recipient-choice,.recipient-list label){background:var(--dark-surface-2)!important;border-color:var(--dark-line)!important;color:var(--dark-text-2)!important}
html[data-theme="dark"] :is(.recipient-choice,.recipient-list label):has(input:checked){background:var(--dark-primary-container)!important;border-color:#4c91cb!important}
html[data-theme="dark"] .report-paper-stage{background:#080d13!important}
html[data-theme="dark"] .report-control-rail p{color:var(--dark-muted)!important}

html[data-theme="dark"] :is(.annual-roster-notice,.annual-roster-toolbar,.annual-roster-metrics>*,.month-distribution-panel,.annual-roster-guidance,.annual-leave-selection-card,.annual-leave-recorded-card){background:var(--dark-surface)!important;color:var(--dark-text)!important;border-color:var(--dark-line)!important}
html[data-theme="dark"] .annual-roster-register :is(th,td){border-color:var(--dark-line)!important}

html[data-theme="dark"] :is(.school-directory,.school-card,.school-profile-card,.guided-report-launch,.visit-authoring-page .panel,.school-data-page .panel){background:var(--dark-surface)!important;color:var(--dark-text)!important;border-color:var(--dark-line)!important}

html[data-theme="dark"] .onboarding-public{background:var(--dark-canvas)!important;color:var(--dark-text)!important}
html[data-theme="dark"] .onboarding-public main{background:var(--dark-canvas)!important}
html[data-theme="dark"] :is(.public-brand,.onboarding-form section,.onboarding-complete){background:var(--dark-surface)!important;color:var(--dark-text)!important;border-color:var(--dark-line)!important;box-shadow:var(--dark-shadow-1)!important}
html[data-theme="dark"] .public-hero{background:linear-gradient(135deg,#0e2c48,#164e79)!important;color:#fff!important}
html[data-theme="dark"] .form-heading,
html[data-theme="dark"] .onboarding-public p{color:var(--dark-muted)!important}

html[data-theme="dark"] :is(.offline-notice,.offline-form-notice,.offline-workspace-card,.sync-centre-card,.saved-work-card){background:var(--dark-surface)!important;color:var(--dark-text)!important;border-color:var(--dark-line)!important}
html[data-theme="dark"] :is(.sync-centre-modal,.saved-work-modal){background:var(--dark-surface-2)!important;color:var(--dark-text)!important;border-color:var(--dark-line-strong)!important;box-shadow:var(--dark-shadow-3)!important}

html[data-theme="dark"] :is(.collab-shell,.collaboration-workspace,.collaboration-sidebar,.collaboration-toolbar,.collaboration-channel-list){background:var(--dark-surface)!important;color:var(--dark-text)!important;border-color:var(--dark-line)!important}
html[data-theme="dark"] :is(.collaboration-channel,.channel-row,.message-file,.collaboration-file-card){background:var(--dark-surface-2)!important;color:var(--dark-text-2)!important;border-color:var(--dark-line)!important}
