/* Margin Lab — an illustrated ledger notebook.
   Palette: ledger green #183C32 · rice paper #EEE8D8 · tangerine #EF9C56 · dark ink #142019
   Tangerine is used for rules, fills and accents only — never as text on paper (contrast too low). */

:root {
  --green: #183C32;
  --green-2: #24584A;
  --paper: #EEE8D8;
  --paper-2: #F7F3E8;     /* card paper */
  --paper-3: #E3DBC6;     /* shade */
  --tangerine: #EF9C56;
  --tangerine-soft: #F7D3B1;
  --ink: #142019;
  --ink-2: #3B4A42;       /* secondary text: 7.6:1 on paper */
  --rule: #C9BFA6;
  --neg: #8A2E0E;         /* deep rust for negative numbers: 7.6:1 on paper-2 */
  --focus: #0B5CAD;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --measure: 68ch;
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background-color: var(--paper);
  /* faint ruled notebook lines */
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, rgba(24, 60, 50, .055) 31px, rgba(24, 60, 50, .055) 32px);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--sans);
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}

a { color: var(--green); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--ink); text-decoration-color: var(--tangerine); text-decoration-thickness: .15em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.15; color: var(--ink); }
h2 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.4rem); margin: .2em 0 .5em; letter-spacing: -.01em; }
h3 { font-size: 1.3rem; margin: 1.4em 0 .5em; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .88em; background: rgba(24, 60, 50, .08); padding: .1em .35em; border-radius: 4px; overflow-wrap: anywhere; }
small { font-size: .82em; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--ink); color: var(--paper); padding: .7rem 1rem; border-radius: 6px; font-weight: 600; }
.skip:focus { top: 1rem; color: var(--paper); }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--green); color: var(--paper); border-bottom: 3px solid var(--tangerine); }
.topnav { max-width: 1180px; margin: 0 auto; padding: .55rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.topnav a { color: var(--paper); text-decoration: none; font-weight: 600; font-size: .95rem; padding: .45rem .2rem; min-height: 44px; display: inline-flex; align-items: center; }
.topnav a:hover { text-decoration: underline; text-decoration-color: var(--tangerine); color: #fff; }
.topnav a:focus-visible { outline-color: var(--tangerine); }
.brand { font-family: var(--serif); font-size: 1.1rem; letter-spacing: .04em; }
@media (max-width: 480px) { .brand { display: none; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .65rem 1.15rem; border-radius: 999px; font: 600 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer; border: 2px solid var(--green); transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease; }
.btn-primary { background: var(--green); color: var(--paper); box-shadow: 3px 3px 0 var(--tangerine); }
.btn-primary:hover { color: #fff; background: var(--green-2); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--tangerine); }
.btn-ghost { background: transparent; color: var(--green); }
.btn-ghost:hover { background: var(--paper-2); color: var(--ink); }
.btn-small { min-height: 44px; padding: .5rem .95rem; font-size: .92rem; background: var(--paper-2); color: var(--green); }
.btn-small:hover { background: var(--tangerine-soft); }
@media (prefers-reduced-motion: reduce) { .btn, .btn:hover { transition: none; transform: none; } }

/* ---------- hero ---------- */
.hero { max-width: 1180px; margin: 0 auto; padding: clamp(2rem, 5vw, 4.5rem) 1rem 2rem; display: grid; gap: 2.5rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.25fr 1fr; } }
.crumbs { font-size: .9rem; color: var(--ink-2); margin-bottom: 1rem; }
.hero h1 { font-size: clamp(2.8rem, 1.6rem + 6vw, 5.4rem); margin: 0 0 .35em; letter-spacing: -.025em; }
.hero h1 em { font-style: italic; background: linear-gradient(transparent 62%, var(--tangerine) 62%, var(--tangerine) 88%, transparent 88%); padding: 0 .06em; }
.lede { font-size: clamp(1.1rem, 1rem + .45vw, 1.3rem); max-width: 40ch; color: var(--ink); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0; }
.disclosure { max-width: 46ch; background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: .2rem 1rem; }
.disclosure summary { cursor: pointer; font-weight: 600; padding: .6rem 0; min-height: 44px; display: flex; align-items: center; }
.disclosure p { font-size: .95rem; }

.hero-ledger { margin: 0; }
.ledger-card {
  position: relative; background: var(--paper-2); border-radius: 6px; padding: 1.5rem 1.5rem 1.2rem 3.2rem;
  box-shadow: 0 1px 0 var(--rule), 8px 10px 0 rgba(20, 32, 25, .12);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 35px, rgba(24, 60, 50, .14) 35px, rgba(24, 60, 50, .14) 36px);
  transform: rotate(-1.2deg);
}
.ledger-card::before { content: ""; position: absolute; left: 2.2rem; top: 0; bottom: 0; width: 2px; background: var(--tangerine); }
@media (prefers-reduced-motion: reduce) { .ledger-card { transform: none; } }
.ledger-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--serif); font-size: 1.25rem; margin-bottom: .5rem; }
.ledger-table { width: 100%; border-collapse: collapse; font-size: 1.05rem; }
.ledger-table th { text-align: left; font-weight: 500; padding: .45rem 0; color: var(--ink-2); }
.ledger-table td { text-align: right; font-family: var(--mono); font-size: 1.15rem; font-weight: 600; padding: .45rem 0; }
.ledger-table tr.rule th, .ledger-table tr.rule td { border-top: 2px solid var(--ink); padding-top: .6rem; }
.pos { color: var(--green); }
.neg { color: var(--neg); font-weight: 700; }
.ledger-note { font-family: var(--serif); font-style: italic; margin: .8rem 0 0; color: var(--ink-2); }

