/* pre-emit critique: P_ H_ E_ S_ R_ V_ · macrostructure: quiet-list */
/* gstr2bmatch.in — "Working paper" (redesign 2026-09-29)
   Design system: projects/gstr-reconciliation/design-system/gstr2bmatch/MASTER.md
   Shared by the home page and the blog (blog adds blog/article.css).

   Paper, ink, a yellow highlighter, a ledger column in mono, and the double
   rule that closes every total. One accent (the highlighter). No blue.
   Three families, six sizes, three weights. transition names its properties. */

/* ── Fonts (all local — no CDN) ─────────────────────────────── */
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/InstrumentSerif-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/IBMPlexSans-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/IBMPlexSans-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/IBMPlexMono-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/IBMPlexMono-Medium.woff2") format("woff2");
}

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  --paper:    #F4F1EA;
  --sheet:    #FBF9F4;
  --ink:      #1A1813;
  --ink-2:    #48443B;
  --ink-3:    #686255;
  --rule:     #D6CEBC;
  --rule-soft:#E4DDCD;
  --rule-strong:#A89E88;
  --mark:     #F5D547;
  --mark-soft:#FAEBA6;

  --risk:     #A3231A;
  --risk-bg:  #F6DDD8;
  --warn:     #8A4B0F;
  --warn-bg:  #F4E3C8;
  --ok:       #2E6A3A;
  --ok-bg:    #D8EADB;
  --note:     #524D42;
  --note-bg:  #E6E0D3;

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans:  "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, Consolas, monospace;

  /* six sizes — do not add a seventh (gate limit) */
  --fs-display: clamp(2.75rem, 1.35rem + 4.6vw, 5rem);
  --fs-title:   clamp(2.25rem, 1.7rem + 2vw, 3.25rem);
  --fs-heading: clamp(1.75rem, 1.4rem + 1.1vw, 2.25rem);
  --fs-lead:    1.25rem;
  --fs-body:    1.0625rem;
  --fs-small:   0.875rem;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px; --sp-16: 64px;
  --sp-20: 80px; --sp-24: 96px;

  --r-1: 2px;
  --r-2: 4px;
  --sheet-shadow: 0 1px 0 var(--rule), 0 18px 40px -24px rgba(74, 58, 28, .35);
  --container: 1200px;
  --gutter: 24px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* aliases used by existing blog posts (inline styles written by agents) */
  --bg: var(--paper);
  --surface: var(--sheet);
  --border: var(--rule);
  --accent: var(--ink);
  --font-mono: var(--mono);
  --brand-600: var(--ink);
  --brand-700: var(--ink);
  --risk-600: var(--risk);
  --ok-600: var(--ok);
  --gray-50: var(--sheet);
  --gray-100: var(--note-bg);
  --gray-200: var(--rule);
  --gray-300: var(--rule);
  --sp-7: 48px;
}

