/* PnLol design tokens: "Ledger". Light = day ledger (warm paper), dark = night ledger (green-black).
   Source of truth for every color, size and font in style.css. Contrast of each text/background pair is checked by
   `node tools/contrast.mjs` (pairs in tools/contrast-pairs.json). Bundled in front of style.css by site/build.mjs. */

@font-face { font-family: "Inter"; src: url(/fonts/inter-var.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(/fonts/plex-mono-400.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(/fonts/plex-mono-500.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(/fonts/plex-mono-600.woff2) format("woff2"); font-weight: 600 700; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  /* paper and ink */
  --bg: #f4f1e8;
  --surface: #fffdf7;
  --surface-2: #ece8da;
  --zebra: #f7f4ea;
  --ink: #1b1d1a;
  --ink-2: #595c54;
  --on-ink: #fffdf7;
  --rule: #ddd7c6;
  --rule-strong: #858071;
  /* action */
  --accent: #1b1d1a;
  --accent-ink: #fffdf7;
  --accent-hover: #3a3d37;
  --link: #1d4cb8;
  --focus: #1d4cb8;
  --highlight: #ffd84d;
  --highlight-ink: #1b1d1a;
  --inv-mark: #ffd84d;
  /* meaning */
  --gain: #0a6636;
  --loss: #b3261e;
  --warn-bg: #fbf0c9;
  --warn-ink: #5c4300;
  --warn-rule: #e3c766;
  --err-bg: #fbe4e1;
  --err-ink: #8a1c14;
  --err-rule: #e9a49c;
  --ok-bg: #e2f1e5;
  --ok-ink: #0d5129;
  --ok-rule: #9fcfab;
  --stamp-ok: #0a6636;
  --stamp-review: #8a5a00;
  --stamp-loss: #b3261e;
  --stamp-preview: #3f4b8c;

  /* type */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --fs-xs: 0.75rem;      /* 12 stamps, column labels */
  --fs-sm: 0.8125rem;    /* 13 meta, disclaimer */
  --fs-md: 0.875rem;     /* 14 table cells, hints */
  --fs-base: 1rem;       /* 16 body */
  --fs-lg: 1.125rem;     /* 18 lead */
  --fs-xl: 1.375rem;     /* 22 h3, mobile figures */
  --fs-2xl: 1.75rem;     /* 28 h2, desktop figures */
  --fs-3xl: 2.25rem;     /* 36 h1 on inner pages, prices */
  --fs-display: clamp(2.25rem, 1.4rem + 3.6vw, 3.5rem);

  /* space, shape */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;
  --r-sm: 4px; --r-md: 8px; --r-lg: 12px;
  --hair: 1px;
  --wrap: 1120px;
  --shadow: 0 1px 0 rgba(27, 29, 26, 0.04), 0 8px 24px -12px rgba(27, 29, 26, 0.18);
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1210;
  --surface: #131a17;
  --surface-2: #1b2420;
  --zebra: #111815;
  --ink: #e9ede6;
  --ink-2: #a2aca4;
  --on-ink: #0d1210;
  --rule: #26312c;
  --rule-strong: #66736c;
  --accent: #e9ede6;
  --accent-ink: #0d1210;
  --accent-hover: #ffffff;
  --link: #93b4ff;
  --focus: #93b4ff;
  --highlight: #ffd84d;
  --highlight-ink: #1b1d1a;
  --inv-mark: #0a6636;
  --gain: #5dd395;
  --loss: #ff8f85;
  --warn-bg: #2a2410;
  --warn-ink: #f3d785;
  --warn-rule: #5e4d1a;
  --err-bg: #2c1513;
  --err-ink: #ffb3ab;
  --err-rule: #6a2a24;
  --ok-bg: #12261a;
  --ok-ink: #a6e8bf;
  --ok-rule: #2a5a3b;
  --stamp-ok: #5dd395;
  --stamp-review: #f0c463;
  --stamp-loss: #ff8f85;
  --stamp-preview: #a9b6ff;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d1210;
    --surface: #131a17;
    --surface-2: #1b2420;
    --zebra: #111815;
    --ink: #e9ede6;
    --ink-2: #a2aca4;
    --on-ink: #0d1210;
    --rule: #26312c;
    --rule-strong: #66736c;
    --accent: #e9ede6;
    --accent-ink: #0d1210;
    --accent-hover: #ffffff;
    --link: #93b4ff;
    --focus: #93b4ff;
    --highlight: #ffd84d;
    --highlight-ink: #1b1d1a;
    --inv-mark: #0a6636;
    --gain: #5dd395;
    --loss: #ff8f85;
    --warn-bg: #2a2410;
    --warn-ink: #f3d785;
    --warn-rule: #5e4d1a;
    --err-bg: #2c1513;
    --err-ink: #ffb3ab;
    --err-rule: #6a2a24;
    --ok-bg: #12261a;
    --ok-ink: #a6e8bf;
    --ok-rule: #2a5a3b;
    --stamp-ok: #5dd395;
    --stamp-review: #f0c463;
    --stamp-loss: #ff8f85;
    --stamp-preview: #a9b6ff;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  }
}

/* PnLol components. Every color/size comes from tokens.css (bundled in front of this file). Style guide: /styleguide/ */

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--fs-base)/1.6 var(--font-sans); font-feature-settings: "cv11", "ss01"; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 var(--sp-3); font-weight: 650; text-wrap: balance; }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); letter-spacing: -0.01em; }
p { margin: 0 0 var(--sp-4); }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; }
code, kbd, .mono { font-family: var(--font-mono); font-size: 0.92em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--highlight); color: var(--highlight-ink); }
.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.narrow { max-width: 760px; }
.small, .hint { font-size: var(--fs-sm); color: var(--ink-2); }
.lead { font-size: var(--fs-lg); color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--sp-3); top: -60px; background: var(--accent); color: var(--accent-ink); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md); z-index: 20; }
.skip:focus { top: var(--sp-3); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
[hidden] { display: none !important; }
main { padding-bottom: var(--sp-8); }
section { margin: var(--sp-7) 0; }
.eyebrow { font: 500 var(--fs-xs)/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); margin: 0 0 var(--sp-3); }

