/* Purpose Split — a bank counter, paper slips and rubber stamps.
   Printed form text is green, filled-in values are ballpoint blue, and the
   only loud thing on the page is a stamp: violet when the contract allows,
   red when it refuses. */

/* Archivo, hosted with the site (SIL Open Font License, see fonts/OFL.txt).
   One variable file covers every weight and width used here. */
@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --counter: #d7dfe7;
  --counter-deep: #c3ced9;
  --slip: #fdfdfb;
  --slip-yellow: #fbf3d2;
  --print: #1f5c4c;
  --print-soft: #4f6f66;
  --ink: #2238a8;
  --violet: #5a2d8c;
  --red: #c3243a;
  --body: #1e2a27;
  --rule-rgb: 31, 92, 76;
  --button-hover: #164638;
  --stamp-blend: multiply;
  color-scheme: light;

  --wide: "wdth" 118;
  --narrow: "wdth" 88;

  --fs-small: 0.875rem;
  --fs-body: 1.0625rem;
  --fs-lead: 1.25rem;
  --fs-h3: 1.375rem;
  --fs-h2: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
  --fs-h1: clamp(2.4rem, 1.3rem + 3.4vw, 4rem);

  --gutter: clamp(16px, 4vw, 40px);
  --max: 1180px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { background: var(--counter); }

body {
  margin: 0;
  background: var(--counter);
  color: var(--body);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.55;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
}

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 8px; background: var(--slip); padding: 8px 12px; z-index: 10; }

main { display: block; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 72px; }
main:focus { outline: none; }

/* ---------------------------------------------------------------- header */

.top {
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--print);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.2rem;
  font-variation-settings: var(--wide);
  letter-spacing: -0.01em;
}

.wordmark__mark {
  width: 22px;
  height: 22px;
  border: 3px solid var(--print);
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px var(--counter), inset 0 0 0 9px var(--violet);
}

.top nav { display: flex; gap: 6px; flex-wrap: wrap; }
.top nav a {
  color: var(--print);
  text-decoration: none;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 3px;
}
.top nav a:hover { background: var(--counter-deep); }
.top nav a[aria-current="page"] { background: var(--print); color: var(--slip); }

/* ---------------------------------------------------------------- type */

h1, h2, h3 { color: var(--print); margin: 0; font-variation-settings: var(--wide); }

h1 {
  font-size: var(--fs-h1);
  line-height: 1.02;
  font-weight: 780;
  font-variation-settings: "wdth" 112;
  letter-spacing: -0.02em;
  max-width: 15ch;
}

h2 { font-size: var(--fs-h2); line-height: 1.1; font-weight: 740; letter-spacing: -0.01em; }
h3 { font-size: var(--fs-h3); line-height: 1.2; font-weight: 700; }

.lead { font-size: var(--fs-lead); line-height: 1.5; max-width: 34ch; margin: 22px 0 0; }
.prose { max-width: 62ch; }
.prose p { margin: 0 0 14px; }
.small { font-size: var(--fs-small); color: var(--print-soft); }

/* ---------------------------------------------------------------- slips */

.slip {
  position: relative;
  background: var(--slip);
  padding: 30px 28px 26px;
  border-radius: 2px;
  box-shadow: 0 1px 0 var(--counter-deep), 10px 12px 0 -6px rgba(var(--rule-rgb), 0.1);
}

.slip--yellow { background: var(--slip-yellow); }

/* the perforated tear-off edge */
.slip::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 0;
  right: 0;
  height: 12px;
  background: radial-gradient(circle at 7px 6px, var(--counter) 4.5px, transparent 5px) repeat-x;
  background-size: 14px 12px;
}

.slip__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 6px;
  border-bottom: 2px solid var(--print);
}

.slip__head h2,
.slip__head h3 { font-size: var(--fs-h3); }
.slip__no { color: var(--print-soft); font-size: var(--fs-small); white-space: nowrap; }

.field {
  display: grid;
  gap: 2px;
  padding: 10px 0 9px;
  border-bottom: 1px dashed rgba(var(--rule-rgb), 0.35);
}
.field:last-child { border-bottom: 0; }

.field__label { color: var(--print-soft); font-size: var(--fs-small); }
.field__value {
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 560;
  font-variation-settings: var(--narrow);
  overflow-wrap: anywhere;
}
.field__value small { display: block; font-weight: 400; color: var(--print-soft); font-size: var(--fs-small); }

.check { color: var(--print); font-weight: 600; font-size: var(--fs-small); }
.check::before { content: "✓ "; }

/* form controls drawn as the blank lines of a slip */
.field select,
.field input {
  appearance: none;
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 560;
  font-variation-settings: var(--narrow);
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--print);
  border-radius: 0;
  padding: 6px 28px 6px 0;
}

.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--print) 50%),
    linear-gradient(135deg, var(--print) 50%, transparent 50%);
  background-position: calc(100% - 12px) 55%, calc(100% - 6px) 55%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.amount-row { display: flex; align-items: baseline; gap: 8px; }
.amount-row input { max-width: 9ch; }
.amount-row span { color: var(--print-soft); }

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font: inherit;
  font-weight: 680;
  font-variation-settings: "wdth" 110;
  color: var(--slip);
  background: var(--print);
  border: 0;
  border-radius: 3px;
  padding: 12px 20px;
  cursor: pointer;
  text-decoration: none;
}
.button:hover { background: var(--button-hover); }
.button[disabled] { opacity: 0.6; cursor: progress; }

