/* Sheet Reserve
   Ledger paper with a green bias, deep green ink, one signal red reserved for
   negative numbers. Archivo carries the brand, headings and interface (heavy
   and tight for display); Newsreader is kept for long reading (articles,
   answers, legal); Kalam for the few handwritten margin notes. */

@font-face { font-family: "Newsreader"; src: url("/assets/fonts/newsreader.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/assets/fonts/newsreader-italic.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("/assets/fonts/archivo.woff2") format("woff2"); font-weight: 400 800; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Kalam"; src: url("/assets/fonts/kalam.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --paper: #f1f4ef;        /* ledger paper, green-grey not cream */
  --paper-2: #e7ece5;
  --sheet: #fbfcfa;        /* a page lying on the paper */
  --rule: #d6ddd3;
  --rule-strong: #b9c4b6;
  --grid: #e3e8e0;
  --ink: #13221a;
  --ink-2: #3c4c43;
  --ink-3: #66756c;
  --green: #1c4a35;        /* the accent: bound-ledger green */
  --green-2: #2c6a4d;
  --green-wash: #dfeadf;
  --signal: #a6402c;       /* negative numbers and errors only */
  --input-blue: #1f4fa3;   /* matches the blue-input convention inside the files */
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --hand: "Kalam", "Bradley Hand", cursive;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1180px;
  --radius: 6px;
  --radius-lg: 14px;
  --frost: rgba(250, 252, 250, .74);   /* a translucent panel laid over the photo or paper */
  --shadow: 0 1px 0 rgba(19, 34, 26, .04), 0 10px 30px -18px rgba(19, 34, 26, .35);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1rem/1.6 var(--sans); font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--green-2); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--green-2); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 750; line-height: 1.08; letter-spacing: -.028em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 800; letter-spacing: -.038em; }