/* ---------- chrome ---------- */
.banner { font-size: var(--fs-sm); color: var(--ink-2); text-align: center; padding: 6px 16px; border-bottom: var(--hair) solid var(--rule); background: var(--surface-2); }
.banner-tag { font: 600 var(--fs-xs)/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; border: var(--hair) solid currentColor; border-radius: 3px; padding: 2px 5px; margin-right: 6px; vertical-align: 1px; }
.site-head { border-bottom: var(--hair) solid var(--rule); background: var(--bg); }
.head-row { display: flex; align-items: center; gap: var(--sp-4); min-height: 64px; flex-wrap: wrap; padding-block: var(--sp-2); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; margin-right: auto; }
.mark { color: var(--ink); flex: none; }
.mark-ink { fill: var(--bg); }
.mark-rule { stroke: var(--highlight); }
.wordmark { font: 600 1.375rem/1 var(--font-mono); letter-spacing: -0.04em; }
.wordmark .lol { color: var(--highlight-ink); background: var(--highlight); border-radius: 3px; padding: 1px 2px 0; margin-left: 1px; }
.beta { font: 600 0.625rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2); border: var(--hair) solid var(--rule-strong); border-radius: 3px; padding: 3px 4px 2px; }
.nav { display: flex; gap: var(--sp-1); flex-wrap: wrap; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: var(--fs-md); font-weight: 500; padding: 8px 10px; border-radius: var(--r-md); }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.theme-toggle { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: var(--r-md); border: var(--hair) solid var(--rule); background: var(--surface); color: var(--ink); cursor: pointer; padding: 0; }
.theme-toggle:hover { border-color: var(--rule-strong); }
.site-foot { border-top: var(--hair) solid var(--rule); background: var(--surface-2); color: var(--ink-2); font-size: var(--fs-md); padding: var(--sp-6) 0 var(--sp-7); }
.site-foot .disclaimer { color: var(--ink); font-weight: 600; }
.site-foot a { color: var(--ink-2); }
.site-foot a:hover { color: var(--ink); }
.foot-links { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); }
.foot-brand { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-5); }
.foot-brand .mark { width: 20px; height: 20px; }
@media (max-width: 720px) {
  .head-row { gap: var(--sp-2); }
  .nav { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -6px; scrollbar-width: none; }
  .nav a { white-space: nowrap; padding: 8px 6px; }
}

