/* ============================================================================
   $ANSEM Stimmy Tracker — "Treasury of the Trenches"
   A US Treasury stimulus check rendered as software: pale money-green safety
   paper, engraved serif masthead, MICR ledger type, and a rubber PAID stamp.
   Single committed light identity. No external resources.
   ========================================================================== */

:root {
  /* Safety-paper money greens */
  --paper:       #e3ede0;   /* the desk / safety-paper stock (page bg) */
  --paper-face:  #f5f8ef;   /* the check face — cleaner raised panels */
  --paper-sunk:  #eaf1e6;   /* recessed wells (tracks, inputs)        */

  /* Treasury green ink */
  --ink:      #143a22;      /* primary engraving — headings & body     */
  --ink-mid:  #3d6b4a;      /* secondary ink — labels, captions        */
  --ink-faint:#6d9078;      /* decorative only — never load-bearing    */

  /* Engraving hairlines + the one red accent */
  --rule:     #b7d0b9;      /* guilloche hairlines, borders            */
  --rule-2:   #cadecb;      /* softer inner rule                       */
  --seal:     #a5301f;      /* treasury red — stamp, negative, alerts  */
  --seal-ink: #8a2718;

  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono:  ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;

  --radius: 4px;
  --max-width: 760px;

  /* Guilloche safety-paper texture (two opposite-phase wave chains) */
  --guilloche: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='16'%3E%3Cg fill='none' stroke='%237fa389' stroke-width='0.6' stroke-opacity='0.32'%3E%3Cpath d='M0 8 q10 -5 20 0 t20 0 t20 0 t20 0 t20 0 t20 0'/%3E%3Cpath d='M0 8 q10 5 20 0 t20 0 t20 0 t20 0 t20 0 t20 0'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

[hidden] { display: none !important; }

body {
  background-color: var(--paper);
  background-image: var(--guilloche);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px 72px;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 2px;
}
a:hover { text-decoration-color: var(--seal); color: var(--seal-ink); }

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

/* ---- Shared engraved primitives -------------------------------------- */

/* Field label: the pre-printed caption on a check form */
.field-label,
.kicker,
.tile-label,
.pay-label,
.amount-label,
.alerts-kicker,
.pattern-card h3 {
  font-family: var(--sans);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mid);
}

/* A raised paper panel with the classic check double-rule border */
.panel {
  background: var(--paper-face);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--paper-face), inset 0 0 0 3px var(--rule-2);
}

/* ---- Sections -------------------------------------------------------- */

.section { margin-top: 44px; }

.section .kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
}
.section .kicker::after {
  content: "";
  flex: 1;
  height: 0;
  border-top: 1px solid var(--rule);
}

.section h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  color: var(--ink);
}

.section-sub {
  color: var(--ink-mid);
  font-size: 0.85rem;
  margin: 0 0 16px;
  max-width: 52ch;
}

/* ---- Letterhead / masthead ------------------------------------------- */

.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 34px 0 18px;
  border-bottom: 2px solid var(--ink);
  position: relative;
}
.site-header::after {  /* the second engraved rule of a double line */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -5px;
  border-top: 1px solid var(--rule);
}

.letterhead {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.seal { flex-shrink: 0; width: 52px; height: 52px; display: block; color: var(--ink); }
.seal--sm { width: 34px; height: 34px; }

.letterhead h1 {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}
.tagline {
  color: var(--ink-mid);
  margin: 3px 0 0;
  font-size: 0.86rem;
  max-width: 40ch;
}
.header-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}
.refreshed {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--ink-mid);
  margin: 4px 0 0;
  white-space: nowrap;
}
#refreshed-at { color: var(--ink); font-weight: 600; }

/* Alerts link — a compact, opt-in line under the ledger timestamp */
.alerts-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--ink-mid);
  text-decoration: none;
  white-space: nowrap;
}
.alerts-link:hover { color: var(--seal-ink); }
.alerts-kicker { color: var(--seal); }

