/* LEDGERLINE layout, components, motion. Consumes tokens.css only.
   Component vocabulary is the ledger's own: sheets, rows, entries, tabs,
   marginalia, postings. No generic card/grid classes live here. */

/* ---------- reset-ish base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  padding-top: 6.1rem; /* fixed formula bar + column ruler */
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

::selection { background: var(--entry-green-deep); color: var(--paper); }

/* ---------- shared roles ---------- */
.sheet-wrap {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--edge);
}

.fig {
  font-family: var(--font-figures);
  font-size: var(--t-fig);
  letter-spacing: var(--track-fig);
  text-transform: uppercase;
}
.fig--muted { color: var(--muted); }
.fig--accent { color: var(--accent); }

.cellref {
  display: inline-block;
  font-family: var(--font-figures);
  font-size: var(--t-fig);
  letter-spacing: var(--track-fig);
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 0.2rem 0.55rem;
  border-radius: var(--r-1);
}

.note-copy {
  max-width: var(--measure);
  color: var(--fg);
}
.note-copy + .note-copy { margin-top: var(--s-4); }

.lead {
  font-size: var(--t-lead);
  max-width: var(--measure);
  line-height: 1.45;
}

.ledger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.78rem 1.35rem;
  background: var(--accent);
  color: var(--paper);
  border: 1px solid var(--accent);
  border-radius: var(--r-1);
  font-family: var(--font-figures);
  font-size: var(--t-fig);
  letter-spacing: var(--track-fig);
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.ledger-btn:hover { background: var(--fg); border-color: var(--fg); color: var(--bg); }
[data-theme="pencil"] .ledger-btn { color: var(--pencil-2); }
[data-theme="pencil"] .ledger-btn:hover { background: var(--paper); border-color: var(--paper); color: var(--pencil-2); }
.ledger-btn--ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line-strong);
}
.ledger-btn--ghost:hover { background: var(--fg); color: var(--bg); }
[data-theme="pencil"] .ledger-btn--ghost { color: var(--fg); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: fixed;
  top: -100%;
  left: var(--s-4);
  z-index: var(--z-skip);
  background: var(--pencil);
  color: var(--paper);
  padding: 0.6rem 1rem;
  font-family: var(--font-figures);
  font-size: var(--t-fig);
  text-decoration: none;
  border-radius: 0 0 var(--r-1) var(--r-1);
}
.skip-link:focus-visible { top: 0; }

/* SAMPLE chip: the honesty marker */
.sample-chip {
  display: inline-block;
  font-family: var(--font-figures);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px dashed var(--accent);
  border-radius: var(--r-1);
  padding: 0.12rem 0.45rem;
  vertical-align: middle;
}

/* ---------- formula bar (fixed header) ---------- */
.formula-bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-bar);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.formula-bar .bar-row {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  max-width: var(--max-w);
  margin-inline: auto;
  padding: 0.7rem var(--edge);
}
.bookmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-figures);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--fg);
  white-space: nowrap;
}
.bookmark svg { width: 20px; height: 20px; color: var(--accent); }
.fx-readout {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  padding: 0.35rem 0.65rem;
  background: var(--paper);
  color: var(--muted);
  font-family: var(--font-figures);
  font-size: var(--t-fig);
  overflow: hidden;
}
.fx-readout .fx-sym { color: var(--accent); font-style: italic; }
.fx-readout span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sheet-nav {
  display: flex;
  gap: var(--s-4);
}
.sheet-nav a {
  font-family: var(--font-figures);
  font-size: var(--t-fig);
  letter-spacing: var(--track-fig);
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 0.3rem 0.15rem;
  border-bottom: 2px solid transparent;
}
.sheet-nav a:hover { color: var(--fg); }
.sheet-nav a[aria-current] { color: var(--accent); border-bottom-color: var(--accent); }
.bar-cta { white-space: nowrap; padding: 0.55rem 1rem; }
.sheet-index-btn {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  padding: 0.45rem 0.9rem;
  font-family: var(--font-figures);
  font-size: var(--t-fig);
  letter-spacing: var(--track-fig);
  text-transform: uppercase;
  cursor: pointer;
}