/* ── Base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }

a { color: var(--ink); text-decoration-line: underline; text-decoration-thickness: 1px;
    text-underline-offset: 3px; text-decoration-color: var(--ink-3);
    transition: text-decoration-color .15s var(--ease), background-color .15s var(--ease); }
a:hover { text-decoration-color: var(--ink); background-color: var(--mark-soft); }



::selection { background: var(--mark); color: var(--ink); }

code, kbd { font-family: var(--mono); font-size: .92em; background: var(--note-bg);
            padding: 1px 5px; border-radius: var(--r-1); overflow-wrap: anywhere; }

strong { font-weight: 600; }

mark, .hl {
  background: linear-gradient(transparent 12%, var(--mark) 12%, var(--mark) 88%, transparent 88%);
  color: inherit;
  padding: 0 .12em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}


:disabled, [disabled], [aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.hidden { display: none !important; }
.file-input { display: none; }

.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;
}

.skip-link {
  position: absolute; left: var(--sp-4); top: -60px; z-index: 20;
  background: var(--ink); color: var(--paper); padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-1); text-decoration: none; transition: top .15s var(--ease);
}
.skip-link:focus { top: var(--sp-3); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.label {
  font-family: var(--mono);
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--ink-2);
}

/* ── Header (shared) ────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); min-height: 64px;
}
.logo {
  display: inline-flex; align-items: center; gap: var(--sp-3);
  text-decoration: none; color: var(--ink); min-height: 44px;
}
.logo:hover { background: none; }
.logo-mark {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px;
  background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: var(--fs-small); font-weight: 500;
  border-radius: var(--r-1);
  box-shadow: 3px 3px 0 var(--mark);
}
.logo-text { font-weight: 600; letter-spacing: -.01em; }
.logo-tld { color: var(--ink-3); font-weight: 400; }

.site-nav { display: flex; align-items: center; gap: var(--sp-1); }
.site-nav a {
  display: inline-flex; align-items: center;
  padding: 11px var(--sp-3); line-height: 22px;
  font-size: var(--fs-small); font-weight: 600;
  color: var(--ink); text-decoration: none; white-space: nowrap;
  border-radius: var(--r-1);
}
.site-nav a:hover { background: var(--mark-soft); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--mark); }
.site-nav .nav-cta {
  background: var(--ink); color: var(--paper); margin-left: var(--sp-2);
}
.site-nav .nav-cta:hover { background: var(--ink-2); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 14px var(--sp-6);
  font-family: var(--sans); font-size: var(--fs-body); font-weight: 600; line-height: 1.25;
  white-space: nowrap; text-decoration: none; cursor: pointer;
  border: 1px solid var(--ink); border-radius: var(--r-1);
  background: var(--ink); color: var(--paper);
  transition: background-color .15s var(--ease), color .15s var(--ease),
              transform .15s var(--ease), box-shadow .15s var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { background: var(--ink-2); color: var(--paper); box-shadow: 3px 3px 0 var(--mark); }
.btn:active { transform: translateY(1px); box-shadow: 1px 1px 0 var(--mark); }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--rule); border-color: var(--rule); color: var(--ink-2);
  box-shadow: none; cursor: not-allowed; transform: none;
}
.btn-outline, .btn-quiet {
  background: transparent; color: var(--ink);
}
.btn-outline:hover, .btn-quiet:hover { background: var(--mark-soft); color: var(--ink); }
.btn-sm { padding: var(--sp-3) var(--sp-4); font-size: var(--fs-small); }

/* ── Home: hero + tool ──────────────────────────────────────── */
.hero {
  padding: var(--sp-12) 0 var(--sp-20);
  border-bottom: 3px double var(--ink);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-areas:
    "intro sheet"
    "steps sheet";
  column-gap: var(--sp-16);
  row-gap: var(--sp-10);
  align-items: start;
}
.hero-intro { grid-area: intro; padding-top: var(--sp-4); }
.hero-steps { grid-area: steps; }
.tool-sheet { grid-area: sheet; }

.hero-kicker { margin-bottom: var(--sp-5); }
.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--fs-display);
  line-height: .98;
  letter-spacing: -.015em;
  text-wrap: balance;
  margin-bottom: var(--sp-6);
}
.hero-lede {
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 34ch;
  text-wrap: pretty;
}

.hero-steps ol { list-style: none; border-top: 1px solid var(--ink); }
.hero-steps li {
  display: grid; grid-template-columns: 44px 1fr; gap: var(--sp-3);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--rule);
}
.hero-steps .step-n { font-family: var(--mono); font-size: var(--fs-small); color: var(--ink-3); padding-top: 3px; }
.hero-steps p { color: var(--ink-2); }
.hero-steps strong { color: var(--ink); }
.hero-steps .sample-link { display: inline-block; margin-top: var(--sp-4); font-size: var(--fs-small); font-weight: 600; }

/* the working paper */
.tool-sheet {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  box-shadow: var(--sheet-shadow);
  position: relative;
}
.sheet-head {
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-6);
  border-bottom: 1px solid var(--ink);
}
.sheet-head .label { color: var(--ink); }
.sheet-status { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--ink-2); }
.sheet-status::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-bg);
}