/* ---- Error state ----------------------------------------------------- */

#app-error {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.error-box {
  max-width: 440px;
  text-align: center;
  background: var(--paper-face);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 3px var(--rule-2);
  padding: 36px 28px;
}
.error-box h1 {
  font-family: var(--serif);
  color: var(--ink);
  font-size: 1.4rem;
  margin: 0 0 12px;
}
.error-box p { color: var(--ink-mid); margin: 0; }

/* ============================================================================
   THE CHECK — hero wallet lookup (the signature element)
   ========================================================================== */

.hero { margin-top: 26px; }

.check {
  position: relative;
  background: var(--paper-face);
  background-image: var(--guilloche);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 4px var(--rule-2), 0 1px 0 rgba(20,58,34,0.06);
  padding: 22px 22px 16px;
  overflow: hidden;
}

.check-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.check-issuer { display: flex; align-items: center; gap: 11px; }
.issuer-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1rem;
  margin: 0;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.issuer-sub {
  font-size: 0.66rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin: 2px 0 0;
}
.check-meta { text-align: right; flex-shrink: 0; }
.check-no {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}
.check-memo {
  font-size: 0.6rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin: 3px 0 0;
}

.check-prompt {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 16px 0 14px;
}

/* Pay-to-the-order-of line */
.wallet-form { margin: 0; }
.pay-line { display: block; }
.pay-label { display: block; margin-bottom: 7px; }

.wallet-input {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--ink);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 8px 2px;
  border-radius: 0;
}
.wallet-input::placeholder { color: var(--ink-faint); font-style: italic; }
.wallet-input:focus {
  outline: none;
  border-bottom-color: var(--seal);
  background: linear-gradient(var(--paper-sunk), var(--paper-sunk)) no-repeat;
  background-size: 100% 100%;
}

.wallet-submit {
  margin-top: 16px;
  width: 100%;
  background: var(--ink);
  color: var(--paper-face);
  border: none;
  border-radius: var(--radius);
  padding: 13px 18px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.14s ease, transform 0.06s ease;
}
.wallet-submit:hover { background: var(--seal); }
.wallet-submit:active { transform: translateY(1px); }

/* MICR line at the bottom of the check */
.micr {
  margin: 18px -22px -16px;
  padding: 9px 22px;
  border-top: 1px solid var(--rule);
  background: var(--paper-sunk);
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.28em;
  color: var(--ink);
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.micr::-webkit-scrollbar { display: none; }

/* ---- Wallet result (the issued / voided check body) ------------------ */

#wallet-result { margin-top: 20px; }

.wallet-error {
  color: var(--seal-ink);
  font-family: var(--mono);
  font-size: 0.82rem;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--seal);
  border-radius: var(--radius);
  background: rgba(165,48,31,0.06);
}

.wallet-empty {
  position: relative;
  border: 1px dashed var(--ink-mid);
  border-radius: var(--radius);
  padding: 26px 22px;
  text-align: center;
  overflow: hidden;
}
.wallet-empty p { margin: 0 0 6px; color: var(--ink); font-size: 0.95rem; }
.wallet-empty-sub { color: var(--ink-mid); font-size: 0.84rem; }

/* Issued-check result */
.wallet-summary {
  position: relative;
  padding-top: 4px;
}

.amount-box {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 18px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 3px var(--rule-2);
  background: var(--paper-sunk);
  margin-bottom: 14px;
}
.amount-label { margin-bottom: 2px; }
.wallet-total { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.wallet-total-value {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.wallet-total-usd {
  font-family: var(--mono);
  color: var(--ink-mid);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.wallet-rank {
  color: var(--ink-mid);
  font-size: 0.86rem;
  margin: 0 0 4px;
}

/* Rubber PAID stamp */
.stamp {
  position: absolute;
  top: -2px;
  right: 2px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--seal);
  border: 3px double var(--seal);
  border-radius: 6px;
  padding: 5px 12px;
  opacity: 0.82;
  transform: rotate(-11deg);
  pointer-events: none;
  mix-blend-mode: multiply;
}
.stamp--void { color: var(--ink-mid); border-color: var(--ink-mid); }

.wallet-payouts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
}
.wallet-payout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: var(--paper-sunk);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.8rem;
}

