/* ============================================================================
   Portal-wide DARK MODE. Activated by data-theme="dark" on <html> (global toggle
   in base.html; persisted in localStorage 'portal-theme'; defaults to the OS).
   The portal is token-driven (--m-* in style.css :root), so the core here just
   overrides those tokens; the long tail below (auto-generated from a coverage
   sweep of every template + CSS file) patches hardcoded light colors and
   Bootstrap components. The navy sidebar (--m-sidebar) is intentionally kept.
   ============================================================================ */

/* ---- Core: token overrides ---- */
html[data-theme="dark"] {
  color-scheme: dark;               /* native selects, scrollbars, date pickers */
  --m-bg:            #0f1c28;        /* app canvas */
  --m-surface:       #16283a;        /* cards / panels */
  --m-surface-2:     #12222f;        /* table head, subtle fills */
  --m-border:        #22384c;
  --m-border-strong: #2b4358;
  --m-ink:           #e6eef2;        /* headings + primary text */
  --m-ink-2:         #93a7b3;        /* body / muted */
  --m-ink-3:         #6d8493;        /* placeholders / subtle */
  --m-primary:       #4c9aff;        /* brightened blue for dark contrast */
  --m-primary-strong:#3b82f6;
  --m-primary-050:   #13314a;        /* dark tint for active/soft states */
  --m-accent:        #22d3ee;        /* brightened teal for dark contrast */
  --m-accent-strong: #0891b2;
  --m-accent-ink:    #22d3ee;
  --m-accent-050:    rgba(34,211,238,0.14);
  --m-success:       #34d399;  --m-success-bg: #0e2a1e;
  --m-warning:       #fbbf24;  --m-warning-bg: #2e2410;
  --m-danger:        #f87171;  --m-danger-bg:  #2e1414;
  --m-shadow-1:      0 1px 2px rgba(0,0,0,0.45), 0 1px 3px rgba(0,0,0,0.5);
  --m-shadow-2:      0 8px 20px rgba(0,0,0,0.6);
  /* --m-sidebar intentionally NOT overridden: the rail stays its navy. */
  --nb-primary: var(--m-primary); --nb-ink: var(--m-ink); --nb-bg: var(--m-bg);
}

/* ---- Core: safety net for Bootstrap + shared primitives ---- */
html[data-theme="dark"] body { background-color: var(--m-bg) !important; color: var(--m-ink); }
html[data-theme="dark"] ::placeholder { color: var(--m-ink-3) !important; opacity: 1; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--m-border-strong); border-radius: 6px; }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: var(--m-surface-2); }
html[data-theme="dark"] hr { border-color: var(--m-border); opacity: 1; }
html[data-theme="dark"] a { color: var(--m-primary); }

/* Bootstrap cards */
html[data-theme="dark"] .card {
  background-color: var(--m-surface); color: var(--m-ink); border-color: var(--m-border);
}
html[data-theme="dark"] .card-header, html[data-theme="dark"] .card-footer {
  background-color: var(--m-surface-2); border-color: var(--m-border); color: var(--m-ink);
}

/* Bootstrap tables (native + bootstrap-table) drive off --bs-table-* vars */
html[data-theme="dark"] .table {
  --bs-table-bg: transparent; --bs-table-color: var(--m-ink);
  --bs-table-border-color: var(--m-border);
  --bs-table-striped-bg: rgba(255,255,255,0.03); --bs-table-striped-color: var(--m-ink);
  --bs-table-hover-bg: rgba(76,154,255,0.10); --bs-table-hover-color: var(--m-ink);
  color: var(--m-ink); border-color: var(--m-border);
}
html[data-theme="dark"] .table > thead, html[data-theme="dark"] .table th { color: var(--m-ink); }
html[data-theme="dark"] .table-light, html[data-theme="dark"] .table thead.table-light th,
html[data-theme="dark"] .bootstrap-table .fixed-table-container thead th {
  background-color: var(--m-surface-2) !important; color: var(--m-ink) !important; border-color: var(--m-border) !important;
}
html[data-theme="dark"] .bootstrap-table .fixed-table-toolbar,
html[data-theme="dark"] .fixed-table-container, html[data-theme="dark"] .fixed-table-body {
  background: transparent; color: var(--m-ink);
}
html[data-theme="dark"] .pagination .page-link {
  background: var(--m-surface); border-color: var(--m-border); color: var(--m-ink);
}
html[data-theme="dark"] .pagination .page-item.active .page-link {
  background: var(--m-primary); border-color: var(--m-primary); color: #06121d;
}

/* List groups, modals backdrop, popovers/tooltips */
html[data-theme="dark"] .list-group-item {
  background-color: var(--m-surface); color: var(--m-ink); border-color: var(--m-border);
}
html[data-theme="dark"] .modal-backdrop.show { opacity: 0.6; }
html[data-theme="dark"] .popover, html[data-theme="dark"] .tooltip-inner {
  background: var(--m-surface); color: var(--m-ink); border-color: var(--m-border);
}
html[data-theme="dark"] .input-group-text {
  background: var(--m-surface-2); color: var(--m-ink-2); border-color: var(--m-border-strong);
}
html[data-theme="dark"] pre, html[data-theme="dark"] .card pre {
  background: var(--m-surface-2); color: var(--m-ink); border-color: var(--m-border);
}