/* column ruler: A B C D ... purely decorative */
.col-ruler {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}
.col-ruler ol {
  list-style: none;
  display: flex;
  max-width: var(--max-w);
  margin-inline: auto;
  padding: 0.18rem var(--edge);
}
.col-ruler li {
  flex: 1;
  text-align: center;
  font-family: var(--font-figures);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  border-left: 1px solid var(--rule);
}
.col-ruler li:first-child { border-left: 0; }

/* ---------- sheet index (focus-trapped dialog) ---------- */
.sheet-index {
  position: fixed;
  inset: 0;
  z-index: var(--z-sheet-index);
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--s-6) + env(safe-area-inset-top)) var(--edge) var(--s-7);
  background: var(--bg);
  color: var(--fg);
}
.sheet-index.is-open { display: flex; }
.sheet-index-close {
  align-self: flex-end;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  padding: 0.5rem 1rem;
  font-family: var(--font-figures);
  font-size: var(--t-fig);
  letter-spacing: var(--track-fig);
  text-transform: uppercase;
  cursor: pointer;
}
.sheet-index nav { display: flex; flex-direction: column; gap: var(--s-3); }
.sheet-index nav a {
  color: var(--fg);
  text-decoration: none;
  font-size: clamp(1.6rem, 6vw, 2.6rem);
  font-weight: 640;
  letter-spacing: -0.02em;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--line);
}
.sheet-index nav a .fig { margin-right: var(--s-4); color: var(--accent); }
.sheet-index nav a:hover { color: var(--accent); }

/* ---------- blocks: every section is rows on the sheet ---------- */
.block {
  position: relative;
  display: grid;
  grid-template-columns: var(--gutter-col) minmax(0, 1fr);
  padding-block: var(--section-pad);
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc(var(--row) - 1px),
      var(--rule) calc(var(--row) - 1px),
      var(--rule) var(--row)
    )
    var(--bg);
  border-bottom: 1px solid var(--line);
}
.block--flush { padding-block: var(--s-7); }
.row-gutter {
  grid-column: 1;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  padding-top: 0.35rem;
  font-family: var(--font-figures);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.row-gutter b {
  font-weight: 400;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}
.block > .sheet-wrap { grid-column: 2; }

/* sheet-tab section heads */
.sheet-tab-head {
  display: flex;
  align-items: flex-end;
  gap: var(--s-4);
  flex-wrap: wrap;
  border-bottom: 2px solid var(--line-strong);
  margin-bottom: var(--s-6);
}
.sheet-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: var(--r-tab);
  padding: 0.55rem 1.1rem 0.45rem;
  transform: translateY(2px);
}
.sheet-tab h2, .sheet-tab .tab-title {
  font-size: var(--t-h3);
  font-weight: 680;
  letter-spacing: -0.01em;
  line-height: 1;
}
.sheet-tab--active { background: var(--bg); border-bottom: 2px solid var(--bg); }
.sheet-tab-head .cellref { margin-bottom: 0.55rem; border: 0; padding-inline: 0; background: none; }

/* ---------- hero: the opening balance ---------- */
.opening h1 {
  font-size: var(--t-display);
  font-weight: 730;
  letter-spacing: -0.032em;
  line-height: var(--lh-tight);
  max-width: 21ch;
}
.opening h1 .balanced { color: var(--accent); }
.opening-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-6);
}
.opening-base {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-6);
  margin-top: var(--s-7);
}
.opening-ctas { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* the double rule: sits under totals and the hero */
.double-rule {
  height: 7px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 3px double var(--line-strong);
  margin-top: var(--s-6);
}

/* ---------- marginalia: pencil notes in the margin ---------- */
.marginalia {
  position: relative;
  max-width: 24rem;
  padding: var(--s-4) var(--s-5);
  color: var(--muted);
  font-size: var(--t-small);
  line-height: 1.5;
  border-left: 2px solid var(--accent);
  background: var(--bg-2);
  border-radius: 0 var(--r-2) var(--r-2) 0;
}
.marginalia::before {
  content: "pencil note";
  display: block;
  font-family: var(--font-figures);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s-2);
}

