/* SK Finvest — site styles
   Palette: forest / marigold on cool paper. Type: Source Serif 4 + Public Sans. */

:root {
  --forest: #0f3b36;
  --forest-2: #174a44;
  --forest-3: #235e57;
  --marigold: #e3a22b;
  --marigold-2: #f0b84d;
  --marigold-ink: #8a5a0a;
  --paper: #f3f6f3;
  --white: #ffffff;
  --text: #1b2b28;
  --muted: #5b6b66;
  --line: #d6ded9;
  --line-soft: #e6ece8;
  --sage: #e3efe9;
  --red: #b4443c;
  --green: #1e7a55;

  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;

  --wrap: 1180px;
  --read: 700px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
}
img, svg { max-width: 100%; display: block; }
a { color: var(--forest-3); text-underline-offset: 3px; }
a:hover { color: var(--forest); }
h1, h2, h3, h4 { font-family: var(--serif); color: var(--forest); line-height: 1.2; margin: 0 0 .6em; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.25em; }
table { border-collapse: collapse; width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; border-radius: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--marigold); color: var(--forest); padding: .6rem 1rem; z-index: 999; font-weight: 600; }
.skip:focus { left: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Top notice bar ---------- */
.notice { background: var(--forest); color: #cfe0db; font-size: .8rem; }
.notice .wrap { display: flex; justify-content: space-between; gap: 1rem; padding-top: .45rem; padding-bottom: .45rem; flex-wrap: wrap; }
.notice a { color: var(--marigold-2); }
.notice span.right { color: #9fb9b2; }

/* ---------- Header ---------- */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 100; }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 1.5rem; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--forest); }
.brand svg { width: 38px; height: 38px; flex: none; }
.brand-name { font-family: var(--serif); font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.brand-name b { font-weight: 400; color: var(--forest-3); }
.brand-tag { display: block; font-family: var(--sans); font-size: .68rem; font-weight: 500; color: var(--muted); letter-spacing: .02em; margin-top: 4px; }

.main-nav ul { list-style: none; display: flex; gap: .15rem; margin: 0; padding: 0; align-items: center; }
.main-nav a { display: block; padding: .5rem .8rem; font-size: .92rem; font-weight: 500; color: var(--text); text-decoration: none; border-radius: 4px; }
.main-nav a:hover { background: var(--sage); color: var(--forest); }
.main-nav a[aria-current="page"] { color: var(--forest); font-weight: 600; box-shadow: inset 0 -3px 0 var(--marigold); border-radius: 0; }
.main-nav li.cta a { background: var(--forest); color: var(--white); margin-left: .5rem; padding: .5rem 1rem; border-radius: 4px; box-shadow: none; }
.main-nav li.cta a:hover { background: var(--forest-2); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 4px; width: 44px; height: 44px; cursor: pointer; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { display: block; width: 20px; height: 2px; background: var(--forest); position: relative; margin: 0 auto; content: ""; }
.nav-toggle span::before { position: absolute; top: -6px; left: 0; }
.nav-toggle span::after { position: absolute; top: 6px; left: 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-block; padding: .75rem 1.3rem; border-radius: 4px; font-weight: 600; font-size: .95rem; text-decoration: none; border: 2px solid transparent; cursor: pointer; line-height: 1.2; }
.btn-primary { background: var(--marigold); color: var(--forest); border-color: var(--marigold); }
.btn-primary:hover { background: var(--marigold-2); border-color: var(--marigold-2); color: var(--forest); }
.btn-ghost { border-color: var(--forest); color: var(--forest); background: transparent; }
.btn-ghost:hover { background: var(--forest); color: var(--white); }
.btn-dark { background: var(--forest); color: var(--white); border-color: var(--forest); }
.btn-dark:hover { background: var(--forest-2); color: var(--white); }

/* ---------- Ledger paper hero ---------- */
.ledger {
  position: relative;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 35px, rgba(15,59,54,.07) 35px, rgba(15,59,54,.07) 36px);
  border-bottom: 1px solid var(--line);
}
.ledger::before {
  content: ""; position: absolute; top: 0; bottom: 0; width: 1px; pointer-events: none;
  left: max(10px, calc((100% - var(--wrap)) / 2 + 1.5rem - 22px));
  background: rgba(180,68,60,.3);
}
.hero { padding: 4.2rem 0 4.5rem; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3.5rem; align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.6rem); font-weight: 700; letter-spacing: -0.025em; margin-bottom: .5em; }
.hero p.lead { font-size: 1.15rem; color: #2f423e; max-width: 34em; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }
.hero-note { margin-top: 1.6rem; font-size: .85rem; color: var(--muted); max-width: 32em; }

/* planner panel */
.planner { background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: 8px 8px 0 var(--forest); overflow: hidden; }
.planner-head { background: var(--forest); color: var(--white); padding: .85rem 1.3rem; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.planner-head strong { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; }
.planner-head a { color: var(--marigold-2); font-size: .82rem; }
.planner-body { padding: 1.3rem; }
.field { margin-bottom: 1rem; }
.field-top { display: flex; justify-content: space-between; align-items: baseline; font-size: .88rem; margin-bottom: .25rem; }
.field-top label { font-weight: 600; color: var(--forest); }
.field-top output { font-variant-numeric: tabular-nums; font-weight: 600; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; background: var(--line); border-radius: 3px; outline-offset: 6px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--forest); border: 3px solid var(--white); box-shadow: 0 0 0 1px var(--forest); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--forest); border: 3px solid var(--white); box-shadow: 0 0 0 1px var(--forest); cursor: pointer; }
.planner-result { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; border-top: 3px double var(--forest); padding-top: 1rem; margin-top: 1.2rem; }
.planner-result dt { font-size: .8rem; color: var(--muted); }
.planner-result dd { margin: 0; font-family: var(--serif); font-size: 1.55rem; font-weight: 700; color: var(--forest); font-variant-numeric: tabular-nums; }
.planner-result .big { grid-column: 1 / -1; }
.planner-result .big dd { color: var(--forest); font-size: 2rem; }
.planner-result .gain dd { color: var(--green); }
.planner-chart { margin: 1rem 0 0; }
.planner-chart svg { width: 100%; height: auto; }
.planner-foot { font-size: .76rem; color: var(--muted); margin: .9rem 0 0; }

