/* Amanah Network: site styles. No build step, no third-party requests.

   TOKEN BLOCK (everything below is built from this)

   Palette   Ledger paper. The neutrals lean green, like account-book paper.
             One accent: blue-black ink, for links and the main action.
             Green, red and ochre are states only: checks out, broken, open question.

   Type      Three voices, so a reader can tell who is speaking.
             sans    what this site says today
             paper   the March 2026 design papers, quoted unedited (serif)
             record  what a ledger records: entry numbers, hashes, amounts, margin labels (mono)

   Layout    The margin column. Each section is a ledger row: a narrow label column,
             a double rule, then the content. On a phone the label sits above the
             content and the rule runs across instead of down.
*/

:root {
  --paper: #f2f5f0;
  --surface: #fbfcfa;
  --sunk: #e7ece6;
  --ink: #16211d;
  --ink-2: #47554f;
  --ink-3: #5c6962;
  --rule: #cdd6cf;
  --rule-strong: #9daba3;
  --field: #76847c;
  --accent: #1d4275;
  --accent-ink: #ffffff;
  --accent-soft: #dde6f1;
  --ok: #1b6447;
  --ok-soft: #dbeae1;
  --bad: #9c2f26;
  --bad-soft: #f4dfdb;
  --note: #6a4e05;
  --note-soft: #f1e8cc;
  --note-rule: #b08a1c;
  --band: #16211d;
  --band-ink: #eef2ec;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-paper: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;
  --font-record: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Roboto Mono", "Liberation Mono", monospace;

  --step--1: 0.8125rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5rem;
  --step-3: clamp(2rem, 1.2rem + 4vw, 3.25rem);

  --margin-col: 10rem;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --radius: 3px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #0f1613;
    --surface: #161f1b;
    --sunk: #0a100e;
    --ink: #e3eae5;
    --ink-2: #aab7b0;
    --ink-3: #909d96;
    --rule: #27332e;
    --rule-strong: #42524a;
    --field: #6b7b73;
    --accent: #a6c2ef;
    --accent-ink: #0f1613;
    --accent-soft: #1b2a40;
    --ok: #76d0a4;
    --ok-soft: #14291f;
    --bad: #f1978c;
    --bad-soft: #36191a;
    --note: #e3c26f;
    --note-soft: #2a2311;
    --note-rule: #8f721f;
    --band: #1f2b26;
    --band-ink: #dfe7e1;
  }
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 3.5rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  overflow-wrap: break-word;
}

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.6em; text-wrap: balance; }
h1 { font-size: var(--step-3); font-weight: 680; letter-spacing: -0.022em; line-height: 1.06; }
h2 { font-size: var(--step-2); font-weight: 650; letter-spacing: -0.012em; }
h3 { font-size: var(--step-1); font-weight: 650; }
p, ul, ol, dl { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; }
li { margin-bottom: 0.35em; }
p:last-child, ul:last-child, ol:last-child, dl:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

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

code, pre, .record { font-family: var(--font-record); font-variant-numeric: tabular-nums; }
code { font-size: 0.9em; background: var(--sunk); padding: 0.08em 0.3em; border-radius: 2px; }

.wrap {
  max-width: 68rem;
  margin-inline: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter-r);
}
.wrap-wide { max-width: 78rem; }

.skip {
  position: absolute; left: var(--gutter); top: -4rem;
  background: var(--surface); color: var(--ink); padding: 0.5rem 0.75rem; border: 1px solid var(--rule-strong);
}
.skip:focus { top: 0.5rem; z-index: 20; }

.lede { font-size: var(--step-1); line-height: 1.5; max-width: 40rem; }
.measure { max-width: 40rem; }
.small { font-size: var(--step--1); color: var(--ink-2); }
.gap-m { margin-top: 1.25rem; }
.gap-l { margin-top: 2.25rem; }

/* margin label: the mono voice used for labels beside content */
.tag {
  font-family: var(--font-record);
  font-size: 0.75rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0;
}

/* ---------- header, status strip, footer ---------- */

.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.35rem 1.5rem; padding-block: 0.85rem;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 0.55rem;
  color: var(--ink); text-decoration: none; font-weight: 680; font-size: 1.125rem; letter-spacing: -0.01em;
}
.wordmark svg { width: 1.3rem; height: 1.3rem; flex: none; color: var(--accent); }
.wordmark span span { font-weight: 420; }

