/* SaralPaisa — design system (advanced release).
   Direction: paper ivory, deep-green ink, haldi gold. One signature element — the result card as a
   bahi-khata / passbook slip (gold binding edge, ruled rows, tabular numerals). Everything else stays quiet.
   rem-based so the page follows the reader's text size (tested at 200%). System fonts only: no font downloads.
   Themes: light (default), dark, or the device setting; [data-theme] on <html> is set by assets/theme.js. */

:root {
  color-scheme: light;
  --bg: #faf7ef;          /* paper ivory */
  --surface: #fffdf8;     /* card paper */
  --surface-2: #f3eedf;   /* sand: input panels, table heads */
  --ink: #1c2b25;         /* body text */
  --ink-strong: #123f31;  /* deep green: headings, primary numbers */
  --muted: #55635c;
  --line: #e4dccb;
  --line-strong: #cfc4ab;
  --brand: #145a42;       /* buttons, links */
  --brand-ink: #ffffff;
  --brand-soft: #e3efe8;
  --link: #135c43;
  --gold: #c8962a;        /* binding edge, focus, rules */
  --gold-ink: #7d5a0f;    /* gold used as text */
  --gold-soft: #f7ecd2;
  --good: #1d6f47;
  --good-soft: #e2f1e8;
  --bad: #a8261d;
  --bad-soft: #fbe9e6;
  --series-a: #0e7c56;    /* chart pair validated (light): CVD ΔE 8.4, contrast ≥ 3:1 on --surface */
  --series-b: #b8780c;
  --shadow: 0 1px 2px rgba(18, 63, 49, .06), 0 6px 18px rgba(18, 63, 49, .07);
  --radius-s: 0.5rem;
  --radius: 0.875rem;
  --maxw: 74rem;
  --read: 44rem;
  --header-h: 4rem;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1714; --surface: #16211c; --surface-2: #1d2a24;
  --ink: #e8ede6; --ink-strong: #f2f5ef; --muted: #a9b7ae;
  --line: #2c3b34; --line-strong: #3d4f46;
  --brand: #8fd3ae; --brand-ink: #0f1714; --brand-soft: #1f3a2f; --link: #9bdcb7;
  --gold: #e2b65a; --gold-ink: #e8c372; --gold-soft: #3a3020;
  --good: #8fd3ae; --good-soft: #1c3a2c; --bad: #ff9a8f; --bad-soft: #3d201d;
  --series-a: #30aa79; --series-b: #c4861c;   /* validated against --surface (dark) */
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 22px rgba(0, 0, 0, .25);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1714; --surface: #16211c; --surface-2: #1d2a24;
    --ink: #e8ede6; --ink-strong: #f2f5ef; --muted: #a9b7ae;
    --line: #2c3b34; --line-strong: #3d4f46;
    --brand: #8fd3ae; --brand-ink: #0f1714; --brand-soft: #1f3a2f; --link: #9bdcb7;
    --gold: #e2b65a; --gold-ink: #e8c372; --gold-soft: #3a3020;
    --good: #8fd3ae; --good-soft: #1c3a2c; --bad: #ff9a8f; --bad-soft: #3d201d;
    --series-a: #30aa79; --series-b: #c4861c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 22px rgba(0, 0, 0, .25);
  }
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans Devanagari", "Nirmala UI", "Mangal", Roboto, sans-serif;
  font-size: 1.0625rem; line-height: 1.7; color: var(--ink); background: var(--bg);
  overflow-wrap: break-word; text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; 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: 0.5rem; top: -5rem; background: var(--brand); color: var(--brand-ink); padding: 0.625rem 1rem; border-radius: var(--radius-s); z-index: 60; }
.skip:focus { top: 0.5rem; }
[hidden] { display: none !important; }
.no-js .js-only { display: none !important; }
.ico { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.25em; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

h1, h2, h3 { color: var(--ink-strong); line-height: 1.3; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.6vw, 2.75rem); font-weight: 800; margin: 0 0 0.75rem; letter-spacing: -0.012em; }
h2 { font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.6rem); font-weight: 750; margin: 2.75rem 0 0.75rem; }
h3 { font-size: 1.18rem; font-weight: 700; margin: 1.75rem 0 0.5rem; }
h2[id], h3[id] { scroll-margin-top: calc(var(--header-h) + 1.25rem); }
p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.35rem; }
li { margin-bottom: 0.35rem; }
.muted { color: var(--muted); }
.num, .tnum { font-variant-numeric: tabular-nums; }
strong { font-weight: 700; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1rem; }
@media (min-width: 48rem) { .wrap { padding: 0 1.5rem; } }
.read { max-width: var(--read); }
main { display: block; padding-bottom: 1rem; }
main:focus { outline: none; }

