/* =====================================================================
   eQuity Money — "The Ledger"  (see money/design-spec.md)
   Light mode only. No external requests: fonts are local.
   ===================================================================== */

/* Fonts: self-hosted in money/assets/fonts/ (SIL Open Font License; license texts alongside).
   Latin and Latin Extended subsets only. No Google Fonts request. Source Sans 3 is a variable
   font, so one file covers weights 400–700. */
@font-face { font-family: "Ledger Display"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/cormorant-garamond-600-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Ledger Display"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/cormorant-garamond-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Ledger Text"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/source-sans-3-var-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Ledger Text"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/source-sans-3-var-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* Color: ledger tokens + shared ink/gold/focus from the main site */
  --ledger-paper: #F6F1E4;
  --ledger-paper-deep: #ECE4CF;
  --ledger-rule: #B9C7D6;
  --ledger-margin: #B5483B;
  --ink: #2A2520;
  --ink-muted: #514B42;
  --ledger-green: #2F5B4A;
  --ledger-green-subtle: #DCE8E1;
  --gold: #B8923A;
  --focus: #24408E;
  --alert: #8A3B12;
  --on-dark: #FFFFFF;

  /* Type (same families as the main site) */
  --font-display: "Ledger Display", "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-text: "Ledger Text", "Source Sans 3", "Source Sans Pro", -apple-system, "Segoe UI", Arial, sans-serif;
  --text-xs: .75rem;
  --text-sm: .875rem;
  --text-body: 1.0625rem;
  --text-md: 1.125rem;
  --text-lg: 1.25rem;
  --text-h3: 1.375rem;
  --text-h2: 1.75rem;
  --text-h1: 2.5rem;
  --leading-tight: 1.1;
  --leading-compact: 1.4;
  --tracking-label: .08em;

  /* Baseline grid: one rule per body line. Every vertical measure in a ruled block is a
     whole multiple of this, so text sits on the lines. */
  --rule: 2rem;

  /* Space (same 4px scale as the main site) */
  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem; --space-5: 1.25rem;
  --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem; --space-16: 4rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  --reading: 42rem;
  --page: 72rem;
  --radius: .25rem;
  --rule-hair: 1px;
  --rule-double: 3px;
  --tap: 2.75rem; /* 44px */
  --header-height: 7.5rem;
  --duration: 250ms;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
@media (min-width: 64rem) {
  :root {
    --text-body: 1.125rem;
    --text-h3: 1.5rem;
    --text-h2: 2rem;
    --text-h1: 3.5rem;
    --header-height: 6rem;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ledger-paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--text-body);
  line-height: var(--rule);
  font-variant-numeric: tabular-nums lining-nums;   /* every figure lines up */
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; color: var(--ink); margin: 0 0 var(--space-3); }
h1 { font-size: var(--text-h1); line-height: var(--leading-tight); }
h2 { font-size: var(--text-h2); line-height: 1.2; }
h3 { font-size: var(--text-h3); line-height: 1.25; }
h4, .label {
  margin: 0 0 var(--space-2);
  font: 700 var(--text-sm)/var(--leading-compact) var(--font-text);
  font-variant: small-caps; letter-spacing: var(--tracking-label); text-transform: lowercase;
  color: var(--ink-muted);
}
p { margin: 0 0 var(--space-4); }
small, .small { font-size: var(--text-sm); line-height: var(--leading-compact); }
a { color: var(--ledger-green); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.container { width: 100%; max-width: var(--page); margin-inline: auto; padding-inline: var(--gutter); }
.skip-link {
  position: absolute; left: var(--space-2); top: -10rem; z-index: 60;
  padding: var(--space-2) var(--space-3); background: var(--ledger-paper); color: var(--ink);
  border: 1px solid var(--ink);
}
.skip-link:focus { top: var(--space-2); }

/* ---------- Quick exit (fixed, always visible) ---------- */
.quick-exit {
  position: fixed; top: var(--space-2); right: var(--space-2); z-index: 1000;
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: var(--tap); padding: 0 var(--space-4);
  background: var(--alert); color: var(--on-dark);
  border: 2px solid var(--alert); border-radius: var(--radius);
  font: 700 var(--text-sm)/1 var(--font-text); letter-spacing: .02em;
  text-decoration: none;
  box-shadow: 0 2px 6px rgb(42 37 32 / 25%);
}
.quick-exit:hover { color: var(--on-dark); text-decoration: underline; text-underline-offset: .2em; }
.quick-exit:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.quick-exit svg { width: 1rem; height: 1rem; }

/* ---------- Header ---------- */
.site-header {
  background: var(--ledger-paper);
  border-bottom: var(--rule-double) double var(--ink);
  box-shadow: 0 1px 0 0 var(--ledger-paper), 0 2px 0 0 var(--ledger-margin); /* red hairline under the double rule */
}
.header-main {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-6);
  padding-block: var(--space-3);
}
/* Quick exit is fixed at the top right: keep the header's own items out from under it */
@media (min-width: 64rem) { .header-main { padding-right: calc(var(--gutter) + 9.5rem); } }
@media (max-width: 63.999rem) { .header-main > .wordmark { min-height: calc(var(--tap) + var(--space-2)); align-items: center; } }
.wordmark {
  display: inline-flex; align-items: baseline; gap: var(--space-2);
  color: var(--ink); text-decoration: none;
  font-family: var(--font-display); font-weight: 600; font-size: 1.75rem; line-height: 1;
}
.wordmark:hover { color: var(--ink); }
.wordmark .q { color: var(--ledger-green); }
/* eQuity wordmark image (light version for the ledger-paper header): 52px tall, 40px on phones */
.wordmark { align-items: center; }
.wordmark .wm-img { display: block; width: auto; height: 3.25rem; }
@media (max-width: 39.999rem) { .wordmark .wm-img { height: 2.5rem; } }
.wordmark .money { font-variant: small-caps; text-transform: lowercase; letter-spacing: .06em; font-size: 1.5rem; }
.tagline { margin: 0; font-style: italic; font-family: var(--font-display); font-size: var(--text-lg); color: var(--ink-muted); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-4); }
.money-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 var(--space-5); }
.money-nav a {
  display: inline-flex; align-items: center; min-height: var(--tap);
  color: var(--ink); font-weight: 600; text-decoration: none;
  border-bottom: 2px solid transparent;
}
.money-nav a:hover { border-bottom-color: var(--ledger-rule); }
.money-nav a[aria-current="page"] { font-weight: 700; border-bottom-color: var(--ledger-green); }
.money-nav .nav-home span[aria-hidden] { margin-right: .25em; }
.search-button {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: var(--tap); min-width: var(--tap); padding: 0 var(--space-3);
  background: transparent; color: var(--ink); cursor: pointer;
  border: 1px solid var(--ink-muted); border-radius: var(--radius);
  font: 600 var(--text-sm)/1 var(--font-text);
}
.search-button:hover { background: var(--ledger-paper-deep); }
.search-button svg { width: 1.125rem; height: 1.125rem; }
@media (max-width: 63.999rem) {
  .header-main { gap: var(--space-2) var(--space-4); }
  .tagline { display: none; }
  .header-actions { order: 3; width: 100%; margin-left: 0; justify-content: space-between; }
}
@media (max-width: 39.999rem) {
  .search-button { padding: 0; justify-content: center; }
  .search-button .search-label { display: none; }
  .money-nav ul { gap: 0 var(--space-4); }
  .money-nav a { font-size: var(--text-sm); }
}

