/* =====================================================================
 * Dark mode legibility (30 Nov 2026).
 *
 * Deep green and navy are text colours made for white: on the dark
 * surfaces they measured 1.1 to 2.3 to 1. Everything that uses one as
 * text turns mint here. :where() keeps each rule exactly as strong as
 * the one it answers, so a class or state that sets its own still wins.
 * ===================================================================== */

:where(:root[data-theme="dark"]) a:where(:not(.lx *, .doc-sheet *, .invoice-sheet *)),
:where(:root[data-theme="dark"]) a:hover:where(:not(.lx *, .doc-sheet *, .invoice-sheet *)),
:where(:root[data-theme="dark"]) .notification-empty-icon,
:where(:root[data-theme="dark"]) .bulk-paste-summary,
:where(:root[data-theme="dark"]) .form-mode-banner.mint .form-mode-banner-title,
:where(:root[data-theme="dark"]) .how-step-title,
:where(:root[data-theme="dark"]) .attention-banner-dot,
:where(:root[data-theme="dark"]) .stat-modal-total,
:where(:root[data-theme="dark"]) .live-deals-committed-value,
:where(:root[data-theme="dark"]) .stock-card-committed-pct.stock-card-bar-mint,
:where(:root[data-theme="dark"]) .stock-card-committed-pct.stock-card-bar-deep,
:where(:root[data-theme="dark"]) .flash-notice::before,
:where(:root[data-theme="dark"]) .deal-link:hover,
:where(:root[data-theme="dark"]) .marketplace-tab.active,
:where(:root[data-theme="dark"]) .market-card-star:hover,
:where(:root[data-theme="dark"]) .market-card-star.active,
:where(:root[data-theme="dark"]) .market-card-ref,
:where(:root[data-theme="dark"]) .econ-cell:first-child .econ-value,
:where(:root[data-theme="dark"]) .market-card-potential strong,
:where(:root[data-theme="dark"]) .market-card-potential-pill strong,
:where(:root[data-theme="dark"]) .deal-modal-eyebrow-label .mono,
:where(:root[data-theme="dark"]) .deal-modal-ref,
:where(:root[data-theme="dark"]) .deal-scout-callout-title,
:where(:root[data-theme="dark"]) .deal-note-quote-label,
:where(:root[data-theme="dark"]) .deal-asin-link,
:where(:root[data-theme="dark"]) .listing-preview-ref,
:where(:root[data-theme="dark"]) .op-step.current .op-label,
:where(:root[data-theme="dark"]) .op-next strong,
:where(:root[data-theme="dark"]) .op-track-inline .op-step.current .op-label,
:where(:root[data-theme="dark"]) .range-credit-settled-title,
:where(:root[data-theme="dark"]) .kanban-col-metric-mint,
:where(:root[data-theme="dark"]) .pipeline-metrics-lens,
:where(:root[data-theme="dark"]) .pipeline-metric-mint,
:where(:root[data-theme="dark"]) .kanban-card-econ strong,
:where(:root[data-theme="dark"]) .trading-tab:hover,
:where(:root[data-theme="dark"]) .trading-figure-value,
:where(:root[data-theme="dark"]) .trading-booked-line strong,
:where(:root[data-theme="dark"]) .account-plan-name,
:where(:root[data-theme="dark"]) .account-upgrade-cta-title,
:where(:root[data-theme="dark"]) .account-upgrade-pending-title,
:where(:root[data-theme="dark"]) .dashboard-preview-hero-eyebrow,
:where(:root[data-theme="dark"]) .dashboard-preview-hero-headline,
:where(:root[data-theme="dark"]) .whats-next-allclear-icon,
:where(:root[data-theme="dark"]) .dashboard-opportunity-glyph,
:where(:root[data-theme="dark"]) .dashboard-opportunity-value,
:where(:root[data-theme="dark"]) .dashboard-opportunity-cta,
:where(:root[data-theme="dark"]) .dashboard-sub-plan-name,
:where(:root[data-theme="dark"]) .performance-monthly-value,
:where(:root[data-theme="dark"]) .paperwork-intro-glyph,
:where(:root[data-theme="dark"]) .mkt-watch-star.has-items,
:where(:root[data-theme="dark"]) .mkt-console .category-pill-bell,
:where(:root[data-theme="dark"]) .mkt-want-line,
:where(:root[data-theme="dark"]) .mkt-want-line:hover,
:where(:root[data-theme="dark"]) .mkt-console .mkt-csv-link:hover,
:where(:root[data-theme="dark"]) .orders-console-clear:hover,
:where(:root[data-theme="dark"]) .refine-clear:hover,
:where(:root[data-theme="dark"]) .runway-steps li.done .runway-check::before,
:where(:root[data-theme="dark"]) .onb-title,
:where(:root[data-theme="dark"]) .onb-skip:hover,
:where(:root[data-theme="dark"]) .ta-econ-strong,
:where(:root[data-theme="dark"]) .ta-foot-mint,
:where(:root[data-theme="dark"]) .scout-coverage-eta,
:where(:root[data-theme="dark"]) .scout-range-was-up,
:where(:root[data-theme="dark"]) .scout-note-lbl,
:where(:root[data-theme="dark"]) .market-card-sheet,
:where(:root[data-theme="dark"]) .road-nav a:hover,
:where(:root[data-theme="dark"]) .road-kicker,
:where(:root[data-theme="dark"]) .road-action-title a:hover,
:where(:root[data-theme="dark"]) .explain-panel summary::before,
:where(:root[data-theme="dark"]) .verdict-cell.is-pass .verdict-value,
:where(:root[data-theme="dark"]) .guide-topic > summary::before,
:where(:root[data-theme="dark"]) .guide-topic[open] > summary,
:where(:root[data-theme="dark"]) .calc-optional > summary::after,
:where(:root[data-theme="dark"]) .hts-result-rate,
:where(:root[data-theme="dark"]) .gate-number {
  color: var(--mint);
}