/* ------------------------------------------------------------------ header */
.hdr-static .site-header { position: static; }
html.hdr-static { scroll-padding-top: 0.5rem; }
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom: 1px solid var(--line); }
@supports not (background: color-mix(in srgb, red 50%, blue)) { .site-header { background: var(--bg); } }
.site-header .wrap { display: flex; align-items: center; gap: 0.5rem; min-height: var(--header-h); flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 800; font-size: min(1.375rem, 6.5vw); color: var(--ink-strong); text-decoration: none; margin-right: auto; letter-spacing: -0.01em; min-width: 0; }
.brand-mark { width: 2rem; height: 2rem; border-radius: 0.6rem; background: var(--ink-strong); color: var(--gold); display: grid; place-items: center; flex: none; box-shadow: inset 0 -3px 0 var(--gold); }
:root[data-theme="dark"] .brand-mark { background: var(--surface-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-mark { background: var(--surface-2); } }
.brand-mark .ico { width: 1.15rem; height: 1.15rem; stroke-width: 2.1; }
.nav { display: flex; align-items: center; gap: 0.125rem; }
.nav a { color: var(--ink); text-decoration: none; padding: 0.5rem 0.7rem; border-radius: var(--radius-s); font-size: 0.98rem; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--ink-strong); font-weight: 700; box-shadow: inset 0 -2px 0 var(--gold); border-radius: 0; }
.hbtn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 2.75rem; min-width: 2.75rem; padding: 0 0.7rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: 0.95rem; cursor: pointer; text-decoration: none; }
.hbtn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.hbtn .ico { width: 1.2rem; height: 1.2rem; }
.hbtn-label { white-space: nowrap; }
.menu-btn { display: none; }
@media (max-width: 60rem) {
  .menu-btn { display: inline-flex; }
  .search-btn .hbtn-label { display: none; }
  .nav { display: none; order: 10; width: 100%; flex-direction: column; align-items: stretch; padding: 0.25rem 0 0.75rem; gap: 0; }
  .nav.open { display: flex; }
  .nav a { padding: 0.75rem 0.5rem; border-bottom: 1px solid var(--line); border-radius: 0; white-space: normal; }
  .nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--gold); padding-left: 0.875rem; }
  .no-js .nav { display: flex; flex-direction: row; flex-wrap: wrap; }
  .no-js .nav a { border: 0; padding: 0.4rem 0.5rem; }
}
@media (max-width: 22.5rem) { .hbtn { padding: 0 0.5rem; min-width: 2.75rem; } .site-header .wrap { gap: 0.3rem; } .brand { font-size: 1.1rem; gap: 0.4rem; } .brand-mark { width: 1.85rem; height: 1.85rem; } }

/* ------------------------------------------------------------------ breadcrumbs, page head */
.crumbs { font-size: 0.92rem; color: var(--muted); margin: 1.25rem 0 0.5rem; }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.crumbs li { margin: 0; }
.crumbs li:not(:last-child)::after { content: "›"; margin-left: 0.35rem; color: var(--line-strong); }
.crumbs a { color: var(--muted); }
.meta { font-size: 0.92rem; color: var(--muted); margin-bottom: 1.25rem; }
.lede { font-size: 1.12rem; color: var(--ink); }

/* ------------------------------------------------------------------ buttons, chips */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; font: inherit; font-size: 0.97rem; font-weight: 600; line-height: 1.3;
  min-height: 2.75rem; padding: 0.55rem 1rem; border-radius: var(--radius-s); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-strong); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink-strong); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--link); padding-left: 0.5rem; padding-right: 0.5rem; }
.btn.quiet:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn .ico { width: 1.1rem; height: 1.1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0; padding: 0; list-style: none; }
.chip { font: inherit; font-size: 0.93rem; min-height: 2.75rem; padding: 0.35rem 0.85rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink-strong); color: var(--surface); border-color: var(--ink-strong); }
:root[data-theme="dark"] .chip[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); } }

/* ------------------------------------------------------------------ home */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem 2.5rem; padding: 1.5rem 0 0.5rem; align-items: start; }
@media (min-width: 60rem) { .hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); padding-top: 3rem; } }
.hero h1 { font-size: clamp(1.9rem, 1.2rem + 3.2vw, 3.1rem); line-height: 1.22; max-width: 15em; }
.hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 34rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.25rem 0 0.5rem; }
.hero-points { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: 0.5rem; font-size: 0.97rem; color: var(--muted); }
.hero-points li { display: flex; gap: 0.55rem; align-items: flex-start; margin: 0; }
.hero-points .ico { color: var(--good); margin-top: 0.2rem; }
.quick { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.1rem 1.25rem; border-left: 6px solid var(--gold); }
.quick h2 { margin: 0 0 0.25rem; font-size: 1.2rem; display: flex; gap: 0.5rem; align-items: center; }
.quick .q-fields { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 0.8fr); gap: 0.6rem; margin-top: 0.75rem; }
@media (max-width: 26rem) { .quick .q-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .quick .q-fields .field:first-child { grid-column: 1 / -1; } }
.quick .field { margin-bottom: 0.25rem; }
.quick-out { margin-top: 0.75rem; border-top: 1px dashed var(--line-strong); padding-top: 0.75rem; }
.quick-out .big { font-size: clamp(1.8rem, 1.3rem + 2.4vw, 2.4rem); font-weight: 800; color: var(--ink-strong); margin: 0; line-height: 1.15; font-variant-numeric: tabular-nums; }
.quick-out .sub { color: var(--muted); font-size: 0.95rem; margin: 0.25rem 0 0.5rem; }
.quick .handoff-note { font-size: 0.85rem; color: var(--muted); margin: 0.5rem 0 0; line-height: 1.5; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 0.5rem 1rem; margin: 3rem 0 0.25rem; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--muted); }
.filterbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem; margin: 1rem 0 0.25rem; }
@media (min-width: 48rem) { .filterbar { grid-template-columns: minmax(0, 1fr) minmax(14rem, 20rem); align-items: center; } }
.filterbar .chips { margin: 0; }
.searchbox { position: relative; }
.searchbox .ico { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.searchbox input { width: 100%; font: inherit; font-size: 1rem; min-height: 2.75rem; padding: 0.5rem 0.75rem 0.5rem 2.6rem; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink); }
.count { font-size: 0.92rem; color: var(--muted); margin: 0.5rem 0; }
.empty { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 1rem 1.1rem; color: var(--ink); background: var(--surface); }
.empty p { margin: 0 0 0.5rem; }