/* ---------- Back button + breadcrumb row (shared component; behavior in money.js) ---------- */
.crumb-row { display: flex; align-items: center; gap: var(--space-3); margin: 0 0 var(--space-4); }
.crumb-row .breadcrumb { min-width: 0; }
.breadcrumb ol {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2);
  font-size: var(--text-sm); line-height: var(--leading-compact); color: var(--ink-muted);
}
.breadcrumb li + li::before { content: "›"; margin-right: var(--space-2); color: var(--ink-muted); }
.breadcrumb a { color: var(--ink-muted); }
.breadcrumb [aria-current="page"] { color: var(--ink); font-weight: 600; }
.back-link {
  flex: none; display: inline-flex; align-items: center; gap: var(--space-2);
  color: var(--ink-muted); font-size: var(--text-sm); line-height: var(--leading-compact);
  text-decoration: none; border-radius: var(--radius);
}
.back-link__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: calc(var(--space-8) + var(--space-1)); height: calc(var(--space-8) + var(--space-1)); /* 36px */
  background: var(--ledger-paper); color: var(--ink);
  border: 1px solid var(--ledger-rule); border-radius: 50%;
}
.back-link__icon svg { width: var(--space-4); height: var(--space-4); }
.back-link:hover, .back-link:focus-visible { color: var(--ink); }
.back-link:hover .back-link__icon,
.back-link:focus-visible .back-link__icon { background: var(--ledger-paper-deep); border-color: var(--ledger-green); }
@media (pointer: coarse) { .back-link { min-height: var(--tap); min-width: var(--tap); justify-content: center; } } /* 44×44 target */
@media (max-width: 39.999rem) { .back-link__text { display: none; } }

/* ---------- Footer ---------- */
.site-footer { margin-top: var(--space-16); border-top: var(--rule-double) double var(--ink); padding-block: var(--space-8); font-size: var(--text-sm); line-height: var(--leading-compact); }
.site-footer .not-advice { font-weight: 700; }

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--tap); padding: 0 var(--space-5);
  border: 1px solid var(--ledger-green); border-radius: var(--radius);
  font: 700 var(--text-body)/1 var(--font-text); text-decoration: none; cursor: pointer;
}
.btn--primary { background: var(--ledger-green); color: var(--on-dark); }
.btn--primary:hover { color: var(--on-dark); box-shadow: inset 0 -3px 0 var(--ink); }
.btn--secondary { background: transparent; color: var(--ledger-green); }
.btn--secondary:hover { background: var(--ledger-green-subtle); }
.ext::after { content: " ↗"; }

/* ---------- Cards ---------- */
.card-grid { display: grid; gap: var(--space-5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 40rem) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .card-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card {
  position: relative; display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-5);
  background: var(--ledger-paper);
  border: 1px solid var(--ink-muted); border-radius: var(--radius);
  box-shadow: 0 4px 0 0 var(--ledger-paper-deep), 0 4px 0 1px var(--ink-muted); /* closed ledger book */
  line-height: var(--leading-compact);
}
.card h3 { margin: 0; }
.card p { margin: 0; color: var(--ink-muted); }
.card .card-cta { margin-top: auto; padding-top: var(--space-2); font-weight: 700; }
a.card { color: var(--ink); text-decoration: none; }
a.card:hover { background: var(--ledger-paper-deep); }
a.card:hover .card-cta { text-decoration: underline; }
.card .spot { width: 2.5rem; height: 2.5rem; color: var(--ink-muted); }