/* ---------- buttons, inputs ---------- */
button, .btn { font: 600 var(--fs-base)/1.2 var(--font-sans); display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: 44px; padding: 10px 18px; border-radius: var(--r-md); border: var(--hair) solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color 120ms var(--ease), border-color 120ms var(--ease), color 120ms var(--ease); }
button:hover, .btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button:disabled { opacity: 0.55; cursor: progress; }
.btn-secondary, button.ghost, .small-btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--rule-strong); }
.btn-secondary:hover, button.ghost:hover, .small-btn.ghost:hover { background: var(--surface-2); border-color: var(--ink); }
.btn-text { background: transparent; border-color: transparent; color: var(--link); padding-inline: var(--sp-2); }
.btn-text:hover { background: var(--surface-2); border-color: transparent; }
.small-btn { min-height: 36px; padding: 6px 12px; font-size: var(--fs-md); }
.btn-lg { min-height: 52px; padding: 12px 22px; font-size: var(--fs-lg); }
label { display: block; font-weight: 600; font-size: var(--fs-md); margin-bottom: var(--sp-2); }
input[type=text], input[type=email], input[type=number], input[type=search], select, textarea { font: 400 var(--fs-base)/1.4 var(--font-sans); color: var(--ink); background: var(--surface); border: var(--hair) solid var(--rule-strong); border-radius: var(--r-md); padding: 11px 12px; min-height: 44px; min-width: 0; transition: border-color 120ms var(--ease); }
input:hover, select:hover { border-color: var(--ink); }
input::placeholder { color: var(--ink-2); opacity: 1; }
input[aria-invalid=true] { border: 2px solid var(--loss); padding: 10px 11px; }
#address, #mint, #key, .addr-input { font-family: var(--font-mono); font-size: var(--fs-md); letter-spacing: -0.01em; }
select { padding-right: 32px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: right 16px center, right 11px center; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }
.row { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: stretch; }
.row > input[type=text], .row > input[type=email] { flex: 1 1 240px; }
.consent { font-weight: 400; font-size: var(--fs-md); color: var(--ink-2); display: flex; gap: var(--sp-2); align-items: flex-start; margin-top: var(--sp-3); }
.consent input { margin-top: 4px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
input.money { flex: 0 1 200px; min-width: 140px; font-family: var(--font-mono); font-size: var(--fs-md); text-align: right; }

/* ---------- panels, alerts, stamps ---------- */
.panel, .tool, .exports, .review { background: var(--surface); border: var(--hair) solid var(--rule); border-radius: var(--r-lg); padding: var(--sp-5); }
.panel + .panel, .review + .review { margin-top: var(--sp-4); }
.review { margin-top: var(--sp-5); }
.review h3 { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.warn, .err, .ok, .note { border-radius: var(--r-md); padding: 10px 14px; margin: var(--sp-3) 0; font-size: var(--fs-md); border: var(--hair) solid; }
.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-rule); }
.err { background: var(--err-bg); color: var(--err-ink); border-color: var(--err-rule); display: block; }
.ok { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-rule); }
.note { background: var(--surface-2); color: var(--ink); border-color: var(--rule); }
.warn::before, .err::before, .ok::before { font: 600 var(--fs-xs)/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; margin-right: 8px; }
.warn::before { content: "Check"; }
.err::before { content: "Error"; }
.ok::before { content: "OK"; }
.err.bare::before, span.err::before { content: none; }
.draft { background: var(--warn-bg); color: var(--warn-ink); border: var(--hair) solid var(--warn-rule); padding: 8px 12px; border-radius: var(--r-md); font-size: var(--fs-md); }
.stamp { display: inline-flex; align-items: center; gap: 6px; font: 600 var(--fs-xs)/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; padding: 5px 7px 4px; border: 1.5px solid currentColor; border-radius: 3px; color: var(--ink-2); background: transparent; white-space: nowrap; vertical-align: middle; }
.stamp::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.stamp.ok { color: var(--stamp-ok); }
.stamp.review { color: var(--stamp-review); }
.stamp.loss { color: var(--stamp-loss); }
.stamp.preview { color: var(--stamp-preview); }
.stamp.ok, .stamp.review, .stamp.loss { margin: 0; border: 1.5px solid currentColor; background: transparent; padding: 5px 7px 4px; font-size: var(--fs-xs); }
.stamp.ok::before, .stamp.review::before, .stamp.loss::before { content: ""; margin: 0; }
.tag { display: inline-block; font: 500 0.6875rem/1.4 var(--font-mono); border: var(--hair) solid var(--rule-strong); color: var(--ink-2); border-radius: 3px; padding: 1px 5px; margin: 1px 4px 1px 0; white-space: nowrap; }
.tag.t-warn { color: var(--stamp-review); border-color: currentColor; }
.tag.t-loss { color: var(--stamp-loss); border-color: currentColor; }