/* ---------- Sections ---------- */
.section { padding: 4rem 0; }
.section-tight { padding: 2.6rem 0; }
.section-white { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-sage { background: var(--sage); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.8rem; border-bottom: 3px double var(--forest); padding-bottom: .55rem; }
.section-head h2 { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2rem); }
.section-head a { font-size: .9rem; font-weight: 600; white-space: nowrap; }
.section-intro { max-width: 40em; color: #34463f; font-size: 1.05rem; margin-bottom: 2rem; }

/* ---------- Article thumbnails ---------- */
.thumb { position: relative; overflow: hidden; background: var(--sage); color: var(--forest); display: block; }
.thumb svg { position: absolute; width: 62%; height: auto; right: -6%; bottom: -14%; opacity: .95; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.thumb .tcat { position: absolute; left: .9rem; top: .8rem; font-size: .78rem; font-weight: 600; }
.t-budget { background: #e1eee7; color: #0f3b36; }
.t-credit { background: #e0e9f4; color: #1f3a5f; }
.t-insure { background: #f8ebd0; color: #7a4e0c; }
.t-invest { background: #e6e3f2; color: #3b3566; }
.t-loan { background: #f4e0dc; color: #7b2d26; }
.t-wealth { background: #e5eed8; color: #3f5a1b; }
.t-retire { background: #dcebf0; color: #1f4b5e; }
.t-gold { background: #f6e9c4; color: #6e5008; }

/* ---------- Feature + ledger rows ---------- */
.feature-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2.6rem; }
.feature { background: var(--white); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.feature .thumb { flex: 1 1 auto; min-height: 220px; }
.feature .thumb svg { width: 34%; right: 8%; bottom: 10%; }
.feature-body { padding: 1.5rem 1.6rem 1.7rem; }
.feature h3 { font-size: 1.75rem; margin-bottom: .45em; }
.feature:hover h3 { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--marigold); }
.feature p { color: #34463f; }
.meta { font-size: .82rem; color: var(--muted); }
.meta b { color: var(--text); font-weight: 600; }

.entries { list-style: none; margin: 0; padding: 0; }
.entry { display: grid; grid-template-columns: 76px 1fr; gap: 1.1rem; padding: 1.05rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.entry:first-child { padding-top: 0; }
.entry .date { font-size: .78rem; font-weight: 600; color: var(--muted); text-align: right; line-height: 1.3; padding-top: .3rem; font-variant-numeric: tabular-nums; }
.entry .date b { display: block; font-family: var(--serif); font-size: 1.5rem; color: var(--forest); line-height: 1.1; }
.entry h3 { font-size: 1.15rem; margin: 0 0 .25em; }
.entry:hover h3 { text-decoration: underline; text-decoration-color: var(--marigold); text-decoration-thickness: 2px; }
.entry p { margin: 0 0 .3em; font-size: .93rem; color: #3b4d47; }
.tagline { display: inline-block; font-size: .78rem; font-weight: 600; padding: .1rem .55rem; border-radius: 3px; margin-right: .5rem; }
.tagline.t-budget, .tagline.t-credit, .tagline.t-insure, .tagline.t-invest, .tagline.t-loan, .tagline.t-wealth, .tagline.t-retire, .tagline.t-gold { }

/* ---------- Life stage path ---------- */
.stages { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 4px solid var(--forest); }
.stage { padding: 1.4rem 1.4rem 1.6rem 0; margin-right: 1.4rem; border-right: 1px solid var(--line); }
.stage:last-child { border-right: 0; margin-right: 0; }
.stage h3 { font-size: 1.35rem; margin-bottom: .1em; }
.stage .range { font-size: .85rem; color: var(--muted); margin-bottom: .8rem; }
.stage ul { list-style: none; padding: 0; margin: 0; font-size: .93rem; }
.stage li { padding: .28rem 0 .28rem 1.3rem; position: relative; }
.stage li::before { content: ""; position: absolute; left: 0; top: .75em; width: 8px; height: 4px; border-left: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: rotate(-45deg); }
.stage a { font-weight: 600; font-size: .88rem; display: inline-block; margin-top: .7rem; }

/* ---------- Tool list ---------- */
.tools { display: grid; grid-template-columns: 1fr 1fr; column-gap: 3rem; }
.tool { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.tool strong { font-family: var(--serif); font-size: 1.2rem; color: var(--forest); font-weight: 600; display: block; }
.tool span { font-size: .9rem; color: var(--muted); }
.tool:hover strong { text-decoration: underline; text-decoration-color: var(--marigold); text-decoration-thickness: 2px; }
.tool i { font-style: normal; font-weight: 700; color: var(--forest-3); }

/* ---------- Standards (how we write) ---------- */
.standards { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.standards h2 { font-size: 2rem; }
.standards dl { margin: 0; }
.standards dt { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; color: var(--forest); margin-top: 1.1rem; }
.standards dt:first-child { margin-top: 0; }
.standards dd { margin: .15rem 0 0; color: #34463f; }
.sources { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.2rem; }
.sources span { border: 1px solid var(--forest-3); color: var(--forest); padding: .15rem .7rem; border-radius: 99px; font-size: .85rem; font-weight: 600; background: rgba(255,255,255,.6); }

/* ---------- Topic chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { border: 1px solid var(--line); background: var(--white); border-radius: 99px; padding: .3rem .9rem; font-size: .88rem; color: var(--text); text-decoration: none; cursor: pointer; }
.chip:hover { border-color: var(--forest); color: var(--forest); }
button.chip[aria-pressed="true"] { background: var(--forest); color: var(--white); border-color: var(--forest); }

/* ---------- Newsletter band ---------- */
.band { background: var(--forest); color: #d6e6e1; padding: 3.2rem 0; }
.band-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center; }
.band h2 { color: var(--white); font-size: 1.9rem; margin-bottom: .3em; }
.band p { margin: 0; }
.subscribe { display: flex; gap: .6rem; flex-wrap: wrap; }
.subscribe input[type=email] { flex: 1 1 220px; padding: .8rem 1rem; border-radius: 4px; border: 2px solid transparent; background: var(--white); color: var(--text); }
.form-msg { font-size: .88rem; margin-top: .6rem; min-height: 1.3em; color: var(--marigold-2); }
.band small { display: block; margin-top: .6rem; color: #9fb9b2; }

/* ---------- Page header (inner pages) ---------- */
.page-head { padding: 3rem 0 2.6rem; }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.9rem); margin-bottom: .35em; font-weight: 700; letter-spacing: -0.02em; }
.page-head p.lead { font-size: 1.12rem; max-width: 38em; color: #2f423e; margin-bottom: 0; }
.crumbs { font-size: .83rem; color: var(--muted); margin-bottom: 1.2rem; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--forest); }
.crumbs span[aria-hidden] { margin: 0 .4rem; }

/* ---------- Lists / blog index ---------- */
.toolbar { display: flex; justify-content: space-between; gap: 1.2rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.6rem; }
.search { flex: 0 1 300px; position: relative; }
.search input { width: 100%; padding: .65rem 1rem; border: 1px solid var(--line); border-radius: 4px; background: var(--white); }
.search input:focus { border-color: var(--forest); }
.post-list { list-style: none; margin: 0; padding: 0; border-top: 4px solid var(--forest); }
.post { display: grid; grid-template-columns: 190px 1fr; gap: 1.6rem; padding: 1.5rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.post .thumb { aspect-ratio: 4 / 3; border-radius: 6px; }
.post h2 { font-size: 1.45rem; margin: .3rem 0 .3em; }
.post:hover h2 { text-decoration: underline; text-decoration-color: var(--marigold); text-decoration-thickness: 2px; }
.post p { color: #3b4d47; margin-bottom: .5em; }
.empty { padding: 2rem 0; color: var(--muted); display: none; }

.layout > * { min-width: 0; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 3rem; align-items: start; }
.sidebar > section { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 1.3rem 1.3rem 1.4rem; margin-bottom: 1.4rem; }
.sidebar h3 { font-size: 1.1rem; margin-bottom: .7em; padding-bottom: .4em; border-bottom: 3px double var(--forest); }
.sidebar ol, .sidebar ul.plain { list-style: none; padding: 0; margin: 0; font-size: .93rem; }
.sidebar li { padding: .45rem 0; border-bottom: 1px solid var(--line-soft); }
.sidebar li:last-child { border-bottom: 0; }
.sidebar a { text-decoration: none; color: var(--text); }
.sidebar a:hover { color: var(--forest); text-decoration: underline; }
.sidebar a.btn, .sidebar a.btn:hover { color: var(--white); text-decoration: none; }
.sidebar .side-note { font-size: .88rem; color: var(--muted); margin: 0; }
.sidebar .subscribe input[type=email] { flex-basis: 100%; border-color: var(--line); }
.sidebar .subscribe .btn { width: 100%; }
.sidebar .form-msg { color: var(--green); }

/* ---------- Article ---------- */
.article-head { padding: 2.8rem 0 2rem; }
.article-head h1 { font-size: clamp(2rem, 4vw, 2.85rem); font-weight: 700; letter-spacing: -0.02em; max-width: 20em; margin-bottom: .4em; }
.article-head .deck { font-family: var(--serif); font-size: 1.3rem; line-height: 1.45; color: #2f423e; max-width: 33em; margin-bottom: 1.2rem; }
.byline { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; font-size: .88rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: .9rem; max-width: var(--read); }
.byline b { color: var(--text); font-weight: 600; }

.prose { max-width: var(--read); font-family: var(--serif); font-size: 1.14rem; line-height: 1.75; color: #1d2e2a; }
.prose h2 { font-size: 1.75rem; margin: 2.2em 0 .55em; padding-top: .3em; scroll-margin-top: 90px; }
.prose h3 { font-size: 1.3rem; margin: 1.8em 0 .4em; }
.prose li { margin-bottom: .45em; }
.prose strong { color: var(--forest); font-weight: 700; }
.prose a { color: var(--forest-3); }
.prose .data-table { font-family: var(--sans); font-size: .92rem; margin: 1.6rem 0 2rem; }
@media (max-width: 700px) { .prose .data-table { display: block; overflow-x: auto; } }
.data-table th, .data-table td { padding: .65rem .8rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table thead th { background: var(--forest); color: var(--white); font-weight: 600; font-size: .85rem; border-bottom: 0; }
.data-table tbody tr:nth-child(even) { background: #f7faf8; }
.data-table td.n, .data-table th.n { text-align: right; font-variant-numeric: tabular-nums; }
.data-table caption { caption-side: bottom; text-align: left; font-size: .82rem; color: var(--muted); padding-top: .6rem; }
.callout { font-family: var(--sans); font-size: 1rem; line-height: 1.6; background: var(--white); border: 1px solid var(--line); border-left: 6px solid var(--marigold); padding: 1.1rem 1.3rem; margin: 1.8rem 0; border-radius: 0 6px 6px 0; }
.callout b { display: block; font-family: var(--serif); font-size: 1.1rem; color: var(--forest); margin-bottom: .2rem; }
.callout p:last-child { margin-bottom: 0; }
.worked { font-family: var(--sans); font-size: .98rem; background: var(--white); border: 1px dashed var(--forest-3); padding: 1.1rem 1.3rem; margin: 1.8rem 0; border-radius: 6px; line-height: 1.6; }
.worked b.h { display: block; font-family: var(--serif); color: var(--forest); font-size: 1.05rem; margin-bottom: .3rem; }
.worked p:last-child { margin-bottom: 0; }
.prose .endnote { font-family: var(--sans); font-size: .88rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 2.5rem; }

.related { margin-top: 3rem; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.mini { background: var(--white); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; text-decoration: none; color: inherit; display: block; }
.mini .thumb { aspect-ratio: 16 / 7; }
.mini div.b { padding: 1rem 1.1rem 1.2rem; }
.mini h3 { font-size: 1.08rem; margin: 0 0 .3em; }
.mini:hover h3 { text-decoration: underline; text-decoration-color: var(--marigold); }
.mini p { margin: 0; font-size: .86rem; color: var(--muted); }

/* ---------- Hub pages ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 0 0 1.4rem 3.4rem; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -.1rem; width: 2.3rem; height: 2.3rem; border-radius: 50%; background: var(--forest); color: var(--white); font-family: var(--serif); font-weight: 700; display: grid; place-items: center; }
.steps li::after { content: ""; position: absolute; left: 1.1rem; top: 2.3rem; bottom: .3rem; width: 2px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps strong { display: block; font-family: var(--serif); font-size: 1.12rem; color: var(--forest); }
.rules { list-style: none; padding: 0; margin: 0; }
.rules li { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.rules li:first-child { border-top: 4px solid var(--forest); }
.rules strong { display: block; font-family: var(--serif); font-size: 1.15rem; color: var(--forest); }
.rules span { color: #3b4d47; font-size: .95rem; }
.tablebox { background: var(--white); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
.tablebox .data-table td, .tablebox .data-table th { font-size: .92rem; }
.fine { font-size: .85rem; color: var(--muted); margin-top: .8rem; }
.warn { background: #fff7e6; border: 1px solid #f0d9a3; border-left: 6px solid var(--marigold); border-radius: 0 6px 6px 0; padding: 1.1rem 1.3rem; }
.warn b { font-family: var(--serif); color: var(--forest); }

/* ---------- Calculators ---------- */
.calc-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.4rem; border-bottom: 1px solid var(--line); }
.calc-tabs button { background: transparent; border: 0; border-bottom: 4px solid transparent; padding: .7rem 1rem .6rem; cursor: pointer; font-weight: 600; color: var(--muted); font-size: .95rem; margin-bottom: -1px; }
.calc-tabs button:hover { color: var(--forest); }
.calc-tabs button[aria-selected="true"] { color: var(--forest); border-bottom-color: var(--marigold); }
.calc-panel { display: none; }
.calc-panel.on { display: block; }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.4rem; background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 1.8rem; }
.calc-grid h2 { font-size: 1.5rem; }
.calc-inputs .field { margin-bottom: 1.3rem; }
.calc-inputs .field-top { align-items: center; }
.calc-inputs .num-in { width: 9.5em; padding: .35rem .6rem; border: 1px solid var(--line); border-radius: 4px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; background: var(--paper); }
.calc-inputs .num-in:focus { border-color: var(--forest); background: var(--white); }
.calc-out { background: var(--paper); border-radius: 8px; padding: 1.4rem; align-self: start; }
.calc-out .headline { font-size: .85rem; color: var(--muted); margin-bottom: .1rem; }
.calc-out .figure { font-family: var(--serif); font-size: 2.5rem; font-weight: 700; color: var(--forest); line-height: 1.1; font-variant-numeric: tabular-nums; }
.calc-out dl { margin: 1.1rem 0 0; border-top: 3px double var(--forest); }
.calc-out dl div { display: flex; justify-content: space-between; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.calc-out dt { color: var(--muted); }
.calc-out dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.bar { display: flex; height: 14px; border-radius: 3px; overflow: hidden; margin: 1.1rem 0 .4rem; background: var(--line); }
.bar i { display: block; height: 100%; }
.bar .a { background: var(--forest); }
.bar .b { background: var(--marigold); }
.legend { display: flex; gap: 1.2rem; font-size: .8rem; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: .4rem; border-radius: 2px; background: var(--forest); }
.legend span.b::before { background: var(--marigold); }
.calc-note { font-size: .82rem; color: var(--muted); margin-top: 1rem; }
.calc-tablewrap { max-height: 260px; overflow: auto; margin-top: 1rem; border: 1px solid var(--line); border-radius: 6px; background: var(--white); }
.calc-tablewrap table { font-size: .85rem; }
.calc-tablewrap th, .calc-tablewrap td { padding: .4rem .7rem; text-align: right; border-bottom: 1px solid var(--line-soft); }
.calc-tablewrap th:first-child, .calc-tablewrap td:first-child { text-align: left; }
.calc-tablewrap thead th { position: sticky; top: 0; background: var(--forest); color: var(--white); font-weight: 600; }

/* ---------- Glossary ---------- */
.az { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: 2rem; }
.az a { min-width: 2.1rem; text-align: center; padding: .25rem .5rem; border: 1px solid var(--line); background: var(--white); border-radius: 4px; text-decoration: none; font-weight: 600; font-size: .9rem; }
.az a:hover { border-color: var(--forest); }
.gloss h2 { font-size: 2rem; border-bottom: 3px double var(--forest); padding-bottom: .15em; margin: 2.2rem 0 .8rem; scroll-margin-top: 90px; }
.gloss dl { margin: 0; }
.gloss dt { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; color: var(--forest); margin-top: 1.1rem; scroll-margin-top: 90px; }
.gloss dd { margin: .15rem 0 0; max-width: 46em; color: #2c3e39; }

/* ---------- About / text pages ---------- */
.text-page { max-width: 760px; }
.text-page h2 { font-size: 1.6rem; margin-top: 2em; }
.text-page h3 { font-size: 1.2rem; margin-top: 1.6em; }
.principles { display: grid; grid-template-columns: 1fr 1fr; gap: 0 3rem; margin: 1rem 0 0; }
.principles div { padding: 1.1rem 0; border-top: 1px solid var(--line); }
.principles h3 { font-size: 1.2rem; margin-bottom: .25em; }
.principles p { margin: 0; color: #34463f; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 3px solid var(--forest); }
.timeline li { padding: 0 0 1.4rem 1.4rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -9px; top: .5rem; width: 15px; height: 15px; background: var(--marigold); border: 3px solid var(--paper); border-radius: 50%; box-shadow: 0 0 0 1px var(--forest); }
.timeline b { font-family: var(--serif); color: var(--forest); font-size: 1.1rem; display: block; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 3rem; align-items: start; }
.form-box { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 1.8rem; }
.form-row { margin-bottom: 1.1rem; }
.form-row label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; color: var(--forest); }
.form-row input, .form-row select, .form-row textarea { width: 100%; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { background: var(--white); border-color: var(--forest); }
.form-row textarea { min-height: 150px; resize: vertical; }
.form-box .form-msg { color: var(--green); }
.faq details { border-bottom: 1px solid var(--line); padding: .9rem 0; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--forest); }
.faq details p { margin: .6rem 0 0; color: #34463f; font-size: .95rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--forest); color: #bfd3ce; padding: 3.4rem 0 1.6rem; font-size: .93rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 2.4rem; }
.site-footer .brand { color: var(--white); margin-bottom: 1rem; }
.site-footer .brand-name b { color: #a9c7bf; }
.site-footer .brand-tag { color: #9fb9b2; }
.site-footer h4 { font-family: var(--sans); color: var(--white); font-size: .95rem; margin-bottom: .8em; letter-spacing: 0; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .45rem; }
.site-footer a { color: #bfd3ce; text-decoration: none; }
.site-footer a:hover { color: var(--marigold-2); text-decoration: underline; }
.footer-about { max-width: 24em; }
.disclaimer { border-top: 1px solid rgba(255,255,255,.14); margin-top: 2.6rem; padding-top: 1.3rem; font-size: .8rem; color: #93aea7; }
.disclaimer p { margin-bottom: .7em; max-width: 70em; }
.legal-row { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .82rem; color: #93aea7; margin-top: 1rem; }
.legal-row a { color: #bfd3ce; margin-left: 1rem; }

/* ---------- 404 ---------- */
.nf { text-align: left; padding: 5rem 0; }
.nf .big { font-family: var(--serif); font-size: clamp(4rem, 14vw, 8rem); font-weight: 700; color: var(--forest); line-height: 1; margin-bottom: .1em; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hero-grid, .feature-grid, .standards, .band-grid, .two-col, .contact-grid, .calc-grid { grid-template-columns: 1fr; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .stages { grid-template-columns: 1fr 1fr; }
  .stage { border-right: 0; border-bottom: 1px solid var(--line); margin-right: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .tools { grid-template-columns: 1fr; }
  .planner { box-shadow: 5px 5px 0 var(--forest); }
}
@media (max-width: 980px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 70px; background: var(--white); border-bottom: 1px solid var(--line); padding: .6rem 1.5rem 1.2rem; box-shadow: 0 12px 20px rgba(15,59,54,.08); }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; }
  .main-nav a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--marigold); background: var(--sage); }
  .main-nav li.cta a { margin: .5rem 0 0; text-align: center; }
  .site-header .wrap { position: relative; }
}
@media (max-width: 860px) {
  .ledger { background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 35px, rgba(15,59,54,.07) 35px, rgba(15,59,54,.07) 36px); }
  .post { grid-template-columns: 1fr; gap: .9rem; }
  .post .thumb { aspect-ratio: 16 / 7; }
  .principles { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .hero { padding: 2.6rem 0 3rem; }
  .stages { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .entry { grid-template-columns: 56px 1fr; gap: .8rem; }
  .planner-result dd { font-size: 1.3rem; }
  .calc-grid { padding: 1.1rem; }
  .calc-out .figure { font-size: 2rem; }
  .notice span.right { display: none; }
  .brand-tag { display: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  .notice, .site-header, .sidebar, .band, .site-footer, .related, .nav-toggle { display: none !important; }
  body { background: #fff; }
  .layout { display: block; }
  .prose { font-size: 11pt; max-width: none; }
}