/* "Coming soon": a blank ruled ledger page */
.card--blank {
  min-height: 11rem;
  background-color: var(--ledger-paper);
  background-image: repeating-linear-gradient(to bottom, transparent 0 calc(1.5rem - 1px), var(--ledger-rule) calc(1.5rem - 1px) 1.5rem);
  background-position: 0 3rem;
  border-left: 4px double var(--ledger-margin);
  box-shadow: none;
}
.card--blank h3 { color: var(--ink-muted); }
.card--blank .soon {
  align-self: flex-start; margin-top: auto;
  padding: 0 var(--space-2); background: var(--ledger-paper);
  font: italic 600 var(--text-md)/1.4 var(--font-display); color: var(--ink-muted);
  border: 1px dashed var(--ink-muted); transform: rotate(-3deg);
}

/* ---------- Ruled long-form block: baseline grid ----------
   Rules are drawn every var(--rule) from the top of the column. Body lines are exactly
   one rule tall, and every margin/padding is a whole number of rules, so each baseline sits
   just above a rule. Headings and Entry boxes cover the rules with a solid background and
   are whole numbers of rules tall, so the lines pick up again in step below them. */
.ruled {
  position: relative;
  padding: 0 0 0 var(--space-6);
  line-height: var(--rule);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 calc(var(--rule) - 1px),
    var(--ledger-rule) calc(var(--rule) - 1px) var(--rule));
  /* nudge the rules down 2px (1/16 rule): ~0.25–0.3em under descenders, still clear of the next line's text */
  background-position: 0 calc(var(--rule) / 16);
  border-left: 4px double var(--ledger-margin);   /* the red margin: one continuous line */
}
.ruled p, .ruled ul, .ruled ol { margin: 0 0 var(--rule); }
.ruled li { line-height: var(--rule); margin: 0; }
.ruled h2, .ruled h3 {
  margin: 0 0 0 calc(-1 * var(--space-6)); padding: 0 0 0 var(--space-6); /* cover the gutter too */
  background: var(--ledger-paper);
}
.ruled h2 { line-height: calc(var(--rule) * 2); }
.ruled h3 { line-height: var(--rule); }
/* Inline pieces must not make a line taller than one rule (that would drift the grid) */
.ruled .gloss-term { height: var(--rule); line-height: var(--rule); vertical-align: top; }
.ruled .placeholder, .ruled .badge-verify { line-height: 1; }
/* Inside snapped blocks (tables, pros/cons) text uses normal line height, so terms do too */
.ruled .snap .gloss-term { height: auto; line-height: inherit; vertical-align: baseline; }
@media (max-width: 39.999rem), (forced-colors: active), (prefers-contrast: more) {
  .ruled { background-image: none; }
  /* no lines here, so headings don't need to fill whole rules */
  .ruled h2 { line-height: 1.2; margin-top: var(--space-2); margin-bottom: var(--space-3); }
}
@media (max-width: 39.999rem) { .ruled { padding-left: var(--space-4); } .ruled h2, .ruled h3 { margin-left: calc(-1 * var(--space-4)); padding-left: var(--space-4); } }

/* ---------- Entry box (ends each section) ----------
   Solid background over the rules. Height = band (1 rule) + half-rule padding top and bottom
   + one rule per line, so it's always a whole number of rules. Hairlines are inset shadows,
   which don't add height. */
.entry {
  margin: 0 0 var(--rule);
  background: var(--ledger-paper-deep);
  border-left: 4px double var(--ledger-margin);
  box-shadow: inset 0 0 0 1px var(--ink-muted);
  line-height: var(--rule);
}
.entry__band {
  padding: 0 var(--space-4);
  box-shadow: inset 0 -1px 0 var(--ink-muted);
  font: 700 var(--text-sm)/var(--rule) var(--font-text); font-variant: small-caps; text-transform: lowercase; letter-spacing: var(--tracking-label);
}
.entry ol, .ruled .entry ol { margin: 0; padding: calc(var(--rule) / 2) var(--space-4) calc(var(--rule) / 2) var(--space-10); }
.entry li { line-height: var(--rule); padding: 0; }
.entry li + li { box-shadow: inset 0 1px 0 var(--ledger-rule); }

/* ---------- Ledger table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--ink-muted); }
.table-wrap:focus-visible { outline-offset: 0; }
.ledger-table { width: 100%; border-collapse: collapse; line-height: var(--leading-compact); }
.ledger-table caption { caption-side: top; text-align: left; padding: 0 0 var(--space-2); font-size: var(--text-sm); color: var(--ink-muted); }
.ledger-table th, .ledger-table td { padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--ledger-rule); text-align: left; vertical-align: baseline; }
.ledger-table thead th {
  background: var(--ledger-paper-deep); border-bottom: 1px solid var(--ink-muted);
  font-size: var(--text-sm); font-variant: small-caps; text-transform: lowercase; letter-spacing: var(--tracking-label); color: var(--ink);
}
.ledger-table .num { text-align: right; white-space: nowrap; }
.ledger-table .minus::before { content: "− "; color: var(--ink-muted); }
.ledger-table tfoot th, .ledger-table tfoot td { border-bottom: 0; font-weight: 700; padding-top: var(--space-3); }
.total { display: inline-block; padding-bottom: 2px; border-bottom: var(--rule-double) double var(--ink); }
/* Calculators: redraw the double underline when a total changes */
.total.is-updated { animation: total-draw var(--duration) var(--ease); }
@keyframes total-draw { from { border-bottom-color: transparent; } }