.button--quiet { background: transparent; color: var(--print); box-shadow: inset 0 0 0 2px var(--print); }
.button--quiet:hover { background: var(--counter); }

.switch { display: flex; gap: 0; margin: 4px 0 8px; border: 2px solid var(--print); border-radius: 3px; width: fit-content; max-width: 100%; }
.switch button {
  font: inherit;
  font-weight: 600;
  font-size: var(--fs-small);
  color: var(--print);
  background: transparent;
  border: 0;
  padding: 7px 12px;
  cursor: pointer;
}
.switch button[aria-pressed="true"] { background: var(--print); color: var(--slip); }

/* ---------------------------------------------------------------- stamps */

.verdict { margin-top: 22px; min-height: 140px; }
.verdict:empty { display: none; }

.stamp {
  display: inline-block;
  font-weight: 900;
  font-variation-settings: "wdth" 125;
  font-size: 2.3rem;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 5px solid currentColor;
  border-radius: 7px;
  outline: 2px solid currentColor;
  outline-offset: -11px;
  padding: 12px 22px 10px;
  transform: rotate(-7deg);
  filter: url(#ink);
  mix-blend-mode: var(--stamp-blend);
  opacity: 0.9;
  animation: thump 220ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.stamp--no { color: var(--red); }
.stamp--ok { color: var(--violet); }
.stamp--small { font-size: 0.95rem; border-width: 3px; outline-width: 1px; outline-offset: -6px; padding: 5px 9px 4px; animation: none; transform: rotate(-4deg); filter: url(#ink-light); opacity: 0.95; }

@keyframes thump {
  from { transform: rotate(-7deg) scale(1.6); opacity: 0; }
  60% { opacity: 0.95; }
  to { transform: rotate(-7deg) scale(1); opacity: 0.9; }
}

.words {
  margin: 18px 0 0;
  padding: 2px 0 2px 16px;
  border-left: 4px solid currentColor;
  font-size: 1.15rem;
  line-height: 1.45;
  font-weight: 560;
  color: var(--body);
}
.words--no { border-color: var(--red); }
.words--ok { border-color: var(--violet); }

.answered { margin: 10px 0 0; font-size: var(--fs-small); color: var(--print-soft); }

/* ---------------------------------------------------------------- home */

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
  padding: clamp(24px, 6vw, 72px) 0 clamp(40px, 6vw, 80px);
}

.hero__aside { margin: 26px 0 0; color: var(--print-soft); max-width: 40ch; }

.section { padding: clamp(40px, 6vw, 72px) 0 0; }
.section > h2 { margin-bottom: 10px; max-width: 24ch; }
.section > .lead { margin-top: 0; margin-bottom: 28px; max-width: 52ch; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }

.slip__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: step; }
.steps li { counter-increment: step; padding-top: 14px; border-top: 2px solid var(--print); }
.steps li::before {
  content: counter(step);
  display: block;
  font-weight: 800;
  font-variation-settings: var(--wide);
  font-size: 2rem;
  line-height: 1;
  color: var(--print);
  margin-bottom: 10px;
}
.steps h3 { font-size: 1.15rem; margin-bottom: 6px; }
.steps p { margin: 0; max-width: 34ch; }

.books {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}
.books p { margin: 0; max-width: 60ch; font-size: var(--fs-lead); }
.books strong { color: var(--ink); font-weight: 650; }

/* ---------------------------------------------------------------- pot page */

.pot-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 32px; align-items: start; padding-top: 24px; }

.ledger { margin: 18px 0 6px; }
.bar { display: flex; height: 16px; background: repeating-linear-gradient(90deg, transparent 0 6px, rgba(var(--rule-rgb), 0.12) 6px 7px); box-shadow: inset 0 0 0 1px rgba(var(--rule-rgb), 0.4); }
.bar span { display: block; height: 100%; }
.bar .paid { background: var(--violet); }
.bar .back { background: var(--print); }
.bar .held { background: var(--ink); }

.key { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; padding: 0; list-style: none; font-size: var(--fs-small); }
.key li::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.key .paid::before { background: var(--violet); }
.key .back::before { background: var(--print); }
.key .held::before { background: var(--ink); }

table.rows { width: 100%; border-collapse: collapse; margin-top: 6px; }
.rows th { text-align: left; font-weight: 500; color: var(--print-soft); font-size: var(--fs-small); padding: 8px 0; border-bottom: 2px solid var(--print); }
.rows td { padding: 10px 0; border-bottom: 1px dashed rgba(var(--rule-rgb), 0.35); vertical-align: top; }
.rows td.num, .rows th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 16px; }
.rows td.num { color: var(--ink); font-weight: 600; font-variation-settings: var(--narrow); }
.rows tr:last-child td { border-bottom: 0; }

.pot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; padding-top: 24px; }
.pot-card h3 { font-size: 1.2rem; }
.pot-card .slip__head { margin-bottom: 2px; }

.status-line { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }

/* ---------------------------------------------------------------- proof */