.slot {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: var(--sp-4);
  align-items: center;
  margin: var(--sp-4) var(--sp-6);
  padding: var(--sp-5);
  border: 1.5px dashed var(--rule-strong);
  border-radius: var(--r-2);
  cursor: pointer;
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.slot + .slot { margin-top: 0; }
.slot:hover { border-color: var(--ink-3); background: var(--paper); }
.slot.dragover { border-color: var(--ink); border-style: solid; background: var(--mark-soft); }
.slot.is-loaded { border-style: solid; border-color: var(--ok); background: var(--ok-bg); }
.slot.is-error { border-style: solid; border-color: var(--risk); background: var(--risk-bg); }

.slot-key {
  display: grid; place-items: center;
  width: 48px; height: 48px;
  border: 1.5px solid var(--ink); border-radius: var(--r-1);
  font-family: var(--mono); font-weight: 500; font-size: var(--fs-lead);
  background: var(--sheet);
}
.slot.is-loaded .slot-key { background: var(--ok); color: var(--sheet); border-color: var(--ok); }
.slot-title { font-size: var(--fs-lead); font-weight: 600; line-height: 1.3; }
.slot-hint { font-size: var(--fs-small); color: var(--ink-2); line-height: 1.5; }
.slot-btn { pointer-events: none; }
.slot .file-info {
  grid-column: 2 / -1;
  font-family: var(--mono); font-size: var(--fs-small); color: var(--ink-2);
}
.slot .file-info:empty { display: none; }
.slot.is-loaded .file-info { color: var(--ok); }
.slot.is-error .file-info { color: var(--risk); }

.sheet-preview { margin: var(--sp-6) var(--sp-6) var(--sp-4); }
.preview-ledger { font-size: var(--fs-small); }
.preview-ledger th {
  text-align: left; font-family: var(--mono); font-weight: 500; color: var(--ink-2);
  padding: 0 0 var(--sp-2); border-bottom: 1px solid var(--ink);
}
.preview-ledger td { padding: var(--sp-2) 0; border-bottom: 1px solid var(--rule-soft); color: var(--ink-2); }
.preview-ledger td:first-child .bucket-badge { vertical-align: middle; margin-right: var(--sp-3); }
.preview-ledger .bucket-badge { min-width: 26px; height: 26px; }
.preview-ledger .num-col { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.preview-ledger tbody tr:last-child td { border-bottom: 3px double var(--ink); }

.sheet-foot {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-4) var(--sp-6) var(--sp-5);
  border-top: 1px solid var(--rule-soft);
  font-size: var(--fs-small); color: var(--ink-2);
}
.sheet-foot span { max-width: 58ch; }
.sheet-foot svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--ink); }

/* ── Mapping ────────────────────────────────────────────────── */
.work-area { padding: var(--sp-12) 0 0; }
.work-area:has(> .container > .hidden:only-child) { padding: 0; }

.panel-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between;
              gap: var(--sp-4); padding-bottom: var(--sp-4); border-bottom: 1px solid var(--ink);
              margin-bottom: var(--sp-6); }
.panel-title {
  font-family: var(--serif); font-weight: 400;
  font-size: var(--fs-heading); line-height: 1.1; letter-spacing: -.01em;
}
.panel-sub { color: var(--ink-2); max-width: 60ch; margin-top: var(--sp-2); }

.mapping-section { margin-bottom: var(--sp-16); }
.mapping-detected { font-size: var(--fs-small); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-6);
                    border-left: 3px solid var(--ink); background: var(--sheet); }
.mapping-detected:empty { display: none; }
.mapping-detected.is-auto { border-left-color: var(--ok); background: var(--ok-bg); }
.mapping-detected.is-manual { border-left-color: var(--warn); background: var(--warn-bg); }

.mapping-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-5) var(--sp-8);
}
.mapping-row { display: grid; gap: var(--sp-2); }
.map-label { font-size: var(--fs-small); font-weight: 600; }
.map-label .req { color: var(--risk); }
.map-label .opt { color: var(--ink-3); font-weight: 400; }
.mapping-row select {
  appearance: none; -webkit-appearance: none;
  min-height: 48px; width: 100%;
  padding: 0 40px 0 var(--sp-3);
  background: var(--sheet) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231A1813' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 18px;
  border: 1px solid var(--ink-3); border-radius: var(--r-1);
  font-family: var(--mono); font-size: var(--fs-small);
  cursor: pointer;
  transition: border-color .15s var(--ease);
}
.mapping-row select:hover { border-color: var(--ink); }
.mapping-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4);
                   margin-top: var(--sp-8); padding-top: var(--sp-6); border-top: 1px solid var(--rule); }
.form-error { color: var(--risk); font-weight: 600; font-size: var(--fs-small); }
.form-error:empty { display: none; }

/* ── Results ────────────────────────────────────────────────── */
.results-section { padding-bottom: var(--sp-20); }
.results-section .totals { border-top: 0; }
.mapping-section, .results-section { scroll-margin-top: var(--sp-6); }
.results-section:focus { outline: none; }
.results-title {
  font-family: var(--serif); font-weight: 400;
  font-size: var(--fs-title); line-height: 1.05; letter-spacing: -.015em;
}

