/* fin·calc dark theme: maps the light palette's hard-coded colours (inline styles and
   page <style> blocks written before the token system) onto the dark tokens. Loaded on
   every page except the homepage; only active when html[data-theme="dark"]. */
html[data-theme="dark"] [style*="color:#5c6b7a"], html[data-theme="dark"] [style*="color: #5c6b7a"],
html[data-theme="dark"] [style*="color:#7a8299"], html[data-theme="dark"] [style*="color:#8a96a3"],
html[data-theme="dark"] [style*="color:#8a94a6"], html[data-theme="dark"] [style*="color:#3b4a58"],
html[data-theme="dark"] [style*="color:#3a4552"] { color: var(--muted) !important; }
html[data-theme="dark"] [style*="color:#1a2733"], html[data-theme="dark"] [style*="color: #1a2733"] { color: var(--ink) !important; }
html[data-theme="dark"] [style*="color:#0e7a4a"], html[data-theme="dark"] [style*="color:#0b6a40"] { color: var(--accent) !important; }
html[data-theme="dark"] [style*="background:#fff;"], html[data-theme="dark"] [style*="background:#fff\""], html[data-theme="dark"] [style*="background:#ffffff"],
html[data-theme="dark"] [style*="background: #fff"], html[data-theme="dark"] [style*="background-color:#fff"] { background: var(--card) !important; }
html[data-theme="dark"] [style*="background:#f4f6f7"], html[data-theme="dark"] [style*="background:#eef1f4"], html[data-theme="dark"] [style*="background:#f1f4f6"],
html[data-theme="dark"] [style*="background:#eef7f1"] { background: var(--bg-2) !important; }
html[data-theme="dark"] [style*="background:#fff4e5"], html[data-theme="dark"] [style*="background:#fff4d6"], html[data-theme="dark"] [style*="background:#fdf0e8"] { background: rgba(251,191,36,0.12) !important; }
html[data-theme="dark"] [style*="color:#8a4b00"], html[data-theme="dark"] [style*="color:#7a5a00"] { color: #fbbf24 !important; }
html[data-theme="dark"] [style*="background:#e3f4ea"] { background: rgba(94,234,212,0.12) !important; }
html[data-theme="dark"] [style*="background:#fbe9e7"] { background: rgba(251,113,133,0.12) !important; }
html[data-theme="dark"] [style*="color:#8a2b12"], html[data-theme="dark"] [style*="color:#8a3b12"] { color: #fb7185 !important; }
html[data-theme="dark"] [style*="border"][style*="#e3e8ee"] { border-color: var(--line) !important; }
/* Common component classes from page style blocks */
html[data-theme="dark"] main, html[data-theme="dark"] main p, html[data-theme="dark"] main li, html[data-theme="dark"] main dd, html[data-theme="dark"] main td { color: inherit; }
html[data-theme="dark"] main h1, html[data-theme="dark"] main h2, html[data-theme="dark"] main h3, html[data-theme="dark"] main h4, html[data-theme="dark"] main strong, html[data-theme="dark"] main b, html[data-theme="dark"] main dt, html[data-theme="dark"] main th { color: var(--ink); }
html[data-theme="dark"] main .sub, html[data-theme="dark"] main .intro, html[data-theme="dark"] main .note, html[data-theme="dark"] main .lead, html[data-theme="dark"] main small { color: var(--muted); }
html[data-theme="dark"] main a:not(.fc-next):not(.cta):not(.fcs-visit):not([class*="btn"]) { color: var(--accent); }
html[data-theme="dark"] main table, html[data-theme="dark"] main tr, html[data-theme="dark"] main td, html[data-theme="dark"] main th { border-color: var(--line) !important; }
html[data-theme="dark"] main .fc-card, html[data-theme="dark"] main .fc-verdict, html[data-theme="dark"] main .fc-warn, html[data-theme="dark"] main .fc-saving,
html[data-theme="dark"] main .keyfacts, html[data-theme="dark"] main .cta-box, html[data-theme="dark"] main blockquote, html[data-theme="dark"] main .mt-panel,
html[data-theme="dark"] main .fi-card, html[data-theme="dark"] main .fi-sec, html[data-theme="dark"] main .guide-card, html[data-theme="dark"] main pre, html[data-theme="dark"] main code {
  background-color: var(--card) !important; color: var(--ink) !important; border-color: var(--line) !important; }
html[data-theme="dark"] main input, html[data-theme="dark"] main select, html[data-theme="dark"] main textarea { background: var(--bg-2) !important; color: var(--ink) !important; border-color: rgba(238,243,251,0.18) !important; }
html[data-theme="dark"] main .fc-err { background: rgba(251,191,36,0.12) !important; color: #fbbf24 !important; }
/* Fixes from the automated dark-mode contrast scan */
html[data-theme="dark"] .cta-btn, html[data-theme="dark"] .dir-chip.active, html[data-theme="dark"] .dir-chip[aria-pressed="true"],
html[data-theme="dark"] .fi-nav a[aria-current=page], html[data-theme="dark"] [style*="background:var(--accent)"] { color: #0a1628 !important; }
html[data-theme="dark"] .fi-nav a, html[data-theme="dark"] .fi-in { background: var(--card) !important; border-color: rgba(238,243,251,0.16) !important; color: var(--ink) !important; }
html[data-theme="dark"] .fi-nav a[aria-current=page] { background: var(--accent) !important; border-color: var(--accent) !important; }
html[data-theme="dark"] .fi-badge--reference { background: rgba(251,191,36,0.14) !important; color: #fbbf24 !important; }
html[data-theme="dark"] main .fc-embed h4, html[data-theme="dark"] main .fc-embed .fc-card { color: var(--ink) !important; }
html[data-theme="dark"] main .fc-embed .big { color: var(--accent) !important; }
html[data-theme="dark"] main .fc-embed .sub, html[data-theme="dark"] main .fc-embed .dp-head, html[data-theme="dark"] main .fc-embed .dp-head div { color: var(--muted) !important; }