.proof-steps { list-style: none; padding: 0; margin: 0; }
.proof-steps li { display: grid; grid-template-columns: 2.4rem 1fr auto; gap: 14px; padding: 14px 0; border-bottom: 1px dashed rgba(var(--rule-rgb), 0.35); align-items: start; }
.proof-steps .n { font-weight: 700; color: var(--print-soft); font-variant-numeric: tabular-nums; }
.proof-steps .what { font-weight: 560; }
.proof-steps .said { display: block; font-weight: 400; color: var(--red); margin-top: 4px; }
.proof-steps a { white-space: nowrap; font-size: var(--fs-small); }

.page-head { padding: clamp(24px, 5vw, 56px) 0 8px; }
.page-head h1 { font-size: var(--fs-h2); max-width: 22ch; }
.page-head .lead { max-width: 56ch; }

.loading { color: var(--print-soft); padding: 40px 0; }
.error { color: var(--red); font-weight: 600; }

/* ---------------------------------------------------------------- footer */

.foot {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
  border-top: 2px solid var(--counter-deep);
  font-size: var(--fs-small);
  color: var(--print-soft);
}
.foot p { margin: 0 0 6px; max-width: 70ch; }

/* ---------------------------------------------------------------- small screens */

@media (max-width: 880px) {
  .hero, .pair, .pot-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 22px; }
  .stamp { font-size: 1.9rem; }
}

@media (max-width: 520px) {
  .slip { padding: 26px 18px 22px; }
  .proof-steps li { grid-template-columns: 2rem 1fr; }
  .proof-steps a { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .stamp { animation: none; }
}

/* ---------------------------------------------------------------- home: story first */

.hero { display: block; padding-bottom: clamp(24px, 4vw, 40px); }
.hero h1 { max-width: 21ch; }
.hero .lead { max-width: 46ch; }

.story { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: story; }
.story li { counter-increment: story; display: flex; flex-direction: column; align-items: flex-start; }
.story li::before {
  content: counter(story);
  position: static;
  height: auto;
  background: none;
  font-weight: 800;
  font-variation-settings: var(--wide);
  font-size: 2rem;
  line-height: 1;
  color: var(--print);
  margin-bottom: 10px;
}
.story h2 { font-size: var(--fs-h3); margin-bottom: 8px; }
.story p { margin: 0 0 14px; }
.story .stamp { margin-top: auto; }

.prose h3 { margin-bottom: 10px; }
.pair { align-items: start; }

details.exact { margin-top: 14px; font-size: var(--fs-small); color: var(--print-soft); }
details.exact summary { cursor: pointer; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; width: fit-content; }
details.exact p { margin: 8px 0 0; }

@media (max-width: 880px) {
  .story { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- v3 additions */

.wordmark__tag { font-weight: 500; font-size: var(--fs-small); color: var(--print-soft); font-variation-settings: "wdth" 100; margin-left: 4px; padding-left: 12px; border-left: 2px solid var(--counter-deep); }

.cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 6px 0 0; }
[hidden] { display: none !important; }

.outcomes, .templates { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; }
.outcomes { grid-template-columns: repeat(3, 1fr); }
.outcomes li { border-top: 2px solid var(--print); padding-top: 14px; }
.outcomes h3, .templates h3 { font-size: 1.15rem; margin-bottom: 6px; }
.outcomes p, .templates p { margin: 0; max-width: 36ch; }

.templates { grid-template-columns: repeat(5, 1fr); gap: 20px; }
.templates li { background: var(--slip); padding: 18px 16px; border-radius: 2px; border-top: 4px solid var(--print); display: flex; flex-direction: column; gap: 8px; }
.templates li:nth-child(n + 3) { border-top-color: var(--counter-deep); }
.templates .small { margin-top: auto; }

.faq { max-width: 760px; border-top: 2px solid var(--print); }
.faq details { border-bottom: 1px dashed rgba(var(--rule-rgb), 0.45); }
.faq summary { cursor: pointer; padding: 16px 32px 16px 0; font-weight: 680; font-size: 1.12rem; color: var(--print); list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 1.5rem; font-weight: 400; }
.faq details[open] summary::after { content: "\2212"; }
.faq p { margin: 0 0 18px; max-width: 64ch; }

.receipt { max-width: 560px; }
.receipt .status-line { margin: 18px 0 8px; gap: 20px; }
.receipt .status-line .small { max-width: 28ch; margin: 0; }

.foot__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; margin-bottom: 22px; }
.foot__name { font-weight: 800; font-variation-settings: var(--wide); color: var(--print); font-size: 1.1rem; }
.foot h2 { font-size: 1rem; margin-bottom: 8px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }

@media (max-width: 1000px) {
  .templates { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 880px) {
  .outcomes, .foot__grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .templates { grid-template-columns: 1fr; }
  .wordmark__tag { display: none; }
}

.split { display: grid; gap: 4px; margin: 18px 0 0; padding: 14px 18px; background: var(--slip); border-left: 4px solid var(--print); max-width: 60ch; }
.split p { margin: 0; }
.split strong { color: var(--ink); font-weight: 650; }
.status-line span:not(.stamp):not(.check) { font-size: var(--fs-small); color: var(--print-soft); }
.field__value small { display: block; }

/* ---------------------------------------------------------------- wallet actions */
.who { display: inline-flex; align-items: center; margin-left: 6px; }
.who__btn { margin: 0; padding: 6px 14px; }
.who__name { font-size: var(--fs-small); font-weight: 600; color: var(--ink); max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 6px 10px; border: 2px solid var(--counter-deep); border-radius: 3px; }
.mini { border-top: 2px solid var(--print); margin-top: 16px; padding-top: 12px; }
.mini h3, [data-actions] h3 { font-size: 1.05rem; margin: 6px 0 4px; }
[data-actions] p { margin: 10px 0; }
[data-actions] .button { margin-top: 6px; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; cursor: pointer; font-size: var(--fs-small); }
.checks { display: grid; gap: 6px; padding-top: 6px; }
.radio { display: flex; gap: 8px; align-items: baseline; padding: 6px 0; cursor: pointer; }
.radio input { accent-color: var(--print); }
fieldset.field { border: 0; margin: 0; padding: 10px 0 9px; border-bottom: 1px dashed rgba(var(--rule-rgb), 0.35); }
fieldset.field legend { padding: 0; }
fieldset.field input[name=releaser] { margin-top: 6px; }
.agree { margin-top: 18px; padding: 14px 18px; background: var(--counter); border-left: 4px solid var(--violet); }
.agree h3 { font-size: 1.05rem; margin: 0 0 6px; }
.agree ul { margin: 0; padding-left: 18px; }
.agree li { margin: 4px 0; }

.field input[type="checkbox"], .field input[type="radio"], .radio input {
  appearance: auto; width: auto; flex: none; border: 0; padding: 0; margin: 0; background: none;
}
.prose .templates { grid-template-columns: 1fr; gap: 12px; margin-bottom: 24px; }
.prose .templates li { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.prose .templates h3 { margin: 0; font-size: 1rem; }
.prose .templates p { max-width: none; }
.checks .radio { gap: 10px; }
.checks .small { margin-left: auto; }

/* ---------------------------------------------------------------- v5: menu, uses, questions, buttons */

/* Buttons: square corners, pressed like a rubber stamp. */
.button { border-radius: 0; box-shadow: 4px 4px 0 var(--counter-deep); transition: transform 80ms ease, box-shadow 80ms ease; }
.button:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--counter-deep); }
.button--quiet { box-shadow: inset 0 0 0 2px var(--print), 4px 4px 0 var(--counter-deep); }
.button--quiet:active { box-shadow: inset 0 0 0 2px var(--print), 1px 1px 0 var(--counter-deep); }
.who__btn { box-shadow: inset 0 0 0 2px var(--print); }
.switch { border-radius: 0; }

/* Header */
.top { flex-wrap: nowrap; }
.top__right { display: flex; align-items: center; gap: 10px; }
.who { margin: 0; }
.menu-btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: inherit; font-weight: 700; font-variation-settings: "wdth" 110;
  color: var(--slip); background: var(--print);
  border: 0; border-radius: 0; padding: 8px 14px; cursor: pointer;
}
.menu-btn:hover { background: var(--button-hover); }
.menu-btn__lines { width: 16px; height: 10px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; position: relative; }
.menu-btn__lines::after { content: ""; position: absolute; left: 0; right: 0; top: 2px; border-top: 2px dotted currentColor; }