.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0 1.15rem; margin: 0; padding: 0; }
.site-nav li { margin: 0; }
.site-nav a {
  display: inline-block; padding: 0.4rem 0; color: var(--ink-2); text-decoration: none;
  font-size: 0.9375rem; border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--rule-strong); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

.strip { background: var(--band); color: var(--band-ink); }
.strip p {
  margin: 0; padding-block: 0.5rem;
  font-family: var(--font-record); font-size: 0.78rem; letter-spacing: 0.02em; line-height: 1.45;
}

.site-foot { border-top: 3px double var(--rule-strong); margin-top: 4rem; }
.site-foot .wrap { padding-block: 2rem 3rem; }
.site-foot p { font-size: var(--step--1); color: var(--ink-2); max-width: 44rem; margin-bottom: 0.6em; }
.site-foot .foot-name { color: var(--ink-3); }

/* ---------- page head ---------- */

.page-head { padding-block: 2.75rem 2.25rem; }
.page-head h1 { max-width: 18ch; }
.page-head .tag { margin-bottom: 1rem; }
.page-head .lede { margin-top: 1rem; }

/* ---------- ledger rows: the margin column ---------- */

.row { border-top: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 1fr); }
.row > .tag { padding-top: 1.5rem; }
.row > .body { padding-block: 0.6rem 2rem; min-width: 0; }
.row > .body > h2 { margin-top: 0.2rem; }

@media (min-width: 52rem) {
  .row { grid-template-columns: var(--margin-col) minmax(0, 1fr); }
  .row > .tag { padding-top: 2.4rem; padding-right: 1rem; }
  .row > .body { border-left: 3px double var(--rule-strong); padding: 2.1rem 0 2.6rem 2.25rem; }
  .row > .body > h2 { margin-top: 0; }
}

/* ---------- small parts ---------- */

.btn {
  display: inline-block; font: inherit; font-size: 1rem; font-weight: 600; line-height: 1.2;
  padding: 0.7rem 1.05rem; border-radius: var(--radius); border: 1px solid var(--ink);
  background: transparent; color: var(--ink); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--sunk); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.12); }
.btn-small { font-size: 0.875rem; padding: 0.5rem 0.75rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.5rem; }

/* open question or caveat: ochre */
.note {
  background: var(--note-soft); color: var(--note);
  border-left: 3px solid var(--note-rule);
  padding: 0.6rem 0.8rem; font-size: 0.9375rem; line-height: 1.5; border-radius: 0 var(--radius) var(--radius) 0;
}

/* glossary: each Arabic term explained once per page */
.terms { border: 1px solid var(--rule); background: var(--surface); padding: 0.85rem 1rem; max-width: 40rem; border-radius: var(--radius); }
.terms .tag { margin-bottom: 0.4rem; }
.terms dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.2rem 0.9rem; margin: 0; font-size: 0.9375rem; }
.terms dt { font-weight: 650; }
.terms dd { margin: 0; color: var(--ink-2); }

.two-col { display: grid; gap: 1.5rem 2.5rem; }
@media (min-width: 40rem) { .two-col { grid-template-columns: 1fr 1fr; } }

.plain-list { list-style: none; padding: 0; }
.plain-list li { padding: 0.55rem 0; border-top: 1px solid var(--rule); margin: 0; }
.plain-list li:first-child { border-top: 0; padding-top: 0; }

/* shows / cannot show */
.can h3, .cannot h3 { font-size: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.mark { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 1px; flex: none; }
.can .mark { background: var(--ok); }
.cannot .mark { background: transparent; border: 2px solid var(--bad); }

/* numbered idea lines */
.idea { list-style: none; padding: 0; counter-reset: idea; }
.idea li { counter-increment: idea; display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); padding: 0.7rem 0; border-top: 1px solid var(--rule); margin: 0; }
.idea li:first-child { border-top: 0; padding-top: 0; }
.idea li::before { content: counter(idea, decimal-leading-zero); font-family: var(--font-record); font-size: 0.8rem; color: var(--ink-3); padding-top: 0.25rem; }
.idea strong { display: block; }
.idea span { color: var(--ink-2); }