/* tool directory: a ruled ledger list, not identical cards */
.tool-list { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 2rem; border-top: 1px solid var(--line); }
@media (min-width: 48rem) { .tool-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tool-list li { margin: 0; border-bottom: 1px solid var(--line); }
.tool-row { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) auto; gap: 0.25rem 0.85rem; align-items: center; padding: 0.85rem 0.25rem; text-decoration: none; color: var(--ink); }
.tool-row:hover .t-name { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; }
.t-ico { width: 2.6rem; height: 2.6rem; border-radius: 0.7rem; display: grid; place-items: center; background: var(--brand-soft); color: var(--ink-strong); grid-row: span 2; }
:root[data-theme="dark"] .t-ico { color: var(--brand); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .t-ico { color: var(--brand); } }
.t-ico .ico { width: 1.35rem; height: 1.35rem; }
.t-name { font-weight: 700; color: var(--ink-strong); font-size: 1.05rem; line-height: 1.35; }
.t-blurb { color: var(--muted); font-size: 0.93rem; line-height: 1.5; grid-column: 2; }
.t-go { color: var(--muted); grid-row: span 2; }
.t-badge { font-size: 0.75rem; font-weight: 700; color: var(--gold-ink); background: var(--gold-soft); border-radius: 999px; padding: 0.05rem 0.5rem; margin-left: 0.35rem; vertical-align: 0.1em; white-space: nowrap; }

