/* Two complete palettes. Dark is the first-visit default; the header control persists a choice. */
html[data-theme="light"]{color-scheme:light}
html[data-theme="dark"]{color-scheme:dark;--paper:#111816;--ink:#f0eee5;--muted:#aeb9af;--green:#b6d8b5;--line:#344139;--soft:#223128;--surface:#19231e;--raised:#1f2b24}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:1px solid var(--line);background:transparent;color:var(--ink);border-radius:999px;padding:9px 12px;min-width:83px;min-height:40px;font-size:14px;white-space:nowrap}
.theme-toggle:hover{background:var(--soft)}
.theme-toggle .icon{width:17px;height:17px}
.theme-sun{display:none}
html[data-theme="dark"] .theme-sun{display:block}
html[data-theme="dark"] .theme-moon{display:none}
html .theme-dark-art{display:none}
html[data-theme="dark"] .theme-light-art{display:none}
html[data-theme="dark"] .theme-dark-art{display:block}
html[data-theme="dark"] ::selection{background:#c4d9b8;color:#122218}
html[data-theme="dark"] :focus-visible{outline-color:#e3c485}
html[data-theme="dark"] .header{background:#111816}
html[data-theme="dark"] .hero,
html[data-theme="dark"] .finance-hero{background:#1a251f;border:1px solid #344139}
html[data-theme="dark"] .hero h1 em,
html[data-theme="dark"] .finance-hero h1 em{color:#b9d1aa}
html[data-theme="dark"] .hero-copy .eyebrow,
html[data-theme="dark"] .finance-hero-copy>.eyebrow{color:#b5c8a8}
html[data-theme="dark"] .hero-copy>p,
html[data-theme="dark"] .finance-hero-copy>p{color:#b8c3b6}
html[data-theme="dark"] .hero-foot,
html[data-theme="dark"] .finance-facts{color:#a8b8a2}
html[data-theme="dark"] .button{background:#c1d7af;color:#1b2b20;border-color:#c1d7af}
html[data-theme="dark"] .button:hover{background:#d6e5c7;color:#132419}
html[data-theme="dark"] .filter-bar button[aria-pressed="true"]{color:#16291e;background:#b6d8b5;border-color:#b6d8b5}
html[data-theme="dark"] .topic-link:hover,
html[data-theme="dark"] .path-steps>a:hover,
html[data-theme="dark"] .icon-button:hover{background:#243329}
html[data-theme="dark"] .topic-link>span,
html[data-theme="dark"] .topic-link>b,
html[data-theme="dark"] .path-steps small,
html[data-theme="dark"] .path-steps>a>span{color:#aeba9f}
html[data-theme="dark"] .search-box{color:#afbaa9;border-color:#687761}
html[data-theme="dark"] .search-box input::placeholder{color:#a6b19e}
html[data-theme="dark"] .search-box kbd{border-color:#43533e}
html[data-theme="dark"] .results-line{color:#aeb9a5}
html[data-theme="dark"] .story-card{background:#19231e;border-color:#354239;box-shadow:0 10px 25px #0000000c}
html[data-theme="dark"] .story-card:hover{border-color:#6a7d65}
html[data-theme="dark"] .card-meta{color:#a7b39e}
html[data-theme="dark"] .card-meta>span:first-child{color:#c3d3ae}
html[data-theme="dark"] .story-card h3 a:hover{color:#c9dfbb}
html[data-theme="dark"] .card-body>p{color:#b2bdad}
html[data-theme="dark"] .saved-count{background:#304233;color:#d7e4cd}
html[data-theme="dark"] .save[aria-pressed="true"] svg{fill:#405f45}
html[data-theme="dark"] .empty-state{background:#1e2a22}
html[data-theme="dark"] .lab,
html[data-theme="dark"] .money-lab,
html[data-theme="dark"] .drawdown-lab{background:#1d2b22}
html[data-theme="dark"] .lab-intro>p,
html[data-theme="dark"] .money-lab-intro>p,
html[data-theme="dark"] .drawdown-intro>p,
html[data-theme="dark"] .learning-path>div>p{color:#b6c1ad}
html[data-theme="dark"] .lab-intro .lab-note{color:#a8b69e}
html[data-theme="dark"] .calculator,
html[data-theme="dark"] .money-calculator{background:#152019;border-color:#3a4b38;box-shadow:none}
html[data-theme="dark"] .pill{color:#bccca8;border-color:#4e6042}
html[data-theme="dark"] .calc-total>span,
html[data-theme="dark"] .calc-total small,
html[data-theme="dark"] .chart-labels,
html[data-theme="dark"] .input-number>span,
html[data-theme="dark"] .calc-note,
html[data-theme="dark"] .calculator details{color:#aeba9f}
html[data-theme="dark"] .input-number{border-color:#617251}
html[data-theme="dark"] .controls input[type="number"]{color:#e4ead8}
html[data-theme="dark"] .controls output,
html[data-theme="dark"] .money-inputs output{color:#d2dfb9}
html[data-theme="dark"] input[type="range"]{accent-color:#bed29e}
html[data-theme="dark"] #growth-chart [stroke="#dce2d2"]{stroke:#40513b}
html[data-theme="dark"] #growth-chart [fill="#dce7c8"]{fill:#324b31}
html[data-theme="dark"] #growth-chart [stroke="#a6b391"]{stroke:#d5c493}
html[data-theme="dark"] #growth-chart [stroke="#486b39"]{stroke:#b6d8b5}
html[data-theme="dark"] #growth-chart [fill="#486b39"]{fill:#b6d8b5}
html[data-theme="dark"] .model-note{color:#b8c5b0!important}
html[data-theme="dark"] .purchasing-result>span,
html[data-theme="dark"] .purchasing-result p,
html[data-theme="dark"] .power-bars label,
html[data-theme="dark"] .basket-detail,
html[data-theme="dark"] .money-calculator details,
html[data-theme="dark"] .drawdown-result>span{color:#b6c5aa}
html[data-theme="dark"] .power-bars>div{background:#2f402a}
html[data-theme="dark"] .power-bars b{background:#b6cd99}
html[data-theme="dark"] .power-bars i{background:#7faa80}
html[data-theme="dark"] .input-error{color:#f1b19b}
html[data-theme="dark"] .finance-promo{background:#1f3025;border-left-color:#a6c892}
html[data-theme="dark"] .finance-promo p,
html[data-theme="dark"] .finance-next p,
html[data-theme="dark"] .finance-disclaimer,
html[data-theme="dark"] .lesson-next small{color:#b4c2a7}
html[data-theme="dark"] .about-strip p,
html[data-theme="dark"] .about-strip>.eyebrow,
html[data-theme="dark"] .footer-grid p,
html[data-theme="dark"] .footer-bottom{color:#acb8a4}
html[data-theme="dark"] .footer{background:#19221c;border-top:1px solid #344139}
html[data-theme="dark"] .footer-bottom{border-color:#344139}
html[data-theme="dark"] .skip{background:#eceddc;color:#182a1d}
html[data-theme="dark"] dialog{background:#1a241e;box-shadow:0 24px 100px #0008}
html[data-theme="dark"] dialog::backdrop{background:#070d09bb}
html[data-theme="dark"] .saved-item small,
html[data-theme="dark"] .empty-saved p,
html[data-theme="dark"] .back-link,
html[data-theme="dark"] .article-byline,
html[data-theme="dark"] .article-figure figcaption{color:#aebaa4}
html[data-theme="dark"] .standfirst{color:#bbc7b3}
html[data-theme="dark"] .article-figure img{background:#202b22}
html[data-theme="dark"] .article-layout aside{border-color:#81956e}
html[data-theme="dark"] .article-layout aside p{color:#ccdcbc}
html[data-theme="dark"] .section-number{color:#b0c19e}
html[data-theme="dark"] .article-body p,
html[data-theme="dark"] .about-page section p{color:#c0cbb8}
html[data-theme="dark"] .sources .source-note{color:#aab89d}
/* Native SVG palettes keep exact scales and match the visible legend. */
html[data-theme="dark"] .visual-atlas>.section-heading>p{color:#b4c1a9}
html[data-theme="dark"] .visual-tabs button{background:#1c271f;border-color:#3f503b!important;color:#c1cdb7}
html[data-theme="dark"] .visual-tabs button:hover{background:#2d3c2b}
html[data-theme="dark"] .visual-tabs button[aria-selected="true"]{background:#c1d7af;color:#17291b;border-color:#c1d7af!important}
html[data-theme="dark"] .infographic{background:var(--info-dark-bg);color:var(--info-dark-accent);border-color:#4c5b49}
html[data-theme="dark"] .info-figure{background:#00000015;border-color:#ffffff20}
html[data-theme="dark"] .info-legend i{background:var(--legend-dark)}
html[data-theme="dark"] .info-topline,
html[data-theme="dark"] .info-figure figcaption,
html[data-theme="dark"] .info-steps,
html[data-theme="dark"] .info-steps>div{border-color:#ffffff23}
html[data-theme="dark"] .info-deck,
html[data-theme="dark"] .info-steps p,
html[data-theme="dark"] .info-figure figcaption,
html[data-theme="dark"] .info-bottom>p{opacity:1;color:#d0d2c3}
html[data-theme="dark"] .info-takeaway{background:#ffffff07}
html[data-theme="dark"] .info-download{border-color:#ffffff45}
html[data-theme="dark"] .info-download:hover{background:#ffffff12}
html[data-theme="dark"] .info-fees .info-big-stat{color:#c8d9b6}
/* Interactive finance tools, including form fields and error states. */
html[data-theme="dark"] .finance-experiment{background:#1c2a30;border-color:#3f5760;color:#bfdee5}
html[data-theme="dark"] .experiment-panel{background:#142128;border-color:#3a535a}
html[data-theme="dark"] .experiment-result{border-color:#4a6267}
html[data-theme="dark"] .experiment-panel details{border-color:#3f565b}
html[data-theme="dark"] .bond-value-track{background:#30484e}
html[data-theme="dark"] .bond-value-track b{background:#a4d1e0}
html[data-theme="dark"] .bond-value-track i{background:#edb48d}
html[data-theme="dark"] .debt-experiment{background:#2c251e;border-color:#5b4b39;color:#e3c9a8}
html[data-theme="dark"] .debt-experiment .experiment-panel{background:#211d18;border-color:#66513d}
html[data-theme="dark"] .debt-fields input{background:#31291f;color:#f2e5d0;border-color:#816b50}
html[data-theme="dark"] .debt-split b{background:#8bc6b4}
html[data-theme="dark"] .debt-split i{background:#e3b18c}
/* Geography keeps its original deep-ocean palette; these sections surround it. */
html[data-theme="dark"] .geo-breadcrumb,
html[data-theme="dark"] .geo-scale p,
html[data-theme="dark"] .geo-evidence p,
html[data-theme="dark"] .geo-sources{color:#b4c3ad}
html[data-theme="dark"] .scale-number,
html[data-theme="dark"] .geo-sources summary{color:#c5d8b4}
html[data-theme="dark"] .radius-track{background:#394b33}
html[data-theme="dark"] .radius-track>i{background:#d0e4b9}
html[data-theme="dark"] .radius-labels,
html[data-theme="dark"] .geo-scale>div>small{color:#adbfa0}
html[data-theme="dark"] .earth-art>figcaption,
html[data-theme="dark"] .earth-model-note{color:#9fb9ae}
html[data-theme="dark"] .ocean-visual>p{color:#9dbfc9}
/* Make room for the theme control without squeezing the navigation. */
@media(max-width:1200px){.reading-button>span{display:none}.theme-toggle{min-width:40px;padding:9px}.theme-toggle>span{display:none}.nav-actions{gap:10px}}
@media(max-width:1000px){.nav nav{display:none;position:absolute;top:98px;left:0;right:0;background:var(--paper);padding:16px 25px;border-bottom:1px solid var(--line);z-index:10}.nav nav.open{display:flex;flex-direction:column;gap:6px;align-items:flex-start}.nav nav a{padding:10px 0;font-size:14px}.mobile-menu{display:inline-grid}}
@media(max-width:800px){.nav nav{top:80px}}
@media(max-width:540px){.nav nav{top:74px}.nav-actions{gap:4px}.theme-toggle{min-width:36px;min-height:36px;padding:8px}.brand{flex-shrink:0}.reading-button{padding-inline:3px}.reading-button .saved-count{min-width:16px}}
@media(max-width:370px){.brand>span{font-size:22px}.brand img{width:30px;height:30px}.brand-sub{font-size:14px;letter-spacing:1.8px}.nav{gap:5px}}

html[data-theme="dark"] .visual-tabs button>span{opacity:.85}
html[data-theme="dark"] .money-controls output{color:#d2dfb9}
html[data-theme="dark"] .purchasing-value>span,html[data-theme="dark"] .purchasing-value>p,html[data-theme="dark"] .basket-cost{color:#b6c5aa}
html[data-theme="dark"] .power-bars>div{background:none;color:#b6c5aa}
html[data-theme="dark"] .power-track{background:#30402b}
html[data-theme="dark"] .power-track>b{background:#a9c58e}
html[data-theme="dark"] .power-track>#power-bar{background:#80af86}
html[data-theme="dark"] .drawdown-lab p,html[data-theme="dark"] .drawdown-controls>div>span{color:#b6c5aa}

html[data-theme="dark"] .info-step-no{opacity:.85}