/* ---------- ledger tables ---------- */
.ledger-sheet { overflow-x: auto; }
.ledger {
  width: 100%;
  min-width: 40rem;
  border-collapse: collapse;
  border: 1px solid var(--line-strong);
  background: var(--bg);
}
.ledger caption {
  text-align: left;
  padding-bottom: var(--s-3);
  color: var(--muted);
  font-size: var(--t-small);
}
.ledger th, .ledger td {
  border: 1px solid var(--line);
  padding: 0.65rem 0.85rem;
  text-align: left;
  vertical-align: top;
}
.ledger thead th {
  font-family: var(--font-figures);
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg-2);
  white-space: nowrap;
}
.ledger tbody th[scope="row"] {
  font-family: var(--font-figures);
  font-size: var(--t-fig);
  font-weight: 400;
  letter-spacing: var(--track-fig);
  color: var(--muted);
  white-space: nowrap;
}
.ledger .amount {
  font-family: var(--font-figures);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ledger .credit { color: var(--accent); }
.ledger .debit { color: var(--debit-red); }
.ledger .svc-name { font-weight: 640; }
.ledger .svc-what { color: var(--muted); font-size: var(--t-small); }

/* total row: the double-entry double rule */
.ledger tfoot th, .ledger tfoot td {
  border-top: 3px double var(--line-strong);
  background: var(--bg-2);
  font-weight: 640;
}
.ledger tfoot .amount { font-size: 1.05rem; }

/* tick: the include checkbox */
.tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0.2rem;
}
.tick input {
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-1);
  background: var(--bg);
  cursor: pointer;
  display: grid;
  place-content: center;
}
.tick input::after {
  content: "";
  width: 0.65rem;
  height: 0.65rem;
  clip-path: polygon(14% 46%, 0 62%, 40% 100%, 100% 16%, 84% 2%, 38% 68%);
  background: transparent;
  transition: background var(--dur-1) var(--ease-out);
}
.tick input:checked { border-color: var(--accent); background: var(--bg); }
.tick input:checked::after { background: var(--accent); }
.tick input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
tr.is-excluded .svc-name,
tr.is-excluded .svc-what,
tr.is-excluded .amount { opacity: 0.42; text-decoration: line-through; }
tr.is-excluded th[scope="row"] { opacity: 0.42; }

.estimate-note { margin-top: var(--s-4); }

/* ---------- method rows ---------- */
.method-rows { list-style: none; padding: 0; counter-reset: step; }
.method-rows li {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 16rem) 1fr;
  gap: var(--s-5);
  padding: var(--s-5) 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.method-rows li:last-child { border-bottom: 0; }
.method-rows .step-ref {
  font-family: var(--font-figures);
  font-size: var(--t-fig);
  letter-spacing: var(--track-fig);
  color: var(--accent);
}
.method-rows h3 { font-size: var(--t-h3); font-weight: 660; letter-spacing: -0.01em; }
.method-rows p { color: var(--muted); max-width: var(--measure); }

/* ---------- keeper (about) ---------- */
.keeper-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--s-7);
  align-items: start;
}

/* ---------- roster + posting form ---------- */
.roster-note { margin: var(--s-4) 0 var(--s-6); }
tr.row-inserted > * { background: var(--bg-2); }
tr.row-inserted .svc-name::after {
  content: " (pending)";
  color: var(--accent);
  font-weight: 400;
  font-size: var(--t-small);
}
@keyframes rowIn {
  from { opacity: 0; transform: translateY(-0.6rem); background-color: var(--paper-3); }
  to { opacity: 1; transform: translateY(0); }
}
html.js tr.row-inserted { animation: rowIn var(--dur-3) var(--ease-out); }
@media (prefers-reduced-motion: reduce) {
  html.js tr.row-inserted { animation: none; }
}