/* Percentile bar — a fill-gauge in check ink */
.pct-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.pct-track {
  position: relative;
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--paper-sunk);
  border: 1px solid var(--rule);
  overflow: visible;
}
.pct-marker {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--seal);
  border: 2px solid var(--paper-face);
  box-shadow: 0 0 0 1px var(--seal);
  transform: translate(-50%, -50%);
}
.pct-caption {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink);
  flex-shrink: 0;
  white-space: nowrap;
}

/* Wallet sparkline */
.wallet-spark { width: 100%; height: 46px; display: block; margin-top: 16px; }
.spark-base { stroke: var(--ink-faint); stroke-width: 1; }
.spark-bar { fill: var(--ink); opacity: 0.82; }
.spark-bar:hover { opacity: 1; }

/* Share / copy — endorse the check */
.wallet-share {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.wallet-share-btn, .wallet-copy-btn {
  flex: 1;
  min-width: 130px;
  text-align: center;
  border-radius: var(--radius);
  padding: 11px 14px;
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.wallet-share-btn {
  background: var(--ink);
  color: var(--paper-face);
  border: 1px solid var(--ink);
  transition: background 0.14s ease;
  text-decoration: none;
}
.wallet-share-btn:hover { background: var(--seal); color: var(--paper-face); text-decoration: none; }
.wallet-copy-btn {
  background: var(--paper-face);
  border: 1px solid var(--ink);
  color: var(--ink);
  transition: background 0.14s ease;
}
.wallet-copy-btn:hover { background: var(--paper-sunk); }
.wallet-copy-btn.is-copied { border-color: var(--seal); color: var(--seal); }

/* Bullpen endorsement line — a discreet note on the check, not a banner */
.bullpen-note {
  margin: 14px 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--rule);
}
.bullpen-link {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-mid);
  text-decoration-style: dotted;
}
.bullpen-link:hover { color: var(--seal-ink); text-decoration-color: var(--seal); }

/* ============================================================================
   THE LEDGER — stats, chart, leaderboard, feed, patterns
   ========================================================================== */

/* Stat tiles — the treasury balance sheet */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.tile {
  background: var(--paper-face);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 2px var(--rule-2);
  padding: 15px 15px 16px;
  transition: box-shadow 0.14s ease;
}
.tile:hover { box-shadow: inset 0 0 0 2px var(--ink-faint); }
.tile-label { margin-bottom: 8px; }
.tile-value {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}
.tile-sub {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-mid);
  margin-top: 3px;
  min-height: 1em;
}

/* War-chest / reserve banner — the money printer */
.tile-war-chest {
  grid-column: 1 / -1;
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink-mid);
  color: var(--paper-face);
}
.tile-war-chest .tile-label { color: var(--paper-sunk); opacity: 0.85; }
.tile-war-chest .tile-value { color: var(--paper-face); }
.tile-war-chest .tile-sub { color: var(--paper-sunk); opacity: 0.85; }
.tile-war-chest:hover { box-shadow: inset 0 0 0 2px var(--paper-sunk); }

/* Anticipation sub-stats — engraved addenda under the books, computed client-side */
.anticipation-row {
  display: flex;
  flex-wrap: wrap;
  column-gap: 16px;
  row-gap: 4px;
  margin: 10px 2px 0;
}
.anticipation-item {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-mid);
  position: relative;
  padding-left: 14px;
}
.anticipation-item::before {
  content: "·";
  position: absolute;
  left: 4px;
}
.anticipation-item:first-child { padding-left: 0; }
.anticipation-item:first-child::before { content: none; }
.anticipation-item strong { color: var(--ink); font-weight: 600; }

