/* ===== TaxSaving — design system ===== */
:root {
  --navy: #0f2c3f;
  --navy-2: #143a52;
  --navy-deep: #0a2231;
  --green: #1fa971;
  --green-2: #17935f;
  --green-soft: #e7f6ee;
  --ink: #16242c;
  --slate: #51616b;
  --line: #e3e9ec;
  --bg: #f6f9f8;
  --surface: #ffffff;
  --surface-alt: #eef4f2;
  --amber: #b7791f;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15,44,63,.05), 0 12px 30px -16px rgba(15,44,63,.22);
  --shadow-sm: 0 1px 2px rgba(15,44,63,.06), 0 6px 16px -12px rgba(15,44,63,.2);

  --sp-1: .35rem; --sp-2: .6rem; --sp-3: 1rem; --sp-4: 1.5rem;
  --sp-5: 2.25rem; --sp-6: 3.5rem; --sp-7: 5rem;

  --font-head: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  /* semantic tokens (remapped in dark mode) */
  --heading: var(--navy);      /* heading / strong ink text */
  --panel: var(--navy);        /* dark feature-panel background */
  --panel-ink: #ffffff;        /* text on dark panels */
  --panel-muted: #b9cdd9;      /* muted text on dark panels */
  --header-bg: rgba(255,255,255,.88);
  --card-bg: var(--surface);
  --input-bg: #ffffff;
  --warn-bg: #fff7ec;
  --warn-line: #f0dcb8;
  --warn-ink: #6b5318;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; color: var(--heading); margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: var(--green-2); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--slate); font-weight: 400; }
.accent { color: var(--green-2); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.container { width: min(1120px, 92vw); margin-inline: auto; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--navy); color: #fff;
  padding: .6rem 1rem; border-radius: 0 0 8px 0; z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; border-radius: 4px; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--navy); }
.brand:hover { text-decoration: none; }
.brand-text { font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; letter-spacing: -.02em; }
.brand-accent { color: var(--green-2); }
.site-nav { display: flex; gap: 1.4rem; }
.site-nav a { color: var(--slate); font-weight: 500; font-size: .95rem; }
.site-nav a:hover { color: var(--navy); text-decoration: none; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 600; font-size: .98rem;
  padding: .8rem 1.4rem; border-radius: 10px; border: 1.5px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 8px 18px -8px rgba(31,169,113,.7); }
.btn-primary:hover { background: var(--green-2); }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--navy); }