/* The menu: a ledger's contents page. */
body.menu-on { overflow: hidden; }
.menu { position: fixed; inset: 0; z-index: 50; background: rgba(31, 42, 39, 0.35); overflow-y: auto; }
.menu__inner {
  position: relative;
  min-height: 100%;
  max-width: 760px;
  margin-left: auto;
  background: var(--slip);
  padding: 22px clamp(18px, 5vw, 48px) 40px;
  box-shadow: -12px 0 0 -6px rgba(var(--rule-rgb), 0.12);
  animation: slide-in 180ms ease-out both;
}
.menu__inner::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: -6px; width: 12px;
  background: radial-gradient(circle at 6px 7px, rgba(31, 42, 39, 0.35) 4.5px, transparent 5px) repeat-y;
  background-size: 12px 14px;
}
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.menu__head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 14px; border-bottom: 2px solid var(--print); }
.menu__title { font-size: var(--fs-small); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--print-soft); }
.menu__close {
  font: inherit; font-weight: 700; color: var(--print); background: transparent;
  border: 0; box-shadow: inset 0 0 0 2px var(--print); padding: 8px 14px; cursor: pointer;
}
.menu__close:hover { background: var(--counter); }

.menu__list { list-style: none; margin: 0; padding: 0; counter-reset: entry; }
.menu__list li { counter-increment: entry; border-bottom: 1px dashed rgba(var(--rule-rgb), 0.4); }
.menu__list a {
  display: grid;
  grid-template-columns: 2.6rem auto 1fr auto;
  align-items: baseline;
  gap: 12px;
  padding: 18px 0 16px;
  text-decoration: none;
  color: var(--print);
}
.menu__list a::before {
  content: counter(entry, decimal-leading-zero);
  font-size: var(--fs-small); font-weight: 700; color: var(--print-soft);
  font-variant-numeric: tabular-nums;
}
.menu__word {
  font-size: clamp(1.7rem, 1rem + 3vw, 2.6rem);
  line-height: 1.05;
  font-weight: 780;
  font-variation-settings: "wdth" 112;
  letter-spacing: -0.02em;
}
.menu__lead { border-bottom: 2px dotted rgba(var(--rule-rgb), 0.45); transform: translateY(-6px); min-width: 16px; }
.menu__label { font-size: var(--fs-small); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--print-soft); text-align: right; }
.menu__list a:hover .menu__word { color: var(--ink); }
.menu__list a[aria-current="page"] .menu__word { color: var(--violet); }
.menu__list a[aria-current="page"]::before { content: "▸"; color: var(--violet); }
.menu__foot { margin: 28px 0 0; font-size: var(--fs-small); color: var(--print-soft); }