/* ---------- tags ---------- */
.tag { display: inline-block; font: 700 .68rem/1 var(--sans); letter-spacing: .07em; text-transform: uppercase; padding: .32em .55em; border-radius: 4px; border: 1.5px solid currentColor; vertical-align: .15em; white-space: nowrap; background: var(--paper-2); }
.tag-framework { color: #1B4D3E; }
.tag-evidence { color: #0F4F7A; }
.tag-interp { color: #5B3A82; }
.tag-hypo { color: #7A3A0A; border-style: dashed; }
.tag-illus { color: #3B4A42; border-style: dotted; }
.tag-fiction { color: #7A2E14; background: var(--tangerine-soft); }

/* ---------- TOC ---------- */
.toc { max-width: 1180px; margin: 0 auto 2rem; padding: 1.25rem 1rem; }
.toc h2 { font-size: 1.1rem; font-family: var(--sans); text-transform: uppercase; letter-spacing: .12em; color: var(--ink-2); margin: 0 0 .6rem; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem 2rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); counter-reset: toc; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); padding: .6rem 0; }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: .7rem; padding: .45rem .2rem; text-decoration: none; min-height: 44px; align-items: baseline; border-radius: 4px; }
.toc a::before { content: counter(toc, decimal-leading-zero); font-family: var(--mono); font-size: .85rem; color: var(--ink-2); }
.toc a:hover, .toc a[aria-current] { background: var(--paper-2); text-decoration: underline; text-decoration-color: var(--tangerine); }
.toc a[aria-current]::before { color: var(--ink); font-weight: 700; }
.legend { font-size: .85rem; color: var(--ink-2); margin: .9rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem .5rem; align-items: center; }

/* ---------- essay ---------- */
.essay { max-width: 1180px; margin: 0 auto; padding: 0 1rem 3rem; }
.chapter { max-width: var(--measure); margin: 0 auto; padding: 3rem 0 1rem; position: relative; }
.chapter + .chapter, .calc-intro + .chapter { border-top: 1px dashed var(--rule); }
.chap-no { font: 700 .85rem/1 var(--mono); color: var(--ink-2); letter-spacing: .15em; margin: 0 0 .4rem; }
.chap-no::before { content: "§ "; color: var(--tangerine); }
.label-line { font-size: .9rem; color: var(--ink-2); }
.pullquote { font-family: var(--serif); font-size: clamp(1.3rem, 1.1rem + .8vw, 1.65rem); line-height: 1.35; border-left: 4px solid var(--tangerine); padding: .3rem 0 .3rem 1.2rem; margin: 1.8rem 0; }
.context-note { font-size: .92rem; color: var(--ink-2); background: var(--paper-2); padding: .8rem 1rem; border-radius: 8px; }
.defs { padding-left: 1.2rem; }
.defs li { margin-bottom: .5rem; }
.equation { font-family: var(--serif); font-size: 1.15rem; background: var(--paper-2); border: 1px solid var(--rule); border-left: 4px solid var(--green); padding: 1rem 1.2rem; border-radius: 6px; line-height: 1.8; }
.equation span { white-space: nowrap; border-bottom: 2px solid var(--tangerine-soft); }
.try { font-size: .98rem; background: var(--tangerine-soft); padding: .8rem 1rem; border-radius: 8px; margin-top: 1.2rem; }

.calc-intro { max-width: var(--measure); margin: 0 auto; padding: 2.5rem 1.4rem 1.5rem; background: var(--green); color: var(--paper); border-radius: var(--radius); box-shadow: 6px 6px 0 var(--tangerine); }
.calc-intro h2 { color: var(--paper); margin-top: 0; }
.calc-intro a { color: var(--paper); }
.calc-intro a:hover { color: #fff; }
.calc-jump { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.calc-jump a { display: inline-flex; min-height: 44px; align-items: center; padding: .4rem .9rem; border: 1.5px solid var(--paper); border-radius: 999px; text-decoration: none; font-weight: 600; }
.calc-jump a:hover { background: rgba(238, 232, 216, .12); }
.noscript { background: var(--paper); color: var(--ink); padding: .8rem 1rem; border-radius: 8px; }

/* ---------- calculators ---------- */
.calc { background: var(--paper-2); border: 1px solid var(--rule); border-top: 6px solid var(--green); border-radius: var(--radius); padding: 1.3rem 1.2rem 1rem; margin: 2rem 0 1rem; box-shadow: 0 2px 0 var(--rule); }
@media (min-width: 1100px) { .calc-wide { margin-left: -8rem; margin-right: -8rem; } }
.calc h3 { margin-top: 0; font-size: 1.35rem; }
.calc h3:focus { outline: none; }
.calc h3:focus-visible { outline: 3px solid var(--focus); }
.calc-sub { font-size: .95rem; color: var(--ink-2); }
.fields { display: grid; gap: .9rem 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
fieldset.fields { border-top: 1px solid var(--rule); padding-top: .8rem; }
fieldset.fields legend { font: 700 .78rem/1 var(--sans); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); padding: 0 .4rem 0 0; }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field label { font-weight: 600; font-size: .95rem; line-height: 1.3; }
.unit { display: block; font-weight: 400; font-size: .82rem; color: var(--ink-2); }
input[type=number], select {
  font: 600 1.05rem/1.2 var(--mono); color: var(--ink); background: #FFFDF7;
  border: 1.5px solid #7D7462; border-radius: 6px; padding: .6rem .7rem; min-height: 44px; width: 100%;
}
input[type=number], select { margin-top: auto; }
input[type=number]:hover, select:hover { border-color: var(--green); }
input[aria-invalid="true"] { border-color: var(--neg); border-width: 2px; background: #FFF1EA; }
.errors { background: #FFF1EA; border: 2px solid var(--neg); color: var(--ink); border-radius: 8px; padding: .6rem 1rem; margin-bottom: 1rem; }
.errors-title { font-weight: 700; margin: 0 0 .3rem; color: var(--neg); }
.errors ul { margin: 0; padding-left: 1.2rem; }

.results { transition: opacity .2s ease; }
.results.is-stale .stats, .results.is-stale .recon, .results.is-stale .chart-wrap, .results.is-stale .table-scroll { opacity: .35; }
@media (prefers-reduced-motion: reduce) { .results { transition: none; } }
.stats { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); margin: 0 0 1rem; }
.stats div { background: #FFFDF7; border: 1px solid var(--rule); border-radius: 8px; padding: .7rem .8rem; }
.stats dt { font-size: .8rem; color: var(--ink-2); line-height: 1.3; }
.stats dd { margin: .2rem 0 0; font: 700 1.3rem/1.2 var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.verdict { font-family: var(--serif); font-size: 1.1rem; border-left: 4px solid var(--tangerine); padding: .2rem 0 .2rem .9rem; }
.helper { font-size: .92rem; color: var(--ink-2); }

.formula { border-top: 1px dashed var(--rule); margin-top: 1rem; padding-top: .8rem; font-size: .93rem; }
.formula p { margin: 0 0 .45rem; }
.formula-title { font: 700 .78rem/1 var(--sans) !important; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); margin-bottom: .7rem !important; }
.worked { background: #FFFDF7; border-radius: 6px; padding: .6rem .8rem; margin-top: .7rem !important; }
.caveat { color: var(--ink-2); font-style: italic; }
.calc-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; border-top: 1px solid var(--rule); margin-top: 1rem; padding-top: .8rem; }
.disclaimer { margin: 0; font-size: .85rem; font-weight: 600; color: var(--ink-2); }

.meter { margin: 0 0 1rem; }
.meter-track { position: relative; height: 14px; background: var(--paper-3); border-radius: 999px; overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: var(--green); border-radius: 999px; transition: width .35s ease; }
.meter-fill.below { background: repeating-linear-gradient(45deg, var(--tangerine) 0 6px, #D9803A 6px 12px); }
.meter-mid { position: absolute; left: 50%; top: 0; bottom: 0; border-left: 2px solid var(--ink); font-size: 0; }
@media (prefers-reduced-motion: reduce) { .meter-fill { transition: none; } }

.recon { background: #FFFDF7; border: 1px solid var(--rule); border-radius: 8px; padding: .8rem 1rem; margin: 1rem 0; max-width: 34rem; }
.recon-title { font-weight: 700; margin: 0 0 .4rem; }
.recon table { width: 100%; border-collapse: collapse; }
.recon th { text-align: left; font-weight: 500; padding: .35rem 0; }
.recon td { text-align: right; font-family: var(--mono); font-weight: 600; padding: .35rem 0; white-space: nowrap; }
.recon tr.total th, .recon tr.total td { border-top: 2px solid var(--ink); font-weight: 700; }

.chart-wrap { margin: 1rem 0; }
.chart { width: 100%; height: auto; background: #FFFDF7; border: 1px solid var(--rule); border-radius: 8px; display: block; }
.chart .grid { stroke: var(--paper-3); stroke-width: 1; }
.chart .zero { stroke: var(--ink); stroke-width: 1.5; }
.chart .tick { font: 12px var(--mono); fill: var(--ink-2); }
.chart .bar { fill: var(--green); }
.chart .bar-neg { fill: var(--tangerine); stroke: var(--neg); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart .profit-line { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-dasharray: 7 4; }
.chart .profit-dot { fill: var(--paper-2); stroke: var(--ink); stroke-width: 2; }
.chart-legend { font-size: .85rem; color: var(--ink-2); margin-top: .4rem; display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; }
.key { display: inline-block; width: 14px; height: 14px; vertical-align: middle; }
.key-bar { background: var(--green); border-radius: 2px; }
.key-line { width: 22px; height: 0; border-top: 3px dashed var(--ink); }

.table-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: 8px; background: #FFFDF7; }
.month-table, .mini { width: 100%; border-collapse: collapse; font-size: .92rem; }
.month-table caption, .mini caption { text-align: left; font-weight: 700; padding: .6rem .8rem; }
.month-table th, .month-table td { padding: .5rem .7rem; text-align: right; white-space: nowrap; border-top: 1px solid var(--paper-3); }
.month-table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); background: var(--paper-2); }
.month-table th[scope=row] { text-align: left; font-family: var(--mono); }
.month-table td { font-family: var(--mono); }

.mini th, .mini td { padding: .5rem .7rem; text-align: left; border-top: 1px solid var(--paper-3); vertical-align: top; }
.mini td { font-family: var(--mono); font-size: .9rem; }
.worked-card { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem 1.1rem; margin: 1.4rem 0; }
.worked-title { font-weight: 700; display: flex; gap: .6rem; align-items: center; }
.worked-card .mini { background: #FFFDF7; margin-bottom: 1rem; }

/* ---------- cycle diagram ---------- */
.cycle { margin: 2rem 0; }
.cycle-svg { width: 100%; height: auto; display: block; background: var(--paper-2); border-radius: var(--radius); border: 1px solid var(--rule); }
.cycle .node path { fill: #FFFDF7; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.cycle .node-cash path { fill: var(--green); }
.cycle .node-cash .n-title, .cycle .node-cash .n-sub { fill: var(--paper); }
.cycle .node-khata path { fill: var(--tangerine-soft); }
.cycle .n-title { font: 700 19px var(--serif); fill: var(--ink); text-anchor: middle; }
.cycle .n-sub { font: 13px var(--sans); fill: var(--ink-2); text-anchor: middle; }
.cycle .flow { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; }
.cycle .flow-slow { stroke-dasharray: 3 7; stroke-width: 2.6; }
.cycle .arrowhead { fill: var(--ink); }
.cycle .f-lab { font: italic 14px var(--serif); fill: var(--ink); }
.cycle .leak { stroke: var(--neg); stroke-width: 2.2; stroke-dasharray: 4 4; fill: none; }
.cycle .leak-box { fill: url(#hatch); stroke: var(--neg); stroke-width: 1.5; }
.cycle .hatch-line { stroke: var(--tangerine-soft); stroke-width: 6; }
.cycle figcaption { font-size: .92rem; color: var(--ink-2); margin-top: .6rem; }

/* ---------- scenarios ---------- */
.scenario { background: var(--paper-2); border: 1px solid var(--rule); border-left: 6px solid var(--tangerine); border-radius: var(--radius); padding: .4rem 1.2rem 1.2rem; margin: 1.4rem 0; }
.scenario h3 { margin-top: .9rem; }
.lesson { font-family: var(--serif); font-size: 1.05rem; }

/* ---------- trade-off cards ---------- */
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); margin: 1.4rem 0; }
@media (min-width: 1100px) { .cards { margin-left: -8rem; margin-right: -8rem; grid-template-columns: repeat(2, 1fr); } }
.card { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: .2rem 1.1rem 1rem; box-shadow: 4px 4px 0 rgba(20, 32, 25, .08); }
.card h3 { font-size: 1.15rem; border-bottom: 2px solid var(--tangerine); padding-bottom: .4rem; }
.who { font-size: .94rem; margin-bottom: .55rem; }
.card .note { font-size: .88rem; color: var(--ink-2); border-top: 1px dashed var(--rule); padding-top: .6rem; margin: .8rem 0 0; }

/* ---------- objections / myths ---------- */
.sub { font-size: 1.2rem; }
.objection { margin: 1rem 0 1.4rem; padding: 1rem 1.2rem; background: var(--green); color: var(--paper); border-radius: var(--radius); font-family: var(--serif); font-size: 1.15rem; }
.objection p { margin: 0; }
.limits li { margin-bottom: .6rem; }
.myths { display: grid; gap: .1rem; }
.myths dt { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; margin-top: .8rem; text-decoration: line-through; text-decoration-color: var(--tangerine); text-decoration-thickness: 2px; }
.myths dd { margin: .2rem 0 0; }

/* ---------- checklist ---------- */
.checklist { min-width: 0; border: 1px solid var(--rule); background: var(--paper-2); border-radius: var(--radius); padding: .6rem 1rem; margin: 0; }
.checklist label { overflow-wrap: anywhere; display: flex; gap: .75rem; align-items: flex-start; padding: .6rem 0; border-bottom: 1px dashed var(--rule); cursor: pointer; min-height: 44px; }
.checklist label:last-child { border-bottom: 0; }
.checklist input { width: 22px; height: 22px; margin: .15rem 0 0; accent-color: var(--green); flex: 0 0 auto; }
.check-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: .8rem; flex-wrap: wrap; }
.check-foot p { margin: 0; font-weight: 600; }

/* ---------- glossary / sources ---------- */
.glossary { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 640px) { .glossary { grid-template-columns: 13rem 1fr; } }
.glossary dt { font-weight: 700; padding: .6rem 0 0; }
@media (min-width: 640px) { .glossary dt, .glossary dd { border-top: 1px solid var(--rule); padding: .6rem 0; } }
.glossary dd { margin: 0; padding: .1rem 0 .6rem; }
.sources { padding-left: 1.3rem; }
.sources li { margin-bottom: 1.2rem; }
.sources .cite { margin-bottom: .3rem; }
.sources .what { font-size: .92rem; color: var(--ink-2); }
.medium-note { font-size: .95rem; background: var(--paper-2); padding: .8rem 1rem; border-radius: 8px; }

/* ---------- related + closing ---------- */
.rel-list { list-style: none; padding: 0; display: grid; gap: 1rem; }
.rel-list li { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem 1.1rem; }
.rel-list a { font-size: 1.1rem; display: inline-flex; min-height: 44px; align-items: center; }
.rel-list p { margin: .2rem 0 0; font-size: .95rem; }
.closing { text-align: left; }
.big-q { font-family: var(--serif); font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); line-height: 1.35; }
.end-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

.site-foot { background: var(--green); color: var(--paper); padding: 2rem 1rem; font-size: .9rem; border-top: 3px solid var(--tangerine); }
.site-foot p { max-width: 1180px; margin: 0 auto .6rem; }
.site-foot a { color: var(--paper); }
.site-foot a:hover { color: #fff; }

/* ---------- 404 ---------- */
.notfound { max-width: 40rem; margin: 0 auto; padding: 4rem 1rem; }
.notfound h1 { font-size: clamp(2.4rem, 1.6rem + 4vw, 4rem); margin-bottom: .3em; }

/* ---------- print ---------- */
@media print {
  body { background: #fff; }
  .topbar, .hero-actions, .calc-foot, .check-foot, .end-actions, .skip { display: none !important; }
  .calc, .scenario, .card { break-inside: avoid; box-shadow: none; }
  a { color: var(--ink); }
}