/* ---- Mapped coverage (auto-generated from portal-dark-mode-coverage sweep) ---- */
html[data-theme="dark"] .modal-content { background-color: var(--m-surface); color: var(--m-ink); }
html[data-theme="dark"] .modal-header, html[data-theme="dark"] .modal-footer { border-color: var(--m-border); }
html[data-theme="dark"] .close:hover { color: var(--m-ink); }
html[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
html[data-theme="dark"] .form-control, html[data-theme="dark"] .form-select, html[data-theme="dark"] textarea, html[data-theme="dark"] input:not([type=checkbox]):not([type=radio]):not([type=range]) { background-color: var(--m-bg); color: var(--m-ink); }
html[data-theme="dark"] .form-select { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2393a7b3' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
html[data-theme="dark"] .form-check-input { background-color: var(--m-bg); border-color: var(--m-border-strong); }
html[data-theme="dark"] .form-control:disabled, html[data-theme="dark"] .form-control[readonly] { background-color: var(--m-surface-2); color: var(--m-ink-2); }
html[data-theme="dark"] .dropdown-menu { background: var(--m-surface); border-color: var(--m-border); color: var(--m-ink); }
html[data-theme="dark"] .btn-outline-primary, html[data-theme="dark"] .btn-secondary, html[data-theme="dark"] .btn-outline-secondary, html[data-theme="dark"] .btn-outline-danger, html[data-theme="dark"] .btn-outline-warning, html[data-theme="dark"] .btn-info, html[data-theme="dark"] .btn-outline-info, html[data-theme="dark"] .actions-menu .btn-kebab { background: var(--m-surface) !important; }
html[data-theme="dark"] .btn-outline-danger { border-color: var(--m-danger) !important; }
html[data-theme="dark"] .btn-outline-warning { border-color: var(--m-warning) !important; }
html[data-theme="dark"] .btn-info, html[data-theme="dark"] .btn-outline-info { border-color: var(--m-primary) !important; }
html[data-theme="dark"] .alert-success { border-color: var(--m-success) !important; color: var(--m-success) !important; }
html[data-theme="dark"] .alert-danger { border-color: var(--m-danger) !important; color: var(--m-danger) !important; }
html[data-theme="dark"] .alert-warning { border-color: var(--m-warning) !important; color: var(--m-warning) !important; }
html[data-theme="dark"] .alert-info { border-color: var(--m-primary) !important; color: var(--m-primary) !important; }
html[data-theme="dark"] .metric-badge, html[data-theme="dark"] .badge.bg-secondary { background: var(--m-surface-2) !important; color: var(--m-ink) !important; }
html[data-theme="dark"] .badge.bg-success { background: var(--m-success-bg) !important; color: var(--m-success) !important; }
html[data-theme="dark"] code { color: var(--m-primary); }
html[data-theme="dark"] .aqua-table tbody tr { border-bottom-color: var(--m-border); }
html[data-theme="dark"] .aqua-stats-bar, html[data-theme="dark"] .aqua-filter-bar, html[data-theme="dark"] .aqua-empty-state, html[data-theme="dark"] .aqua-cloud-card, html[data-theme="dark"] .navbar { background: var(--m-surface); box-shadow: var(--m-shadow-1); }
html[data-theme="dark"] .stat-label, html[data-theme="dark"] .aqua-empty-state p { color: var(--m-ink-2); }
html[data-theme="dark"] .aqua-filter-bar .filter-select { background: var(--m-bg); border-color: var(--m-border-strong); color: var(--m-ink); }
html[data-theme="dark"] .select2-container--default .select2-selection--single { background: var(--m-bg); border-color: var(--m-border-strong); }
html[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--m-ink); }
html[data-theme="dark"] .feedback-panel { background: var(--m-surface); color: var(--m-ink); }
html[data-theme="dark"] .feedback-panel textarea, html[data-theme="dark"] .feedback-panel input, html[data-theme="dark"] .feedback-panel select { background: var(--m-bg); color: var(--m-ink); border-color: var(--m-border-strong); }
html[data-theme="dark"] .feedback-status { color: var(--m-ink-2); }
html[data-theme="dark"] .connecting-line { background: var(--m-border-strong); }
html[data-theme="dark"] .wizard .nav-tabs > li a i { color: var(--m-ink); }
html[data-theme="dark"] .wizard .nav-tabs > li.active > a { color: var(--m-ink); }
html[data-theme="dark"] span.round-tab { background: var(--m-surface); color: var(--m-ink); border-color: var(--m-border-strong); }
html[data-theme="dark"] span.round-tab i { color: var(--m-ink-2); }
html[data-theme="dark"] .custom-file-label { background-color: var(--m-bg); color: var(--m-ink); border-color: var(--m-border-strong); }
html[data-theme="dark"] .custom-file-label::after { background-color: var(--m-surface-2); color: var(--m-ink); }
html[data-theme="dark"] .list-content a { background-color: var(--m-surface-2); color: var(--m-ink); }
html[data-theme="dark"] .ctc-canvas { background: var(--m-bg); }
html[data-theme="dark"] .ctc-card, html[data-theme="dark"] .ctc-section, html[data-theme="dark"] .blg-hero, html[data-theme="dark"] .blg-rail .ctc-card { background: var(--m-surface); border-color: var(--m-border); }
html[data-theme="dark"] .ctc-select-wrap select, html[data-theme="dark"] .ctc-btn { background: var(--m-surface); border-color: var(--m-border-strong); color: var(--m-ink); }
html[data-theme="dark"] .ctc-btn:hover { background: var(--m-surface-2); color: var(--m-ink); }
html[data-theme="dark"] .ctc-icon-chip { background: var(--m-primary-050); color: var(--m-primary); }
html[data-theme="dark"] .ctc-title, html[data-theme="dark"] .ctc-value, html[data-theme="dark"] .ctc-section-title, html[data-theme="dark"] .ctc-td, html[data-theme="dark"] .ctc-td.ink, html[data-theme="dark"] .blg-big .whole, html[data-theme="dark"] .blg-key .val, html[data-theme="dark"] .blg-key .muted .val, html[data-theme="dark"] .blg-rail .val-lg, html[data-theme="dark"] .blg-rail .val-md, html[data-theme="dark"] .blg-rail .acct-name { color: var(--m-ink); }
html[data-theme="dark"] .ctc-subtitle, html[data-theme="dark"] .ctc-back, html[data-theme="dark"] .ctc-controls .lbl, html[data-theme="dark"] .ctc-note, html[data-theme="dark"] .ctc-overline, html[data-theme="dark"] .ctc-caption, html[data-theme="dark"] .ctc-section-sub, html[data-theme="dark"] .ctc-th, html[data-theme="dark"] .ctc-td.num, html[data-theme="dark"] .blg-big .frac, html[data-theme="dark"] .blg-key, html[data-theme="dark"] .blg-key .muted, html[data-theme="dark"] .blg-rail .sub, html[data-theme="dark"] .blg-rail .acct-id, html[data-theme="dark"] .blg-rail .acct-note, html[data-theme="dark"] .blg-legend span, html[data-theme="dark"] .blg-chart .ylabels span, html[data-theme="dark"] .blg-xlabels .labels span { color: var(--m-ink-2); }
html[data-theme="dark"] .ctc-overline .date, html[data-theme="dark"] .ctc-foot { color: var(--m-ink-3); }
html[data-theme="dark"] .ctc-thead, html[data-theme="dark"] .ctc-row { border-bottom-color: var(--m-border); }
html[data-theme="dark"] .ctc-row:hover { background: var(--m-surface-2); }
html[data-theme="dark"] .ctc-bar-track, html[data-theme="dark"] .blg-split { background: var(--m-surface-2); }
html[data-theme="dark"] .blg-chart .gridline { background: var(--m-border); }
html[data-theme="dark"] .blg-chart .baseline { background: var(--m-border-strong); }
html[data-theme="dark"] .ctc-pill.ctc-flat { background: var(--m-surface-2); }
html[data-theme="dark"] .ctc-pill.ctc-up { background: var(--m-danger-bg); }
html[data-theme="dark"] .ctc-pill.ctc-down { background: var(--m-success-bg); }
html[data-theme="dark"] .ctc-up { color: var(--m-danger) !important; }
html[data-theme="dark"] .ctc-down { color: var(--m-success) !important; }
html[data-theme="dark"] .ctc-flat { color: var(--m-ink-2) !important; }
html[data-theme="dark"] .ctc-back:hover, html[data-theme="dark"] .ctc-foot a { color: var(--m-primary); }
html[data-theme="dark"] .nav-tabs { border-bottom-color: var(--m-border); }
html[data-theme="dark"] .nav-tabs .nav-link { color: var(--m-ink-2); }
html[data-theme="dark"] .nav-tabs .nav-link.active { background: var(--m-surface); color: var(--m-ink); border-color: var(--m-border) var(--m-border) var(--m-surface); }
html[data-theme="dark"] .input-group-text { background: var(--m-surface-2); color: var(--m-ink); border-color: var(--m-border-strong); }
html[data-theme="dark"] .list-group-item { background: var(--m-surface); color: var(--m-ink); border-color: var(--m-border); }
html[data-theme="dark"] .accordion-item { background: var(--m-surface); border-color: var(--m-border); }
html[data-theme="dark"] .accordion-button { background: var(--m-surface); color: var(--m-ink); }
html[data-theme="dark"] .accordion-button:not(.collapsed) { background: var(--m-primary-050); color: var(--m-primary); }
html[data-theme="dark"] .accordion-button::after { filter: invert(1) grayscale(100%) brightness(200%); }
html[data-theme="dark"] .line { border-bottom-color: var(--m-border); }
html[data-theme="dark"] .spinner { border-color: rgba(255,255,255,0.15); border-top-color: var(--m-primary); }
html[data-theme="dark"] #content, html[data-theme="dark"] .dash { background: var(--m-bg); }
html[data-theme="dark"] .dash-hero h1, html[data-theme="dark"] .dash-tile .qa-title, html[data-theme="dark"] .dash-card-head h2, html[data-theme="dark"] .dash-billing .big, html[data-theme="dark"] .dash-billing .row-item span:last-child, html[data-theme="dark"] .dash-tests-grid .td.name .test-link, html[data-theme="dark"] .dash-tests-grid .td.dur, html[data-theme="dark"] .dash-infra .name { color: var(--m-ink); }
html[data-theme="dark"] .dash-hero p, html[data-theme="dark"] .dash-tile .qa-sub, html[data-theme="dark"] .dash-infra .sub, html[data-theme="dark"] .dash-billing .row-item span:first-child, html[data-theme="dark"] .dash-tests-grid .td.cluster, html[data-theme="dark"] .dash-tests-grid .th, html[data-theme="dark"] .dash-label, html[data-theme="dark"] .dash-tests-empty { color: var(--m-ink-2); }
html[data-theme="dark"] .dash-tile, html[data-theme="dark"] .dash-card, html[data-theme="dark"] .dash-infra a, html[data-theme="dark"] .dash-feedback { background: var(--m-surface); border-color: var(--m-border); }
html[data-theme="dark"] .dash-tile:hover, html[data-theme="dark"] .dash-infra a:hover, html[data-theme="dark"] .dash-feedback:hover { background: var(--m-surface-2); }
html[data-theme="dark"] .dash-card-head { border-bottom-color: var(--m-border); }
html[data-theme="dark"] .dash-tests-grid .td { border-top-color: var(--m-border); }
html[data-theme="dark"] .dash-tile .qa-icon, html[data-theme="dark"] .dash-infra .infra-icon { background: var(--m-surface-2); color: var(--m-ink-2); }
html[data-theme="dark"] .dash-hero-icon, html[data-theme="dark"] .qa-new, html[data-theme="dark"] .dash-tile.primary .qa-icon, html[data-theme="dark"] .dash-pill.running { background: var(--m-primary-050); color: var(--m-primary); }
html[data-theme="dark"] .dash-tile.primary { background: var(--m-primary-050); border-color: var(--m-border-strong); }
html[data-theme="dark"] .dash-pill.ok { background: var(--m-success-bg); color: var(--m-success); }
html[data-theme="dark"] .dash-pill.warn { background: var(--m-warning-bg); color: var(--m-warning); }
html[data-theme="dark"] .pc-pop { background: var(--m-surface); color: var(--m-ink); }
html[data-theme="dark"] .pc-pop h3, html[data-theme="dark"] .pc-pop-close:hover, html[data-theme="dark"] .pc-pop-actions .later:hover { color: var(--m-ink); }
html[data-theme="dark"] .pc-pop p, html[data-theme="dark"] .pc-pop li { color: var(--m-ink-2); }
html[data-theme="dark"] .pc-pop code { background: var(--m-surface-2); color: var(--m-ink); }
html[data-theme="dark"] .at-wrap { background: var(--m-bg); }
html[data-theme="dark"] .at-card, html[data-theme="dark"] .at-btn, html[data-theme="dark"] .at-empty { background: var(--m-surface); border-color: var(--m-border); }
html[data-theme="dark"] .at-card { border-left-color: var(--m-success); }
html[data-theme="dark"] .at-name, html[data-theme="dark"] .at-empty h3, html[data-theme="dark"] .at-btn { color: var(--m-ink); }
html[data-theme="dark"] .at-meta .cluster { color: var(--m-ink-2); }
html[data-theme="dark"] .at-pill { background: var(--m-success-bg); color: var(--m-success); }
html[data-theme="dark"] .at-tag { background: var(--m-primary-050); color: var(--m-primary); }
html[data-theme="dark"] .at-btn.abort { color: var(--m-danger); border-color: var(--m-border-strong); }
html[data-theme="dark"] #content { background: var(--m-bg); }
html[data-theme="dark"] .aqua-stats-bar .aqua-stat-item, html[data-theme="dark"] .aqua-filter-bar, html[data-theme="dark"] .aqua-table-wrapper, html[data-theme="dark"] .rt-seg, html[data-theme="dark"] .rt-btn-light, html[data-theme="dark"] .rt-qt, html[data-theme="dark"] select.rt-chip, html[data-theme="dark"] .rt-chip-btn, html[data-theme="dark"] .rt-ev-btn { background: var(--m-surface); border-color: var(--m-border); color: var(--m-ink); }
html[data-theme="dark"] .aqua-stats-bar .aqua-stat-item:hover, html[data-theme="dark"] select.rt-chip:hover, html[data-theme="dark"] .rt-chip-btn:hover, html[data-theme="dark"] .rt-btn-light:hover, html[data-theme="dark"] .rt-seg a:hover { background: var(--m-surface-2); }
html[data-theme="dark"] .aqua-table thead th { background: var(--m-surface-2) !important; color: var(--m-ink-2) !important; border-bottom-color: var(--m-border); }
html[data-theme="dark"] .aqua-table td { border-bottom-color: var(--m-border); }
html[data-theme="dark"] .aqua-table tbody tr:hover td { background: var(--m-surface-2); }
html[data-theme="dark"] #recent_tests_table tbody tr.selected td { background: var(--m-surface-2) !important; }
html[data-theme="dark"] tr.rt-row-failed td { background: var(--m-danger-bg) !important; }
html[data-theme="dark"] .rt-test-name, html[data-theme="dark"] .rt-mono { color: var(--m-ink); }
html[data-theme="dark"] .rt-pill.success, html[data-theme="dark"] .td-status-pill.success, html[data-theme="dark"] .rt-cmp-tip .tip-pill.success { background: var(--m-success-bg); color: var(--m-success); }
html[data-theme="dark"] .rt-pill.failed, html[data-theme="dark"] .rt-cmp-tip .tip-pill.failed { background: var(--m-danger-bg); color: var(--m-danger); }
html[data-theme="dark"] .rt-pill.unstable { background: var(--m-warning-bg); color: var(--m-warning); }
html[data-theme="dark"] .rt-pill.running, html[data-theme="dark"] .rt-cmp-tip .tip-pill.running { background: var(--m-primary-050); color: var(--m-primary); }
html[data-theme="dark"] .rt-pill.aborted, html[data-theme="dark"] .rt-pill.other, html[data-theme="dark"] .rt-cmp-tip .tip-pill.other, html[data-theme="dark"] .rt-tag.cores { background: var(--m-surface-2); color: var(--m-ink-2); }
html[data-theme="dark"] .rt-tag.enforcer, html[data-theme="dark"] a.rt-tag.enforcer:hover, html[data-theme="dark"] .rt-label-chip, html[data-theme="dark"] .rt-cmp-enf, html[data-theme="dark"] .ev-modal-row.checked { background: var(--m-primary-050); color: var(--m-primary); border-color: var(--m-border); }
html[data-theme="dark"] .rt-ctx-menu { background: var(--m-surface); border-color: var(--m-border); --ctx-row: var(--m-ink); --ctx-icon: var(--m-ink-2); --ctx-hover: var(--m-surface-2); --ctx-divider: var(--m-border); --ctx-label: var(--m-ink-3); --ctx-kbd-bg: var(--m-surface-2); --ctx-kbd-bd: var(--m-border); --ctx-kbd-tx: var(--m-ink-2); --ctx-accent-bg: var(--m-primary-050); --ctx-chip-bg: var(--m-primary-050); --ctx-chip-tx: var(--m-primary); }
html[data-theme="dark"] .rt-more-menu { background: var(--m-surface); border-color: var(--m-border); }
html[data-theme="dark"] .rt-more-item { color: var(--m-ink-2); }
html[data-theme="dark"] .rt-more-item:hover, html[data-theme="dark"] .rt-more-btn:hover, html[data-theme="dark"] .rt-more-btn.open { background: var(--m-primary-050); color: var(--m-primary); }
html[data-theme="dark"] .rt-more-divider { border-top-color: var(--m-border); }
html[data-theme="dark"] .rt-hint-toast, html[data-theme="dark"] .rt-cmp-tip { background: var(--m-surface); border-color: var(--m-border); }
html[data-theme="dark"] .rt-hint-body p, html[data-theme="dark"] .rt-hint-mock .m-item, html[data-theme="dark"] .rt-cmp-tip .tip-val .tip-mono, html[data-theme="dark"] #selection-footer .rt-cmp-id { color: var(--m-ink-2); }
html[data-theme="dark"] .rt-hint-body p b, html[data-theme="dark"] .rt-cmp-tip .tip-val { color: var(--m-ink); }
html[data-theme="dark"] .rt-hint-mock { background: var(--m-surface-2); border-color: var(--m-border); }
html[data-theme="dark"] .rt-cmp-tip .tip-row + .tip-row { border-top-color: var(--m-border); }
html[data-theme="dark"] .rt-label-add { background: var(--m-surface); color: var(--m-ink-2); border-color: var(--m-border); }
html[data-theme="dark"] #selection-footer { background: var(--m-surface) !important; border-color: var(--m-border); }
html[data-theme="dark"] #selection-footer .text-secondary, html[data-theme="dark"] #selection-footer .btn-outline-secondary { color: var(--m-ink-2) !important; border-color: var(--m-border); }
html[data-theme="dark"] #selection-footer .rt-cmp-title { color: var(--m-ink); }
html[data-theme="dark"] #selection-footer #export-s3-btn, html[data-theme="dark"] #selection-footer #export-s3-btn:hover:not(:disabled) { color: var(--m-primary); border-color: var(--m-border); background: var(--m-surface); }
html[data-theme="dark"] .ev-modal-search input { background: var(--m-surface-2); color: var(--m-ink); border-color: var(--m-border); }
html[data-theme="dark"] .ev-modal-list { border-color: var(--m-border); }
html[data-theme="dark"] .ev-modal-row { color: var(--m-ink-2); border-bottom-color: var(--m-border); }
html[data-theme="dark"] .ev-modal-row:hover, html[data-theme="dark"] .ev-suggest-row { background: var(--m-surface-2); }
html[data-theme="dark"] .rt-col-resize-handle::after { background: var(--m-border); }
html[data-theme="dark"] .dropdown-menu { background: var(--m-surface); border-color: var(--m-border); }
html[data-theme="dark"] .dropdown-item { color: var(--m-ink); }
html[data-theme="dark"] .dropdown-item:hover, html[data-theme="dark"] .dropdown-item:focus { background: var(--m-surface-2); color: var(--m-ink); }
html[data-theme="dark"] .dropdown-divider { border-top-color: var(--m-border); }
html[data-theme="dark"] .fixed-table-pagination .page-link, html[data-theme="dark"] .fixed-table-toolbar .search .form-control { background: var(--m-surface); color: var(--m-ink); border-color: var(--m-border); }
html[data-theme="dark"] .test-detail-page { background: var(--m-bg); }
html[data-theme="dark"] .td-card, html[data-theme="dark"] .td-btn-secondary, html[data-theme="dark"] .td-btn-danger, html[data-theme="dark"] .td-btn-muted, html[data-theme="dark"] .td-btn-warning, html[data-theme="dark"] .td-expand-btn, html[data-theme="dark"] .td-back-link, html[data-theme="dark"] .td-params-search, html[data-theme="dark"] .td-comment-input, html[data-theme="dark"] .loki-card { background: var(--m-surface); border-color: var(--m-border); color: var(--m-ink); }
html[data-theme="dark"] .td-test-name, html[data-theme="dark"] .td-card-title, html[data-theme="dark"] .td-ov-value, html[data-theme="dark"] .td-param-val { color: var(--m-ink); }
html[data-theme="dark"] .td-param-key, html[data-theme="dark"] .td-ov-label, html[data-theme="dark"] .td-ov-sub, html[data-theme="dark"] .td-report-sub, html[data-theme="dark"] .td-run-id, html[data-theme="dark"] .td-job-path, html[data-theme="dark"] .td-breadcrumb, html[data-theme="dark"] .td-params-count, html[data-theme="dark"] .td-empty, html[data-theme="dark"] .td-btn-secondary, html[data-theme="dark"] .td-btn-muted { color: var(--m-ink-2); }
html[data-theme="dark"] .td-build-badge, html[data-theme="dark"] .td-params-count { background: var(--m-surface-2); }
html[data-theme="dark"] .td-report-link:hover, html[data-theme="dark"] .td-btn-secondary:hover, html[data-theme="dark"] .td-expand-btn:hover, html[data-theme="dark"] .td-back-link:hover, html[data-theme="dark"] .td-comment-input { background: var(--m-surface-2); }
html[data-theme="dark"] .td-status-pill.failure, html[data-theme="dark"] .td-alert.danger, html[data-theme="dark"] .loki-jira-section.unmatched { background: var(--m-danger-bg); color: var(--m-danger); border-color: var(--m-border); }
html[data-theme="dark"] .td-status-pill.aborted, html[data-theme="dark"] .td-alert.warning, html[data-theme="dark"] .loki-jira-section.matches { background: var(--m-warning-bg); color: var(--m-warning); border-color: var(--m-border); }
html[data-theme="dark"] .td-status-pill.running, html[data-theme="dark"] .td-alert.info, html[data-theme="dark"] .td-ov-status-text, html[data-theme="dark"] .td-ov-status-dot { background: var(--m-primary-050); color: var(--m-primary); }
html[data-theme="dark"] .td-alert.success { background: var(--m-success-bg); color: var(--m-success); border-color: var(--m-border); }
html[data-theme="dark"] .td-report-badge.json { background: var(--m-primary-050); color: var(--m-primary); }
html[data-theme="dark"] .td-report-badge.html { background: var(--m-success-bg); color: var(--m-success); }
html[data-theme="dark"] .td-report-badge.txt { background: var(--m-surface-2); color: var(--m-ink-2); }
html[data-theme="dark"] .td-report-badge.zip { background: var(--m-warning-bg); color: var(--m-warning); }
html[data-theme="dark"] .td-comment-post { background: var(--m-surface-2); color: var(--m-ink-2); }
html[data-theme="dark"] .td-action-divider { background: var(--m-border); }
html[data-theme="dark"] .loki-card-body th { background: var(--m-surface-2); color: var(--m-ink-2); }
html[data-theme="dark"] .loki-card-body td { border-bottom-color: var(--m-border); color: var(--m-ink); }
html[data-theme="dark"] .td-label-chip { background: var(--m-primary-050); color: var(--m-primary); }
html[data-theme="dark"] .td-enforcer-tag { background: var(--m-surface-2); color: var(--m-ink); }
html[data-theme="dark"] .tbt-tag-cloud a { background: var(--m-surface); color: var(--m-ink); border-color: var(--m-border); }
html[data-theme="dark"] .tbt-tag-cloud a:hover { background: var(--m-surface-2); border-color: var(--m-border-strong); }
html[data-theme="dark"] .tbt-tag-cloud a .cnt { background: var(--m-surface-2); color: var(--m-primary); }
html[data-theme="dark"] .tbt-empty { background: var(--m-surface); border-color: var(--m-border); color: var(--m-ink-2); }
html[data-theme="dark"] .aqua-table tr.tbt-row-failed td { background: var(--m-danger-bg); }
html[data-theme="dark"] .rt-test-sub a, html[data-theme="dark"] .rt-act, html[data-theme="dark"] #selection-footer #export-s3-btn { color: var(--m-primary); }
html[data-theme="dark"] .nav-tabs, html[data-theme="dark"] .nav-tabs .nav-link { background: transparent; color: var(--m-ink-2); border-color: var(--m-border); }
html[data-theme="dark"] .ctc-card, html[data-theme="dark"] .ctc-section, html[data-theme="dark"] .blg-hero { background: var(--m-surface); border-color: var(--m-border); }
html[data-theme="dark"] .ctc-subtitle, html[data-theme="dark"] .ctc-overline, html[data-theme="dark"] .ctc-caption, html[data-theme="dark"] .ctc-section-sub, html[data-theme="dark"] .ctc-th, html[data-theme="dark"] .ctc-td.num, html[data-theme="dark"] .ctc-controls .lbl, html[data-theme="dark"] .ctc-note, html[data-theme="dark"] .blg-key, html[data-theme="dark"] .blg-key .muted, html[data-theme="dark"] .blg-legend span, html[data-theme="dark"] .blg-xlabels .labels span, html[data-theme="dark"] .blg-rail .sub, html[data-theme="dark"] .blg-rail .acct-note { color: var(--m-ink-2); }
html[data-theme="dark"] .ctc-foot, html[data-theme="dark"] .ctc-overline .date, html[data-theme="dark"] .blg-big .frac, html[data-theme="dark"] .blg-rail .acct-id, html[data-theme="dark"] .blg-chart .ylabels span, html[data-theme="dark"] details.ctc-details summary { color: var(--m-ink-3); }
html[data-theme="dark"] .ctc-select-wrap select { background: var(--m-surface-2); color: var(--m-ink); border-color: var(--m-border-strong); }
html[data-theme="dark"] .ctc-btn { background: var(--m-surface-2); color: var(--m-ink); border-color: var(--m-border-strong); }
html[data-theme="dark"] .ctc-btn:hover { background: var(--m-surface); color: var(--m-ink); }
html[data-theme="dark"] .ctc-back { color: var(--m-ink-2); }
html[data-theme="dark"] .ctc-bar-fill, html[data-theme="dark"] .blg-split .seg-billed, html[data-theme="dark"] .blg-chart .bar .billed, html[data-theme="dark"] .blg-key .dot.blue { background: var(--m-primary); }
html[data-theme="dark"] .blg-split .seg-sp, html[data-theme="dark"] .blg-chart .bar .sp, html[data-theme="dark"] .blg-key .dot.green { background: var(--m-success); }
html[data-theme="dark"] .table { color: var(--m-ink); --bs-table-color: var(--m-ink); --bs-table-striped-color: var(--m-ink); --bs-table-hover-color: var(--m-ink); --bs-table-striped-bg: rgba(255,255,255,.03); }
html[data-theme="dark"] .table-dark { --bs-table-bg: var(--m-surface-2); --bs-table-color: var(--m-ink); --bs-table-border-color: var(--m-border); }
html[data-theme="dark"] .table-warning { --bs-table-bg: var(--m-warning-bg); --bs-table-color: var(--m-warning); }
html[data-theme="dark"] .table-secondary { --bs-table-bg: var(--m-surface-2); --bs-table-color: var(--m-ink); }
html[data-theme="dark"] .form-control, html[data-theme="dark"] .form-select { background-color: var(--m-surface-2); color: var(--m-ink); border-color: var(--m-border-strong); }
html[data-theme="dark"] .form-select option { background-color: var(--m-surface); color: var(--m-ink); }
html[data-theme="dark"] .form-check-input { background-color: var(--m-surface-2); border-color: var(--m-border-strong); }
html[data-theme="dark"] .nav-tabs { --bs-nav-tabs-border-color: var(--m-border); border-bottom-color: var(--m-border); }
html[data-theme="dark"] .nav-tabs .nav-link.active { color: var(--m-ink); background-color: var(--m-surface); border-color: var(--m-border) var(--m-border) var(--m-surface); }
html[data-theme="dark"] .nav-tabs .nav-link:hover { border-color: var(--m-border); }
html[data-theme="dark"] .modal-content { background-color: var(--m-surface); color: var(--m-ink); border-color: var(--m-border); }
html[data-theme="dark"] .progress { background-color: var(--m-surface-2); }
html[data-theme="dark"] .badge.bg-secondary { background: var(--m-surface-2) !important; color: var(--m-ink-2) !important; }
html[data-theme="dark"] .bg-light { background-color: var(--m-surface-2) !important; color: var(--m-ink); }
html[data-theme="dark"] .alert-warning { color: var(--m-warning) !important; border-color: var(--m-warning) !important; }
html[data-theme="dark"] .alert-danger { color: var(--m-danger) !important; border-color: var(--m-danger) !important; }
html[data-theme="dark"] .aqua-stats-bar, html[data-theme="dark"] .aqua-cloud-card, html[data-theme="dark"] .aqua-empty-state { background: var(--m-surface); }
html[data-theme="dark"] .stat-label, html[data-theme="dark"] .aqua-empty-state p { color: var(--m-ink-2); }
html[data-theme="dark"] .text-muted { color: var(--m-ink-2) !important; }
html[data-theme="dark"] .text-success { color: var(--m-success) !important; }
html[data-theme="dark"] .text-danger { color: var(--m-danger) !important; }
html[data-theme="dark"] .table { --bs-table-bg: transparent; --bs-table-color: var(--m-ink); --bs-emphasis-color: var(--m-ink); --bs-table-striped-bg: var(--m-surface-2); --bs-table-striped-color: var(--m-ink); --bs-table-hover-bg: var(--m-surface-2); --bs-table-hover-color: var(--m-ink); --bs-table-border-color: var(--m-border); color: var(--m-ink); }
html[data-theme="dark"] .table-success { --bs-table-bg: var(--m-success-bg); --bs-table-color: var(--m-ink); }
html[data-theme="dark"] .table-danger { --bs-table-bg: var(--m-danger-bg); --bs-table-color: var(--m-ink); }
html[data-theme="dark"] .table-warning { --bs-table-bg: var(--m-warning-bg); --bs-table-color: var(--m-ink); }
html[data-theme="dark"] .table-secondary { --bs-table-bg: var(--m-surface-2); --bs-table-color: var(--m-ink-2); }
html[data-theme="dark"] .table-light { --bs-table-bg: var(--m-surface-2); --bs-table-color: var(--m-ink-2); }
html[data-theme="dark"] .aqua-cloud-card { background: var(--m-surface); border-color: var(--m-border); box-shadow: var(--m-shadow-1); }
html[data-theme="dark"] .aqua-stats-bar { background: var(--m-surface); box-shadow: var(--m-shadow-1); }
html[data-theme="dark"] .aqua-empty-state { background: var(--m-surface); box-shadow: var(--m-shadow-1); }
html[data-theme="dark"] .aqua-empty-state p, html[data-theme="dark"] .stat-label { color: var(--m-ink-2); }
html[data-theme="dark"] .modal-content { background: var(--m-surface); color: var(--m-ink); }
html[data-theme="dark"] .form-control, html[data-theme="dark"] .form-select { background-color: var(--m-surface); }
html[data-theme="dark"] .btn-secondary, html[data-theme="dark"] .btn-outline-secondary, html[data-theme="dark"] .btn-outline-primary, html[data-theme="dark"] .btn-outline-danger, html[data-theme="dark"] .btn-outline-info, html[data-theme="dark"] .btn-info { background-color: var(--m-surface) !important; }
html[data-theme="dark"] .alert-success { color: var(--m-success) !important; border-color: var(--m-border-strong) !important; }
html[data-theme="dark"] .alert-danger { color: var(--m-danger) !important; border-color: var(--m-border-strong) !important; }
html[data-theme="dark"] .alert-warning { color: var(--m-warning) !important; border-color: var(--m-border-strong) !important; }
html[data-theme="dark"] .alert-info { color: var(--m-primary) !important; border-color: var(--m-border-strong) !important; }
html[data-theme="dark"] .badge.bg-success { color: var(--m-success) !important; }
html[data-theme="dark"] .metric-badge, html[data-theme="dark"] .badge.bg-secondary { background: var(--m-surface-2) !important; color: var(--m-ink-2) !important; }
html[data-theme="dark"] .badge.bg-light { background-color: var(--m-surface-2) !important; color: var(--m-ink) !important; }
html[data-theme="dark"] .badge.bg-info-subtle { background-color: var(--m-primary-050) !important; }
html[data-theme="dark"] .text-info-emphasis { color: var(--m-primary) !important; }
html[data-theme="dark"] #content_table td.text-dark, html[data-theme="dark"] .aqua-table td.text-dark { color: var(--m-ink) !important; }
html[data-theme="dark"] code { color: var(--m-primary) !important; }
html[data-theme="dark"] .actions-menu .dropdown-menu { background-color: var(--m-surface) !important; }
html[data-theme="dark"] .actions-menu .btn-kebab { background-color: var(--m-surface) !important; }
html[data-theme="dark"] .dropdown-divider { border-color: var(--m-border) !important; }
html[data-theme="dark"] .nav-tabs { border-bottom-color: var(--m-border) !important; }
html[data-theme="dark"] .nav-tabs .nav-link.active { background-color: var(--m-surface) !important; color: var(--m-ink) !important; border-color: var(--m-border) var(--m-border) var(--m-surface) !important; }
html[data-theme="dark"] .btn-close:not(.btn-close-white) { filter: invert(1) grayscale(100%) brightness(1.8); }
html[data-theme="dark"] .alert-success { border-color: var(--m-border) !important; color: var(--m-success) !important; }
html[data-theme="dark"] .alert-danger { border-color: var(--m-border) !important; color: var(--m-danger) !important; }
html[data-theme="dark"] .alert-warning { border-color: var(--m-border) !important; color: var(--m-warning) !important; }
html[data-theme="dark"] .alert-info { border-color: var(--m-border) !important; color: var(--m-primary) !important; }
html[data-theme="dark"] .alert .btn-close, html[data-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
html[data-theme="dark"] .badge.bg-success { color: var(--m-success) !important; }
html[data-theme="dark"] .btn-secondary, html[data-theme="dark"] .btn-outline-secondary { background: var(--m-surface) !important; color: var(--m-ink) !important; border-color: var(--m-border-strong) !important; }
html[data-theme="dark"] .btn-secondary:hover, html[data-theme="dark"] .btn-outline-secondary:hover { background: var(--m-surface-2) !important; color: var(--m-ink) !important; }
html[data-theme="dark"] .btn-outline-primary, html[data-theme="dark"] .btn-outline-success, html[data-theme="dark"] .btn-outline-warning, html[data-theme="dark"] .btn-outline-danger { color: var(--m-primary); border-color: var(--m-primary); }
html[data-theme="dark"] .bg-light { background-color: var(--m-surface-2) !important; color: var(--m-ink) !important; }
html[data-theme="dark"] .border { border-color: var(--m-border) !important; }
html[data-theme="dark"] .form-check-input { background-color: var(--m-surface); border-color: var(--m-border-strong); }
html[data-theme="dark"] .pagination .page-link { background: var(--m-surface); border-color: var(--m-border); color: var(--m-primary); }
html[data-theme="dark"] .page-item.active .page-link, html[data-theme="dark"] .page-item.disabled .page-link { background: var(--m-surface); border-color: var(--m-border); color: var(--m-ink-3); }
html[data-theme="dark"] .dropdown-menu .dropdown-item { color: var(--m-ink); }
html[data-theme="dark"] .breadcrumb-item.active, html[data-theme="dark"] .breadcrumb-item + .breadcrumb-item::before { color: var(--m-ink-2); }
html[data-theme="dark"] .table-success, html[data-theme="dark"] .table-success > td, html[data-theme="dark"] .table-success > th { --bs-table-bg: var(--m-success-bg); --bs-table-color: var(--m-ink); background-color: var(--m-success-bg); color: var(--m-ink); }
html[data-theme="dark"] .filter-bar { background: var(--m-surface) !important; border-color: var(--m-border) !important; }
html[data-theme="dark"] .dir-up, html[data-theme="dark"] .badge-throughput { color: var(--m-success); }
html[data-theme="dark"] .dir-info, html[data-theme="dark"] .badge-availability { color: #a78bfa; }
html[data-theme="dark"] .scope-badge { background: rgba(34,211,238,0.14); color: #67e8f9; }
html[data-theme="dark"] .dir-unk, html[data-theme="dark"] .badge-unclassified, html[data-theme="dark"] .prom-help-cell { color: var(--m-ink-2); }
/* Swagger UI is a vendored widget with its own light theme — keep it on a
   self-consistent light surface rather than half-theming it. */
html[data-theme="dark"] #swagger-ui { background: #fff !important; color: #1f2733; border: 1px solid var(--m-border); border-radius: 10px; }
html[data-theme="dark"] .form-control, html[data-theme="dark"] .form-select { background-color: var(--m-surface-2); color: var(--m-ink); }
html[data-theme="dark"] .alert-success { color: var(--m-success) !important; border-color: var(--m-border) !important; }
html[data-theme="dark"] .alert-danger { color: var(--m-danger) !important; border-color: var(--m-border) !important; }
html[data-theme="dark"] .alert-warning { color: var(--m-warning) !important; border-color: var(--m-border) !important; }
html[data-theme="dark"] .alert-info { color: var(--m-primary) !important; border-color: var(--m-border) !important; }
html[data-theme="dark"] .table { color: var(--m-ink); border-color: var(--m-border); --bs-table-striped-color: var(--m-ink); --bs-table-striped-bg: rgba(255,255,255,.04); }
html[data-theme="dark"] .modal-header { border-bottom-color: var(--m-border); }
html[data-theme="dark"] .modal-footer { border-top-color: var(--m-border); }
html[data-theme="dark"] .alert-info { color: var(--m-primary); border-color: var(--m-border-strong); }
html[data-theme="dark"] .alert-success { color: var(--m-success); border-color: var(--m-border-strong); }
html[data-theme="dark"] .alert-warning { color: var(--m-warning); border-color: var(--m-border-strong); }
html[data-theme="dark"] .alert-danger { color: var(--m-danger); border-color: var(--m-border-strong); }
html[data-theme="dark"] .badge.bg-light { background: var(--m-surface-2) !important; color: var(--m-ink) !important; }
html[data-theme="dark"] span.round-tab { background: var(--m-surface-2); color: var(--m-ink); border-color: var(--m-border-strong); }
html[data-theme="dark"] .form-control:disabled, html[data-theme="dark"] .form-control[readonly] { background-color: var(--m-surface-2) !important; }
html[data-theme="dark"] select option, html[data-theme="dark"] .form-select option { background: var(--m-surface); color: var(--m-ink); }
html[data-theme="dark"] .metric-name { color: var(--m-ink-2); }
html[data-theme="dark"] .metric-avg-row { background-color: var(--m-primary-050) !important; }
html[data-theme="dark"] .metric-avg-name { color: var(--m-primary) !important; }
html[data-theme="dark"] .metric-minmax-name { color: var(--m-ink-3) !important; }
html[data-theme="dark"] .text-regression { color: var(--m-danger); }
html[data-theme="dark"] .text-improvement { color: var(--m-success); }
html[data-theme="dark"] .text-info-direction { color: var(--m-warning); }
html[data-theme="dark"] .category-header.active { background: var(--m-primary-050) !important; border-left-color: var(--m-primary); }
html[data-theme="dark"] .cgroup-mem-table td.cgroup-comp-name { background: var(--m-surface-2) !important; color: var(--m-ink) !important; border-right-color: var(--m-border-strong); border-bottom-color: var(--m-border-strong); }
html[data-theme="dark"] .cgroup-mem-table td.cgroup-field-label { color: var(--m-ink-2); }
html[data-theme="dark"] .cgroup-mem-table td.cgroup-stat-label { color: var(--m-ink-3); }
html[data-theme="dark"] .cgroup-mem-table tbody tr.cgroup-component-end td { border-bottom-color: var(--m-border-strong); }
html[data-theme="dark"] #cgroupMemFilter { background: var(--m-surface) !important; border-color: var(--m-border-strong); color: var(--m-ink); }
html[data-theme="dark"] .finding { background: var(--m-surface); border-color: var(--m-border); box-shadow: var(--m-shadow-1); }
html[data-theme="dark"] .finding-badge-critical { background: var(--m-danger-bg); color: var(--m-danger); border-color: var(--m-border-strong); }
html[data-theme="dark"] .finding-badge-warning { background: var(--m-warning-bg); color: var(--m-warning); border-color: var(--m-border-strong); }
html[data-theme="dark"] .finding-badge-info { background: var(--m-primary-050); color: var(--m-primary); border-color: var(--m-border-strong); }
html[data-theme="dark"] .finding-badge-category { background: var(--m-surface-2); color: var(--m-ink-2); border-color: var(--m-border); }
html[data-theme="dark"] .finding h3, html[data-theme="dark"] .finding-description h6.finding-section-title, html[data-theme="dark"] .finding-description strong { color: var(--m-ink); }
html[data-theme="dark"] .finding-subtitle, html[data-theme="dark"] .finding-description, html[data-theme="dark"] .finding details { color: var(--m-ink-2); }
html[data-theme="dark"] .finding-divider { border-top-color: var(--m-border); }
html[data-theme="dark"] .finding-description code { background: var(--m-surface-2); color: #f8a5c2; }
html[data-theme="dark"] .toc-panel { background: var(--m-surface); border-color: var(--m-border); box-shadow: var(--m-shadow-1); }
html[data-theme="dark"] .toc-header { color: var(--m-ink-2); border-bottom-color: var(--m-border); }
html[data-theme="dark"] .toc-list a { color: var(--m-ink-2); }
html[data-theme="dark"] .toc-list a:hover, html[data-theme="dark"] .toc-list a.toc-active { background: var(--m-primary-050); color: var(--m-primary); border-left-color: var(--m-primary); }
html[data-theme="dark"] .report-sidebar::-webkit-scrollbar-thumb { background: var(--m-border-strong); }
html[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection { background: var(--m-surface); border-color: var(--m-border-strong); color: var(--m-ink); }
html[data-theme="dark"] .select2-dropdown { background: var(--m-surface); border-color: var(--m-border); }
html[data-theme="dark"] .select2-results__option--highlighted { background-color: var(--m-primary-050) !important; color: var(--m-ink) !important; }
html[data-theme="dark"] .select2-results__option--selected { background-color: var(--m-surface-2) !important; color: var(--m-ink) !important; }
html[data-theme="dark"] .select2-results__option::before { background-color: var(--m-surface); border-color: var(--m-border-strong); }
html[data-theme="dark"] .select2-search--dropdown .select2-search__field { background: var(--m-surface); border-color: var(--m-border-strong); color: var(--m-ink); }
/* ============================================================================
   Adversarial-review fixes (verified) — residual contrast/coverage defects.
   ============================================================================ */
html[data-theme="dark"] .td-report-label { color: var(--m-ink); }
html[data-theme="dark"] .td-crumb-run { color: var(--m-ink); }
html[data-theme="dark"] #selection-footer .rt-cmp-enf { background: var(--m-primary-050); color: var(--m-primary); border-color: var(--m-border); }
html[data-theme="dark"] #selection-footer .rt-cmp-build { background: var(--m-danger-bg); color: var(--m-danger); border-color: var(--m-border); }
html[data-theme="dark"] #selection-footer .rt-cmp-enf-missing { background: var(--m-surface-2); color: var(--m-ink-2); border-color: var(--m-border); }
html[data-theme="dark"] button.aqua-stat-item.active, html[data-theme="dark"] select.rt-chip.active, html[data-theme="dark"] .rt-ev-btn.active { background: var(--m-primary-050) !important; border-color: var(--m-primary) !important; color: var(--m-primary) !important; }
html[data-theme="dark"] .rt-seg a, html[data-theme="dark"] .rt-chip-lead, html[data-theme="dark"] .rt-quicktags-lead { color: var(--m-ink-2); }
html[data-theme="dark"] .rt-seg a:hover { color: var(--m-ink); }
html[data-theme="dark"] .ev-modal-row .ev-row-kind { background: var(--m-primary-050); color: var(--m-primary); }
html[data-theme="dark"] .tbt-tag-cloud a.current { background: var(--m-primary); color: #06121d; border-color: var(--m-primary); }
html[data-theme="dark"] .tbt-tag-cloud a.current .cnt { background: rgba(255,255,255,0.22); color: #06121d; }
html[data-theme="dark"] .dash-billing .delta.up { color: var(--m-danger); }
html[data-theme="dark"] .dash-billing .delta.down { color: var(--m-success); }
/* Page headers are flat and token-colored since 2026-07 — no dark patches needed. */
/* Warning modal/card headers */
html[data-theme="dark"] .modal-header.bg-warning, html[data-theme="dark"] .card-header.bg-warning { background-color: var(--m-warning-bg) !important; border-color: var(--m-border) !important; }
html[data-theme="dark"] .modal-header.bg-warning .modal-title, html[data-theme="dark"] .modal-header.bg-warning .modal-title i, html[data-theme="dark"] .card-header.bg-warning { color: var(--m-warning) !important; }
/* Wizard step buttons (cyan/yellow bg) need dark ink label under color-scheme:dark */
html[data-theme="dark"] .next-step, html[data-theme="dark"] .skip-btn, html[data-theme="dark"] .finish { color: #04222a !important; }
/* Success buttons -> soft green pill in dark */
html[data-theme="dark"] .btn-success { background: var(--m-success-bg) !important; border-color: var(--m-success) !important; color: var(--m-success) !important; }
/* comparison_report_result finding summary link */
html[data-theme="dark"] .finding details summary { color: var(--m-primary); }
/* metrics_catalog category badges keep their hue (beat the generic .metric-badge reset) */
html[data-theme="dark"] .badge-utilization { background: var(--m-primary-050) !important; color: var(--m-primary) !important; }
html[data-theme="dark"] .badge-throughput { background: var(--m-success-bg) !important; color: var(--m-success) !important; }
html[data-theme="dark"] .badge-latency { background: var(--m-warning-bg) !important; color: var(--m-warning) !important; }
html[data-theme="dark"] .badge-reliability { background: var(--m-danger-bg) !important; color: var(--m-danger) !important; }
html[data-theme="dark"] .dir-down { color: var(--m-danger); }
html[data-theme="dark"] .dir-ctx { color: var(--m-warning); }
/* paid_resources injected report (wrapper .pr-report added in the template) */
html[data-theme="dark"] .pr-report .container { background: var(--m-surface) !important; color: var(--m-ink) !important; }
html[data-theme="dark"] .pr-report h1, html[data-theme="dark"] .pr-report h2, html[data-theme="dark"] .pr-report h3 { color: var(--m-ink) !important; }
html[data-theme="dark"] .pr-report table td { color: var(--m-ink) !important; border-bottom-color: var(--m-border) !important; }
html[data-theme="dark"] .pr-report th { background: var(--m-surface-2) !important; color: var(--m-ink) !important; }
html[data-theme="dark"] .pr-report .summary { background: var(--m-success-bg) !important; border-left-color: var(--m-success) !important; }
html[data-theme="dark"] .pr-report .summary p { color: var(--m-ink-2) !important; }
