/* ============================================================================
   theme-dark.css — Dark-mode overrides for SEMANTIC color sets + BESPOKE surfaces
   (Appearance/Themes Wave 3+). Plan docs/APPEARANCE-THEMES-PLAN.md §0.7.3.

   WHY a marker (not the var() token cascade used for the grid chrome): these
   surfaces are either (a) semantic color SETS that must stay DISTINGUISHABLE under
   Dark (status badges, the 8-colour group-by palette, risk score/status cells) and
   can't fold into the 72 core tokens without losing meaning, or (b) bespoke layouts
   (Daily Reports dashboard, Project Dashboard) with dozens of one-off colours that
   would bloat the spec + force a live-DB reseed. A `data-theme-mode="dark"` marker
   on <html> — the theme-AGNOSTIC light/dark signal (set by theme-boot.applyAppearance
   + the index.html FOUC bootstrap from the active theme's `mode`) — lets us repaint
   them with scoped CSS. PHASE 4 (plan §0.13, 2026-06-22): these rules were migrated
   from the slug-specific `[data-theme="dark"]` to `[data-theme-mode="dark"]`, so ANY
   dark theme (a superadmin-created custom theme of any slug — not only the built-in
   "dark") picks them up too. The shipped "dark" theme sets BOTH attributes, so the
   migration is byte-identical for it.

   CLASSIC-SAFE (the #1 gate): EVERY rule here is scoped under [data-theme-mode="dark"].
   Classic sets NO marker → none of these match → byte-identical. Light sets
   data-theme-mode="light" → these dark rules don't match it either (Light keeps its
   existing light colours; add [data-theme-mode="light"] blocks only if a surface needs
   a Light-specific tweak — none do today).
   ============================================================================ */

/* ───────────────────────────────────────────────────────────────────────────
   1. GROUP-BY category palette — RETROFITTED to base tokens (plan §0.13 Phase 3,
   2026-06-22). group-by-manager.css now reads .group-header-row.grp-0..7 (band fill /
   border / text / .group-dot) from the NEW --grp{0..7}-{bg,bd,tx,dot} palette tokens,
   and .group-by-select from --tb-btn-*. Classic falls to each rule's exact literal
   (byte-identical); ANY theme drives the 8-hue band coding. Markers DELETED — now
   editor-driven (editor group 'palette'). Distinct from the DR-scoped --dr-grp* set.
   ─────────────────────────────────────────────────────────────────────────── */

/* ───────────────────────────────────────────────────────────────────────────
   2. RISK score / status conditional CELLS — RETROFITTED to base tokens (plan §0.13
   Phase 3, 2026-06-22). risk-management-styles.css now reads .risk-score-* /
   .risk-status-* from the NEW --risk-* tokens (background only; the cell text is the
   themed --cell-text). Classic falls to each rule's light literal (byte-identical);
   ANY theme drives the red→amber→green severity ramp. Markers DELETED — now
   editor-driven (editor group 'risk').
   ─────────────────────────────────────────────────────────────────────────── */

/* ───────────────────────────────────────────────────────────────────────────
   3. STATUS / pill badges across modules — RETROFITTED to the base semantic palette
   (plan §0.13 Phase 3, 2026-06-22). documents / rfis / submittals / meetings status
   badges now read background + color from --chip-neutral-* (draft/neutral) and
   --sem-{ok,warn,danger,info} (+ the --sem-*-bg soft fills) in each module's own CSS.
   Classic falls to each badge's exact pastel literal (byte-identical); ANY theme drives
   them. This ALSO closes the badge states that had NO dark marker before (rfis closed/
   closeddraft/closedrevised/overdue, submittals open/closed/recycled, documents rejected/
   superseded, meetings open/closed/overdue) — they were light-pastel-in-dark leaks.
   Markers DELETED — editor-driven via the 'status' + 'chips' groups. (Daily-Report
   dr-pill badges were retrofitted earlier in Phase 1.5.)
   ─────────────────────────────────────────────────────────────────────────── */

/* ───────────────────────────────────────────────────────────────────────────
   4. DAILY REPORTS — bespoke 2-level dashboard (L1 list/calendar + L2 day-view).
   PHASE 1 + 1.5 (plan §0.13): the structural chrome AND the semantic palette are
   now 100% editor-driven — every rule reads base-CSS var(--token, <classic-literal>)
   in daily-reports.css (Classic = the literal, byte-identical; any theme drives it).
   Structural map: card→--surface-card, page→--page-bg, recessed→--panel-bg,
   control→--tb-btn-*, hover→--row-hover-bg, border→--header-border, text→--cell-text.
   Semantic map (Phase 1.5, 2026-06-22): active/selected/focus→--sel-bg/--sel-fg
   (borders --tb-btn-hover-border); status text→--sem-ok/warn/danger/info; solid
   CTAs→--btn-primary/--btn-ok; count chips→--chip-neutral-*; 13 section dots→
   --dr-sec-*; 5 category bands→--dr-grp{0..4}-{bg,bd,tx,dot}; weather→--dr-wx-accent;
   danger note-cards→--sem-danger/--sem-danger-bg. ALL dark markers below were DELETED.
   ONE remnant remains — the loading scrim: a semi-transparent rgba overlay whose alpha
   the hex token shape can't express (true Bucket B; needs a future alpha-aware token).
   ─────────────────────────────────────────────────────────────────────────── */
[data-theme-mode="dark"] #daily-reports-container .dr-loading { background: rgba(11,16,24,.7); color: #8995ae; }
[data-theme-mode="dark"] #daily-reports-container td.dr-req-empty { background: #2a1618; box-shadow: inset 3px 0 0 #e74c3c; }

/* ───────────────────────────────────────────────────────────────────────────
   5. PROJECT DASHBOARD (dashboard-styles.css) — the default landing view.
   PHASE 1 (plan §0.13): the bespoke tiles/sections/widgets were retrofitted to
   base-CSS var(--token, <classic-literal>) IN dashboard-styles.css, so they now
   follow ANY theme (Light + Dark) and Classic falls to the literal (byte-identical);
   the editor's knobs drive them. Token map: page→--page-bg, card→--surface-card,
   inner-panel→--panel-bg, border→--header-border, strong text→--cell-text,
   muted→--tb-color, hover→--row-hover-bg, buttons→--tb-btn-*, active-tab→--actbtn-view.
   The marker rules that lived here were DELETED in Phase 1.
   DEFERRED to Phase 2 (Bucket B — these selectors have NO base rule, so a base default
   must be seeded alongside the token before they can be tokenized Classic-safely): the
   empty / no-data states, the legacy / mislabelled header + milestone-row variants,
   and the generic inner inputs/selects — kept marker-scoped below until Phase 2.
   ─────────────────────────────────────────────────────────────────────────── */