/* ---------- money ---------- */
.num, .mono-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -0.01em; }
.up, .gain { color: var(--gain); }
.down, .loss { color: var(--loss); }
.zero { color: var(--ink-2); }
.up::before, .gain.num::before { content: "\25B2\00A0"; font-size: 0.7em; vertical-align: 0.12em; }
.down::before, .loss.num::before { content: "\25BC\00A0"; font-size: 0.7em; vertical-align: 0.12em; }
.mint { font: 400 var(--fs-xs)/1.4 var(--font-mono); color: var(--ink-2); word-break: break-all; }

/* ---------- ledger table ---------- */
.tablewrap { overflow: auto; max-height: 640px; border: var(--hair) solid var(--rule); border-radius: var(--r-lg); background: var(--surface); }
.tablewrap:focus-visible { outline-offset: 2px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-md); }
caption { text-align: left; padding: var(--sp-3) var(--sp-4); font-weight: 600; caption-side: top; }
th, td { text-align: right; padding: 10px 14px; border-bottom: var(--hair) solid var(--rule); white-space: nowrap; vertical-align: top; }
td { font-family: var(--font-mono); font-size: var(--fs-md); letter-spacing: -0.01em; }
th:first-child, td:first-child { text-align: left; }
td:first-child { font-family: var(--font-sans); font-size: var(--fs-md); font-weight: 600; letter-spacing: 0; }
th { font: 500 var(--fs-xs)/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); background: var(--surface-2); position: sticky; top: 0; z-index: 1; border-bottom-color: var(--rule-strong); }
th.sortable { padding: 0; }
th.sortable button { all: unset; display: block; box-sizing: border-box; width: 100%; padding: 10px 14px; cursor: pointer; text-align: inherit; }
th.sortable button:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
th[aria-sort=ascending] button::after { content: " \2191"; }
th[aria-sort=descending] button::after { content: " \2193"; }
tbody tr:hover td { background: var(--zebra); }
tbody tr:last-child td { border-bottom: 0; }
td.notes { text-align: left; white-space: normal; min-width: 260px; font-family: var(--font-sans); }
tfoot td { font-weight: 600; border-top: var(--hair) solid var(--rule-strong); border-bottom: 0; background: var(--surface-2); position: sticky; bottom: 0; }
tfoot td.num { text-decoration: underline double; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.table-tools { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; justify-content: space-between; margin: var(--sp-3) 0; }
.table-tools input[type=search] { flex: 1 1 200px; max-width: 320px; min-height: 40px; padding: 8px 12px; font-size: var(--fs-md); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { min-height: 36px; padding: 6px 12px; font-size: var(--fs-sm); font-weight: 500; border-radius: 999px; background: var(--surface); color: var(--ink-2); border: var(--hair) solid var(--rule); }
.chip:hover { background: var(--surface-2); color: var(--ink); border-color: var(--rule-strong); }
.chip[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.empty-row td { text-align: center; color: var(--ink-2); padding: var(--sp-6); font-family: var(--font-sans); font-weight: 400; }

.tablewrap th:first-child, .tablewrap td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.tablewrap thead th:first-child { z-index: 2; background: var(--surface-2); }
.tablewrap tfoot td:first-child { background: var(--surface-2); z-index: 2; }
@media (max-width: 520px) { .sample th:nth-child(2), .sample td:nth-child(2) { display: none; } }
.has-report .sample { display: none; }
.has-report .hero-grid { grid-template-columns: minmax(0, 760px); }
#status:not([hidden]), #result:not([hidden]) { margin-top: var(--sp-6); }

/* ---------- summary: the equation + stat tiles ---------- */
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.report-head h2 { margin-bottom: var(--sp-1); }
.equation { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: end; gap: var(--sp-3); background: var(--surface); border: var(--hair) solid var(--rule); border-radius: var(--r-lg); padding: var(--sp-5); }
.eq-term .k { font: 500 var(--fs-xs)/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-2); margin-bottom: var(--sp-2); }
.eq-term .v { font: 500 var(--fs-2xl)/1.1 var(--font-mono); letter-spacing: -0.03em; white-space: nowrap; }
.eq-term.total .v { font-weight: 600; text-decoration: underline double; text-decoration-thickness: 1px; text-underline-offset: 8px; }
.eq-op { font: 400 var(--fs-2xl)/1.1 var(--font-mono); color: var(--ink-2); padding-bottom: 2px; }
.eq-foot { grid-column: 1 / -1; display: flex; gap: var(--sp-2) var(--sp-4); flex-wrap: wrap; align-items: center; border-top: var(--hair) dashed var(--rule); padding-top: var(--sp-3); margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--ink-2); }
@media (max-width: 760px) {
  .equation { grid-template-columns: 1fr; gap: 0; padding: var(--sp-4); }
  .eq-op { display: none; }
  .eq-term { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); padding: var(--sp-2) 0; }
  .eq-term .k { margin: 0; }
  .eq-term .v { font-size: var(--fs-xl); }
  .eq-term.minus .k::before { content: "\2212\00A0"; }
  .eq-term.total { border-top: var(--hair) solid var(--rule-strong); margin-top: var(--sp-1); padding-top: var(--sp-3); }
  .eq-term.total .k::before { content: "=\00A0"; }
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; margin: var(--sp-4) 0; border: var(--hair) solid var(--rule); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.card { padding: var(--sp-4); border-right: var(--hair) solid var(--rule); border-bottom: var(--hair) solid var(--rule); margin: 0 -1px -1px 0; }
.card .k { font: 500 var(--fs-xs)/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); }
.card .v { font: 500 var(--fs-xl)/1.2 var(--font-mono); letter-spacing: -0.02em; margin-top: 6px; white-space: nowrap; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin: var(--sp-6) 0 var(--sp-3); }
.section-title h3 { margin: 0; }