h2 { font-size: clamp(1.55rem, 2.7vw, 2.15rem); }
h3 { font-size: 1.18rem; font-weight: 700; letter-spacing: -.015em; line-height: 1.2; }
p { margin: 0 0 1em; }
code, kbd { font: 500 .88em/1 ui-monospace, "SFMono-Regular", Menlo, monospace; background: var(--paper-2); padding: .15em .35em; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 50; font-family: var(--sans); }
.skip:focus { top: 12px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 780px; }
.small { font: 400 .86rem/1.5 var(--sans); color: var(--ink-3); }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.kicker { font: 600 .76rem/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); margin-bottom: .9rem; }
.kicker a { color: inherit; }
.lede { font-size: clamp(1.06rem, 1.4vw, 1.2rem); line-height: 1.6; color: var(--ink-2); max-width: 46em; }
.margin-note { font: 400 1.2rem/1.15 var(--hand); color: var(--green-2); transform: rotate(-4deg); margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  font: 600 .98rem/1 var(--sans); letter-spacing: -.005em; text-decoration: none;
  padding: .9em 1.35em; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn:disabled:hover { opacity: .55; cursor: not-allowed; transform: none; background: var(--green); }
.btn-ink { background: var(--green); color: #fff; }
.btn-ink:hover { background: var(--green-2); color: #fff; text-decoration: none; }
.btn-line { background: var(--sheet); color: var(--ink); border-color: var(--rule-strong); }
.btn-line:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; background: var(--sheet); }
.btn-paper { background: var(--sheet); color: var(--ink); }
.btn-paper:hover { background: #fff; color: var(--ink); text-decoration: none; }
.btn-ghost-light { color: #fff; border-color: rgba(255,255,255,.45); background: transparent; }
.btn-ghost-light:hover { border-color: #fff; color: #fff; text-decoration: none; }
.btn-danger { background: transparent; color: var(--signal); border-color: var(--signal); }
.btn-danger:hover { background: var(--signal); color: #fff; }
.btn-sm { font-size: .84rem; padding: .62em .95em; }
.btn-lg { font-size: 1.06rem; padding: 1.05em 1.6em; }
.btn-arrow { font-size: 1.15em; line-height: 0; transition: transform .15s; }
.btn:hover .btn-arrow { transform: translateX(3px); }
.btn-wide { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin: 1.5rem 0 0; }
.g-icon { width: 18px; height: 18px; flex: none; }
.link-arrow { font: 600 .92rem/1 var(--sans); text-decoration: none; white-space: nowrap; }
.link-arrow::after { content: " \2192"; transition: margin .15s; }
.link-arrow:hover::after { margin-left: .2em; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(244, 247, 243, .93); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--rule); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 78px; }
.home .header-row.wrap { max-width: 1672px; padding: 0 clamp(16px, 4.9vw, 82px); }
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); text-decoration: none; }
.logo-mark { width: 42px; height: 42px; flex: none; }
.logo-mark rect { fill: var(--sheet); stroke: var(--green); stroke-width: 1.6; }
.logo-mark .lm-s1 { fill: var(--green); }
.logo-mark .lm-grid { stroke: rgba(255,255,255,.55); stroke-width: 1.2; fill: none; }
.brand-text { display: flex; flex-direction: column; white-space: nowrap; }
.brand-name { font: 700 1.62rem/1 var(--display); letter-spacing: -.03em; }
.brand-slogan { font: 500 .64rem/1.3 var(--sans); letter-spacing: .3em; text-transform: uppercase; color: var(--ink-3); margin-top: .45em; }
.site-nav { display: flex; align-items: center; gap: 2rem; font: 450 1.02rem/1 var(--sans); }
.site-nav a[href="/login"], .site-nav a[href="/account"] { color: var(--ink); font-weight: 550; }
.site-nav a:not(.btn) { color: var(--ink-2); text-decoration: none; padding: .5em 0; border-bottom: 1.5px solid transparent; }
.site-nav a:not(.btn):hover { color: var(--ink); border-bottom-color: var(--rule-strong); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--green); }
.nav-split { width: 1px; height: 22px; background: var(--rule-strong); }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; padding: 0; }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 22px; height: 1.6px; background: var(--ink); margin: 0 auto; position: relative; transition: transform .2s; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Sections ---------- */
.band { padding: clamp(3.5rem, 7vw, 6rem) 0; border-top: 1px solid var(--rule); }
.band-tight { padding: 2rem 0 4rem; border-top: 0; }
.band-ruled { background-color: var(--sheet); background-image: linear-gradient(var(--grid) 1px, transparent 1px); background-size: 100% 2.2rem; }
.band-ink { background: var(--green); color: #e9f0ea; border-top: 0; }
.band-ink h2, .band-ink .price-big { color: #fff; }
.band-ink .kicker { color: #a9cbb4; }
.band-ink .small { color: #b7cdbd; }
.band-ink a:not(.btn) { color: #fff; }
.section-head { max-width: 640px; margin-bottom: 2.4rem; }
.section-head p { color: var(--ink-2); }
.section-head-row { max-width: none; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.split > *, .article-layout > *, .book-hero > *, .book-band-row > *, .auth-row > *, .sheet-head-row > * { min-width: 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.h-small { font: 600 .78rem/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 1rem; }
.page-head { padding: 2.6rem 0 2.8rem; }
.page-head-tight { padding-bottom: 1rem; }
.page-head h1 { margin-top: .3rem; }
.crumbs ol { list-style: none; margin: 0 0 1.6rem; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; font: 500 .82rem/1.3 var(--sans); color: var(--ink-3); }
.crumbs li + li::before { content: "/"; margin-right: .4rem; color: var(--rule-strong); }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--green); }

/* ---------- Hero ----------
   A full-width stage: copy on the left, the photo on the right. The photo has
   an empty spot where the sheet goes; .hero-sheet is laid over it in
   percentages of the figure and sized in container units, so the two stay
   registered at every width. */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--rule); background: linear-gradient(180deg, #f3f6f2 0%, var(--paper) 100%); }
.hero-stage { position: relative; max-width: 1672px; margin: 0 auto; display: grid; grid-template-columns: max(34.2%, 500px) minmax(0, 1fr); align-items: end; }
.hero-copy { position: relative; z-index: 2; padding: clamp(3rem, 4.8vw, 5rem) 0 clamp(2.5rem, 2.8vw, 3rem) clamp(16px, 4.9vw, 82px); min-width: 0; }
.hero-copy .kicker { color: var(--ink-2); font-weight: 500; letter-spacing: .16em; margin-bottom: clamp(1.4rem, 2.4vw, 2.3rem); }
.hero-title { font: 800 clamp(3rem, 5.45vw, 5.75rem)/.98 var(--display); letter-spacing: -.045em; margin: 0; white-space: nowrap; color: var(--ink); }
.hero-title em { font-style: normal; color: var(--green); display: block; }
.hero-swash { display: block; width: clamp(150px, 14.5vw, 245px); height: auto; margin: .5rem 0 0 .2rem; overflow: visible; }
.hero-swash path { fill: none; stroke: #bfd0c3; stroke-width: 5; stroke-linecap: round; }
.hero-copy .lede { font-size: clamp(1rem, 1.1vw, 1.16rem); line-height: 1.62; color: var(--ink-3); max-width: 28.5em; margin: clamp(1.4rem, 2.3vw, 2.2rem) 0 0; }
.hero-copy .btn-row { margin-top: clamp(1.4rem, 1.9vw, 1.9rem); gap: 1rem; flex-wrap: nowrap; }
.hero-copy .btn-lg { font-size: clamp(.98rem, 1.05vw, 1.06rem); padding: 1.05em clamp(1.1em, 1.4vw, 1.6em); }
.hero-copy .btn-line { background: rgba(251, 252, 250, .8); }
.hero-facts { position: relative; display: inline-flex; flex-wrap: nowrap; margin: clamp(1.6rem, 2.2vw, 2.2rem) 0 0 -1rem; padding: .9rem 1.4rem .9rem 1rem; background: var(--frost); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-radius: var(--radius-lg); border-top: 1px solid var(--rule); white-space: nowrap; }
.hero-facts div { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: .8rem; align-items: center; padding: 0 1.3rem; border-right: 1px solid var(--rule-strong); }
.hero-facts div:last-child { border-right: 0; padding-right: 0; }
.hero-fact-icon { grid-row: span 2; width: 26px; height: 26px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.hero-facts dt { font: 600 .66rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .4rem; align-self: end; }
.hero-facts dd { margin: 0; font: 450 .95rem/1.2 var(--sans); color: var(--ink-2); align-self: start; }
.hero-facts .price { color: var(--ink); }
.hero-quote { position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: 1.2rem; max-width: 30rem; margin: 1rem 0 0; padding: 1.3rem 1.6rem 1.2rem; background: #e5ece5; border-radius: 18px; }
.hero-quote-mark { grid-row: span 2; font: 800 4.6rem/.8 var(--serif); color: var(--green); margin-top: .1rem; }
.hero-quote blockquote { margin: 0; }
.hero-quote p { margin: 0; font: italic 400 1.05rem/1.45 var(--sans); color: var(--ink); }
.hero-quote figcaption { font: 400 .84rem/1.4 var(--sans); color: var(--ink-3); margin-top: .5rem; }

.hero-figure { position: relative; margin: 0; container-type: inline-size; aspect-ratio: 1100 / 828; align-self: end; }
.hero-scene { position: absolute; inset: 0; width: 100%; height: 100%; --fade: linear-gradient(90deg, transparent 0, #000 5%), linear-gradient(180deg, transparent 0, #000 7%); -webkit-mask-image: var(--fade); -webkit-mask-composite: source-in; mask-image: var(--fade); mask-composite: intersect; }
.hero-sheet { position: absolute; left: 34.05%; top: 17.05%; width: 58.05%; height: 61.4%; display: flex; flex-direction: column; background: var(--sheet); border: 1px solid #d9e0da; border-radius: .9cqw; box-shadow: 0 .2cqw .5cqw rgba(19, 34, 26, .06), 0 2.6cqw 5cqw -2.6cqw rgba(19, 34, 26, .3); overflow: hidden; font-size: 1.2cqw; }
.hero-sheet-bar { flex: none; display: flex; align-items: center; gap: 1.1em; height: 3.5cqw; padding: 0 1.4em; border-bottom: 1px solid var(--grid); font: 500 1em/1 var(--sans); color: var(--ink); background: var(--sheet); }
.hero-sheet-file { white-space: nowrap; }
.hero-sheet-formula { flex: 1; min-width: 0; font: 400 .96em/1 ui-monospace, "SFMono-Regular", Menlo, monospace; color: var(--green); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 1px solid var(--rule); padding-left: 1.1em; }
.hero-sheet .grid-scroll { flex: 1; min-height: 0; max-height: none; border: 0; border-radius: 0; }
.hero-sheet .grid { width: 139% !important; font-size: 1em; }
.hero-sheet .grid col { width: auto !important; }
.hero-sheet .grid col.grid-rh { width: 5.9% !important; }
.hero-sheet .grid col:nth-child(2) { width: 7.8% !important; }
.hero-sheet .grid th, .hero-sheet .grid td { height: 3.12cqw; padding: 0 .75em; font-size: 1em; }
.hero-sheet .grid thead th { height: 2.9cqw; background: #f6f8f6; color: var(--ink-2); font-weight: 450; }
.hero-sheet .grid tbody th { background: #f6f8f6; color: var(--ink-2); font-weight: 450; }
.hero-sheet .grid tr:first-child td.is-b { font: 700 1.12em/1 var(--display); }
.hero-sheet .grid td.is-h { background: #234d3a; }
.hero-sheet-tabs { flex: none; display: flex; height: 3.3cqw; border-top: 1px solid var(--grid); background: #f6f8f6; font: 450 1em/1 var(--sans); }
.hero-sheet-tabs span { display: flex; align-items: center; padding: 0 1.4em; color: var(--ink-3); white-space: nowrap; }
.hero-sheet-tabs .on { background: var(--sheet); color: var(--green); font-weight: 600; box-shadow: inset 0 .2cqw 0 var(--green); }
.hero-note { position: absolute; left: 70.4%; top: 6.4%; margin: 0; font: 400 2.25cqw/1.2 var(--hand); color: var(--green); transform: rotate(-7deg); transform-origin: left bottom; white-space: nowrap; }
.hero-note-arrow { position: absolute; left: 86.6%; top: 7.6%; width: 5.4%; height: auto; overflow: visible; fill: none; stroke: var(--green); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Spreadsheet grid (previews) ---------- */
.grid-scroll { overflow: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--sheet); max-height: 560px; scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
.grid { border-collapse: separate; border-spacing: 0; font: 400 .8rem/1.25 var(--sans); font-variant-numeric: tabular-nums; table-layout: fixed; }
.grid th, .grid td { border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid); padding: .34rem .5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 1.9rem; }
.grid thead th { position: sticky; top: 0; background: var(--paper); color: var(--ink-3); font-weight: 500; text-align: center; z-index: 2; border-bottom-color: var(--rule); }
.grid tbody th { position: sticky; left: 0; background: var(--paper); color: var(--ink-3); font-weight: 500; text-align: center; z-index: 1; border-right-color: var(--rule); }
.grid .grid-rh { width: 2.6rem; }
.grid .grid-corner { left: 0; z-index: 3; }
.grid td.is-b { font-weight: 650; }
.grid td.is-i { font-style: italic; color: var(--ink-3); }
.grid td.is-n { text-align: right; }
.grid td.is-h { background: var(--green); color: #fff; font-weight: 600; }
.grid td.is-x { color: var(--signal); }
.grid td.is-f { cursor: help; }
.grid td.is-f:hover, .grid td.is-f.is-lit { box-shadow: inset 0 0 0 2px var(--green-2); }
.grid td.is-m { overflow: visible; }
.grid td.is-o { overflow: visible; text-overflow: clip; position: relative; z-index: 0; }
.grid td.is-l { font: 700 1.12rem/1 var(--display); letter-spacing: -.01em; }
.grid tr:first-child td.is-b { font: 700 1rem/1.2 var(--display); letter-spacing: -.01em; }
.grid td.cell-in { animation: cellIn .45s ease-out both; }
@keyframes cellIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ---------- Ledger (category index) ---------- */
.ledger { border-top: 2px solid var(--ink); font-family: var(--sans); }
.ledger-row { display: grid; grid-template-columns: 1.3fr .8fr .5fr 2.4fr; gap: 1.5rem; padding: 1.05rem .2rem; border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; align-items: baseline; }
a.ledger-row:hover { background: var(--sheet); color: var(--ink); text-decoration: none; }
a.ledger-row:hover .ledger-name { color: var(--green); }
.ledger-head { font: 600 .7rem/1 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); padding: .8rem .2rem; }
.ledger-name { font: 700 1.18rem/1.2 var(--display); letter-spacing: -.02em; }
.ledger-desc { color: var(--ink-3); font-size: .92rem; }

/* ---------- Pipeline ---------- */
.pipeline { list-style: none; margin: 0; padding: 0; counter-reset: pipe; border-left: 2px solid var(--green); }
.pipeline li { position: relative; padding: 0 0 1.6rem 1.8rem; counter-increment: pipe; }
.pipeline li:last-child { padding-bottom: 0; }
.pipeline li::before { content: ""; position: absolute; left: -7px; top: .45rem; width: 12px; height: 12px; background: var(--sheet); border: 2px solid var(--green); }
.pipe-k { display: block; font: 600 .78rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--green); margin-bottom: .4rem; }
.pipe-v { display: block; color: var(--ink-2); }

/* ---------- Cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 0; border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.sheet-card { position: relative; padding: 1.5rem 1.5rem 1.4rem; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: transparent; transition: background-color .15s; }
.sheet-card:hover { background: var(--sheet); }
.sheet-card h3 { margin: .2rem 0 .5rem; font-size: 1.22rem; }
.sheet-card h3 a { color: var(--ink); text-decoration: none; }
.sheet-card h3 a::after { content: ""; position: absolute; inset: 0; }
.sheet-card:hover h3 a { color: var(--green); }
.sheet-card-meta { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font: 600 .7rem/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 0; }
.sheet-card-meta .free { color: var(--green-2); }
.sheet-card-sub { color: var(--ink-2); font-size: .97rem; margin-bottom: .9rem; }
.sheet-card-facts { font: 500 .8rem/1 var(--sans); color: var(--ink-3); margin: 0; font-variant-numeric: tabular-nums; }

/* ---------- Posts ---------- */
.post-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 3rem; }
.post-list-3 { grid-template-columns: repeat(3, 1fr); }
.post-item { padding: 1.4rem 0 1.5rem; border-top: 1px solid var(--rule); }
.post-item h3 { margin: .35rem 0 .5rem; font-size: 1.25rem; }
.post-item h3 a { color: var(--ink); text-decoration: none; }
.post-item h3 a:hover { color: var(--green); text-decoration: underline; }
.post-item p:last-child { color: var(--ink-2); font-size: .96rem; margin: 0; }
.post-meta { display: flex; gap: .9rem; font: 600 .7rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 0; }
.topic-index { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; font: 500 .9rem/1.4 var(--sans); margin-top: 1.5rem; }
.topic-head { font-size: 1.35rem; margin: 2.8rem 0 .4rem; }
.topic-head:first-child { margin-top: 0; }

/* ---------- Pricing / sign-in block ---------- */
.price-big { font: 800 clamp(3rem, 6vw, 4.4rem)/1 var(--display); letter-spacing: -.045em; margin: 0 0 1.4rem; }
.price-big span { font: 500 1.05rem/1 var(--sans); letter-spacing: 0; margin-left: .3rem; }
.ticks { list-style: none; padding: 0; margin: 0 0 1.4rem; }
.ticks li { position: relative; padding: .35rem 0 .35rem 1.6rem; font-family: var(--sans); font-size: .98rem; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .82em; width: .7rem; height: .38rem; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); color: var(--green-2); }
.band-ink .ticks li::before { color: #a9cbb4; }
.ticks-quiet li { color: var(--ink-2); }
.signin-block { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16); padding: 2rem; border-radius: var(--radius-lg); display: grid; gap: .8rem; }
.signin-block h2 { margin-bottom: 0; }
.price-side .h-small { margin-top: 2.2rem; }
.price-side .h-small:first-child { margin-top: 0; }
.price-card { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 2.2rem; box-shadow: var(--shadow); }
.lib-status { font: 500 .96rem/1.5 var(--sans); padding: .85rem 1.1rem; border-left: 3px solid var(--rule-strong); border-radius: 0 var(--radius) var(--radius) 0; background: var(--sheet); margin: .5rem 0 0; }
.lib-status-ok { border-left-color: var(--green-2); }
.lib-status-warn { border-left-color: var(--signal); }

/* ---------- Book ---------- */
.book-band { background: var(--paper-2); border-top: 1px solid var(--rule); padding: clamp(3rem, 6vw, 5rem) 0; }
.book-band-row { display: grid; grid-template-columns: 220px 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; position: relative; }
.book-cover img { box-shadow: 0 2px 0 rgba(0,0,0,.05), 14px 22px 40px -22px rgba(19,34,26,.6); transition: transform .3s; }
.book-cover:hover img { transform: translateY(-3px) rotate(-.6deg); }
.book-band h2 { max-width: 22ch; }
.book-band-copy p { max-width: 58ch; color: var(--ink-2); }
.book-facts { font: 500 .86rem/1.4 var(--sans); color: var(--ink-3); }
.book-note { position: absolute; right: 0; top: 0; }
.book-aside { border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--sheet); padding: 1.3rem; }
.book-aside .book-cover img { width: 120px; margin-bottom: 1rem; }
.book-aside-title { font: 700 1.02rem/1.3 var(--display); margin-bottom: .4rem; }
.book-aside-title a { color: var(--ink); text-decoration: none; }
.book-inline { display: grid; grid-template-columns: 96px 1fr; gap: 1.3rem; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); padding: 1.4rem 0; margin: 3rem 0 0; font-size: .97rem; }
.book-inline-title { font: 700 1.1rem/1.3 var(--display); margin-bottom: .4rem; }
.book-inline .kicker { margin-bottom: .4rem; }
.book-hero { display: grid; grid-template-columns: minmax(220px, 360px) 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.book-hero-cover { box-shadow: 18px 26px 50px -26px rgba(19,34,26,.6); }

/* ---------- The film ----------
   A sheet on the paper: the player keeps its 16:9 frame at every width, and the chapters
   form a ledger beside it. Only the poster loads until someone presses play. */
.film-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(1.5rem, 3.4vw, 3rem); align-items: start; }
.film { margin: 0; min-width: 0; }
.film-frame { aspect-ratio: 16 / 9; background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.film-video { display: block; width: 100%; height: 100%; background: var(--sheet); }
.film figcaption { margin-top: .75rem; font: 500 .86rem/1.45 var(--sans); color: var(--ink-3); }
.film-chapters { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); font: 450 .95rem/1.35 var(--sans); min-width: 0; }
.film-chapters li { border-bottom: 1px solid var(--rule); }
.film-chapters a { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); gap: .8rem; padding: .72rem .2rem; color: var(--ink); text-decoration: none; }
.film-chapters a:hover span:last-child { color: var(--green); text-decoration: underline; text-underline-offset: .18em; }
.film-time { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--green); }

/* ---------- Catalog ---------- */
.catalog-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1rem; margin-bottom: 1.2rem; font-family: var(--sans); }
.search { flex: 1 1 280px; }
.search input, .select select, .field input {
  width: 100%; font: 400 1rem/1.3 var(--sans); color: var(--ink); background: var(--sheet);
  border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: .75rem .9rem; transition: border-color .15s, box-shadow .15s;
}
.search input { padding-left: 2.4rem; background: var(--sheet) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2366756c' stroke-width='1.8'%3E%3Ccircle cx='7' cy='7' r='5.2'/%3E%3Cpath d='m11 11 3.6 3.6'/%3E%3C/svg%3E") no-repeat .85rem 50%; }
.search input:focus, .select select:focus, .field input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-wash); }
.select select { appearance: none; padding-right: 2.2rem; background: var(--sheet) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2313221a' stroke-width='1.6'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E") no-repeat right .9rem center; cursor: pointer; }
.seg { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: var(--radius); overflow: hidden; }
.seg button { font: 500 .9rem/1 var(--sans); background: var(--sheet); color: var(--ink-2); border: 0; padding: .78rem 1rem; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--rule-strong); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.catalog-count { margin: 0 0 0 auto; font: 500 .86rem/1 var(--sans); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.catalog-table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: .93rem; }
.catalog-table thead th { text-align: left; border-bottom: 2px solid var(--ink); padding: 0; font-weight: 600; white-space: nowrap; }
.catalog-table thead th button { all: unset; cursor: pointer; display: block; padding: .8rem .7rem; font: 600 .72rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.catalog-table thead th.num button { text-align: right; }
.catalog-table thead th button:hover, .catalog-table th[aria-sort] button { color: var(--ink); }
.catalog-table th[aria-sort="ascending"] button::after { content: " \2191"; }
.catalog-table th[aria-sort="descending"] button::after { content: " \2193"; }
.catalog-table td { padding: .95rem .7rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.catalog-table tbody tr:hover { background: var(--sheet); }
.catalog-title { font: 650 1.05rem/1.3 var(--display); letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.catalog-title:hover { color: var(--green); text-decoration: underline; }
.catalog-sub { display: block; color: var(--ink-3); font-size: .84rem; margin-top: .25rem; max-width: 58ch; }
.catalog-action { text-align: right; white-space: nowrap; }
.catalog-empty { padding: 2rem 0; color: var(--ink-3); font-family: var(--sans); }

/* ---------- Download dialog ---------- */
.dl-dialog { border: 1px solid var(--rule-strong); border-radius: var(--radius-lg); padding: 0; max-width: 560px; width: calc(100% - 32px); background: var(--sheet); color: var(--ink); box-shadow: 0 30px 80px -30px rgba(19,34,26,.6); }
.dl-dialog::backdrop { background: rgba(19, 34, 26, .42); }
.dl-form { padding: 1.8rem; }
.dl-form h2 { font-size: 1.5rem; margin-bottom: .2rem; }
.dl-sub { color: var(--ink-3); font: 400 .9rem/1.4 var(--sans); }
.dl-formats { border: 0; padding: 0; margin: 1rem 0; display: grid; gap: .5rem; }
.dl-opt { display: grid; grid-template-columns: auto 1fr; gap: .1rem .8rem; align-items: start; padding: .8rem .9rem; border: 1px solid var(--rule); border-radius: var(--radius); cursor: pointer; font-family: var(--sans); }
.dl-opt:hover { border-color: var(--rule-strong); }
.dl-opt:has(input:checked) { border-color: var(--green); background: var(--green-wash); }
.dl-opt input { grid-row: span 2; margin-top: .25rem; accent-color: var(--green); }
.dl-opt-head { display: flex; justify-content: space-between; font-weight: 600; font-size: .95rem; }
.dl-opt-head code { background: none; color: var(--ink-3); }
.dl-opt-desc { font-size: .84rem; color: var(--ink-3); }
.dl-status { min-height: 1.4em; font: 500 .9rem/1.4 var(--sans); color: var(--green-2); margin: 0; }
.dl-status.is-error { color: var(--signal); }

/* ---------- Sheet page ---------- */
.sheet-head-row { display: grid; grid-template-columns: 1fr auto; gap: 2rem 3rem; align-items: end; }
.sheet-cta { display: grid; gap: .6rem; justify-items: start; max-width: 340px; }
.sheet-cta .small { margin: 0; }
.formats { display: flex; flex-wrap: wrap; gap: .35rem; font: 600 .68rem/1 var(--sans); letter-spacing: .06em; color: var(--ink-3); }
.formats span { padding: .35rem .5rem; border: 1px solid var(--rule); border-radius: 4px; background: var(--sheet); }
.preview-tabs { display: flex; gap: 0; overflow-x: auto; border-bottom: 1px solid var(--rule); }
.preview-tabs button { font: 500 .86rem/1 var(--sans); background: none; border: 0; padding: .8rem 1rem; color: var(--ink-3); cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.preview-tabs button[aria-selected="true"] { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }
.preview-panel .grid-scroll { border-top: 0; }
.preview-note { font: 400 .82rem/1.4 var(--sans); color: var(--ink-3); margin-top: .7rem; }
.facts { margin: 0; display: grid; gap: 0; font-family: var(--sans); font-size: .9rem; }
.facts div { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--rule); }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.facts-row { display: flex; flex-wrap: wrap; gap: 0 2rem; }
.facts-row div { display: block; border: 0; padding: 0; }
.facts-row dd { text-align: left; font: 650 1.1rem/1.3 var(--display); letter-spacing: -.01em; }
.cite { font-size: .94rem; background: var(--green-wash); border-radius: var(--radius); padding: .9rem 1.1rem; }

/* ---------- Article ---------- */
.article-head .lede { margin-bottom: 1.2rem; }
.byline { font: 400 .86rem/1.5 var(--sans); color: var(--ink-3); }
.byline a { color: var(--ink-2); }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; padding-bottom: 4rem; }
.aside-col { display: grid; gap: 1.6rem; position: sticky; top: 96px; }
.aside-block { border-top: 2px solid var(--ink); padding-top: 1rem; }
.toc ol { margin: 0; padding-left: 1.1rem; font: 400 .9rem/1.45 var(--sans); }
.toc li { margin-bottom: .45rem; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--green); text-decoration: underline; }
.link-list { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: .93rem; }
.link-list li { padding: .5rem 0; border-bottom: 1px solid var(--rule); }
.link-list a { color: var(--ink); text-decoration: none; }
.link-list a:hover { color: var(--green); text-decoration: underline; }
.prose { max-width: 70ch; font: 400 1.14rem/1.7 var(--serif); }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.65rem; margin: 2.4rem 0 .8rem; }
.prose h3 { font-size: 1.25rem; margin: 1.8rem 0 .6rem; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.2em; }
.prose li { margin-bottom: .4em; }
.prose li::marker { color: var(--green-2); }
.prose blockquote { margin: 1.5em 0; padding: .2em 0 .2em 1.2em; border-left: 3px solid var(--green); color: var(--ink-2); font-style: italic; }
.prose table { border-collapse: collapse; width: 100%; font: 400 .92rem/1.45 var(--sans); margin: 0; font-variant-numeric: tabular-nums; }
.prose .table-scroll { margin: 1.4em 0 1.6em; border-top: 2px solid var(--ink); }
.prose th { text-align: left; font-weight: 600; padding: .65rem .7rem; border-bottom: 1px solid var(--rule-strong); background: var(--sheet); white-space: nowrap; }
.prose td { padding: .6rem .7rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose code { font-size: .86em; color: var(--green); background: var(--green-wash); }
.prose pre { background: var(--sheet); border: 1px solid var(--rule); padding: 1rem; overflow-x: auto; font-size: .88rem; }
.prose pre code { background: none; color: var(--ink); }
.prose-lede { font-size: 1.1rem; color: var(--ink-2); }
.prose-legal { font-size: 1.04rem; }
.answer-box { background: var(--green-wash); border-radius: var(--radius-lg); padding: 1.4rem 1.6rem; margin: 1.4rem 0 1.2rem; font: 400 1.18rem/1.55 var(--serif); }
.answer-box p:last-child { margin: 0; }
.answer-label { font: 600 .72rem/1 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--green-2); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq details:first-child { border-top: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding: 1rem 2rem 1rem 0; font: 600 1.04rem/1.4 var(--display); list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .2rem; top: .85rem; font: 400 1.4rem/1 var(--sans); color: var(--green); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); padding-bottom: .4rem; }
.qa-index { columns: 2 380px; column-gap: 4rem; }
.qa-group { break-inside: avoid; margin-bottom: 2.6rem; }
.qa-group h2 { font-size: 1.3rem; border-bottom: 2px solid var(--ink); padding-bottom: .5rem; }
.qa-group ul { list-style: none; padding: 0; margin: 0; }
.qa-group li { border-bottom: 1px solid var(--rule); }
.qa-group a { display: block; padding: .65rem 0; color: var(--ink); text-decoration: none; }
.qa-group a:hover { color: var(--green); }

/* ---------- Auth and forms ---------- */
.auth { padding: clamp(2rem, 5vw, 4rem) 0 5rem; }
.auth-row { display: grid; grid-template-columns: minmax(0, 460px) 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.auth-card { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: clamp(1.6rem, 4vw, 2.4rem); box-shadow: var(--shadow); }
.auth-card h1 { font-size: 2rem; }
.auth-intro { color: var(--ink-2); }
.auth-side { position: relative; padding-top: 4rem; }
.auth-note { position: absolute; top: 0; left: 0; font-size: 1.35rem; }
.auth-alt { font: 400 .92rem/1.4 var(--sans); color: var(--ink-3); margin: 1.2rem 0 0; text-align: center; }
.or { display: flex; align-items: center; gap: .9rem; font: 500 .78rem/1 var(--sans); color: var(--ink-3); margin: 1.2rem 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.form { display: grid; gap: 1rem; margin: 0; }
.form-row { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; margin: 1rem 0 1.4rem; }
.field label, .label-row label { display: block; font: 600 .86rem/1.2 var(--sans); margin-bottom: .45rem; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.help { font: 400 .82rem/1.4 var(--sans); color: var(--ink-3); margin: .4rem 0 0; }
.check { display: flex; gap: .6rem; align-items: flex-start; font: 400 .88rem/1.45 var(--sans); color: var(--ink-2); }
.check input { margin-top: .2rem; accent-color: var(--green); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.flash { font: 500 .92rem/1.45 var(--sans); padding: .8rem 1rem; margin: 0 0 .4rem; border-left: 3px solid; }
.flash-error { border-color: var(--signal); background: #f6e9e5; color: #6d2416; }
.flash-ok { border-color: var(--green-2); background: var(--green-wash); color: var(--green); }
.pw-meter { height: 3px; background: var(--rule); margin-top: .5rem; overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; background: var(--signal); transition: width .2s, background-color .2s; }

/* ---------- Account ---------- */
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.panel { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 1.6rem; }
.panel h2 { font-size: 1.35rem; }
.panel-danger { border-color: #e2c8c1; }
.inline-form { display: inline-block; margin: .6rem .5rem 0 0; }
.mini-table { width: 100%; border-collapse: collapse; font: 400 .84rem/1.4 var(--sans); margin-bottom: .6rem; }
.mini-table td { padding: .45rem .3rem; border-bottom: 1px solid var(--rule); color: var(--ink-2); }
#membership { grid-column: 1 / -1; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #c9d6cd; padding: 4rem 0 2rem; font-family: var(--sans); font-size: .92rem; }
.site-footer a { color: #e6eee8; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-top { display: grid; grid-template-columns: 1fr 3fr; gap: 3rem; padding-bottom: 2.6rem; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand-footer, .brand-footer:hover { color: #fff; }
.brand-footer .brand-slogan { color: #9fb3a6; }
.brand-footer .logo-mark rect { fill: var(--ink); stroke: #a9cbb4; }
.brand-footer .logo-mark .lm-s1 { fill: #a9cbb4; }
.brand-footer .logo-mark .lm-grid { stroke: rgba(19,34,26,.5); }
.footer-note { margin-top: 1.2rem; max-width: 34ch; color: #9fb3a6; }
.footer-cols { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2rem; }
.footer-cols h2 { font: 600 .72rem/1 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: #9fb3a6; margin-bottom: 1rem; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; }
.footer-cols li { margin-bottom: .55rem; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem 2rem; padding-top: 1.6rem; font-size: .84rem; color: #9fb3a6; }
.footer-base p { margin: 0; }

/* ---------- Motion ---------- */
.logo-mark rect { transform-box: fill-box; transform-origin: center; }
.brand .lm-s3, .brand .lm-s2 { transition: transform .35s cubic-bezier(.2,.7,.2,1); }
.brand:hover .lm-s3 { transform: translate(2px, -2px); }
.brand:hover .lm-s2 { transform: translate(1px, -1px); }
.is-loading .logo-mark .lm-s3 { animation: stackIn .6s .05s cubic-bezier(.2,.7,.2,1) both; }
.is-loading .logo-mark .lm-s2 { animation: stackIn .6s .15s cubic-bezier(.2,.7,.2,1) both; }
@keyframes stackIn { from { transform: translate(-3px, 3px); opacity: 0; } to { transform: none; opacity: 1; } }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .hero-stage { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { padding: clamp(2.5rem, 6vw, 4rem) 24px 0; max-width: 760px; }
  .hero-title { font-size: clamp(2.6rem, 9.4vw, 5.4rem); }
  .hero-copy .lede { max-width: 36em; }
  .hero-facts { margin-left: 0; }
  .hero-figure { margin-top: 1.5rem; }
  .hero-scene { -webkit-mask-image: none; mask-image: none; }
}
@media (max-width: 1020px) {
  .split, .book-hero, .film-row { grid-template-columns: minmax(0, 1fr); }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .aside-col { position: static; }
  .post-list-3 { grid-template-columns: 1fr 1fr; }
  .footer-top { grid-template-columns: 1fr; }
}
@media (max-width: 1080px) {
  .nav-toggle { display: block; }
  .site-nav { position: absolute; top: 78px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--paper); border-bottom: 1px solid var(--rule); padding: .5rem clamp(16px, 4.9vw, 82px) 1.2rem; display: none; }
  .site-nav.is-open { display: flex; }
  .site-nav a:not(.btn) { padding: .9rem 0; border-bottom: 1px solid var(--rule); }
  .site-nav .btn { margin-top: 1rem; }
  .nav-split { display: none; }
}
@media (max-width: 860px) {
  .auth-row { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .sheet-head-row { grid-template-columns: 1fr; }
  .account-grid { grid-template-columns: 1fr; }
  .ledger-row { grid-template-columns: 1fr auto; gap: .2rem 1rem; }
  .ledger-row > :nth-child(2) { display: none; }
  .ledger-desc { grid-column: 1 / -1; }
  .ledger-head { display: none; }
  .book-band-row { grid-template-columns: 140px 1fr; }
  .book-note { display: none; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .wrap { padding: 0 16px; }
  .post-list, .post-list-3 { grid-template-columns: 1fr; }
  .brand-slogan { display: none; }
  .hero-copy { padding: 2.2rem 16px 0; }
  .hero-title { white-space: normal; }
  .hero-copy .btn-row { flex-wrap: wrap; }
  .hero-copy .btn-row .btn { flex: 1 1 auto; }
  .hero-facts { display: grid; grid-template-columns: 1fr; gap: .9rem; white-space: normal; padding: 1rem 1.1rem; width: 100%; }
  .hero-facts div { padding: 0; border-right: 0; grid-template-columns: 26px 1fr; justify-items: start; }
  .hero-quote { padding: 1.1rem 1.2rem; }
  .hero-quote-mark { font-size: 3.6rem; }
  .catalog-table thead th:nth-child(2), .catalog-table td:nth-child(2),
  .catalog-table thead th:nth-child(4), .catalog-table td:nth-child(4),
  .catalog-table thead th:nth-child(5), .catalog-table td:nth-child(5) { display: none; }
  .catalog-count { margin-left: 0; }
  .book-band-row { grid-template-columns: 1fr; }
  .book-band .book-cover img { width: 150px; }
  .book-inline { grid-template-columns: 72px 1fr; }
}
/* ---------- Free browser tools ----------
   A workbench on the same paper: the controls sit on a sheet-like panel, the
   preview is the site's own spreadsheet grid, and the format flow is written
   out in the same small caps as the rest of the site. */
.tool {
 display: grid;
 grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
 gap: clamp(1.5rem, 3vw, 2.6rem);
 align-items: start;
}
.tool-controls {
 background: var(--sheet);
 border: 1px solid var(--rule);
 border-radius: var(--radius-lg);
 padding: 1.6rem;
 box-shadow: var(--shadow);
}
.tool-drop {
  position: relative;
 display: block;
 padding: 1.5rem 1.4rem;
 border: 1.5px dashed var(--rule-strong);
 border-radius: var(--radius);
 background: var(--paper);
 cursor: pointer;
 transition:
  border-color 0.15s,
  background-color 0.15s;
}
.tool-drop:hover,
.tool-drop.is-over {
 border-color: var(--green);
 background: var(--green-wash);
}
.tool-drop:focus-within {
 outline: 2px solid var(--green-2);
 outline-offset: 2px;
}
.tool-drop-title {
 display: block;
 font: 700 1.06rem / 1.25 var(--display);
 letter-spacing: -0.015em;
 margin-bottom: 0.35rem;
}
.tool-drop-hint {
 display: block;
 font: 400 0.86rem / 1.45 var(--sans);
 color: var(--ink-2);
}
/* The file input fills the drop zone and stays invisible: a bigger hit target
   than the site-wide .sr-only clip, and not a scroll container, so nothing on
   the page reports horizontal overflow. */
.tool-drop .sr-only {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  clip: auto;
  clip-path: none;
  opacity: 0;
  margin: 0;
}
.tool-file {
 margin: 0.7rem 0 0;
 font: 500 0.84rem / 1.4 var(--sans);
 color: var(--ink-2);
 font-variant-numeric: tabular-nums;
 min-height: 1.2em;
}
.tool-paste {
 margin-top: 1rem;
}
.tool-paste summary {
 cursor: pointer;
  padding: 0.4rem 0;
 font: 600 0.92rem / 1.4 var(--sans);
 color: var(--green);
}
.tool-paste summary:hover {
 color: var(--green-2);
}
.tool-paste > .field {
 margin-top: 0.8rem;
}
.tool-paste textarea {
 width: 100%;
 font:
  400 0.88rem / 1.5 ui-monospace,
  "SFMono-Regular",
  Menlo,
  monospace;
 color: var(--ink);
 background: var(--paper);
 border: 1px solid var(--rule-strong);
 border-radius: var(--radius);
 padding: 0.7rem 0.8rem;
 resize: vertical;
}
.tool-paste textarea:focus {
 border-color: var(--green);
 box-shadow: 0 0 0 3px var(--green-wash);
}
.tool-options {
 display: grid;
 gap: 1.1rem;
 margin-top: 1.4rem;
 padding-top: 1.4rem;
 border-top: 1px solid var(--rule);
}
.tool-options .check {
 display: flex;
 font: 400 0.9rem / 1.45 var(--sans);
}
.tool-options .check input[type="checkbox"] {
 width: auto;
 flex: none;
 padding: 0;
 border: 0;
 background: none;
 box-shadow: none;
}
.tool-options .field > label {
 margin-bottom: 0.45rem;
}
.tool-options .tool-columns {
 border: 0;
 padding: 0;
 margin: 0;
 min-width: 0;
}
.tool-options .tool-columns legend {
 padding: 0;
 font: 600 0.86rem / 1.2 var(--sans);
 margin-bottom: 0.5rem;
}
.tool-columns-list {
 max-height: 15rem;
 overflow-y: auto;
 border: 1px solid var(--rule-strong);
 border-radius: var(--radius);
 background: var(--paper);
 padding: 0.35rem 0.8rem 0.35rem 2.4rem;
}
.tool-columns-list:empty {
 display: none;
}
.tool-columns-legend {
 font: 400 0.82rem / 1.45 var(--sans);
 color: var(--ink-2);
 margin: 0.5rem 0;
}
.tool-column {
 display: flex;
 gap: 0.6rem;
 align-items: flex-start;
 padding: 0.5rem 0;
 border-bottom: 1px solid var(--rule);
 font: 400 0.88rem / 1.35 var(--sans);
}
.tool-column:last-of-type {
 border-bottom: 0;
}
.tool-column input {
 margin-top: 0.2rem;
 accent-color: var(--green);
}
.tool-column-name {
 display: block;
 font-weight: 600;
}
.tool-column-why {
 display: block;
 font-size: 0.8rem;
 color: var(--ink-2);
}
.tool-status {
 min-height: 1.4em;
 margin: 0.9rem 0 0;
 font: 500 0.9rem / 1.45 var(--sans);
 color: var(--green-2);
}
.tool-status:empty {
 min-height: 0;
 margin-top: 0;
}
.tool-status.is-error {
 color: var(--signal);
}
.tool-output {
 min-width: 0;
}
.tool-empty {
 margin: 0;
 padding: 2.6rem 1.6rem;
 border: 1.5px dashed var(--rule);
 border-radius: var(--radius-lg);
 color: var(--ink-2);
 font: 400 0.95rem / 1.5 var(--sans);
 max-width: 46ch;
}
.tool-preview > .h-small {
 margin-bottom: 0.5rem;
}
.tool-preview-note {
 font: 400 0.86rem / 1.5 var(--sans);
 color: var(--ink-2);
 margin: 0 0 0.9rem;
}
.tool-preview .grid-scroll {
 max-height: 420px;
}
.tool-code {
 margin: 1rem 0 0;
 background: var(--sheet);
 border: 1px solid var(--rule);
 border-radius: var(--radius);
 padding: 0.9rem 1rem;
 overflow: auto;
 max-height: 22rem;
 font:
  400 0.82rem / 1.5 ui-monospace,
  "SFMono-Regular",
  Menlo,
  monospace;
}
.tool-code code {
 background: none;
 padding: 0;
 font: inherit;
 color: var(--ink-2);
}
.tool-index {
 list-style: none;
 margin: 0;
 padding: 0;
 border-top: 2px solid var(--ink);
}
.tool-index li {
 display: grid;
 grid-template-columns: minmax(0, 1fr) auto;
 gap: 0.3rem 1.5rem;
 align-items: baseline;
 padding: 1.15rem 0.2rem 1.2rem;
 border-bottom: 1px solid var(--rule);
}
.tool-index li:hover {
 background: var(--sheet);
}
.tool-index h2 {
 margin: 0;
 font-size: 1.25rem;
}
.tool-index h2 a {
 color: var(--ink);
 text-decoration: none;
}
.tool-index h2 a:hover {
 color: var(--green);
 text-decoration: underline;
}
.tool-index-flow {
 font: 600 0.72rem / 1.3 var(--sans);
 letter-spacing: 0.08em;
 text-transform: uppercase;
 color: var(--ink-2);
 white-space: nowrap;
}
.tool-index-desc {
 grid-column: 1 / -1;
 color: var(--ink-2);
 font: 400 0.95rem / 1.55 var(--sans);
 max-width: 72ch;
 margin: 0;
}
.tool-related {
 display: grid;
 grid-template-columns: repeat(2, minmax(0, 1fr));
 gap: 2rem clamp(2rem, 5vw, 4rem);
 align-items: start;
}
/* These small headings carry section names on the tool pages, so they use the
 readable ink tone rather than the site-wide muted one. */
.tool-notes .h-small,
  .tool-hub-notes .h-small,
.tool-related .h-small,
.tool-preview > .h-small {
 color: var(--ink-2);
}
/* The tool pages use the readable ink tone for their breadcrumb and small
   headings: same components as the rest of the site, darker where they carry
   the page's own navigation. Scoped by body class, so no other page changes. */
body.tools .crumbs a,
body.tools .crumbs li[aria-current] {
  color: var(--ink-2);
}
.link-kind {
 display: inline-block;
 margin-left: 0.55rem;
 font: 600 0.66rem / 1 var(--sans);
 letter-spacing: 0.08em;
 text-transform: uppercase;
 color: var(--ink-2);
}
@media (max-width: 1020px) {
 .tool {
  grid-template-columns: minmax(0, 1fr);
 }
 .tool-related {
  grid-template-columns: minmax(0, 1fr);
 }
}
@media (max-width: 620px) {
 .tool-controls {
  padding: 1.15rem;
 }
 .tool-index li {
  grid-template-columns: minmax(0, 1fr);
 }
 .tool-empty {
  padding: 1.8rem 1.2rem;
 }
}