.tradeoff { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-top: 0.75rem; }
.tradeoff table { margin: 0.5rem 0 0.25rem; }
@media (max-width: 26rem) { .tradeoff { padding: 0.85rem 0.7rem; } .tradeoff th, .tradeoff td { padding-left: 0.4rem; padding-right: 0.4rem; } }
.share-bar { display: block; height: 0.5rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 0.35rem; min-width: 4rem; }
.share-bar i { display: block; height: 100%; background: var(--series-b); border-radius: 999px; }
.guide-list { list-style: none; padding: 0; margin: 0.75rem 0 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 2rem; border-top: 1px solid var(--line); }
@media (min-width: 48rem) { .guide-list.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.guide-list li { margin: 0; border-bottom: 1px solid var(--line); padding: 0.85rem 0.1rem; }
.guide-list a { font-weight: 700; font-size: 1.05rem; color: var(--ink-strong); text-decoration: none; display: inline-flex; gap: 0.5rem; align-items: flex-start; }
.guide-list a .ico { color: var(--gold-ink); margin-top: 0.2rem; }
.guide-list a:hover span { text-decoration: underline; text-decoration-color: var(--gold); }
.guide-list p { margin: 0.2rem 0 0 1.75rem; font-size: 0.93rem; color: var(--muted); line-height: 1.5; }
.method { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.25rem 2rem; margin-top: 0.75rem; }
@media (min-width: 48rem) { .method { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.method h3 { font-size: 1.05rem; margin: 1rem 0 0.25rem; display: flex; gap: 0.5rem; align-items: center; }
.method h3 .ico { color: var(--gold-ink); }
.method p { color: var(--muted); font-size: 0.97rem; margin: 0; }
.method-note { color: var(--muted); font-size: 0.97rem; margin: 1.25rem 0 0; max-width: 46rem; }
.favs { background: var(--gold-soft); border-radius: var(--radius); padding: 0.75rem 1rem 0.5rem; margin-top: 1.5rem; }
.favs h2 { font-size: 1.05rem; margin: 0 0 0.25rem; }
.favs ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.favs li { margin: 0; }

/* hubs (section pages) */
.hub-intro { display: flex; gap: 1rem; align-items: flex-start; }
.hub-intro .t-ico { width: 3.25rem; height: 3.25rem; grid-row: auto; }
.decide { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.decide li { padding: 0.65rem 0 0.65rem 1rem; border-left: 3px solid var(--gold); margin: 0 0 0.6rem; background: var(--surface); border-radius: 0 var(--radius-s) var(--radius-s) 0; }

/* legacy tiles (kept for any page still using them) */
.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: 0.875rem; margin: 1.5rem 0 2.5rem; }
.calc-tile { display: block; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-left: 5px solid var(--gold); border-radius: var(--radius-s); padding: 1rem 1.125rem; background: var(--surface); }
.calc-tile strong { display: block; font-size: 1.1rem; color: var(--ink-strong); }
.calc-tile span { color: var(--muted); font-size: 0.95rem; line-height: 1.5; display: block; margin-top: 0.25rem; }
.post-list { list-style: none; padding: 0; margin: 0 0 2.5rem; }
.post-list li { border-bottom: 1px solid var(--line); padding: 0.875rem 0; margin: 0; }
.post-list a { font-size: 1.1rem; font-weight: 700; text-decoration: none; color: var(--ink-strong); }
.post-list small { display: block; color: var(--muted); font-size: 0.93rem; }

/* ------------------------------------------------------------------ tool page */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.5rem; margin: 0.75rem 0 0.25rem; }
.toolbar .presets { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-right: auto; }
.toolbar .presets-label { font-size: 0.9rem; color: var(--muted); margin-right: 0.15rem; }
.toolbar .chip { min-height: 2.75rem; }
.toolbar .btn { min-height: 2.75rem; padding: 0.35rem 0.7rem; font-size: 0.92rem; }
.fav-btn[aria-pressed="true"] { color: var(--gold-ink); border-color: var(--gold); background: var(--gold-soft); }
.fav-btn[aria-pressed="true"] .ico { fill: currentColor; }
.toolbar-note { flex-basis: 100%; font-size: 0.88rem; color: var(--muted); margin: 0.25rem 0 0; }
.toolbar-note.ok { color: var(--good); }
.toolbar-note.err { color: var(--bad); }
.result-jump { display: none; }
@media (max-width: 60rem) { .result-jump { display: inline-flex; } }
.noscript { background: var(--gold-soft); border-left: 4px solid var(--gold); padding: 0.75rem 1rem; border-radius: 0 var(--radius-s) var(--radius-s) 0; }

.scope { border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 0 var(--radius-s) var(--radius-s) 0; padding: 0.75rem 1rem; margin: 1rem 0; font-size: 0.98rem; background: var(--surface); }
.scope p { margin: 0 0 0.375rem; }
.scope ul { margin: 0.25rem 0 0; }

.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: calc(var(--radius) + 0.25rem); padding: 1.5rem; margin: 1rem 0 1.25rem; align-items: start; }
@media (min-width: 60rem) {
  .calc > div:last-child { position: sticky; top: calc(var(--header-h) + 1rem); max-height: calc(100vh - var(--header-h) - 2rem); overflow-y: auto; overscroll-behavior: contain; padding: 2px; margin: -2px; }
  .calc.wide > div:last-child { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 60rem) { .calc { grid-template-columns: minmax(0, 1fr); padding: 1.1rem 1rem; } }
fieldset { border: 0; padding: 0; margin: 0 0 1.125rem; min-width: 0; }
legend { font-weight: 700; font-size: 1rem; padding: 0; margin-bottom: 0.4rem; color: var(--ink-strong); }
.field { margin-bottom: 1.1rem; }
.field > label, .field .label { display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; font-weight: 600; font-size: 0.98rem; margin-bottom: 0.35rem; color: var(--ink); line-height: 1.45; }
.field input[type="number"], .field input[type="text"], .field input[type="search"], .field select, .q-in {
  width: 100%; font: inherit; font-size: 1.1rem; padding: 0.6rem 0.75rem; border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink); min-height: 2.875rem; font-variant-numeric: tabular-nums;
}
.field input:hover, .field select:hover { border-color: var(--muted); }
.field input:focus-visible, .field select:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; border-color: var(--ink-strong); }
.field input[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); background: var(--bad-soft); }
.field input[type="range"] { width: 100%; accent-color: var(--brand); margin-top: 0.6rem; min-height: 1.5rem; }
.hint, .slider-note { font-size: 0.87rem; color: var(--muted); line-height: 1.5; margin: 0.3rem 0 0; }
.field-err { color: var(--bad); font-size: 0.9rem; font-weight: 600; margin: 0.35rem 0 0; display: flex; gap: 0.35rem; }
.field-err::before { content: "!"; display: inline-grid; place-items: center; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: var(--bad); color: var(--surface); font-size: 0.75rem; font-weight: 800; flex: none; margin-top: 0.2rem; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.625rem; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.98rem; margin: 0.4rem 0; line-height: 1.5; }
.check input { width: 1.3rem; height: 1.3rem; margin-top: 0.15rem; flex: none; accent-color: var(--brand); }
.seg { display: flex; border: 1px solid var(--line-strong); border-radius: var(--radius-s); overflow: hidden; background: var(--surface); }
.seg button { flex: 1; font: inherit; font-size: 0.97rem; border: 0; background: none; padding: 0.55rem 0.5rem; cursor: pointer; color: var(--ink); min-height: 2.75rem; line-height: 1.35; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button[aria-pressed="true"] { background: var(--ink-strong); color: var(--surface); font-weight: 700; }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); } }