[data-theme-mode="dark"] .upcoming-trade-group-header,
[data-theme-mode="dark"] .milestone-row { background: #16243a; border-color: #283652; }
[data-theme-mode="dark"] .upcoming-empty,
[data-theme-mode="dark"] .no-data-message { background: #16243a; color: #8995ae; }
[data-theme-mode="dark"] .dashboard-container-wrapper input,
[data-theme-mode="dark"] .dashboard-container-wrapper select { background: var(--tb-btn-bg, #1f2c46); color: var(--cell-text, #edf1fa); border-color: var(--tb-btn-border, #2b3a57); }

/* ───────────────────────────────────────────────────────────────────────────
   6. AI-ANALYSIS MODULE (ai-analysis-styles.css) — now 100% TOKEN-DRIVEN.
   Every themed surface/border/text/accent reads base-CSS var(--token, <classic
   literal>) so the module follows ANY theme and Classic stays byte-identical; the
   old dark-marker block (controls / status / tabs / results / chat / chat-only /
   mode-toggle / mini-gantt / tm- modal) is retired (plan §0.13 Phase 1, §6). Only
   the two genuinely translucent surfaces below remain as dark overrides (Bucket B
   — an rgba() alpha can't be expressed by the hex token shape). Saturated data-viz
   (gantt bars, rank/delta badges, severity colours) was never marked, keeps its hue.
   ─────────────────────────────────────────────────────────────────────────── */
[data-theme-mode="dark"] .ai-thinking-content { background: rgba(0,0,0,.25); }
[data-theme-mode="dark"] .ai-thinking-tool strong { background: rgba(196,181,253,.15); }

/* ───────────────────────────────────────────────────────────────────────────
   7. TOOLBAR BUTTONS + POPOVERS (excel-toolbar.css) — RETROFITTED to Option-A
   tokens (plan §0.13 Phase 1, 2026-06-22). The toolbar `.active` button, the
   ☰ hamburger / view-settings trigger buttons, the toolbar `.dropdown-menu`
   (column chooser / baseline picker / font-size), the hamburger dropdown (.hm-*)
   and the view-settings dropdown (.vs-*) are now token-driven in BASE CSS via
   var(--popover-bg/-text/-border/-hover, --panel-bg, --tb-btn-bg/-border/-hover-bg/
   -hover-border, --tb-color, --cell-text, --sel-bg/--sel-fg, --btn-primary) — so
   they follow ANY theme and Classic falls to each rule's exact literal (byte-
   identical). The whole [data-theme-mode="dark"] marker block for these surfaces is
   now DELETED. Saturated accents (switch-on, checked/selected, the active blue)
   read --btn-primary / --sel-* (same hue, just editable). Documented dark hair-
   shifts: popover body text #cdd5e6→--popover-text #dbe2f0; trigger/step hover-
   border #44557a→--tb-btn-border #2b3a57 (mirrors §12.1); disabled/outline
   #56657c/#475569→--tb-color #8995ae. The grid-colour PALETTE swatches/inputs
   stay raw (arbitrary user data, like §12.2). Bonus dark-leak fixed: the column-
   chooser .checkbox-item label text (#495057, was dark-on-dark) → --popover-text.
   ─────────────────────────────────────────────────────────────────────────── */
/* Module HEADER action buttons (secondary white/grey ones; .btn-primary follows the
   accent and is left as-is). Marker-scoped → Classic/Light untouched. */
[data-theme-mode="dark"] .documents-actions .doc-upload-btn,
[data-theme-mode="dark"] .documents-actions .doc-export-btn,
[data-theme-mode="dark"] .documents-actions .doc-settings-btn,
[data-theme-mode="dark"] .rfis-actions .rfi-export-btn,
[data-theme-mode="dark"] .rfis-actions .rfi-settings-btn,
[data-theme-mode="dark"] .submittals-actions button { background: #1f2c46; border-color: #2b3a57; color: #dbe2f0; }
[data-theme-mode="dark"] .documents-actions .doc-upload-btn:hover,
[data-theme-mode="dark"] .documents-actions .doc-export-btn:hover,
[data-theme-mode="dark"] .documents-actions .doc-settings-btn:hover,
[data-theme-mode="dark"] .rfis-actions .rfi-export-btn:hover,
[data-theme-mode="dark"] .rfis-actions .rfi-settings-btn:hover,
[data-theme-mode="dark"] .submittals-actions button:hover { background: #24314b; border-color: #1199fc; color: #66bdff; }
/* Keep the primary/create buttons on their accent under Dark (override the grey-button
   :hover rule above for .btn-primary / create, which also match .submittals-actions button) */
[data-theme-mode="dark"] .submittals-actions .btn-primary,
[data-theme-mode="dark"] .submittals-actions .submittal-create-btn { background: var(--btn-pri, #2563eb); border-color: var(--btn-pri, #2563eb); color: #fff; }
[data-theme-mode="dark"] .submittals-actions .submittal-create-btn:hover { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }

/* ───────────────────────────────────────────────────────────────────────────
   8. GRID COLUMN-HEADER MENU — RETROFITTED to Option-A tokens (plan §0.7.9, 2026-06-19).
   #column-menu + .column-menu-item are now driven by inline var() tokens set in
   column-menu-manager.js: --popover-bg / --popover-text / --popover-border /
   --popover-hover / --danger (delete action). Dark/Light come from the seeded theme;
   Classic falls back to the original literals (white / #ccc / #e0e0e0 / #f0f0f0 / #d32f2f),
   byte-identical. No [data-theme-mode="dark"] rules remain here. (One deviation: the dark
   dropdown shadow now uses the inline default 0 2px 8px rgba(0,0,0,.15) — box-shadow is
   not in the token model; both shadows are black, no light surface.)
   ─────────────────────────────────────────────────────────────────────────── */

/* ───────────────────────────────────────────────────────────────────────────
   9. PER-COLUMN ADVANCED FILTER MODAL — RETROFITTED to Option-A tokens (plan §0.7.9,
   2026-06-19). advanced-filter-ui.js's injected #advanced-filter-styles now consumes
   var() tokens directly: modal → --popover-bg/-text/-border; header/footer/operator-box/
   set-filter-list/scrollbar-track → --panel-bg (NEW token); inputs/footer+set buttons →
   --tb-btn-*; muted text (labels/close/row-count/funnel/empty/value-count) → --tb-color;
   bright text (title/input/close-hover) → --cell-text; item label/operator label →
   --popover-text; reset button → --danger + --st-void-bg (hover); funnel/active →
   --tb-color/--popover-hover/--actbtn-view/--panel-bg. The funnel + sort header icons
   carried inline cssText color → tokenized in place. Dark/Light come from the seeded
   theme; Classic falls back to the original literals (byte-identical). No
   [data-theme-mode="dark"] rules remain here. (`.has-active-filter .column-filter` stays
   under §12.4, not §9.)
   ─────────────────────────────────────────────────────────────────────────── */

/* ───────────────────────────────────────────────────────────────────────────
   10. @MENTION @-suggestion DROPDOWN — RETROFITTED to Option-A tokens (§0.7.9).
   The dropdown chrome (panel/header/title/empty/loading/items/name/email/role/
   scrollbar) is now token-driven in BASE CSS (mention-styles.css) via
   var(--popover-bg/-border, --panel-bg, --popover-hover, --cell-text, --tb-color,
   --tb-btn-border) — flips Dark/Light/Classic + Theme-Editor-tunable; no
   [data-theme-mode="dark"] dropdown rules remain here. The file's old OS-keyed
   @media (prefers-color-scheme: dark) block was scoped to Classic-only
   (:root:not([data-theme])) so the app theme — not the OS — drives Light/Dark,
   while Classic stays byte-identical. Only the inline @name CHIP keeps a marker
   below: a one-off blue semantic SET (same policy as status badges), not chrome.
   (Dropdown box-shadow drops the marker's rgba(0,0,0,.4) → base rgba(0,0,0,.15);
   composite shadow isn't in the 4-type token model — both black, negligible. §D-078-16)
   ─────────────────────────────────────────────────────────────────────────── */
[data-theme-mode="dark"] .mention { background-color: #16334d; color: #66bdff; }
[data-theme-mode="dark"] .mention:hover { background-color: #1d4368; }

/* ───────────────────────────────────────────────────────────────────────────
   11. USER ACCOUNT BUTTON + DROPDOWN — RETROFITTED to tokens (plan §0.7.9, iter #10).
   The pill, dropdown menu, items, dividers, section labels, logout, toggle track and
   scrollbar are now token-driven in BASE CSS (user-profile-enhanced.css, "§11 THEME
   TOKENS" block) via var(--tb-btn-bg/-border, --popover-bg/-text/-border/-hover,
   --cell-text, --tb-color, --danger, --st-void-bg, --panel-bg). No [data-theme-mode="dark"]
   rules remain here. Purple gradient header / avatars / ADMIN badge intentionally
   untokenized (brand gradient). Dark hair-shifts vs the old marker (Dark is not
   byte-identical-guaranteed): hover-border #44557a→#2b3a57, logout-hover #3a1518→#3a0f17,
   the .active toggle now keeps its green ON accent, box-shadows stay the base (lighter)
   values (composite shadow — see D-078-16). §D-078-17.
   ─────────────────────────────────────────────────────────────────────────── */

/* ───────────────────────────────────────────────────────────────────────────
   12. FULL-SCREEN AUDIT LEFTOVERS (§0.7.7). Seven light surfaces the §0.7.6 pass
   left behind, found by the automated light-surface scan. Each is marker-scoped →
   Classic/Light byte-identical. !important is used ONLY where the source paints
   via an inline style or its own !important (noted per block).
   ─────────────────────────────────────────────────────────────────────────── */

/* 12.1 — Top-bar "☰ Menu" pill + every .action-btn — RETROFITTED to tokens (plan §0.7.9,
   iter #11). Now token-driven in BASE style.css `.action-btn` via var(--tb-btn-bg/-border/
   -text, --tb-btn-hover-bg, --btn-primary (active bg+border), --panel-bg/--tb-color/
   --tb-btn-border (disabled)). No [data-theme] rule remains. Dark hair-shifts vs the old
   marker: hover-border #44557a→#2b3a57, disabled bg #1a2438→#16243a / text #56657c→#8995ae;
   the hover box-shadow stays the base value (composite shadow, see D-078-16). §D-078-18. */

/* 12.2 — Column-GROUP header band (th.grouped-header) + grouped column cells
   (th.grouped-col). column-group-manager.js paints `background:${group.color}` as an
   INLINE style with a user-picked, ARBITRARY hex (default #e8f4fd; Procurement's
   "START DATES" = green #e8fdf3). Inline + arbitrary ⇒ reactive CSS can't per-value
   remap, and a JS remap wouldn't react to a live theme switch (applyTheme only
   re-paints tokens, never re-renders the grid). So Dark FLATTENS the band to a dark
   surface (per-group hue not preserved under Dark — deliberate, see plan §0.7.7).
   Inline bg ⇒ !important required. The ⋮/collapse glyphs carry inline color:#666
   (invisible on dark) so they relight too. */
/* PHASE 3 (plan §0.13): slug-specific [data-theme="dark"] → [data-theme-mode="dark"] so ANY dark
   theme flattens the arbitrary inline group colour; raw literals → --tb-btn-bg / --tb-color. */
[data-theme-mode="dark"] th.grouped-header { background: var(--tb-btn-bg, #1f2c46) !important; color: var(--hdr-text, #edf1fa) !important; border-color: var(--hdr-border, #283652) !important; }
[data-theme-mode="dark"] th.grouped-col { background: var(--hdr-bg, #162136) !important; color: var(--hdr-text, #edf1fa) !important; border-color: var(--hdr-border, #283652) !important; }
[data-theme-mode="dark"] th.grouped-header .group-collapse-btn,
[data-theme-mode="dark"] th.grouped-col .column-menu-trigger { color: var(--tb-color, #8995ae) !important; }

/* 12.3 — Documents view/scope bar — RETROFITTED to tokens (plan §0.7.9, iter #12).
   `.documents-view-bar` (documents.css) → var(--header-bg/--header-border); the shared
   `.data-scope-label`/`.data-scope-select` (grid-tokens.css) → var(--tb-color, --tb-btn-bg/
   -border/-text) — this also themes the RFIs/Submittals scope selectors. The "Group" pill's
   colours moved OFF the inline cssText (document-grid.js) into a token-driven `.doc-group-btn`
   class rule (documents.css), so no !important is needed. No [data-theme] rule remains. Dark
   hair-shift: select/group hover-border #44557a→#2b3a57. §D-078-19. */

/* 12.4 — Active-filter highlight on a column-filter INPUT (light-blue #e8f0fe). The
   generic rule (advanced-filter-ui.js injected <style>, NOT !important) is won on
   specificity; the per-module copies (documents/rfis/submittals .X-container … ,
   #e8f0fe !important) need !important + one extra class to out-rank. The active
   funnel trigger (same modules, #e8f0fe !important bg) relights too. */
[data-theme-mode="dark"] .filter-row th.has-active-filter .column-filter { background: #16263f; border-color: #1199fc; color: #edf1fa; }
[data-theme-mode="dark"] .documents-container .filter-row th.has-active-filter .column-filter,
[data-theme-mode="dark"] .rfis-container .filter-row th.has-active-filter .column-filter,
[data-theme-mode="dark"] .submittals-container .filter-row th.has-active-filter .column-filter { background: #16263f !important; border-color: #1199fc !important; color: #edf1fa !important; }
[data-theme-mode="dark"] .documents-container .filter-row .advanced-filter-trigger.active,
[data-theme-mode="dark"] .rfis-container .filter-row .advanced-filter-trigger.active,
[data-theme-mode="dark"] .submittals-container .filter-row .advanced-filter-trigger.active { background: #16334d !important; color: #66bdff !important; }
/* ExcelGridBase GENERIC active-filter input (filter-manager.js: `.column-filter.active`,
   amber #fef3c7) — a different mechanism/colour from the per-module blue above; relight to
   dark amber (mirrors §3). Plus the generic input's light #d1d5db border. NOT !important. */
[data-theme-mode="dark"] .excel-grid-table .column-filter { border-color: #2b3a57; }
[data-theme-mode="dark"] .excel-grid-table .column-filter.active { background-color: #3a2e0c; border-color: #b8860b; color: #fcd34d; }

/* 12.5 — Filter-row STRIP — RETROFITTED to tokens (plan §0.7.9, iter #13). The ExcelGridBase
   strip (filter-manager.js injects `.excel-grid-table .filter-row`) → var(--hdr-bg, #fafafa);
   the Gantt schedule grid (style.css `.grid-table .filter-row th` #f8f9fa !important + border
   #ddd, and `.column-filter`) → var(--hdr-bg/--hdr-border, --tb-btn-bg/-border, --cell-text;
   the input keeps Classic-transparent bg + inherited text → byte-identical). No [data-theme]
   rule remains. §D-078-20. */

/* 12.5b — Module VIEW surface — RETROFITTED (plan §0.7.9, iter #13). dynamic-grid-styles.css
   `.view-container` background #fff → var(--page-bg, #fff). No [data-theme] rule remains. */

/* 12.5c — Procurement Progress-bar TRACK — RETROFITTED (plan §0.7.9, iter #13). The inline
   `background:#e9ecef` was moved OFF the 3 render sites (procurement-grid.js ×2 +
   column-group-manager.js) into a token-driven `.proc-progress-track` rule
   (procurement-styles.css) via var(--tb-btn-border, #e9ecef) — no !important needed. No
   [data-theme] rule remains. */

/* 12.6 — Notification center slide-in panel (#notification-panel) + toasts — RETROFITTED
   to tokens (plan §0.7.9, iter #15). The NEUTRAL chrome (panel / header / title / search /
   tabs / toggles / list / group-headers / items / messages / footer / toast surfaces) is now
   token-driven in the BASE injected style (notification-center-manager.js) via var(--panel-bg,
   --popover-bg/-text/-border/-hover, --tb-btn-bg/-border, --tb-color, --cell-text, --actbtn-view,
   --btn-primary). Only the genuinely MULTI-COLOUR semantic SETs keep a [data-theme] marker
   below (same policy as the §3 status badges + §12.4 active-filter accents): the blue unread
   row, the amber pinned header, the blue active tab-count / group-density chips, the blue
   push-prompt banner, the blue hover-action tint, and the settings sub-panel. The pastel
   type-badges / type-icons stay accents (not marker-scoped). A few muted dark texts shift a
   hair (#cdd5e6 → --tb-color #8995ae) and the panel box-shadow drops to the base value
   (composite shadow, D-078-16). §D-078-22. */
[data-theme-mode="dark"] .notification-bell-btn:hover { background-color: rgba(255,255,255,.08) !important; }
[data-theme-mode="dark"] .notification-bell-btn:active { background-color: rgba(255,255,255,.12) !important; }
[data-theme-mode="dark"] .push-prompt { background: #16263f !important; border-bottom-color: #283652 !important; }
[data-theme-mode="dark"] .notification-tab.active .tab-count { background: #16334d !important; color: #66bdff !important; }
[data-theme-mode="dark"] .group-btn.active,
[data-theme-mode="dark"] .density-btn.active { background: #16334d !important; border-color: #1199fc !important; color: #66bdff !important; }
[data-theme-mode="dark"] .notification-pinned-header { background: #3a2e0c !important; border-bottom-color: #5c4a12 !important; color: #fcd34d !important; }
[data-theme-mode="dark"] .notification-item.unread { background-color: #16263f !important; }
[data-theme-mode="dark"] .notification-item.unread:hover { background-color: #1d4368 !important; }
[data-theme-mode="dark"] .hover-btn:hover { background: #16334d !important; }
[data-theme-mode="dark"] .notification-type-settings { background: #16243a !important; border-bottom-color: #283652 !important; }

/* 12.7 — Expanded toolbar search box — RETROFITTED to tokens (plan §0.7.9, iter #14).
   excel-toolbar.css `.search-expanded` → var(--popover-bg/--popover-border); input →
   var(--cell-text); placeholder + `.search-counter` → var(--tb-color). The dark box-shadow
   drops to the base value (composite shadow, D-078-16); the defensive #toolbar-search-input
   ID rule is no longer needed (the input is coloured by the class rule). No [data-theme]
   rule remains. §D-078-21. */

/* ───────────────────────────────────────────────────────────────────────────
   13. FINANCIAL module grid chrome — RETROFITTED to tokens (plan §0.7.9, iter #16). The
   shared chrome — `.dynamic-grid-wrapper` / `.dynamic-grid-header` / `.dynamic-grid-title` /
   `.dynamic-grid-header .toolbar-container` (dynamic-grid-styles.css) and the KPI strip
   `.budget-kpi-row`/`.fin-kpi-row` / `.kpi-card` / `.kpi-label` / neutral `.kpi-value`
   (financial.css) — is now token-driven in BASE CSS via var(--page-bg, --header-bg/-border,
   --hd-color, --tb-bg/-border, --panel-bg, --popover-bg/-border, --tb-color, --cell-text); it
   relights every financial grid's chrome in Light AND Dark. KEPT below as documented markers
   (semantic / inline-override exceptions — same policy as §12.2/§12.4): the
   row action buttons (INLINE white bg across the financial grid JS → no base class can reach
   them), and the approval toggle (strip-financial-toolbar.js injected). §D-078-23.
   The COLOURED KPI value hues + left-borders were RETROFITTED to base tokens (plan §0.13
   Phase 3): financial.css now reads .kpi-card.kpi-{blue,amber,purple,green,positive,negative}
   from --sem-info / --sem-warn / --brief-accent / --sem-ok / --sem-danger (Classic = each
   literal via the var() fallback; markers DELETED). */
/* Row action buttons — INLINE white bg + grey border + semantic text, !important; no base
   class can reach them (inline beats it). Inline-override exception → PHASE 3 (plan §0.13)
   switched to [data-theme-mode="dark"] (ANY dark theme) + tokenized to chrome/semantic tokens. */
[data-theme-mode="dark"] .dynamic-grid-wrapper button[class*="-act-"] { background: var(--tb-btn-bg, #1f2c46) !important; border-color: var(--tb-btn-border, #2b3a57) !important; }
[data-theme-mode="dark"] .dynamic-grid-wrapper button[class*="-act-"]:hover { background: var(--tb-btn-hover-bg, #24314b) !important; border-color: var(--tb-btn-border, #44557a) !important; }
[data-theme-mode="dark"] .dynamic-grid-wrapper button[class*="-act-view"] { color: var(--sem-info, #93c5fd) !important; }
[data-theme-mode="dark"] .dynamic-grid-wrapper button[class*="-act-delete"],
[data-theme-mode="dark"] .dynamic-grid-wrapper button[class*="-act-void"] { color: var(--sem-danger, #fca5a5) !important; }
[data-theme-mode="dark"] .dynamic-grid-wrapper button[class*="-act-approve"] { color: var(--sem-ok, #6ee7b7) !important; }
/* Approval toggle (strip-financial-toolbar.js injects #approval-toggle-css). JS-injected →
   PHASE 3 (plan §0.13) switched to [data-theme-mode="dark"] (ANY dark theme) + tokenized. */
[data-theme-mode="dark"] .approval-toggle { background: var(--tb-btn-bg, #1f2c46); border-color: var(--tb-btn-border, #2b3a57); color: var(--tb-color, #8995ae); }
[data-theme-mode="dark"] .approval-toggle:hover { background: var(--tb-btn-hover-bg, #24314b); border-color: var(--tb-btn-border, #44557a); }
/* .on accent stays saturated per D-078-2 (small accent exception) — label/gear inherit white */
[data-theme-mode="dark"] .approval-toggle.on { background: #2563eb; border-color: #2563eb; color: #fff; }
[data-theme-mode="dark"] .approval-toggle-label { color: inherit; }
/* Read-only pill (A3 2026-07-23, dynamic-grid-styles.css) — light-grey chip would glow in dark;
   re-light from the toolbar-button tokens (small state label, follows the §13 chrome). */
[data-theme-mode="dark"] .grid-readonly-pill { background: var(--tb-btn-bg, #1f2c46); border-color: var(--tb-btn-border, #2b3a57); color: var(--tb-color, #8995ae); }

/* ───────────────────────────────────────────────────────────────────────────
   14. §0.11 localized leaks — RETROFITTED to base tokens (plan §0.13 Phase 2,
   2026-06-22): 14a submittals pager + 14b reports scrollbar moved to base CSS with
   byte-identical fallbacks; the [data-theme-mode="dark"] marker rules are DELETED.
   ─────────────────────────────────────────────────────────────────────────── */
/* 14a — Submittals pager buttons → base tokens in submittals.css (--tb-btn-bg/-border,
   color:var(--tb-btn-text,#000) scoped :not(:disabled), + hover tokens). Markers DELETED. */
/* 14b — Financial-Reports `.rpt-grid-wrap` scrollbar → base in report-builder.js
   (scrollbar-color: var(--gantt-scrollbar-thumb) var(--gantt-scrollbar-track); no fallback
   → Classic keeps the native `auto` scrollbar). Marker DELETED. */

/* ───────────────────────────────────────────────────────────────────────────
   15. ADMIN PANEL (P5, 2026-06-21). The chrome + Grid-Settings + System sub-tab
   surfaces are token-driven in BASE CSS (admin-styles.css → var(--page-bg,
   --header-bg/-border, --hdr-border, --panel-bg, --cell-text, --hd-color,
   --tb-color, --source-text, --conn-bg/-text)) and the per-tab content
   (src/core/admin-tabs/*.js) is token-driven at each inline site — so Light AND
   Dark both relight and Classic stays byte-identical. KEPT here (marker-scoped,
   dark-only → Classic + Light native widget rendering 100% untouched; tokens so
   the editor still tunes them in dark): native form controls — a base-CSS bg on
   <select>/<input> would alter Classic's native widget look. Mirrors §13 policy.
   ─────────────────────────────────────────────────────────────────────────── */
/* Admin base TEXT colour + form-group labels → RETROFITTED to base CSS in admin-styles.css
   (plan §0.13 Phase 2): #admin-container { color: var(--cell-text, inherit) } (the `inherit`
   fallback reproduces today's no-rule inheritance = byte-identical Classic) + #admin-container
   .form-group label { color: var(--cell-text, #495057) }. Markers DELETED — now editor-driven
   for Light too. The native form controls below STAY marker-scoped (next). */
[data-theme-mode="dark"] #admin-container select,
[data-theme-mode="dark"] #admin-container input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
[data-theme-mode="dark"] #admin-container textarea {
    background: var(--tb-btn-bg, #1f2c46);
    color: var(--tb-btn-text, #dbe2f0);
    border-color: var(--tb-btn-border, #2b3a57);
}
[data-theme-mode="dark"] #admin-container select option {
    background: var(--popover-bg, #1d2a42);
    color: var(--popover-text, #dbe2f0);
}
[data-theme-mode="dark"] #admin-container input::placeholder,
[data-theme-mode="dark"] #admin-container textarea::placeholder { color: var(--tb-color, #8995ae); }
/* 15b — Email-queue KPI tiles — RETROFITTED to base tokens (plan §0.13 Phase 3). The 4
   severity VALUE hues now read var(--sem-warn/-info/-ok/-danger, <literal>) and the labels
   var(--tb-color, <literal>) inline in admin-email-settings-tab.js; the card chrome (bg/border)
   was already token-driven. Classic = each inline literal (byte-identical); any theme drives
   them (dark numbers stay coloured, labels muted via --tb-color). Markers DELETED. */

/* ───────────────────────────────────────────────────────────────────────────
   16. FULL-APP CONTRAST SWEEP (2026-06-22). The whole-app WCAG sweep
   (docs/playwright_setup/modular/modules/theme-fullpage-contrast.mjs — every nav
   view + every dashboard tab) surfaced 199 unique sub-3:1 TEXT nodes that the
   earlier deferred-surfaces pass never rendered. Each carried a HARDCODED
   light-mode literal (NO var()), so it never themed — invisible dark-on-dark under
   Dark. Marker-scoped → Classic + Light byte-identical. Tokens (var(--cell-text)
   #edf1fa / var(--tb-color) #8995ae) so the editor still tunes them.
   ─────────────────────────────────────────────────────────────────────────── */
/* 16a — PROJECT DASHBOARD widgets. PHASE 1 (plan §0.13): the dashboard's own text
   (page title h1, Upcoming-Work columns, WBS names) was tokenized to base
   var(--cell-text, <literal>) IN dashboard-styles.css and those marker rules deleted.
   KEPT here (deferred): .trade-name / .slab-label are Progress-Matrix selectors shared
   with the standalone module — scoping the fix to the dashboard wrapper avoids
   entangling Progress Matrix; revisit when that module is tokenized. */
[data-theme-mode="dark"] .dashboard-container-wrapper .trade-name,
[data-theme-mode="dark"] .dashboard-container-wrapper .slab-label { color: var(--cell-text, #edf1fa); }

/* 16b — GANTT grid WBS / summary-bar row labels (style.css .summary-name-label
   #2c3e50, cr 1.47, all 6 schedule views). Regular .activity-name-label is already
   light; only the bold summary variant carried the dark blue-grey. */
[data-theme-mode="dark"] .summary-name-label { color: var(--cell-text, #edf1fa); }

/* 16c — Shared toolbar font-size readout (excel-toolbar.css .font-size-value
   #374151, cr 1.35, every view's toolbar). */
[data-theme-mode="dark"] .excel-toolbar .font-size-display .font-size-value { color: var(--cell-text, #edf1fa); }

/* 16d + 17 + 17b — "NEW UPDATES" view + Run-Schedule wizard (updates.css) —
   RETROFITTED to Option-A tokens (plan §0.13 Phase 1, 2026-06-22). The whole
   management view (header / category cards / subtitle+count / badges / action
   buttons / status pills) AND the run-schedule wizard (header gradient / stepper /
   update groups+items / config cards / mode options / selection summary / result
   KPI cards / impact table / note callout / type badges) are now token-driven in
   BASE updates.css via var(--header-bg/-border, --surface-card, --panel-bg,
   --cell-text, --tb-color, --popover-text, --tb-btn-bg/-border/-text/-hover-*,
   --row-hover-bg, --sel-bg/--sel-fg, --brief-accent(+bg), --sem-ok/-warn/-danger/
   -info + their -bg fills). Classic falls to each rule's exact literal (byte-
   identical). The §16d/§17/§17b [data-theme-mode="dark"] marker blocks are DELETED.
   Bonus dark-leaks fixed in-pass (the committed sweep missed them; no Classic
   change): run-schedule-header light gradient, admin-badge, wizard type-badges /
   blue chips, previous-updates status pills + draft-status. */

/* 16e — ACR / any dynamic-grid pinned TOTALS row (dynamic-grid-styles.css
   `.excel-grid-table tfoot td` sets --foot-bg but no color → inherited black on
   the dark totals band, cr 1.62). Relight the plain totals cells; the semantic
   negative / computed / source totals keep their hue (re-asserted at higher
   specificity so the generic rule below doesn't flatten them). */
[data-theme-mode="dark"] .excel-grid-table tfoot td { color: var(--cell-text, #edf1fa); }
[data-theme-mode="dark"] .excel-grid-table tfoot td.negative-currency { color: #fca5a5; }
[data-theme-mode="dark"] .excel-grid-table tfoot td.col-computed { color: var(--computed-text, #fca5a5); }
[data-theme-mode="dark"] .excel-grid-table tfoot td.col-source { color: var(--source-text, #93c5fd); }

/* Procore-alignment plan Phase 2 (2026-07-17) — invoice line-items approved-CO row tint.
   Same blue family as col-source above, opacity raised so it stays visible on the dark row
   background without becoming a large bright fill (subtle-tint rule). */
[data-theme-mode="dark"] .excel-grid-table tbody tr.inv-line-co-row { background-color: var(--inv-line-co-bg, rgba(96, 165, 250, 0.12)); }
[data-theme-mode="dark"] .excel-grid-table tbody tr.inv-line-co-row.zebra-even { background-color: var(--inv-line-co-bg-zebra, rgba(96, 165, 250, 0.16)); }
[data-theme-mode="dark"] .excel-grid-table tbody tr.inv-line-co-row:hover { background-color: var(--inv-line-co-bg-hover, rgba(96, 165, 250, 0.20)); }

/* 17 (Bucket B remnant) — the run-schedule config-card NON-date inputs / selects /
   textareas have NO base rule (browser-default native widgets), so a base var()
   default would alter Classic's native look. Kept marker-scoped (same policy as
   the §7/§15 native controls); everything else in §16d/§17/§17b is now base-token. */
[data-theme-mode="dark"] .run-schedule-section .config-card input:not([type="date"]):not([type="checkbox"]):not([type="radio"]),
[data-theme-mode="dark"] .run-schedule-section .config-card select,
[data-theme-mode="dark"] .run-schedule-section .config-card textarea { background: #1f2c46; border-color: #2b3a57; color: #edf1fa; }

/* ───────────────────────────────────────────────────────────────────────────
   18. RFIs pagination footer → RETROFITTED to base tokens in rfis.css (plan §0.13
   Phase 2): strip → --foot-bg/-border + --cell-text; info → --tb-color; buttons →
   --tb-btn-bg/-border/-text + --btn-primary accent hover. Marker rules DELETED below.
   ─────────────────────────────────────────────────────────────────────────── */
/* (rfis-pagination marker rules deleted — now base-tokenized in rfis.css; see note above) */

/* 17b — Updates view text / chips / action buttons: RETROFITTED to base updates.css
   tokens (see the consolidated §16d+17+17b note above). Marker block DELETED. */

/* 17c — Dashboard Elevation-Progress view-toggle: tokenized to base
   var(--panel-bg, #f1f5f9) in dashboard-styles.css (Phase 1). Marker rule removed. */

/* 17d — Documents sheet-set source chip (sheet-set-import.css .doc-grid-source-set
   #0c4a6e dark blue, cr 1.37) → light blue (keeps the blue identity). */
[data-theme-mode="dark"] .doc-grid-source-set { color: #93c5fd; }

/* ───────────────────────────────────────────────────────────────────────────
   19. PROJECT DASHBOARD — per-tab SETTINGS ACCORDION (dashboard-settings.js +
   dashboard-styles.css). This collapsible panel (WBS Filter / Key Milestones /
   Upcoming Work + their chips, rows, toggle icons, summaries, help bubbles) shipped
   with ZERO dark coverage — hardcoded light fills + dark text in BOTH the stylesheet
   AND inline style="" strings. The classed elements are repainted here (!important
   beats the inline styles); the two CLASSLESS inline <div>s (time-filter label + info
   callout) are tokenized in dashboard-settings.js (CSS can't target them). Classic /
   Light set no/other marker → byte-identical.
   ─────────────────────────────────────────────────────────────────────────── */
/* Help glyph bubble */
[data-theme-mode="dark"] .settings-section-help { background: var(--hdr-border, #283652); color: var(--cell-text, #c9d3e6); }
/* Inline toggle icons (▶/▼) + section summaries — built inline, need !important */
[data-theme-mode="dark"] .wbs-toggle-icon,
[data-theme-mode="dark"] .milestones-toggle-icon,
[data-theme-mode="dark"] .upcoming-toggle-icon,
[data-theme-mode="dark"] .wbs-filter-summary,
[data-theme-mode="dark"] .milestones-summary,
[data-theme-mode="dark"] .upcoming-work-summary { color: var(--tb-color, #8995ae) !important; }
/* WBS include/exclude chips — darken the bright green/red fills to deep variants */
[data-theme-mode="dark"] .wbs-chip.included { background: #14331f; border-color: #2e7d32; color: #86efac; }
[data-theme-mode="dark"] .wbs-chip.excluded { background: #3a1619; border-color: #b91c1c; color: #fca5a5; }
/* Key Milestones compact rows */
[data-theme-mode="dark"] .milestone-settings-item-compact { background: var(--panel-bg, #16243a); border-color: var(--hdr-border, #283652); }
[data-theme-mode="dark"] .milestone-name-compact { color: var(--cell-text, #edf1fa); }
[data-theme-mode="dark"] .milestone-date-compact,
[data-theme-mode="dark"] .milestone-remove-compact { color: var(--tb-color, #8995ae); }
/* Upcoming Work rows */
[data-theme-mode="dark"] .upcoming-task-row-item { background: var(--panel-bg, #16243a); border-left-color: var(--hdr-border, #283652); }
[data-theme-mode="dark"] .upcoming-task-row-item:hover { background: var(--row-hover-bg, #24314b); }
[data-theme-mode="dark"] .upcoming-task-name-item,
[data-theme-mode="dark"] .upcoming-task-date-item { color: var(--cell-text, #edf1fa); }
[data-theme-mode="dark"] .upcoming-task-trade-path,
[data-theme-mode="dark"] .upcoming-filtered { color: var(--tb-color, #8995ae); }
/* Inline-styled Upcoming time-filter panel bg (class present, value inline → !important) */
[data-theme-mode="dark"] .upcoming-time-filter { background: var(--panel-bg, #16243a) !important; }

/* ───────────────────────────────────────────────────────────────────────────
   20. SHARED MODAL CHROME (style.css .modal-content / .modal-header / .modal-title /
   .close-btn / .modal-footer / .form-group / .btn-secondary) — used by the gantt
   toolbar VERSION selector (#version-modal) and COLUMN show/hide (#show-columns-modal),
   plus other .modal-content dialogs. Shipped light-only (background:white, #212529 text,
   #e1e5e9 borders). Light/Classic keep those (light-native); only Dark is repainted.
   ─────────────────────────────────────────────────────────────────────────── */
[data-theme-mode="dark"] .modal-content { background: var(--surface-card, #1d2a42); color: var(--cell-text, #edf1fa); }
[data-theme-mode="dark"] .modal-header { border-bottom-color: var(--hdr-border, #283652); }
[data-theme-mode="dark"] .modal-title { color: var(--cell-text, #edf1fa); }
[data-theme-mode="dark"] .modal-body { color: var(--cell-text, #edf1fa); }
[data-theme-mode="dark"] .modal-footer { border-top-color: var(--hdr-border, #283652); }
[data-theme-mode="dark"] .close-btn { color: var(--tb-color, #8995ae); }
[data-theme-mode="dark"] .close-btn:hover { background: var(--row-hover-bg, #24314b); color: var(--cell-text, #edf1fa); }
/* Form fields inside any modal */
[data-theme-mode="dark"] .form-group label { color: var(--cell-text, #edf1fa); }
[data-theme-mode="dark"] .form-group input[type="text"],
[data-theme-mode="dark"] .form-group input[type="email"],
[data-theme-mode="dark"] .form-group input[type="password"],
[data-theme-mode="dark"] .form-group input[type="date"],
[data-theme-mode="dark"] .form-group input[type="color"],
[data-theme-mode="dark"] .form-group textarea { background: var(--tb-btn-bg, #1f2c46); color: var(--cell-text, #edf1fa); border-color: var(--tb-btn-border, #2b3a57); }
/* Column show/hide specifics */
[data-theme-mode="dark"] .column-group h4,
[data-theme-mode="dark"] .column-checkbox { color: var(--cell-text, #edf1fa); }
[data-theme-mode="dark"] .btn-secondary { background: var(--tb-btn-bg, #1f2c46); border-color: var(--tb-btn-border, #2b3a57); color: var(--cell-text, #edf1fa); }
[data-theme-mode="dark"] .btn-secondary:hover { background: var(--row-hover-bg, #24314b); }

/* ───────────────────────────────────────────────────────────────────────────
   21. GANTT ADVANCED FILTER modal (src/filters/gantt-filter-modal-styles.js) — an
   INJECTED stylesheet of ~700 hardcoded light literals, every rule !important and no
   tokens. Repaint the surfaces here; our [data-theme-mode] scope (0,2,0)+!important
   outranks the injected .gfm-* (0,1,0)+!important. Light/Classic = no marker → original.
   ─────────────────────────────────────────────────────────────────────────── */
[data-theme-mode="dark"] .gfm-modal { background: var(--surface-card, #1d2a42) !important; color: var(--cell-text, #edf1fa) !important; border-color: var(--hdr-border, #283652) !important; }
[data-theme-mode="dark"] .gfm-header,
[data-theme-mode="dark"] .gfm-tabs,
[data-theme-mode="dark"] .gfm-left-panel,
[data-theme-mode="dark"] .gfm-left-header,
[data-theme-mode="dark"] .gfm-simple-column-header { background: var(--panel-bg, #16243a) !important; border-color: var(--hdr-border, #283652) !important; }
[data-theme-mode="dark"] .gfm-content,
[data-theme-mode="dark"] .gfm-tab-content,
[data-theme-mode="dark"] .gfm-body,
[data-theme-mode="dark"] .gfm-simple-column { background: var(--surface-card, #1d2a42) !important; }
[data-theme-mode="dark"] .gfm-header-title,
[data-theme-mode="dark"] .gfm-left-title,
[data-theme-mode="dark"] .gfm-simple-column-title,
[data-theme-mode="dark"] .gfm-tab,
[data-theme-mode="dark"] .gfm-filter-item-name,
[data-theme-mode="dark"] .gfm-tree-label,
[data-theme-mode="dark"] .gfm-group-label,
[data-theme-mode="dark"] .gfm-section-label { color: var(--cell-text, #edf1fa) !important; }
[data-theme-mode="dark"] .gfm-filter-item-meta,
[data-theme-mode="dark"] .gfm-tree-count,
[data-theme-mode="dark"] .gfm-group-count,
[data-theme-mode="dark"] .gfm-live-count { color: var(--tb-color, #8995ae) !important; }
[data-theme-mode="dark"] .gfm-search-input,
[data-theme-mode="dark"] .gfm-category-select,
[data-theme-mode="dark"] .gfm-condition-input,
[data-theme-mode="dark"] .gfm-condition-select { background: var(--tb-btn-bg, #1f2c46) !important; color: var(--cell-text, #edf1fa) !important; border-color: var(--tb-btn-border, #2b3a57) !important; }
[data-theme-mode="dark"] .gfm-condition-group,
[data-theme-mode="dark"] .gfm-group-header,
[data-theme-mode="dark"] .gfm-rule-wrap,
[data-theme-mode="dark"] .gfm-filter-item { background: var(--panel-bg, #16243a) !important; border-color: var(--hdr-border, #283652) !important; }
[data-theme-mode="dark"] .gfm-filter-item:hover { background: var(--row-hover-bg, #24314b) !important; }
[data-theme-mode="dark"] .gfm-new-btn,
[data-theme-mode="dark"] .gfm-tree-action-btn,
[data-theme-mode="dark"] .gfm-add-condition-btn,
[data-theme-mode="dark"] .gfm-add-group-btn { background: var(--tb-btn-bg, #1f2c46) !important; color: var(--cell-text, #edf1fa) !important; border-color: var(--tb-btn-border, #2b3a57) !important; }
/* gfm — tree (WBS / activity-code) scroll containers, nodes, checkboxes, counts */
[data-theme-mode="dark"] .gfm-tree-scroll { background: var(--surface-card, #1d2a42) !important; border-color: var(--hdr-border, #283652) !important; }
[data-theme-mode="dark"] .gfm-tree-node { background: transparent !important; }
[data-theme-mode="dark"] .gfm-tree-node:hover { background: var(--row-hover-bg, #24314b) !important; }
[data-theme-mode="dark"] .gfm-tree-checkbox { background: var(--tb-btn-bg, #1f2c46) !important; border-color: var(--tb-btn-border, #2b3a57) !important; }
[data-theme-mode="dark"] .gfm-tree-count { background: var(--panel-bg, #16243a) !important; color: var(--tb-color, #8995ae) !important; }
/* gfm — footer + footer buttons (ghost / red-ghost) */
[data-theme-mode="dark"] .gfm-footer { background: var(--panel-bg, #16243a) !important; border-color: var(--hdr-border, #283652) !important; }
[data-theme-mode="dark"] .gfm-btn,
[data-theme-mode="dark"] .gfm-btn-ghost { background: var(--tb-btn-bg, #1f2c46) !important; color: var(--cell-text, #edf1fa) !important; border-color: var(--tb-btn-border, #2b3a57) !important; }
[data-theme-mode="dark"] .gfm-btn-red-ghost { background: var(--tb-btn-bg, #1f2c46) !important; color: #fca5a5 !important; border-color: #b91c1c !important; }
/* gfm — tab badges + live match count (darken the bright status fills) */
[data-theme-mode="dark"] .gfm-tab-badge { background: var(--tb-btn-bg, #1f2c46) !important; color: var(--cell-text, #edf1fa) !important; }
/* active-tab badges carry an ID/state rule that outranks the class — match ID specificity */
[data-theme-mode="dark"] #gfm-simple-badge,
[data-theme-mode="dark"] #gfm-advanced-badge { background: var(--tb-btn-bg, #1f2c46) !important; color: #93c5fd !important; }
[data-theme-mode="dark"] .gfm-live-count { background: #14331f !important; color: #86efac !important; }

/* ───────────────────────────────────────────────────────────────────────────
   22. VERSION selector modal (#version-modal, version-selector.js) — the version
   table is inline-styled <th>/<td> (color:#666/#444/#555, background:#f8f9fa). The
   shared §20 fixes the frame; this fixes the inline table (ancestor scope + !important
   beats the inline styles).
   ─────────────────────────────────────────────────────────────────────────── */
[data-theme-mode="dark"] #version-modal th { background: var(--panel-bg, #16243a) !important; color: var(--tb-color, #8995ae) !important; border-bottom-color: var(--hdr-border, #283652) !important; }
[data-theme-mode="dark"] #version-modal td { color: var(--cell-text, #edf1fa) !important; border-color: var(--hdr-border, #283652) !important; }
[data-theme-mode="dark"] #version-modal .version-item:hover td { background: var(--row-hover-bg, #24314b) !important; }

/* ───────────────────────────────────────────────────────────────────────────
   23. DASHBOARD ELEVATION-PROGRESS tab SETTINGS (dashboard-styles.css
   .elevation-filter-*). Panel/toggle/content were already tokenized; the header rule,
   label, trade-group CHIPS (white bg), divider and action buttons were still hardcoded.
   ─────────────────────────────────────────────────────────────────────────── */
[data-theme-mode="dark"] .elevation-filter-header { border-bottom-color: var(--header-border, #283652); }
[data-theme-mode="dark"] .elevation-filter-label { color: var(--cell-text, #edf1fa); }
[data-theme-mode="dark"] .elevation-filter-chip { background: var(--tb-btn-bg, #1f2c46); border-color: var(--tb-btn-border, #2b3a57); color: var(--cell-text, #edf1fa); }
[data-theme-mode="dark"] .elevation-filter-chip.active { background: #1890ff; border-color: #1890ff; color: #fff; }
[data-theme-mode="dark"] .elevation-toolbar-divider { background: var(--hdr-border, #283652); }
[data-theme-mode="dark"] .elevation-filter-actions button { background: var(--tb-btn-bg, #1f2c46); border-color: var(--tb-btn-border, #2b3a57); color: var(--cell-text, #edf1fa); }
[data-theme-mode="dark"] .elevation-filter-actions button:hover { background: var(--row-hover-bg, #24314b); }
[data-theme-mode="dark"] .elevation-no-roots-message { color: var(--tb-color, #8995ae); }
/* elevation trade-group CARDS / WBS tree (the white cards with checkboxes) */
[data-theme-mode="dark"] .elevation-wbs-tree-container { background: var(--surface-card, #1d2a42); border-color: var(--hdr-border, #283652); }
[data-theme-mode="dark"] .elevation-wbs-group-header { background: var(--panel-bg, #16243a); border-color: var(--hdr-border, #283652); }
[data-theme-mode="dark"] .elevation-wbs-group-header:hover { background: var(--row-hover-bg, #24314b); }
[data-theme-mode="dark"] .elevation-wbs-group-header.has-selection { background: #14331f; border-color: #2e7d32; }
[data-theme-mode="dark"] .elevation-wbs-group-header.has-selection:hover { background: #1b432a; }
[data-theme-mode="dark"] .elevation-wbs-group-chevron { color: var(--tb-color, #8995ae); }
[data-theme-mode="dark"] .elevation-wbs-group-name { color: var(--cell-text, #edf1fa); }
[data-theme-mode="dark"] .elevation-selected-count.none { background: var(--panel-bg, #16243a); color: var(--tb-color, #8995ae); }
[data-theme-mode="dark"] .elevation-wbs-items { background: var(--panel-bg, #16243a); border-color: var(--hdr-border, #283652); }
[data-theme-mode="dark"] .elevation-wbs-item { border-bottom-color: var(--hdr-border, #283652); }
[data-theme-mode="dark"] .elevation-wbs-item:hover { background: var(--row-hover-bg, #24314b); }
[data-theme-mode="dark"] .elevation-wbs-item-name,
[data-theme-mode="dark"] .elevation-wbs-item.checked .elevation-wbs-item-name { color: var(--cell-text, #edf1fa); }
/* elevation saved-filters controls (Saved: select + delete X; save btn stays accent blue) */
[data-theme-mode="dark"] #elevation-saved-filters-select { background: var(--tb-btn-bg, #1f2c46); border-color: var(--tb-btn-border, #2b3a57); color: var(--cell-text, #edf1fa); }
[data-theme-mode="dark"] .elevation-delete-btn { background: var(--tb-btn-bg, #1f2c46) !important; border-color: var(--tb-btn-border, #2b3a57) !important; color: var(--tb-color, #8995ae) !important; }
[data-theme-mode="dark"] .elevation-delete-btn:hover:not(:disabled) { background: #3a1619 !important; color: #fca5a5 !important; border-color: #b91c1c !important; }

/* ───────────────────────────────────────────────────────────────────────────
   24. SWITCH-VERSION + SELECT-BASELINES toolbar DROPDOWNS (.dynamic-dropdown; content
   built with hardcoded inline styles in gantt-grid-dropdowns.js). The .dropdown-menu
   container is tokenized via --popover-*; the inline table / header / footer bars are
   repainted here (!important + [style*=] beats the inline styles).
   ─────────────────────────────────────────────────────────────────────────── */
[data-theme-mode="dark"] .dynamic-dropdown th { background: var(--panel-bg, #16243a) !important; color: var(--tb-color, #8995ae) !important; border-bottom-color: var(--hdr-border, #283652) !important; }
[data-theme-mode="dark"] .dynamic-dropdown td { color: var(--cell-text, #edf1fa) !important; }
[data-theme-mode="dark"] .dynamic-dropdown tbody tr { background: var(--surface-card, #1d2a42) !important; border-bottom-color: var(--hdr-border, #283652) !important; }
[data-theme-mode="dark"] .dynamic-dropdown tbody tr.bl-row-selected,
[data-theme-mode="dark"] .dynamic-dropdown tbody tr:hover { background: var(--row-hover-bg, #24314b) !important; }
[data-theme-mode="dark"] .dynamic-dropdown [style*="background:#f8f9fa"] { background: var(--panel-bg, #16243a) !important; border-color: var(--hdr-border, #283652) !important; }
[data-theme-mode="dark"] .dynamic-dropdown [style*="color:#333"],
[data-theme-mode="dark"] .dynamic-dropdown [style*="color:#444"],
[data-theme-mode="dark"] .dynamic-dropdown [style*="color:#555"] { color: var(--cell-text, #edf1fa) !important; }
[data-theme-mode="dark"] .dynamic-dropdown [style*="color:#666"],
[data-theme-mode="dark"] .dynamic-dropdown [style*="color:#888"] { color: var(--tb-color, #8995ae) !important; }
[data-theme-mode="dark"] .dynamic-dropdown [style*="background:#e0e0e0"],
[data-theme-mode="dark"] .dynamic-dropdown [style*="background:#e8eaed"] { background: var(--panel-bg, #16243a) !important; color: var(--tb-color, #8995ae) !important; }
[data-theme-mode="dark"] .baseline-clear-btn { background: var(--tb-btn-bg, #1f2c46) !important; }
/* radio/checkbox grey outlines + INT/CLT/Rec status badges (inline-styled) */
[data-theme-mode="dark"] .dynamic-dropdown [style*="solid #ccc"] { border-color: var(--hdr-border, #283652) !important; }
[data-theme-mode="dark"] .dynamic-dropdown [style*="background:#e3f2fd"] { background: #1e3a5f !important; color: #93c5fd !important; }
[data-theme-mode="dark"] .dynamic-dropdown [style*="background:#e8f5e9"] { background: #14331f !important; color: #86efac !important; }
[data-theme-mode="dark"] .dynamic-dropdown [style*="background:#fff3e0"] { background: #3a2e14 !important; color: #fbbf77 !important; }

/* ───────────────────────────────────────────────────────────────────────────
   25. DARK SCROLLBARS for the overflow regions fixed above — version/baseline
   dropdowns, the dashboard settings panel (incl. elevation trade-group cards), and
   shared modals. Token-driven (--gantt-scrollbar-* — editable in the Theme Editor).
   Deliberately scoped (NOT a global ::-webkit-scrollbar) so .grid-body's 17px width,
   which is load-bearing for header/body scroll-sync, is left untouched.
   ─────────────────────────────────────────────────────────────────────────── */
[data-theme-mode="dark"] .dynamic-dropdown ::-webkit-scrollbar,
[data-theme-mode="dark"] .dashboard-settings-panel ::-webkit-scrollbar,
[data-theme-mode="dark"] .elevation-wbs-tree-container::-webkit-scrollbar,
[data-theme-mode="dark"] .elevation-wbs-items::-webkit-scrollbar,
[data-theme-mode="dark"] .modal-content ::-webkit-scrollbar { width: 10px; height: 10px; }
[data-theme-mode="dark"] .dynamic-dropdown ::-webkit-scrollbar-track,
[data-theme-mode="dark"] .dashboard-settings-panel ::-webkit-scrollbar-track,
[data-theme-mode="dark"] .elevation-wbs-tree-container::-webkit-scrollbar-track,
[data-theme-mode="dark"] .elevation-wbs-items::-webkit-scrollbar-track,
[data-theme-mode="dark"] .modal-content ::-webkit-scrollbar-track { background: var(--gantt-scrollbar-track, #16243a); }
[data-theme-mode="dark"] .dynamic-dropdown ::-webkit-scrollbar-thumb,
[data-theme-mode="dark"] .dashboard-settings-panel ::-webkit-scrollbar-thumb,
[data-theme-mode="dark"] .elevation-wbs-tree-container::-webkit-scrollbar-thumb,
[data-theme-mode="dark"] .elevation-wbs-items::-webkit-scrollbar-thumb,
[data-theme-mode="dark"] .modal-content ::-webkit-scrollbar-thumb { background: var(--gantt-scrollbar-thumb, #46556f); border-radius: 5px; }
[data-theme-mode="dark"] .dynamic-dropdown,
[data-theme-mode="dark"] .dashboard-settings-panel,
[data-theme-mode="dark"] .gfm-modal { scrollbar-color: var(--gantt-scrollbar-thumb, #46556f) var(--gantt-scrollbar-track, #16243a); }

/* ───────────────────────────────────────────────────────────────────────────
   26. STANDARD TOOLBAR DROPDOWNS — menu-item text + the "Select / Deselect All"
   row (Show/Hide Columns, Font Size, Align, Row/Col Ops, Cell Format, Export all
   share .dropdown-menu .menu-item). The container/borders are already tokenized via
   --popover-*, but item TEXT inherits a dark default and the toggle-all item carries
   an inline background:#f0f0f0. Repaint both. The green Apply (apply-column-changes)
   and .active item keep their inline accent look.
   ─────────────────────────────────────────────────────────────────────────── */
[data-theme-mode="dark"] .dropdown-menu .menu-item:not(.active):not([data-action="apply-column-changes"]),
[data-theme-mode="dark"] .dropdown-menu .menu-item:not(.active):not([data-action="apply-column-changes"]) > span:not(.shortcut),
[data-theme-mode="dark"] .dropdown-menu .checkbox-item,
[data-theme-mode="dark"] .dropdown-menu .checkbox-item span { color: var(--popover-text, #dbe2f0); }
[data-theme-mode="dark"] .dropdown-menu .menu-item[data-action="toggle-all-columns"] { background: var(--popover-hover, #24314b) !important; color: var(--popover-text, #dbe2f0) !important; }

/* 27. Hamburger ☰ "saved layouts" count badge (inline background:#e3f2fd;color:#1565c0). */
[data-theme-mode="dark"] .hm-layout-count { background: #1e3a5f !important; color: #93c5fd !important; }

/* ───────────────────────────────────────────────────────────────────────────
   28. WBS BROWSER MODAL (Dashboard → TCO activity picker + Add-Milestone picker).
   wbs-browser-modal.js builds it 100% with inline styles, so dark needs !important.
   Chrome → surface/panel/border tokens; tree rows incl. JS hover (:hover) + selected;
   Expand/Collapse/Cancel → dark buttons; date pill → recessed. The blue Apply and the
   green Select stay as action accents.
   ─────────────────────────────────────────────────────────────────────────── */
[data-theme-mode="dark"] .wbs-browser-modal .wbs-modal-content { background: var(--surface-card, #1d2a42) !important; color: var(--cell-text, #edf1fa) !important; }
[data-theme-mode="dark"] .wbs-browser-modal .wbs-modal-header,
[data-theme-mode="dark"] .wbs-browser-modal .wbs-modal-footer,
[data-theme-mode="dark"] .wbs-browser-modal .wbs-toolbar { background: var(--panel-bg, #16243a) !important; border-color: var(--hdr-border, #283652) !important; }
[data-theme-mode="dark"] .wbs-browser-modal .wbs-modal-header h3 { color: var(--cell-text, #edf1fa) !important; }
[data-theme-mode="dark"] .wbs-browser-modal .wbs-close-btn,
[data-theme-mode="dark"] .wbs-browser-modal .wbs-toolbar span,
[data-theme-mode="dark"] .wbs-browser-modal .wbs-modal-footer span,
[data-theme-mode="dark"] .wbs-browser-modal #wbs-selection-count { color: var(--tb-color, #8995ae) !important; }
[data-theme-mode="dark"] .wbs-browser-modal #wbs-expand-all-btn,
[data-theme-mode="dark"] .wbs-browser-modal #wbs-collapse-all-btn,
[data-theme-mode="dark"] .wbs-browser-modal #wbs-cancel-btn { background: var(--tb-btn-bg, #1f2c46) !important; border-color: var(--tb-btn-border, #2b3a57) !important; color: var(--cell-text, #edf1fa) !important; }
[data-theme-mode="dark"] .wbs-browser-modal .wbs-list-container,
[data-theme-mode="dark"] .wbs-browser-modal .wbs-browser-list { background: var(--surface-card, #1d2a42) !important; }
[data-theme-mode="dark"] .wbs-browser-modal .wbs-tree-item { background: transparent !important; border-bottom-color: var(--hdr-border, #283652) !important; color: var(--cell-text, #edf1fa) !important; }
[data-theme-mode="dark"] .wbs-browser-modal .wbs-tree-item span { color: var(--cell-text, #edf1fa) !important; }
[data-theme-mode="dark"] .wbs-browser-modal .wbs-tree-item:hover { background: var(--row-hover-bg, #24314b) !important; }
[data-theme-mode="dark"] .wbs-browser-modal .wbs-tree-item.selected { background: #1e3a5f !important; }
[data-theme-mode="dark"] .wbs-browser-modal .wbs-tree-item span[style*="background"] { background: var(--panel-bg, #16243a) !important; color: var(--tb-color, #8995ae) !important; }

/* 29. Dashboard Upcoming-Work: export ▾ dropdown (inline + JS hover) + settings summary divider. */
[data-theme-mode="dark"] #export-dropdown-menu { background: var(--popover-bg, #1d2a42) !important; border-color: var(--popover-border, #283652) !important; color: var(--popover-text, #dbe2f0) !important; }
[data-theme-mode="dark"] #export-dropdown-menu .export-dropdown-item { color: var(--popover-text, #dbe2f0) !important; border-bottom-color: var(--popover-border, #283652) !important; background: transparent !important; }
[data-theme-mode="dark"] #export-dropdown-menu .export-dropdown-item:hover { background: var(--popover-hover, #24314b) !important; }
[data-theme-mode="dark"] .upcoming-work-summary { border-bottom-color: var(--hdr-border, #283652); }

/* ───────────────────────────────────────────────────────────────────────────
   30. Add-Field cell chips + boolean glyph (generic-grid _ensureDynamicCellStyles) —
   merged from the various-issues grid work (2026-06-24). Light keeps the injected
   pastel (#e0e7ff/#3730a3); Dark uses a darkened indigo fill + light text so multiselect
   chips don't glow on the dark grid. Kept on the slug marker [data-theme="dark"] as
   authored (the built-in dark theme sets it); a follow-up could migrate to
   [data-theme-mode] for custom-dark-theme coverage.
   ─────────────────────────────────────────────────────────────────────────── */
[data-theme="dark"] .excel-grid-table td .egb-chip { background: #312e81 !important; color: #c7d2fe !important; }
[data-theme="dark"] .excel-grid-table td .egb-bool-glyph { color: #cbd5e1 !important; }

/* ───────────────────────────────────────────────────────────────────────────
   31. Add-Field picker (Airtable-style "+ Add Field") — dark overrides for
   add-field-picker.css, merged from the various-issues grid work (2026-06-24). NO large
   bright fills (MEMORY feedback_dark_mode_no_bright_fills): deep/muted palette + light
   text + a muted blue accent only on the small primary button + focus rings.
   ─────────────────────────────────────────────────────────────────────────── */
[data-theme="dark"] .afp-popover { background: #16243a !important; color: #edf1fa !important; border-color: #283652 !important; box-shadow: 0 18px 50px rgba(0,0,0,.55) !important; }
[data-theme="dark"] .afp-head { border-bottom-color: #283652 !important; }
[data-theme="dark"] .afp-title { color: #edf1fa !important; }
[data-theme="dark"] .afp-sub { color: #8995ae !important; }
[data-theme="dark"] .afp-search { background: #1f2c46 !important; color: #edf1fa !important; border-color: #283652 !important; }
[data-theme="dark"] .afp-search:focus { background: #1d2a42 !important; border-color: #1199fc !important; }
[data-theme="dark"] .afp-search::placeholder { color: #8995ae !important; }
[data-theme="dark"] .afp-group-label { color: #8995ae !important; }
[data-theme="dark"] .afp-item:hover { background: #1d2a42 !important; }
[data-theme="dark"] .afp-item.afp-active { background: #16334d !important; }
[data-theme="dark"] .afp-item-icon { background: #1f2c46 !important; color: #cdd5e6 !important; }
[data-theme="dark"] .afp-item-label { color: #edf1fa !important; }
[data-theme="dark"] .afp-lock-hint { background: #1f2c46 !important; border-color: #283652 !important; color: #8995ae !important; }
[data-theme="dark"] .afp-empty { color: #8995ae !important; }
[data-theme="dark"] .afp-config-type { color: #edf1fa !important; }
[data-theme="dark"] .afp-back-btn { color: #8995ae !important; }
[data-theme="dark"] .afp-back-btn:hover { background: #1d2a42 !important; color: #edf1fa !important; }
[data-theme="dark"] .afp-label { color: #8995ae !important; }
[data-theme="dark"] .afp-input { background: #1f2c46 !important; color: #edf1fa !important; border-color: #283652 !important; }
[data-theme="dark"] .afp-input:focus { border-color: #1199fc !important; }
[data-theme="dark"] .afp-input.afp-invalid { border-color: #f87171 !important; }
[data-theme="dark"] .afp-err { color: #f4a4a4 !important; }
[data-theme="dark"] .afp-option-del { background: none !important; border-color: #283652 !important; color: #8995ae !important; }
[data-theme="dark"] .afp-option-del:hover { color: #f87171 !important; border-color: #5a2c30 !important; }
[data-theme="dark"] .afp-option-add { border-color: #283652 !important; color: #66bdff !important; }
[data-theme="dark"] .afp-option-add:hover { background: #16334d !important; }
[data-theme="dark"] .afp-footer { border-top-color: #283652 !important; }
[data-theme="dark"] .afp-btn { background: #1f2c46 !important; color: #edf1fa !important; border-color: #283652 !important; }
[data-theme="dark"] .afp-btn:hover { background: #24314b !important; }
[data-theme="dark"] .afp-primary { background: #1199fc !important; border-color: #1199fc !important; color: #04101f !important; }
[data-theme="dark"] .afp-primary:hover { background: #38aaff !important; }
[data-theme="dark"] .afp-primary:disabled { background: #243a57 !important; border-color: #243a57 !important; color: #6b7a96 !important; }
[data-theme="dark"] .gf-add-field { color: #8995ae !important; background: var(--hdr-bg, #16243a) !important; border-color: var(--hdr-border, #283652) !important; }
[data-theme="dark"] .gf-add-field:hover { background: #1d2a42 !important; color: #66bdff !important; }
/* Link step (Phase 2): target select + provisioning status (deep/muted, no large bright fills) */
[data-theme="dark"] select.afp-input { background: #1f2c46 !important; color: #edf1fa !important; }
[data-theme="dark"] .afp-prov-state { color: #edf1fa !important; }
[data-theme="dark"] .afp-prov-state.afp-prov-done { color: #5fd0a6 !important; }
[data-theme="dark"] .afp-prov-state.afp-prov-failed { color: #f4a4a4 !important; }
[data-theme="dark"] .afp-prov-note { color: #8995ae !important; }
[data-theme="dark"] .afp-spinner { border-color: #243a57 !important; border-top-color: #66bdff !important; }
/* Phase 5 polish: keyboard highlight, empty state, inline create-error banner, in-button spinner
   (deep/muted dark palette — no large bright fills; the error banner stays a deep red surface). */
[data-theme="dark"] .afp-item.afp-hl { background: #16334d !important; box-shadow: inset 0 0 0 1px #2f5170 !important; }
[data-theme="dark"] .afp-item.afp-hl.afp-locked { background: #1d2a42 !important; box-shadow: inset 0 0 0 1px #283652 !important; }
[data-theme="dark"] .afp-empty-state { color: #8995ae !important; }
[data-theme="dark"] .afp-empty-title { color: #cdd5e6 !important; }
[data-theme="dark"] .afp-empty-sub { color: #8995ae !important; }
[data-theme="dark"] .afp-form-err { background: #2a1416 !important; border-color: #5a2c30 !important; color: #f4a4a4 !important; }
[data-theme="dark"] .afp-create.afp-loading::after { border-color: rgba(4,16,31,.45) !important; border-top-color: #04101f !important; }