/* Chart */
.chart-container {
  background: var(--paper-face);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 2px var(--rule-2);
  padding: 14px 12px;
}
.chart-svg { width: 100%; height: auto; display: block; }
.chart-bar { fill: var(--ink); opacity: 0.82; }
.chart-bar:hover { opacity: 1; }
.chart-label { fill: var(--ink-mid); font-size: 9px; font-family: var(--mono); }

.empty-state {
  color: var(--ink-mid);
  text-align: center;
  padding: 28px 20px;
  font-size: 0.9rem;
}

/* Leaderboard */
.lb-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.lb-tab {
  background: var(--paper-face);
  border: 1px solid var(--ink);
  color: var(--ink-mid);
  border-radius: var(--radius);
  padding: 8px 15px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.lb-tab:hover { color: var(--ink); background: var(--paper-sunk); }
.lb-tab.is-active { background: var(--ink); color: var(--paper-face); border-color: var(--ink); }

.leaderboard { display: flex; flex-direction: column; }
.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 6px 11px 4px;
  border-bottom: 1px solid var(--rule);
  font-size: 0.84rem;
  cursor: pointer;
  transition: background 0.1s ease;
}
.lb-row:first-child { border-top: 1px solid var(--ink); }
.lb-row:hover { background: var(--paper-sunk); }
.lb-row:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.lb-rank {
  font-family: var(--mono);
  color: var(--ink-mid);
  width: 2.6em;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.lb-who { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.lb-dates { font-family: var(--mono); font-size: 0.68rem; color: var(--ink-mid); }
.lb-count {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-mid);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.lb-amount {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--mono);
  min-width: 8.5em;
  flex-shrink: 0;
}
.lb-amount-token { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.lb-amount-usd { color: var(--ink-mid); font-size: 0.72rem; font-variant-numeric: tabular-nums; }

/* Filter bar + live register */
.filter-bar { margin-bottom: 16px; }
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  background: var(--paper-face);
  border: 1px solid var(--ink);
  color: var(--ink-mid);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.chip:hover { color: var(--ink); background: var(--paper-sunk); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper-face); }

.filter-controls { display: flex; gap: 8px; align-items: stretch; }
.feed-search {
  flex: 1;
  min-width: 0;
  background: var(--paper-face);
  border: 1px solid var(--ink);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.8rem;
  border-radius: var(--radius);
  padding: 9px 12px;
}
.feed-search:focus { outline: none; border-color: var(--seal); background: var(--paper-sunk); }
.feed-search::placeholder { color: var(--ink-faint); }

.sort-toggle {
  display: flex;
  flex-shrink: 0;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
}
.sort-btn {
  background: var(--paper-face);
  border: none;
  color: var(--ink-mid);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 13px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.sort-btn:hover { color: var(--ink); }
.sort-btn.is-active { background: var(--ink); color: var(--paper-face); }

.feed-summary {
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 0.79rem;
  color: var(--ink-mid);
  font-variant-numeric: tabular-nums;
}

.feed-list { display: flex; flex-direction: column; }
.feed-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px 10px 4px;
  border-bottom: 1px solid var(--rule);
  font-size: 0.82rem;
  transition: background 0.1s ease;
}
.feed-row:first-child { border-top: 1px solid var(--ink); }
.feed-row:hover { background: var(--paper-sunk); }
.feed-time {
  font-family: var(--mono);
  color: var(--ink-mid);
  width: 3.4em;
  flex-shrink: 0;
}
.addr-link { font-family: var(--mono); flex-shrink: 0; color: var(--ink); }
.feed-amount {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--mono);
  min-width: 9.5em;
  flex-shrink: 0;
}
.feed-amount-token { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.feed-amount-usd { color: var(--ink-mid); font-size: 0.74rem; font-variant-numeric: tabular-nums; }

/* The Wall — holder/seller classification, built entirely on the leaderboard's
   own row system (lb-row/lb-who/lb-amount) so it reads as one ledger. */
.wall-headline {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 2px 0 18px;
}
.wall-pct { font-variant-numeric: tabular-nums; }
.wall-pct--low { color: var(--seal-ink); }
.wall-pct--high { color: var(--ink); }

.lb-who-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.wall-stacked-tag {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1px 5px;
}

.wall-footnote {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-mid);
  margin: 14px 2px 0;
}