/* the signature: result as a passbook slip */
.ledger { position: relative; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--gold); border-radius: var(--radius); padding: 1.15rem 1.25rem 1.25rem; min-width: 0; box-shadow: var(--shadow); }
.ledger h3 { margin: 0 0 0.35rem; font-size: 1rem; color: var(--muted); font-weight: 600; }
.ledger .big { font-size: clamp(1.9rem, 1.4rem + 2.6vw, 2.6rem); font-weight: 800; line-height: 1.12; color: var(--ink-strong); margin: 0 0 0.2rem; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; letter-spacing: -0.015em; }
.ledger .big.good { color: var(--good); }
.ledger .sub { font-size: 0.95rem; color: var(--muted); margin: 0 0 0.75rem; }
.ledger .tag { float: right; margin: 0 0 0.25rem 0.5rem; font-size: 0.78rem; font-weight: 700; color: var(--gold-ink); border: 1.5px solid var(--gold); border-radius: 0.35rem; padding: 0.05rem 0.45rem; background: var(--gold-soft); }
.ledger .table-scroll { clear: both; }   /* overflow:auto makes a new block context that would otherwise squeeze beside the floated tag */
.explain { font-size: 0.98rem; line-height: 1.65; background: var(--brand-soft); border-radius: var(--radius-s); padding: 0.65rem 0.8rem; margin: 0.25rem 0 0.75rem; color: var(--ink); }
.explain:empty { display: none; }
.row { display: flex; align-items: baseline; gap: 0.5rem; font-size: 0.99rem; padding: 0.5rem 0; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.row:last-of-type { border-bottom: 0; }
.row .k { color: var(--muted); line-height: 1.4; flex: 1 1 9rem; min-width: 0; }
.row .v { font-weight: 700; font-variant-numeric: tabular-nums; margin-left: auto; text-align: right; overflow-wrap: anywhere; color: var(--ink-strong); }
.row.total { border-top: 2px solid var(--ink-strong); border-bottom: 0; margin-top: 0.25rem; padding-top: 0.65rem; font-size: 1.08rem; }
.row.total .k { color: var(--ink-strong); font-weight: 700; }
.verdict { background: var(--good-soft); color: var(--ink); border-left: 4px solid var(--good); border-radius: 0 var(--radius-s) var(--radius-s) 0; padding: 0.6rem 0.8rem; font-weight: 600; font-size: 0.98rem; margin: 0.75rem 0 0; }
.caveat { background: var(--gold-soft); color: var(--ink); border-radius: var(--radius-s); padding: 0.6rem 0.8rem; font-size: 0.95rem; margin: 0.75rem 0 0; }
.verdict:empty, .caveat:empty { display: none; }
.blocked { background: var(--bad-soft); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); color: var(--ink); border-radius: var(--radius); padding: 0.9rem 1rem; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0; }
.actions .btn { max-width: 100%; text-align: center; }   /* long labels (e.g. an amount in the label) wrap instead of overflowing */
.assume { font-size: 0.97rem; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.4rem 1.1rem 0.85rem; margin: 0 0 1.5rem; background: var(--surface); }
.assume summary { font-size: 1.02rem; color: var(--ink-strong); }
.assume ul { margin: 0.5rem 0 0; }

/* scenario comparison (baseline vs now) */
.scenario { margin: 1rem 0 0; border-top: 1px dashed var(--line-strong); padding-top: 0.85rem; }
.scenario h4 { margin: 0 0 0.35rem; font-size: 0.98rem; color: var(--ink-strong); }
.scenario p { font-size: 0.9rem; color: var(--muted); margin: 0 0 0.5rem; }
.scenario table { margin: 0.25rem 0 0.5rem; font-size: 0.92rem; }
.scenario .v { display: block; }
.scenario .delta { display: block; font-size: 0.84rem; color: var(--muted); }
.scenario .delta.up { color: var(--bad); }
.scenario .delta.down { color: var(--good); }
.scenario .btns { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.scenario .btn { min-height: 2.75rem; font-size: 0.9rem; padding: 0.35rem 0.7rem; }
.cmp-box { margin: 1rem 0 0; border-top: 1px dashed var(--line-strong); padding-top: 0.85rem; }
.cmp-box h4 { margin: 0 0 0.35rem; font-size: 0.98rem; color: var(--ink-strong); }
.cmp-box p { margin: 0; font-size: 0.95rem; }

.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 40rem) { .compare { grid-template-columns: minmax(0, 1fr); } }
.offer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; min-width: 0; }
.offer legend { font-size: 1.05rem; }
.offer h3 { margin: 0 0 0.75rem; font-size: 1.05rem; }
.calc.wide { grid-template-columns: minmax(0, 1fr); }