/* ---------- progress ---------- */
.status { margin-top: var(--sp-4); }
.progress { background: var(--surface); border: var(--hair) solid var(--rule); border-radius: var(--r-lg); padding: var(--sp-5); }
.progress-title { display: flex; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; font-weight: 600; }
.steps { list-style: none; padding: 0; margin: var(--sp-4) 0; display: grid; gap: var(--sp-3); }
.steps li { display: grid; grid-template-columns: 24px 1fr auto; gap: var(--sp-3); align-items: center; font-size: var(--fs-md); color: var(--ink-2); }
.steps li::before { content: ""; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--rule-strong); box-sizing: border-box; }
.steps li .st { font: 500 var(--fs-xs)/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; }
.steps li.done { color: var(--ink); }
.steps li.done::before { background: var(--gain); border-color: var(--gain); box-shadow: inset 0 0 0 4px var(--surface); }
.steps li.now { color: var(--ink); font-weight: 600; }
.steps li.now::before { border: 2px solid var(--ink); border-right-color: transparent; animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: var(--hair) solid var(--rule); }
.bar > div { height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--ink) 0 6px, var(--ink-2) 6px 8px); transition: width 400ms var(--ease); }
.bar-row { display: flex; justify-content: space-between; gap: var(--sp-3); font: 500 var(--fs-sm)/1.4 var(--font-mono); color: var(--ink-2); margin-top: var(--sp-2); }
.skeleton { display: grid; gap: 10px; margin-top: var(--sp-4); }
.skeleton i { display: block; height: 14px; border-radius: var(--r-sm); background: var(--surface-2); }
.skeleton i:nth-child(3n+2) { width: 82%; } .skeleton i:nth-child(3n) { width: 64%; }

/* ---------- review items ---------- */
.ritem { border-top: var(--hair) solid var(--rule); padding: var(--sp-3) 0; font-size: var(--fs-md); }
.ritem .row { margin-top: var(--sp-2); }
.ritem-date { font: 500 var(--fs-xs)/1 var(--font-mono); color: var(--ink-2); margin-right: 6px; }
details { border-bottom: var(--hair) solid var(--rule); }
summary { cursor: pointer; font-weight: 600; padding: var(--sp-3) 0; list-style: none; display: flex; justify-content: space-between; gap: var(--sp-3); }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font: 400 var(--fs-xl)/1 var(--font-mono); color: var(--ink-2); }
details[open] > summary::after { content: "\2212"; }
.review details { border: 0; }