/* ---------- Glossary term + popover ---------- */
.gloss { position: relative; display: inline; }
.gloss-term {
  padding: 0; margin: 0; background: none; border: 0; cursor: help;
  font: inherit; color: inherit;
  text-decoration: underline dotted var(--ledger-green); text-decoration-thickness: 2px; text-underline-offset: .2em;
}
.gloss-term:hover, .gloss-term[aria-expanded="true"] { color: var(--ledger-green); }
.gloss-pop {
  position: absolute; left: 0; top: calc(100% + var(--space-2)); z-index: 30;
  width: min(20rem, 80vw); padding: var(--space-3) var(--space-4);
  background: var(--ledger-paper); color: var(--ink);
  border: 1px solid var(--ink-muted); border-top: 4px solid var(--ledger-green-subtle);
  box-shadow: 0 6px 18px rgb(42 37 32 / 16%);
  font-size: var(--text-sm); line-height: var(--leading-compact); font-weight: 400; text-align: left;
}
.gloss-pop strong { display: block; font-family: var(--font-display); font-size: var(--text-lg); }
.gloss-pop a { display: inline-block; margin-top: var(--space-1); }

/* ---------- Moment page pieces ---------- */
.ledger-header { position: relative; padding-block: var(--space-10) var(--space-8); border-bottom: 1px solid var(--ink-muted); }
.ledger-header .eyebrow { margin: 0 0 var(--space-2); font: 700 var(--text-sm)/1.4 var(--font-text); font-variant: small-caps; text-transform: lowercase; letter-spacing: var(--tracking-label); color: var(--ink-muted); }
.one-thing { max-width: var(--reading); font-size: var(--text-md); }
.one-thing strong { font-family: var(--font-display); font-size: var(--text-lg); }
.meta-row { display: flex; align-items: center; gap: var(--space-2); color: var(--ink-muted); font-size: var(--text-sm); }
.meta-row svg { width: 1.5rem; height: 1.5rem; }
/* Carnation seal on a ribbon (decorative; one per page) */
.seal { position: absolute; top: 0; right: var(--gutter); width: 4.5rem; pointer-events: none; }
.seal__ribbon {
  display: block; width: 1.25rem; height: 3.5rem; margin: 0 auto -.5rem;
  background: var(--ledger-margin);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
}
.seal__disc {
  display: flex; align-items: center; justify-content: center;
  width: 4.5rem; height: 4.5rem; border-radius: 50%;
  background: var(--ledger-paper); border: 2px solid var(--gold);
  box-shadow: 0 0 0 3px var(--ledger-paper), 0 0 0 4px var(--gold);
  color: var(--ink);
  /* hand-colored petals: a wash of the margin red, mixed from tokens */
  --accent-subtle: color-mix(in srgb, var(--ledger-margin) 32%, var(--ledger-paper));
}
.seal__disc svg { width: 3.25rem; height: 3.25rem; }
@media (max-width: 39.999rem) { .seal { width: 3.5rem; } .seal__disc { width: 3.5rem; height: 3.5rem; } .seal__disc svg { width: 2.5rem; height: 2.5rem; } .seal__ribbon { height: 2rem; } }
/* The eQuity seal image (assets/img/logo/equity-seal-green-200.png) is the disc: it has its own ring,
   so no drawn border. 72px; 64px on phones (never smaller: the ring lettering stops being legible). */
.seal__disc { border: 0; box-shadow: none; background: var(--ledger-paper); }
.seal__disc img { display: block; width: 100%; height: auto; }
@media (max-width: 39.999rem) { .seal { width: 4rem; } .seal__disc { width: 4rem; height: 4rem; } }

.moment-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-8); padding-top: var(--space-8); } /* minmax: wide tables scroll in their own box */
@media (min-width: 64rem) { .moment-layout { grid-template-columns: 15rem minmax(0, 1fr); align-items: start; } }
.contents { line-height: var(--leading-compact); }
@media (min-width: 64rem) { .contents { position: sticky; top: var(--space-6); } }
.contents ol { list-style: none; margin: 0; padding: 0; }
.contents li + li { border-top: 1px dotted var(--ledger-rule); }
.contents li a { display: block; padding-block: var(--space-2); color: var(--ink); text-decoration: none; }
.contents li a:hover { text-decoration: underline; }
.strip { margin-top: var(--space-12); }
.help-list { list-style: none; margin: 0; padding: 0; line-height: var(--rule); }
.help-list li { padding: var(--space-3) 0; border-top: 1px solid var(--ledger-rule); }
.help-list .name { display: block; font-weight: 700; }
.sources ol, .sources ul { font-size: var(--text-sm); line-height: var(--leading-compact); }
.sources li { margin-bottom: var(--space-2); }
.last-reviewed { font-size: var(--text-sm); color: var(--ink-muted); }

/* Notices */
.notice { padding: var(--space-3) var(--space-4); border-left: 4px solid var(--alert); background: var(--ledger-paper-deep); line-height: var(--leading-compact); }
.notice .label { color: var(--alert); }

/* Editing markers (same meaning as the main site) */
.badge-verify {
  display: inline; padding: 0 var(--space-1);
  background: var(--ledger-paper-deep); color: var(--alert);
  border: 1px dashed var(--alert); border-radius: var(--radius);
  font: 600 var(--text-xs)/1.6 var(--font-text); white-space: normal;
}
.placeholder { padding: 0 var(--space-1); background: var(--ledger-paper-deep); border: 1px dotted var(--ink-muted); color: var(--ink-muted); font-size: var(--text-sm); }