/* quoted paper text inside site pages */
.from-paper { font-family: var(--font-paper); font-size: 1.125rem; }
.from-paper dt { font-weight: 700; }
.from-paper dd { margin: 0 0 0.7rem; }
.source { font-size: var(--step--1); color: var(--ink-3); margin-top: 0.75rem; }

/* state pill */
.pill {
  display: inline-block; font-family: var(--font-record); font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0.15rem 0.5rem; border-radius: 2px; border: 1px solid currentColor; line-height: 1.5;
}
.pill-ok { color: var(--ok); background: var(--ok-soft); }
.pill-no { color: var(--bad); background: var(--bad-soft); }
.pill-next { color: var(--accent); background: var(--accent-soft); }
.pill-wait { color: var(--note); background: var(--note-soft); }
.pill-off { color: var(--ink-2); background: var(--sunk); }

.status-group h2 { font-size: var(--step-1); margin-bottom: 0.5rem; }
.status-group .pill { margin-bottom: 0.9rem; }

/* FAQ and questions */
.qa h2 { font-size: var(--step-1); margin-bottom: 0.4rem; }
@media (min-width: 52rem) {
  .row.qa > .tag { padding-top: 1.75rem; }
  .row.qa > .body { padding-block: 1.5rem 1.7rem; }
}
.qa p { max-width: 40rem; }
.q-list { padding-left: 1.4rem; max-width: 42rem; }
.q-list > li { margin-bottom: 1.3rem; padding-left: 0.2rem; }
.q-list > li::marker { font-family: var(--font-record); font-size: 0.85rem; color: var(--ink-3); }
.q-list .why { display: block; font-size: var(--step--1); color: var(--ink-2); margin-top: 0.3rem; }
.q-list strong { display: block; }

/* contact address shown as selectable text */
.address {
  font-family: var(--font-record); font-size: clamp(1rem, 0.7rem + 1.6vw, 1.35rem);
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius);
  padding: 0.9rem 1rem; display: inline-block; max-width: 100%; user-select: all; overflow-wrap: anywhere;
}

/* ---------- the papers (serif voice) ---------- */

.paper { font-family: var(--font-paper); font-size: 1.1875rem; line-height: 1.62; border-left: 3px double var(--rule-strong); padding-left: 1rem; margin-block: 0.5rem 1rem; }
.paper > *, .paper .annotated > :not(.sidenote) { max-width: 36rem; }
.paper h2 { font-family: var(--font-paper); font-size: 1.45rem; font-weight: 700; letter-spacing: 0; margin: 2.4rem 0 0.7rem; }
.paper .paper-title { font-size: 1.75rem; margin-top: 0; line-height: 1.2; }
.paper .paper-sub { font-style: italic; color: var(--ink-2); }
.paper .annotated { max-width: none; }
.paper .annotated > h2:first-child { margin-top: 2.4rem; }
.paper hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; max-width: 36rem; }

.sidenote {
  font-family: var(--font-sans); font-size: 0.875rem; line-height: 1.5;
  background: var(--note-soft); color: var(--note); border-left: 3px solid var(--note-rule);
  padding: 0.6rem 0.8rem; margin: 0.25rem 0 1.1rem; max-width: 36rem; border-radius: 0 var(--radius) var(--radius) 0;
}
.sidenote b { font-weight: 650; }

@media (min-width: 62rem) {
  .paper { padding-left: 2.25rem; }
  .paper .annotated { display: grid; grid-template-columns: minmax(0, 36rem) minmax(0, 17rem); gap: 0 2.5rem; align-items: start; }
  .paper .annotated > :not(.sidenote) { grid-column: 1; }
  .paper .annotated > .sidenote { grid-column: 2; grid-row: 1 / span 4; margin: 0.35rem 0 0; }
  .paper .annotated > h2:first-child + .sidenote, .paper .annotated > .sidenote.at-heading { margin-top: 2.5rem; }
}

/* ---------- ledger entries (home fragment and demo) ---------- */