/* ---------- export receipt ---------- */
.receipt { max-width: 640px; background: var(--surface); border: var(--hair) solid var(--rule-strong); border-radius: var(--r-lg); padding: var(--sp-5); position: relative; }
.receipt-head { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); border-bottom: 2px solid var(--ink); padding-bottom: var(--sp-3); margin-bottom: var(--sp-2); }
.receipt-head h3 { margin: 0; }
.rrow { display: flex; justify-content: space-between; gap: var(--sp-4); padding: 9px 0; border-bottom: var(--hair) dashed var(--rule); font-size: var(--fs-md); }
.rrow > :last-child { font-family: var(--font-mono); text-align: right; }
.rrow.total { border-bottom: 0; border-top: var(--hair) solid var(--ink); font-weight: 600; }
.receipt .fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-3); margin: var(--sp-4) 0; }
.receipt .fields label { font: 500 var(--fs-xs)/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-2); }
.receipt .fields select { width: 100%; }
.dl-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
@media (max-width: 420px) { .dl-buttons { grid-template-columns: 1fr; } }
.unlock { background: var(--surface-2); border-radius: var(--r-md); padding: var(--sp-4); margin-top: var(--sp-4); font-size: var(--fs-md); }
.formats { display: flex; flex-wrap: wrap; gap: var(--sp-2); padding: 0; margin: var(--sp-4) 0 0; list-style: none; }
.formats li { font: 500 var(--fs-sm)/1 var(--font-mono); border: var(--hair) solid var(--rule-strong); border-radius: var(--r-sm); padding: 9px 10px; background: var(--surface); }
.formats li b { font-weight: 600; }

/* ---------- landing ---------- */
.hero { margin: var(--sp-8) 0 var(--sp-6); }
.hero h1 { font-size: var(--fs-display); line-height: 1.02; letter-spacing: -0.035em; max-width: 16ch; margin-bottom: var(--sp-4); font-weight: 700; }
.hero h1 .hl { background: linear-gradient(transparent 8%, var(--highlight) 8%, var(--highlight) 92%, transparent 92%); color: var(--highlight-ink); padding: 0 4px; margin: 0 -2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--sp-7); align-items: start; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; gap: var(--sp-6); } .hero { margin-top: var(--sp-6); } }
.trust { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); padding: 0; margin: var(--sp-4) 0 0; list-style: none; font-size: var(--fs-sm); color: var(--ink-2); }
.trust li::before { content: "\2713\00A0"; color: var(--gain); font-weight: 700; }
.tool { padding: var(--sp-5); box-shadow: var(--shadow); }
.tool-hero label { font-size: var(--fs-base); }
.tool-hero .row input { min-height: 52px; font-size: var(--fs-base); }
.tool-hero .row button { min-height: 52px; padding-inline: 22px; }
@media (max-width: 520px) { .tool-hero .row button { width: 100%; } }
.sample { margin: 0; background: var(--surface); border: var(--hair) solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.sample-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2); padding: 10px var(--sp-4); border-bottom: var(--hair) solid var(--rule); background: var(--surface-2); font: 500 var(--fs-xs)/1.3 var(--font-mono); color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.sample .equation { border: 0; border-radius: 0; border-bottom: var(--hair) solid var(--rule); grid-template-columns: 1fr; gap: 0; padding: var(--sp-3) var(--sp-4); }
.sample .eq-op { display: none; }
.sample .eq-term { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; }
.sample .eq-term .k { margin: 0; }
.sample .eq-term .v { font-size: var(--fs-lg); }
.sample .eq-term.minus .k::before { content: "\2212\00A0"; }
.sample .eq-term.total { border-top: var(--hair) solid var(--rule-strong); margin-top: 4px; padding-top: 10px; }
.sample .eq-term.total .k::before { content: "=\00A0"; }
.sample .eq-term.total .v { text-underline-offset: 6px; }
.sample table { font-size: 0.8125rem; }
.sample th, .sample td { padding: 8px 12px; }
.sample-foot { padding: 10px var(--sp-4); font-size: var(--fs-sm); color: var(--ink-2); border-top: var(--hair) solid var(--rule); }
.steps-how { counter-reset: step; list-style: none; padding: 0; margin: var(--sp-5) 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); border-top: 2px solid var(--ink); }
.steps-how li { counter-increment: step; padding: var(--sp-4) var(--sp-4) var(--sp-4) 0; border-bottom: var(--hair) solid var(--rule); color: var(--ink-2); font-size: var(--fs-md); }
.steps-how li::before { content: "0" counter(step); display: block; font: 500 var(--fs-sm)/1 var(--font-mono); color: var(--ink-2); margin-bottom: var(--sp-3); }
.steps-how strong { display: block; color: var(--ink); font-size: var(--fs-base); margin-bottom: 4px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-6); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.faq details { padding: 0; }
.faq summary { padding: var(--sp-4) 0; font-size: var(--fs-base); }
.faq details p { color: var(--ink-2); max-width: 70ch; }
.guide-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0; border-top: var(--hair) solid var(--rule); }
.guide-list li { border-bottom: var(--hair) solid var(--rule); }
.guide-list a { display: block; padding: var(--sp-3) var(--sp-4) var(--sp-3) 0; color: var(--ink); text-decoration: none; font-weight: 500; }
.guide-list a:hover { color: var(--link); text-decoration: underline; }
.guide-list p { margin: -6px 0 var(--sp-3); color: var(--ink-2); font-size: var(--fs-sm); padding-right: var(--sp-4); }