/* ---------- Search dialog (shared ../assets/js/search.js), ledger styling ---------- */
html.search-open { overflow: hidden; }
.search-layer { position: fixed; inset: 0; z-index: 100; }
.search-layer[hidden] { display: none; }
.search-backdrop { position: absolute; inset: 0; background: var(--ink); opacity: .6; }
.search-dialog {
  position: relative; display: flex; flex-direction: column;
  width: min(calc(100% - 2 * var(--gutter)), var(--reading));
  max-height: calc(100vh - 2 * var(--space-8)); max-height: calc(100dvh - 2 * var(--space-8));
  margin: var(--space-8) auto 0;
  background: var(--ledger-paper); color: var(--ink);
  border: var(--rule-hair) solid var(--ink-muted); border-top: 2px solid var(--gold);
  border-radius: var(--radius); box-shadow: 0 8px 22px rgb(42 37 32 / 16%);
  animation: nav-in var(--duration) var(--ease);
}
@media (max-width: 39.999rem) {
  .search-dialog { margin-top: var(--space-4); max-height: calc(100vh - 2 * var(--space-4)); max-height: calc(100dvh - 2 * var(--space-4)); }
}
.search-head { padding: var(--space-4) var(--space-4) var(--space-3); border-bottom: var(--rule-hair) solid var(--ledger-rule); }
.search-label {
  display: block; margin-bottom: var(--space-2);
  font: 700 var(--text-xs)/var(--leading-compact) var(--font-text);
  letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--ink-muted);
}
.search-field { display: flex; align-items: center; gap: var(--space-2); }
.search-field > svg { flex: none; width: var(--space-5); height: var(--space-5); color: var(--ink-muted); }
.search-input {
  flex: 1; min-width: 0; min-height: calc(var(--space-10) + var(--space-1));
  padding: var(--space-2) var(--space-3);
  background: var(--ledger-paper); color: var(--ink);
  border: var(--rule-hair) solid var(--ink-muted); border-radius: var(--radius);
  font: 400 var(--text-md)/var(--leading-compact) var(--font-text);
}
.search-input::-webkit-search-cancel-button { display: none; }
.search-close {
  flex: none; min-height: calc(var(--space-10) + var(--space-1)); padding: 0 var(--space-3);
  background: transparent; color: var(--ink); cursor: pointer;
  border: var(--rule-hair) solid var(--ink-muted); border-radius: var(--radius);
  font: 600 var(--text-sm)/var(--leading-compact) var(--font-text);
}
.search-close:hover { border-color: var(--ink); background: var(--ledger-paper-deep); }
.search-body { overflow-y: auto; overscroll-behavior: contain; padding: var(--space-2) 0 var(--space-4); }
.search-group + .search-group { margin-top: var(--space-2); border-top: var(--rule-hair) solid var(--ledger-rule); }
.search-group-title {
  margin: 0; padding: var(--space-3) var(--space-4) var(--space-1);
  font: 700 var(--text-xs)/var(--leading-compact) var(--font-text);
  letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--ink-muted);
}
.search-results { list-style: none; margin: 0; padding: 0; }
.search-result {
  position: relative; display: block; padding: var(--space-2) var(--space-4);
  color: var(--ink); text-decoration: none;
}
/* dotted divider between results, inset like the nav panel */
.search-results li + li > .search-result::after {
  content: ""; position: absolute; top: 0; left: var(--space-4); right: var(--space-4);
  border-top: var(--rule-hair) dotted var(--ink-muted); pointer-events: none;
}
.search-result:hover, .search-result:focus { background: var(--ledger-paper-deep); color: var(--ink); }
.search-result:focus { outline: var(--rule-double) solid var(--focus); outline-offset: calc(-1 * var(--rule-double)); }
.search-result:hover::after, .search-result:focus::after,
.search-results li:hover + li > .search-result::after,
.search-results li:has(> .search-result:focus) + li > .search-result::after { visibility: hidden; }
.search-result-title {
  font-weight: 700;
  /* plain green underline on the hovered / active result */
  padding-bottom: var(--space-1);
  text-decoration: underline 2px transparent; text-underline-offset: .25em;
}
.search-result:hover .search-result-title,
.search-result:focus .search-result-title { text-decoration-color: var(--ledger-green); }
.search-result .ext-icon { width: var(--space-3); height: var(--space-3); vertical-align: middle; margin-left: var(--space-1); }
.search-result-crumb { display: block; margin-top: var(--space-1); font-size: var(--text-xs); color: var(--ink-muted); }
.search-result-snippet { display: block; margin-top: var(--space-1); font-size: var(--text-sm); color: var(--ink-muted); }
.search-result mark { background: var(--ledger-green-subtle); color: var(--ink); border-radius: var(--radius); }
.search-more {
  margin: var(--space-1) var(--space-4) 0; padding: var(--space-1) 0;
  background: none; border: 0; cursor: pointer;
  color: var(--ledger-green); font: 700 var(--text-sm)/var(--leading-compact) var(--font-text);
  text-decoration: underline; text-underline-offset: var(--space-1);
}
.search-empty { padding: var(--space-3) var(--space-4); margin: 0; }
.search-hint { margin: var(--space-2) 0 0; font-size: var(--text-xs); color: var(--ink-muted); }
@media (prefers-reduced-motion: reduce) {
  .search-dialog { animation: none; }
  .search-result-title { transition: none; }
}
@keyframes nav-in { from { opacity: 0; transform: translateY(-.25rem); } }

/* ---------- Page heads (index, tools, glossary, help) ---------- */
.page-head { padding-block: var(--space-10) var(--space-8); border-bottom: 1px solid var(--ink-muted); }
.page-head .lead { max-width: var(--reading); font-size: var(--text-md); color: var(--ink-muted); margin: 0; }
.page-head .eyebrow, .eyebrow { margin: 0 0 var(--space-2); font: 700 var(--text-sm)/1.4 var(--font-text); font-variant: small-caps; text-transform: lowercase; letter-spacing: var(--tracking-label); color: var(--ink-muted); }
.section-block { padding-top: var(--space-10); }
.section-block > h2 { margin-bottom: var(--space-5); }
.privacy-line { max-width: var(--reading); color: var(--ink-muted); font-size: var(--text-sm); line-height: var(--leading-compact); }

