/* ForeGlass (foreglass.ai) Secondary Dark Optical Glass Color Scheme
 * Loaded LAST in <head> across foreglass.ai pages so html[data-theme="dark"]
 * cleanly overrides legacy per-page light defaults while keeping Light (primary)
 * 100% untouched when data-theme is "light" or absent.
 */

/* Shared theme toggle button (visible in both Light & Dark header chrome) */
.fg-site-nav .fg-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 32px;
  padding: 0.28rem 0.62rem;
  margin-left: 0.25rem;
  border-radius: 999px;
  border: 1px solid #bfd4d8;
  background: #f3f9f9;
  color: #1e293b;
  font: 600 0.78rem/1 var(--font-sans, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}
.fg-site-nav .fg-theme-toggle:hover {
  background: #e2f2f0;
  border-color: #0f766e;
  color: #0f766e;
}
.fg-site-nav .fg-theme-toggle:focus-visible {
  outline: 2px solid #0f766e;
  outline-offset: 2px;
}
@media (min-width: 841px) and (max-width: 1480px) {
  .fg-site-nav .fg-theme-toggle {
    min-height: 28px;
    padding: 0.22rem 0.5rem;
    margin-left: 0.14rem;
    font-size: 0.72rem;
  }
}
@container fg-bar (max-width: 840px) {
  .fg-navmenu__checkbox:checked ~ .fg-site-nav > .fg-theme-toggle {
    width: 100%;
    min-height: 40px;
    margin: 0.35rem 0 0.1rem;
    font-size: 0.86rem;
  }
}

/* Light-mode code blocks (Option A — nuanced cool frosted slate matching comuvia.ai light) */
html:not([data-theme="dark"]) pre:not(.fg-sha-box__out),
html:not([data-theme="dark"]) pre.code,
html:not([data-theme="dark"]) .sdk-body pre {
  background: #eef4f6 !important;
  color: #132c38 !important;
  border: 1px solid #c9dde0 !important;
  border-left: 3px solid #0f766e !important;
  border-radius: 10px;
}
html:not([data-theme="dark"]) pre code,
html:not([data-theme="dark"]) .sdk-body pre code {
  background: transparent !important;
  color: inherit !important;
}