.totals {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  margin-bottom: var(--sp-8);
}
.total {
  padding: var(--sp-5) var(--sp-6) var(--sp-6) 0;
  display: grid; gap: var(--sp-2); align-content: start;
}
.total + .total { padding-left: var(--sp-6); border-left: 1px solid var(--rule); }
.total-label { font-family: var(--mono); font-size: var(--fs-small); color: var(--ink-2); }
.total-amount {
  justify-self: start;
  font-family: var(--mono); font-weight: 500;
  font-size: var(--fs-heading); line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--risk);
  border-bottom: 3px double var(--risk);
  padding-bottom: 2px;
}
.total-desc { font-size: var(--fs-small); color: var(--ink-2); }
.total .btn { justify-self: start; margin-top: var(--sp-2); }

.help-panel {
  background: var(--sheet); border: 1px solid var(--rule); border-left: 3px solid var(--mark);
  padding: var(--sp-6); margin-bottom: var(--sp-8); border-radius: var(--r-1);
}
.help-panel-title { font-size: var(--fs-body); font-weight: 600; margin-bottom: var(--sp-3); }
.help-steps { padding-left: var(--sp-6); display: grid; gap: var(--sp-2); color: var(--ink-2); }
.help-disclaimer { margin-top: var(--sp-4); font-size: var(--fs-small); color: var(--ink-2); max-width: 64ch; }

/* bucket ledger */
.accordion { border-top: 1px solid var(--ink); }
.accordion-item { border: none; border-top: 1px solid var(--border); border-radius: 0; background: transparent; box-shadow: none; overflow: hidden; transition: none; }
.accordion-header {
  width: 100%; min-height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-3) 0;
  background: none; border: 0; text-align: left; cursor: pointer;
  transition: background-color .15s var(--ease);
}
.accordion-header:hover { background: var(--sheet); }
.bucket-label { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3); font-weight: 600; }
.bucket-meta { display: inline-flex; align-items: center; gap: var(--sp-3);
               font-family: var(--mono); font-size: var(--fs-small); color: var(--ink-2); white-space: nowrap; }
.bucket-meta .count { font-weight: 500; color: var(--ink); }
.chevron { width: 20px; height: 20px; transition: transform .2s var(--ease); }
.accordion-item.active .chevron { transform: rotate(180deg); }
.accordion-content { display: none; padding: 0 0 var(--sp-6); }
.accordion-item.active .accordion-content { display: block; }

/* stamps: A/B/C/D/E */
.bucket-badge {
  display: inline-grid; place-items: center;
  min-width: 32px; height: 32px; padding: 0 6px;
  font-family: var(--mono); font-size: var(--fs-small); font-weight: 500;
  border: 1.5px solid currentColor; border-radius: var(--r-1);
  line-height: 1;
}
.bucket-badge-danger  { color: var(--risk); background: var(--risk-bg); }
.bucket-badge-warning { color: var(--warn); background: var(--warn-bg); }
.bucket-badge-info    { color: var(--note); background: var(--note-bg); }
.bucket-badge-success { color: var(--ok);   background: var(--ok-bg); }
.bucket-badge-neutral { color: var(--note); background: transparent; }

.bucket-tag { font-family: var(--mono); font-size: var(--fs-small); font-weight: 400; }
.bucket-tag-danger  { color: var(--risk); }
.bucket-tag-warning { color: var(--warn); }
.bucket-tag-info, .bucket-tag-neutral { color: var(--ink-3); }
.bucket-tag-success { color: var(--ok); }
.bucket-tag::before { content: "\2014\00a0"; color: var(--ink-3); }

/* data tables (results + samples) */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r-1); background: var(--sheet); }
.table-wrap table, .ledger { font-size: var(--fs-small); }
.table-wrap th, .ledger th {
  text-align: left; font-family: var(--mono); font-weight: 500; color: var(--ink-2);
  padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--ink); white-space: nowrap;
  background: var(--sheet);
}
.table-wrap td, .ledger td {
  padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--rule-soft); vertical-align: top;
}
.table-wrap td:nth-child(1), .table-wrap td:nth-child(3), .table-wrap td:nth-child(4) { font-family: var(--mono); white-space: nowrap; }
.table-wrap td:nth-child(n+5) { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.table-wrap th:nth-child(n+5) { text-align: right; }
#table-cd td:nth-child(5), #table-cd th:nth-child(5) { text-align: left; font-family: var(--sans); }
.table-wrap tbody tr:hover { background: var(--mark-soft); }
.table-wrap tbody tr:last-child td { border-bottom: 0; }
.table-wrap tbody:empty::after {
  content: "Nothing in this bucket."; display: table-caption; caption-side: bottom;
  padding: var(--sp-4); color: var(--ink-3); font-size: var(--fs-small);
}
td small.warning { display: block; margin-top: 2px; font-family: var(--sans); color: var(--warn); white-space: normal; }
td.danger { color: var(--risk); font-weight: 500; }

/* ── Home: sections after the hero ──────────────────────────── */
.block { padding: var(--sp-20) 0; }
.block + .block { border-top: 1px solid var(--rule); }

.block-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: var(--sp-16);
  align-items: start;
}
.block-side { position: sticky; top: var(--sp-6); }
.block-side .label { display: block; margin-bottom: var(--sp-4); }
.block-heading {
  font-family: var(--serif); font-weight: 400;
  font-size: var(--fs-heading); line-height: 1.1; letter-spacing: -.01em;
  text-wrap: balance; margin-bottom: var(--sp-4);
}
.block-lede { color: var(--ink-2); max-width: 40ch; }