/* Disclaimer + crisis box + browsing-safely note */
.callout { max-width: var(--reading); margin: var(--space-6) 0 0; padding: var(--space-3) var(--space-4); border: 1px solid var(--ink-muted); background: var(--ledger-paper); font-size: var(--text-sm); line-height: var(--leading-compact); }
.callout p { margin: 0; }
.crisis { max-width: var(--reading); margin-top: var(--space-6); padding: var(--space-4) var(--space-5); background: var(--ledger-paper-deep); border-left: 4px solid var(--alert); line-height: var(--leading-compact); }
.crisis .label { color: var(--alert); }
.crisis ul { margin: 0 0 var(--space-2); padding-left: var(--space-5); }
.crisis li { margin-bottom: var(--space-2); }
.crisis p:last-child { margin: 0; }
.browse-safely { max-width: var(--reading); margin-top: var(--space-6); padding: var(--space-4) var(--space-5); border: 1px solid var(--ink-muted); background: var(--ledger-paper); line-height: var(--leading-compact); }
.browse-safely h2 { font-size: var(--text-h3); margin-bottom: var(--space-2); }
.browse-safely ul { margin: 0; padding-left: var(--space-5); }
.browse-safely li { margin-bottom: var(--space-2); }

/* ---------- Glossary page: a ledger index ---------- */
.gloss-index { max-width: var(--reading); }
.gloss-letter { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: var(--space-4); padding-block: var(--space-4); border-top: 1px solid var(--ledger-rule); }
.gloss-letter > h2 { margin: 0; font-size: var(--text-h2); line-height: 1; color: var(--ledger-margin); }
.gloss-letter dl { margin: 0; line-height: var(--leading-compact); }
.gloss-letter dt { font-weight: 700; margin-top: var(--space-3); }
.gloss-letter dt:first-child { margin-top: 0; }
.gloss-letter dd { margin: var(--space-1) 0 0; color: var(--ink); }

/* ---------- Tools ---------- */
.tool { display: grid; gap: var(--space-8); margin-top: var(--space-8); align-items: start; }
@media (min-width: 64rem) { .tool { grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); } }
.tool-inputs { padding: var(--space-5); border: 1px solid var(--ink-muted); background: var(--ledger-paper); line-height: var(--leading-compact); }
.tool-inputs fieldset { border: 0; margin: 0; padding: 0; }
.tool-inputs legend { padding: 0; margin-bottom: var(--space-3); font: 600 var(--text-h3)/1.25 var(--font-display); }
.field { margin-bottom: var(--space-5); }
.field:last-child { margin-bottom: 0; }
.field > label, .field > .field-label { display: block; margin-bottom: var(--space-1); font-weight: 700; }
.field .hint { display: block; margin-top: var(--space-1); font-size: var(--text-sm); color: var(--ink-muted); }
.field .error { display: block; margin-top: var(--space-1); font-size: var(--text-sm); color: var(--alert); font-weight: 600; }
.money-input { display: flex; align-items: stretch; }
.money-input > span { display: inline-flex; align-items: center; padding: 0 var(--space-3); background: var(--ledger-paper-deep); border: 1px solid var(--ink-muted); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); }
input[type="text"], input[type="number"], select {
  min-height: var(--tap); width: 100%; padding: var(--space-2) var(--space-3);
  background: var(--ledger-paper); color: var(--ink);
  border: 1px solid var(--ink-muted); border-radius: var(--radius);
  font: 400 var(--text-body)/1.3 var(--font-text); font-variant-numeric: tabular-nums;
}
.money-input input { border-radius: 0 var(--radius) var(--radius) 0; text-align: right; }
input[aria-invalid="true"] { border-color: var(--alert); border-width: 2px; }
.check { display: flex; gap: var(--space-3); align-items: flex-start; }
.check input { width: 1.25rem; height: 1.25rem; margin: .15rem 0 0; accent-color: var(--ledger-green); flex: none; }
input[type="range"] { width: 100%; accent-color: var(--ledger-green); min-height: var(--tap); }
.range-row { display: flex; align-items: center; gap: var(--space-3); }
.range-row output { min-width: 5.5rem; font-weight: 700; }
.tool-results { line-height: var(--leading-compact); }
.tool-summary { margin: var(--space-3) 0 0; font-size: var(--text-md); }
.tool-results .ledger-table td.num { font-size: var(--text-md); }
.how { max-width: var(--reading); margin-top: var(--space-6); border-top: 1px solid var(--ink-muted); padding-top: var(--space-3); line-height: var(--leading-compact); }
.how summary { cursor: pointer; font-weight: 700; color: var(--ledger-green); min-height: var(--tap); display: flex; align-items: center; }
.how[open] summary { margin-bottom: var(--space-2); }
.how ul { padding-left: var(--space-5); }
.estimate-line { font-weight: 700; }