.posting-form { margin-top: var(--s-7); max-width: 46rem; }
.posting-form .entry-line { margin-bottom: var(--s-5); }
.posting-form label {
  display: block;
  font-family: var(--font-figures);
  font-size: var(--t-fig);
  letter-spacing: var(--track-fig);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--s-2);
}
.posting-form label .req { color: var(--accent); }
.posting-form input[type="text"],
.posting-form input[type="email"],
.posting-form select,
.posting-form textarea {
  width: 100%;
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-bottom: 1.5px solid var(--line-strong);
  border-radius: var(--r-1) var(--r-1) 0 0;
  padding: 0.7rem 0.85rem;
}
.posting-form textarea { resize: vertical; min-height: 7rem; }
.posting-form input:focus-visible,
.posting-form select:focus-visible,
.posting-form textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.entry-line.is-invalid input,
.entry-line.is-invalid textarea {
  /* full-strength ink, not the debit red: red belongs to the demo ledger only */
  border-color: var(--fg);
  border-bottom-color: var(--fg);
  border-bottom-width: 3px;
}
.entry-err { color: var(--fg); font-size: var(--t-small); margin-top: var(--s-2); }
.entry-err::before { content: "! "; font-family: var(--font-figures); color: var(--accent); }

.form-errors {
  border: 1.5px solid var(--line-strong);
  border-left: 4px solid var(--accent);
  background: var(--bg-2);
  border-radius: var(--r-1);
  padding: var(--s-4) var(--s-5);
  margin-bottom: var(--s-5);
}
.form-errors h3 { font-size: 1rem; margin-bottom: var(--s-2); }
.form-errors ul { margin: 0; padding-left: 1.1rem; }
.form-errors a { color: var(--fg); }

.carry-line {
  font-family: var(--font-figures);
  font-size: var(--t-fig);
  letter-spacing: 0.04em;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-1);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-5);
}
.carry-line b { color: var(--accent); font-weight: 400; }

.form-status { margin-top: var(--s-4); min-height: 1.5em; }

/* the standing disclosure: what the draft key holds while the visitor types */
.draft-note {
  margin: 0 0 var(--s-6);
  color: var(--muted);
  font-size: var(--t-small);
  border-left: 2px solid var(--line-strong);
  padding-left: var(--s-4);
}
/* without scripts there is no draft, so the disclosure would be a lie */
html:not(.js) .draft-note { display: none; }

/* the sure path when scripts never arrive: same desk, printed in the open */
.sans-script {
  display: none;
  margin-top: var(--s-5);
  max-width: var(--measure);
  font-size: var(--t-small);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-1);
  padding: var(--s-4) var(--s-5);
  background: var(--bg-2);
}
.sans-script a { color: var(--accent); }
html:not(.js) .sans-script { display: block; }
.form-fallback {
  margin-top: var(--s-5);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  padding: var(--s-4) var(--s-5);
  background: var(--bg-2);
}
.form-fallback textarea {
  width: 100%;
  font-family: var(--font-figures);
  font-size: var(--t-small);
  border: 1px solid var(--line);
  background: var(--bg);
  padding: var(--s-3);
  margin: var(--s-3) 0;
}
.form-fallback .fallback-acts { display: flex; flex-wrap: wrap; gap: var(--s-3); }

.hp-line { position: absolute; left: -9999px; top: auto; }

/* ---------- notes to the accounts (accordion) ---------- */
.acct-notes { list-style: none; padding: 0; border-top: 1px solid var(--line-strong); }
.acct-notes li { border-bottom: 1px solid var(--line); }
.note-trigger {
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: var(--s-4);
  text-align: left;
  background: none;
  border: 0;
  padding: var(--s-4) 0;
  cursor: pointer;
  font-size: var(--t-h3);
  font-weight: 640;
  letter-spacing: -0.01em;
}
.note-trigger .fn-ref { font-family: var(--font-figures); font-size: var(--t-fig); color: var(--accent); }
.note-trigger .note-mark {
  margin-left: auto;
  font-family: var(--font-figures);
  color: var(--muted);
  transition: transform var(--dur-2) var(--ease-out);
}
.note-trigger[aria-expanded="true"] .note-mark { transform: rotate(45deg); }
.note-panel { overflow: hidden; }
.note-panel > div { padding: 0 0 var(--s-5) calc(var(--s-4) + 2.4rem); }
.note-panel p { max-width: var(--measure); color: var(--muted); }

/* ---------- carried forward (footer) ---------- */
.carryforward {
  background: var(--bg);
  color: var(--fg);
  padding-block: var(--s-8) var(--s-6);
}
.carryforward .foot-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-6);
  padding-bottom: var(--s-6);
  border-bottom: 1px solid var(--line);
}
.carryforward h2 { font-size: 1rem; font-weight: 660; margin-bottom: var(--s-3); }
.carryforward ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.carryforward a { color: var(--fg); text-decoration-color: var(--line-strong); }
.carryforward a:hover { color: var(--accent); }
.foot-close {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-4);
  padding-top: var(--s-5);
  color: var(--muted);
  font-size: var(--t-small);
}