/* ===== Hero ===== */
.hero {
  background:
    radial-gradient(1100px 480px at 85% -10%, rgba(31,169,113,.14), transparent 60%),
    linear-gradient(180deg, #fff 0%, var(--bg) 100%);
  padding: var(--sp-7) 0 var(--sp-6);
}
.hero-grid { display: grid; grid-template-columns: 1.25fr .9fr; gap: var(--sp-5); align-items: center; }
.eyebrow {
  display: inline-block; font-family: var(--font-head); font-weight: 600; font-size: .8rem;
  letter-spacing: .04em; text-transform: uppercase; color: var(--green-2);
  background: var(--green-soft); padding: .3rem .7rem; border-radius: 999px; margin-bottom: 1rem;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.lede { font-size: 1.18rem; color: var(--slate); max-width: 34ch; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1.4rem 0 .8rem; }
.hero-note { font-size: .88rem; color: var(--slate); }

.hero-card {
  background: var(--panel);
  color: var(--panel-ink);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow);
  display: grid; gap: 1.1rem;
}
.hero-card .stat { display: flex; flex-direction: column; }
.stat-num { font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; color: #fff; }
.stat-label { font-size: .85rem; color: #b9cdd9; }
.hero-card-foot { font-size: .76rem; color: #8fb0c0; margin: 0; border-top: 1px solid rgba(255,255,255,.12); padding-top: .8rem; }

/* ===== Disclaimer strip ===== */
.disclaimer-strip {
  background: var(--warn-bg); border-top: 1px solid var(--warn-line); border-bottom: 1px solid var(--warn-line);
  font-size: .9rem; color: var(--warn-ink); padding: .9rem 0;
}
.disclaimer-strip strong { color: var(--amber); }

/* ===== Sections ===== */
.section { padding: var(--sp-6) 0; }
.section-alt { background: var(--surface-alt); }
.section-head { max-width: 60ch; margin-bottom: var(--sp-4); }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.section-head p { color: var(--slate); font-size: 1.05rem; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm);
}

/* ===== Calculator 1 ===== */
.calc-grid { display: grid; grid-template-columns: 360px 1fr; gap: 1.4rem; align-items: start; }
.field { margin-bottom: 1.1rem; }
.field > label, .fieldset legend { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .4rem; color: var(--navy); }
select, input[type="number"] {
  width: 100%; font: inherit; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: .65rem .8rem; background: var(--input-bg); transition: border-color .15s;
}
select:focus, input:focus { border-color: var(--green); outline: none; }
.input-money { position: relative; display: flex; align-items: center; }
.input-money > span { position: absolute; left: .8rem; color: var(--slate); font-weight: 600; }
.input-money input { padding-left: 1.6rem; }
.input-money.sm { width: 130px; }
.input-money.sm input { padding: .45rem .5rem .45rem 1.3rem; }
.input-money.sm > span { left: .55rem; }

.fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem; }
.contrib-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .7rem; font-size: .95rem; }
.contrib-row:last-child { margin-bottom: 0; }
.form-hint { font-size: .82rem; color: var(--slate); margin: .6rem 0 0; }

.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.result-kpi { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .9rem 1rem; }
.result-kpi.wide { grid-column: 1 / -1; }
.kpi-label { display: block; font-size: .82rem; color: var(--slate); margin-bottom: .25rem; }
.kpi-value { font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; color: var(--navy); font-variant-numeric: tabular-nums; }

.breakdown-title { font-size: 1.05rem; margin: 0 0 .7rem; }
.table-wrap { overflow-x: auto; }
.bracket-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.bracket-table th, .bracket-table td { text-align: right; padding: .55rem .7rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.bracket-table th:first-child, .bracket-table td:first-child,
.bracket-table th:nth-child(2), .bracket-table td:nth-child(2) { text-align: left; }
.bracket-table thead th { color: var(--slate); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.bracket-table tbody tr.active { background: var(--green-soft); }
.bracket-table tbody td:first-child { font-weight: 600; }
.bracket-table .rate-chip { font-variant-numeric: tabular-nums; }

/* ===== Calculator 2 ===== */
.contrib-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; align-items: start; }
.marginal-pill { background: var(--green-soft); color: var(--green-2); border-radius: 999px; padding: .5rem .9rem; display: inline-block; font-size: .9rem; margin: 0 0 1.3rem; }
.marginal-pill strong { color: var(--navy); }
.slider-block { margin-bottom: 1.4rem; }
.slider-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .4rem; }
.slider-head label { font-weight: 600; font-size: .95rem; color: var(--navy); }
.slider-val { font-family: var(--font-head); font-weight: 700; color: var(--green-2); font-variant-numeric: tabular-nums; }
.slider-scale { display: flex; justify-content: space-between; font-size: .75rem; color: var(--slate); margin-top: .3rem; }

input[type="range"] { width: 100%; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 999px; background: var(--line); cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--green); border: 3px solid #fff; box-shadow: 0 1px 6px rgba(15,44,63,.3); }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--green); border: 3px solid #fff; box-shadow: 0 1px 6px rgba(15,44,63,.3); }
input[type="range"]:focus { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--green-soft); }