@media (max-width: 620px) {
  .menu__list a { grid-template-columns: 2.2rem 1fr; row-gap: 4px; }
  .menu__lead { display: none; }
  .menu__label { grid-column: 2; text-align: left; letter-spacing: 0.06em; }
}

/* "Works for any purpose": three numbered index cards. */
.uses { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.uses a {
  display: flex; flex-direction: column; gap: 8px; height: 100%;
  background: var(--slip); padding: 20px 20px 18px; border-top: 4px solid var(--print);
  color: var(--body); text-decoration: none;
  box-shadow: 4px 4px 0 var(--counter-deep);
  transition: transform 120ms ease;
}
.uses a:hover { transform: translate(-2px, -2px); }
.uses__n { font-size: var(--fs-small); font-weight: 700; color: var(--print-soft); }
.uses h3 { font-size: 1.25rem; }
.uses p { margin: 0; }
.uses__go { margin-top: auto; padding-top: 8px; color: var(--ink); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.uses__go::after { content: " →"; }
@media (max-width: 880px) { .uses { grid-template-columns: 1fr; } }

/* Questions: numbered, closed until clicked. */
.faq summary { display: grid; grid-template-columns: 3rem 1fr 20px; align-items: baseline; padding: 16px 0; }
.faq summary::after {
  content: ""; position: static; width: 9px; height: 9px;
  border-right: 2px solid var(--print); border-bottom: 2px solid var(--print);
  transform: rotate(-45deg); transition: transform 150ms ease; align-self: center;
}
.faq details[open] summary::after { content: ""; transform: rotate(45deg); }
.faq__n { font-size: var(--fs-small); font-weight: 700; color: var(--print-soft); font-variant-numeric: tabular-nums; }
.faq details > p { margin: 0 0 18px 3rem; padding-left: 14px; border-left: 3px solid var(--violet); }
@media (max-width: 520px) {
  .faq summary { grid-template-columns: 2.4rem 1fr 18px; }
  .faq details > p { margin-left: 0; }
}

/* Ideas to try: a closed note at the foot of the slip. */
.ideas { margin-top: 20px; padding-top: 12px; border-top: 1px dashed rgba(var(--rule-rgb), 0.45); }
.ideas summary { cursor: pointer; font-weight: 650; color: var(--ink); width: fit-content; }
.ideas summary span { color: var(--print-soft); font-weight: 500; }
.ideas ol { margin: 10px 0 0; padding-left: 22px; display: grid; gap: 6px; }

.kicker { margin: 0 0 10px; font-size: var(--fs-small); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--print-soft); }

.wordmark, .who__btn, .menu-btn { white-space: nowrap; }
@media (max-width: 420px) {
  .top { padding-top: 16px; padding-bottom: 16px; gap: 8px; }
  .wordmark { font-size: 1.05rem; gap: 8px; }
  .wordmark__mark { width: 18px; height: 18px; }
  .top__right { gap: 6px; }
  .who__btn { padding: 6px 10px; }
  .menu-btn { padding: 8px 10px; gap: 8px; }
  .cta .button { margin-top: 10px; }
}

/* How to try it */
.howto { list-style: none; margin: 0; padding: 24px 0 0; display: grid; gap: 28px; max-width: 820px; }
.howto > li { display: grid; grid-template-columns: 4rem 1fr; gap: 12px; }
.howto__n { font-weight: 800; font-variation-settings: var(--wide); font-size: 2rem; line-height: 1; color: var(--print); }
.howto h2 { font-size: var(--fs-h3); margin-bottom: 8px; }
.howto p { margin: 0 0 10px; max-width: 60ch; }
.howto__links { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.howto .loading { padding: 6px 0; }
@media (max-width: 520px) { .howto > li { grid-template-columns: 1fr; } }

/* Where the money went: one segment per payee, the free part, returned, still held. */
.went { margin: 18px 0 6px; max-width: 760px; }
.went__h { font-size: var(--fs-h3); margin: 28px 0 0; }
.went__bar { display: flex; height: 26px; box-shadow: inset 0 0 0 2px var(--print); background: var(--slip); }
.went__bar span { display: block; height: 100%; border-right: 2px solid var(--slip); }
.went__bar span:last-child { border-right: 0; }
.went__key { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.went__key li { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: baseline; padding-bottom: 6px; border-bottom: 1px dashed rgba(var(--rule-rgb), 0.35); }
.went__key li::before { content: ""; width: 12px; height: 12px; align-self: center; }
.went__key strong { font-variant-numeric: tabular-nums; }
.went__bar .to1, .went__key .to1::before { background: var(--violet); }
.went__bar .to2, .went__key .to2::before { background: #b5651d; }
.went__bar .to3, .went__key .to3::before { background: #a23b72; }
.went__bar .free, .went__key .free::before { background: var(--print-soft); }
.went__bar .back, .went__key .back::before { background: var(--print); }
.went__bar .held, .went__key .held::before { background: repeating-linear-gradient(135deg, var(--ink) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--ink); }
.went--compact .went__bar { height: 20px; }

/* "Live on NEAR" stamp on every Try to cheat box. */
.live-stamp { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 10px; font-size: var(--fs-small); color: var(--print-soft); }
.live-stamp span {
  display: inline-block; padding: 3px 8px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.75rem;
  color: var(--red); border: 2px solid var(--red); transform: rotate(-2deg); filter: url(#ink-light);
}
.live-stamp span::before { content: "● "; }

/* v6: a smaller menu, one line per item. */
.menu__inner { max-width: 520px; }
.menu__list a { padding: 14px 0 12px; grid-template-columns: 2.2rem auto 1fr auto; }
.menu__word { font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem); letter-spacing: -0.01em; }
.menu__lead { transform: translateY(-4px); }
.menu__label { font-size: 0.75rem; }
@media (max-width: 620px) {
  .menu__list a { grid-template-columns: 2rem auto 1fr auto; row-gap: 0; }
  .menu__lead { display: block; }
  .menu__label { grid-column: auto; text-align: right; letter-spacing: 0.04em; }
}
@media (max-width: 380px) {
  .menu__list a { grid-template-columns: 2rem 1fr; row-gap: 2px; }
  .menu__lead { display: none; }
  .menu__label { grid-column: 2; text-align: left; }
}

/* Money boxes: the folded "older practice boxes" line. */
.older { margin-top: 40px; padding-top: 14px; border-top: 1px dashed rgba(var(--rule-rgb), 0.45); }
.older summary { cursor: pointer; font-weight: 650; color: var(--ink); width: fit-content; }
.older summary span { color: var(--print-soft); font-weight: 500; }
.older .pot-list { margin-top: 18px; }
.pot-card .kicker { margin-bottom: 6px; }
.menu__label { white-space: nowrap; }
.menu__word { white-space: nowrap; }
@media (max-width: 620px) {
  .menu__list a { grid-template-columns: 1.8rem auto 1fr auto; gap: 10px; }
  .menu__word { font-size: 1.3rem; }
  .menu__label { font-size: 0.7rem; letter-spacing: 0.03em; }
}
@media (max-width: 380px) { .menu__list a { grid-template-columns: 1.8rem 1fr; } }
#ex-h { margin-top: 28px; }

/* Menu without the dotted leaders: the word on the left, the label on the right. */
.menu__lead { border-bottom: 0; }

/* v0.7.1: the menu is just five numbered words. */
.menu__list a, .menu__list a:any-link { grid-template-columns: 2.2rem 1fr; }
@media (max-width: 620px) { .menu__list a { grid-template-columns: 2rem 1fr; } }

/* v0.8: the pass, and the "what happens next" guide. */

/* A pass: a stamped ticket with a torn edge between its head and its body. */
.pass {
  position: relative;
  background: var(--slip);
  padding: 22px 26px 22px;
  border-top: 6px solid var(--print);
  box-shadow: 6px 6px 0 var(--counter-deep);
  max-width: 520px;
}
.pass__top {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: var(--fs-small); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--print-soft);
  padding-bottom: 14px; margin-bottom: 16px;
  border-bottom: 3px dotted rgba(var(--rule-rgb), 0.55);
}
.pass__top::before, .pass__top::after {
  content: ""; position: absolute; top: 44px; width: 22px; height: 22px; border-radius: 50%; background: var(--counter);
}
.pass__top::before { left: -11px; }
.pass__top::after { right: -11px; }
.pass__what { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.4rem); line-height: 1.05; margin: 0; color: var(--print); }
.pass__to { font-size: 1.2rem; font-weight: 650; margin: 6px 0 14px; color: var(--body); }
.pass .status-line { margin-top: 16px; align-items: center; }
.pass .status-line p { margin: 0; flex: 1 1 200px; }
.pass__links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 0; font-size: var(--fs-small); }
.pass-list { display: grid; gap: 32px; }
.pass-form { margin: 0; }
.pass-form input { width: 100%; }

/* What happens next: four numbered steps, the current one marked. */
.nextup { margin: 22px 0 6px; max-width: 760px; }
.nextup ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.nextup li {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: var(--slip); color: var(--print-soft); font-weight: 650; font-size: var(--fs-small); line-height: 1.25;
  border-top: 4px solid var(--counter-deep);
}
.nextup li span {
  flex: none; width: 24px; height: 24px; display: grid; place-items: center;
  font-size: 0.8rem; font-weight: 800; color: var(--print-soft); box-shadow: inset 0 0 0 2px var(--print-soft);
}
.nextup li.done { color: var(--print); border-top-color: var(--print); }
.nextup li.done span { background: var(--print); color: var(--slip); box-shadow: none; font-size: 0; }
.nextup li.done span::before { content: "✓"; font-size: 0.85rem; }
.nextup li[aria-current="step"] { color: var(--violet); border-top-color: var(--violet); }
.nextup li[aria-current="step"] span { background: var(--violet); color: var(--slip); box-shadow: none; }
.nextup p { margin: 12px 0 0; font-weight: 600; color: var(--body); }
@media (max-width: 700px) { .nextup ol { grid-template-columns: 1fr 1fr; } }
.proof-steps .noted { display: block; font-weight: 400; color: var(--print-soft); margin-top: 4px; }

/* v8.1: account names are for checking, so they sit quietly under the role. */
a.acct { color: var(--print-soft); font-size: 0.8rem; font-weight: 400; text-decoration-color: rgba(var(--rule-rgb), 0.3); word-break: break-all; }
a.acct:hover { color: var(--ink); }

/* v8.2: payees, council votes, records. */
.payee-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.payee p { margin: 4px 0; }
.mine-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.bills { margin: 8px 0; padding-left: 18px; display: grid; gap: 4px; font-size: var(--fs-small); }
.votes { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; max-width: 760px; }
.vote h3 { font-size: 1.1rem; }
.vote .stamp { margin-right: 8px; vertical-align: middle; }
.vote--approved { border-left: 4px solid var(--print); }
.vote--inprogress { border-left: 4px solid var(--violet); }
.cta--small { margin-top: 10px; }
.cta--small .button { font-size: var(--fs-small); padding: 8px 14px; }


/* ---------------------------------------------------------------- dark mode */
:root[data-theme="dark"] {
  --counter: #111917;
  --counter-deep: #26332f;
  --slip: #1a2421;
  --slip-yellow: #29261a;
  --print: #86c9b1;
  --print-soft: #97b0a7;
  --ink: #a9b8ff;
  --violet: #c39cf2;
  --red: #ff7486;
  --body: #dde7e3;
  --rule-rgb: 134, 201, 177;
  --button-hover: #a6dcc8;
  --stamp-blend: normal;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --counter: #111917;
  --counter-deep: #26332f;
  --slip: #1a2421;
  --slip-yellow: #29261a;
  --print: #86c9b1;
  --print-soft: #97b0a7;
  --ink: #a9b8ff;
  --violet: #c39cf2;
  --red: #ff7486;
  --body: #dde7e3;
  --rule-rgb: 134, 201, 177;
  --button-hover: #a6dcc8;
  --stamp-blend: normal;
  color-scheme: dark;
  }
}

/* The light / dark switch in the header. */
.theme-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  background: transparent; color: var(--print); border: 0; cursor: pointer; border-radius: 50%;
}
.theme-btn:hover { background: var(--counter-deep); }
.theme-btn svg { width: 20px; height: 20px; }
.theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
:root[data-theme="dark"] .theme-btn .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: none; }
}
@media (max-width: 420px) { .theme-btn { width: 30px; height: 30px; } .theme-btn svg { width: 18px; height: 18px; } }
@media (max-width: 420px) {
  .top__right { gap: 4px; }
  .theme-btn { width: 28px; height: 28px; }
  .who__btn { padding: 6px 8px; }
  .menu-btn { padding: 8px 9px; gap: 7px; }
}
@media (max-width: 360px) { .wordmark { font-size: 0.98rem; } }
/* Narrow phones: the menu button keeps its lines and drops the word (screen readers still hear "Menu"). */
@media (max-width: 480px) {
  .menu-btn { font-size: 0; gap: 0; padding: 10px; }
  .menu-btn__lines { width: 18px; height: 12px; }
}
@media (max-width: 340px) {
  .top { gap: 6px; }
  .wordmark { font-size: 0.92rem; gap: 6px; }
  .wordmark__mark { width: 16px; height: 16px; }
}