/* Budget sheet */
.budget-group { margin-top: var(--space-5); }
.budget-group h2 { font-size: var(--text-h3); display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); margin-bottom: var(--space-2); }
.budget-group h2 .group-total { font: 700 var(--text-body)/1 var(--font-text); }
.budget-rows { list-style: none; margin: 0; padding: 0; }
.budget-row { display: grid; grid-template-columns: minmax(0, 1fr) 8.5rem var(--tap); gap: var(--space-2); align-items: center; padding-block: var(--space-1); border-bottom: 1px solid var(--ledger-rule); }
@media (max-width: 30rem) { .budget-row { grid-template-columns: minmax(0, 1fr) 6.5rem var(--tap); } }
.icon-btn { min-height: var(--tap); min-width: var(--tap); display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--ink); border: 1px solid var(--ink-muted); border-radius: var(--radius); cursor: pointer; font: 700 var(--text-lg)/1 var(--font-text); }
.icon-btn:hover { background: var(--ledger-paper-deep); }
.text-btn { margin-top: var(--space-2); padding: 0; min-height: var(--tap); background: none; border: 0; cursor: pointer; color: var(--ledger-green); font: 700 var(--text-body)/1 var(--font-text); text-decoration: underline; text-underline-offset: .2em; }
.split-bars { margin-top: var(--space-6); }
.split-bar { display: flex; height: 2.25rem; border: 1px solid var(--ink-muted); background: var(--ledger-paper); overflow: hidden; }
.split-bar span { display: flex; align-items: center; justify-content: center; min-width: 0; font-size: var(--text-xs); font-weight: 700; white-space: nowrap; overflow: hidden; border-right: 1px solid var(--ink-muted); }
.split-bar span:last-child { border-right: 0; }
.split-bar .seg-needs { background: var(--ledger-paper-deep); color: var(--ink); }
.split-bar .seg-wants { background: var(--ledger-green-subtle); color: var(--ink); }
.split-bar .seg-savings { background: var(--ledger-green); color: var(--on-dark); }
.split-bar .seg-left { background: var(--ledger-paper); color: var(--ink-muted); }
.split-legend { margin: var(--space-1) 0 var(--space-4); font-size: var(--text-sm); color: var(--ink-muted); }

/* ---------- Savings goals + credit card pages (November 2026) ---------- */
/* Blocks in a ruled column that money.js pads up to a whole number of rules */
.ruled .snap { margin: 0 0 var(--rule); background: var(--ledger-paper); line-height: var(--leading-compact); }
.ruled .snap .table-wrap { background: var(--ledger-paper); }

/* Starter checklist (feeds the planner) */
.goal-checklist fieldset { margin: 0; padding: var(--space-4); border: 1px solid var(--ink-muted); }
.goal-checklist legend { padding: 0 var(--space-2); margin: 0; }
.goal-checklist ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1) var(--space-6); }
@media (min-width: 48rem) { .goal-checklist ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.goal-checklist li { line-height: var(--leading-compact); padding-block: var(--space-1); }
.goal-checklist label { display: inline-flex; gap: var(--space-2); align-items: flex-start; cursor: pointer; }
.goal-checklist input[type="checkbox"] { width: 1.15rem; height: 1.15rem; margin: .2rem 0 0; accent-color: var(--ledger-green); flex: none; }
.goal-checklist .goal-other { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.goal-checklist .goal-other input[type="text"] { width: auto; flex: 1 1 10rem; min-height: var(--tap); }
.goal-checklist__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin: var(--space-4) 0 0; }

/* Pros and cons: a two-column ledger */
.ledger-cols { display: grid; grid-template-columns: minmax(0, 1fr); border: 1px solid var(--ink-muted); }
@media (min-width: 48rem) { .ledger-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ledger-col + .ledger-col { border-left: 1px solid var(--ink-muted); } }
@media (max-width: 47.999rem) { .ledger-col + .ledger-col { border-top: 1px solid var(--ink-muted); } }
.ledger-col h3 {
  margin: 0 !important; padding: var(--space-2) var(--space-4) !important; line-height: 1.4 !important;
  background: var(--ledger-paper-deep) !important; border-bottom: 1px solid var(--ink-muted);
  font: 700 var(--text-sm)/1.4 var(--font-text); font-variant: small-caps; text-transform: lowercase; letter-spacing: var(--tracking-label);
}
.ledger-col--pros h3 { color: var(--ledger-green); }
.ledger-col--cons h3 { color: var(--alert); }
.ledger-col ul { list-style: none; margin: 0 !important; padding: 0; }
.ledger-col li { line-height: var(--leading-compact) !important; border-top: 1px dotted var(--ledger-rule); }
.ledger-col li:first-child { border-top: 0; }
.ledger-col details { padding: var(--space-2) var(--space-4); }
.ledger-col summary { cursor: pointer; font-weight: 600; min-height: var(--tap); display: flex; align-items: center; gap: var(--space-2); list-style: none; }
.ledger-col summary::-webkit-details-marker { display: none; }
.ledger-col summary::before { content: "+"; flex: none; width: 1.25rem; height: 1.25rem; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--ink-muted); border-radius: 50%; font-weight: 700; line-height: 1; }
.ledger-col details[open] summary::before { content: "−"; }
.ledger-col details p { margin: 0 0 var(--space-2) !important; color: var(--ink); }

/* Habits checklist inside an Entry box */
.entry li:has(.habit) { list-style: none; margin-left: calc(-1 * var(--space-6)); }
/* block-level flex so each habit is exactly one rule per line (inline-flex would stretch the line box) */
.habit { display: flex; gap: var(--space-2); align-items: flex-start; line-height: var(--rule); cursor: pointer; }
.habit input { width: 1.1rem; height: 1.1rem; margin: calc((var(--rule) - 1.1rem) / 2) 0 0; accent-color: var(--ledger-green); flex: none; }

/* Timeframe tag */
.tag {
  display: inline-block; padding: 0 var(--space-2); border: 1px solid var(--ink-muted); border-radius: 999px;
  font: 700 var(--text-xs)/1.6 var(--font-text); font-variant: small-caps; text-transform: lowercase; letter-spacing: var(--tracking-label);
  background: var(--ledger-paper);
}
.tag--short { background: var(--ledger-green-subtle); }
.tag--medium { background: var(--ledger-paper-deep); }
.tag--long { background: var(--ledger-paper); border-style: double; border-width: 3px; }