.contrib-results { background: var(--panel); border-color: var(--panel); color: var(--panel-ink); }
.contrib-big { padding: .9rem 0; border-bottom: 1px solid rgba(255,255,255,.12); }
.contrib-big:last-of-type { border-bottom: none; }
.contrib-big .kpi-label { color: #b9cdd9; }
.contrib-big .kpi-value { color: #fff; font-size: 1.9rem; }
.contrib-big.highlight .kpi-value { color: #5fe3a6; }
.contrib-explainer { font-size: .85rem; color: #b9cdd9; margin: 1rem 0 0; }

/* ===== Strategy library ===== */
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: var(--sp-4); }
.filter-btn {
  font-family: var(--font-head); font-weight: 600; font-size: .9rem;
  padding: .5rem 1rem; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; color: var(--slate); cursor: pointer; transition: all .15s;
}
.filter-btn:hover { border-color: var(--green); color: var(--navy); }
.filter-btn.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }

.strategy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.1rem; }
.strategy-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: .55rem;
  transition: transform .15s, box-shadow .15s;
}
.strategy-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.strategy-card .tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag { font-size: .72rem; font-weight: 600; text-transform: capitalize; color: var(--green-2); background: var(--green-soft); padding: .2rem .55rem; border-radius: 6px; }
.strategy-card h3 { font-size: 1.12rem; margin: .1rem 0 0; }
.strategy-card .what { font-size: .92rem; color: var(--slate); margin: 0; }
.strategy-meta { font-size: .85rem; margin: 0; }
.strategy-meta b { color: var(--navy); }
.savings-line { font-family: var(--font-head); font-weight: 600; color: var(--green-2); font-size: .95rem; margin: .2rem 0; }
.watchout { font-size: .82rem; color: var(--amber); background: #fff7ec; border-left: 3px solid var(--amber); padding: .45rem .7rem; border-radius: 0 6px 6px 0; margin: .3rem 0 0; }
.empty-msg { color: var(--slate); grid-column: 1 / -1; }

/* ===== Summary ===== */
.summary-card { max-width: 680px; }
.summary-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.summary-list li { display: flex; justify-content: space-between; align-items: baseline; padding: .8rem 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
.summary-list li span:last-child { font-family: var(--font-head); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--navy); }
.summary-total { font-size: 1.1rem !important; border-bottom: none !important; padding-top: 1rem !important; }
.summary-total span:last-child { font-size: 1.6rem; }
.summary-foot { font-size: .85rem; color: var(--slate); margin: .4rem 0 0; }

/* ===== Acquire ===== */
.acquire-section { padding: var(--sp-5) 0; }
.acquire-card {
  background: linear-gradient(120deg, var(--navy), var(--navy-2));
  color: #fff; border-radius: var(--radius); padding: 2rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
}
.acquire-card h2 { color: #fff; font-size: 1.4rem; }
.acquire-card p { color: #c4d6e0; margin: 0; max-width: 60ch; font-size: .98rem; }
.acquire-card .btn-primary { flex-shrink: 0; }

/* ===== Footer ===== */
.site-footer { background: var(--navy-deep); color: #a8c0cd; padding: var(--sp-5) 0 var(--sp-4); }
.footer-inner { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; padding-bottom: 1.5rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.footer-brand .brand-text { color: #fff; font-size: 1.2rem; }
.footer-brand p { font-size: .9rem; margin: .5rem 0 0; max-width: 32ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: center; }
.footer-links a { color: #a8c0cd; font-size: .92rem; }
.footer-links a:hover { color: #fff; }
.footer-legal { padding-top: 1.2rem; }
.footer-legal p { font-size: .78rem; color: #7e98a6; margin: 0 0 .5rem; }

/* ===== Responsive ===== */
@media (max-width: 880px) {
  .hero-grid, .calc-grid, .contrib-grid { grid-template-columns: 1fr; }
  .site-nav { display: none; }
  .hero { padding: var(--sp-6) 0 var(--sp-5); }
}
@media (max-width: 480px) {
  .result-grid { grid-template-columns: 1fr; }
  .acquire-card { padding: 1.4rem; }
  .kpi-value { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* ===========================================================
   NEW COMPONENTS
   =========================================================== */

/* ---- Data-source note (shown under each tool) ---- */
.data-note {
  font-size: .8rem; color: var(--slate); margin: 1rem 0 0;
  display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap;
}
.data-note .year-chip {
  font-family: var(--font-head); font-weight: 600; font-size: .72rem;
  color: var(--green-2); background: var(--green-soft);
  padding: .12rem .5rem; border-radius: 999px; letter-spacing: .02em;
}

/* ---- Take-home paycheck tool ---- */
.paycheck-grid { display: grid; grid-template-columns: 360px 1fr; gap: 1.4rem; align-items: start; }
.paycheck-results { background: var(--panel); border-color: var(--panel); color: var(--panel-ink); }
.takehome-hero { text-align: center; padding: .5rem 0 1.2rem; border-bottom: 1px solid rgba(255,255,255,.14); margin-bottom: 1.1rem; }
.takehome-hero .kpi-label { color: var(--panel-muted); }
.takehome-hero .kpi-value { color: #5fe3a6; font-size: clamp(2rem, 6vw, 2.8rem); display: block; margin-top: .2rem; }
.takehome-hero .period-label { display: block; font-size: .85rem; color: var(--panel-muted); margin-top: .2rem; }
.paycheck-breakdown { list-style: none; margin: 0; padding: 0; }
.paycheck-breakdown li { display: flex; justify-content: space-between; align-items: baseline; padding: .6rem 0; border-bottom: 1px solid rgba(255,255,255,.12); font-size: .95rem; color: var(--panel-muted); }
.paycheck-breakdown li:last-child { border-bottom: none; }
.paycheck-breakdown li span:last-child { font-family: var(--font-head); font-weight: 600; color: var(--panel-ink); font-variant-numeric: tabular-nums; }
.paycheck-breakdown li.is-total span { color: var(--panel-ink); font-size: 1.05rem; }
.paycheck-note { font-size: .82rem; color: var(--panel-muted); margin: 1rem 0 0; }

/* ---- Guides section on homepage ---- */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.1rem; }
.guide-card {
  display: flex; flex-direction: column; gap: .5rem;
  background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem; box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s; color: inherit;
}
.guide-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; }
.guide-card .guide-kicker { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--green-2); }
.guide-card h3 { font-size: 1.1rem; margin: 0; color: var(--heading); }
.guide-card p { font-size: .9rem; color: var(--slate); margin: 0; }
.guide-card .guide-more { font-family: var(--font-head); font-weight: 600; font-size: .9rem; color: var(--green-2); margin-top: auto; }

/* ---- Email capture ---- */
.signup {
  background: linear-gradient(120deg, var(--panel), var(--navy-2));
  color: var(--panel-ink); border-radius: var(--radius); padding: 2rem;
}
.signup h2 { color: #fff; font-size: 1.4rem; }
.signup p { color: var(--panel-muted); max-width: 52ch; }
.signup-form { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; max-width: 480px; }
.signup-form input[type="email"] { flex: 1 1 220px; min-width: 0; background: rgba(255,255,255,.95); border-color: transparent; }
.signup-form .btn { flex-shrink: 0; }
.signup .hp-field { position: absolute; left: -5000px; } /* honeypot */
.form-fine { font-size: .76rem; color: var(--panel-muted); margin: .7rem 0 0; }
.form-thanks {
  margin-top: 1rem; background: rgba(95,227,166,.14); border: 1px solid rgba(95,227,166,.4);
  color: #d9fbec; border-radius: var(--radius-sm); padding: 1rem 1.2rem; font-size: .95rem;
}
.form-thanks strong { color: #fff; }

/* article-footer signup variant sits on light surface */
.signup.signup-inline { margin-top: 2.5rem; }

/* ---- Affiliate slots (hidden until CONFIG has a url) ---- */
.affiliate-module { margin-top: 1.6rem; }
.affiliate-module > h3 { font-size: 1rem; color: var(--heading); margin-bottom: .3rem; }
.affiliate-disclosure { font-size: .78rem; color: var(--slate); margin: 0 0 .9rem; }
.affiliate-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .9rem; }
.affiliate-card {
  display: flex; flex-direction: column; gap: .3rem; position: relative;
  background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 1rem 1.1rem; box-shadow: var(--shadow-sm); color: inherit;
  transition: transform .15s, box-shadow .15s;
}
.affiliate-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.affiliate-badge { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--slate); }
.affiliate-name { font-family: var(--font-head); font-weight: 700; color: var(--heading); font-size: 1.05rem; }
.affiliate-blurb { font-size: .84rem; color: var(--slate); }
.affiliate-cta { font-family: var(--font-head); font-weight: 600; font-size: .88rem; color: var(--green-2); margin-top: .3rem; }

/* ---- Ad-slot reserved container (no ad code shipped) ---- */
.ad-slot { margin: 1.5rem 0; min-height: 90px; }

/* ===========================================================
   ARTICLE / GUIDE PAGES
   =========================================================== */
.breadcrumbs { font-size: .85rem; color: var(--slate); padding: 1.2rem 0 0; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.breadcrumbs li::after { content: '/'; margin-left: .4rem; color: var(--line); }
.breadcrumbs li:last-child::after { content: ''; }
.breadcrumbs a { color: var(--slate); }
.breadcrumbs a:hover { color: var(--green-2); }
.breadcrumbs [aria-current="page"] { color: var(--heading); font-weight: 600; }

.article { padding: var(--sp-4) 0 var(--sp-6); }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--sp-5); align-items: start; }
.article-main { max-width: 72ch; }
.article-head .eyebrow { margin-bottom: .8rem; }
.article-head h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); }
.article-meta { color: var(--slate); font-size: .9rem; margin: 0 0 1.4rem; }
.article-body { font-size: 1.05rem; }
.article-body h2 { font-size: 1.5rem; margin-top: 2rem; }
.article-body h3 { font-size: 1.18rem; margin-top: 1.6rem; }
.article-body p { color: var(--ink); }
.article-body ul, .article-body ol { padding-left: 1.2rem; margin: 0 0 1.2rem; }
.article-body li { margin-bottom: .5rem; }
.article-body a { text-decoration: underline; }
.article-body strong { color: var(--heading); }
.article-body .callout {
  background: var(--surface-alt); border: 1px solid var(--line); border-left: 4px solid var(--green);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 1rem 1.2rem; margin: 1.4rem 0; font-size: .96rem;
}
.article-body .callout p:last-child { margin-bottom: 0; }
.article-body .tool-cta {
  display: block; background: var(--panel); color: var(--panel-ink);
  border-radius: var(--radius); padding: 1.3rem 1.4rem; margin: 1.6rem 0; text-decoration: none;
}
.article-body .tool-cta:hover { text-decoration: none; transform: translateY(-2px); }
.article-body .tool-cta strong { color: #fff; display: block; font-family: var(--font-head); font-size: 1.1rem; margin-bottom: .2rem; }
.article-body .tool-cta span { color: var(--panel-muted); font-size: .92rem; }
.article-body .fig-table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 1.2rem 0; }
.article-body .fig-table th, .article-body .fig-table td { border: 1px solid var(--line); padding: .5rem .7rem; text-align: left; }
.article-body .fig-table th { background: var(--surface-alt); font-family: var(--font-head); font-size: .82rem; }

.article-disclaimer {
  background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink);
  border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin: 2rem 0 0; font-size: .88rem;
}
.article-disclaimer strong { color: var(--amber); }

.article-faq { margin-top: 2.4rem; }
.article-faq h2 { font-size: 1.5rem; }
.article-faq details {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .3rem 1.1rem; margin-bottom: .7rem; background: var(--card-bg);
}
.article-faq summary { font-family: var(--font-head); font-weight: 600; color: var(--heading); cursor: pointer; padding: .8rem 0; font-size: 1rem; }
.article-faq summary::marker { color: var(--green-2); }
.article-faq details[open] summary { margin-bottom: .3rem; }
.article-faq p { color: var(--slate); font-size: .95rem; }

/* sidebar */
.article-side { position: sticky; top: 84px; display: grid; gap: 1.2rem; }
.side-card { background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; box-shadow: var(--shadow-sm); }
.side-card h2, .side-card h3 { font-size: 1rem; margin: 0 0 .7rem; }
.related-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.related-list a { display: block; font-size: .92rem; font-weight: 500; color: var(--heading); }
.related-list a:hover { color: var(--green-2); text-decoration: none; }
.related-list .rl-kicker { display: block; font-size: .72rem; color: var(--slate); font-weight: 400; text-transform: uppercase; letter-spacing: .03em; }

.related-guides { margin-top: 2.6rem; border-top: 1px solid var(--line); padding-top: 1.6rem; }
.related-guides h2 { font-size: 1.3rem; }

/* ===========================================================
   COLOR THEME
   The base stylesheet above is LIGHT. Dark styling applies when
   EITHER the OS prefers dark and the user has not made an explicit
   choice (:root:not([data-theme])), OR the user has toggled dark
   (:root[data-theme="dark"]). An explicit [data-theme="light"]
   always wins over the OS preference. The toggle button (added by
   script.js) and an inline <head> script set data-theme.
   =========================================================== */

/* ---- Dark tokens ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --ink: #e6eef1; --slate: #9fb4bf; --line: #24343d; --bg: #0b171d;
    --surface: #10222c; --surface-alt: #0d1b23; --green-soft: #123227;
    --heading: #eaf3f1; --panel: #16303e; --header-bg: rgba(11,23,29,.82);
    --card-bg: #10222c; --input-bg: #0d1b23; --warn-bg: #2a2213; --warn-line: #4a3d1e; --warn-ink: #e7cf9c;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 30px -16px rgba(0,0,0,.7);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 6px 16px -12px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] {
  --ink: #e6eef1; --slate: #9fb4bf; --line: #24343d; --bg: #0b171d;
  --surface: #10222c; --surface-alt: #0d1b23; --green-soft: #123227;
  --heading: #eaf3f1; --panel: #16303e; --header-bg: rgba(11,23,29,.82);
  --card-bg: #10222c; --input-bg: #0d1b23; --warn-bg: #2a2213; --warn-line: #4a3d1e; --warn-ink: #e7cf9c;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 30px -16px rgba(0,0,0,.7);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 6px 16px -12px rgba(0,0,0,.6);
}

/* ---- Dark component overrides (auto: OS dark + no explicit choice) ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .hero { background:
    radial-gradient(1100px 480px at 85% -10%, rgba(31,169,113,.16), transparent 60%),
    linear-gradient(180deg, #0f2028 0%, var(--bg) 100%); }
  :root:not([data-theme]) .btn-ghost { background: var(--surface); color: var(--heading); }
  :root:not([data-theme]) .btn-ghost:hover { border-color: var(--green); }
  :root:not([data-theme]) .brand, :root:not([data-theme]) .brand-text { color: var(--heading); }
  :root:not([data-theme]) .filter-btn { background: var(--surface); }
  :root:not([data-theme]) .filter-btn.is-active { background: var(--green); border-color: var(--green); color: #06231a; }
  :root:not([data-theme]) .kpi-value { color: var(--heading); }
  :root:not([data-theme]) .result-kpi { background: var(--surface-alt); }
  :root:not([data-theme]) .field > label, :root:not([data-theme]) .fieldset legend,
  :root:not([data-theme]) .slider-head label, :root:not([data-theme]) .breakdown-title,
  :root:not([data-theme]) .strategy-card h3, :root:not([data-theme]) .bracket-table tbody td:first-child { color: var(--heading); }
  :root:not([data-theme]) .marginal-pill { background: var(--green-soft); color: #5fe3a6; }
  :root:not([data-theme]) .marginal-pill strong, :root:not([data-theme]) .summary-list li span:last-child,
  :root:not([data-theme]) .strategy-meta b, :root:not([data-theme]) .article-body .fig-table th { color: var(--heading); }
  :root:not([data-theme]) .tag { color: #7fe9bb; }
  :root:not([data-theme]) .eyebrow { color: #7fe9bb; }
  :root:not([data-theme]) .btn-primary { color: #06231a; }
  :root:not([data-theme]) .stat-num { color: #fff; }
  :root:not([data-theme]) .watchout { background: #2a2213; color: #e7cf9c; }
  :root:not([data-theme]) .disclaimer-strip strong { color: #e0b465; }
  :root:not([data-theme]) .amber, :root:not([data-theme]) .article-disclaimer strong { color: #e0b465; }
  :root:not([data-theme]) .signup-form input[type="email"] { background: #0d1b23; color: var(--ink); border-color: var(--line); }
  :root:not([data-theme]) .footer-brand .brand-text { color: #fff; }
}

/* ---- Dark component overrides (explicit toggle) ---- */
:root[data-theme="dark"] .hero { background:
  radial-gradient(1100px 480px at 85% -10%, rgba(31,169,113,.16), transparent 60%),
  linear-gradient(180deg, #0f2028 0%, var(--bg) 100%); }
:root[data-theme="dark"] .btn-ghost { background: var(--surface); color: var(--heading); }
:root[data-theme="dark"] .btn-ghost:hover { border-color: var(--green); }
:root[data-theme="dark"] .brand, :root[data-theme="dark"] .brand-text { color: var(--heading); }
:root[data-theme="dark"] .filter-btn { background: var(--surface); }
:root[data-theme="dark"] .filter-btn.is-active { background: var(--green); border-color: var(--green); color: #06231a; }
:root[data-theme="dark"] .kpi-value { color: var(--heading); }
:root[data-theme="dark"] .result-kpi { background: var(--surface-alt); }
:root[data-theme="dark"] .field > label, :root[data-theme="dark"] .fieldset legend,
:root[data-theme="dark"] .slider-head label, :root[data-theme="dark"] .breakdown-title,
:root[data-theme="dark"] .strategy-card h3, :root[data-theme="dark"] .bracket-table tbody td:first-child { color: var(--heading); }
:root[data-theme="dark"] .marginal-pill { background: var(--green-soft); color: #5fe3a6; }
:root[data-theme="dark"] .marginal-pill strong, :root[data-theme="dark"] .summary-list li span:last-child,
:root[data-theme="dark"] .strategy-meta b, :root[data-theme="dark"] .article-body .fig-table th { color: var(--heading); }
:root[data-theme="dark"] .tag { color: #7fe9bb; }
:root[data-theme="dark"] .eyebrow { color: #7fe9bb; }
:root[data-theme="dark"] .btn-primary { color: #06231a; }
:root[data-theme="dark"] .stat-num { color: #fff; }
:root[data-theme="dark"] .watchout { background: #2a2213; color: #e7cf9c; }
:root[data-theme="dark"] .disclaimer-strip strong { color: #e0b465; }
:root[data-theme="dark"] .amber, :root[data-theme="dark"] .article-disclaimer strong { color: #e0b465; }
:root[data-theme="dark"] .signup-form input[type="email"] { background: #0d1b23; color: var(--ink); border-color: var(--line); }
:root[data-theme="dark"] .footer-brand .brand-text { color: #fff; }

/* ---- Explicit light tokens (always beat the OS preference) ---- */
:root[data-theme="light"] {
  --ink: #16242c; --slate: #51616b; --line: #e3e9ec; --bg: #f6f9f8;
  --surface: #ffffff; --surface-alt: #eef4f2; --green-soft: #e7f6ee;
  --heading: var(--navy); --panel: var(--navy); --header-bg: rgba(255,255,255,.88);
  --card-bg: #ffffff; --input-bg: #ffffff; --warn-bg: #fff7ec; --warn-line: #f0dcb8; --warn-ink: #6b5318;
}

/* ---- Theme toggle button (injected into the header by script.js) ---- */
/* Keep the brand on the left and cluster nav + toggle on the right. */
.header-inner .site-nav { margin-left: auto; }
.theme-toggle {
  margin-left: .5rem;
  flex: none;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.1rem; line-height: 1;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.theme-toggle:hover { border-color: var(--green); }
.theme-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* ---- Contribution-cap note ---- */
.clamp-note {
  margin-top: .4rem;
  padding: .5rem .7rem;
  border-radius: 8px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: var(--warn-ink);
  font-weight: 500;
}

/* ===========================================================
   RESPONSIVE additions for new components
   =========================================================== */
@media (max-width: 880px) {
  .paycheck-grid { grid-template-columns: 1fr; }
  .article-layout { grid-template-columns: 1fr; }
  .article-side { position: static; }
}