/* v8.7: the box page's one next step */
.demo { margin: 14px 0 6px; padding: 10px 12px; background: var(--counter); font-size: 0.95rem; }
.demo__tag { display: inline-block; margin-right: 6px; padding: 1px 7px; border: 1.5px solid var(--violet); color: var(--violet); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.more { margin-top: 18px; border-top: 1px dashed rgba(var(--rule-rgb), 0.45); padding-top: 12px; }
.more summary { cursor: pointer; color: var(--print); font-weight: 600; }

/* Phones: logo, light/dark, Sign in and Menu share one row without touching. */
@media (max-width: 480px) {
  .top__right { gap: 8px; }
  .theme-btn { width: 34px; height: 34px; }
  .who__btn { padding: 6px 10px; font-size: 0.95rem; }
  .menu-btn { padding: 10px; }
}
@media (max-width: 480px) {
  .who__name { max-width: 7.5rem; padding: 6px 8px; }
}
@media (max-width: 360px) {
  .who__name { max-width: 5.5rem; }
}
@media (max-width: 340px) {
  .who__name { max-width: 4.2rem; }
  .theme-btn { width: 30px; height: 30px; }
  .top__right { gap: 4px; }
}

/* A small link that jumps down the page to "Try to cheat" */
.jump { margin: 14px 0 0; font-weight: 700; }

/* Footer: a quiet dark band that ends the page */
.foot {
  --band: #173f33;
  background: var(--band);
  box-shadow: 0 0 0 100vmax var(--band);
  clip-path: inset(0 -100vmax);
  border-top: 0;
  margin-top: 56px;
  padding: 44px var(--gutter) 40px;
  color: #b9cfc6;
  font-size: 0.95rem;
}
.foot__name { color: #fff; font-size: 1.25rem; margin-bottom: 8px; }
.foot h2 { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-variation-settings: normal; font-size: 0.78rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: #8fb3a6; margin-bottom: 14px; }
.foot ul { gap: 10px; }
.foot a { color: #f4f1e4; text-decoration: none; font-size: 1.02rem; }
.foot a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot a[target="_blank"]::after { content: " ↗"; font-size: 0.9em; opacity: 0.8; }
.foot__grid { margin-bottom: 30px; }
.foot > p { max-width: none; border-top: 1px solid rgba(255, 255, 255, 0.14); padding-top: 18px; color: #8fb3a6; font-size: 0.85rem; }
[data-theme="dark"] .foot { --band: #0d1f1a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .foot { --band: #0d1f1a; } }

/* Header, any phone and any text size: the signed-in name gives up space first,
   so the logo, the light/dark switch and the Menu button are never cut off. */
.wordmark { flex: 0 0 auto; }
.top__right { flex: 1 1 0; min-width: 0; justify-content: flex-end; }
.who { flex: 0 1 auto; min-width: 0; }
.who__name { display: block; min-width: 0; max-width: min(18ch, 100%); }
.theme-btn, .menu-btn { flex: 0 0 auto; }
@media (max-width: 480px) { .who__name { max-width: 100%; } }

/* "Give from another chain": a live NEAR Intents price */
.intents { margin-top: 22px; }
.intents__out:empty { display: none; }
.intents__out { margin-top: 18px; }
.intents__big { font-size: 1.15rem; line-height: 1.45; margin: 0 0 8px; }

/* Box page: the left column holds The rules and Try to cheat, stacked */
.pot-col { display: grid; gap: 32px; align-content: start; min-width: 0; }
.intents--compact { margin-top: 10px; }

/* The giving banner at the top of every box */
.give-banner { margin: 22px 0 6px; padding: 18px 20px; background: var(--slip); color: var(--body); border-left: 6px solid var(--print); max-width: 760px; }
.give-banner p { margin: 0 0 10px; font-size: 1.08rem; }
.give-banner p:last-child { margin-bottom: 0; }
.give-banner__bar { height: 10px; background: rgba(var(--rule-rgb), 0.15); margin: 4px 0 14px; }
.give-banner__bar span { display: block; height: 100%; background: var(--print); }
.give-banner--done { border-left-color: var(--violet); }

/* Box 7's NEAR Intents note: one line, opened only by those who want the detail */
.intents-note summary { cursor: pointer; list-style: none; }
.intents-note summary::-webkit-details-marker { display: none; }
.intents-note__more { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.intents-note__more::before { content: "▸ "; text-decoration: none; display: inline-block; }
.intents-note[open] .intents-note__more::before { content: "▾ "; }
.intents-note p { margin: 10px 0 0; }

/* Phones: nothing on a box page may be wider than the screen */
.pot-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
.pot-grid > *, .pot-col > *, .slip { min-width: 0; }
.slip small, .field__value, .rows td, .demo, .give-banner p { overflow-wrap: anywhere; }
.key { flex-wrap: wrap; }
@media (max-width: 880px) {
  .pot-grid { grid-template-columns: minmax(0, 1fr); }
}
.give-more { border-top: 1px dashed rgba(var(--rule-rgb), 0.45); margin-top: 18px; padding-top: 14px; }
.give-more h3 { margin: 0 0 4px; }

/* Menu polish, phones only: a card over a blurred page, taller rows, an arrow on each row.
   PC keeps the original full menu. */
@media (max-width: 620px) {
.menu { background: rgba(31, 42, 39, 0.28); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); padding: 14px; }
.menu__inner { min-height: 0; border-radius: 18px; box-shadow: 0 18px 50px rgba(15, 30, 26, 0.28); padding: 22px clamp(20px, 5vw, 40px) 26px; }
.menu__inner::before { display: none; }
.menu__head { border-bottom: 0; padding-bottom: 6px; }
.menu__close {
  width: 46px; height: 46px; padding: 0; border-radius: 50%; font-size: 0;
  box-shadow: inset 0 0 0 1.5px rgba(var(--rule-rgb), 0.45); display: grid; place-items: center;
}
.menu__close::before { content: "✕"; font-size: 1.05rem; font-weight: 600; color: var(--print); }
.menu__list li:last-child { border-bottom: 0; }
.menu__list a { grid-template-columns: 2.4rem 1fr auto; padding: 19px 0 17px; align-items: center; }
.menu__list a::before { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-weight: 500; font-size: 0.8rem; }
.menu__list a::after { content: "→"; font-size: 1.25rem; color: var(--print); transition: transform 120ms ease; }
.menu__list a:hover::after { transform: translateX(4px); color: var(--ink); }
.menu__foot { border-top: 1px dashed rgba(var(--rule-rgb), 0.4); padding-top: 16px; margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { .menu__list a::after { transition: none; } }
.menu__list a, .menu__list a:any-link { grid-template-columns: 2.4rem 1fr auto; row-gap: 0; }
.menu__list a::after { grid-column: 3; grid-row: 1; }
}

/* Reveal on scroll (added by script only; see app.js) */
.rv { opacity: 0; transform: translateY(16px); transition: opacity 420ms ease-out, transform 420ms ease-out; }
.rv.rv--in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; transition: none; } }
@media print { .rv { opacity: 1; transform: none; } }

/* The menu panel takes focus when opened, without drawing a ring */
.menu__inner:focus { outline: none; }