/* sample statement */
.statement {
  background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-2);
  box-shadow: var(--sheet-shadow);
}
.statement-head {
  display: flex; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap;
  padding: var(--sp-4) var(--sp-6); border-bottom: 1px solid var(--ink);
}
.statement .totals { border-top: 0; margin: 0; padding: 0 var(--sp-6); border-bottom: 1px solid var(--rule); }
.statement .table-wrap { border: 0; border-radius: 0; }
.statement-foot { padding: var(--sp-3) var(--sp-6); font-size: var(--fs-small); color: var(--ink-3);
                  border-top: 1px solid var(--rule-soft); }
.ledger td.num-col, .ledger th.num-col { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger td:nth-child(3) { font-family: var(--mono); white-space: nowrap; }
.ledger .row-e td:nth-child(2) { background: linear-gradient(transparent 20%, var(--mark-soft) 20%, var(--mark-soft) 80%, transparent 80%); }

.bucket-defs { margin-top: var(--sp-10); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--sp-10); }
.bucket-def-row { display: grid; grid-template-columns: 40px 1fr; gap: var(--sp-2) var(--sp-3);
                  padding: var(--sp-5) 0; border-top: 1px solid var(--rule); }
.bucket-def-row dt { display: contents; font-weight: 600; }
.bucket-def-row dt .bucket-badge { grid-row: span 2; }
.bucket-def-row dd { grid-column: 2; color: var(--ink-2); font-size: var(--fs-small); line-height: 1.6; }

/* IMS explainer */
.prose { max-width: 64ch; }
.prose > * + * { margin-top: var(--sp-5); }
.prose h3 { font-size: var(--fs-lead); font-weight: 600; line-height: 1.3; margin-top: var(--sp-10); }
.prose p { color: var(--ink-2); }
.prose p strong { color: var(--ink); }
.prose ol { padding-left: 0; list-style: none; counter-reset: step; border-top: 1px solid var(--rule); }
.prose ol li { counter-increment: step; position: relative;
               padding: var(--sp-3) 0 var(--sp-3) 56px; border-bottom: 1px solid var(--rule-soft); color: var(--ink-2); }
.prose ol li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: calc(var(--sp-3) + 3px); font-family: var(--mono); color: var(--ink-3); font-size: var(--fs-small); }

.state-table { font-size: var(--fs-small); background: var(--sheet); border: 1px solid var(--rule); }
.state-table th { text-align: left; font-family: var(--mono); font-weight: 500; color: var(--ink-2);
                  padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--ink); }
.state-table td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--rule-soft); }
.state-table .is-bad td { background: var(--risk-bg); color: var(--risk); font-weight: 600; }
.state-table .is-bad td:first-child { box-shadow: inset 3px 0 0 var(--risk); }

.aside-note { max-width: 56ch; font-size: var(--fs-small); color: var(--ink-2); padding: var(--sp-4) var(--sp-5);
              border-left: 3px solid var(--ink); background: var(--sheet); }
.more-link { display: inline-flex; align-items: center; gap: var(--sp-2); font-weight: 600; }

/* ── Generic page (templates/page.html: about, privacy, new tools) ── */
.page-head { padding: var(--sp-12) 0 var(--sp-16); border-bottom: 3px double var(--ink); }
.page-head .label { display: block; margin-bottom: var(--sp-5); }
.page-title {
  font-family: var(--serif); font-weight: 400;
  font-size: var(--fs-title); line-height: 1.04; letter-spacing: -.015em;
  text-wrap: balance; max-width: 22ch; margin-bottom: var(--sp-5);
}
.page-lede { font-size: var(--fs-lead); line-height: 1.5; color: var(--ink-2); max-width: 52ch; }