/* Wall-check stamp — subtle marginalia near the amount box, kept quiet so it
   never competes with the PAID/void stamp. */
.wall-mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: -6px 0 14px;
}
.wall-mark::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.wall-mark--holding, .wall-mark--stacked { color: var(--ink); }
.wall-mark--sold { color: var(--seal-ink); }

.load-more-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  background: var(--paper-face);
  border: 1px solid var(--ink);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 12px;
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.12s ease;
}
.load-more-btn:hover { background: var(--paper-sunk); }

/* Patterns — audit notes */
.patterns-grid { display: flex; flex-direction: column; gap: 12px; }
.pattern-card {
  background: var(--paper-face);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 2px var(--rule-2);
  padding: 18px;
}
.pattern-card h3 { margin: 0 0 10px; }
.pattern-card p {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.6;
}

.histogram { display: flex; flex-direction: column; gap: 8px; }
.hist-row {
  display: grid;
  grid-template-columns: 4.6em 1fr 2.6em;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.75rem;
}
.hist-label { color: var(--ink-mid); }
.hist-track {
  background: var(--paper-sunk);
  border: 1px solid var(--rule);
  border-radius: 2px;
  height: 12px;
  overflow: hidden;
}
.hist-fill { background: var(--ink); height: 100%; }
.hist-count { text-align: right; color: var(--ink-mid); font-variant-numeric: tabular-nums; }

/* Footer — the fine print */
.site-footer {
  margin-top: 64px;
  padding-top: 22px;
  border-top: 2px solid var(--ink);
  color: var(--ink-mid);
  font-size: 0.76rem;
  text-align: center;
  position: relative;
}
.site-footer::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 3px;
  border-top: 1px solid var(--rule);
}
.site-footer p { margin: 5px 0; }
.site-footer #dist-wallet-link a,
.site-footer #builder-handle { font-family: var(--mono); }

.tip-jar-address { font-family: var(--mono); color: var(--ink); }
.tip-jar-copy {
  margin-left: 4px;
  background: var(--paper-face);
  border: 1px solid var(--rule);
  color: var(--ink-mid);
  border-radius: var(--radius);
  padding: 2px 9px;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.tip-jar-copy:hover { background: var(--paper-sunk); color: var(--ink); }
.tip-jar-copy.is-copied { border-color: var(--seal); color: var(--seal); }

.b2b-line a { font-family: var(--mono); }

/* ---- Motion ---------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .stamp { animation: stamp-down 0.34s cubic-bezier(0.2, 0.75, 0.3, 1.25) both; }
  @keyframes stamp-down {
    from { opacity: 0; transform: rotate(-15deg) scale(1.55); }
    to   { opacity: 0.82; transform: rotate(-11deg) scale(1); }
  }
}

/* ---- Responsive ------------------------------------------------------ */
@media (min-width: 480px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 640px) {
  main { padding: 0 24px 88px; }
  .stat-grid { grid-template-columns: repeat(5, 1fr); }
  .letterhead h1 { font-size: 1.8rem; }
  .check { padding: 28px 30px 20px; }
  .micr { margin: 20px -30px -20px; padding: 10px 30px; }
  .check-prompt { font-size: 1.7rem; }
  .section h2 { font-size: 1.7rem; }
}