/* Savings goal planner */
.planner { margin-top: var(--space-10); padding-top: var(--space-6); border-top: var(--rule-double) double var(--ink); line-height: var(--leading-compact); }
.planner__title { margin-bottom: var(--space-2); }
.planner-options { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3) var(--space-6); margin: var(--space-4) 0; }
.planner-options .field { margin: 0; min-width: 12rem; }
.planner-options .check { align-self: center; }
.planner-table { min-width: 0; }
.planner-table td { vertical-align: middle; }
.planner-table input[type="text"], .planner-table select { min-width: 0; }
.planner-table .money-input input { width: 5.5rem; }
.planner-table th, .planner-table td { padding: var(--space-2); }
.planner-table .money-input > span { padding: 0 var(--space-2); }
.planner-table td[data-label="Goal"] input { min-width: 9rem; }
.date-pick { display: flex; gap: var(--space-1); }
.date-pick select { width: auto; padding-inline: var(--space-2); }
.planner-table td[data-out="need"] { font-weight: 700; white-space: nowrap; }
.planner-table tr.is-issue td[data-out="need"] { color: var(--alert); font-weight: 600; white-space: normal; }
.planner-table tr.is-done td[data-out="need"] { color: var(--ledger-green); }
.planner-table tfoot th { text-align: right; }
.planner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin: var(--space-3) 0; }
.text-btn:disabled { color: var(--ink-muted); text-decoration: none; cursor: not-allowed; }
.planner-note { min-height: 1.4em; margin: var(--space-2) 0; font-weight: 600; }
.planner-note.is-short { color: var(--alert); }
.print-only { display: none; }
/* Phones and tablets: each goal becomes a small ledger card */
@media (max-width: 63.999rem) {
  .planner-wrap { overflow: visible; border: 0; }
  .planner-table, .planner-table tbody, .planner-table tr, .planner-table td, .planner-table tfoot { display: block; width: 100%; }
  .planner-table thead { display: none; }
  .planner-table caption { display: block; }
  .planner-table tbody tr { margin-bottom: var(--space-4); padding: var(--space-3); border: 1px solid var(--ink-muted); background: var(--ledger-paper); }
  .planner-table td { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-1) 0; border: 0; text-align: right; }
  .planner-table td::before { content: attr(data-label); flex: none; font-size: var(--text-sm); font-weight: 700; color: var(--ink-muted); text-align: left; }
  .planner-table td.planner-remove::before { content: none; }
  .planner-table td.planner-remove { justify-content: flex-end; }
  .planner-table td[data-label="Goal"] input { min-width: 0; flex: 1; }
  .planner-table tfoot tr { display: flex; justify-content: space-between; align-items: baseline; padding: var(--space-3); border: 1px solid var(--ink-muted); }
  .planner-table tfoot th, .planner-table tfoot td { display: inline; width: auto; padding: 0; }
  .planner-table tfoot td:empty { display: none; }
}

/* Credit card self-check */
.cardcheck { max-width: var(--reading); margin-top: var(--space-8); line-height: var(--leading-compact); }
.cardcheck__set { margin: 0; padding: 0; border: 0; }
.cardcheck__set > legend { padding: 0; margin-bottom: var(--space-4); font: 600 var(--text-h3)/1.25 var(--font-display); }
.yn { margin: 0 0 var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--ink-muted); background: var(--ledger-paper); }
.yn legend { padding: 0 var(--space-1); font-weight: 600; }
.yn .hint { display: block; font-size: var(--text-sm); color: var(--ink-muted); }
.yn__opts { display: flex; gap: var(--space-6); margin-top: var(--space-2); }
.yn__opts label { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap); cursor: pointer; }
.yn__opts input { width: 1.15rem; height: 1.15rem; accent-color: var(--ledger-green); }
.cardcheck__result { margin-top: var(--space-6); padding: var(--space-4) var(--space-5); background: var(--ledger-paper-deep); border-left: 4px double var(--ledger-margin); }
.cardcheck__result p:last-child { margin-bottom: 0; }
.cc-close { font-size: var(--text-sm); color: var(--ink-muted); }

/* Print or save as PDF: only the plan, on one page */
@media print {
  body.print-plan .quick-exit, body.print-plan .site-header, body.print-plan .site-footer, body.print-plan .skip-link { display: none !important; }
  body.print-plan main > .container > *:not(.planner),
  body.print-plan main > .container > section:not(.planner),
  body.print-plan .planner .planner-options, body.print-plan .planner .planner-actions,
  body.print-plan .planner .privacy-line, body.print-plan .planner .planner-remove,
  body.print-plan .planner .estimate-line + *, body.print-plan .moment-layout, body.print-plan .ledger-header, body.print-plan .page-head { display: none !important; }
  body.print-plan .planner { margin: 0; padding: 0; border: 0; }
  body.print-plan .print-only { display: block; }
  body.print-plan .planner-wrap, body.print-plan .planner-note:empty { display: none !important; }
  body.print-plan [data-print-table] table { width: 100%; font-size: 10.5pt; }
  body.print-plan [data-print-table] th, body.print-plan [data-print-table] td { padding: 4pt 6pt; }
  body.print-plan .table-wrap { border: 0; overflow: visible; }
  @page { margin: 14mm; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .quick-exit, .site-header .header-actions, .seal { display: none !important; }
  .ruled { background-image: none; }
}