/* budget / list editors */
.rows-editor { display: grid; gap: 0.5rem; margin: 0.25rem 0 0.5rem; }
.rows-editor .r { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; gap: 0.4rem; align-items: center; }
.rows-editor.exp .r { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto auto auto; }
.rows-editor input, .rows-editor select { font: inherit; font-size: 1rem; min-height: 2.75rem; padding: 0.45rem 0.6rem; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); color: var(--ink); width: 100%; min-width: 0; }
.rows-editor input[aria-invalid="true"] { border-color: var(--bad); background: var(--bad-soft); }
.rows-editor .del { min-width: 2.75rem; padding: 0; }
@media (max-width: 34rem) {
  .rows-editor .r, .rows-editor.exp .r { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; padding: 0.5rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
  .rows-editor .r .lab { grid-column: 1 / -1; }
  .rows-editor.exp .r .grp { grid-column: 1 / 3; }
}

/* charts */
.chart { margin: 0.5rem 0 1.25rem; }
.chart svg { width: 100%; height: auto; display: block; }
.chart text { font-size: 13px; fill: var(--muted); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .sa { fill: var(--series-a); }
.chart .sb { fill: var(--series-b); }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.88rem; color: var(--ink); margin-bottom: 0.25rem; }
.sw { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 3px; margin-right: 0.375rem; vertical-align: baseline; }
.sw-a { background: var(--series-a); }
.sw-b { background: var(--series-b); }
.bar { display: flex; height: 0.7rem; border-radius: 999px; overflow: hidden; margin: 0.875rem 0 0.375rem; background: var(--surface-2); gap: 2px; }
.bar i { display: block; height: 100%; }
.bar .a { background: var(--series-a); }
.bar .b { background: var(--series-b); }

/* ------------------------------------------------------------------ content */
.note { background: var(--gold-soft); border-left: 4px solid var(--gold); padding: 0.85rem 1rem; border-radius: 0 var(--radius-s) var(--radius-s) 0; margin: 1.25rem 0; }
.keypoints { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.85rem 1.1rem 0.5rem; margin: 1.25rem 0 1.75rem; }
.keypoints h2 { font-size: 1.05rem; margin: 0 0 0.35rem; }
.keypoints ul { margin: 0; }
.example { border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 0 var(--radius) var(--radius) 0; background: var(--surface); padding: 0.85rem 1.1rem 0.4rem; margin: 1.25rem 0; }
.example .ex-label { font-size: 0.85rem; font-weight: 700; color: var(--gold-ink); margin: 0 0 0.25rem; }
.stale { background: var(--bad-soft); border-left: 4px solid var(--bad); padding: 0.75rem 1rem; border-radius: 0 var(--radius-s) var(--radius-s) 0; margin: 1rem 0; }
table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: 0.98rem; }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 700; color: var(--ink-strong); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num { white-space: nowrap; } /* numbers never break; headers wrap so a long label cannot widen its column */
.fy-table td:first-child { min-width: 6.25rem; } /* keeps "2026-27" on one line; a partial-year note wraps below it */
.table-scroll { overflow-x: auto; max-width: 100%; border-radius: var(--radius-s); }
.table-scroll:focus-visible { outline: 3px solid var(--gold); }
.toc { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.85rem 1.1rem; margin: 1.25rem 0; font-size: 0.98rem; background: var(--surface); }
.toc strong { display: block; margin-bottom: 0.25rem; color: var(--ink-strong); }
.toc ol { margin: 0; }
details { border-bottom: 1px solid var(--line); padding: 0.75rem 0; }
summary { font-weight: 700; cursor: pointer; font-size: 1.05rem; color: var(--ink-strong); }
details p { margin: 0.5rem 0 0; }
.formula { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92rem; overflow-x: auto; background: var(--surface-2); border-radius: var(--radius-s); padding: 0.6rem 0.8rem; }
.next-steps { margin-top: 2.75rem; }
.next-steps h2 { margin-top: 0; }
.next-steps ul { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.next-steps li { margin: 0; border-bottom: 1px solid var(--line); }
.next-steps a { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) auto; gap: 0.1rem 0.75rem; padding: 0.8rem 0.1rem; text-decoration: none; color: var(--ink); align-items: center; }
.next-steps a .ico.lead-ico { color: var(--gold-ink); grid-row: span 2; width: 1.5rem; height: 1.5rem; }
.next-steps a strong { color: var(--ink-strong); }
.next-steps a span { grid-column: 2; color: var(--muted); font-size: 0.93rem; line-height: 1.5; }
.next-steps a .ico.go { grid-row: span 2; grid-column: 3; color: var(--muted); }
.next-steps a:hover strong { text-decoration: underline; text-decoration-color: var(--gold); }
.sources { font-size: 0.93rem; border-top: 1px solid var(--line); margin-top: 2.5rem; padding-top: 1rem; }
.sources h2 { font-size: 1.15rem; margin-top: 0; }
.sources .st { font-size: 0.78rem; font-weight: 700; border-radius: 999px; padding: 0.05rem 0.5rem; background: var(--surface-2); }
.byline { font-size: 0.93rem; border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1rem; color: var(--muted); }