/* ══ SECONDARY DARK SCHEME (html[data-theme="dark"]) ═════════════════════════ */
html[data-theme="dark"] {
  --color-bg: #061629;
  --color-canvas-top: #07192f;
  --color-canvas-mid: #0a2340;
  --color-canvas-end: #051326;
  --color-surface: rgba(11, 34, 60, 0.80);
  --color-surface-alt: rgba(7, 25, 46, 0.84);
  --color-fg: #f4f8fc;
  --color-muted: #9eb7cf;
  --color-border: rgba(115, 178, 230, 0.26);
  --color-accent: #5eead4;
  --color-accent-bg: rgba(94, 234, 212, 0.14);
  --color-accent-2: #f4b95a;
  --color-accent-2-bg: rgba(244, 185, 90, 0.16);
  --env-chip-bg: rgba(244, 185, 90, 0.18);
  --fg-ink: #f4f8fc;
  --fg-muted: #b4cae0;
  --fg-teal: #5eead4;
  --fg-bg: #061629;
  --fg-border: rgba(115, 178, 230, 0.24);
  --ink: #f4f8fc;
  --muted: #b4cae0;
  --slate: #c6daec;
  --teal: #5eead4;
  --tealdeep: #8ff0e6;
  --soft: rgba(15, 118, 110, 0.22);
  --surface: rgba(11, 34, 60, 0.82);
  --surface2: rgba(7, 25, 46, 0.86);
  --surface3: rgba(5, 19, 36, 0.90);
  --line: rgba(115, 178, 230, 0.24);
  --line2: rgba(115, 178, 230, 0.16);
  --fc-ink: #f4f8fc;
  --fc-muted: #b4cae0;
  --fc-line: rgba(115, 178, 230, 0.24);
  --fc-teal: #5eead4;
  --fc-surface: rgba(11, 34, 60, 0.82);
  --chart-bg: rgba(5, 19, 36, 0.86);
  --chart-grid: rgba(148, 197, 235, 0.15);
  --chart-axis: #9eb7cf;
  --chart-ink: #e2eef9;
  --glass-bg: rgba(11, 34, 60, 0.78);
  --glass-border: rgba(115, 178, 230, 0.26);
  --glass-bevel: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 16px 38px rgba(2, 10, 22, 0.46);
  color-scheme: dark;
  background: #061629 !important;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(1100px 620px at 84% 10%, rgba(56, 189, 248, 0.11), transparent 62%),
    radial-gradient(960px 600px at 12% 86%, rgba(94, 234, 212, 0.08), transparent 60%),
    linear-gradient(180deg, #061629 0%, #0a2340 48%, #07192f 100%) !important;
  background-attachment: fixed !important;
  color: #f4f8fc !important;
}
html[data-theme="dark"] body::before {
  background:
    radial-gradient(1100px 620px at 84% 10%, rgba(56, 189, 248, 0.11), transparent 62%),
    radial-gradient(960px 600px at 12% 86%, rgba(94, 234, 212, 0.08), transparent 60%),
    linear-gradient(180deg, #061629 0%, #0a2340 48%, #07192f 100%) !important;
}

html[data-theme="dark"] a { color: #5eead4; }
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4 { color: #f4f8fc; }

/* ── Shared Navigation Chrome ─────────────────────────────────────────────── */
html[data-theme="dark"] header.fg-site-header,
html[data-theme="dark"] header.site-header,
html[data-theme="dark"] .fg-header {
  background: rgba(6, 22, 41, 0.90) !important;
  border-bottom-color: rgba(115, 178, 230, 0.24) !important;
  color: #f4f8fc !important;
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow: 0 4px 18px rgba(2, 10, 22, 0.45) !important;
}
html[data-theme="dark"] .fg-site-brand,
html[data-theme="dark"] .fg-brand { color: #f4f8fc !important; }
html[data-theme="dark"] .fg-site-brand img,
html[data-theme="dark"] .fg-brand img,
html[data-theme="dark"] .namenote img { filter: invert(1) brightness(1.15); }
html[data-theme="dark"] .fg-site-brand .fg-site-product,
html[data-theme="dark"] .fg-brand span { color: #5eead4 !important; }

html[data-theme="dark"] .fg-site-nav > a,
html[data-theme="dark"] .fg-menu > summary,
html[data-theme="dark"] .fg-mech-menu > summary,
html[data-theme="dark"] .fg-site-nav > .nav-dropdown > .nav-dropdown__trigger {
  color: #dce9f5 !important;
}
html[data-theme="dark"] .fg-site-nav > a:hover,
html[data-theme="dark"] .fg-menu > summary:hover,
html[data-theme="dark"] .fg-mech-menu > summary:hover,
html[data-theme="dark"] .fg-site-nav > .nav-dropdown:hover > .nav-dropdown__trigger {
  background: rgba(56, 189, 248, 0.14) !important;
  color: #5eead4 !important;
}
html[data-theme="dark"] .fg-site-nav > a[aria-current="page"],
html[data-theme="dark"] .fg-site-nav > a[aria-current="true"],
html[data-theme="dark"] .fg-menu.is-active > summary,
html[data-theme="dark"] .fg-mech-menu.is-active > summary,
html[data-theme="dark"] .fg-site-nav > .nav-dropdown.is-active > .nav-dropdown__trigger {
  background: rgba(94, 234, 212, 0.16) !important;
  color: #5eead4 !important;
  box-shadow: inset 0 -2px 0 #5eead4 !important;
}
html[data-theme="dark"] .fg-site-nav > .fg-evidence-menu:not(.is-active):not([open]) > summary {
  background: rgba(94, 234, 212, 0.10) !important;
  border-color: rgba(94, 234, 212, 0.34) !important;
  color: #5eead4 !important;
}
html[data-theme="dark"] .fg-site-nav > a[href="/open-data/"]::before,
html[data-theme="dark"] .fg-site-nav > .nav-dropdown::before {
  background: rgba(115, 178, 230, 0.28) !important;
}
html[data-theme="dark"] .fg-site-nav > a[href="https://comuvia.ai/contact"] {
  background: linear-gradient(135deg, #0369a1 0%, #0e7490 50%, #0f766e 100%) !important;
  border-color: rgba(94, 234, 212, 0.45) !important;
  color: #ffffff !important;
}
html[data-theme="dark"] .fg-menu nav,
html[data-theme="dark"] .fg-mech-menu__panel,
html[data-theme="dark"] .nav-dropdown__menu {
  background: rgba(8, 26, 48, 0.96) !important;
  border-color: rgba(115, 178, 230, 0.32) !important;
  border-top-color: #5eead4 !important;
  box-shadow: 0 16px 36px rgba(2, 10, 22, 0.65) !important;
}
html[data-theme="dark"] .fg-menu nav a,
html[data-theme="dark"] .fg-mech-menu__panel a,
html[data-theme="dark"] .nav-dropdown__menu a {
  color: #dce9f5 !important;
}
html[data-theme="dark"] .fg-menu nav a:hover,
html[data-theme="dark"] .fg-mech-menu__panel a:hover,
html[data-theme="dark"] .nav-dropdown__menu a:hover {
  background: rgba(56, 189, 248, 0.16) !important;
  color: #5eead4 !important;
}
html[data-theme="dark"] .fg-menu nav a[aria-current="page"],
html[data-theme="dark"] .fg-mech-menu__panel a[aria-current="page"] {
  background: rgba(94, 234, 212, 0.16) !important;
  color: #5eead4 !important;
  box-shadow: inset 3px 0 0 #5eead4 !important;
}
html[data-theme="dark"] .fg-site-nav .fg-theme-toggle {
  background: rgba(15, 42, 74, 0.85);
  border-color: rgba(94, 234, 212, 0.42);
  color: #5eead4;
}
html[data-theme="dark"] .fg-site-nav .fg-theme-toggle:hover {
  background: rgba(94, 234, 212, 0.18);
  color: #ffffff;
}
html[data-theme="dark"] .fg-topic-nav a {
  background: rgba(11, 34, 60, 0.82) !important;
  border-color: rgba(115, 178, 230, 0.28) !important;
  color: #c6daec !important;
}
html[data-theme="dark"] .fg-topic-nav a[aria-current="page"] {
  background: rgba(94, 234, 212, 0.18) !important;
  border-color: #5eead4 !important;
  color: #5eead4 !important;
}
html[data-theme="dark"] .fg-topic-nav a.fg-mech-pair-link,
html[data-theme="dark"] .fg-mech-pair-banner a.fg-mech-pair-link {
  background: rgba(244, 185, 90, 0.16) !important;
  border-color: rgba(244, 185, 90, 0.48) !important;
  color: #f4b95a !important;
}
html[data-theme="dark"] .fg-navmenu__toggle {
  border-color: rgba(115, 178, 230, 0.34) !important;
  background: rgba(11, 34, 60, 0.86) !important;
}
html[data-theme="dark"] .fg-navmenu__bars,
html[data-theme="dark"] .fg-navmenu__bars::before,
html[data-theme="dark"] .fg-navmenu__bars::after {
  background: #f4f8fc !important;
}
html[data-theme="dark"] .fg-site-nav > a[href="/concept"],
html[data-theme="dark"] .fg-site-nav > a:has(.hid),
html[data-theme="dark"] .fg-site-nav > .nav-dropdown > a.nav-dropdown__trigger[href="/concept"],
html[data-theme="dark"] .fg-site-nav > .nav-dropdown > a.nav-dropdown__trigger:has(.hid) {
  background: rgba(244, 185, 90, 0.16) !important;
  border-color: rgba(244, 185, 90, 0.55) !important;
  color: #f4b95a !important;
}
@container fg-bar (max-width: 840px) {
  html[data-theme="dark"] .fg-site-header .fg-navmenu__checkbox:checked ~ .fg-site-nav,
  html[data-theme="dark"] .fg-navmenu__checkbox:checked ~ .fg-site-nav {
    background: rgba(6, 22, 41, 0.97) !important;
    border-color: rgba(115, 178, 230, 0.36) !important;
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    box-shadow: 0 18px 42px rgba(2, 10, 22, 0.74) !important;
  }
  html[data-theme="dark"] .fg-navmenu__checkbox:checked ~ .fg-site-nav > a[href="/open-data/"],
  html[data-theme="dark"] .fg-navmenu__checkbox:checked ~ .fg-site-nav > .nav-dropdown {
    border-top-color: rgba(115, 178, 230, 0.22) !important;
  }
  html[data-theme="dark"] .fg-navmenu__checkbox:checked ~ .fg-site-nav > .nav-dropdown > .nav-dropdown__menu,
  html[data-theme="dark"] .fg-navmenu__checkbox:checked ~ .fg-site-nav > .fg-menu nav,
  html[data-theme="dark"] .fg-navmenu__checkbox:checked ~ .fg-site-nav > .fg-mech-menu > .fg-mech-menu__panel {
    background: transparent !important;
    border-left-color: rgba(94, 234, 212, 0.32) !important;
  }
}

/* ── Optical Glass Cards, Text Blocks & Top Gradient Borders (non-radar) ──── */
html[data-theme="dark"]:not(.fg-radar-page) .card,
html[data-theme="dark"] .fg-card,
html[data-theme="dark"] .fg-assessment,
html[data-theme="dark"] .fg-ladder,
html[data-theme="dark"] .fg-sha-box,
html[data-theme="dark"] .ledgerwrap,
html[data-theme="dark"] .statrow,
html[data-theme="dark"] .hometile,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .result-section,
html[data-theme="dark"] .od-explorer,
html[data-theme="dark"] .doc-card,
html[data-theme="dark"] .mechanism-card,
html[data-theme="dark"] .callout,
html[data-theme="dark"] .tier-card,
html[data-theme="dark"] .plan-card,
html[data-theme="dark"] .comparison-card,
html[data-theme="dark"] .faq-item,
html[data-theme="dark"] .fg-detail-card,
html[data-theme="dark"] .detail-card,
html[data-theme="dark"] .namenote,
html[data-theme="dark"] .fg-start-card,
html[data-theme="dark"] .fg-learn-feature,
html[data-theme="dark"] .fg-learn-card,
html[data-theme="dark"] .fg-film,
html[data-theme="dark"] .fg-wis-lab,
html[data-theme="dark"] .fg-wis-card,
html[data-theme="dark"] .fg-section,
html[data-theme="dark"] .fg-ledger-block,
html[data-theme="dark"] .fg-case-card,
html[data-theme="dark"] .fg-link-card,
html[data-theme="dark"] .fg-kpi-card,
html[data-theme="dark"] .fg-framing-banner,
html[data-theme="dark"] .fg-workspace-grid .fg-workspace-panel,
html[data-theme="dark"] .dc-pair-card,
html[data-theme="dark"] .dc-review,
html[data-theme="dark"] .hv-panel,
html[data-theme="dark"] .fc-chart-card,
html[data-theme="dark"] .fc-question,
html[data-theme="dark"] .fc-cohort-banner,
html[data-theme="dark"] .fc-candidates article,
html[data-theme="dark"] .cite-box,
html[data-theme="dark"] .chart-frame {
  background:
    linear-gradient(90deg, #0ea5e9 0%, #06b6d4 32%, #2dd4bf 58%, #fbbf24 100%) top / 100% 3px no-repeat,
    rgba(11, 34, 60, 0.82) !important;
  background-origin: padding-box !important;
  background-clip: padding-box !important;
  border: 1px solid rgba(115, 178, 230, 0.25) !important;
  border-top-width: 1px !important;
  color: #e6f0fa !important;
  backdrop-filter: blur(12px) saturate(135%);
  -webkit-backdrop-filter: blur(12px) saturate(135%);
  box-shadow: 0 14px 34px rgba(2, 10, 22, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.10) !important;
}
html[data-theme="dark"]:not(.fg-radar-page) .card,
html[data-theme="dark"] .fg-card,
html[data-theme="dark"] .fg-start-card,
html[data-theme="dark"] .fg-learn-feature,
html[data-theme="dark"] .fg-learn-card,
html[data-theme="dark"] .fg-film,
html[data-theme="dark"] .fg-section,
html[data-theme="dark"] .fg-workspace-grid .fg-workspace-panel,
html[data-theme="dark"] .fc-chart-card,
html[data-theme="dark"] .fc-question,
html[data-theme="dark"] .fc-cohort-banner {
  overflow: hidden;
}
html[data-theme="dark"] .fg-learn-feature {
  border-left: 3px solid #2dd4bf !important;
}
html[data-theme="dark"] .fg-film {
  border-left: 3px solid #2dd4bf !important;
}
html[data-theme="dark"]:not(.fg-radar-page) main > section:not(.fg-start-paths):not(.fg-learn-track):not(.ve-panel):not(.fg-assessment):not(.fg-ladder):not(.fg-model-link):not(.fg-support):not(.fg-ahead):not(.panel):not(.fg-section):not(.hero):not(#datasets):not(.od-explorer):not(.od-table-panel):not(.demand-banner):not(:has(> article.card)) {
  background:
    linear-gradient(90deg, #0ea5e9 0%, #06b6d4 32%, #2dd4bf 58%, #fbbf24 100%) top / 100% 3px no-repeat,
    rgba(11, 34, 60, 0.82) !important;
  background-origin: padding-box !important;
  background-clip: padding-box !important;
  border-color: rgba(115, 178, 230, 0.25) !important;
  color: #e6f0fa !important;
}
html[data-theme="dark"] .fg-start-paths,
html[data-theme="dark"] .fg-learn-track,
html[data-theme="dark"] main > section.hero,
html[data-theme="dark"] main > section#datasets {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .card--featured,
html[data-theme="dark"] .fg-wis-card.is-best {
  border-color: rgba(94, 234, 212, 0.52) !important;
}
html[data-theme="dark"] .fg-rung,
html[data-theme="dark"] .stat-tile,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .tool-card,
html[data-theme="dark"] .fg-sha-box__out,
html[data-theme="dark"] .fg-own-scale-row,
html[data-theme="dark"] .fg-model-link,
html[data-theme="dark"] .phase-toolbar,
html[data-theme="dark"] .phase-scrubber,
html[data-theme="dark"] .diagram-readout,
html[data-theme="dark"] .diagram-events-key,
html[data-theme="dark"] .diagram-event-pill,
html[data-theme="dark"] .js-phase-stage,
html[data-theme="dark"] .od-table-wrap,
html[data-theme="dark"] .od-empty,
html[data-theme="dark"] .result-metrics > div,
html[data-theme="dark"] .fg-film-companions,
html[data-theme="dark"] .fg-wis-controls,
html[data-theme="dark"] .fg-wis-formula,
html[data-theme="dark"] .fg-seq-nav,
html[data-theme="dark"] .fg-boundary-box,
html[data-theme="dark"] .fg-boundary-box--limits,
html[data-theme="dark"] .fg-takeaway,
html[data-theme="dark"] .fg-details,
html[data-theme="dark"] .fg-diag-box,
html[data-theme="dark"] .fg-diag-list li,
html[data-theme="dark"] .fg-step-controls,
html[data-theme="dark"] .fg-step-fig,
html[data-theme="dark"] .fg-wide-fig,
html[data-theme="dark"] .fg-substep-bar,
html[data-theme="dark"] .fg-ref-list li,
html[data-theme="dark"] .concept,
html[data-theme="dark"] .anchor,
html[data-theme="dark"] .chain li,
html[data-theme="dark"] .formula,
html[data-theme="dark"] .macro-flow article,
html[data-theme="dark"] .reading-rules article,
html[data-theme="dark"] .network-node,
html[data-theme="dark"] .keen-metrics article,
html[data-theme="dark"] .macro-chart-native,
html[data-theme="dark"] .synthetic-chart,
html[data-theme="dark"] .status,
html[data-theme="dark"] .chart-caveat,
html[data-theme="dark"] .chart-zone-caption,
html[data-theme="dark"] .readout,
html[data-theme="dark"] .refusal,
html[data-theme="dark"] .fg-workspace-sidebar,
html[data-theme="dark"] .fg-workspace-toolbar,
html[data-theme="dark"] .fg-workspace-empty,
html[data-theme="dark"] .history-controls,
html[data-theme="dark"] .dc-chart,
html[data-theme="dark"] .dc-fold,
html[data-theme="dark"] .dc-note-box,
html[data-theme="dark"] .dc-stat,
html[data-theme="dark"] .dc-table-wrap,
html[data-theme="dark"] fieldset.dc-controls,
html[data-theme="dark"] .dc-controls,
html[data-theme="dark"] .pc-chart,
html[data-theme="dark"] .pc-desk-bridge,
html[data-theme="dark"] .pc-lineage,
html[data-theme="dark"] .pc-notice,
html[data-theme="dark"] .exp-controls,
html[data-theme="dark"] .exp-details,
html[data-theme="dark"] .exp-disclosure,
html[data-theme="dark"] .exp-figure,
html[data-theme="dark"] .exp-kpi,
html[data-theme="dark"] .exp-lineage,
html[data-theme="dark"] .exp-note,
html[data-theme="dark"] #daily-keen-readout,
html[data-theme="dark"] #market-outlook-status,
html[data-theme="dark"] .timeline-readout,
html[data-theme="dark"] .keen-axis-explanation,
html[data-theme="dark"] .detail-evidence .ve-reading,
html[data-theme="dark"] .detail-retained,
html[data-theme="dark"] .hv-unavailable,
html[data-theme="dark"] .vulnerability-evidence .ve-history-readout,
html[data-theme="dark"] .vulnerability-evidence .ve-use,
html[data-theme="dark"] .vulnerability-evidence .ve-withheld,
html[data-theme="dark"] .fc-agreement,
html[data-theme="dark"] .fc-boundary,
html[data-theme="dark"] .fc-scoring,
html[data-theme="dark"] .fc-state,
html[data-theme="dark"] .fc-table-scroll,
html[data-theme="dark"] .fc-unavailable,
html[data-theme="dark"] .fc-upcoming,
html[data-theme="dark"] .fc-group-members li,
html[data-theme="dark"] .fragility-detail .ve-controls {
  background: rgba(7, 25, 46, 0.86) !important;
  border-color: rgba(115, 178, 230, 0.24) !important;
  color: #dce9f5 !important;
}
html[data-theme="dark"] .fg-boundary-box--limits {
  border-left: 3px solid #f4b95a !important;
}
html[data-theme="dark"] .fg-takeaway {
  border-left: 3px solid #2dd4bf !important;
}
html[data-theme="dark"] .result {
  background: rgba(7, 25, 46, 0.88) !important;
  border: 1px solid rgba(94, 234, 212, 0.30) !important;
  border-left: 3px solid #2dd4bf !important;
  color: #e6f0fa !important;
}
html[data-theme="dark"] .chart-caveat {
  background: rgba(244, 185, 90, 0.14) !important;
  border-left: 3px solid #f4b95a !important;
  color: #f4b95a !important;
}
html[data-theme="dark"] .chart-zone-caption {
  background: rgba(7, 25, 46, 0.86) !important;
  border-left: 3px solid #2dd4bf !important;
  color: #c6daec !important;
}
html[data-theme="dark"] .chart-unit,
html[data-theme="dark"] .stress-caption,
html[data-theme="dark"] .fg-workspace-hint,
html[data-theme="dark"] .fg-workspace-status,
html[data-theme="dark"] .js-phase-hint {
  color: #b4cae0 !important;
}
html[data-theme="dark"] .fg-workspace-sidebar summary,
html[data-theme="dark"] .macro-chart summary,
html[data-theme="dark"] .assumptions summary,
html[data-theme="dark"] .anchor strong {
  color: #5eead4 !important;
}
html[data-theme="dark"] .network-arrow {
  color: #f4b95a !important;
  border-top-color: rgba(115, 178, 230, 0.28) !important;
}
html[data-theme="dark"] .fg-workspace-sidebar button,
html[data-theme="dark"] .fg-workspace-toolbar button {
  background: rgba(11, 34, 60, 0.90) !important;
  border-color: rgba(115, 178, 230, 0.34) !important;
  color: #dce9f5 !important;
}
html[data-theme="dark"] .fg-workspace-sidebar button:hover,
html[data-theme="dark"] .fg-workspace-toolbar button:hover {
  background: rgba(56, 189, 248, 0.16) !important;
  border-color: #5eead4 !important;
  color: #ffffff !important;
}
html[data-theme="dark"] .fg-workspace-column-options button[aria-pressed="true"] {
  background: linear-gradient(135deg, #073b5c 0%, #0b5a6e 52%, #0c6b64 100%) !important;
  border-color: rgba(94, 234, 212, 0.55) !important;
  color: #ffffff !important;
}
html[data-theme="dark"] .fg-rung--desk {
  background: rgba(15, 118, 110, 0.22) !important;
  border-color: rgba(94, 234, 212, 0.50) !important;
}

/* ── Learn, Accounting, Mechanism & Comparison Dark Text, Pills & Controls ── */
html[data-theme="dark"] .fg-start-card p,
html[data-theme="dark"] .fg-learn-track-head p,
html[data-theme="dark"] .fg-learn-feature p,
html[data-theme="dark"] .fg-learn-card p,
html[data-theme="dark"] .fg-section p,
html[data-theme="dark"] .fg-section li,
html[data-theme="dark"] .fg-intro p,
html[data-theme="dark"] .fg-lesson-lead,
html[data-theme="dark"] .fg-wide-fig figcaption,
html[data-theme="dark"] .fc-score dd,
html[data-theme="dark"] .fc-reasons li > span,
html[data-theme="dark"] .fc-list-label,
html[data-theme="dark"] main.legal p,
html[data-theme="dark"] main.legal li {
  color: #c6daec !important;
}
html[data-theme="dark"] .fg-learn-feature h3 a,
html[data-theme="dark"] .fg-learn-card h3 a,
html[data-theme="dark"] .fg-start-card h2,
html[data-theme="dark"] .fg-film h2,
html[data-theme="dark"] .fg-step-fig strong {
  color: #f4f8fc !important;
}
html[data-theme="dark"] .fg-start-step,
html[data-theme="dark"] .fg-film-companions strong,
html[data-theme="dark"] .fg-diag-list strong,
html[data-theme="dark"] .fg-step-fig span,
html[data-theme="dark"] .fc-cohort-banner strong,
html[data-theme="dark"] .fc-group-details summary,
html[data-theme="dark"] .fc-question details summary {
  color: #5eead4 !important;
}
html[data-theme="dark"] .fc-sections a {
  color: #b4cae0 !important;
}
html[data-theme="dark"] .fc-sections a.fc-active,
html[data-theme="dark"] .fc-sections a:hover {
  color: #5eead4 !important;
  border-bottom-color: #5eead4 !important;
}
html[data-theme="dark"] .tier__badge {
  background: linear-gradient(135deg, #073b5c 0%, #0b5a6e 52%, #0c6b64 100%) !important;
  border: 1px solid rgba(94, 234, 212, 0.50) !important;
  color: #ffffff !important;
}
html[data-theme="dark"] .fg-start-card--2 .fg-start-step { color: #7dd3fc !important; }
html[data-theme="dark"] .fg-start-card--3 .fg-start-step { color: #f4b95a !important; }
html[data-theme="dark"] .fg-start-links,
html[data-theme="dark"] .fg-learn-card-foot,
html[data-theme="dark"] .fg-learn-feature-side {
  border-color: rgba(115, 178, 230, 0.20) !important;
}
html[data-theme="dark"] .fg-learn-card-foot .fg-json-link { color: #9eb7cf !important; }
html[data-theme="dark"] .fg-learn-jump a,
html[data-theme="dark"] .fg-jump a,
html[data-theme="dark"] .fg-step-btn,
html[data-theme="dark"] .fg-substep-btn,
html[data-theme="dark"] .fg-wis-btn,
html[data-theme="dark"] .fg-workspace-panel-actions button,
html[data-theme="dark"] .vulnerability-evidence button[data-ve-choice],
html[data-theme="dark"] .keen-gdp-range,
html[data-theme="dark"] .usd-zone-toggle,
html[data-theme="dark"] .fc-controls button,
html[data-theme="dark"] .fc-state button,
html[data-theme="dark"] .fragility-detail .detail-related nav a {
  background: rgba(11, 34, 60, 0.86) !important;
  border-color: rgba(115, 178, 230, 0.30) !important;
  color: #dce9f5 !important;
}
html[data-theme="dark"] .fg-learn-jump a:hover,
html[data-theme="dark"] .fg-jump a:hover,
html[data-theme="dark"] .fg-step-btn:hover,
html[data-theme="dark"] .fg-substep-btn:hover,
html[data-theme="dark"] .fg-wis-btn:hover,
html[data-theme="dark"] .fg-step-btn[aria-pressed="true"],
html[data-theme="dark"] .fg-substep-btn[aria-pressed="true"],
html[data-theme="dark"] .fg-workspace-panel-actions button[aria-pressed="true"],
html[data-theme="dark"] .vulnerability-evidence button[data-ve-choice][aria-pressed="true"],
html[data-theme="dark"] .keen-gdp-range.on,
html[data-theme="dark"] .fc-controls button:hover,
html[data-theme="dark"] .fc-state button:hover,
html[data-theme="dark"] .fragility-detail .detail-related nav a[aria-current="page"] {
  background: rgba(94, 234, 212, 0.18) !important;
  border-color: #5eead4 !important;
  color: #ffffff !important;
}
html[data-theme="dark"] .fg-format-pill,
html[data-theme="dark"] .fg-wis-badge,
html[data-theme="dark"] .fg-identity-chip,
html[data-theme="dark"] .fg-pill--bond,
html[data-theme="dark"] .fg-pill--deposit,
html[data-theme="dark"] .fg-pill--reserve,
html[data-theme="dark"] .fg-pill--tga,
html[data-theme="dark"] .exp-badge,
html[data-theme="dark"] .dc-badge-kind,
html[data-theme="dark"] .fc-chip,
html[data-theme="dark"] .fc-count {
  background: rgba(15, 42, 74, 0.88) !important;
  border-color: rgba(115, 178, 230, 0.32) !important;
  color: #7dd3fc !important;
}
html[data-theme="dark"] .fg-acct-table tbody tr { background: transparent !important; }
html[data-theme="dark"] .fg-acct-row--highlight,
html[data-theme="dark"] .history-table tr.is-selected {
  background: rgba(56, 189, 248, 0.14) !important;
}
html[data-theme="dark"] .history-table tbody tr:nth-child(even) {
  background: rgba(7, 25, 46, 0.45) !important;
}
html[data-theme="dark"] table tbody tr:hover,
html[data-theme="dark"] table.od-index-table tr:hover td {
  background: rgba(56, 189, 248, 0.10) !important;
}
html[data-theme="dark"] .bar-track,
html[data-theme="dark"] .fc-bar-track,
html[data-theme="dark"] .vulnerability-evidence .ve-bar-track {
  background: rgba(15, 42, 74, 0.90) !important;
  border-color: rgba(115, 178, 230, 0.28) !important;
}
html[data-theme="dark"] caption {
  background: rgba(7, 25, 46, 0.72) !important;
  color: #9eb7cf !important;
}

/* ── Text, Muted Copy, Badges, Pills & Buttons ────────────────────────────── */
html[data-theme="dark"] .sub,
html[data-theme="dark"] .lede,
html[data-theme="dark"] .sectionlede,
html[data-theme="dark"] .meta-line,
html[data-theme="dark"] .diagram-caption,
html[data-theme="dark"] .overview-details,
html[data-theme="dark"] .overview-context,
html[data-theme="dark"] .overview-note,
html[data-theme="dark"] .ledger-question-meta,
html[data-theme="dark"] .ledger-foot,
html[data-theme="dark"] .stat span,
html[data-theme="dark"] .stat-tile span,
html[data-theme="dark"] .fg-caption,
html[data-theme="dark"] .fg-period,
html[data-theme="dark"] .fg-footer,
html[data-theme="dark"] .tile-period,
html[data-theme="dark"] .tile-desc,
html[data-theme="dark"] .masthead figcaption {
  color: #9eb7cf !important;
}
html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .fg-rung__step,
html[data-theme="dark"] .stat b,
html[data-theme="dark"] .stat-tile strong,
html[data-theme="dark"] .phase-scrubber__q {
  color: #5eead4 !important;
}
html[data-theme="dark"] .pill,
html[data-theme="dark"] .chip,
html[data-theme="dark"] .fg-badge,
html[data-theme="dark"] .tile-kind {
  background: rgba(94, 234, 212, 0.14) !important;
  color: #5eead4 !important;
  border-color: rgba(94, 234, 212, 0.34) !important;
}
html[data-theme="dark"] .pill--amber,
html[data-theme="dark"] .fg-conditional,
html[data-theme="dark"] #home-tiles .regime-chip,
html[data-theme="dark"] .home-radar-badge {
  background: rgba(244, 185, 90, 0.16) !important;
  color: #f4b95a !important;
  border-color: rgba(244, 185, 90, 0.44) !important;
}
html[data-theme="dark"] .home-radar-stage {
  border-color: rgba(115, 178, 230, 0.28) !important;
  background:
    radial-gradient(460px 280px at 82% 16%, rgba(56, 189, 248, 0.14), transparent 62%),
    radial-gradient(420px 260px at 14% 86%, rgba(94, 234, 212, 0.10), transparent 62%),
    linear-gradient(180deg, #061629 0%, #09203b 100%) !important;
}
html[data-theme="dark"] .fg-withheld {
  background: rgba(251, 113, 133, 0.18) !important;
  color: #fb7185 !important;
}

html[data-theme="dark"] .btn--ghost,
html[data-theme="dark"] .cta--secondary,
html[data-theme="dark"] .home-range,
html[data-theme="dark"] .phase-btn,
html[data-theme="dark"] .od-tab,
html[data-theme="dark"] .fg-toolbar button,
html[data-theme="dark"] .fg-zone-toggle {
  background: rgba(7, 25, 46, 0.86) !important;
  border-color: rgba(115, 178, 230, 0.34) !important;
  color: #dce9f5 !important;
}
html[data-theme="dark"] .home-range[aria-pressed="true"],
html[data-theme="dark"] .phase-btn.is-active,
html[data-theme="dark"] .od-tab.is-active,
html[data-theme="dark"] .fg-toolbar button[aria-pressed="true"] {
  background: rgba(94, 234, 212, 0.20) !important;
  border-color: #5eead4 !important;
  color: #ffffff !important;
}
html[data-theme="dark"] .cta--secondary {
  border-color: rgba(244, 185, 90, 0.58) !important;
  color: #f4b95a !important;
}

/* ── Tables, Inputs, Code & Scale Strips ──────────────────────────────────── */
html[data-theme="dark"] table th {
  background: rgba(7, 25, 46, 0.90) !important;
  color: #5eead4 !important;
  border-color: rgba(115, 178, 230, 0.24) !important;
}
html[data-theme="dark"] table td {
  border-color: rgba(115, 178, 230, 0.16) !important;
  color: #dce9f5;
}
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: rgba(6, 22, 41, 0.90) !important;
  border-color: rgba(115, 178, 230, 0.34) !important;
  color: #f4f8fc !important;
}
html[data-theme="dark"] code {
  background: rgba(7, 25, 46, 0.86) !important;
  color: #7dd3fc !important;
  border-color: rgba(115, 178, 230, 0.22);
}
html[data-theme="dark"] pre {
  background: rgba(4, 15, 29, 0.94) !important;
  border: 1px solid rgba(115, 178, 230, 0.24);
  color: #e2eef9 !important;
}
html[data-theme="dark"] pre code { background: transparent !important; color: inherit !important; }

html[data-theme="dark"] .fg-scale-track {
  background: rgba(15, 40, 70, 0.88) !important;
  border-color: rgba(115, 178, 230, 0.30) !important;
}
html[data-theme="dark"] .fg-scale-ticks,
html[data-theme="dark"] .fg-scale-lbl { color: #c6daec !important; }
html[data-theme="dark"] .fg-scale-pin-dot { background: #ffffff !important; border-color: #061629 !important; }
html[data-theme="dark"] .fg-scale-pin-tri { border-bottom-color: #ffffff !important; }

/* ── Film Rail, Lightbox & Glossary Popups ────────────────────────────────── */
html[data-theme="dark"] .fg-film-rail,
html[data-theme="dark"] aside.fg-film-rail,
html[data-theme="dark"] .fg-rail-card,
html[data-theme="dark"] .fg-glossary-pop {
  background: rgba(6, 22, 41, 0.96) !important;
  border-color: rgba(115, 178, 230, 0.26) !important;
  color: #dce9f5 !important;
}
html[data-theme="dark"] .fg-film-rail__head {
  background: rgba(7, 25, 46, 0.96) !important;
  border-bottom-color: rgba(115, 178, 230, 0.24) !important;
}
html[data-theme="dark"] .fg-film-rail__item,
html[data-theme="dark"] .fg-lightbox__box {
  background: rgba(11, 34, 60, 0.86) !important;
  border-color: rgba(115, 178, 230, 0.24) !important;
  color: #dce9f5 !important;
}
html[data-theme="dark"] .fg-film-rail__item h3,
html[data-theme="dark"] .fg-film h2,
html[data-theme="dark"] .fg-lightbox__head strong {
  color: #f4f8fc !important;
}
html[data-theme="dark"] .fg-film-rail__item p,
html[data-theme="dark"] .fg-film-rail__note,
html[data-theme="dark"] .fg-film p,
html[data-theme="dark"] .fg-film__note {
  color: #9eb7cf !important;
}
html[data-theme="dark"] .fg-film-rail__tab {
  background: rgba(8, 26, 48, 0.96) !important;
  border-color: rgba(94, 234, 212, 0.45) !important;
  color: #5eead4 !important;
}
html[data-theme="dark"] .fg-film-rail button,
html[data-theme="dark"] .fg-film-rail a.fg-rail-btn {
  background: rgba(15, 42, 74, 0.85) !important;
  border-color: rgba(115, 178, 230, 0.34) !important;
  color: #5eead4 !important;
}

/* ── Verification Explorer Tabs, Filters & Badges ─────────────────────────── */
html[data-theme="dark"] .ve-wrap div.ve-tabs[role="tablist"] {
  background: rgba(7, 25, 46, 0.88) !important;
  border-color: rgba(115, 178, 230, 0.28) !important;
  box-shadow: 0 10px 26px rgba(2, 10, 22, 0.45) !important;
}
html[data-theme="dark"] .ve-wrap div.ve-tabs[role="tablist"] > button.ve-tab[role="tab"] {
  color: #c6daec !important;
}
html[data-theme="dark"] .ve-wrap div.ve-tabs[role="tablist"] > button.ve-tab[role="tab"]:hover {
  background: rgba(56, 189, 248, 0.14) !important;
  border-color: rgba(94, 234, 212, 0.32) !important;
  color: #5eead4 !important;
}
html[data-theme="dark"] .ve-wrap div.ve-tabs[role="tablist"] > button.ve-tab[role="tab"][aria-selected="true"] {
  background: linear-gradient(135deg, #0369a1 0%, #0e7490 50%, #0f766e 100%) !important;
  border-color: rgba(94, 234, 212, 0.48) !important;
  color: #ffffff !important;
}
html[data-theme="dark"] .ve-tab__badge {
  background: rgba(15, 42, 74, 0.90) !important;
  border-color: rgba(115, 178, 230, 0.32) !important;
  color: #c6daec !important;
}
html[data-theme="dark"] .ve-tab__badge--highlight {
  background: rgba(244, 185, 90, 0.20) !important;
  border-color: rgba(244, 185, 90, 0.48) !important;
  color: #f4b95a !important;
}
html[data-theme="dark"] .ve-wrap #p-lanes .filters {
  background: rgba(7, 25, 46, 0.84) !important;
  border-color: rgba(115, 178, 230, 0.24) !important;
}
html[data-theme="dark"] .ve-wrap #p-lanes .filters .seal {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: rgba(52, 211, 153, 0.42) !important;
  color: #6ee7b7 !important;
}
html[data-theme="dark"] .ve-btn {
  background: rgba(11, 34, 60, 0.90) !important;
  border-color: rgba(115, 178, 230, 0.34) !important;
  color: #dce9f5 !important;
}

/* ── Daily Fragility Overview Guide, Polarity Pills & Support Panels ──────── */
html[data-theme="dark"] .fg-layer-guide div,
html[data-theme="dark"] .fg-ahead,
html[data-theme="dark"] .fg-support,
html[data-theme="dark"] .fg-assessment-facts {
  background: rgba(11, 34, 60, 0.80) !important;
  border-color: rgba(115, 178, 230, 0.26) !important;
  color: #dce9f5 !important;
}
html[data-theme="dark"] .fg-layer-guide strong { color: #5eead4 !important; }
html[data-theme="dark"] .fg-ahead .fg-ahead-note { color: #9eb7cf !important; }
html[data-theme="dark"] .fg-polarity-chip,
html[data-theme="dark"] .fg-tone-teal,
html[data-theme="dark"] .fg-tone-neutral {
  background: rgba(94, 234, 212, 0.14) !important;
  border-color: rgba(94, 234, 212, 0.34) !important;
  color: #7dd3fc !important;
}
html[data-theme="dark"] .fg-card-scale .fg-scale-pill,
html[data-theme="dark"] .fg-card-scale [class*="tone-"],
html[data-theme="dark"] .fg-card-scale [class*="pill"],
html[data-theme="dark"] .fg-card-scale [class*="chip"] {
  background: rgba(15, 42, 74, 0.86) !important;
  border-color: rgba(94, 234, 212, 0.36) !important;
  color: #5eead4 !important;
}
html[data-theme="dark"] .fg-card-scale .fg-tone-amber,
html[data-theme="dark"] .fg-card-scale .fg-regime-watch,
html[data-theme="dark"] .fg-card-scale .fg-regime-elevated {
  background: rgba(244, 185, 90, 0.18) !important;
  border-color: rgba(244, 185, 90, 0.48) !important;
  color: #f4b95a !important;
}
html[data-theme="dark"] .fg-card-scale .fg-tone-red,
html[data-theme="dark"] .fg-card-scale .fg-regime-fragile {
  background: rgba(251, 113, 133, 0.18) !important;
  border-color: rgba(251, 113, 133, 0.48) !important;
  color: #fb7185 !important;
}

/* ── Primary Gradient Action Buttons (Dark Optical Glass) ─────────────────── */
html[data-theme="dark"] .fg-sha-box__btn,
html[data-theme="dark"] .fg-rung--desk a.fg-rung__cta,
html[data-theme="dark"] .fg-button,
html[data-theme="dark"] .cta:not(.cta--secondary),
html[data-theme="dark"] .btn:not(.btn--ghost):not(.btn--amber) {
  background: linear-gradient(135deg, #073b5c 0%, #0b5a6e 52%, #0c6b64 100%) !important;
  background-image: linear-gradient(135deg, #073b5c 0%, #0b5a6e 52%, #0c6b64 100%) !important;
  border: 1px solid rgba(94, 234, 212, 0.42) !important;
  color: #f4f8fc !important;
  box-shadow: 0 4px 14px rgba(2, 10, 22, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.16) !important;
}
html[data-theme="dark"] .fg-sha-box__btn:hover,
html[data-theme="dark"] .fg-rung--desk a.fg-rung__cta:hover,
html[data-theme="dark"] .fg-button:hover,
html[data-theme="dark"] .cta:not(.cta--secondary):hover,
html[data-theme="dark"] .btn:not(.btn--ghost):not(.btn--amber):hover {
  background: linear-gradient(135deg, #094c76 0%, #0e7087 52%, #0f8279 100%) !important;
  background-image: linear-gradient(135deg, #094c76 0%, #0e7087 52%, #0f8279 100%) !important;
  border-color: rgba(94, 234, 212, 0.72) !important;
  color: #ffffff !important;
}

/* ── Open Data Explorer, Buttons, Diagram Controls & Badges ───────────────── */
html[data-theme="dark"] .btn--amber {
  background: linear-gradient(135deg, #b45309 0%, #d97706 100%) !important;
  border-color: rgba(244, 185, 90, 0.55) !important;
  color: #ffffff !important;
}
html[data-theme="dark"] .od-tabs { border-bottom-color: rgba(115, 178, 230, 0.22) !important; }
html[data-theme="dark"] .od-chip,
html[data-theme="dark"] .od-view-btn,
html[data-theme="dark"] .diagram-tab,
html[data-theme="dark"] .win-range__preset,
html[data-theme="dark"] .diagram-tool-btn {
  background: rgba(7, 25, 46, 0.88) !important;
  border-color: rgba(115, 178, 230, 0.30) !important;
  color: #dce9f5 !important;
}
html[data-theme="dark"] .od-chip.is-active,
html[data-theme="dark"] .od-view-btn.is-active,
html[data-theme="dark"] .diagram-tab.is-active,
html[data-theme="dark"] .win-range__preset.is-active {
  background: #0f766e !important;
  border-color: #5eead4 !important;
  color: #ffffff !important;
}
html[data-theme="dark"] .od-view-toggle { border-color: rgba(115, 178, 230, 0.34) !important; }
html[data-theme="dark"] .diagram-box,
html[data-theme="dark"] .preview-box,
html[data-theme="dark"] .od-table-panel,
html[data-theme="dark"] .demand-banner {
  background: rgba(7, 25, 46, 0.86) !important;
  border-color: rgba(115, 178, 230, 0.26) !important;
  color: #dce9f5 !important;
}
html[data-theme="dark"] .od-badge-new {
  background: rgba(244, 185, 90, 0.20) !important;
  border-color: rgba(244, 185, 90, 0.52) !important;
  color: #f4b95a !important;
}
html[data-theme="dark"] .od-badge-tierb {
  background: rgba(56, 189, 248, 0.18) !important;
  border-color: rgba(56, 189, 248, 0.45) !important;
  color: #7dd3fc !important;
}

/* ── SVG Charts & Diagrams (Legible Light Labels & Subtle Sapphire Grids) ─── */
html[data-theme="dark"] svg.diagram-svg,
html[data-theme="dark"] .overview-plot svg,
html[data-theme="dark"] .fg-mini-chart svg,
html[data-theme="dark"] .timeline-chart svg {
  background: transparent;
}
html[data-theme="dark"] svg g[fill="#415c6b"],
html[data-theme="dark"] svg g[fill="#183b3a"],
html[data-theme="dark"] svg text[fill="#415c6b"],
html[data-theme="dark"] svg text[fill="#183b3a"],
html[data-theme="dark"] svg text[fill="#111"],
html[data-theme="dark"] svg text[fill="#111111"],
html[data-theme="dark"] svg text[fill="#163038"],
html[data-theme="dark"] svg text[fill="#11232b"],
html[data-theme="dark"] svg text[fill="#0f2933"],
html[data-theme="dark"] svg text[fill="#1f2937"],
html[data-theme="dark"] svg text[fill="#24404a"],
html[data-theme="dark"] svg text[fill="#1e293b"],
html[data-theme="dark"] svg text[fill="#0f172a"],
html[data-theme="dark"] svg text[fill="#334155"],
html[data-theme="dark"] svg text[fill="#475569"],
html[data-theme="dark"] svg text[fill="#4b5563"],
html[data-theme="dark"] svg text[fill="#526b77"],
html[data-theme="dark"] svg text[fill="#536c7b"],
html[data-theme="dark"] svg text[fill="#64748b"] {
  fill: #c6daec !important;
}
html[data-theme="dark"] svg text[fill="#0b5c56"],
html[data-theme="dark"] svg text[fill="#0f766e"],
html[data-theme="dark"] svg text[fill="#147d78"] {
  fill: #5eead4 !important;
}
html[data-theme="dark"] svg text[fill="#0369a1"],
html[data-theme="dark"] svg text[fill="#0284c7"],
html[data-theme="dark"] svg text[fill="#075985"] {
  fill: #38bdf8 !important;
}
html[data-theme="dark"] svg text[fill="#8c531c"],
html[data-theme="dark"] svg text[fill="#854206"],
html[data-theme="dark"] svg text[fill="#b45309"] {
  fill: #f4b95a !important;
}
html[data-theme="dark"] svg text[fill="#9a3412"] { fill: #fb923c !important; }
html[data-theme="dark"] svg text[fill="#991b1b"] { fill: #fb7185 !important; }
html[data-theme="dark"] svg text[fill="#3730a3"] { fill: #a5b4fc !important; }
html[data-theme="dark"] svg text[stroke="#ffffff"],
html[data-theme="dark"] svg text[stroke="#fff"],
html[data-theme="dark"] svg text[stroke="#f9fcfc"] {
  stroke: #07192f !important;
}
html[data-theme="dark"] svg rect.timeline-context-band,
html[data-theme="dark"] svg rect.chart-context-band,
html[data-theme="dark"] svg rect[fill="#dce3e8"] {
  fill: #38bdf8 !important;
  fill-opacity: 0.13 !important;
  stroke: rgba(125, 211, 252, 0.28);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}
html[data-theme="dark"] svg rect[fill="#fff0dd"] {
  fill: #f4b95a !important;
  fill-opacity: 0.12 !important;
  stroke: rgba(244, 185, 90, 0.36);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}
html[data-theme="dark"] svg rect[fill="#e6edeb"] {
  fill: rgba(15, 42, 74, 0.85) !important;
}
html[data-theme="dark"] svg text.timeline-ref-label,
html[data-theme="dark"] svg text.timeline-fill-label {
  stroke: #07192f !important;
}
html[data-theme="dark"] svg text.timeline-boundary-label {
  fill: #c4b5fd !important;
}
html[data-theme="dark"] svg rect[fill="#ffffff"],
html[data-theme="dark"] svg rect[fill="#fff"],
html[data-theme="dark"] svg rect[fill="white"],
html[data-theme="dark"] svg rect[fill="#f8fafc"],
html[data-theme="dark"] svg rect[fill="#f8fafb"],
html[data-theme="dark"] svg rect[fill="#f9fcfc"],
html[data-theme="dark"] svg rect[fill="#edf4f4"],
html[data-theme="dark"] svg rect[fill="#f3f9f9"] {
  fill: rgba(7, 25, 46, 0.88) !important;
}
/* Open Data 3D & Unfolded Goodwin-Keen Phase Space cube walls & grids */
html[data-theme="dark"] svg polygon[fill="#eef6f6"] {
  fill: rgba(15, 118, 110, 0.22) !important;
}
html[data-theme="dark"] svg polygon[fill="#f2f8fc"] {
  fill: rgba(2, 132, 199, 0.20) !important;
}
html[data-theme="dark"] svg polygon[fill="#fdf8f0"] {
  fill: rgba(217, 119, 6, 0.16) !important;
}
html[data-theme="dark"] svg polygon[stroke="#bfd4d4"],
html[data-theme="dark"] svg polygon[stroke="#d0e2e4"] {
  stroke: rgba(148, 197, 235, 0.32) !important;
}
html[data-theme="dark"] svg line[stroke="#e2e8f0"],
html[data-theme="dark"] svg line[stroke="#e5e7eb"],
html[data-theme="dark"] svg line[stroke="#dce6e9"],
html[data-theme="dark"] svg line[stroke="#cbd5e1"],
html[data-theme="dark"] svg line[stroke="#d7e6e8"],
html[data-theme="dark"] svg line[stroke="#e2ecee"],
html[data-theme="dark"] svg line[stroke="#edf4f4"],
html[data-theme="dark"] svg line[stroke="#edf4f5"] {
  stroke: rgba(148, 197, 235, 0.22) !important;
}
html[data-theme="dark"] svg circle[stroke="#111827"],
html[data-theme="dark"] svg circle[stroke="#0f172a"] {
  stroke: #f4f8fc !important;
}

/* ── Reduced-Transparency & Print Safety ──────────────────────────────────── */
@media (prefers-reduced-transparency: reduce) {
  html[data-theme="dark"] .card,
  html[data-theme="dark"] .fg-card,
  html[data-theme="dark"] .fg-assessment,
  html[data-theme="dark"] .fg-ladder,
  html[data-theme="dark"] header.fg-site-header {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #0b223c !important;
  }
}

@media print {
  html[data-theme="dark"],
  html[data-theme="dark"] body {
    background: #ffffff !important;
    color: #111111 !important;
    color-scheme: light !important;
  }
  html[data-theme="dark"] .card,
  html[data-theme="dark"] .fg-card,
  html[data-theme="dark"] .fg-assessment {
    background: #ffffff !important;
    color: #111111 !important;
    border-color: #cccccc !important;
    box-shadow: none !important;
  }
  .fg-theme-toggle { display: none !important; }
}