.ledger { list-style: none; margin: 0; padding: 0; }
.entry {
  position: relative; margin: 0; padding: 0.15rem 0 0.85rem 3.4rem;
}
.entry::before { /* the chain */
  content: ""; position: absolute; left: 1.35rem; top: 0; bottom: 0; width: 2px; background: var(--rule-strong);
}
.entry:first-child::before { top: 0.9rem; }
.entry:last-child::before { bottom: auto; height: 0.9rem; }
.entry:only-child::before { display: none; }
.entry .seq {
  position: absolute; left: 0; top: 0.2rem; width: 2.75rem; text-align: center;
  font-family: var(--font-record); font-size: 0.78rem; font-variant-numeric: tabular-nums;
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 2px; padding: 0.1rem 0; color: var(--ink);
}
.entry .prev, .entry .hash { font-family: var(--font-record); font-size: 0.78rem; margin: 0; overflow-wrap: anywhere; }
.entry .prev { color: var(--ink-3); }
.entry .hash { color: var(--ink); }
.entry .prev b, .entry .hash b { font-weight: 400; color: var(--ink-3); margin-right: 0.35rem; }
.entry .etype { font-family: var(--font-record); font-size: 0.8rem; color: var(--ink-2); }
.entry .entry-meta { margin: 0.15rem 0 0; font-size: 0.8rem; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 0 0.75rem; align-items: baseline; }
.entry .entry-sum { margin: 0.1rem 0 0.2rem; font-size: 0.9375rem; line-height: 1.45; }
.entry .flag { font-family: var(--font-record); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.05rem 0.4rem; border-radius: 2px; border: 1px solid currentColor; }
.entry details { margin-top: 0.3rem; }
.entry summary { font-size: 0.8rem; color: var(--ink-2); cursor: pointer; }
.entry pre { font-size: 0.74rem; line-height: 1.45; background: var(--sunk); padding: 0.6rem; margin: 0.4rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; border-radius: var(--radius); }

.entry.is-ok .seq { border-color: var(--ok); color: var(--ok); }
.entry.is-ok .flag { color: var(--ok); background: var(--ok-soft); }
.entry.is-edited .entry-sum { background: var(--note-soft); color: var(--note); padding: 0.2rem 0.4rem; margin-left: -0.4rem; border-radius: 2px; }
.entry.is-edited .flag-edit { color: var(--note); background: var(--note-soft); }
.entry.is-broken .seq { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.entry.is-broken .flag-break { color: var(--bad); background: var(--bad-soft); }
.entry.is-broken::before, .entry.is-after::before { background: none; border-left: 2px dashed var(--bad); width: 0; }
.entry.is-after { color: var(--ink-3); }
.entry.is-after .hash, .entry.is-after .seq { color: var(--ink-3); }
.entry.is-after .flag { color: var(--ink-3); }

@media (prefers-reduced-motion: no-preference) {
  .entry.is-new { animation: entry-in 1.4s ease-out; }
  @keyframes entry-in { from { background: var(--accent-soft); } to { background: transparent; } }
}

/* home: fragment beside the headline */
.hero { display: grid; gap: 2.25rem 3rem; padding-block: 2.75rem 3rem; align-items: start; }
.hero h1 { max-width: 16ch; }
.hero .tag { margin-bottom: 1rem; }
.hero .lede { margin-top: 1.1rem; }
.fragment { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem 1rem 0.9rem; }
.fragment figcaption { font-size: var(--step--1); color: var(--ink-2); border-top: 1px solid var(--rule); padding-top: 0.7rem; margin-top: 0.3rem; }
.fragment .tag { margin-bottom: 0.9rem; }
figure { margin: 0; }
@media (min-width: 58rem) {
  .hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); padding-block: 4rem 4rem; }
  .fragment { margin-top: 2.1rem; }
}