/* ---------- pricing ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--sp-4); margin-top: var(--sp-5); }
.plan { background: var(--surface); border: var(--hair) solid var(--rule-strong); border-radius: var(--r-lg); padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); }
.plan h3 { margin: 0; font-size: var(--fs-lg); }
.plan .price { font: 600 var(--fs-3xl)/1 var(--font-mono); letter-spacing: -0.04em; }
.plan .price small { font: 400 var(--fs-md)/1 var(--font-sans); color: var(--ink-2); letter-spacing: 0; margin-left: 4px; }
.plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: var(--fs-md); }
.plan li { padding-left: 22px; position: relative; }
.plan li::before { content: "\2713"; position: absolute; left: 0; color: var(--gain); font-weight: 700; }
.plan .plan-foot { margin-top: auto; }
.plan.inverted { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.plan.inverted .muted, .plan.inverted .price small, .plan.inverted .small { color: var(--on-ink); opacity: 0.85; }
.plan.inverted li::before { color: var(--inv-mark); }
.plan.inverted .stamp { color: var(--inv-mark); }
.plan.inverted .btn { background: var(--on-ink); color: var(--ink); border-color: var(--on-ink); }
.plan.inverted .btn:hover { background: var(--highlight); border-color: var(--highlight); color: var(--highlight-ink); }
.plan.inverted a { color: var(--on-ink); }

/* ---------- prose: guides, method, legal ---------- */
.guide, .legal { max-width: 720px; margin-top: var(--sp-7); }
.guide h1, .legal h1 { font-size: var(--fs-3xl); letter-spacing: -0.03em; }
.guide h2, .legal h2 { font-size: var(--fs-xl); margin-top: var(--sp-6); padding-top: var(--sp-4); border-top: var(--hair) solid var(--rule); }
.guide h3 { font-size: var(--fs-lg); margin-top: var(--sp-5); }
.guide p, .guide li, .legal p, .legal li { color: var(--ink); }
.guide li { margin-bottom: 6px; }
.guide table { white-space: normal; font-size: var(--fs-md); display: block; overflow-x: auto; width: max-content; max-width: 100%; border: var(--hair) solid var(--rule); border-radius: var(--r-md); }
.guide td, .guide th { white-space: normal; text-align: left; font-family: var(--font-sans); font-size: var(--fs-md); position: static; }
.guide td:first-child { font-weight: 400; }
.guide pre { overflow-x: auto; background: var(--surface-2); padding: var(--sp-3); border-radius: var(--r-md); font-size: var(--fs-sm); }
.guide code { overflow-wrap: anywhere; }
.guide blockquote { border-left: 3px solid var(--highlight); margin: var(--sp-4) 0; padding: var(--sp-1) 0 var(--sp-1) var(--sp-4); color: var(--ink-2); }
.guide .updated { font: 500 var(--fs-sm)/1.4 var(--font-mono); color: var(--ink-2); border-top: var(--hair) solid var(--rule); padding-top: var(--sp-3); margin-top: var(--sp-6); }
.cta { background: var(--surface); border: var(--hair) solid var(--rule); border-radius: var(--r-lg); padding: var(--sp-5); margin-top: var(--sp-5); }
.cta a { display: inline-flex; min-height: 44px; align-items: center; background: var(--accent); color: var(--accent-ink); padding: 10px 18px; border-radius: var(--r-md); font-weight: 600; text-decoration: none; }
.cta a:hover { background: var(--accent-hover); }
.page-head { margin: var(--sp-7) 0 var(--sp-5); }
.page-head h1 { font-size: var(--fs-3xl); letter-spacing: -0.03em; }
.crumbs { font: 500 var(--fs-xs)/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-2); margin-bottom: var(--sp-3); }
.crumbs a { color: var(--ink-2); }
.fourohfour { text-align: left; margin-top: var(--sp-8); }
.fourohfour .big { font: 600 clamp(4rem, 3rem + 6vw, 7rem)/1 var(--font-mono); letter-spacing: -0.06em; color: var(--ink-2); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: var(--sp-5); transform: translateX(-50%); background: var(--ink); color: var(--on-ink); border-radius: var(--r-md); padding: 10px 16px; font-size: var(--fs-md); box-shadow: var(--shadow); z-index: 30; animation: toast-in 160ms var(--ease); max-width: calc(100% - 32px); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- share card preview ---------- */
.card-img { display: block; max-width: 100%; height: auto; border-radius: var(--r-lg); border: var(--hair) solid var(--rule); margin: var(--sp-3) 0; }

/* ---------- style guide ---------- */
.sg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-3); }
.sg-swatch { border: var(--hair) solid var(--rule); border-radius: var(--r-md); overflow: hidden; font: 500 var(--fs-xs)/1.4 var(--font-mono); background: var(--surface); }
.sg-swatch i { display: block; height: 48px; border-bottom: var(--hair) solid var(--rule); }
.sg-swatch span { display: block; padding: 6px 8px; }
.sg-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; margin: var(--sp-3) 0; }
.sg-section { border-top: 2px solid var(--ink); padding-top: var(--sp-4); }
.sg-scale p { margin: 0 0 var(--sp-2); }
.sg-themes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
@media (max-width: 760px) { .sg-themes { grid-template-columns: 1fr; } }
.sw-bg { background: var(--bg); } .sw-surface { background: var(--surface); } .sw-surface-2 { background: var(--surface-2); } .sw-ink { background: var(--ink); } .sw-ink-2 { background: var(--ink-2); }
.sw-rule { background: var(--rule); } .sw-rule-strong { background: var(--rule-strong); } .sw-gain { background: var(--gain); } .sw-loss { background: var(--loss); } .sw-link { background: var(--link); }
.sw-highlight { background: var(--highlight); } .sw-warn { background: var(--warn-bg); } .sw-err { background: var(--err-bg); } .sw-ok { background: var(--ok-bg); } .sw-preview { background: var(--stamp-preview); } .sw-review { background: var(--stamp-review); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .banner, .site-head, .site-foot, .tool form, .review button, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; }
}
.bar > .sg-bar { width: 42%; }
.token-result { margin-top: var(--sp-5); }
.token-result > ul { list-style: none; padding: 0; margin: var(--sp-4) 0; border-top: 2px solid var(--ink); }
.token-result > ul li { padding: 10px 0; border-bottom: var(--hair) solid var(--rule); font-size: var(--fs-md); }
.token-result h3 { margin-top: var(--sp-6); }
#tresult ~ .small, .tool + .small { margin-top: var(--sp-5); }