/* Plain ink, not an accent. */
:where(:root[data-theme="dark"]) :is(.dashboard-sub-plan-name, .account-plan-name, .op-next strong, .trading-tab-active) { color: var(--ink); }

/* Colours typed on the element itself. */
:root[data-theme="dark"] :is(.view-root, dialog) :is([style*="color: var(--deep"], [style*="color:var(--deep"], [style*="color: var(--navy"], [style*="color: #1f3b34"], [style*="color: #1c2d35"]):not([style*="background"]) { color: var(--mint) !important; }
:root[data-theme="dark"] :is(.view-root, dialog) :is([style*="background: #f"], [style*="background:#f"], [style*="background: #e"], [style*="background:#e"]):not(iframe, .doc-sheet, .invoice-sheet) { background-color: var(--surface-2) !important; color: var(--ink); }
:root[data-theme="dark"] :is(.view-root, dialog) [style*="solid #e"] { border-color: var(--line) !important; }

/* Boxes filled in on a light tint. */
:root[data-theme="dark"] :is(.well-input, .well-select) { background-color: rgba(255, 255, 255, .05); }
:root[data-theme="dark"] .chip-counterparty { background: var(--surface-2); color: var(--ink-2); border-color: var(--line-2); }
:root[data-theme="dark"] .chip-portal { background: var(--gold-soft); color: #e3c47d; border-color: rgba(212, 175, 90, .4); }
:root[data-theme="dark"] :is(.duty-flag-warn, .duty-flag-danger, .sourcing-flag, .guide-note, .guide-worked) { background: var(--surface-2); color: var(--ink); }
:root[data-theme="dark"] :is(.duty-flag-warn, .duty-flag-danger, .sourcing-flag, .guide-note, .guide-worked) :is(strong, li, p, code) { color: inherit; background: none; }
:root[data-theme="dark"] :is(.ms-total-row, .fam-chip, .reserve-max-chip, .op-next) { background: var(--surface-2); color: var(--ink); }
:root[data-theme="dark"] .btn-outline { background: transparent; color: var(--ink); border-color: var(--line-2); }
:root[data-theme="dark"] .market-card-asin-link { background: none; color: var(--mint); }
:root[data-theme="dark"] :is(.prep-fold > summary, .market-card-stock-claimed, .reserve-on-table strong, .econ-value.profit span, .email-pref-saved-indicator, .origin-rate-record > summary) { color: var(--mint); }
:root[data-theme="dark"] .kanban-card-econ .econ-neg strong { color: #f08c86; }
:root[data-theme="dark"] .form-mode-banner.gold .form-mode-banner-title { color: #e3c47d; }
:root[data-theme="dark"] .view-root code { background: var(--surface-2); color: var(--ink); }
:root[data-theme="dark"] .lx-agent-item-title { color: var(--lx-ink); }