/* how it works: diagram */
.diagram { display: grid; gap: 1.5rem; margin: 1.25rem 0; }
.diagram figure { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.9rem; }
.diagram figcaption { font-size: var(--step--1); color: var(--ink-2); margin-top: 0.5rem; }
.diagram svg { display: block; width: 100%; height: auto; max-width: 22rem; margin-inline: auto; }
@media (min-width: 46rem) { .diagram { grid-template-columns: 1fr 1fr; } }
.d-box { fill: var(--paper); stroke: var(--rule-strong); stroke-width: 1.2; }
.d-box-bad { fill: var(--bad-soft); stroke: var(--bad); stroke-width: 1.4; }
.d-box-edit { fill: var(--note-soft); stroke: var(--note-rule); stroke-width: 1.4; }
.d-t { font-family: var(--font-sans); font-size: 13px; fill: var(--ink); }
.d-t-b { font-weight: 650; }
.d-m { font-family: var(--font-record); font-size: 11.5px; fill: var(--ink-2); }
.d-m-ink { fill: var(--ink); }
.d-m-bad { fill: var(--bad); font-weight: 700; }
.d-m-edit { fill: var(--note); font-weight: 700; }
.d-link { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.d-link-bad { fill: none; stroke: var(--bad); stroke-width: 1.6; stroke-dasharray: 4 4; }
.d-head { fill: var(--accent); }
.d-head-bad { fill: var(--bad); }

/* ---------- demo ---------- */

.sim-label {
  position: sticky; top: 0; z-index: 10;
  background: var(--note-soft); color: var(--note); border-bottom: 1px solid var(--note-rule);
}
.sim-label p { margin: 0; padding-block: 0.45rem; font-family: var(--font-record); font-size: 0.8rem; font-weight: 700; line-height: 1.4; }

.demo-head { padding-block: 2rem 1.25rem; }
.demo-head h1 { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 2.6rem); }
.demo-head .terms { margin-top: 1rem; }

.demo-grid { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); padding-bottom: 1rem; }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem; min-width: 0; }
.panel > h2 { font-size: 1.15rem; margin-bottom: 0.2rem; }
.panel > .tag { margin-bottom: 0.35rem; }
.panel-sub { font-size: var(--step--1); color: var(--ink-2); margin-bottom: 0.9rem; }

@media (min-width: 62rem) {
  .demo-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 27rem); align-items: start; gap: 1.25rem 1.5rem; }
  .demo-grid > .panel { grid-column: 1; }
  .demo-grid > #p-ledger { grid-column: 2; grid-row: 1 / span 6; position: sticky; top: 2.75rem; }
  #p-ledger .ledger-scroll { max-height: calc(100vh - 21rem); min-height: 12rem; overflow-y: auto; padding-right: 0.25rem; }
}

/* guided steps */
#steps-box > summary { cursor: pointer; font-weight: 650; padding: 0.2rem 0; }
.steps { list-style: none; padding: 0; margin: 0.8rem 0 0; counter-reset: step; }
.step { counter-increment: step; position: relative; padding: 0.5rem 0 0.5rem 2.6rem; border-top: 1px solid var(--rule); margin: 0; }
.step::before {
  content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 0.62rem;
  font-family: var(--font-record); font-size: 0.78rem; color: var(--ink-3);
}
.step p { margin: 0; }
.step .step-label { font-size: 0.9375rem; line-height: 1.45; }
.step .note { margin-top: 0.45rem; font-size: 0.85rem; }
.step .step-rec { font-family: var(--font-record); font-size: 0.75rem; color: var(--ok); margin-top: 0.2rem; overflow-wrap: anywhere; }
.step .btn { margin-top: 0.65rem; }
.step-todo .step-label { color: var(--ink-3); }
.step-done::before { color: var(--ok); }
.step-current { background: var(--accent-soft); margin-inline: -1rem; padding-left: 3.6rem; padding-right: 1rem; padding-block: 0.8rem; border-top-color: transparent; }
.step-current::before { left: 1rem; top: 0.95rem; color: var(--accent); font-weight: 700; }
.step-current .step-label { font-size: 1.0625rem; font-weight: 600; }
.step-current + .step { border-top-color: transparent; }
.steps-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }

.msg { font-size: 0.9rem; margin: 0.7rem 0 0; padding: 0.55rem 0.75rem; border-radius: var(--radius); border-left: 3px solid var(--rule-strong); background: var(--sunk); }
.msg:empty { display: none; }
.msg p { margin: 0 0 0.45em; }
.msg p:last-child { margin: 0; }
.msg-ok { border-left-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.msg-bad { border-left-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.msg-refused { border-left-color: var(--note-rule); background: var(--note-soft); color: var(--note); }
.msg .record { font-size: 0.78rem; }

/* treasury */
.pools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid var(--rule-strong); border-radius: var(--radius); overflow: hidden; }
.pool { padding: 0.65rem 0.75rem; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); min-width: 0; }
.pool .tag { color: var(--ink); font-weight: 700; }
.pool .amount { font-family: var(--font-record); font-variant-numeric: tabular-nums; font-size: 1.3rem; font-weight: 700; line-height: 1.3; margin: 0.1rem 0 0; }
.pool .unit { font-size: 0.72rem; color: var(--ink-3); margin: 0; }
.pool.is-zero .amount { color: var(--ink-3); font-weight: 400; }
@media (min-width: 34rem) { .pools { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.people { list-style: none; padding: 0; margin: 0.9rem 0 0; font-size: 0.85rem; color: var(--ink-2); }
.people li { margin: 0; padding: 0.2rem 0; }
.people .record { color: var(--ink); font-size: 0.78rem; }
.empty { color: var(--ink-3); font-size: 0.9375rem; margin: 0; }

/* cases */
.case { border-top: 1px solid var(--rule); padding: 0.9rem 0 0.4rem; }
.case:first-child { border-top: 0; padding-top: 0.2rem; }
.case h3 { font-size: 1rem; margin-bottom: 0.3rem; display: flex; flex-wrap: wrap; gap: 0.3rem 0.6rem; align-items: baseline; }
.case h3 .record { font-size: 0.85rem; }
.case .facts { font-size: 0.9rem; color: var(--ink-2); margin-bottom: 0.6rem; }
.stages { list-style: none; padding: 0; margin: 0 0 0.6rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; }
.stage { margin: 0; border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: 0.4rem 0.5rem; font-size: 0.8rem; line-height: 1.35; min-width: 0; }
.stage b { display: block; font-family: var(--font-record); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
.stage span { color: var(--ink-3); overflow-wrap: anywhere; }
.stage.is-on { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.stage.is-on span { color: var(--ok); }
.case details > summary { cursor: pointer; font-size: 0.9rem; color: var(--accent); padding: 0.2rem 0; }
.reveal { display: grid; gap: 0.75rem; margin-top: 0.6rem; }
@media (min-width: 40rem) { .reveal { grid-template-columns: 1fr 1fr; } }
.reveal > div { border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.65rem; min-width: 0; }
.reveal .is-private { border-style: dashed; border-color: var(--rule-strong); background: var(--sunk); }
.reveal h4 { margin: 0 0 0.4rem; font-size: 0.85rem; }
.reveal pre { margin: 0; font-size: 0.74rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.reveal .small { margin: 0.4rem 0 0; font-size: 0.78rem; }

/* ledger panel */
.ledger-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: end; margin-bottom: 0.4rem; }
.ledger-tools label { font-size: 0.8rem; color: var(--ink-2); display: grid; gap: 0.15rem; flex: 1 1 11rem; min-width: 0; }
.tamper-row { border-top: 1px solid var(--rule); padding-top: 0.7rem; margin-top: 0.7rem; }
.ledger-scroll { margin-top: 1rem; }

/* free play */
.seg { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.9rem; }
.seg button {
  font: inherit; font-size: 0.875rem; padding: 0.45rem 0.7rem; border-radius: var(--radius);
  border: 1px solid var(--field); background: transparent; color: var(--ink); cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.form { display: grid; gap: 0.7rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 34rem) { .form { grid-template-columns: 1fr 1fr; } .form .full { grid-column: 1 / -1; } }
.form label { display: grid; gap: 0.2rem; font-size: 0.85rem; color: var(--ink-2); min-width: 0; }
.form .check { display: flex; gap: 0.5rem; align-items: center; color: var(--ink); }
.form .check input { width: 1.1rem; height: 1.1rem; flex: none; }
.form .note { margin: 0; font-size: 0.85rem; }
input[type="text"], select, textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper);
  border: 1px solid var(--field); border-radius: var(--radius); padding: 0.5rem 0.55rem; width: 100%; min-width: 0;
}
textarea { min-height: 4.2rem; resize: vertical; }
.try { font-size: 0.875rem; color: var(--ink-2); margin-top: 1rem; }
.try ul { margin-top: 0.3rem; }