/* ── Footer (shared) ────────────────────────────────────────── */
.site-footer {
  border-top: 3px double var(--ink);
  padding: var(--sp-16) 0 var(--sp-12);
  font-size: var(--fs-small);
  color: var(--ink-2);
}
.footer-inner { display: grid; gap: var(--sp-6); }
.footer-brand { display: flex; align-items: center; gap: var(--sp-3); }
.footer-name { font-weight: 600; color: var(--ink); font-size: var(--fs-body); }
.footer-note { max-width: 60ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-6); }
.footer-links a { font-weight: 600; white-space: nowrap; }
.footer-legal { color: var(--ink-3); max-width: 64ch; padding-top: var(--sp-6); border-top: 1px solid var(--rule); }

.fine-print { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--sp-12); }
.fine-print dl { display: grid; gap: var(--sp-5); }
.fine-print dt { font-family: var(--mono); font-weight: 500; color: var(--ink); margin-bottom: var(--sp-1); }
.fine-print dd { max-width: 62ch; }
.fine-print h2 { font-family: var(--mono); font-weight: 500; font-size: var(--fs-small); color: var(--ink); margin-bottom: var(--sp-3); }
.guide-list { list-style: none; border-top: 1px solid var(--rule); }
.guide-list li { border-bottom: 1px solid var(--rule-soft); }
.guide-list a { display: block; padding: var(--sp-3) 0; text-decoration: none; color: var(--ink); }
.guide-list a:hover { background: var(--mark-soft); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "intro" "sheet" "steps";
    row-gap: var(--sp-8);
  }
  .hero-lede { max-width: 52ch; }
  .block-grid { grid-template-columns: minmax(0, 1fr); gap: var(--sp-8); }
  .block-side { position: static; }
  .fine-print { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 719px) {
  .bucket-defs { grid-template-columns: minmax(0, 1fr); }
  .totals { grid-template-columns: minmax(0, 1fr); }
  .total + .total { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); }
  .slot { grid-template-columns: 48px 1fr; }
  .slot-btn { grid-column: 2; justify-self: start; }
  .block { padding: var(--sp-16) 0; }
}
@media (max-width: 559px) {
  :root { --gutter: 16px; }
  .site-nav a:not(.nav-cta) { padding: 0 var(--sp-2); }
  .logo-text { display: none; }
  .site-nav .nav-optional { display: none; }
  .hero { padding-top: var(--sp-8); }
  .sheet-head, .sheet-foot { padding-left: var(--sp-4); padding-right: var(--sp-4); }
  .sheet-head > .label:first-child { display: none; }
  .sheet-preview { margin-left: var(--sp-4); margin-right: var(--sp-4); }
  .slot { margin-left: var(--sp-4); margin-right: var(--sp-4); padding: var(--sp-4); }
  .statement-head, .statement-foot { padding-left: var(--sp-4); padding-right: var(--sp-4); }
  .statement .totals { padding: 0 var(--sp-4); }
  .accordion-header { align-items: flex-start; }
  .bucket-label { flex-wrap: nowrap; align-items: flex-start; }
  .bucket-label .bucket-badge { flex: none; }
  .bucket-tag { display: none; }
  .bucket-meta { padding-top: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header, .site-nav, .hero-steps, .sheet-foot, .results-actions, .btn { display: none !important; }
  body { background: #fff; }
  .accordion-content { display: block !important; }
}

.hero { background: var(--surface); }
.proof-strip { background: var(--bg); border-top: 1px solid var(--border); }
.tool-section { background: var(--surface); border-top: 1px solid var(--border); }
.section-preview { background: var(--bg); border-top: 1px solid var(--border); }
.section-how { background: var(--surface); border-top: 1px solid var(--border); }
.section-ims { background: var(--bg); border-top: 1px solid var(--border); }
.section-compare { background: var(--surface); border-top: 1px solid var(--border); }
.section-privacy { background: var(--bg); border-top: 1px solid var(--border); }
.section-for { background: var(--surface); border-top: 1px solid var(--border); }
.section-faq { background: var(--bg); border-top: 1px solid var(--border); }

.measure, p { max-width: 68ch; }

/* Keyboard focus indicator (2026-10-10, maintenance): same ring as blog .post-card.
   Required by the ui-audit gate; only shows for keyboard users, not on mouse click. */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.results-section:focus-visible { outline: none; }