/* ------------------------------------------------------------------ dialogs (search, save, share) */
dialog.dlg { border: 1px solid var(--line); border-radius: var(--radius); padding: 0; width: min(40rem, calc(100vw - 1.5rem)); max-height: min(44rem, calc(100vh - 3rem)); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
dialog.dlg::backdrop { background: rgba(12, 22, 18, .55); }
.dlg-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 0.85rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.dlg-head h2 { margin: 0; font-size: 1.1rem; margin-right: auto; }
.dlg-body { padding: 0.9rem 1rem 1.1rem; overflow-y: auto; }
.dlg-body p { font-size: 0.97rem; }
.dlg .field input[type="text"] { font-size: 1.05rem; }
.dlg-foot { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; margin-top: 0.75rem; }
.search-dlg[open] { display: flex; flex-direction: column; }
dialog.dlg:not([open]) { display: none; }
.search-in { flex: 1; min-width: 0; font: inherit; font-size: 1.1rem; min-height: 2.875rem; border: 1px solid var(--line-strong); border-radius: var(--radius-s); padding: 0.5rem 0.75rem 0.5rem 2.6rem; background: var(--surface); color: var(--ink); }
.search-in::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search-field { position: relative; flex: 1; min-width: 0; display: flex; }
.search-field .ico { position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-results { list-style: none; margin: 0; padding: 0.35rem; overflow-y: auto; }
.search-results li { margin: 0; }
.search-results a { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: 0 0.7rem; padding: 0.6rem 0.6rem; border-radius: var(--radius-s); text-decoration: none; color: var(--ink); align-items: center; }
.search-results a:hover, .search-results a:focus-visible { background: var(--surface-2); outline-offset: -2px; }
.search-results .t-ico { width: 2.2rem; height: 2.2rem; border-radius: 0.55rem; grid-row: span 2; }
.search-results .t-ico .ico { width: 1.15rem; height: 1.15rem; }
.search-results strong { color: var(--ink-strong); font-size: 1rem; }
.search-results span.d { grid-column: 2; font-size: 0.88rem; color: var(--muted); line-height: 1.45; }
.search-results mark { background: var(--gold-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-meta { display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; font-size: 0.86rem; color: var(--muted); padding: 0.5rem 1rem; border-top: 1px solid var(--line); }
.search-empty { padding: 0.75rem 1rem 1rem; }
@media (max-width: 40rem) { dialog.dlg { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100%; margin: 0; border-radius: 0; border: 0; } .kbd-hint { display: none; } }
.preview { white-space: pre-wrap; font-size: 0.95rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.75rem; margin: 0.5rem 0; font-variant-numeric: tabular-nums; }
.plan-list { list-style: none; padding: 0; margin: 0.5rem 0; border-top: 1px solid var(--line); }
.plan-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; padding: 0.65rem 0; border-bottom: 1px solid var(--line); margin: 0; }
.plan-list .pl-name { font-weight: 700; color: var(--ink-strong); margin-right: auto; min-width: 0; overflow-wrap: anywhere; }
.plan-list .pl-meta { flex-basis: 100%; font-size: 0.86rem; color: var(--muted); }
.plan-list .btn { min-height: 2.75rem; padding: 0.3rem 0.65rem; font-size: 0.9rem; }
.status { font-size: 0.93rem; margin: 0.5rem 0; }
.status.ok { color: var(--good); }
.status.err { color: var(--bad); }

/* ------------------------------------------------------------------ ads (only when configured) */
.ad-slot { margin: 2.5rem 0; padding: 0.5rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 18rem; }
.ad-label { font-size: 0.8rem; color: var(--muted); margin: 0 0 0.25rem; }
.ad-slot ins { display: block; }
/* Adsterra Native Banner (one per eligible page, after the content). The third-party markup gets a light box in both
   themes so text designed for white pages stays readable. It can never widen the page on a small phone: an ad wider
   than the screen scrolls sideways inside its own box instead of being cut off (Adsterra forbids hiding parts of ads). While the
   box is empty (still loading, no fill, or blocked by an ad blocker) the label and frame are hidden; the slot itself
   stays in the layout (zero height), so the ad script still finds a visible container. */
.ad-slot.ad-native { min-height: 0; max-width: var(--read); margin: 2.5rem 0 1.5rem; padding: 0; border: 0; }
.ad-native .ad-label { margin: 0 0 0.35rem; }
.ad-native [id^="container-"] { color-scheme: light; background: #ffffff; color: #1b1b1b; border-radius: var(--radius-s); max-width: 100%; overflow-x: auto; overflow-y: visible; }
.ad-native [id^="container-"] img, .ad-native [id^="container-"] iframe { max-width: 100%; height: auto; }
.ad-native:has([id^="container-"]:empty) .ad-label { display: none; }
.ad-native:not(:has([id^="container-"]:empty)) { padding: 0.5rem 0 0.75rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ad-native:not(:has([id^="container-"]:empty)) [id^="container-"] { padding: 0.5rem; border: 1px solid var(--line-strong); }
.ad-check { margin-top: 0.75rem; padding: 0.6rem 0.8rem; border: 1px dashed var(--line-strong); border-radius: var(--radius-s); font-size: 0.9rem; }
.ad-check ul { margin: 0.25rem 0 0; padding-left: 1.2rem; overflow-wrap: anywhere; }
.ad-notice { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem;
  padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom, 0px)); background: var(--surface); color: var(--ink);
  border-top: 2px solid var(--gold); box-shadow: 0 -4px 16px rgba(0, 0, 0, .12); font-size: 0.9rem; line-height: 1.5; }
.ad-notice p { margin: 0; flex: 1 1 16rem; max-width: 52rem; }
.ad-notice .btn { flex: none; }
.has-ad-notice body { padding-bottom: 9rem; }
@media (min-width: 48rem) { .has-ad-notice body { padding-bottom: 5rem; } }

/* ------------------------------------------------------------------ footer */
/* Below-the-fold blocks without in-page anchors: the browser skips their layout until they come near the screen.
   contain-intrinsic-size "auto" remembers the real height once rendered, so the scrollbar settles after the first pass. */
.cv { content-visibility: auto; contain-intrinsic-size: auto 42rem; }
.site-footer.cv { contain-intrinsic-size: auto 34rem; }
@media print { .cv { content-visibility: visible; } }
.site-footer { background: #10271f; color: #d7e2db; margin-top: 4.5rem; padding: 2.5rem 0 2rem; font-size: 0.95rem; border-top: 4px solid var(--gold); }
:root[data-theme="dark"] .site-footer { background: #0a110e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .site-footer { background: #0a110e; } }
.site-footer a { color: #ffffff; text-decoration-color: rgba(255, 255, 255, .4); }
.site-footer h2 { color: #ffffff; font-size: 1rem; margin: 0 0 0.5rem; }
.foot-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 1.5rem; margin-bottom: 1.5rem; }
@media (min-width: 48rem) { .foot-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.foot-cols ul { list-style: none; padding: 0; margin: 0; }
.foot-cols li { margin: 0 0 0.35rem; }
.site-footer p { max-width: 46rem; line-height: 1.65; color: #c9d6ce; }
.foot-brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 800; color: #fff; font-size: 1.1rem; margin-bottom: 0.5rem; }

/* ------------------------------------------------------------------ print */
#print-sheet { display: none; }
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #f2f2f2; --ink: #000; --ink-strong: #000; --muted: #333; --line: #bbb; --line-strong: #888; --gold: #000; --series-a: #0e7c56; --series-b: #b8780c; }
  body { background: #fff; color: #000; font-size: 10.5pt; line-height: 1.5; }
  .site-header, .site-footer, .skip, .ad-slot, .ad-notice, .actions, .toc, .calc-inputs, .print-hide, .read > *:not(.print-keep), .crumbs, .scope,
  .chart, [data-blocked], .toolbar, .scenario .btns, .next-steps, dialog, .noscript, .favs { display: none !important; }
  #print-sheet { display: block; margin-bottom: 1rem; border: 1px solid #000; padding: 0.6rem 0.8rem; }
  #print-sheet h2 { margin: 0 0 0.25rem; font-size: 13pt; }
  #print-sheet dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.2rem 1rem; font-size: 9.5pt; margin: 0.5rem 0 0; }
  #print-sheet dt { font-weight: 700; }
  .print-label { font-weight: 700; display: inline-block; font-size: 9pt; }
  .calc { display: block; background: none; padding: 0; border: 0; margin: 0; }
  .calc > div:last-child { position: static; max-height: none; overflow: visible; }
  .ledger { border: 1px solid #000; border-left: 4px solid #000; box-shadow: none; break-inside: avoid; }
  .explain { background: none; border: 1px dashed #666; }
  .read > .print-keep, .assume { display: block !important; }
  .assume { border: 0; padding: 0; }
  .table-scroll { overflow: visible; }
  table { font-size: 9pt; }
  th { background: #eee !important; }
  h1 { font-size: 15pt; }
  a { color: #000; text-decoration: none; }
  .sources a::after { content: " (" attr(href) ")"; font-size: 8pt; }
}

/* ------------------------------------------------------------------ motion + small screens */
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
@media (prefers-reduced-motion: no-preference) {
  .ledger .big { transition: color .2s ease; }
  dialog.dlg[open] { animation: dlg-in .16s ease-out; }
  @keyframes dlg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
@media (max-width: 30rem) {
  .ledger { padding: 1rem 0.9rem; }
  .ledger th, .ledger td { padding: 0.5rem 0.3rem; font-size: 0.875rem; }
  .ledger td:first-child { min-width: 5.5rem; }
  h2 { margin-top: 2.25rem; }
}
@media (max-width: 22.5rem) {
  .calc { padding: 0.875rem 0.625rem; }
  .ledger { padding: 0.875rem 0.7rem; }
  .ledger th, .ledger td { padding: 0.45rem 0.2rem; font-size: 0.8125rem; }
  .ledger td:first-child { min-width: 4.5rem; }
  .pair { gap: 0.4rem; }
}
@media (forced-colors: active) { .ledger, .quick { border: 1px solid CanvasText; } .chip[aria-pressed="true"], .seg button[aria-pressed="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; } }
/* my-plans: the file input is visually hidden, so its label shows the keyboard focus */
.file-in:focus-visible + label.btn { outline: 3px solid var(--gold); outline-offset: 2px; }
.hint.warn { color: var(--gold-ink); font-weight: 600; }