/* ---------- interior banner ---------- */
.page-banner { padding-block: var(--s-8) var(--s-6); }
.page-banner .crumb { margin-bottom: var(--s-4); display: inline-flex; gap: 0.5rem; align-items: center; }
.page-banner .crumb a { color: var(--muted); text-decoration: none; }
.page-banner .crumb a:hover { color: var(--fg); }
.page-banner h1 {
  font-size: var(--t-h2);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: var(--lh-heading);
}

/* engagement blocks on the pricing ledger */
.engagements {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-5);
  margin-top: var(--s-6);
}
.engagement {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  background: var(--bg);
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.engagement--held { border-color: var(--accent); border-width: 1.5px; }
.engagement h3 { font-size: var(--t-h3); font-weight: 680; }
.engagement .engage-price {
  font-family: var(--font-figures);
  font-size: 1.5rem;
  color: var(--accent);
}
.engagement .engage-price small { font-size: var(--t-fig); color: var(--muted); }
.engagement ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--s-2); color: var(--muted); font-size: var(--t-small); }
.engagement ul li::before { content: "+ "; font-family: var(--font-figures); color: var(--accent); }
.engagement .ledger-btn { margin-top: auto; align-self: flex-start; }

.footnotes { list-style: none; padding: 0; counter-reset: fn; max-width: var(--measure); }
.footnotes li {
  counter-increment: fn;
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--t-small);
}
.footnotes li::before {
  content: "fn." counter(fn) " ";
  font-family: var(--font-figures);
  color: var(--accent);
  letter-spacing: 0.08em;
}

/* ---------- 404: the #REF! page ---------- */
.ref-error { min-height: 62vh; display: grid; align-content: center; }
.ref-error .ref-code {
  font-family: var(--font-figures);
  font-size: clamp(3.5rem, 14vw, 9rem);
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1;
}
.ref-error h1 { font-size: var(--t-h2); font-weight: 700; letter-spacing: -0.02em; margin-top: var(--s-4); }
.ref-error .note-copy { margin-top: var(--s-4); color: var(--muted); }
.ref-fixes { margin-top: var(--s-6); display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* ---------- styleguide helpers ---------- */
.swatch-row { display: flex; flex-wrap: wrap; gap: var(--s-4); }
.swatch { width: 9.5rem; }
.swatch .chip { height: 3.4rem; border: 1px solid var(--line-strong); border-radius: var(--r-1); margin-bottom: var(--s-2); }
.swatch .fig { display: block; }
.spec-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); max-width: var(--measure); }
.spec-list li { border-bottom: 1px solid var(--line); padding-bottom: var(--s-2); }

/* ---------- reveals ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out);
}
html.js .reveal[data-delay="1"] { transition-delay: 120ms; }
html.js .reveal[data-delay="2"] { transition-delay: 240ms; }
html.js .reveal[data-delay="3"] { transition-delay: 360ms; }
html.js .reveal.is-inview { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 64rem) {
  .sheet-nav { display: none; }
  .bar-cta { display: none; }
  .sheet-index-btn { display: inline-flex; }
  .keeper-cols { grid-template-columns: 1fr; }
  .engagements { grid-template-columns: 1fr; }
}
@media (max-width: 48rem) {
  body { padding-top: 5.4rem; }
  :root { --gutter-col: 1.6rem; }
  .row-gutter b { display: none; }
  .col-ruler li:nth-child(n+6) { display: none; }
  .method-rows li { grid-template-columns: 3rem 1fr; }
  .method-rows li p { grid-column: 2; }
  .carryforward .foot-cols { grid-template-columns: 1fr; }
  .fx-readout { display: none; }
}

/* ---------- print: the sheet prints like a sheet ---------- */
@media print {
  .formula-bar, .sheet-index, .skip-link { display: none; }
  body { padding-top: 0; background: #fff; color: #000; }
  .block { border-bottom: 1px solid #999; background: none; }
  a { text-decoration: none; color: inherit; }
}