.has-report .hero-copy, .has-report .trust { display: none; }
.has-report.hero, .has-report .hero { margin-top: var(--sp-5); }
.coverage { border: 0; margin-top: var(--sp-2); }
.coverage summary { font-size: var(--fs-sm); font-weight: 500; color: var(--link); padding: var(--sp-1) 0; justify-content: flex-start; }
.coverage summary::after { font-size: var(--fs-base); }
.provisional { display: flex; gap: var(--sp-2) var(--sp-3); flex-wrap: wrap; align-items: center; background: var(--warn-bg); color: var(--warn-ink); border: var(--hair) solid var(--warn-rule); border-radius: var(--r-md); padding: 10px 14px; margin-bottom: var(--sp-3); font-size: var(--fs-md); }
.provisional strong { font: 600 var(--fs-xs)/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; }
.provisional a { color: inherit; font-weight: 600; }
.plan-status { margin: 0; font-size: var(--fs-md); display: flex; gap: var(--sp-2); align-items: center; }
.plan .price .pre { display: block; margin: 0 0 6px; font: 500 var(--fs-xs)/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; }
.keybox summary h2 { margin: 0; font-size: var(--fs-xl); }
.keybox summary { padding: 0; }
.keybox[open] summary { margin-bottom: var(--sp-4); }
.ledger-note { margin-top: var(--sp-2); }
@media (max-width: 720px) { .nav .nav-extra { display: none; } .nav { overflow: visible; } }

body:not(.payments-on) .live-only { display: none !important; }
.payments-on .planned-only { display: none !important; }
.receipt-title { font-size: var(--fs-xl); font-weight: 650; letter-spacing: -0.01em; }
.toast-region:empty { display: none; }
.empty-state { max-width: 640px; }
.empty-state h3 { margin-bottom: var(--sp-2); }
@media (max-width: 520px) { button, .btn { white-space: normal; text-align: center; } }
