/* Theme behavior:
   - System Default follows the existing mobile device/browser dark preference.
   - Light Mode suppresses automatic dark mode.
   - Dark Mode applies the same dark palette site-wide on all screen sizes. */
@media (max-width: 850px) and (prefers-color-scheme: dark) {
html.theme-dark{
    color-scheme: dark;
    --paper:#0f1724;
    --ink:#edf2f7;
    --white:#172235;
    --line:#334155;
    --ok:#55b77a;
    --soh-ink:#edf2f7;
    --soh-muted:#aab6c8;
    --soh-surface:#172235;
    --soh-surface-soft:#111c2c;
    --soh-border:#334155;
    --ui-text:#edf2f7;
    --ui-text-muted:#aab6c8;
    --ui-surface:#172235;
    --ui-surface-soft:#111c2c;
    --ui-border:#334155;
    --ui-border-light:#29384c;
    --ui-primary:#8fb3ff;
    --ui-primary-soft:#172a49;
    --surface:#172235;
    --border:#334155;
    --border-color:#334155;
    --text-muted:#aab6c8;
    --muted:#aab6c8;
  }
html.theme-dark,html.theme-dark body{background:#0f1724;color:#edf2f7}
html.theme-dark body,html.theme-dark .app-content{background:#0f1724;color:#edf2f7}
html.theme-dark .site-footer,html.theme-dark .muted,html.theme-dark small,html.theme-dark .page-heading p,html.theme-dark .member-identity p,html.theme-dark .table-subtext{color:#aab6c8}
html.theme-dark .card,html.theme-dark .ui-card,html.theme-dark .ui-card-soft,html.theme-dark .summary-chip,html.theme-dark .checkin-member,html.theme-dark .sticky-save,html.theme-dark .choice-card,html.theme-dark .result-details-panel,html.theme-dark .result-detail-meta>div,html.theme-dark .result-feedback-card,html.theme-dark .result-private-section p,html.theme-dark .eservices-confirmation,html.theme-dark .oflight-syllabus-guide,html.theme-dark .oflight-syllabus-columns article,html.theme-dark .oflight-cadet-syllabus,html.theme-dark .oflight-selected-guide,html.theme-dark .oflight-dashboard-grid article,html.theme-dark .oflight-operations-grid article,html.theme-dark .oflight-resource-grid>*,html.theme-dark .oflight-readiness-card,html.theme-dark .event-detail-sidebar,html.theme-dark .online-user-card,html.theme-dark .chat-panel,html.theme-dark .chat-message,html.theme-dark .chat-compose,html.theme-dark .chat-emoji-picker,html.theme-dark .modal,html.theme-dark .app-modal,html.theme-dark details.card,html.theme-dark dialog{background:#172235;color:#edf2f7;border-color:#334155}
html.theme-dark .ui-card-soft,html.theme-dark .check-grid,html.theme-dark .inactive-member,html.theme-dark .oflight-syllabus-guide,html.theme-dark .result-private-section,html.theme-dark .result-empty-feedback,html.theme-dark .promotion-finalize-header,html.theme-dark .promotion-table-intro,html.theme-dark .result-detail-heading,html.theme-dark .event-detail-sidebar,html.theme-dark .chat-messages{background:#111c2c}
html.theme-dark h1,html.theme-dark h2,html.theme-dark h3,html.theme-dark h4,html.theme-dark h5,html.theme-dark h6,html.theme-dark .choice-card h2,html.theme-dark .cadet-name,html.theme-dark .feedback-card-label,html.theme-dark .result-detail-meta strong,html.theme-dark .oflight-counts-header,html.theme-dark .oflight-syllabus-guide>summary,html.theme-dark .oflight-counts-summary,html.theme-dark .oflight-history-summary{color:#edf2f7}
html.theme-dark a:not(.btn):not(.sidebar-link):not(.sidebar-brand){color:#8fb3ff}
html.theme-dark input,html.theme-dark select,html.theme-dark textarea{
    background:#0f1a2a;
    color:#edf2f7;
    border-color:#475569;
  }
html.theme-dark input::placeholder,html.theme-dark textarea::placeholder{color:#7f8da3}
html.theme-dark input:disabled,html.theme-dark select:disabled,html.theme-dark textarea:disabled{background:#172235;color:#8996aa}
html.theme-dark table{color:#edf2f7}
html.theme-dark th{background:#1d2b40;color:#bcd0ff;border-color:#334155}
html.theme-dark td{border-color:#334155}
html.theme-dark tbody tr:hover{background:#1a2940}
html.theme-dark .oflight-report-table thead th,html.theme-dark .oflight-report-table thead .cadet-col,html.theme-dark .oflight-report-table thead .actions-col{background:#1d2b40;color:#d6e2f5}
html.theme-dark .oflight-report-table tbody tr:nth-child(odd){background:#152033}
html.theme-dark .oflight-report-table tbody tr:nth-child(even){background:#19263a}
html.theme-dark .oflight-report-table tbody tr:hover{background:#263650}
html.theme-dark .oflight-report-wrap{background:#172235;border-color:#334155}
html.theme-dark .btn-secondary,html.theme-dark .status-btn,html.theme-dark .chat-emoji-toggle{background:#263449;color:#edf2f7;border-color:#475569}
html.theme-dark .btn-secondary:hover,html.theme-dark .status-btn:hover,html.theme-dark .chat-emoji-toggle:hover{background:#314159}
html.theme-dark .sidebar-account>div{background:#172235;border-color:#334155}
html.theme-dark .sidebar-account a,html.theme-dark .sidebar-account-action{color:#edf2f7}
html.theme-dark .sidebar-account a:hover,html.theme-dark .sidebar-account-action:hover{background:#263449;color:#fff}
html.theme-dark .alert.success{background:#123222;color:#d8f3e3}
html.theme-dark .alert.error{background:#381821;color:#ffd9df}
html.theme-dark .badge.muted,html.theme-dark .attendance-badge.unmarked{background:#263449;color:#c7d1df}
html.theme-dark .oflight-cadet-summary,html.theme-dark .syllabus-display{background:#111c2c;color:#edf2f7}
html.theme-dark .private-note-field{background:#2c2515;border-color:#806a2d}
html.theme-dark .oflight-cadet-feedback{background:#142a20}
html.theme-dark .oflight-cadet-prep{background:rgba(74,110,190,.18)}
html.theme-dark .oflight-selected-guide{background:rgba(23,34,53,.96);border-color:#3e5c8f}
html.theme-dark .oflight-selected-guide>header{background:#1b2d4b}
html.theme-dark .oflight-guide-callout{background:rgba(255,205,0,.12)}
html.theme-dark .oflight-center-nav{background:#111c2c;border-color:#334155}
html.theme-dark .online-user-card,html.theme-dark .role-presence-admin,html.theme-dark .role-presence-command,html.theme-dark .role-presence-training,html.theme-dark .role-presence-cadet-staff,html.theme-dark .role-presence-senior,html.theme-dark .role-presence-pilot{background:#172235}
html.theme-dark .chat-message.is-mine{background:#1b2d4b}
html.theme-dark .chat-core-values-notice{background:#352d13;color:#f4e5a4;border-color:#675722}
html.theme-dark .chat-compose{border-color:#334155}
html.theme-dark .chat-message-head time,html.theme-dark .chat-empty{color:#9aa8bb}
html.theme-dark .login-page{background:linear-gradient(135deg,#071226,#0b2046)}
html.theme-dark .login-card{background:#172235;color:#edf2f7;box-shadow:0 18px 50px rgba(0,0,0,.55)}
/* Keep semantic status pills recognizable in dark mode. */
html.theme-dark .oflight-metrics .metric-available.metric-full{background:#5b1625;color:#ffdbe2;border-color:#e65773}
html.theme-dark .oflight-metrics .metric-available:not(.metric-full),html.theme-dark .oflight-metrics .metric-approved{background:#173925;color:#c8f3d7;border-color:#4a9b68}
html.theme-dark .oflight-metrics .metric-interested{background:#493c13;color:#ffe9a0;border-color:#a98918}
html.theme-dark .oflight-metrics .metric-front{background:#152f52;color:#c6e1ff;border-color:#477db8}
html.theme-dark .oflight-metrics .metric-back{background:#392143;color:#efcef7;border-color:#89599a}
/* Message Board */
html.theme-dark .forum-categories,html.theme-dark .forum-topic-row,html.theme-dark .forum-post,html.theme-dark .forum-reply-box,html.theme-dark .forum-admin-category-list .form-card{background:#172235;color:#edf2f7;border-color:#334155}
html.theme-dark .forum-category-link:hover,html.theme-dark .forum-category-link.is-active,html.theme-dark .forum-post-author{background:#111c2c;color:#edf2f7}
html.theme-dark .forum-topic-row:hover{background:#1a2940}
html.theme-dark .forum-post-author{border-color:#334155}
html.theme-dark .forum-post-meta{border-color:#334155}
html.theme-dark .forum-reply-box{background:#111c2c}
}

html.theme-dark{
    color-scheme: dark;
    --paper:#0f1724;
    --ink:#edf2f7;
    --white:#172235;
    --line:#334155;
    --ok:#55b77a;
    --soh-ink:#edf2f7;
    --soh-muted:#aab6c8;
    --soh-surface:#172235;
    --soh-surface-soft:#111c2c;
    --soh-border:#334155;
    --ui-text:#edf2f7;
    --ui-text-muted:#aab6c8;
    --ui-surface:#172235;
    --ui-surface-soft:#111c2c;
    --ui-border:#334155;
    --ui-border-light:#29384c;
    --ui-primary:#8fb3ff;
    --ui-primary-soft:#172a49;
    --surface:#172235;
    --border:#334155;
    --border-color:#334155;
    --text-muted:#aab6c8;
    --muted:#aab6c8;
  }
html.theme-dark,html.theme-dark body{background:#0f1724;color:#edf2f7}
html.theme-dark body,html.theme-dark .app-content{background:#0f1724;color:#edf2f7}
html.theme-dark .site-footer,html.theme-dark .muted,html.theme-dark small,html.theme-dark .page-heading p,html.theme-dark .member-identity p,html.theme-dark .table-subtext{color:#aab6c8}
html.theme-dark .card,html.theme-dark .ui-card,html.theme-dark .ui-card-soft,html.theme-dark .summary-chip,html.theme-dark .checkin-member,html.theme-dark .sticky-save,html.theme-dark .choice-card,html.theme-dark .result-details-panel,html.theme-dark .result-detail-meta>div,html.theme-dark .result-feedback-card,html.theme-dark .result-private-section p,html.theme-dark .eservices-confirmation,html.theme-dark .oflight-syllabus-guide,html.theme-dark .oflight-syllabus-columns article,html.theme-dark .oflight-cadet-syllabus,html.theme-dark .oflight-selected-guide,html.theme-dark .oflight-dashboard-grid article,html.theme-dark .oflight-operations-grid article,html.theme-dark .oflight-resource-grid>*,html.theme-dark .oflight-readiness-card,html.theme-dark .event-detail-sidebar,html.theme-dark .online-user-card,html.theme-dark .chat-panel,html.theme-dark .chat-message,html.theme-dark .chat-compose,html.theme-dark .chat-emoji-picker,html.theme-dark .modal,html.theme-dark .app-modal,html.theme-dark details.card,html.theme-dark dialog{background:#172235;color:#edf2f7;border-color:#334155}
html.theme-dark .ui-card-soft,html.theme-dark .check-grid,html.theme-dark .inactive-member,html.theme-dark .oflight-syllabus-guide,html.theme-dark .result-private-section,html.theme-dark .result-empty-feedback,html.theme-dark .promotion-finalize-header,html.theme-dark .promotion-table-intro,html.theme-dark .result-detail-heading,html.theme-dark .event-detail-sidebar,html.theme-dark .chat-messages{background:#111c2c}
html.theme-dark h1,html.theme-dark h2,html.theme-dark h3,html.theme-dark h4,html.theme-dark h5,html.theme-dark h6,html.theme-dark .choice-card h2,html.theme-dark .cadet-name,html.theme-dark .feedback-card-label,html.theme-dark .result-detail-meta strong,html.theme-dark .oflight-counts-header,html.theme-dark .oflight-syllabus-guide>summary,html.theme-dark .oflight-counts-summary,html.theme-dark .oflight-history-summary{color:#edf2f7}
html.theme-dark a:not(.btn):not(.sidebar-link):not(.sidebar-brand){color:#8fb3ff}
html.theme-dark input,html.theme-dark select,html.theme-dark textarea{
    background:#0f1a2a;
    color:#edf2f7;
    border-color:#475569;
  }
html.theme-dark input::placeholder,html.theme-dark textarea::placeholder{color:#7f8da3}
html.theme-dark input:disabled,html.theme-dark select:disabled,html.theme-dark textarea:disabled{background:#172235;color:#8996aa}
html.theme-dark table{color:#edf2f7}
html.theme-dark th{background:#1d2b40;color:#bcd0ff;border-color:#334155}
html.theme-dark td{border-color:#334155}
html.theme-dark tbody tr:hover{background:#1a2940}
html.theme-dark .oflight-report-table thead th,html.theme-dark .oflight-report-table thead .cadet-col,html.theme-dark .oflight-report-table thead .actions-col{background:#1d2b40;color:#d6e2f5}
html.theme-dark .oflight-report-table tbody tr:nth-child(odd){background:#152033}
html.theme-dark .oflight-report-table tbody tr:nth-child(even){background:#19263a}
html.theme-dark .oflight-report-table tbody tr:hover{background:#263650}
html.theme-dark .oflight-report-wrap{background:#172235;border-color:#334155}
html.theme-dark .btn-secondary,html.theme-dark .status-btn,html.theme-dark .chat-emoji-toggle{background:#263449;color:#edf2f7;border-color:#475569}
html.theme-dark .btn-secondary:hover,html.theme-dark .status-btn:hover,html.theme-dark .chat-emoji-toggle:hover{background:#314159}
html.theme-dark .sidebar-account>div{background:#172235;border-color:#334155}
html.theme-dark .sidebar-account a,html.theme-dark .sidebar-account-action{color:#edf2f7}
html.theme-dark .sidebar-account a:hover,html.theme-dark .sidebar-account-action:hover{background:#263449;color:#fff}
html.theme-dark .alert.success{background:#123222;color:#d8f3e3}
html.theme-dark .alert.error{background:#381821;color:#ffd9df}
html.theme-dark .badge.muted,html.theme-dark .attendance-badge.unmarked{background:#263449;color:#c7d1df}
html.theme-dark .oflight-cadet-summary,html.theme-dark .syllabus-display{background:#111c2c;color:#edf2f7}
html.theme-dark .private-note-field{background:#2c2515;border-color:#806a2d}
html.theme-dark .oflight-cadet-feedback{background:#142a20}
html.theme-dark .oflight-cadet-prep{background:rgba(74,110,190,.18)}
html.theme-dark .oflight-selected-guide{background:rgba(23,34,53,.96);border-color:#3e5c8f}
html.theme-dark .oflight-selected-guide>header{background:#1b2d4b}
html.theme-dark .oflight-guide-callout{background:rgba(255,205,0,.12)}
html.theme-dark .oflight-center-nav{background:#111c2c;border-color:#334155}
html.theme-dark .online-user-card,html.theme-dark .role-presence-admin,html.theme-dark .role-presence-command,html.theme-dark .role-presence-training,html.theme-dark .role-presence-cadet-staff,html.theme-dark .role-presence-senior,html.theme-dark .role-presence-pilot{background:#172235}
html.theme-dark .chat-message.is-mine{background:#1b2d4b}
html.theme-dark .chat-core-values-notice{background:#352d13;color:#f4e5a4;border-color:#675722}
html.theme-dark .chat-compose{border-color:#334155}
html.theme-dark .chat-message-head time,html.theme-dark .chat-empty{color:#9aa8bb}
html.theme-dark .login-page{background:linear-gradient(135deg,#071226,#0b2046)}
html.theme-dark .login-card{background:#172235;color:#edf2f7;box-shadow:0 18px 50px rgba(0,0,0,.55)}
/* Keep semantic status pills recognizable in dark mode. */
html.theme-dark .oflight-metrics .metric-available.metric-full{background:#5b1625;color:#ffdbe2;border-color:#e65773}
html.theme-dark .oflight-metrics .metric-available:not(.metric-full),html.theme-dark .oflight-metrics .metric-approved{background:#173925;color:#c8f3d7;border-color:#4a9b68}
html.theme-dark .oflight-metrics .metric-interested{background:#493c13;color:#ffe9a0;border-color:#a98918}
html.theme-dark .oflight-metrics .metric-front{background:#152f52;color:#c6e1ff;border-color:#477db8}
html.theme-dark .oflight-metrics .metric-back{background:#392143;color:#efcef7;border-color:#89599a}
/* Message Board */
html.theme-dark .forum-categories,html.theme-dark .forum-topic-row,html.theme-dark .forum-post,html.theme-dark .forum-reply-box,html.theme-dark .forum-admin-category-list .form-card{background:#172235;color:#edf2f7;border-color:#334155}
html.theme-dark .forum-category-link:hover,html.theme-dark .forum-category-link.is-active,html.theme-dark .forum-post-author{background:#111c2c;color:#edf2f7}
html.theme-dark .forum-topic-row:hover{background:#1a2940}
html.theme-dark .forum-post-author{border-color:#334155}
html.theme-dark .forum-post-meta{border-color:#334155}
html.theme-dark .forum-reply-box{background:#111c2c}


/* Comprehensive dark-mode surface normalization.
   Keeps semantic status/role colors intact while eliminating pale backgrounds with light text. */
html.theme-dark :where(
 .form-card,.form-grid,.table-wrap,.data-table,.dashboard-card,.dashboard-panel,
 .page-section,.section-card,.content-panel,.detail-panel,.info-panel,.summary-panel,
 .member-card,.member-row,.member-detail,.member-profile,.member-directory-card,
 .promotion-cadet-card,.promotion-card-progress,.promotion-requirements-details,
 .promotion-requirement-list,.promotion-requirement-item,.promotion-history-section,
 .event-card,.event-detail-card,.event-response-group,.event-response-list,.event-response-item,
 .attendance-card,.attendance-summary,.attendance-table-card,.attendance-member-row,
 .meeting-card,.training-plan-card,.training-plan-section,.activity-card,
 .drill-card,.drill-record-card,.drill-test-card,.pt-card,.pt-record-card,
 .report-card,.report-section,.report-summary,.report-filter-bar,
 .useful-link-card,.useful-links-page,.useful-link-admin-row,
 .profile-photo-page,.profile-theme-form,.profile-membership-form,.profile-signature-form,
 .theme-choice,.profile-photo-preview,
 .forum-page,.forum-categories,.forum-category-link,.forum-topic-row,.forum-post,.forum-post-author,
 .forum-reply-box,.forum-topic-modal,.forum-post-editor,.forum-attachment,
 .oflight-card,.oflight-flight-card,.oflight-assignment-card,.oflight-history-card,
 .oflight-schedule-card,.oflight-syllabus-card,.oflight-admin-card,
 .modal-card,.dialog-card,.empty-state
){
 background:#172235 !important;
 color:#edf2f7 !important;
 border-color:#334155 !important;
}

html.theme-dark :where(
 .card-header,.card-footer,.section-heading-row,.section-heading,
 .promotion-table-intro,.promotion-card-progress-heading,
 .forum-topic-heading,.forum-post-meta,.event-detail-sidebar,
 .useful-link-icon,.profile-photo-placeholder
){
 color:#edf2f7;
 border-color:#334155;
}

html.theme-dark :where(
 .muted,.field-help,.table-subtext,.forum-author-stat-label,
 .forum-author-stat-value,.forum-post-date,.useful-link-card p,
 .promotion-cadet-meta,.promotion-eyebrow,.theme-choice small
){
 color:#aab6c8 !important;
}

html.theme-dark :where(
 input,select,textarea,.compact-search input,
 .form-card input,.form-card select,.form-card textarea,
 .profile-theme-form input,.profile-theme-form select,.profile-theme-form textarea
){
 background:#0f1a2a !important;
 color:#edf2f7 !important;
 border-color:#475569 !important;
}

html.theme-dark :where(
 input::placeholder,textarea::placeholder
){
 color:#7f8da3 !important;
}

html.theme-dark :where(
 .btn-secondary,.status-btn,.link-button:not(.danger),
 .forum-emoji-toggle,.theme-choice
){
 background:#263449 !important;
 color:#edf2f7 !important;
 border-color:#475569 !important;
}

html.theme-dark :where(
 .forum-category-link:hover,.forum-topic-row:hover,
 .useful-link-card:hover,.theme-choice:hover
){
 background:#1a2940 !important;
}

/* Preserve readable contrast on common pale utility surfaces. */
html.theme-dark :where(
 .login-identity,.summary-chip,.check-grid,.result-empty-feedback,
 .promotion-finalize-header,.result-detail-heading,
 .chat-messages,.oflight-cadet-summary,.syllabus-display,
 .inactive-member,.ui-card-soft
){
 background:#111c2c !important;
 color:#edf2f7 !important;
 border-color:#334155 !important;
}

/* Mobile/system dark mode receives the same normalization. */
@media (max-width:850px) and (prefers-color-scheme:dark){
 html.theme-dark :where(
  .form-card,.form-grid,.table-wrap,.data-table,.dashboard-card,.dashboard-panel,
  .page-section,.section-card,.content-panel,.detail-panel,.info-panel,.summary-panel,
  .member-card,.member-row,.member-detail,.member-profile,.member-directory-card,
  .promotion-cadet-card,.promotion-card-progress,.promotion-requirements-details,
  .promotion-requirement-list,.promotion-requirement-item,.promotion-history-section,
  .event-card,.event-detail-card,.event-response-group,.event-response-list,.event-response-item,
  .attendance-card,.attendance-summary,.attendance-table-card,.attendance-member-row,
  .meeting-card,.training-plan-card,.training-plan-section,.activity-card,
  .drill-card,.drill-record-card,.drill-test-card,.pt-card,.pt-record-card,
  .report-card,.report-section,.report-summary,.report-filter-bar,
  .useful-link-card,.useful-links-page,.useful-link-admin-row,
  .profile-photo-page,.profile-theme-form,.profile-membership-form,.profile-signature-form,
  .theme-choice,.profile-photo-preview,
  .forum-page,.forum-categories,.forum-category-link,.forum-topic-row,.forum-post,.forum-post-author,
  .forum-reply-box,.forum-topic-modal,.forum-post-editor,.forum-attachment,
  .oflight-card,.oflight-flight-card,.oflight-assignment-card,.oflight-history-card,
  .oflight-schedule-card,.oflight-syllabus-card,.oflight-admin-card,
  .modal-card,.dialog-card,.empty-state
 ){
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
 }
 html.theme-dark :where(
  input,select,textarea,.compact-search input,
  .form-card input,.form-card select,.form-card textarea
 ){
  background:#0f1a2a !important;
  color:#edf2f7 !important;
  border-color:#475569 !important;
 }
 html.theme-dark :where(
  .muted,.field-help,.table-subtext,.forum-author-stat-label,
  .forum-author-stat-value,.theme-choice small
 ){
  color:#aab6c8 !important;
 }
}


/* Targeted dark-mode fixes for components with explicit light backgrounds/text. */
html.theme-dark .promotion-achievement-block,
html.theme-dark .legacy-achievement-panel,
html.theme-dark .legacy-achievement-row,
html.theme-dark .test-facts,
html.theme-dark .option-delete-form{
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
}
html.theme-dark .promotion-achievement-block strong,
html.theme-dark .legacy-achievement-panel h3,
html.theme-dark .legacy-achievement-row strong{
  color:#edf2f7 !important;
}
html.theme-dark .promotion-achievement-block .promotion-eyebrow{
  color:#aab6c8 !important;
}
html.theme-dark .legacy-achievement-row{
  border-top-color:#334155 !important;
}

/* Catch remaining explicitly pale content surfaces that commonly pair with inherited light text. */
html.theme-dark :where(
 .promotion-achievement-block,
 .legacy-achievement-panel,
 .legacy-achievement-row,
 .test-facts,
 .fact-card,
 .status-card,
 .metric-card,
 .info-card,
 .detail-card,
 .summary-card,
 .filter-card,
 .toolbar-card,
 .results-card,
 .progress-card,
 .history-card,
 .archive-card,
 .resource-card,
 .assignment-card,
 .schedule-card,
 .instruction-card,
 .guide-card
){
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
}
html.theme-dark :where(
 .promotion-achievement-block strong,
 .legacy-achievement-panel h1,
 .legacy-achievement-panel h2,
 .legacy-achievement-panel h3,
 .legacy-achievement-row strong,
 .fact-card strong,
 .status-card strong,
 .metric-card strong,
 .info-card strong,
 .detail-card strong,
 .summary-card strong
){
  color:#edf2f7 !important;
}

/* Same targeted coverage for System Default dark mode on mobile. */
@media (max-width:850px) and (prefers-color-scheme:dark){
 html.theme-dark :where(
  .promotion-achievement-block,
  .legacy-achievement-panel,
  .legacy-achievement-row,
  .test-facts,
  .fact-card,
  .status-card,
  .metric-card,
  .info-card,
  .detail-card,
  .summary-card,
  .filter-card,
  .toolbar-card,
  .results-card,
  .progress-card,
  .history-card,
  .archive-card,
  .resource-card,
  .assignment-card,
  .schedule-card,
  .instruction-card,
  .guide-card
 ){
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
 }
 html.theme-dark .promotion-achievement-block strong,
 html.theme-dark .legacy-achievement-panel h3,
 html.theme-dark .legacy-achievement-row strong{
  color:#edf2f7 !important;
 }
 html.theme-dark .promotion-achievement-block .promotion-eyebrow{
  color:#aab6c8 !important;
 }
}


/* Dark-mode table normalization: headers, cells, stripes, mobile table cards. */
html.theme-dark table,
html.theme-dark thead,
html.theme-dark tbody,
html.theme-dark tfoot,
html.theme-dark tr,
html.theme-dark th,
html.theme-dark td{
  color:#edf2f7 !important;
  border-color:#334155 !important;
}
html.theme-dark table,
html.theme-dark tbody,
html.theme-dark td{
  background:#172235 !important;
}
html.theme-dark thead,
html.theme-dark th{
  background:#1d2b40 !important;
  color:#d8e5ff !important;
}
html.theme-dark tbody tr:nth-child(odd) td{
  background:#152033 !important;
}
html.theme-dark tbody tr:nth-child(even) td{
  background:#19263a !important;
}
html.theme-dark tbody tr:hover td{
  background:#263650 !important;
}
html.theme-dark tfoot,
html.theme-dark tfoot td,
html.theme-dark tfoot th{
  background:#111c2c !important;
  color:#edf2f7 !important;
}
html.theme-dark :where(
 .table-wrap,.responsive-table,.data-table,.admin-table,.member-table,
 .attendance-table,.promotion-table,.report-table,.drill-table,.pt-table,
 .event-table,.oflight-report-table,.oflight-report-wrap
){
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
}
html.theme-dark :where(
 .mobile-table-row,.table-card-row,.responsive-table-row,
 [data-label]
){
  border-color:#334155 !important;
}
html.theme-dark :where(
 .mobile-table-row,.table-card-row,.responsive-table-row
){
  background:#172235 !important;
  color:#edf2f7 !important;
}
html.theme-dark :where(
 .mobile-table-row:nth-child(odd),.table-card-row:nth-child(odd),.responsive-table-row:nth-child(odd)
){
  background:#152033 !important;
}
html.theme-dark :where(
 .mobile-table-row:nth-child(even),.table-card-row:nth-child(even),.responsive-table-row:nth-child(even)
){
  background:#19263a !important;
}
html.theme-dark td::before,
html.theme-dark [data-label]::before{
  color:#aab6c8 !important;
}

/* System Default dark mode on mobile gets the same table treatment. */
@media (max-width:850px) and (prefers-color-scheme:dark){
 html.theme-dark table,
 html.theme-dark thead,
 html.theme-dark tbody,
 html.theme-dark tfoot,
 html.theme-dark tr,
 html.theme-dark th,
 html.theme-dark td{
  color:#edf2f7 !important;
  border-color:#334155 !important;
 }
 html.theme-dark table,
 html.theme-dark tbody,
 html.theme-dark td{
  background:#172235 !important;
 }
 html.theme-dark thead,
 html.theme-dark th{
  background:#1d2b40 !important;
  color:#d8e5ff !important;
 }
 html.theme-dark tbody tr:nth-child(odd) td{
  background:#152033 !important;
 }
 html.theme-dark tbody tr:nth-child(even) td{
  background:#19263a !important;
 }
 html.theme-dark tbody tr:hover td{
  background:#263650 !important;
 }
 html.theme-dark tfoot,
 html.theme-dark tfoot td,
 html.theme-dark tfoot th{
  background:#111c2c !important;
  color:#edf2f7 !important;
 }
 html.theme-dark :where(
  .table-wrap,.responsive-table,.data-table,.admin-table,.member-table,
  .attendance-table,.promotion-table,.report-table,.drill-table,.pt-table,
  .event-table,.oflight-report-table,.oflight-report-wrap,
  .mobile-table-row,.table-card-row,.responsive-table-row
 ){
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
 }
 html.theme-dark td::before,
 html.theme-dark [data-label]::before{
  color:#aab6c8 !important;
 }
}


/* Dark-mode card normalization across the Hub. */
html.theme-dark :where(
 .card,.ui-card,.ui-card-soft,.form-card,
 .dashboard-card,.dashboard-panel,.summary-card,.summary-chip,
 .member-card,.member-row,.member-detail,.member-profile,.member-directory-card,
 .promotion-cadet-card,.promotion-card-progress,.promotion-requirements-details,
 .promotion-requirement-item,.promotion-history-section,.promotion-achievement-block,
 .event-card,.event-detail-card,.event-response-group,.event-response-item,
 .meeting-card,.training-plan-card,.training-plan-section,.activity-card,
 .attendance-card,.attendance-summary,.attendance-member-row,
 .drill-card,.drill-record-card,.drill-test-card,
 .pt-card,.pt-record-card,
 .report-card,.report-section,.report-summary,
 .useful-link-card,.useful-links-page,.useful-link-admin-row,
 .profile-photo-page,.profile-theme-form,.profile-membership-form,.profile-signature-form,
 .forum-page,.forum-categories,.forum-topic-row,.forum-post,.forum-reply-box,.forum-attachment,
 .oflight-card,.oflight-flight-card,.oflight-assignment-card,.oflight-history-card,
 .oflight-schedule-card,.oflight-syllabus-card,.oflight-admin-card,.oflight-readiness-card,
 .status-card,.metric-card,.info-card,.detail-card,.results-card,.progress-card,.history-card,
 .archive-card,.resource-card,.assignment-card,.schedule-card,.instruction-card,.guide-card,
 .mobile-card,.mobile-list-card,.table-card-row
){
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
  box-shadow:0 8px 22px rgba(0,0,0,.18);
}

html.theme-dark :where(
 .card h1,.card h2,.card h3,.card h4,.card h5,.card h6,
 .ui-card h1,.ui-card h2,.ui-card h3,.ui-card h4,.ui-card h5,.ui-card h6,
 .dashboard-card strong,.member-card strong,.promotion-cadet-card strong,
 .event-card strong,.meeting-card strong,.training-plan-card strong,
 .attendance-card strong,.drill-card strong,.pt-card strong,.report-card strong,
 .useful-link-card strong,.forum-post strong,.oflight-card strong,
 .status-card strong,.metric-card strong,.info-card strong,.detail-card strong
){
  color:#edf2f7 !important;
}

html.theme-dark :where(
 .card .muted,.ui-card .muted,.dashboard-card .muted,.member-card .muted,
 .promotion-cadet-card .muted,.event-card .muted,.meeting-card .muted,
 .training-plan-card .muted,.attendance-card .muted,.drill-card .muted,
 .pt-card .muted,.report-card .muted,.useful-link-card .muted,
 .forum-post .muted,.oflight-card .muted
){
  color:#aab6c8 !important;
}

/* Hover states should stay dark rather than reverting to pale surfaces. */
html.theme-dark :where(
 .card:hover,.dashboard-card:hover,.member-card:hover,.promotion-cadet-card:hover,
 .event-card:hover,.meeting-card:hover,.training-plan-card:hover,.attendance-card:hover,
 .drill-card:hover,.pt-card:hover,.report-card:hover,.useful-link-card:hover,
 .forum-topic-row:hover,.oflight-card:hover
){
  background:#1a2940 !important;
  border-color:#475569 !important;
}

/* Preserve semantic/status cards where stronger colors are intentional. */
html.theme-dark :where(
 .alert.success,.alert.error,.alert.warning,
 .metric-full,.status-danger,.status-warning,.status-success,
 .role-presence-admin,.role-presence-commander,.role-presence-training-officer,
 .role-presence-cadet-staff,.role-presence-cadet,.role-presence-prospect,
 .role-presence-member,.role-presence-pilot
){
  box-shadow:none;
}

/* System Default dark mode on mobile gets the same card treatment. */
@media (max-width:850px) and (prefers-color-scheme:dark){
 html.theme-dark :where(
  .card,.ui-card,.ui-card-soft,.form-card,
  .dashboard-card,.dashboard-panel,.summary-card,.summary-chip,
  .member-card,.member-row,.member-detail,.member-profile,.member-directory-card,
  .promotion-cadet-card,.promotion-card-progress,.promotion-requirements-details,
  .promotion-requirement-item,.promotion-history-section,.promotion-achievement-block,
  .event-card,.event-detail-card,.event-response-group,.event-response-item,
  .meeting-card,.training-plan-card,.training-plan-section,.activity-card,
  .attendance-card,.attendance-summary,.attendance-member-row,
  .drill-card,.drill-record-card,.drill-test-card,
  .pt-card,.pt-record-card,
  .report-card,.report-section,.report-summary,
  .useful-link-card,.useful-links-page,.useful-link-admin-row,
  .profile-photo-page,.profile-theme-form,.profile-membership-form,.profile-signature-form,
  .forum-page,.forum-categories,.forum-topic-row,.forum-post,.forum-reply-box,.forum-attachment,
  .oflight-card,.oflight-flight-card,.oflight-assignment-card,.oflight-history-card,
  .oflight-schedule-card,.oflight-syllabus-card,.oflight-admin-card,.oflight-readiness-card,
  .status-card,.metric-card,.info-card,.detail-card,.results-card,.progress-card,.history-card,
  .archive-card,.resource-card,.assignment-card,.schedule-card,.instruction-card,.guide-card,
  .mobile-card,.mobile-list-card,.table-card-row
 ){
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
 }
 html.theme-dark :where(
  .card h1,.card h2,.card h3,.card h4,.card h5,.card h6,
  .ui-card h1,.ui-card h2,.ui-card h3,.ui-card h4,.ui-card h5,.ui-card h6,
  .dashboard-card strong,.member-card strong,.promotion-cadet-card strong,
  .event-card strong,.meeting-card strong,.training-plan-card strong,
  .attendance-card strong,.drill-card strong,.pt-card strong,.report-card strong,
  .useful-link-card strong,.forum-post strong,.oflight-card strong
 ){
  color:#edf2f7 !important;
 }
 html.theme-dark :where(
  .card .muted,.ui-card .muted,.dashboard-card .muted,.member-card .muted,
  .promotion-cadet-card .muted,.event-card .muted,.meeting-card .muted,
  .training-plan-card .muted,.attendance-card .muted,.drill-card .muted,
  .pt-card .muted,.report-card .muted,.useful-link-card .muted,
  .forum-post .muted,.oflight-card .muted
 ){
  color:#aab6c8 !important;
 }
}


/* ========================================================================
   Deep dark-mode audit fixes
   Covers explicit pale inner surfaces that generic card/table rules miss.
   ======================================================================== */

/* Demo-role preview: use dark role-tinted surfaces with readable text. */
html.theme-dark .demo-view-bar{
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#475569 !important;
}
html.theme-dark .demo-view-bar strong,
html.theme-dark .demo-view-bar span,
html.theme-dark .demo-view-bar label{
  color:#edf2f7 !important;
}
html.theme-dark .demo-view-bar.demo-role-admin{background:#3b1720 !important;border-color:#ba0c2f !important}
html.theme-dark .demo-view-bar.demo-role-commander{background:#2f2145 !important;border-color:#9a62cf !important}
html.theme-dark .demo-view-bar.demo-role-training_officer{background:#22294a !important;border-color:#7698e0 !important}
html.theme-dark .demo-view-bar.demo-role-cadet_staff,
html.theme-dark .demo-view-bar.demo-role-cadet{background:#1d3523 !important;border-color:#91c486 !important}
html.theme-dark .demo-view-bar.demo-role-prospect{background:#393112 !important;border-color:#d2ad16 !important}
html.theme-dark .demo-view-bar.demo-role-member,
html.theme-dark .demo-view-bar.demo-role-senior_member,
html.theme-dark .demo-view-bar.demo-role-senior{background:#402914 !important;border-color:#e58a2f !important}
html.theme-dark .demo-view-bar.demo-role-pilot{background:#17343a !important;border-color:#64b8c7 !important}
html.theme-dark .demo-view-form select{
  background:#0f1a2a !important;
  color:#edf2f7 !important;
  border-color:#64748b !important;
}

/* Generic collapsible/accordion surfaces in content areas. */
html.theme-dark .app-content :where(
 details.ui-accordion,
 details.archived-section,
 details.promotion-requirements-details,
 details.duty-category-block,
 .org-chart-tabs>details,
 .role-permission-grid details,
 .oflight-syllabus-guide,
 details.oflight-assignment-flight,
 details.oflight-add-cadet-panel,
 details.card
){
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
}
html.theme-dark .app-content :where(
 details.ui-accordion>summary,
 details.archived-section>summary,
 details.promotion-requirements-details>summary,
 details.duty-category-block>summary,
 .org-chart-tabs>details>summary,
 .role-permission-grid details>summary,
 .oflight-syllabus-guide>summary,
 details.oflight-assignment-flight>summary,
 details.oflight-add-cadet-panel>summary,
 details.card>summary
){
  background:#1d2b40 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
}
html.theme-dark .app-content :where(
 details.ui-accordion[open]>summary,
 details.archived-section[open]>summary,
 details.promotion-requirements-details[open]>summary,
 details.duty-category-block[open]>summary,
 .org-chart-tabs>details[open]>summary,
 .oflight-syllabus-guide[open]>summary,
 details.oflight-assignment-flight[open]>summary,
 details.oflight-add-cadet-panel[open]>summary
){
  background:#263650 !important;
  color:#fff !important;
}
html.theme-dark .promotion-requirements-details>summary::before,
html.theme-dark .checklist-chevron{
  background:#334155 !important;
  color:#edf2f7 !important;
}

/* Promotion cards: normalize every nested pale surface, not just the outer card. */
html.theme-dark .promotion-cadet-card,
html.theme-dark .promotion-cadet-header,
html.theme-dark .promotion-achievement-block,
html.theme-dark .promotion-card-progress,
html.theme-dark .promotion-requirements-details,
html.theme-dark .promotion-requirements-details>summary,
html.theme-dark .promotion-requirement-list,
html.theme-dark .promotion-requirement-item,
html.theme-dark .promotion-card-actions,
html.theme-dark .promotion-empty-state{
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
}
html.theme-dark .promotion-cadet-header,
html.theme-dark .promotion-card-actions,
html.theme-dark .promotion-requirements-details>summary{
  background:#1d2b40 !important;
}
html.theme-dark .promotion-requirement-item.is-complete{
  background:#183324 !important;
  border-color:#356b48 !important;
}
html.theme-dark .promotion-requirement-status{
  background:#334155 !important;
  color:#edf2f7 !important;
}
html.theme-dark .promotion-requirement-item.is-complete .promotion-requirement-status{
  background:#245337 !important;
  color:#d9f6e3 !important;
}
html.theme-dark .promotion-card-progress .promotion-progress-bar,
html.theme-dark .promotion-progress-step{
  background:#334155 !important;
}
html.theme-dark .promotion-cadet-card :where(h3,strong,.promotion-achievement-block strong){
  color:#edf2f7 !important;
}
html.theme-dark .promotion-cadet-card :where(.promotion-cadet-meta,.promotion-eyebrow,.promotion-requirement-copy small){
  color:#aab6c8 !important;
}

/* Drill Tests / Drill Records / evaluation controls. */
html.theme-dark :where(
 .drill-test-card,
 .command-score-card,
 .evaluation-summary-panel,
 .supplement-selector,
 .phone-command-sequence,
 .officer-command-checklist,
 .command-chart,
 .selected-test-heading,
 .test-save-bar,
 .testing-officer-tip,
 .test-facts div,
 .checklist-help,
 .info-callout
){
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
}
html.theme-dark :where(
 .phone-command-list li,
 .officer-command-list li
){
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
}
html.theme-dark :where(
 .phone-command-list li:nth-child(even),
 .officer-command-list li:nth-child(even)
){
  background:#1d2b40 !important;
}
html.theme-dark .phone-command-list li::before,
html.theme-dark .sequence-command-number,
html.theme-dark .drill-score-display{
  background:#263650 !important;
  color:#d8e5ff !important;
}
html.theme-dark .officer-command-list label:has(input:checked){
  background:#183324 !important;
  color:#d9f6e3 !important;
}
html.theme-dark .checklist-help{
  color:#aab6c8 !important;
}
html.theme-dark .test-save-bar{
  border-top-color:#5b82c4 !important;
}

/* Menus, dropdown panels, replacement selectors, and option editors. */
html.theme-dark :where(
 .duty-menu-panel,
 .option-delete-form .replacement-choice,
 .sortable-option-row:has(.duty-option-metadata)>.option-delete-form .replacement-choice,
 .sortable-option-row:has(.duty-option-metadata),
 .duty-option-metadata textarea
){
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
}
html.theme-dark .duty-option:hover{
  background:#263650 !important;
}

/* Reports / duty-position / org chart inner cards. */
html.theme-dark :where(
 .report-range-summary,
 .reports-stat-card,
 .report-launch-card,
 .duty-report-row,
 .org-chart-tabs>details,
 .flight-members-node
){
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
}
html.theme-dark .duty-report-row.is-vacant{
  background:#332d17 !important;
  color:#f7e8a5 !important;
  border-color:#806a2d !important;
}

/* Event inner surfaces and roster chips. */
html.theme-dark :where(
 .permission-download-card,
 .event-logistics-grid>div,
 .event-detail-sidebar
){
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
}
html.theme-dark .event-public-roster span,
html.theme-dark .event-public-response-group .event-public-roster span,
html.theme-dark .event-public-response-group h3 span{
  background:#263650 !important;
  color:#edf2f7 !important;
  border-color:#475569 !important;
}

/* O-Flight inner surfaces and collapsibles. */
html.theme-dark :where(
 .oflight-info-grid article,
 .oflight-card,
 .oflight-roster-row,
 .oflight-cadet-summary,
 .oflight-cadet-feedback,
 .oflight-syllabus-guide,
 .oflight-syllabus-columns article,
 .oflight-selected-guide,
 .oflight-standalone-guide,
 .oflight-assignment-editor,
 .oflight-assignment-flight,
 .oflight-assignment-flight-open,
 .oflight-assignment-flight-header,
 .oflight-assignment-cadet-card,
 .oflight-manual-assignment.oflight-add-cadet-panel,
 .oflight-workspace-completed-flight,
 .oflight-past-card,
 .oflight-completed-card,
 .oflight-readiness-card.is-completed
){
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
}
html.theme-dark :where(
 .oflight-assignment-flight>summary,
 .oflight-assignment-flight>summary.oflight-assignment-flight-header,
 .oflight-assignment-flight-header,
 .oflight-add-cadet-panel>summary
){
  background:#1d2b40 !important;
  color:#edf2f7 !important;
}
html.theme-dark :where(
 .oflight-assignment-flight[open]>summary,
 .oflight-assignment-flight[open]>summary.oflight-assignment-flight-header,
 .oflight-add-cadet-panel[open]>summary
){
  background:#263650 !important;
}
html.theme-dark .oflight-assignment-count{
  background:#263650 !important;
  color:#d8e5ff !important;
  border-color:#475569 !important;
}
html.theme-dark .oflight-progress{
  background:#172a49 !important;
  color:#d8e5ff !important;
}
html.theme-dark .oflight-report-table .syllabus-date.complete{
  background:#263650 !important;
  color:#edf2f7 !important;
}

/* Message Board and Chat explicit pale surfaces. */
html.theme-dark :where(
 .forum-category-link,
 .forum-topic-row,
 .chat-panel
){
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
}

/* Attendance mobile table cards and other explicit white rows. */
html.theme-dark .attendance-meetings-table tr{
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
}

/* Miscellaneous explicit pale panels discovered in the audit. */
html.theme-dark :where(
 .compact-requirements-table tr,
 .role-permission-grid details,
 .role-permission-grid summary
){
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
}
html.theme-dark .role-permission-grid summary{
  background:#1d2b40 !important;
}

/* System Default dark mode on mobile: mirror all deep fixes. */
@media (max-width:850px) and (prefers-color-scheme:dark){
 html.theme-dark .demo-view-bar{
  background:#172235 !important;color:#edf2f7 !important;border-color:#475569 !important;
 }
 html.theme-dark .demo-view-bar strong,
 html.theme-dark .demo-view-bar span,
 html.theme-dark .demo-view-bar label{color:#edf2f7 !important}
 html.theme-dark .demo-view-form select{background:#0f1a2a !important;color:#edf2f7 !important;border-color:#64748b !important}

 html.theme-dark .app-content :where(
  details.ui-accordion,details.archived-section,details.promotion-requirements-details,
  details.duty-category-block,.org-chart-tabs>details,.role-permission-grid details,
  .oflight-syllabus-guide,details.oflight-assignment-flight,details.oflight-add-cadet-panel,details.card,
  .promotion-cadet-card,.promotion-cadet-header,.promotion-achievement-block,.promotion-card-progress,
  .promotion-requirement-list,.promotion-requirement-item,.promotion-card-actions,.promotion-empty-state,
  .drill-test-card,.command-score-card,.evaluation-summary-panel,.supplement-selector,
  .phone-command-sequence,.officer-command-checklist,.command-chart,.selected-test-heading,
  .test-save-bar,.testing-officer-tip,.test-facts div,.checklist-help,.info-callout,
  .duty-menu-panel,.option-delete-form .replacement-choice,
  .reports-stat-card,.report-launch-card,.duty-report-row,.permission-download-card,
  .event-logistics-grid>div,.oflight-info-grid article,.oflight-roster-row,
  .oflight-assignment-editor,.oflight-assignment-flight,.oflight-assignment-cadet-card,
  .forum-category-link,.forum-topic-row,.chat-panel,.attendance-meetings-table tr
 ){
  background:#172235 !important;color:#edf2f7 !important;border-color:#334155 !important;
 }

 html.theme-dark .app-content :where(
  details.ui-accordion>summary,details.archived-section>summary,
  details.promotion-requirements-details>summary,details.duty-category-block>summary,
  .org-chart-tabs>details>summary,.role-permission-grid details>summary,
  .oflight-syllabus-guide>summary,details.oflight-assignment-flight>summary,
  details.oflight-add-cadet-panel>summary,.promotion-cadet-header,.promotion-card-actions
 ){
  background:#1d2b40 !important;color:#edf2f7 !important;border-color:#334155 !important;
 }

 html.theme-dark :where(
  .phone-command-list li,.officer-command-list li
 ){
  background:#172235 !important;color:#edf2f7 !important;border-color:#334155 !important;
 }
 html.theme-dark :where(
  .phone-command-list li:nth-child(even),.officer-command-list li:nth-child(even)
 ){
  background:#1d2b40 !important;
 }
}


/* Dark-mode Important Notices */
html.theme-dark .dashboard-notifications{
  background:linear-gradient(135deg,#2a2414 0%,#172235 72%) !important;
  color:#edf2f7 !important;
  border-color:#806a2d !important;
  border-left-color:#ba0c2f !important;
}
html.theme-dark .dashboard-notifications-header .eyebrow{
  color:#e7c66a !important;
}
html.theme-dark .dashboard-notifications-header h2{
  color:#edf2f7 !important;
}
html.theme-dark .dashboard-notification{
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#475569 !important;
}
html.theme-dark .dashboard-notification-copy h3{
  color:#edf2f7 !important;
}
html.theme-dark .dashboard-notification-copy p{
  color:#c7d2e1 !important;
}
html.theme-dark .dashboard-notification-marker{
  background:#263650 !important;
  color:#d8e5ff !important;
}
html.theme-dark .dashboard-notification.notice-important{
  background:#2d2716 !important;
  border-left-color:#d49600 !important;
}
html.theme-dark .dashboard-notification.notice-important .dashboard-notification-marker{
  background:#4a3b12 !important;
  color:#ffe7a3 !important;
}
html.theme-dark .dashboard-notification.notice-urgent{
  background:#321820 !important;
  border-left-color:#ba0c2f !important;
}
html.theme-dark .dashboard-notification.notice-urgent .dashboard-notification-marker{
  background:#ba0c2f !important;
  color:#fff !important;
}

/* System Default dark mode on mobile */
@media (max-width:850px) and (prefers-color-scheme:dark){
 html.theme-dark .dashboard-notifications{
  background:linear-gradient(135deg,#2a2414 0%,#172235 72%) !important;
  color:#edf2f7 !important;
  border-color:#806a2d !important;
  border-left-color:#ba0c2f !important;
 }
 html.theme-dark .dashboard-notifications-header .eyebrow{color:#e7c66a !important}
 html.theme-dark .dashboard-notifications-header h2{color:#edf2f7 !important}
 html.theme-dark .dashboard-notification{
  background:#172235 !important;color:#edf2f7 !important;border-color:#475569 !important;
 }
 html.theme-dark .dashboard-notification-copy h3{color:#edf2f7 !important}
 html.theme-dark .dashboard-notification-copy p{color:#c7d2e1 !important}
 html.theme-dark .dashboard-notification-marker{background:#263650 !important;color:#d8e5ff !important}
 html.theme-dark .dashboard-notification.notice-important{background:#2d2716 !important;border-left-color:#d49600 !important}
 html.theme-dark .dashboard-notification.notice-important .dashboard-notification-marker{background:#4a3b12 !important;color:#ffe7a3 !important}
 html.theme-dark .dashboard-notification.notice-urgent{background:#321820 !important;border-left-color:#ba0c2f !important}
 html.theme-dark .dashboard-notification.notice-urgent .dashboard-notification-marker{background:#ba0c2f !important;color:#fff !important}
}


/* Mission & Event Management dark-mode normalization */
html.theme-dark :where(
 .event-summary-card,
 .event-stat-grid .stat-card,
 .event-list-filters,
 .event-management-row,
 .event-management-row:hover,
 .event-row-past,
 .event-row-past:hover,
 .event-collapsible,
 .event-collapsible>summary,
 .event-roster-table,
 .event-roster-table tr,
 .event-roster-table td,
 .event-roster-table th,
 .event-logistics-grid>div,
 .event-detail-sidebar,
 .event-public-response-group,
 .permission-download-card
){
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
}
html.theme-dark .event-list-filters{
  background:#111c2c !important;
}
html.theme-dark .event-management-row:hover{
  background:#263650 !important;
}
html.theme-dark .event-row-past,
html.theme-dark .event-row-past:hover{
  background:#1b2534 !important;
  color:#aab6c8 !important;
  border-left-color:#697586 !important;
}
html.theme-dark .event-metrics span,
html.theme-dark .event-row-metrics span,
html.theme-dark .event-public-roster span,
html.theme-dark .event-public-response-group h3 span,
html.theme-dark .event-public-response-group .event-public-roster span{
  background:#263650 !important;
  color:#edf2f7 !important;
  border-color:#475569 !important;
}
html.theme-dark :where(
 .event-collapsible select,
 .event-collapsible input[type="text"],
 .event-collapsible input:not([type]),
 .event-roster-table select,
 #attendance select,
 #attendance input[type="text"],
 #attendance input:not([type])
){
  background:#0f1a2a !important;
  color:#edf2f7 !important;
  border-color:#475569 !important;
}
html.theme-dark .event-collapsible>summary{
  background:#1d2b40 !important;
}
html.theme-dark .event-collapsible[open]>summary{
  background:#263650 !important;
}

/* System Default dark mode on mobile */
@media (max-width:850px) and (prefers-color-scheme:dark){
 html.theme-dark :where(
  .event-summary-card,
  .event-stat-grid .stat-card,
  .event-list-filters,
  .event-management-row,
  .event-management-row:hover,
  .event-row-past,
  .event-row-past:hover,
  .event-collapsible,
  .event-collapsible>summary,
  .event-roster-table,
  .event-roster-table tr,
  .event-roster-table td,
  .event-roster-table th,
  .event-logistics-grid>div,
  .event-detail-sidebar,
  .event-public-response-group,
  .permission-download-card
 ){
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
 }
 html.theme-dark .event-list-filters{background:#111c2c !important}
 html.theme-dark .event-management-row:hover{background:#263650 !important}
 html.theme-dark .event-row-past,
 html.theme-dark .event-row-past:hover{
  background:#1b2534 !important;color:#aab6c8 !important;border-left-color:#697586 !important;
 }
 html.theme-dark .event-metrics span,
 html.theme-dark .event-row-metrics span,
 html.theme-dark .event-public-roster span,
 html.theme-dark .event-public-response-group h3 span,
 html.theme-dark .event-public-response-group .event-public-roster span{
  background:#263650 !important;color:#edf2f7 !important;border-color:#475569 !important;
 }
 html.theme-dark :where(
  .event-collapsible select,
  .event-collapsible input[type="text"],
  .event-collapsible input:not([type]),
  .event-roster-table select,
  #attendance select,
  #attendance input[type="text"],
  #attendance input:not([type])
 ){
  background:#0f1a2a !important;color:#edf2f7 !important;border-color:#475569 !important;
 }
 html.theme-dark .event-collapsible>summary{background:#1d2b40 !important}
 html.theme-dark .event-collapsible[open]>summary{background:#263650 !important}
}

html.theme-dark .forum-online-person.role-presence-parent{background:#17343a!important;color:#c6eef4!important;border-color:#64b8c7!important}

/* Parent role remains light pink in dark mode for system-wide consistency. */
html.theme-dark .role-pill-parent,
html.theme-dark .user-accounts-page .user-role-pill.role-pill-parent{background:#5a2f40!important;color:#ffdce9!important;border-color:#c97999!important}
html.theme-dark .role-avatar-parent{background:#6b344a!important;color:#ffe3ed!important}
html.theme-dark .forum-online-person.role-presence-parent,
html.theme-dark .online-user-card.role-presence-parent{background:#492938!important;color:#ffdce9!important;border-color:#c97999!important}
html.theme-dark .forum-role-key-item.role-presence-parent{color:#f0a9c4!important}
html.theme-dark .role-permissions-reference .role-parent summary{background:#5a2f40!important;color:#ffdce9!important;border-color:#c97999!important}


html.theme-dark .promotion-cadet-meta .promotion-phase-badge{
 background:#1d3158;border-color:#456394;color:#dbe8ff;box-shadow:none
}


/* Promotions insignia/edit polish */
html.theme-dark .promotion-achievement-badge{filter:drop-shadow(0 2px 4px rgba(0,0,0,.45))}
html.theme-dark .promotion-stage-checklist legend{color:#dbe8ff}
html.theme-dark .promotion-progress-step{background:#344154;border-color:#46546a}
html.theme-dark .promotion-stage-checklist legend{color:#dbe8ff}
html.theme-dark .promotion-progress-step{background:#344154;border-color:#46546a}


/* Member Bio dark mode */
html.theme-dark .bio-meta-chips span,html.theme-dark .bio-meta-chips span,html.theme-dark .bio-tabs a,html.theme-dark .bio-tabs a,html.theme-dark .bio-item-meta span,html.theme-dark .bio-item-meta span{background:#27344a;color:#eef3fb}html.theme-dark .bio-tabs a.active,html.theme-dark .bio-tabs a.active{background:#4f78c7;color:#fff}html.theme-dark .bio-item-card,html.theme-dark .bio-item-card,html.theme-dark .member-recognition-card,html.theme-dark .member-recognition-card{background:#182235;border-color:#33425a}html.theme-dark .bio-photo-wrap,html.theme-dark .bio-photo-wrap{background:#27344a;color:#dce8ff}html.theme-dark .bio-signature,html.theme-dark .bio-signature,html.theme-dark .bio-facts div,html.theme-dark .bio-facts div,html.theme-dark .bio-timeline article,html.theme-dark .bio-timeline article,html.theme-dark .bio-manage-items>div,html.theme-dark .bio-manage-items>div{border-color:#33425a}

/* Member bio links */
html.theme-dark .forum-author-bio-link,html.theme-dark .forum-online-person-link,html.theme-dark .online-user-bio-link,html.theme-dark .forum-author-bio-link,html.theme-dark .forum-online-person-link,html.theme-dark .online-user-bio-link{color:inherit}


/* 2026-07-22 — Promotions commander review and segmented track dark mode */
html.theme-dark .promotion-progress-steps,html.theme-dark .promotion-progress-steps{background:#0f1928!important}
html.theme-dark .promotion-progress-step,html.theme-dark .promotion-progress-step{background:#465264!important}
html.theme-dark .promotion-review-ready-badge,html.theme-dark .promotion-review-ready-badge{background:#172a46!important;border-color:#46658d!important;color:#d8e8ff!important}
html.theme-dark .promotion-commander-review-heading,html.theme-dark .promotion-commander-review-heading,
html.theme-dark .promotion-edit-review-heading,html.theme-dark .promotion-edit-review-heading{background:#15243a!important;border-color:#3d587d!important;color:#d8e8ff!important}
html.theme-dark .promotion-commander-review-heading span,html.theme-dark .promotion-commander-review-heading span,
html.theme-dark .promotion-edit-review-heading small,html.theme-dark .promotion-edit-review-heading small{color:#b8c8dc!important}
html.theme-dark .promotion-requirement-item.is-commander-review,html.theme-dark .promotion-requirement-item.is-commander-review,
html.theme-dark .promotion-dynamic-item.is-commander-review,html.theme-dark .promotion-dynamic-item.is-commander-review{background:#111f32!important;border-color:#3d587d!important}


/* FINAL Promotions segmented-bar colors in dark mode */
html.theme-dark .promotion-card-progress.is-zero .promotion-progress-steps .promotion-progress-step.is-filled,
html.theme-dark .promotion-card-progress.is-zero .promotion-progress-steps .promotion-progress-step.is-filled{
  background:#BA0C2F !important;
}
html.theme-dark .promotion-card-progress.is-low .promotion-progress-steps .promotion-progress-step.is-filled,
html.theme-dark .promotion-card-progress.is-low .promotion-progress-steps .promotion-progress-step.is-filled{
  background:#E87722 !important;
}
html.theme-dark .promotion-card-progress.is-partial .promotion-progress-steps .promotion-progress-step.is-filled,
html.theme-dark .promotion-card-progress.is-partial .promotion-progress-steps .promotion-progress-step.is-filled{
  background:#FFCD00 !important;
}
html.theme-dark .promotion-card-progress.is-complete .promotion-progress-steps .promotion-progress-step.is-filled,
html.theme-dark .promotion-card-progress.is-complete .promotion-progress-steps .promotion-progress-step.is-filled{
  background:#2E8540 !important;
}
html.theme-dark .promotion-card-progress .promotion-progress-steps .promotion-progress-step:not(.is-filled),
html.theme-dark .promotion-card-progress .promotion-progress-steps .promotion-progress-step:not(.is-filled){
  background:#465264 !important;
}


/* Promotions readiness card states and filters in dark mode */
html.theme-dark .promotion-cadet-card.is-review-ready,
html.theme-dark .promotion-cadet-card.is-review-ready{
  background:#3a3211 !important;
  border-color:#d6ad16 !important;
}
html.theme-dark .promotion-cadet-card.is-ready,
html.theme-dark .promotion-cadet-card.is-ready{
  background:#173823 !important;
  border-color:#4ca866 !important;
}
html.theme-dark .promotion-status-filter,
html.theme-dark .promotion-status-filter{
  color:#cbd5e1;
}
html.theme-dark .promotion-status-filter select,
html.theme-dark .promotion-status-filter select{
  background:#172033;
  color:#f8fafc;
  border-color:#46546a;
}


/* Completed achievement displays in dark mode */
html.theme-dark .bio-current-achievement,
html.theme-dark .bio-current-achievement,
html.theme-dark .forum-author-achievement,
html.theme-dark .forum-author-achievement{
  background:#172033;
  border-color:#334155;
}
html.theme-dark .bio-current-achievement span,
html.theme-dark .bio-current-achievement span,
html.theme-dark .forum-author-achievement span,
html.theme-dark .forum-author-achievement span{
  color:#94a3b8;
}
html.theme-dark .bio-current-achievement strong,
html.theme-dark .bio-current-achievement strong,
html.theme-dark .forum-author-achievement strong,
html.theme-dark .forum-author-achievement strong{
  color:#f8fafc;
}


html.theme-dark .forum-author-achievement-text,
html.theme-dark .forum-author-achievement-text{
  background:#172033;
  border-color:#334155;
}
html.theme-dark .forum-author-achievement-text span,
html.theme-dark .forum-author-achievement-text span{color:#94a3b8}
html.theme-dark .forum-author-achievement-text strong,
html.theme-dark .forum-author-achievement-text strong{color:#f8fafc}


/* 2026-07-22 — AUTHORITATIVE Promotions segmented progress bar dark-mode fix */
html.theme-dark .promotion-card-progress .promotion-progress-steps,
html.theme-dark .promotion-card-progress .promotion-progress-steps{
  background:#465264 !important;
}
html.theme-dark .promotion-card-progress .promotion-progress-steps .promotion-progress-step,
html.theme-dark .promotion-card-progress .promotion-progress-steps .promotion-progress-step{
  background:#465264 !important;
}
html.theme-dark .promotion-card-progress .promotion-progress-steps .promotion-progress-step + .promotion-progress-step,
html.theme-dark .promotion-card-progress .promotion-progress-steps .promotion-progress-step + .promotion-progress-step{
  border-left-color:rgba(15,25,40,.72) !important;
}
html.theme-dark .promotion-card-progress.is-zero .promotion-progress-steps .promotion-progress-step.is-filled,
html.theme-dark .promotion-card-progress.is-zero .promotion-progress-steps .promotion-progress-step.is-filled{background:#BA0C2F !important;}
html.theme-dark .promotion-card-progress.is-low .promotion-progress-steps .promotion-progress-step.is-filled,
html.theme-dark .promotion-card-progress.is-low .promotion-progress-steps .promotion-progress-step.is-filled{background:#E87722 !important;}
html.theme-dark .promotion-card-progress.is-partial .promotion-progress-steps .promotion-progress-step.is-filled,
html.theme-dark .promotion-card-progress.is-partial .promotion-progress-steps .promotion-progress-step.is-filled{background:#FFCD00 !important;}
html.theme-dark .promotion-card-progress.is-complete .promotion-progress-steps .promotion-progress-step.is-filled,
html.theme-dark .promotion-card-progress.is-complete .promotion-progress-steps .promotion-progress-step.is-filled{background:#2E8540 !important;}

/* 2026-07-22 — Complete Demo Role Preview dark palette alignment, including Parent. */
html.theme-dark .demo-view-bar.demo-role-parent{background:#402131!important;border-color:#e7a9bf!important}

@media (prefers-color-scheme: dark){.forum-post-edit-popover{background:#111827;border-color:#374151}.forum-action-pill{background:#111827;border-color:#4b5563;color:#e5e7eb}.forum-action-delete{background:#3b1111;border-color:#7f1d1d;color:#fecaca}}

@media (prefers-color-scheme: dark){
 .forum-post-editor-inline>summary.forum-action-pill,
 .forum-post-editor-inline[open]>summary.forum-action-pill{
  background:#111827!important;
  border-color:#4b5563!important;
  color:#e5e7eb!important;
 }
}
html.theme-dark .forum-post-editor-inline>summary.forum-action-pill,
html.theme-dark .forum-post-editor-inline[open]>summary.forum-action-pill{
 background:#111827!important;
 border-color:#4b5563!important;
 color:#e5e7eb!important;
}

/* ========================================================================== 
   V6.3 theme hardening — system-wide dark surface safety net
   Prevents legacy light backgrounds from pairing with dark-theme light text.
   ========================================================================== */
html.theme-dark{color-scheme:dark;}
html.theme-dark body,html.theme-dark .app-content{background:#0f1724;color:#edf2f7;}
html.theme-dark :where(
  .card,.ui-card,.form-card,.panel,.content-panel,.widget,.box,.section-card,
  .summary-card,.metric-card,.dashboard-card,.member-card,.profile-card,.bio-card,
  .settings-card,.report-card,.admin-card,.resource-card,.event-card,.meeting-card,
  .promotion-card,.drill-card,.pt-card,.attendance-card,.oflight-card,
  .table-wrap,.table-container,.table-responsive,.data-table-wrap,
  .modal,.app-modal,dialog,details.card,
  .forum-categories,.forum-topic-row,.forum-post,.forum-reply-box,
  .chat-panel,.chat-message,.chat-compose,.chat-emoji-picker,
  .online-user-card,.event-detail-sidebar,.inactive-members-toggle,
  .settings-tabs,.dropdown-list-nav,.sortable-option-row,.inline-save-bar,
  .profile-photo-page,.profile-photo-form,.profile-drag-crop-form
){background-color:#172235;color:#edf2f7;border-color:#334155;}

html.theme-dark :where(
  .ui-card-soft,.surface-soft,.subcard,.inner-card,.nested-card,.well,.callout,
  .check-grid,.chat-messages,.forum-post-author,.forum-reply-box,
  .result-private-section,.result-empty-feedback,.promotion-finalize-header,
  .promotion-table-intro,.result-detail-heading,.oflight-center-nav
){background-color:#111c2c;color:#edf2f7;border-color:#334155;}

html.theme-dark :where(input,select,textarea,.inline-edit-control,[contenteditable="true"]){
  background-color:#0f1a2a;color:#edf2f7;border-color:#475569;
}
html.theme-dark :where(input,select,textarea,.inline-edit-control):focus{background-color:#111f32;color:#fff;}
html.theme-dark :where(input,select,textarea)::placeholder{color:#7f8da3;}
html.theme-dark :where(input,select,textarea):disabled{background-color:#172235;color:#8996aa;}
html.theme-dark :where(.muted,small,.field-help,.help-text,.page-heading p,.table-subtext){color:#aab6c8;}
html.theme-dark :where(h1,h2,h3,h4,h5,h6,label,legend,summary){color:#edf2f7;}
html.theme-dark table{background:#172235;color:#edf2f7;}
html.theme-dark tbody tr:nth-child(odd) td{background:#152033;color:#edf2f7;}
html.theme-dark tbody tr:nth-child(even) td{background:#19263a;color:#edf2f7;}
html.theme-dark tbody tr:hover td,html.theme-dark tbody tr:focus-within td{background:#263650;color:#fff;}
html.theme-dark td{border-color:#334155;}
html.theme-dark code,html.theme-dark pre{background:#0b1320;color:#dbe7ff;border-color:#334155;}

/* Apply the same hardened dark layer to System Default on any screen size. */
@media (prefers-color-scheme: dark){
  html.theme-system{color-scheme:dark;}
  html.theme-system body,html.theme-system .app-content{background:#0f1724;color:#edf2f7;}
  html.theme-system :where(
    .card,.ui-card,.form-card,.panel,.content-panel,.widget,.box,.section-card,
    .summary-card,.metric-card,.dashboard-card,.member-card,.profile-card,.bio-card,
    .settings-card,.report-card,.admin-card,.resource-card,.event-card,.meeting-card,
    .promotion-card,.drill-card,.pt-card,.attendance-card,.oflight-card,
    .table-wrap,.table-container,.table-responsive,.data-table-wrap,
    .modal,.app-modal,dialog,details.card,
    .forum-categories,.forum-topic-row,.forum-post,.forum-reply-box,
    .chat-panel,.chat-message,.chat-compose,.chat-emoji-picker,
    .online-user-card,.event-detail-sidebar,.inactive-members-toggle,
    .settings-tabs,.dropdown-list-nav,.sortable-option-row,.inline-save-bar,
    .profile-photo-page,.profile-photo-form,.profile-drag-crop-form
  ){background-color:#172235;color:#edf2f7;border-color:#334155;}
  html.theme-system :where(input,select,textarea,.inline-edit-control,[contenteditable="true"]){background-color:#0f1a2a;color:#edf2f7;border-color:#475569;}
  html.theme-system :where(.muted,small,.field-help,.help-text,.page-heading p,.table-subtext){color:#aab6c8;}
  html.theme-system table{background:#172235;color:#edf2f7;}
  html.theme-system tbody tr:nth-child(odd) td{background:#152033;color:#edf2f7;}
  html.theme-system tbody tr:nth-child(even) td{background:#19263a;color:#edf2f7;}
  html.theme-system tbody tr:hover td,html.theme-system tbody tr:focus-within td{background:#263650;color:#fff;}
  html.theme-system td{border-color:#334155;}
}

/* 2026-07-23 — Authoritative dark-surface contrast fix.
   Covers newer dashboard and Mission & Events components that use pale/silver
   backgrounds outside the legacy generic card/event selectors. */
html.theme-dark .dashboard-section,
html.theme-dark .dashboard-stat-card,
html.theme-dark .dashboard-stat-card.inactive-stat,
html.theme-dark .dashboard-detail-card,
html.theme-dark .next-meeting-details p,
html.theme-dark .security-card {
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
}
html.theme-dark .dashboard-section-heading h2,
html.theme-dark .dashboard-stat-label,
html.theme-dark .dashboard-stat-copy strong,
html.theme-dark .dashboard-stat-copy small,
html.theme-dark .dashboard-stat-card.inactive-stat .dashboard-stat-label,
html.theme-dark .dashboard-stat-card.inactive-stat .dashboard-stat-copy strong,
html.theme-dark .dashboard-stat-card.inactive-stat .dashboard-stat-copy small,
html.theme-dark .next-meeting-details span {
  color:#edf2f7 !important;
}
html.theme-dark .dashboard-intro,
html.theme-dark .next-meeting-details strong,
html.theme-dark .dashboard-section .muted,
html.theme-dark .dashboard-stat-card .muted {
  color:#aab6c8 !important;
}
html.theme-dark .dashboard-stat-icon,
html.theme-dark .dashboard-stat-card.inactive-stat .dashboard-stat-icon {
  background:#263650 !important;
  color:#dbe8ff !important;
}

html.theme-dark .event-list-card,
html.theme-dark .event-list-card-past,
html.theme-dark .event-list-card-past:hover {
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
}
html.theme-dark .event-list-card-past {
  border-left-color:#697586 !important;
}
html.theme-dark .event-list-card-date {
  border-right-color:#475569 !important;
}
html.theme-dark .event-list-card-date strong,
html.theme-dark .event-list-card-heading h3,
html.theme-dark .event-list-card-heading a,
html.theme-dark .event-list-card-details,
html.theme-dark .event-list-card-details strong {
  color:#edf2f7 !important;
}
html.theme-dark .event-list-card-date span,
html.theme-dark .event-list-card .muted,
html.theme-dark .event-list-card-past .muted {
  color:#aab6c8 !important;
}
html.theme-dark .event-list-card-metrics span,
html.theme-dark .event-list-card .status-badge {
  background:#263650 !important;
  color:#edf2f7 !important;
  border-color:#475569 !important;
}

/* Other common pale/silver legacy surfaces that can otherwise retain low-contrast
   light backgrounds when nested inside modern pages. */
html.theme-dark :where(
  .past-meetings-section,
  .check-grid,
  .result-empty-feedback,
  .result-private-section,
  .compact-progress .promotion-progress-bar,
  .promotion-progress-bar,
  .forum-post-author,
  .forum-reply-box,
  .chat-workspace,
  .chat-thread,
  .chat-conversation-item,
  .chat-user-avatar
) {
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
}
html.theme-dark .chat-conversation-item:hover,
html.theme-dark .chat-conversation-item.is-active,
html.theme-dark .chat-conversation-item.is-unread {
  background:#263650 !important;
  color:#edf2f7 !important;
  border-color:#475569 !important;
}

@media (prefers-color-scheme:dark) {
  html.theme-system .dashboard-section,
  html.theme-system .dashboard-stat-card,
  html.theme-system .dashboard-stat-card.inactive-stat,
  html.theme-system .dashboard-detail-card,
  html.theme-system .next-meeting-details p,
  html.theme-system .security-card,
  html.theme-system .event-list-card,
  html.theme-system .event-list-card-past,
  html.theme-system .past-meetings-section,
  html.theme-system .check-grid,
  html.theme-system .result-empty-feedback,
  html.theme-system .result-private-section,
  html.theme-system .forum-post-author,
  html.theme-system .forum-reply-box,
  html.theme-system .chat-workspace,
  html.theme-system .chat-thread,
  html.theme-system .chat-conversation-item,
  html.theme-system .chat-user-avatar {
    background:#172235 !important;
    color:#edf2f7 !important;
    border-color:#334155 !important;
  }
  html.theme-system .dashboard-section-heading h2,
  html.theme-system .dashboard-stat-label,
  html.theme-system .dashboard-stat-copy strong,
  html.theme-system .dashboard-stat-copy small,
  html.theme-system .next-meeting-details span,
  html.theme-system .event-list-card-date strong,
  html.theme-system .event-list-card-heading h3,
  html.theme-system .event-list-card-details {
    color:#edf2f7 !important;
  }
  html.theme-system .dashboard-intro,
  html.theme-system .next-meeting-details strong,
  html.theme-system .event-list-card-date span,
  html.theme-system .event-list-card .muted,
  html.theme-system .event-list-card-past .muted {
    color:#aab6c8 !important;
  }
  html.theme-system .dashboard-stat-icon,
  html.theme-system .dashboard-stat-card.inactive-stat .dashboard-stat-icon,
  html.theme-system .event-list-card-metrics span {
    background:#263650 !important;
    color:#edf2f7 !important;
    border-color:#475569 !important;
  }
  html.theme-system .event-list-card-date { border-right-color:#475569 !important; }
  html.theme-system .event-list-card-past { border-left-color:#697586 !important; }
  html.theme-system .chat-conversation-item:hover,
  html.theme-system .chat-conversation-item.is-active,
  html.theme-system .chat-conversation-item.is-unread {
    background:#263650 !important;
    color:#edf2f7 !important;
    border-color:#475569 !important;
  }
}

/* ========================================================================== */
/* V6.3. dark-mode contrast follow-up — targeted surfaces reported in QA      */
/* ========================================================================== */
html.theme-dark .oflight-my-status{
  background:#123b2b !important;
  border-left-color:#34a66f !important;
  color:#e7f8ef !important;
}
html.theme-dark .oflight-my-status strong{color:#ffffff !important;}

html.theme-dark .event-list-card-date,
html.theme-dark .event-list-card-past .event-list-card-date{
  background:#172235 !important;
  border-color:#475569 !important;
  color:#e5edf8 !important;
}
html.theme-dark .event-list-card-date strong{color:#ffffff !important;}
html.theme-dark .event-list-card-date span{color:#cbd5e1 !important;}

html.theme-dark .promotion-requirement-item.is-commander-review.is-complete{
  background:#123b2b !important;
  border-color:#287b56 !important;
  color:#e7f8ef !important;
}
html.theme-dark .promotion-requirement-item.is-commander-review.is-complete .promotion-requirement-status{
  background:#34a66f !important;
  border-color:#34a66f !important;
  color:#071a11 !important;
}

/* Drill Tests — selection steps, score choices, private notes and score sheet. */
html.theme-dark .testing-officer-workflow,
html.theme-dark .officer-selection-stack,
html.theme-dark .selection-step,
html.theme-dark .selection-step.is-disabled,
html.theme-dark .command-score-card,
html.theme-dark .testing-officer-tip,
html.theme-dark .evaluation-summary-panel,
html.theme-dark .private-notes-panel,
html.theme-dark .score-calculation-actions,
html.theme-dark .selected-test-heading{
  background:#111827 !important;
  border-color:#46556b !important;
  color:#e5edf8 !important;
}
html.theme-dark .selection-step.is-disabled{opacity:.82 !important;}
html.theme-dark .selection-step-copy,
html.theme-dark .selection-step-copy strong,
html.theme-dark .command-score-card h3,
html.theme-dark .evaluation-summary-panel h3,
html.theme-dark .selected-test-heading h2,
html.theme-dark .summary-score-row strong{color:#ffffff !important;}
html.theme-dark .selection-step-copy small,
html.theme-dark .selected-test-heading p,
html.theme-dark .selected-test-heading .eyebrow{color:#cbd5e1 !important;}
html.theme-dark .selection-step select,
html.theme-dark .command-score-card input,
html.theme-dark .command-score-card textarea,
html.theme-dark .private-notes-panel textarea{
  background:#0b1220 !important;
  color:#f8fafc !important;
  border-color:#53627a !important;
}
html.theme-dark .binary-score .score-choice,
html.theme-dark .binary-score label{
  background:#172235 !important;
  border-color:#53627a !important;
  color:#e5edf8 !important;
}
html.theme-dark .binary-score .score-choice-satisfactory:has(input:checked){
  background:#123b2b !important;
  border-color:#34a66f !important;
  color:#dff8e9 !important;
}
html.theme-dark .binary-score .score-choice-unsatisfactory:has(input:checked){
  background:#481827 !important;
  border-color:#ef6680 !important;
  color:#ffe4ea !important;
}
html.theme-dark .score-choice-icon{background:#26354a !important;color:#f8fafc !important;}
html.theme-dark .score-choice-satisfactory:has(input:checked) .score-choice-icon{background:#34a66f !important;color:#071a11 !important;}
html.theme-dark .score-choice-unsatisfactory:has(input:checked) .score-choice-icon{background:#ef6680 !important;color:#25040b !important;}

/* Drill Test Supplements — Topic / Conditions / Passing Score headings. */
html.theme-dark .supplement-facts dt,
html.theme-dark .test-facts.supplement-facts dt{
  color:#ffcd00 !important;
}
html.theme-dark .supplement-facts div,
html.theme-dark .test-facts.supplement-facts div{
  background:#172235 !important;
  border-left-color:#ffcd00 !important;
  color:#e5edf8 !important;
}
html.theme-dark .supplement-facts dd{color:#e5edf8 !important;}

/* Drill Records / Drill Readiness. */
html.theme-dark .analytics-grid,
html.theme-dark .analytics-card,
html.theme-dark .metric-row,
html.theme-dark .manual-evaluations .ui-accordion-content{
  background:#111827 !important;
  color:#e5edf8 !important;
  border-color:#46556b !important;
}
html.theme-dark .analytics-card h3,
html.theme-dark .metric-row strong{color:#ffffff !important;}
html.theme-dark .metric-row{border-bottom-color:#36465c !important;}

/* Message Board / Dashboard live presence. */
html.theme-dark .online-user-grid,
html.theme-dark .online-user-card,
html.theme-dark .online-user-card[class*="role-presence-"]{
  background:#111827 !important;
  color:#e5edf8 !important;
  border-color:#46556b !important;
}
html.theme-dark .online-user-card strong{color:#ffffff !important;}
html.theme-dark .online-user-card small{color:#cbd5e1 !important;}
html.theme-dark .online-user-count{background:#123b2b !important;color:#dff8e9 !important;}

/* Reports — Squadron Overview. */
html.theme-dark .reports-overview,
html.theme-dark .reports-stat-card{
  background:#111827 !important;
  background-image:none !important;
  border-color:#46556b !important;
  color:#e5edf8 !important;
}
html.theme-dark .reports-overview-heading h2,
html.theme-dark .reports-stat-card strong{color:#ffffff !important;}
html.theme-dark .reports-overview-heading p,
html.theme-dark .reports-stat-card span{color:#cbd5e1 !important;}

/* User Accounts — search/filter bar. */
html.theme-dark .user-account-filters,
html.theme-dark .user-account-search,
html.theme-dark .user-account-filters input,
html.theme-dark .user-account-filters select{
  background:#111827 !important;
  color:#f8fafc !important;
  border-color:#46556b !important;
}
html.theme-dark .user-account-filters input::placeholder{color:#94a3b8 !important;}

/* Parent / Guardian Connections. */
html.theme-dark .parent-connections-page,
html.theme-dark .parent-connection-summary>div,
html.theme-dark .parent-connection-card,
html.theme-dark .parent-connection-current,
html.theme-dark .parent-connection-chips span,
html.theme-dark .parent-connection-tools,
html.theme-dark .parent-connection-select,
html.theme-dark .parent-connection-select select{
  background:#111827 !important;
  color:#e5edf8 !important;
  border-color:#46556b !important;
}
html.theme-dark .parent-connection-card-header,
html.theme-dark .parent-connection-card-actions{border-color:#46556b !important;}
html.theme-dark .parent-connection-identity h3,
html.theme-dark .parent-connection-current strong,
html.theme-dark .parent-connection-select,
html.theme-dark .parent-connection-label{color:#f8fafc !important;}
html.theme-dark .parent-connection-identity p,
html.theme-dark .parent-connection-email,
html.theme-dark .parent-connection-select small,
html.theme-dark .parent-connection-card-actions>span,
html.theme-dark .parent-connection-none{color:#cbd5e1 !important;}
html.theme-dark .parent-connection-select option{background:#111827 !important;color:#f8fafc !important;}
html.theme-dark .parent-connection-select option.inactive-cadet-option{color:#b8c2d1 !important;}
html.theme-dark .parent-connection-badges .status-badge,
html.theme-dark .parent-connection-badges .status-published{color:#dff8e9 !important;}
html.theme-dark .parent-connection-badges .status-cancelled{color:#ffe4ea !important;}

/* System Settings — entire editable custom-list rows and replacement dropdowns. */
html.theme-dark .sortable-option-list,
html.theme-dark .sortable-option-row,
html.theme-dark .option-bulk-fields,
html.theme-dark .replacement-choice,
html.theme-dark .bulk-options-toolbar,
html.theme-dark .bulk-options-footer{
  background:#111827 !important;
  color:#e5edf8 !important;
  border-color:#46556b !important;
}
html.theme-dark .sortable-option-row input,
html.theme-dark .sortable-option-row select,
html.theme-dark .sortable-option-row textarea,
html.theme-dark .replacement-choice select{
  background:#0b1220 !important;
  color:#f8fafc !important;
  border-color:#53627a !important;
}
html.theme-dark .sortable-option-row option,
html.theme-dark .replacement-choice option{background:#111827 !important;color:#f8fafc !important;}
html.theme-dark .dropdown-list-nav a:not(.active){color:#dbe7f5 !important;}
html.theme-dark .dropdown-list-nav a:not(.active):hover{background:#1d2a3d !important;}

/* Administration — Dashboard Notices Management. */
html.theme-dark .admin-notification-editor,
html.theme-dark .admin-notification-list-card,
html.theme-dark .admin-notice-list,
html.theme-dark .admin-notice-item,
html.theme-dark .admin-notice-item.is-hidden,
html.theme-dark .notice-role-targets,
html.theme-dark .notice-role-checkbox-grid{
  background:#111827 !important;
  color:#e5edf8 !important;
  border-color:#46556b !important;
}
html.theme-dark .admin-notice-content h3,
html.theme-dark .notice-role-targets legend{color:#ffffff !important;}
html.theme-dark .admin-notice-content p,
html.theme-dark .admin-notice-meta,
html.theme-dark .admin-notice-audience{color:#cbd5e1 !important;}
html.theme-dark .status-pill{background:#26354a !important;color:#e5edf8 !important;}
html.theme-dark .notice-priority-badge{background:#26354a !important;color:#e5edf8 !important;}
html.theme-dark .notice-important .notice-priority-badge{background:#5a440d !important;color:#ffe69a !important;}
html.theme-dark .notice-urgent .notice-priority-badge{background:#481827 !important;color:#ffe4ea !important;}

/* Match all of the fixes above when the user chooses System Default and the OS is dark. */
@media (prefers-color-scheme: dark){
  html.theme-system .oflight-my-status{background:#123b2b !important;border-left-color:#34a66f !important;color:#e7f8ef !important;}
  html.theme-system .oflight-my-status strong{color:#fff !important;}
  html.theme-system .event-list-card-date,html.theme-system .event-list-card-past .event-list-card-date{background:#172235 !important;border-color:#475569 !important;color:#e5edf8 !important;}
  html.theme-system .event-list-card-date strong{color:#fff !important;} html.theme-system .event-list-card-date span{color:#cbd5e1 !important;}
  html.theme-system .promotion-requirement-item.is-commander-review.is-complete{background:#123b2b !important;border-color:#287b56 !important;color:#e7f8ef !important;}
  html.theme-system .promotion-requirement-item.is-commander-review.is-complete .promotion-requirement-status{background:#34a66f !important;border-color:#34a66f !important;color:#071a11 !important;}
  html.theme-system .testing-officer-workflow,html.theme-system .officer-selection-stack,html.theme-system .selection-step,html.theme-system .selection-step.is-disabled,html.theme-system .command-score-card,html.theme-system .testing-officer-tip,html.theme-system .evaluation-summary-panel,html.theme-system .private-notes-panel,html.theme-system .score-calculation-actions,html.theme-system .selected-test-heading{background:#111827 !important;border-color:#46556b !important;color:#e5edf8 !important;}
  html.theme-system .selection-step-copy,html.theme-system .selection-step-copy strong,html.theme-system .command-score-card h3,html.theme-system .evaluation-summary-panel h3,html.theme-system .selected-test-heading h2,html.theme-system .summary-score-row strong{color:#fff !important;}
  html.theme-system .selection-step-copy small,html.theme-system .selected-test-heading p,html.theme-system .selected-test-heading .eyebrow{color:#cbd5e1 !important;}
  html.theme-system .selection-step select,html.theme-system .command-score-card input,html.theme-system .command-score-card textarea,html.theme-system .private-notes-panel textarea{background:#0b1220 !important;color:#f8fafc !important;border-color:#53627a !important;}
  html.theme-system .binary-score .score-choice,html.theme-system .binary-score label{background:#172235 !important;border-color:#53627a !important;color:#e5edf8 !important;}
  html.theme-system .binary-score .score-choice-satisfactory:has(input:checked){background:#123b2b !important;border-color:#34a66f !important;color:#dff8e9 !important;}
  html.theme-system .binary-score .score-choice-unsatisfactory:has(input:checked){background:#481827 !important;border-color:#ef6680 !important;color:#ffe4ea !important;}
  html.theme-system .supplement-facts dt,html.theme-system .test-facts.supplement-facts dt{color:#ffcd00 !important;}
  html.theme-system .supplement-facts div,html.theme-system .test-facts.supplement-facts div{background:#172235 !important;border-left-color:#ffcd00 !important;color:#e5edf8 !important;}
  html.theme-system .supplement-facts dd{color:#e5edf8 !important;}
  html.theme-system .analytics-grid,html.theme-system .analytics-card,html.theme-system .metric-row,html.theme-system .manual-evaluations .ui-accordion-content{background:#111827 !important;color:#e5edf8 !important;border-color:#46556b !important;}
  html.theme-system .analytics-card h3,html.theme-system .metric-row strong{color:#fff !important;}
  html.theme-system .online-user-grid,html.theme-system .online-user-card,html.theme-system .online-user-card[class*="role-presence-"]{background:#111827 !important;color:#e5edf8 !important;border-color:#46556b !important;}
  html.theme-system .online-user-card strong{color:#fff !important;} html.theme-system .online-user-card small{color:#cbd5e1 !important;} html.theme-system .online-user-count{background:#123b2b !important;color:#dff8e9 !important;}
  html.theme-system .reports-overview,html.theme-system .reports-stat-card{background:#111827 !important;background-image:none !important;border-color:#46556b !important;color:#e5edf8 !important;}
  html.theme-system .reports-overview-heading h2,html.theme-system .reports-stat-card strong{color:#fff !important;} html.theme-system .reports-overview-heading p,html.theme-system .reports-stat-card span{color:#cbd5e1 !important;}
  html.theme-system .user-account-filters,html.theme-system .user-account-search,html.theme-system .user-account-filters input,html.theme-system .user-account-filters select{background:#111827 !important;color:#f8fafc !important;border-color:#46556b !important;}
  html.theme-system .parent-connections-page,html.theme-system .parent-connection-summary>div,html.theme-system .parent-connection-card,html.theme-system .parent-connection-current,html.theme-system .parent-connection-chips span,html.theme-system .parent-connection-tools,html.theme-system .parent-connection-select,html.theme-system .parent-connection-select select{background:#111827 !important;color:#e5edf8 !important;border-color:#46556b !important;}
  html.theme-system .parent-connection-identity h3,html.theme-system .parent-connection-current strong,html.theme-system .parent-connection-select,html.theme-system .parent-connection-label{color:#f8fafc !important;}
  html.theme-system .parent-connection-identity p,html.theme-system .parent-connection-email,html.theme-system .parent-connection-select small,html.theme-system .parent-connection-card-actions>span,html.theme-system .parent-connection-none{color:#cbd5e1 !important;}
  html.theme-system .parent-connection-select option{background:#111827 !important;color:#f8fafc !important;}
  html.theme-system .sortable-option-list,html.theme-system .sortable-option-row,html.theme-system .option-bulk-fields,html.theme-system .replacement-choice,html.theme-system .bulk-options-toolbar,html.theme-system .bulk-options-footer{background:#111827 !important;color:#e5edf8 !important;border-color:#46556b !important;}
  html.theme-system .sortable-option-row input,html.theme-system .sortable-option-row select,html.theme-system .sortable-option-row textarea,html.theme-system .replacement-choice select{background:#0b1220 !important;color:#f8fafc !important;border-color:#53627a !important;}
  html.theme-system .sortable-option-row option,html.theme-system .replacement-choice option{background:#111827 !important;color:#f8fafc !important;}
  html.theme-system .admin-notification-editor,html.theme-system .admin-notification-list-card,html.theme-system .admin-notice-list,html.theme-system .admin-notice-item,html.theme-system .admin-notice-item.is-hidden,html.theme-system .notice-role-targets,html.theme-system .notice-role-checkbox-grid{background:#111827 !important;color:#e5edf8 !important;border-color:#46556b !important;}
  html.theme-system .admin-notice-content h3,html.theme-system .notice-role-targets legend{color:#fff !important;} html.theme-system .admin-notice-content p,html.theme-system .admin-notice-meta,html.theme-system .admin-notice-audience{color:#cbd5e1 !important;}
  html.theme-system .status-pill{background:#26354a !important;color:#e5edf8 !important;}
}

/* ========================================================================== */
/* 2026-07-23 dark-mode QA pass: attendance, training, events, CoC, drill,    */
/* forum presence, and parent/guardian connection surfaces.                   */
/* ========================================================================== */

/* Attendance — archived Past Meetings / Historical Attendance surfaces. */
html.theme-dark .archived-section,
html.theme-dark .archived-section > summary,
html.theme-dark .archived-section .collapsible-content,
html.theme-dark .archived-section .table-wrap,
html.theme-dark .archived-section .attendance-meetings-table,
html.theme-dark .archived-section .attendance-meetings-table tr,
html.theme-dark .historical-attendance-row{
  background:#111827 !important;
  color:#e5edf8 !important;
  border-color:#46556b !important;
}
html.theme-dark .archived-section > summary:hover{background:#1b2638 !important;}
html.theme-dark .archived-section .collapsible-hint,
html.theme-dark .archived-section small,
html.theme-dark .historical-attendance-row small{color:#cbd5e1 !important;}
html.theme-dark #attendance-records{scroll-margin-top:24px;}

/* Meeting Plans — agenda hover and sticky action bar. */
html.theme-dark .agenda-row:hover{background:#1b2638 !important;color:#f8fafc !important;}
html.theme-dark .agenda-row:hover small,
html.theme-dark .agenda-row:hover .activity-location{color:#cbd5e1 !important;}
html.theme-dark .workspace-action-bar{
  background:#111827 !important;
  border-color:#46556b !important;
  box-shadow:0 3px 12px rgba(0,0,0,.22) !important;
}

/* Missions & Events — overview metrics, royal-blue copy, response roster, check-in. */
html.theme-dark .event-management-overview,
html.theme-dark .event-overview-stat,
html.theme-dark .event-public-response-group,
html.theme-dark .event-public-response-group .event-public-roster,
html.theme-dark .event-public-response-group .event-response-person,
html.theme-dark .event-collapsible,
html.theme-dark .event-collapsible > summary,
html.theme-dark .event-collapsible .collapsible-content,
html.theme-dark .event-collapsible .table-wrap,
html.theme-dark .event-roster-table,
html.theme-dark #attendance.event-collapsible{
  background:#111827 !important;
  color:#e5edf8 !important;
  border-color:#46556b !important;
}
html.theme-dark .event-overview-stat strong,
html.theme-dark .event-management-page h1,
html.theme-dark .event-management-page h2,
html.theme-dark .event-management-page h3,
html.theme-dark .event-management-page a:not(.btn),
html.theme-dark .event-collapsible h2,
html.theme-dark .event-collapsible h3{color:#f8fafc !important;}
html.theme-dark .event-overview-label{color:#ffcd00 !important;}
html.theme-dark .event-overview-stat small,
html.theme-dark .event-management-page .muted,
html.theme-dark .event-collapsible .muted{color:#cbd5e1 !important;}
html.theme-dark .event-public-response-group h3 span,
html.theme-dark .event-public-response-group .event-response-person{
  background:#172235 !important;
  color:#e5edf8 !important;
  border-color:#53627a !important;
}
html.theme-dark .response-group-attending,
html.theme-dark .response-group-interested,
html.theme-dark .response-group-not_attending{background:#111827 !important;border-color:#46556b !important;}
html.theme-dark .event-collapsible select,
html.theme-dark .event-collapsible input,
html.theme-dark .event-collapsible textarea,
html.theme-dark .event-roster-table select{
  background:#0b1220 !important;
  color:#f8fafc !important;
  border-color:#53627a !important;
}
html.theme-dark .event-collapsible option{background:#111827 !important;color:#f8fafc !important;}

/* Chain of Command — reduce bright title and flight-column surfaces. */
html.theme-dark .coc-title-block{
  background:#172235 !important;
  color:#f8fafc !important;
  border-color:#53627a !important;
  box-shadow:0 3px 0 #0b1220 !important;
}
html.theme-dark .coc-title-block span{color:#cbd5e1 !important;}
html.theme-dark .coc-flight-column{
  background:#111827 !important;
  color:#e5edf8 !important;
  border-color:#46556b !important;
}
html.theme-dark .coc-flight-column h2{color:#f8fafc !important;}
html.theme-dark .coc-mini-connector{background:#53627a !important;}
html.theme-dark .coc-members-node span{border-top-color:#36465c !important;}

/* Drill Tests / Drill Records — replace dark-on-dark royal blue emphasis. */
html.theme-dark .official-drill-results h2,
html.theme-dark .official-drill-results h3,
html.theme-dark .official-drill-results a:not(.btn),
html.theme-dark .analytics-card h3,
html.theme-dark .info-callout strong,
html.theme-dark .drill-score-display,
html.theme-dark .drill-score-cell strong,
html.theme-dark .manual-evaluations h2,
html.theme-dark .manual-evaluations h3,
html.theme-dark .ui-accordion-content a:not(.btn){color:#8fc5ff !important;}
html.theme-dark .info-callout{
  background:#111827 !important;
  color:#e5edf8 !important;
  border-color:#53627a !important;
  border-left-color:#8fc5ff !important;
}
html.theme-dark .analytics-grid,
html.theme-dark .analytics-card,
html.theme-dark .metric-row,
html.theme-dark .manual-evaluations,
html.theme-dark .manual-evaluations .ui-accordion-content,
html.theme-dark .official-drill-results,
html.theme-dark .drill-score-cell{
  background:#111827 !important;
  color:#e5edf8 !important;
  border-color:#46556b !important;
}

/* Message Board — exact Live Presence component used by forum. */
html.theme-dark .forum-online-panel,
html.theme-dark .forum-online-summary,
html.theme-dark .forum-online-names,
html.theme-dark .forum-online-names-flat,
html.theme-dark .forum-online-person,
html.theme-dark .forum-online-person-link,
html.theme-dark .forum-role-key{
  background:#111827 !important;
  color:#e5edf8 !important;
  border-color:#46556b !important;
}
html.theme-dark .forum-online-panel h2,
html.theme-dark .forum-online-person-link{color:#f8fafc !important;}
html.theme-dark .forum-online-panel .eyebrow{color:#ffcd00 !important;}

/* Parent / Guardian Connections — enforce dark surfaces and readable metadata. */
html.theme-dark .parent-connections-page .card,
html.theme-dark .parent-new-account-card,
html.theme-dark .parent-registration-admin,
html.theme-dark .parent-registration-request-card,
html.theme-dark .parent-connection-summary,
html.theme-dark .parent-connection-summary > div,
html.theme-dark .parent-connection-tools,
html.theme-dark .parent-connection-card,
html.theme-dark .parent-connection-card-header,
html.theme-dark .parent-connection-current,
html.theme-dark .parent-connection-select,
html.theme-dark .parent-connection-card-actions{
  background:#111827 !important;
  color:#e5edf8 !important;
  border-color:#46556b !important;
}
html.theme-dark .parent-connection-email,
html.theme-dark .parent-connection-label,
html.theme-dark .parent-connection-card-actions > span,
html.theme-dark .parent-connection-identity p,
html.theme-dark .parent-connection-select small{color:#cbd5e1 !important;}
html.theme-dark .parent-connection-identity h3,
html.theme-dark .parent-connection-current,
html.theme-dark .parent-connection-select{color:#f8fafc !important;}
html.theme-dark .parent-connection-chips span{
  background:#172235 !important;
  color:#e5edf8 !important;
  border-color:#53627a !important;
}
html.theme-dark .parent-connections-page input,
html.theme-dark .parent-connections-page select,
html.theme-dark .parent-connections-page textarea{
  background:#0b1220 !important;
  color:#f8fafc !important;
  border-color:#53627a !important;
}
html.theme-dark .parent-connections-page option{background:#111827 !important;color:#f8fafc !important;}
html.theme-dark .parent-connections-page option.inactive-cadet-option{color:#cbd5e1 !important;}
html.theme-dark .parent-connection-badges .status-published{background:#123b2b !important;color:#dff8e9 !important;}
html.theme-dark .parent-connection-badges .status-cancelled{background:#481827 !important;color:#ffe4ea !important;}

/* System Default + dark OS: mirror this QA pass. */
@media (prefers-color-scheme: dark){
  html.theme-system .archived-section,html.theme-system .archived-section>summary,html.theme-system .archived-section .collapsible-content,html.theme-system .archived-section .table-wrap,html.theme-system .archived-section .attendance-meetings-table,html.theme-system .archived-section .attendance-meetings-table tr,html.theme-system .historical-attendance-row{background:#111827!important;color:#e5edf8!important;border-color:#46556b!important;}
  html.theme-system .archived-section>summary:hover{background:#1b2638!important;} html.theme-system .archived-section .collapsible-hint,html.theme-system .archived-section small,html.theme-system .historical-attendance-row small{color:#cbd5e1!important;}
  html.theme-system .agenda-row:hover{background:#1b2638!important;color:#f8fafc!important;} html.theme-system .agenda-row:hover small,html.theme-system .agenda-row:hover .activity-location{color:#cbd5e1!important;}
  html.theme-system .workspace-action-bar{background:#111827!important;border-color:#46556b!important;box-shadow:0 3px 12px rgba(0,0,0,.22)!important;}
  html.theme-system .event-management-overview,html.theme-system .event-overview-stat,html.theme-system .event-public-response-group,html.theme-system .event-public-response-group .event-public-roster,html.theme-system .event-public-response-group .event-response-person,html.theme-system .event-collapsible,html.theme-system .event-collapsible>summary,html.theme-system .event-collapsible .collapsible-content,html.theme-system .event-collapsible .table-wrap,html.theme-system .event-roster-table,html.theme-system #attendance.event-collapsible{background:#111827!important;color:#e5edf8!important;border-color:#46556b!important;}
  html.theme-system .event-overview-stat strong,html.theme-system .event-management-page h1,html.theme-system .event-management-page h2,html.theme-system .event-management-page h3,html.theme-system .event-management-page a:not(.btn),html.theme-system .event-collapsible h2,html.theme-system .event-collapsible h3{color:#f8fafc!important;} html.theme-system .event-overview-label{color:#ffcd00!important;}
  html.theme-system .event-public-response-group h3 span,html.theme-system .event-public-response-group .event-response-person{background:#172235!important;color:#e5edf8!important;border-color:#53627a!important;} html.theme-system .response-group-attending,html.theme-system .response-group-interested,html.theme-system .response-group-not_attending{background:#111827!important;border-color:#46556b!important;}
  html.theme-system .event-collapsible select,html.theme-system .event-collapsible input,html.theme-system .event-collapsible textarea,html.theme-system .event-roster-table select{background:#0b1220!important;color:#f8fafc!important;border-color:#53627a!important;}
  html.theme-system .coc-title-block{background:#172235!important;color:#f8fafc!important;border-color:#53627a!important;box-shadow:0 3px 0 #0b1220!important;} html.theme-system .coc-title-block span{color:#cbd5e1!important;} html.theme-system .coc-flight-column{background:#111827!important;color:#e5edf8!important;border-color:#46556b!important;} html.theme-system .coc-flight-column h2{color:#f8fafc!important;}
  html.theme-system .official-drill-results h2,html.theme-system .official-drill-results h3,html.theme-system .official-drill-results a:not(.btn),html.theme-system .analytics-card h3,html.theme-system .info-callout strong,html.theme-system .drill-score-display,html.theme-system .drill-score-cell strong,html.theme-system .manual-evaluations h2,html.theme-system .manual-evaluations h3,html.theme-system .ui-accordion-content a:not(.btn){color:#8fc5ff!important;}
  html.theme-system .info-callout,html.theme-system .analytics-grid,html.theme-system .analytics-card,html.theme-system .metric-row,html.theme-system .manual-evaluations,html.theme-system .manual-evaluations .ui-accordion-content,html.theme-system .official-drill-results,html.theme-system .drill-score-cell{background:#111827!important;color:#e5edf8!important;border-color:#46556b!important;}
  html.theme-system .forum-online-panel,html.theme-system .forum-online-summary,html.theme-system .forum-online-names,html.theme-system .forum-online-names-flat,html.theme-system .forum-online-person,html.theme-system .forum-online-person-link,html.theme-system .forum-role-key{background:#111827!important;color:#e5edf8!important;border-color:#46556b!important;} html.theme-system .forum-online-panel h2,html.theme-system .forum-online-person-link{color:#f8fafc!important;} html.theme-system .forum-online-panel .eyebrow{color:#ffcd00!important;}
  html.theme-system .parent-connections-page .card,html.theme-system .parent-new-account-card,html.theme-system .parent-registration-admin,html.theme-system .parent-registration-request-card,html.theme-system .parent-connection-summary,html.theme-system .parent-connection-summary>div,html.theme-system .parent-connection-tools,html.theme-system .parent-connection-card,html.theme-system .parent-connection-card-header,html.theme-system .parent-connection-current,html.theme-system .parent-connection-select,html.theme-system .parent-connection-card-actions{background:#111827!important;color:#e5edf8!important;border-color:#46556b!important;}
  html.theme-system .parent-connection-email,html.theme-system .parent-connection-label,html.theme-system .parent-connection-card-actions>span,html.theme-system .parent-connection-identity p,html.theme-system .parent-connection-select small{color:#cbd5e1!important;} html.theme-system .parent-connection-identity h3,html.theme-system .parent-connection-current,html.theme-system .parent-connection-select{color:#f8fafc!important;}
  html.theme-system .parent-connection-chips span{background:#172235!important;color:#e5edf8!important;border-color:#53627a!important;} html.theme-system .parent-connections-page input,html.theme-system .parent-connections-page select,html.theme-system .parent-connections-page textarea{background:#0b1220!important;color:#f8fafc!important;border-color:#53627a!important;}
}

/* ========================================================================== */
/* Squadron Chat — comprehensive dark-mode contrast pass                      */
/* ========================================================================== */
html.theme-dark .chat-conversations,
html.theme-dark .chat-conversations-toolbar,
html.theme-dark .chat-thread-header,
html.theme-dark .chat-new-dialog-card,
html.theme-dark .chat-new-dialog-card form,
html.theme-dark .chat-user-picker {
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#334155 !important;
}
html.theme-dark .chat-workspace,
html.theme-dark .chat-thread,
html.theme-dark .chat-messages {
  background:#111c2c !important;
  color:#edf2f7 !important;
}
html.theme-dark .chat-conversation-item {
  background:transparent !important;
  color:#edf2f7 !important;
  border-color:transparent !important;
}
html.theme-dark .chat-conversation-item:hover {
  background:#314159 !important;
  color:#ffffff !important;
  border-color:#56657a !important;
}
html.theme-dark .chat-conversation-item.is-active,
html.theme-dark .chat-conversation-item.is-unread {
  background:#263650 !important;
  color:#ffffff !important;
  border-color:#64748b !important;
}
html.theme-dark .chat-conversation-item:hover strong,
html.theme-dark .chat-conversation-item:hover .chat-conversation-preview,
html.theme-dark .chat-conversation-item:hover time,
html.theme-dark .chat-conversation-item.is-active strong,
html.theme-dark .chat-conversation-item.is-active .chat-conversation-preview,
html.theme-dark .chat-conversation-item.is-active time {
  color:#ffffff !important;
}
html.theme-dark .chat-conversation-preview,
html.theme-dark .chat-thread-header small,
html.theme-dark .chat-user-copy small,
html.theme-dark .chat-conversation-item-top time {
  color:#b8c3d4 !important;
}
html.theme-dark .chat-conversation-protected {
  color:#f4d35e !important;
}
html.theme-dark .chat-back-button {
  background:#263449 !important;
  color:#ffffff !important;
}
html.theme-dark .chat-back-button:hover {
  background:#3a4a61 !important;
  color:#ffffff !important;
}

/* Yellow advisory/protection surfaces must keep dark, high-contrast text. */
html.theme-dark .chat-core-values-notice,
html.theme-dark .chat-protection-banner,
html.theme-dark .chat-protection-create {
  background:#f4d35e !important;
  color:#2b2400 !important;
  border-color:#d3ad24 !important;
}
html.theme-dark .chat-core-values-notice strong,
html.theme-dark .chat-protection-banner strong,
html.theme-dark .chat-protection-banner p,
html.theme-dark .chat-protection-create strong,
html.theme-dark .chat-protection-create p,
html.theme-dark .chat-protection-create label {
  color:#2b2400 !important;
}
html.theme-dark .chat-protection-banner .btn,
html.theme-dark .chat-protection-create .btn {
  color:#ffffff !important;
}

/* Start New Chat dialog and member picker. */
html.theme-dark .chat-new-dialog {
  background:rgba(2,6,23,.76) !important;
}
html.theme-dark .chat-new-dialog-head {
  background:#172235 !important;
  color:#ffffff !important;
  border-color:#334155 !important;
}
html.theme-dark .chat-new-dialog-head strong,
html.theme-dark .chat-new-search,
html.theme-dark .chat-group-title,
html.theme-dark .chat-user-copy strong {
  color:#edf2f7 !important;
}
html.theme-dark .chat-new-dialog-head small,
html.theme-dark .chat-user-copy small {
  color:#b8c3d4 !important;
}
html.theme-dark .chat-new-dialog-head button {
  color:#edf2f7 !important;
}
html.theme-dark .chat-new-dialog-head button:hover {
  color:#ffffff !important;
  background:#314159 !important;
  border-radius:8px !important;
}
html.theme-dark .chat-new-search input,
html.theme-dark .chat-group-title input {
  background:#0f1726 !important;
  color:#ffffff !important;
  border-color:#475569 !important;
}
html.theme-dark .chat-new-search input::placeholder,
html.theme-dark .chat-group-title input::placeholder {
  color:#94a3b8 !important;
}
html.theme-dark .chat-new-search input:focus,
html.theme-dark .chat-group-title input:focus {
  background:#111c2c !important;
  color:#ffffff !important;
  border-color:#7aa2e8 !important;
  outline:2px solid rgba(122,162,232,.28) !important;
}
html.theme-dark .chat-user-option {
  color:#edf2f7 !important;
}
html.theme-dark .chat-user-option:hover {
  background:#314159 !important;
  color:#ffffff !important;
}
html.theme-dark .chat-user-option:hover strong,
html.theme-dark .chat-user-option:hover small {
  color:#ffffff !important;
}
html.theme-dark .chat-user-option:has(input:checked) {
  background:#263650 !important;
  color:#ffffff !important;
  outline:1px solid #64748b !important;
}
html.theme-dark .chat-user-option:has(input:checked) strong,
html.theme-dark .chat-user-option:has(input:checked) small {
  color:#ffffff !important;
}
html.theme-dark .chat-user-avatar {
  background:#263449 !important;
  color:#ffffff !important;
  border:1px solid #475569 !important;
}
html.theme-dark .chat-new-actions {
  border-color:#334155 !important;
}
html.theme-dark .chat-create-error {
  background:#4a1823 !important;
  color:#ffd7df !important;
  border:1px solid #8f3347 !important;
}

/* System theme follows the same chat contrast rules when the OS is dark. */
@media (prefers-color-scheme:dark) {
  html.theme-system .chat-conversations,
  html.theme-system .chat-conversations-toolbar,
  html.theme-system .chat-thread-header,
  html.theme-system .chat-new-dialog-card,
  html.theme-system .chat-new-dialog-card form,
  html.theme-system .chat-user-picker {
    background:#172235 !important;
    color:#edf2f7 !important;
    border-color:#334155 !important;
  }
  html.theme-system .chat-workspace,
  html.theme-system .chat-thread,
  html.theme-system .chat-messages {background:#111c2c !important;color:#edf2f7 !important;}
  html.theme-system .chat-conversation-item {background:transparent !important;color:#edf2f7 !important;border-color:transparent !important;}
  html.theme-system .chat-conversation-item:hover {background:#314159 !important;color:#ffffff !important;border-color:#56657a !important;}
  html.theme-system .chat-conversation-item.is-active,
  html.theme-system .chat-conversation-item.is-unread {background:#263650 !important;color:#ffffff !important;border-color:#64748b !important;}
  html.theme-system .chat-conversation-item:hover strong,
  html.theme-system .chat-conversation-item:hover .chat-conversation-preview,
  html.theme-system .chat-conversation-item:hover time,
  html.theme-system .chat-conversation-item.is-active strong,
  html.theme-system .chat-conversation-item.is-active .chat-conversation-preview,
  html.theme-system .chat-conversation-item.is-active time {color:#ffffff !important;}
  html.theme-system .chat-conversation-preview,
  html.theme-system .chat-thread-header small,
  html.theme-system .chat-user-copy small,
  html.theme-system .chat-conversation-item-top time {color:#b8c3d4 !important;}
  html.theme-system .chat-conversation-protected {color:#f4d35e !important;}
  html.theme-system .chat-back-button {background:#263449 !important;color:#ffffff !important;}
  html.theme-system .chat-back-button:hover {background:#3a4a61 !important;color:#ffffff !important;}
  html.theme-system .chat-core-values-notice,
  html.theme-system .chat-protection-banner,
  html.theme-system .chat-protection-create {background:#f4d35e !important;color:#2b2400 !important;border-color:#d3ad24 !important;}
  html.theme-system .chat-core-values-notice strong,
  html.theme-system .chat-protection-banner strong,
  html.theme-system .chat-protection-banner p,
  html.theme-system .chat-protection-create strong,
  html.theme-system .chat-protection-create p,
  html.theme-system .chat-protection-create label {color:#2b2400 !important;}
  html.theme-system .chat-new-dialog {background:rgba(2,6,23,.76) !important;}
  html.theme-system .chat-new-dialog-head {background:#172235 !important;color:#ffffff !important;border-color:#334155 !important;}
  html.theme-system .chat-new-dialog-head strong,
  html.theme-system .chat-new-search,
  html.theme-system .chat-group-title,
  html.theme-system .chat-user-copy strong {color:#edf2f7 !important;}
  html.theme-system .chat-new-dialog-head small,
  html.theme-system .chat-user-copy small {color:#b8c3d4 !important;}
  html.theme-system .chat-new-dialog-head button {color:#edf2f7 !important;}
  html.theme-system .chat-new-dialog-head button:hover {color:#ffffff !important;background:#314159 !important;border-radius:8px !important;}
  html.theme-system .chat-new-search input,
  html.theme-system .chat-group-title input {background:#0f1726 !important;color:#ffffff !important;border-color:#475569 !important;}
  html.theme-system .chat-new-search input::placeholder,
  html.theme-system .chat-group-title input::placeholder {color:#94a3b8 !important;}
  html.theme-system .chat-user-option {color:#edf2f7 !important;}
  html.theme-system .chat-user-option:hover {background:#314159 !important;color:#ffffff !important;}
  html.theme-system .chat-user-option:hover strong,
  html.theme-system .chat-user-option:hover small {color:#ffffff !important;}
  html.theme-system .chat-user-option:has(input:checked) {background:#263650 !important;color:#ffffff !important;outline:1px solid #64748b !important;}
  html.theme-system .chat-user-option:has(input:checked) strong,
  html.theme-system .chat-user-option:has(input:checked) small {color:#ffffff !important;}
  html.theme-system .chat-user-avatar {background:#263449 !important;color:#ffffff !important;border:1px solid #475569 !important;}
  html.theme-system .chat-create-error {background:#4a1823 !important;color:#ffd7df !important;border:1px solid #8f3347 !important;}
}

/* ========================================================================== */
/* Dark-mode QA pass: global CAP-blue text + remaining page-specific surfaces */
/* ========================================================================== */
html.theme-dark{
  --soh-blue:#8fc5ff;
  --soh-blue-700:#9dccff;
  --soh-blue-600:#8fc5ff;
}
/* Royal/CAP blue is a brand color on light surfaces, but fails contrast as text
   on navy/dark surfaces. Keep buttons, pills, badges, and warning panels intact. */
html.theme-dark :where(a:not(.btn):not(.badge):not(.role-pill),.table-sort,.choice-card h2,.link-primary,.text-primary,.text-blue,.eyebrow-blue){color:#8fc5ff!important;}
html.theme-dark :where(a:not(.btn):not(.badge):not(.role-pill)):hover{color:#c6e2ff!important;}
html.theme-dark :where(h1,h2,h3,h4,h5,h6) a:not(.btn){color:#a8d4ff!important;}

/* Missions & Events: force page-local branded text to readable dark-mode tones. */
html.theme-dark .event-management-page :where(a:not(.btn),.table-sort,.event-link,.event-title-link){color:#8fc5ff!important;}
html.theme-dark .event-management-page :where(a:not(.btn),.table-sort,.event-link,.event-title-link):hover{color:#c6e2ff!important;}
html.theme-dark .event-management-page :where(h1,h2,h3,h4,strong){color:#f8fafc;}

/* Drill Records: table wrappers and nested table surfaces. */
html.theme-dark .official-drill-results,
html.theme-dark .official-drill-results thead,
html.theme-dark .official-drill-results tbody,
html.theme-dark .official-drill-results tr,
html.theme-dark .manual-evaluations .table-wrap,
html.theme-dark .manual-evaluations table,
html.theme-dark .manual-evaluations thead,
html.theme-dark .manual-evaluations tbody,
html.theme-dark .manual-evaluations tr,
html.theme-dark .ui-accordion-content>.table-wrap{
  background:#111827!important;
  color:#e5edf8!important;
  border-color:#46556b!important;
}
html.theme-dark .official-drill-results th,
html.theme-dark .official-drill-results td,
html.theme-dark .manual-evaluations th,
html.theme-dark .manual-evaluations td{
  background:#172235!important;
  color:#e5edf8!important;
  border-color:#46556b!important;
}
html.theme-dark .official-drill-results tbody tr:hover td,
html.theme-dark .manual-evaluations tbody tr:hover td{background:#223149!important;color:#fff!important;}
html.theme-dark .drill-score-display,
html.theme-dark .drill-score-cell strong,
html.theme-dark .official-drill-results .table-sort,
html.theme-dark .manual-evaluations .table-sort{color:#8fc5ff!important;}

/* Message Board role key: role-specific classes can inject dark text. */
html.theme-dark .forum-role-key,
html.theme-dark .forum-role-key strong,
html.theme-dark .forum-role-key-item,
html.theme-dark .forum-role-key-item span{
  color:#f8fafc!important;
}
html.theme-dark .forum-role-key-item i{border:1px solid rgba(255,255,255,.72)!important;}

/* Parent/Guardian Connections: expanded New Parent Account details header/body. */
html.theme-dark details.parent-new-account-card,
html.theme-dark details.parent-new-account-card>summary,
html.theme-dark .parent-new-account-card,
html.theme-dark .parent-new-account-form,
html.theme-dark .parent-new-account-grid{
  background:#111827!important;
  color:#e5edf8!important;
  border-color:#46556b!important;
}
html.theme-dark details.parent-new-account-card>summary:hover{background:#223149!important;color:#fff!important;}
html.theme-dark .parent-new-account-card :where(h2,h3,h4,strong,label){color:#f8fafc!important;}
html.theme-dark .parent-new-account-card :where(p,small,.muted){color:#cbd5e1!important;}
html.theme-dark .parent-new-account-card :where(input,select,textarea){background:#0b1220!important;color:#f8fafc!important;border-color:#53627a!important;}

/* Squadron Chat: final specificity pass over legacy/new-chat yellow and picker states. */
html.theme-dark .chat-core-values-notice,
html.theme-dark .chat-protection-banner,
html.theme-dark .chat-protection-create,
html.theme-dark .chat-warning,
html.theme-dark .chat-advisory,
html.theme-dark [class*="chat-"][class*="warning"],
html.theme-dark [class*="chat-"][class*="protection"]{
  background:#ffcd00!important;
  color:#241f00!important;
  border-color:#d8ad00!important;
}
html.theme-dark .chat-core-values-notice *,
html.theme-dark .chat-protection-banner *,
html.theme-dark .chat-protection-create *,
html.theme-dark .chat-warning *,
html.theme-dark .chat-advisory *{
  color:#241f00!important;
}
html.theme-dark .chat-new-dialog-card,
html.theme-dark .chat-new-dialog-card form,
html.theme-dark .chat-user-picker,
html.theme-dark .chat-user-picker-row,
html.theme-dark .chat-member-option,
html.theme-dark .chat-user-option{
  background:#172235!important;
  color:#edf2f7!important;
  border-color:#46556b!important;
}
html.theme-dark :where(.chat-user-picker-row,.chat-member-option,.chat-user-option):hover{
  background:#314159!important;
  color:#fff!important;
}
html.theme-dark :where(.chat-user-picker-row,.chat-member-option,.chat-user-option).is-selected,
html.theme-dark :where(.chat-user-picker-row,.chat-member-option,.chat-user-option)[aria-selected="true"]{
  background:#263650!important;
  color:#fff!important;
  border-color:#8fc5ff!important;
}
html.theme-dark .chat-new-dialog-card :where(input,select,textarea){background:#0b1220!important;color:#f8fafc!important;border-color:#53627a!important;}
html.theme-dark .chat-new-dialog-card :where(input,textarea)::placeholder{color:#94a3b8!important;opacity:1;}

@media (prefers-color-scheme:dark){
  html.theme-system{--soh-blue:#8fc5ff;--soh-blue-700:#9dccff;--soh-blue-600:#8fc5ff;}
  html.theme-system :where(a:not(.btn):not(.badge):not(.role-pill),.table-sort,.choice-card h2,.link-primary,.text-primary,.text-blue,.eyebrow-blue){color:#8fc5ff!important;}
  html.theme-system :where(a:not(.btn):not(.badge):not(.role-pill)):hover{color:#c6e2ff!important;}
  html.theme-system .official-drill-results,html.theme-system .official-drill-results thead,html.theme-system .official-drill-results tbody,html.theme-system .official-drill-results tr,html.theme-system .manual-evaluations .table-wrap,html.theme-system .manual-evaluations table,html.theme-system .manual-evaluations thead,html.theme-system .manual-evaluations tbody,html.theme-system .manual-evaluations tr,html.theme-system .ui-accordion-content>.table-wrap{background:#111827!important;color:#e5edf8!important;border-color:#46556b!important;}
  html.theme-system .official-drill-results th,html.theme-system .official-drill-results td,html.theme-system .manual-evaluations th,html.theme-system .manual-evaluations td{background:#172235!important;color:#e5edf8!important;border-color:#46556b!important;}
  html.theme-system .forum-role-key,html.theme-system .forum-role-key strong,html.theme-system .forum-role-key-item{color:#f8fafc!important;}
  html.theme-system details.parent-new-account-card,html.theme-system details.parent-new-account-card>summary,html.theme-system .parent-new-account-card,html.theme-system .parent-new-account-form,html.theme-system .parent-new-account-grid{background:#111827!important;color:#e5edf8!important;border-color:#46556b!important;}
  html.theme-system .chat-core-values-notice,html.theme-system .chat-protection-banner,html.theme-system .chat-protection-create,html.theme-system .chat-warning,html.theme-system .chat-advisory,html.theme-system [class*="chat-"][class*="warning"],html.theme-system [class*="chat-"][class*="protection"]{background:#ffcd00!important;color:#241f00!important;border-color:#d8ad00!important;}
  html.theme-system .chat-core-values-notice *,html.theme-system .chat-protection-banner *,html.theme-system .chat-protection-create *,html.theme-system .chat-warning *,html.theme-system .chat-advisory *{color:#241f00!important;}
  html.theme-system .chat-new-dialog-card,html.theme-system .chat-new-dialog-card form,html.theme-system .chat-user-picker,html.theme-system .chat-user-picker-row,html.theme-system .chat-member-option,html.theme-system .chat-user-option{background:#172235!important;color:#edf2f7!important;border-color:#46556b!important;}
  html.theme-system :where(.chat-user-picker-row,.chat-member-option,.chat-user-option):hover{background:#314159!important;color:#fff!important;}
}

/* Squadron Chat initial conversation-selection prompt */
html.theme-dark .chat-select-prompt,
html.theme-dark .chat-select-prompt{
 color:#e5e7eb;
}
html.theme-dark .chat-select-prompt-arrow,
html.theme-dark .chat-select-prompt-arrow{
 color:#f6c945;
}

/* Final dark-mode QA: Missions & Events stats and admin permission upload */
html.theme-dark .event-stat-grid .stat-card strong,
html.theme-dark .event-stat-grid .stat-card strong{
 color:#8fc5ff !important;
}
html.theme-dark .event-stat-grid .stat-card span,
html.theme-dark .event-stat-grid .stat-card span{
 color:#e5edf8 !important;
}
html.theme-dark .event-admin-permission-upload,
html.theme-dark .event-admin-permission-form,
html.theme-dark .event-admin-permission-form label,
html.theme-dark .event-admin-permission-upload,
html.theme-dark .event-admin-permission-form,
html.theme-dark .event-admin-permission-form label{
 background:#111827 !important;color:#e5edf8 !important;border-color:#46556b !important;
}
html.theme-dark .event-admin-permission-form select,
html.theme-dark .event-admin-permission-form input[type="file"],
html.theme-dark .event-admin-permission-form select,
html.theme-dark .event-admin-permission-form input[type="file"]{
 background:#0f1a2a !important;color:#f8fafc !important;border-color:#53627a !important;
}

/* Drill Records: force the complete table containers and readiness surfaces dark */
html.theme-dark .official-drill-results,
html.theme-dark .official-drill-results thead,
html.theme-dark .official-drill-results tbody,
html.theme-dark .official-drill-results tr,
html.theme-dark .official-drill-results th,
html.theme-dark .official-drill-results td,
html.theme-dark .ui-accordion:has(.official-drill-results),
html.theme-dark .ui-accordion:has(.official-drill-results) .ui-accordion-content,
html.theme-dark .ui-accordion:has(.analytics-grid),
html.theme-dark .ui-accordion:has(.analytics-grid) .ui-accordion-content,
html.theme-dark .analytics-grid,
html.theme-dark .analytics-card,
html.theme-dark .official-drill-results,
html.theme-dark .official-drill-results thead,
html.theme-dark .official-drill-results tbody,
html.theme-dark .official-drill-results tr,
html.theme-dark .official-drill-results th,
html.theme-dark .official-drill-results td,
html.theme-dark .ui-accordion:has(.official-drill-results),
html.theme-dark .ui-accordion:has(.official-drill-results) .ui-accordion-content,
html.theme-dark .ui-accordion:has(.analytics-grid),
html.theme-dark .ui-accordion:has(.analytics-grid) .ui-accordion-content,
html.theme-dark .analytics-grid,
html.theme-dark .analytics-card{
 background:#111827 !important;color:#e5edf8 !important;border-color:#46556b !important;
}
html.theme-dark .official-drill-results th,
html.theme-dark .official-drill-results th{background:#1b2a3f !important;color:#ffffff !important;}
html.theme-dark .official-drill-results tr:hover td,
html.theme-dark .official-drill-results tr:hover td{background:#1d2d44 !important;}

/* Message Board role key: preserve distinct role colors in dark mode */
html.theme-dark .forum-role-key-item.role-presence-admin,
html.theme-dark .forum-role-key-item.role-presence-admin{color:#ff8b9a !important}
html.theme-dark .forum-role-key-item.role-presence-commander,
html.theme-dark .forum-role-key-item.role-presence-command,
html.theme-dark .forum-role-key-item.role-presence-commander,
html.theme-dark .forum-role-key-item.role-presence-command{color:#cda2ff !important}
html.theme-dark .forum-role-key-item.role-presence-training-officer,
html.theme-dark .forum-role-key-item.role-presence-training,
html.theme-dark .forum-role-key-item.role-presence-training-officer,
html.theme-dark .forum-role-key-item.role-presence-training{color:#9fc1ff !important}
html.theme-dark .forum-role-key-item.role-presence-cadet-staff,
html.theme-dark .forum-role-key-item.role-presence-cadet,
html.theme-dark .forum-role-key-item.role-presence-cadet-staff,
html.theme-dark .forum-role-key-item.role-presence-cadet{color:#9bdd9f !important}
html.theme-dark .forum-role-key-item.role-presence-prospect,
html.theme-dark .forum-role-key-item.role-presence-prospect{color:#ffe07a !important}
html.theme-dark .forum-role-key-item.role-presence-member,
html.theme-dark .forum-role-key-item.role-presence-senior-member,
html.theme-dark .forum-role-key-item.role-presence-senior,
html.theme-dark .forum-role-key-item.role-presence-member,
html.theme-dark .forum-role-key-item.role-presence-senior-member,
html.theme-dark .forum-role-key-item.role-presence-senior{color:#ffb56b !important}
html.theme-dark .forum-role-key-item.role-presence-pilot,
html.theme-dark .forum-role-key-item.role-presence-pilot{color:#79d5e5 !important}
html.theme-dark .forum-role-key-item.role-presence-parent,
html.theme-dark .forum-role-key-item.role-presence-parent{color:#f0a9c4 !important}

/* Chat new-conversation member-type filters */
html.theme-dark .chat-member-type-filters,
html.theme-dark .chat-member-type-filters{background:#111827 !important;border-color:#46556b !important;color:#e5edf8 !important}
html.theme-dark .chat-member-type-filters legend,
html.theme-dark .chat-member-type-filters legend{color:#cbd5e1 !important}
html.theme-dark .chat-member-type-filters label,
html.theme-dark .chat-member-type-filters label{color:#f8fafc !important}

/* Parent connections eligible account count */
html.theme-dark .parent-connections-page :where(.parent-eligible-count,.eligible-parent-count,.parent-account-count,.summary-count),
html.theme-dark .parent-connections-page :where(.parent-eligible-count,.eligible-parent-count,.parent-account-count,.summary-count){
 background:#1b2a3f !important;color:#e5edf8 !important;border:1px solid #46556b !important;border-radius:10px;padding:10px 12px;
}

/* O-Flight Center dark mode */
html.theme-dark .oflight-active-records-note,
html.theme-dark .oflight-active-records-note{background:#172235 !important;color:#e5edf8 !important;border-color:#46556b !important;border-left-color:#8fc5ff !important}
html.theme-dark .oflight-assignments-center :where(a:not(.btn),h2,h3,h4,.oflight-counts-summary,.oflight-history-summary,.oflight-syllabus-guide>summary),
html.theme-dark .oflight-assignments-center :where(a:not(.btn),h2,h3,h4,.oflight-counts-summary,.oflight-history-summary,.oflight-syllabus-guide>summary){color:#8fc5ff !important}

html.theme-dark .parent-connection-debug-summary,
html.theme-dark .parent-connection-debug-summary{
 background:#172235 !important;
 color:#e5edf8 !important;
 border:1px solid #46556b !important;
 border-radius:10px;
 padding:10px 12px;
}

/* Restore role-specific live-presence colors in dark mode: Dashboard + Message Board */
html.theme-dark .online-user-card.role-presence-admin,
html.theme-dark .online-user-card.role-presence-admin,
html.theme-dark .forum-online-person.role-presence-admin,
html.theme-dark .forum-online-person.role-presence-admin{background:#3a1820 !important;border-color:#ff687d !important;color:#ffb6c0 !important}
html.theme-dark .online-user-card.role-presence-commander,
html.theme-dark .online-user-card.role-presence-command,
html.theme-dark .online-user-card.role-presence-commander,
html.theme-dark .online-user-card.role-presence-command,
html.theme-dark .forum-online-person.role-presence-commander,
html.theme-dark .forum-online-person.role-presence-command,
html.theme-dark .forum-online-person.role-presence-commander,
html.theme-dark .forum-online-person.role-presence-command{background:#2f2340 !important;border-color:#b987ef !important;color:#e1c6ff !important}
html.theme-dark .online-user-card.role-presence-training-officer,
html.theme-dark .online-user-card.role-presence-training,
html.theme-dark .online-user-card.role-presence-training-officer,
html.theme-dark .online-user-card.role-presence-training,
html.theme-dark .forum-online-person.role-presence-training-officer,
html.theme-dark .forum-online-person.role-presence-training,
html.theme-dark .forum-online-person.role-presence-training-officer,
html.theme-dark .forum-online-person.role-presence-training{background:#182b49 !important;border-color:#79a7ef !important;color:#c4dbff !important}
html.theme-dark .online-user-card.role-presence-cadet,
html.theme-dark .online-user-card.role-presence-cadet-staff,
html.theme-dark .online-user-card.role-presence-cadet,
html.theme-dark .online-user-card.role-presence-cadet-staff,
html.theme-dark .forum-online-person.role-presence-cadet,
html.theme-dark .forum-online-person.role-presence-cadet-staff,
html.theme-dark .forum-online-person.role-presence-cadet,
html.theme-dark .forum-online-person.role-presence-cadet-staff{background:#18331f !important;border-color:#6fc27b !important;color:#bce9c2 !important}
html.theme-dark .online-user-card.role-presence-member,
html.theme-dark .online-user-card.role-presence-senior,
html.theme-dark .online-user-card.role-presence-senior-member,
html.theme-dark .online-user-card.role-presence-member,
html.theme-dark .online-user-card.role-presence-senior,
html.theme-dark .online-user-card.role-presence-senior-member,
html.theme-dark .forum-online-person.role-presence-member,
html.theme-dark .forum-online-person.role-presence-senior,
html.theme-dark .forum-online-person.role-presence-senior-member,
html.theme-dark .forum-online-person.role-presence-member,
html.theme-dark .forum-online-person.role-presence-senior,
html.theme-dark .forum-online-person.role-presence-senior-member{background:#3b2818 !important;border-color:#e89b50 !important;color:#ffd0a0 !important}
html.theme-dark .online-user-card.role-presence-pilot,
html.theme-dark .online-user-card.role-presence-pilot,
html.theme-dark .forum-online-person.role-presence-pilot,
html.theme-dark .forum-online-person.role-presence-pilot{background:#17333a !important;border-color:#62bdcb !important;color:#b5edf4 !important}
html.theme-dark .online-user-card.role-presence-parent,
html.theme-dark .online-user-card.role-presence-parent,
html.theme-dark .forum-online-person.role-presence-parent,
html.theme-dark .forum-online-person.role-presence-parent{background:#3a2432 !important;border-color:#d17da4 !important;color:#f5bfd7 !important}
html.theme-dark .online-user-card.role-presence-prospect,
html.theme-dark .online-user-card.role-presence-prospect,
html.theme-dark .forum-online-person.role-presence-prospect,
html.theme-dark .forum-online-person.role-presence-prospect{background:#3a3218 !important;border-color:#d9b94f !important;color:#ffe58b !important}
html.theme-dark .online-user-card[class*="role-presence-"] strong,
html.theme-dark .online-user-card[class*="role-presence-"] small,
html.theme-dark .online-user-card[class*="role-presence-"] strong,
html.theme-dark .online-user-card[class*="role-presence-"] small{color:inherit !important}
html.theme-dark .forum-online-person[class*="role-presence-"],
html.theme-dark .forum-online-person[class*="role-presence-"]{box-shadow:none}

/* O-Flight Center informational headings: replace unreadable CAP royal blue */
html.theme-dark .oflight-info-grid article strong,
html.theme-dark .oflight-info-grid article strong{color:#8fc5ff !important}
html.theme-dark .oflight-info-grid article span:not(.oflight-info-icon),
html.theme-dark .oflight-info-grid article span:not(.oflight-info-icon){color:#d5deea !important}

/* Chat filter controls */
html.theme-dark .chat-member-type-filter-actions button,
html.theme-dark .chat-member-type-filter-actions button{background:#172235 !important;color:#e5edf8 !important;border-color:#53627a !important}
html.theme-dark .chat-member-type-filter-actions button:hover,
html.theme-dark .chat-member-type-filter-actions button:focus,
html.theme-dark .chat-member-type-filter-actions button:hover,
html.theme-dark .chat-member-type-filter-actions button:focus{background:#263650 !important;color:#ffffff !important;border-color:#8fc5ff !important}

/* Prospect navigation stays on the standard dark sidebar palette. */
html.theme-dark .role-prospect .sidebar-user,
html.theme-dark .role-prospect .sidebar-user{
 background:rgba(4,18,43,.42) !important;
 color:#f7f9ff !important;
 border-top-color:rgba(255,255,255,.12) !important;
}
html.theme-dark .role-prospect .sidebar-user-copy small,
html.theme-dark .role-prospect .sidebar-user-copy small{color:#c7d0df !important}

html.theme-dark .chat-conversation-section.is-readonly{border-top-color:#46556b !important}
html.theme-dark .chat-conversation-section-heading{color:#aebbd0 !important}
html.theme-dark .chat-close-conversation-button{background:#172235 !important;color:#ffb6c0 !important;border-color:#6f4550 !important}
html.theme-dark .chat-close-conversation-button:hover,
html.theme-dark .chat-close-conversation-button:focus{background:#3a1820 !important;color:#ffd5db !important;border-color:#ff687d !important}

html.theme-dark .attendance-history-list,
html.theme-dark .attendance-history-wrap,
html.theme-dark .attendance-history-table,
html.theme-dark .attendance-history-table thead,
html.theme-dark .attendance-history-table tbody,
html.theme-dark .attendance-history-table tr,
html.theme-dark .attendance-history-table th,
html.theme-dark .attendance-history-table td{background:#111827 !important;color:#e5edf8 !important;border-color:#46556b !important}
html.theme-dark .attendance-history-table th{background:#1b2a3f !important;color:#fff !important}
html.theme-dark .attendance-history-person{background:#172235 !important;color:#e5edf8 !important;border-color:#46556b !important}

/* Squadron Chat read-only oversight — explicit dark mode grayscale */
html.theme-dark .chat-conversation-item.is-readonly{
 background:#25282d !important;
 color:#d1d5db !important;
 border-color:#4b5563 !important;
}
html.theme-dark .chat-conversation-item.is-readonly:hover{
 background:#34383f !important;
 color:#f9fafb !important;
 border-color:#6b7280 !important;
}
html.theme-dark .chat-conversation-item.is-readonly.is-active{
 background:#3d424a !important;
 color:#ffffff !important;
 border-color:#9ca3af !important;
}
html.theme-dark .chat-conversation-item.is-readonly .chat-conversation-preview,
html.theme-dark .chat-conversation-item.is-readonly time{color:#aeb4bd !important}
html.theme-dark .chat-conversation-item.is-readonly .chat-conversation-readonly{
 background:#3a3f46 !important;color:#e5e7eb !important;border-color:#666d77 !important;
}
html.theme-dark .chat-archive-link{color:#d1d5db !important}
html.theme-dark .chat-archive-link:hover{color:#ffffff !important}
html.theme-dark .chat-archive-conversation,
html.theme-dark .chat-archive-summary,
html.theme-dark .chat-archive-body{background:#1f2329 !important;color:#e5e7eb !important;border-color:#4b5563 !important}
html.theme-dark .chat-archive-summary:hover{background:#292e35 !important}
html.theme-dark .chat-archive-lock{color:#cbd0d7 !important}
html.theme-dark .chat-archive-summary small,
html.theme-dark .chat-archive-summary-meta,
html.theme-dark .chat-archive-message-head time,
html.theme-dark .chat-archive-message>small{color:#aeb4bd !important}
html.theme-dark .chat-archive-participants span{background:#2d3239 !important;color:#e5e7eb !important;border:1px solid #555c66 !important}
html.theme-dark .chat-archive-message{background:#292e35 !important;color:#e5e7eb !important;border:1px solid #454c55 !important}

html.theme-dark .attendance-history-key{background:#172235 !important;border-color:#46556b !important;color:#e5edf8 !important}
html.theme-dark .attendance-history-person.status-present,html.theme-dark .attendance-history-key .status-present{color:#8ee6aa !important}
html.theme-dark .attendance-history-person.status-late,html.theme-dark .attendance-history-key .status-late{color:#ffb86b !important}
html.theme-dark .attendance-history-person.status-virtual,html.theme-dark .attendance-history-key .status-virtual{color:#8fc5ff !important}
html.theme-dark .attendance-history-person.status-excused,html.theme-dark .attendance-history-key .status-excused{color:#ffe07a !important}
html.theme-dark .attendance-history-person.status-absent,html.theme-dark .attendance-history-key .status-absent{color:#ff9aa8 !important}

/* Demo View quick theme switch — dark mode */
html.theme-dark .demo-theme-switch{background:#172235 !important;border-color:#53627a !important;color:#e5edf8 !important}
html.theme-dark .demo-theme-switch button{color:#e5edf8 !important}
html.theme-dark .demo-theme-switch button:hover,
html.theme-dark .demo-theme-switch button:focus{background:#263650 !important;color:#fff !important}
html.theme-dark .demo-theme-switch button.is-active{background:#e5edf8 !important;color:#172235 !important}

html.theme-dark .chat-view-all-participants{color:#8fc5ff !important}
html.theme-dark .chat-participants-dialog-card{background:#172235 !important;color:#edf2f7 !important}
html.theme-dark .chat-participants-dialog-head{border-color:#334155 !important}
html.theme-dark .chat-participant-list-item{border-color:#334155 !important}
html.theme-dark .chat-participant-list-item span{color:#b8c3d4 !important}

/* Permission slips — forced dark mode */
@media screen{
 html.theme-dark .rsvp-permission-method,
 html.theme-dark .permission-reference-panel{
   background:#111c2c;
   color:#edf2f7;
   border-color:#475569;
 }
 html.theme-dark .permission-reference-panel summary{
   background:#1d2b40;
   color:#edf2f7;
 }
 html.theme-dark .permission-reference-panel .permission-details dt,
 html.theme-dark .permission-reference-panel .permission-details dd,
 html.theme-dark .permission-summary-grid strong{
   color:#edf2f7;
 }
 html.theme-dark .permission-summary-grid>div,
 html.theme-dark .permission-success-details>div,
 html.theme-dark .paper-permission-upload-panel{
   background:#111c2c;
   color:#edf2f7;
   border-color:#475569;
 }
 html.theme-dark .permission-progress-list>div{
   background:#111c2c;
   color:#dbe4f1;
   border-color:#475569;
 }
 html.theme-dark .permission-progress-list>div.is-complete{
   background:#143421;
   color:#b8f0ca;
   border-color:#397754;
 }
 html.theme-dark .permission-upload-link{color:#9fc0ff}
 html.theme-dark .permission-upload-link.is-selected{color:#edf2f7}
 html.theme-dark .paper-permission-alternative,
 html.theme-dark .permission-success-details small,
 html.theme-dark .permission-form-card .field-help{color:#aab6c8}
 html.theme-dark .signature-wrap canvas{
   background:#fff;
   border-color:#738198;
   box-shadow:0 0 0 1px rgba(255,255,255,.08),inset 0 0 0 1px rgba(15,23,42,.08);
 }
 html.theme-dark .permission-slip-received{
   background:#143421;
   color:#b8f0ca;
   border-color:#397754;
 }
 html.theme-dark .permission-slip-received-icon{background:#3e9b63;color:#fff}

 /* A completed slip represents a paper form and must not inherit dark-card colors. */
 html.theme-dark .capf-permission-copy,
 html.theme-dark .capf-permission-copy.card{
   background:#fff!important;
   color:#111!important;
   border-color:#333!important;
 }
 html.theme-dark .capf-permission-copy h1,
 html.theme-dark .capf-permission-copy h2,
 html.theme-dark .capf-permission-copy h3,
 html.theme-dark .capf-permission-copy h4{
   color:var(--capf-blue)!important;
 }
 html.theme-dark .capf-permission-copy p,
 html.theme-dark .capf-permission-copy span,
 html.theme-dark .capf-permission-copy strong,
 html.theme-dark .capf-permission-copy em,
 html.theme-dark .capf-permission-copy div{
   color:inherit;
 }
 html.theme-dark .capf-permission-copy .capf-grid span,
 html.theme-dark .capf-permission-copy .capf-auth-grid span,
 html.theme-dark .capf-permission-copy .capf-verification-line span{color:#394554!important}
 html.theme-dark .capf-permission-copy .capf-grid strong,
 html.theme-dark .capf-permission-copy .capf-auth-grid strong,
 html.theme-dark .capf-permission-copy .capf-verification-line strong,
 html.theme-dark .capf-permission-copy .capf-document-row strong{color:#111!important}
 html.theme-dark .capf-permission-copy .capf-detach-line{color:#333!important}
 html.theme-dark .capf-permission-copy .capf-detach-line strong,
 html.theme-dark .capf-permission-copy .capf-form-footer strong{color:var(--capf-blue)!important}
 html.theme-dark .capf-permission-copy .capf-checkbox{background:#fff;color:#111;border-color:#333}
}

/* 2026-07-26 — Guided RSVP / permission workflow dark-mode coverage */
@media screen{
 html.theme-dark .rsvp-step-process,
 html.theme-dark .rsvp-process-step,
 html.theme-dark .permission-wizard-step{
  color:#edf2f7;
 }
 html.theme-dark .rsvp-process-step,
 html.theme-dark .permission-wizard-step{
  background:#111c2c!important;
  border-color:#475569!important;
 }
 html.theme-dark .rsvp-process-step.is-active{
  border-color:#7fa6ff!important;
  box-shadow:0 0 0 1px rgba(127,166,255,.22);
 }
 html.theme-dark .rsvp-process-step.is-locked{opacity:.78}
 html.theme-dark .rsvp-step-heading h3,
 html.theme-dark .permission-wizard-step h2,
 html.theme-dark .permission-wizard-step h3,
 html.theme-dark .rsvp-permission-method h4{
  color:#f8fafc!important;
 }
 html.theme-dark .rsvp-step-heading p,
 html.theme-dark .optional-label,
 html.theme-dark .rsvp-locked-message,
 html.theme-dark .rsvp-process-step .field-help,
 html.theme-dark .rsvp-process-step small{
  color:#aab6c8!important;
 }
 html.theme-dark .rsvp-step-number{
  background:#315a9e!important;
  color:#fff!important;
 }
 html.theme-dark .rsvp-locked-message{
  background:#172235!important;
  border-color:#53627a!important;
 }
 html.theme-dark .rsvp-process-step label,
 html.theme-dark .permission-wizard-step label{
  color:#edf2f7!important;
 }
 html.theme-dark .rsvp-process-step input[type="text"],
 html.theme-dark .rsvp-process-step input[type="tel"],
 html.theme-dark .rsvp-process-step input[type="email"],
 html.theme-dark .rsvp-process-step textarea,
 html.theme-dark .rsvp-process-step select,
 html.theme-dark .permission-wizard-step input,
 html.theme-dark .permission-wizard-step textarea,
 html.theme-dark .permission-wizard-step select{
  background:#0d1624!important;
  color:#f8fafc!important;
  border-color:#53627a!important;
 }
 html.theme-dark .rsvp-process-step input::placeholder,
 html.theme-dark .rsvp-process-step textarea::placeholder,
 html.theme-dark .permission-wizard-step input::placeholder,
 html.theme-dark .permission-wizard-step textarea::placeholder{color:#8391a5!important}
 html.theme-dark .rsvp-choice span{
  background:#172235!important;
  color:#e5edf8!important;
  border-color:#53627a!important;
 }
 html.theme-dark .rsvp-choice input:checked+span{
  background:#254b85!important;
  color:#fff!important;
  border-color:#8fb3ff!important;
 }
 html.theme-dark .transportation-request{
  color:#e5edf8!important;
 }
 html.theme-dark .rsvp-save-reminder{
  background:#3d3213!important;
  color:#ffe8a3!important;
  border-color:#8d742e!important;
 }
 html.theme-dark .rsvp-permission-method{
  background:#172235!important;
  border:1px solid #475569!important;
  border-radius:12px;
  padding:1rem;
 }
 html.theme-dark .paper-permission-download{
  color:#edf2f7!important;
 }
}


/* 2026-07-28 — system-wide component dark-mode stabilization */
@media screen{
 html.theme-dark .app-modal-panel,
 html.theme-dark .modal-form-body,
 html.theme-dark .promotion-overhaul-modal .app-modal-panel,
 html.theme-dark .promotion-edit-form,
 html.theme-dark .promotion-stage-checklist,
 html.theme-dark .promotion-dynamic-checklist,
 html.theme-dark .promotion-dynamic-item,
 html.theme-dark .dp2-catalog-department,
 html.theme-dark .dp2-catalog-section,
 html.theme-dark .dp2-catalog-position,
 html.theme-dark .dp2-position-staffing,
 html.theme-dark .dp2-assignees,
 html.theme-dark .duty-position-editor>form,
 html.theme-dark .dp2-review-card,
 html.theme-dark .dp2-stat{
  background:#172235!important;color:#edf2f7!important;border-color:#475569!important;
 }
 html.theme-dark .app-modal-header,
 html.theme-dark .dp2-catalog-department>summary,
 html.theme-dark .dp2-catalog-section>summary,
 html.theme-dark .promotion-edit-review-heading{
  background:#1d2b40!important;color:#edf2f7!important;border-color:#475569!important;
 }
 html.theme-dark .promotion-dynamic-item.is-auto{background:#111c2c!important}
 html.theme-dark .promotion-dynamic-item.is-complete{background:#143421!important;border-color:#397754!important}
 html.theme-dark .promotion-dynamic-item strong,
 html.theme-dark .dp2-catalog-position h4,
 html.theme-dark .dp2-catalog-department h2,
 html.theme-dark .dp2-catalog-section h3{color:#f8fafc!important}
 html.theme-dark .promotion-dynamic-item small,
 html.theme-dark .promotion-dynamic-item em,
 html.theme-dark .dp2-catalog-position p,
 html.theme-dark .dp2-position-staffing span{color:#aab6c8!important}
 html.theme-dark .promotion-edit-form input,
 html.theme-dark .promotion-edit-form select,
 html.theme-dark .promotion-edit-form textarea,
 html.theme-dark .dp2-toolbar input,
 html.theme-dark .dp2-toolbar select,
 html.theme-dark .duty-position-editor input,
 html.theme-dark .duty-position-editor select,
 html.theme-dark .duty-position-editor textarea{
  background:#0d1624!important;color:#f8fafc!important;border-color:#53627a!important;
 }
 html.theme-dark .dp2-badge{background:#263449!important;color:#edf2f7!important}
 html.theme-dark .dp2-vacant{background:#4b3810!important;color:#ffe6a3!important}
}

html.theme-dark .member-achievement-section.has-welcome-section{border-color:#33425a}html.theme-dark .member-recognition-subheading-icon{background:#27344a;color:#eef3fb}html.theme-dark .member-welcome-card{background:#182d25;border-color:#35624d}html.theme-dark .member-welcome-icon{background:#234936;color:#bff3d1}html.theme-dark .member-recognition-subheading p{color:#aebbd0}

html.theme-dark .attendance-history-status-group{background:#172235 !important;border-color:#46556b !important}
html.theme-dark .attendance-history-status-heading{background:#202d42 !important;border-color:#46556b !important;color:#f3f7fc !important}
html.theme-dark .attendance-history-status-count{background:#33445e !important;color:#fff !important}

/* 2026-07-29 — preserve live attendance status colors in manual dark mode. */
html.theme-dark .status-btn.present.selected,
html.theme-dark .status-btn.present[aria-pressed="true"]{background:#1f7a45!important;color:#fff!important;border-color:#62c98a!important}
html.theme-dark .status-btn.late.selected,
html.theme-dark .status-btn.late[aria-pressed="true"]{background:#b96a00!important;color:#fff!important;border-color:#ffb86b!important}
html.theme-dark .status-btn.virtual.selected,
html.theme-dark .status-btn.virtual[aria-pressed="true"]{background:#0050b5!important;color:#fff!important;border-color:#8fc5ff!important}
html.theme-dark .status-btn.excused.selected,
html.theme-dark .status-btn.excused[aria-pressed="true"]{background:#d9a400!important;color:#211b00!important;border-color:#ffe07a!important}
html.theme-dark .status-btn.absent.selected,
html.theme-dark .status-btn.absent[aria-pressed="true"]{background:#ba0c2f!important;color:#fff!important;border-color:#ff9aa8!important}
html.theme-dark .status-btn.clear.selected,
html.theme-dark .status-btn.clear[aria-pressed="true"]{background:#667085!important;color:#fff!important;border-color:#b9c2d0!important}

/* 2026-07-29 — Dashboard Missions & Events date contrast in manual dark mode. */
html.theme-dark .dashboard-mission-event-date strong{
  color:#c9d8ee!important;
}
html.theme-dark .dashboard-mission-event-date span{
  color:#f4f8ff!important;
  text-shadow:0 1px 2px rgba(0,0,0,.35);
}

/* 2026-07-29: Dark-mode contrast repairs for Cadet Interest Review and Attendance */
html.theme-dark .cadet-review-position-description,
html[data-theme="dark"] .cadet-review-position-description,
body.dark-mode .cadet-review-position-description {
  color:#dbe8f7 !important;
  background:#172235 !important;
  border:1px solid #3b506a !important;
  border-radius:10px !important;
  margin:.75rem 1.25rem .35rem !important;
  padding:.85rem 1rem !important;
  line-height:1.6 !important;
}
html.theme-dark .cadet-application-details :where(h5,p),
html[data-theme="dark"] .cadet-application-details :where(h5,p),
body.dark-mode .cadet-application-details :where(h5,p) {
  opacity:1 !important;
}
html.theme-dark .attendance-summary .summary-chip strong,
html[data-theme="dark"] .attendance-summary .summary-chip strong,
body.dark-mode .attendance-summary .summary-chip strong {
  color:#f8fbff !important;
  text-shadow:0 1px 2px rgba(0,0,0,.45) !important;
}
html.theme-dark .attendance-summary .summary-chip.virtual strong,
html[data-theme="dark"] .attendance-summary .summary-chip.virtual strong,
body.dark-mode .attendance-summary .summary-chip.virtual strong {
  color:#b9dcff !important;
}

/* 2026-07-29 — Squadron Moments uploader final dark-mode contrast repair */
html.theme-dark .moments-sharing-reminder,
html.theme-dark .moments-upload-card {
  background:#152235!important;
  border-color:#3a5068!important;
  color:#eef5fb!important;
}
html.theme-dark .moments-sharing-reminder :where(h2,p,li,strong,span,b),
html.theme-dark .moments-upload-card :where(h2,label,legend,p,strong,span,b,small) {
  color:#eef5fb!important;
  opacity:1!important;
}
html.theme-dark .moments-review-notice {
  background:#102a3d!important;
  border:1px solid #416b89!important;
  border-left:4px solid #62b5e5!important;
  color:#e9f6ff!important;
  box-shadow:none!important;
}
html.theme-dark .moments-review-notice :where(strong,span,b) {
  color:#e9f6ff!important;
  opacity:1!important;
}
html.theme-dark .moments-upload-patience-note {
  background:#10283a!important;
  border:1px solid #416783!important;
  border-left:4px solid #67b9e8!important;
  color:#edf8ff!important;
  box-shadow:none!important;
}
html.theme-dark .moments-upload-patience-note :where(strong,span) {
  color:#edf8ff!important;
  opacity:1!important;
}
html.theme-dark .moments-file-field {
  background:#0d1926!important;
  border-color:#466680!important;
  color:#eef6fc!important;
}
html.theme-dark .moments-file-field :where(strong,span,b) {
  color:#dceaf5!important;
  opacity:1!important;
}
html.theme-dark .moments-file-heading strong {color:#fff!important}
html.theme-dark .moments-upload-limits {
  background:#132235!important;
  border-color:#334c64!important;
}
html.theme-dark .moments-upload-limits span {color:#cbd9e5!important}
html.theme-dark .moments-upload-limits b {color:#fff!important}
html.theme-dark .moments-upload-form .form-grid > label > strong,
html.theme-dark .moments-upload-form .moments-caption-field > strong,
html.theme-dark .moments-upload-form label > strong {
  color:#f5f9fd!important;
  opacity:1!important;
}
html.theme-dark .moments-upload-form .form-help {
  color:#c0cfdb!important;
  opacity:1!important;
}
html.theme-dark .moments-upload-form .optional-label {
  background:#26384c!important;
  border-color:#526a82!important;
  color:#d8e4ee!important;
}
html.theme-dark .moments-usage-choice {
  background:#0e1b28!important;
  border-color:#45617a!important;
  color:#eef5fb!important;
}
html.theme-dark .moments-usage-choice legend {
  background:#152235!important;
  color:#fff!important;
}
html.theme-dark .moments-usage-choice > p {color:#c8d6e2!important}
html.theme-dark .moments-usage-choice label {
  background:#142638!important;
  border-color:#3d5870!important;
  color:#eef5fb!important;
}
html.theme-dark .moments-usage-choice label:has(input:checked) {
  background:#193850!important;
  border-color:#69a9d2!important;
}
html.theme-dark .moments-usage-choice label span,
html.theme-dark .moments-usage-choice label strong {
  color:#f5f9fd!important;
  opacity:1!important;
}
html.theme-dark .moments-usage-choice label small {
  color:#c2d1dd!important;
  opacity:1!important;
}
html.theme-dark .moments-upload-form input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
html.theme-dark .moments-upload-form select,
html.theme-dark .moments-upload-form textarea {
  background:#0b1723!important;
  border-color:#425d74!important;
  color:#f5f9fd!important;
  opacity:1!important;
}
html.theme-dark .moments-upload-form input::placeholder,
html.theme-dark .moments-upload-form textarea::placeholder {color:#9eb0c0!important;opacity:1!important}
html.theme-dark .moments-upload-form select option {background:#0b1723!important;color:#f5f9fd!important}
html.theme-dark .moments-file-summary {color:#d8e7f2!important}
html.theme-dark .moments-upload-progress,
html.theme-dark .moments-upload-overlay-card {
  background:#10283a!important;
  border-color:#456d89!important;
  color:#eef8ff!important;
}
html.theme-dark .moments-upload-progress :where(strong,small,span),
html.theme-dark .moments-upload-overlay-card :where(strong,small,span) {color:#eef8ff!important;opacity:1!important}


/* Meeting plan focus categories */
body.dark-mode .meeting-standard-pill,html.dark-mode .meeting-standard-pill{background:#263244;color:#e7edf7;border-color:#46546a}
body.dark-mode .meeting-focus-selector,html.dark-mode .meeting-focus-selector{border-color:#46546a;background:#172131}
body.dark-mode .meeting-focus-selector legend,html.dark-mode .meeting-focus-selector legend{color:#f3f6fb}
@media (prefers-color-scheme: dark){html:not(.light-mode) .meeting-standard-pill{background:#263244;color:#e7edf7;border-color:#46546a}html:not(.light-mode) .meeting-focus-selector{border-color:#46546a;background:#172131}html:not(.light-mode) .meeting-focus-selector legend{color:#f3f6fb}}

/* V6.3.50 O-Flight Center home redesign */
html.theme-dark .oflight-about-panel,html.theme-dark .oflight-upcoming-overview,html.theme-dark .oflight-stats-card,html.theme-dark .oflight-personal-progress{background:#111b2c;border-color:#34445c}
html.theme-dark .oflight-stats-heading,html.theme-dark .oflight-info-list article{background:#162238;border-color:#34445c}
html.theme-dark .oflight-section-icon,html.theme-dark .oflight-info-list .oflight-info-icon{background:#213654;color:#cfe3ff}
html.theme-dark .oflight-about-panel>p,html.theme-dark .oflight-info-list span,html.theme-dark .oflight-upcoming-list article>div span,html.theme-dark .oflight-compact-stats small,html.theme-dark .oflight-personal-progress>span,html.theme-dark .oflight-personal-progress>strong small{color:#c3cedd}
html.theme-dark .oflight-info-list strong,html.theme-dark .oflight-compact-stats strong,html.theme-dark .oflight-personal-progress>strong{color:#9dccff}
html.theme-dark .oflight-upcoming-list article,html.theme-dark .oflight-compact-stats article{border-color:#34445c}
html.theme-dark .oflight-progress-track{background:#334155}
html.theme-dark .oflight-official-link{color:#8fc5ff}

/* Dashboard Upcoming O-Flights: explicit manual dark-theme support */
html.theme-dark .dashboard-oflights-card{
  background:#111a2b!important;
  border-color:#344158!important;
  color:#edf3ff!important;
}
html.theme-dark .dashboard-oflights-next{
  background:#182338!important;
  border-color:#344158!important;
  color:#edf3ff!important;
}
html.theme-dark .dashboard-oflights-details h3,
html.theme-dark .dashboard-oflights-details strong{
  color:#f4f7ff!important;
}
html.theme-dark .dashboard-oflights-details p,
html.theme-dark .dashboard-oflights-details small{
  color:#b8c4d8!important;
}
html.theme-dark .dashboard-oflights-personal span{
  background:#182338!important;
  border-color:#344158!important;
  color:#e8effb!important;
}
html.theme-dark .dashboard-oflights-status{
  background:#183529!important;
  color:#9ee1b7!important;
  border-color:#2f6547!important;
}
html.theme-dark .dashboard-oflights-status-nearly-full{
  background:#3c3216!important;
  color:#ffe395!important;
  border-color:#6d5b24!important;
}
html.theme-dark .dashboard-oflights-status-full{
  background:#3d2024!important;
  color:#ffb8be!important;
  border-color:#73363d!important;
}

/* Dashboard Recent Achievements & Milestones — authoritative dark-mode rules.
   Kept in the dedicated theme stylesheet so later global link rules cannot
   restore light-mode yellow surfaces or blue link text. */
html.theme-dark .dashboard-layout-grid a.member-recognition-compact-item.member-recognition-earned{
  background:#24231f !important;
  border-color:#514b36 !important;
  border-left-color:#d2ac32 !important;
  color:#f7f4ea !important;
}
html.theme-dark .dashboard-layout-grid a.member-recognition-compact-item.member-recognition-earned:hover{
  background:#302e26 !important;
}
html.theme-dark .dashboard-layout-grid a.member-recognition-compact-item.member-recognition-earned .member-recognition-avatar{
  background:#38352a !important;
  border-color:#887638 !important;
  color:#fff4c2 !important;
}
html.theme-dark .dashboard-layout-grid a.member-recognition-compact-item.member-recognition-earned .member-recognition-compact-copy strong{
  color:#ffffff !important;
}
html.theme-dark .dashboard-layout-grid a.member-recognition-compact-item.member-recognition-earned .member-recognition-compact-copy > span,
html.theme-dark .dashboard-layout-grid a.member-recognition-compact-item.member-recognition-earned time{
  color:#ddd2a9 !important;
}

html.theme-dark .commander-requirement-check{background:#172337;border-color:#496b94;color:#f4f7fb}
html.theme-dark .commander-verification-actions{border-top-color:#385777}

/* Dashboard promotion recognition — authoritative dark-mode rules. */
html.theme-dark .dashboard-layout-grid a.member-recognition-compact-item.member-recognition-promotion{
  background:#173553 !important;
  border-color:#315f8b !important;
  border-left-color:#62aef5 !important;
  color:#eef7ff !important;
}
html.theme-dark .dashboard-layout-grid a.member-recognition-compact-item.member-recognition-promotion:hover{
  background:#1d4267 !important;
}
html.theme-dark .dashboard-layout-grid a.member-recognition-compact-item.member-recognition-promotion .member-recognition-avatar{
  background:#214d78 !important;
  border-color:#65b5ff !important;
  color:#ffffff !important;
}
html.theme-dark .dashboard-layout-grid a.member-recognition-compact-item.member-recognition-promotion .member-recognition-compact-copy strong{
  color:#ffffff !important;
}
html.theme-dark .dashboard-layout-grid a.member-recognition-compact-item.member-recognition-promotion .member-recognition-compact-copy > span,
html.theme-dark .dashboard-layout-grid a.member-recognition-compact-item.member-recognition-promotion time{
  color:#c7e4ff !important;
}
html.theme-dark .dashboard-layout-grid a.member-recognition-compact-item.member-recognition-promotion .recognition-promotion-label{
  color:#8bcbff !important;
}
html.theme-dark .dashboard-layout-grid a.member-recognition-compact-item.member-recognition-promotion .recognition-promotion-grade{
  color:#eef7ff !important;
  font-weight:700;
}

/* O-Flight Cadet Progress — authoritative dark-mode contrast fixes. */
html.theme-dark .oflight-report-table thead th span,
html.theme-dark .oflight-report-table thead th strong{
  color:#f3f7ff !important;
  opacity:1 !important;
}
html.theme-dark .oflight-qualifications-save-all{
  background:#172235 !important;
  color:#edf2f7 !important;
  border-color:#40516a !important;
  box-shadow:0 8px 24px rgba(0,0,0,.38) !important;
}
html.theme-dark .oflight-qualifications-save-all .muted{color:#cbd7e8 !important}

html.theme-dark .oflight-program-links .oflight-resource-card,html.theme-system .oflight-program-links .oflight-resource-card{background:linear-gradient(135deg,#182536 0%,#111b28 100%);border-color:#40556e;color:#f3f7fc;box-shadow:0 6px 16px rgba(0,0,0,.28)}
html.theme-dark .oflight-program-links .oflight-resource-card.primary,html.theme-system .oflight-program-links .oflight-resource-card.primary{background:linear-gradient(135deg,#15314f 0%,#111b28 75%);border-color:#5a8ec5}
html.theme-dark .oflight-program-links .oflight-resource-card:hover,html.theme-dark .oflight-program-links .oflight-resource-card:focus-visible,html.theme-system .oflight-program-links .oflight-resource-card:hover,html.theme-system .oflight-program-links .oflight-resource-card:focus-visible{border-color:#8fc5ff;box-shadow:0 10px 22px rgba(0,0,0,.38)}
html.theme-dark .oflight-resource-icon,html.theme-system .oflight-resource-icon{background:#26394e}
html.theme-dark .oflight-resource-card.primary .oflight-resource-icon,html.theme-system .oflight-resource-card.primary .oflight-resource-icon{background:#20466d}
html.theme-dark .oflight-resource-copy small,html.theme-system .oflight-resource-copy small{color:#b8c8d9}
html.theme-dark .oflight-resource-arrow,html.theme-system .oflight-resource-arrow{background:#263d57;color:#a9d3ff}

/* 2026-08-06 — Notification Preferences: required promotion workflow notice */
html.theme-dark .notification-required-topic,
body.theme-dark .notification-required-topic {
  background:#17283b !important;
  border-color:#45627d !important;
  color:#f4f7fb !important;
  box-shadow:none !important;
}
html.theme-dark .notification-required-topic strong,
html.theme-dark .notification-required-topic > span,
body.theme-dark .notification-required-topic strong,
body.theme-dark .notification-required-topic > span {
  color:#f4f7fb !important;
}
html.theme-dark .notification-required-topic small,
body.theme-dark .notification-required-topic small {
  color:#c8d6e2 !important;
}
html.theme-dark .notification-required-topic .status-badge.success,
body.theme-dark .notification-required-topic .status-badge.success {
  background:#173f32 !important;
  border-color:#3f8f70 !important;
  color:#c8f6df !important;
}

/* Meeting Plans modal/action footer — dark mode */
html.theme-dark .app-modal-actions{
  background:#111827 !important;
  border-top-color:#46556b !important;
  color:#f3f6fb !important;
}
html.theme-dark .app-modal-actions .btn-secondary{
  background:#243247 !important;
  border-color:#52647d !important;
  color:#f3f6fb !important;
}
html.theme-dark .app-modal-actions .btn-secondary:hover{background:#2d3d54 !important;}

/* ==========================================================================
   2026-08-22 full dark-mode audit
   Covers legacy/nested panels whose light backgrounds bypass the generic
   .card dark surface. @media screen intentionally leaves print documents alone.
   ========================================================================== */
@media screen {
 html.theme-dark{
  --card-bg:#172235;
  --surface-muted:#111c2c;
  --surface-soft:#111c2c;
  --border-color:#334155;
  --text-muted:#aab6c8;
  --table-border:#334155;
  --table-row-even:#19263a;
  --table-row-hover:#263650;
  --table-head:#1d2b40;
 }

 /* Model Rocketry: exam completion and stage/status surfaces */
 html.theme-dark .rocketry-exam-actions,
 html.theme-dark .rocketry-exam-button-card,
 html.theme-dark .rocketry-cadet-summary-progress,
 html.theme-dark .rocketry-summary-phase-chips>span,
 html.theme-dark .rocketry-member-phase,
 html.theme-dark .rocketry-group-roster,
 html.theme-dark .rocketry-group-cadet{
  background:#172235!important;color:#edf2f7!important;border-color:#334155!important;
 }
 html.theme-dark .rocketry-exam-button-card.is-pending,
 html.theme-dark .rocketry-requirement.is-submitted,
 html.theme-dark .rocketry-award-card.is-ready{
  background:#302711!important;color:#fff0b4!important;border-color:#d8ad36!important;
 }
 html.theme-dark .rocketry-exam-button-card.is-verified,
 html.theme-dark .rocketry-requirement.is-verified,
 html.theme-dark .rocketry-award-card.is-approved,
 html.theme-dark .rocketry-member-phase.is-complete,
 html.theme-dark .rocketry-summary-phase-chips>span.is-complete{
  background:#102b20!important;color:#c9f1d8!important;border-color:#3f9b68!important;
 }
 html.theme-dark .rocketry-exam-state-icon{
  background:#263449!important;color:#dbe7f4!important;
 }
 html.theme-dark .rocketry-required-callout{
  background:#302711!important;color:#fff0b4!important;border-color:#d8ad36!important;
 }

 /* Generic nested surfaces missed by older dark rules */
 html.theme-dark :where(
  .branding-preview,.inactive-members-toggle,.inactive-members-section,
  .account-card,.account-details-grid>div,.user-account-row,.user-account-filters,
  .app-modal-panel,.app-modal-actions,.workspace-action-bar,
  .event-summary-card,.event-stat-grid .stat-card,.event-list-filters,
  .event-management-row,.event-row-metrics span,
  .promotion-requirements,.promotion-checkbox-grid .checkbox,
  .drill-test-card,.test-facts>div,.command-score-card,.testing-officer-tip,
  .binary-score label,.test-save-bar,.private-notes-panel,.evaluation-summary-panel,
  .analytics-card,.supplement-selector,.phone-command-sequence,.selection-step,
  .selected-test-heading,.score-calculation-actions,.officer-command-checklist,
  .promotion-id-block,.promotion-requirement-review>div,.eservices-confirmation,
  .legacy-achievement-panel,.compact-requirements-table tr,
  .report-range-summary,.reports-inactive-toggle label,.reports-stat-card,.reports-overview,
  .duty-menu-panel,.report-launch-card,.duty-report-row,.info-popover>div,
  .duty-category-block,.org-chart-tabs>details,.org-chart,.command-chart,
  .coc-title-block,.coc-flight-column,.role-permission-grid details,
  .permission-download-card,.event-logistics-grid>div,
  .oflight-info-grid article,.oflight-card,.oflight-roster-row,
  .admin-profile-focal-form,.parent-registration-panel,.pt-result-card,
  .chat-selected-participants,.chat-selected-person,.chat-autocomplete-results,
  .chat-reaction-picker,.dashboard-mission-event-card,
  .audit-details dl,.notification-channel-icon
 ){
  background:#172235!important;
  color:#edf2f7!important;
  border-color:#334155!important;
 }

 html.theme-dark :where(
  .inactive-members-section tbody tr,.account-card-disabled,.event-row-past,
  .selection-step.is-disabled,.duty-filled-section-heading,
  .duty-filled-opportunities .duty-opportunity-card,.oflight-past-card
 ){
  background:#111c2c!important;color:#aab6c8!important;border-color:#334155!important;
 }

 /* Inputs/dropdowns created by older components */
 html.theme-dark :where(
  .branding-form input[type=file],.inline-edit-control,
  .supplement-selector select,.selection-step select,
  .chat-participants-manage select,.parent-registration-form input[readonly]
 ){
  background:#0f1a2a!important;color:#edf2f7!important;border-color:#475569!important;
 }

 /* Tables: defeat legacy !important zebra striping */
 html.theme-dark .table-wrap{background:#172235!important;border-color:#334155!important}
 html.theme-dark table{background:#172235!important;color:#edf2f7!important}
 html.theme-dark tbody tr:nth-child(odd)>td{background:#152033!important;color:#edf2f7!important}
 html.theme-dark tbody tr:nth-child(even)>td{background:#19263a!important;color:#edf2f7!important}
 html.theme-dark tbody tr:hover>td{background:#263650!important;color:#fff!important}
 html.theme-dark .editable-member-table tr.row-modified>td,
 html.theme-dark .row-editing>td{background:#3b3218!important;color:#ffe9a6!important}

 /* Popovers/navigation */
 html.theme-dark .nav-dropdown,
 html.theme-dark .sidebar-account>div{
  background:#172235!important;color:#edf2f7!important;border-color:#334155!important;
 }
 html.theme-dark .nav-dropdown::before{background:#172235!important;border-color:#334155!important}

 /* Semantic pale surfaces translated to dark equivalents */
 html.theme-dark :where(.alert.warning,.notice,.deadline-note,.dashboard-widget-setting.is-pinned-widget){
  background:#3a3014!important;color:#ffe8a3!important;border-color:#806a2d!important;
 }
 html.theme-dark :where(.danger-zone,.response-group-not_attending,.permission-response-icon.permission-needed){
  background:#3b1d23!important;color:#ffcbd1!important;border-color:#7d414a!important;
 }
 html.theme-dark .response-group-interested{
  background:#3a3014!important;color:#ffe8a3!important;border-color:#806a2d!important;
 }
 html.theme-dark :where(.info-callout,.transportation-request,.rocketry-group-step-label){
  background:#132a43!important;color:#d8ebff!important;border-color:#3f6f9e!important;
 }

 /* Profiles / parent registration / PT */
 html.theme-dark :where(
  .admin-profile-photo-preview,.profile-focal-circle-preview,
  .profile-focal-controls output,.profile-drag-crop-status span,
  .parent-registration-request-names,.pt-cadet-choice
 ){
  background:#172235!important;color:#edf2f7!important;border-color:#334155!important;
 }
 html.theme-dark .pt-cadet-choice:has(input:checked){
  background:#173153!important;color:#d6e9ff!important;border-color:#6396ce!important;
 }

 /* Chat and notification details */
 html.theme-dark .chat-readonly-banner{
  background:#3a3014!important;color:#ffe8a3!important;border-color:#806a2d!important;
 }
 html.theme-dark :where(.chat-reaction-chip,.chat-user-role-badge,.training-plan-external-leader){
  background:#263449!important;color:#dbe5f2!important;border-color:#475569!important;
 }
 html.theme-dark .chat-selected-remove:hover,
 html.theme-dark .chat-selected-remove:focus-visible{
  background:#3b1d23!important;color:#ffcbd1!important;
 }

 /* Report / duty / role pills that were pale white or silver */
 html.theme-dark :where(.duty-category-block>summary,.org-chart-tabs>details>summary,.role-permission-grid summary){
  background:#1d2b40!important;color:#dbe7f7!important;border-color:#334155!important;
 }
 html.theme-dark .duty-report-row.is-vacant{
  background:#3a3014!important;color:#ffe8a3!important;border-color:#806a2d!important;
 }

 /* Existing selected-file and required-label fixes remain authoritative */
 html.theme-dark .moments-selected-item{background:#142533!important;color:#f5f9fc!important;border-color:#49677d!important}
 html.theme-dark .moments-upload-form .required-label{background:#4a2028!important;color:#ffd7dc!important;border-color:#a65b66!important}
}

/* Final unresolved UI surfaces from the 2026-08-22 static audit.
   Document canvases and signature pads are intentionally excluded. */
@media screen {
 html.theme-dark .nav-toggle,
 html.theme-dark .past-meeting-card:hover,
 html.theme-dark .org-node,
 html.theme-dark .access-denied-page,
 html.theme-dark .forum-emoji-picker,
 html.theme-dark .forum-post-edit-popover,
 html.theme-dark .rocketry-phase-table .member-col,
 html.theme-dark .ui-table,
 html.theme-dark .ui-modal-dialog{
  background:#172235!important;
  color:#edf2f7!important;
  border-color:#334155!important;
 }
 html.theme-dark :where(input:not([type=checkbox]):not([type=radio]),select,textarea,.ui-control){
  background:#0f1a2a!important;
  color:#edf2f7!important;
  border-color:#475569!important;
 }
 html.theme-dark .org-node *{color:inherit!important}
 html.theme-dark .forum-emoji-picker button:hover,
 html.theme-dark .forum-emoji-picker button:focus-visible{
  background:#263449!important;
  color:#fff!important;
 }
}
