/* Penny Drop
   Layout: the pixel-art bank fills one pane edge to edge (top on a phone, left on a
   desktop). The desk beside it is ledger paper: square corners, 2px ink rules, a
   pixel face for display and a typewriter mono for everything you read. */

/* Jersey is a pixel family drawn on fixed grids. Jersey 15 is used at 30, 45 and 60px and
   Jersey 10 at 20px, so every glyph pixel lands on a whole number of screen pixels. */
@font-face { font-family: "Jersey 15"; src: url("../assets/fonts/jersey-15-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Jersey 10"; src: url("../assets/fonts/jersey-10-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --paper: #f2f5ee;
  --card: #fbfcf8;
  --raised: #e4e9df;
  --ink: #17211b;
  --ink-2: #47554b;
  --ink-3: #5f6d63;
  --line: rgba(23, 33, 27, 0.16);
  --gold: #f2c14e;
  --gold-ink: #7a5006;
  --up: #17774a;
  --down: #bb372f;
  --sky: #77c3e6;
  --btn: #17211b;
  --btn-ink: #f2f5ee;

  --chip: #17211b;
  --chip-ink: #f2c14e;

  --font-display: "Jersey 15", "Courier New", ui-monospace, monospace;
  --font-label: "Jersey 10", "Courier New", ui-monospace, monospace;
  --font-body: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1411; --card: #151b17; --raised: #212a24; --ink: #e7eee8; --ink-2: #a9b5ac; --ink-3: #8a968d;
    --line: rgba(231, 238, 232, 0.16); --gold-ink: #f2c14e; --up: #4cc38a; --down: #f0706a; --sky: #0e1530;
    --btn: #e7eee8; --btn-ink: #0f1411; --chip: #f2c14e; --chip-ink: #17211b; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1411; --card: #151b17; --raised: #212a24; --ink: #e7eee8; --ink-2: #a9b5ac; --ink-3: #8a968d;
  --line: rgba(231, 238, 232, 0.16); --gold-ink: #f2c14e; --up: #4cc38a; --down: #f0706a; --sky: #0e1530;
  --btn: #e7eee8; --btn-ink: #0f1411; --chip: #f2c14e; --chip-ink: #17211b; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3, p, ol, ul, dl, dd, table { margin: 0; padding: 0; }
h1, h2, h3 { font-weight: 400; }
ol, ul { list-style: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 2px; }

/* ── frame ──
   The bank fills the whole window. Everything you read or type lives in one
   console docked at the bottom: a centred card on wide screens, a sheet on
   phones. The scene's camera keeps the action above it. */

html, body { overflow: hidden; }
.app { position: relative; height: 100%; overflow: hidden; background: var(--sky); }

.scene { position: absolute; inset: 0; overflow: hidden; background: var(--sky); }
.scene-canvas { display: block; position: absolute; left: 0; top: 0; image-rendering: crisp-edges; image-rendering: pixelated; }
.scene-canvas.is-browsable { cursor: grab; touch-action: none; }
.scene-canvas.is-browsable:active { cursor: grabbing; }

.topbar {
  position: absolute; z-index: 2; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding-top: 12px;
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand {
  display: flex; align-items: baseline; gap: 8px;
  background: var(--card); border: 2px solid var(--ink);
  padding: 4px 8px;
}
.brand-name { font-family: var(--font-label); font-size: 20px; line-height: 24px; }
.brand-meta { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tools { display: flex; gap: 4px; }
.tool {
  width: 36px; height: 36px; padding: 8px;
  display: grid; place-items: center;
  background: var(--card); border: 2px solid var(--ink);
  transition: background-color 140ms var(--ease), transform 140ms var(--ease);
}
.tool svg { width: 18px; height: 18px; fill: var(--ink); shape-rendering: crispEdges; }
.tool:hover { background: var(--raised); }
.tool:active { transform: translateY(1px); }
/* Support: gold, so it reads as its own thing next to the game tools. It is a
   plain link to the creator's Buy Me a Coffee page, opened in a new tab. */
.tool--support {
  width: auto; gap: 6px; padding: 0 10px; text-decoration: none; color: #17211b;
  background: var(--gold); box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--font-label); font-size: 20px; line-height: 1;
  display: inline-flex; align-items: center;
}
.tool--support svg { fill: #17211b; width: 18px; height: 18px; flex: none; }
.tool--support:hover { background: #ffd56b; }
.tool--support:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.tool--support span { display: none; }
@media (min-width: 640px) { .tool--support span { display: inline; } .tool--support { margin-right: 6px; } }
#btn-sound .muted { display: none; }
#btn-sound[aria-pressed="false"] .waves { display: none; }
#btn-sound[aria-pressed="false"] .muted { display: block; }

/* the lift panel, which is also the building's directory: each floor and what is on it.
   Phones and narrow windows show the floor codes, wider screens add the names. */
.lift {
  position: absolute; z-index: 2; top: 56px;
  right: max(12px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column;
  background: var(--card); border: 2px solid var(--ink);
}
.lift li + li { border-top: 1px solid var(--line); }
.lift-row {
  position: relative;
  display: grid; grid-template-columns: 32px; align-items: center;
  width: 100%; height: 28px; padding: 0;
  background: transparent; border: 0; text-align: left;
  font-family: var(--font-label); font-size: 20px; line-height: 28px; color: var(--ink-3);
  transition: background-color 140ms var(--ease), color 140ms var(--ease);
}
.lift-code { text-align: center; }
.lift-name { display: none; }
button.lift-row:hover { background: var(--raised); color: var(--ink); }
.lift-row.is-reached { color: var(--ink); }
.lift-row.is-reached::after { content: ""; position: absolute; left: 3px; top: 3px; width: 4px; height: 4px; background: var(--gold); outline: 1px solid var(--ink); }
.lift-row.is-here { background: var(--ink); color: var(--paper); }

@media (min-width: 640px) {
  .lift { top: 64px; }
}
@media (min-width: 1000px) {
  .lift-row { grid-template-columns: 32px auto; padding-right: 12px; }
  .lift-name { display: block; font-family: var(--font-body); font-size: 13px; padding-left: 4px; white-space: nowrap; }
}

/* the player's answer, riding the coin down (positioned by the scene each frame) */
.coin-tag {
  position: absolute; z-index: 1; left: 0; top: 0;
  max-width: min(46vw, 320px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 2px 10px 2px 8px;
  background: #17211b; color: #f2f5ee; border: 2px solid #f2c14e;
  font-family: var(--font-display); font-size: 30px; line-height: 32px;
  rotate: -3deg; transform-origin: left center;
  box-shadow: 4px 4px 0 rgba(10, 14, 12, 0.35);
  pointer-events: none;
  animation: tag-in 220ms var(--ease);
  transition: opacity 300ms var(--ease);
}
.coin-tag.is-gone { opacity: 0; }
@keyframes tag-in { from { opacity: 0; scale: 0.6; } }
@media (max-width: 639px) {
  .coin-tag { font-size: 20px; line-height: 22px; padding: 2px 8px 2px 6px; white-space: normal; overflow-wrap: anywhere; }
}
.coin-tag.is-left { transform-origin: right center; rotate: 3deg; }

.banner {
  position: absolute; z-index: 2; left: 50%; bottom: min(calc(var(--console-h, 0px) + 16px), calc(100% - 120px)); transform: translateX(-50%);
  display: flex; align-items: baseline; gap: 12px; white-space: nowrap;
  background: var(--card); border: 2px solid var(--ink); padding: 4px 12px;
  font-family: var(--font-display); font-size: 30px; line-height: 32px;
  animation: rise 320ms var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }
.banner.is-bump { animation: bump 240ms var(--ease); }
@keyframes bump { from { transform: translateX(-50%) scale(1.14); } }

.desk {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0;
  max-height: calc(100% - 72px);
  overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 20px;
  background: var(--paper);
  border-top: 2px solid var(--ink);
  padding-block: 16px calc(16px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.desk > * { min-width: 0; }
.panel { display: flex; flex-direction: column; gap: 16px; animation: enter 360ms var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }

/* On phones the closing statement keeps part of the bank in view and scrolls inside */
@media (max-width: 639px) {
  .desk.is-wide { max-height: max(60%, 400px); }
}
@media (max-width: 639px) and (max-height: 720px) {
  .lift-row { height: 24px; line-height: 24px; }
}

@media (min-width: 640px) {
  .desk {
    left: max(24px, env(safe-area-inset-left, 0px)); right: max(24px, env(safe-area-inset-right, 0px));
    bottom: max(24px, env(safe-area-inset-bottom, 0px));
    max-width: 600px; margin-inline: auto;
    max-height: calc(100% - 112px);
    border: 2px solid var(--ink);
    box-shadow: 8px 8px 0 rgba(10, 14, 12, 0.35);
    padding: 24px;
  }
  .desk.is-wide { max-width: 880px; }
}

/* ── type ── */

.eyebrow { font-size: 12px; line-height: 16px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.headline { font-family: var(--font-display); font-size: 45px; line-height: 0.9; text-wrap: balance; }
.lede { color: var(--ink-2); max-width: 62ch; }
.lede b { color: var(--ink); font-weight: 500; }
.fine { font-size: 12px; line-height: 16px; color: var(--ink-3); }
.up { color: var(--up); }
.down { color: var(--down); }
.num { font-variant-numeric: tabular-nums; }

/* ── controls ── */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 8px 20px;
  font-family: var(--font-display); font-size: 30px; line-height: 1;
  border: 2px solid var(--ink); background: var(--card); color: var(--ink);
  transition: transform 140ms var(--ease), box-shadow 140ms var(--ease), background-color 140ms var(--ease);
}
.btn:hover { background: var(--raised); }
.btn:active { transform: translate(1px, 1px); }
.btn--primary { background: var(--btn); color: var(--btn-ink); box-shadow: 4px 4px 0 var(--gold); }
.btn--primary:hover { background: var(--btn); box-shadow: 6px 6px 0 var(--gold); }
.btn--primary:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--gold); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn--text { min-height: 32px; padding: 4px 0; border: 0; background: none; font-family: var(--font-body); font-weight: 400; font-size: 13px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.btn--text:hover { background: none; color: var(--ink); }
.under-form .btn--text { white-space: nowrap; flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; }
.actions .btn--primary { margin-right: 4px; }

/* ── floors table (intro and help) ── */

.floors { width: 100%; border-collapse: collapse; border: 2px solid var(--ink); background: var(--card); }
.floors th, .floors td { padding: 6px 8px; text-align: left; font-weight: 400; vertical-align: baseline; }
.floors tr + tr > * { border-top: 1px solid var(--line); }
.floors .code { width: 48px; }
.floors .ret { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; }
.floors .who { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.floors .name { font-family: var(--font-label); font-size: 20px; line-height: 20px; }
.floors .is-trap > * { background: var(--raised); }
@media (max-width: 400px) { .floors .who { white-space: normal; } }

.chip {
  display: inline-block; min-width: 32px; padding: 0 4px;
  font-family: var(--font-label); font-size: 20px; line-height: 20px; text-align: center;
  background: var(--chip); color: var(--chip-ink);
}
.chip--trap { background: var(--down); color: #fff; }
.chip--cash { background: var(--raised); color: var(--ink-2); }

/* ── a round ── */

.round-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.round-no { font-family: var(--font-label); font-size: 20px; line-height: 20px; display: flex; align-items: center; gap: 8px; }
.pips { display: flex; gap: 4px; }
.pips i { width: 8px; height: 8px; border: 2px solid var(--ink); background: transparent; }
.pips i.is-done { background: var(--ink); }
.pips i.is-now { background: var(--gold); }
.pips i.is-trap { background: var(--down); border-color: var(--down); }
.purse { font-family: var(--font-display); font-size: 30px; line-height: 24px; font-variant-numeric: tabular-nums; }

.question-block { display: flex; flex-direction: column; gap: 8px; }
.question { font-family: var(--font-display); font-size: 30px; line-height: 1; text-wrap: balance; }
.rule { color: var(--ink-2); font-size: 13px; line-height: 20px; }

.clock { display: flex; align-items: center; gap: 12px; }
.clock-track { flex: 1; height: 12px; border: 2px solid var(--ink); background: var(--card); overflow: hidden; }
.clock-fill { height: 100%; background: var(--ink); transform-origin: left center; }
.clock.is-low .clock-fill { background: var(--down); }
.clock-num { width: 2ch; text-align: right; font-family: var(--font-display); font-size: 30px; line-height: 20px; font-variant-numeric: tabular-nums; }

.answer-form { display: flex; gap: 8px; }
.answer-input {
  flex: 1; min-width: 0; height: 48px; padding: 0 12px;
  background: var(--card); border: 2px solid var(--ink); border-radius: 0;
  font-size: 16px;
}
.answer-input::placeholder { color: var(--ink-3); }
.answer-input:focus-visible { outline-offset: 0; }
.answer-form.is-wrong { animation: shake 240ms linear; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.under-form { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; min-height: 32px; }
.msg { color: var(--down); font-size: 13px; }
.msg.is-info { color: var(--ink-2); }

/* ── reveal ── */

.result { border: 2px solid var(--ink); background: var(--card); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.result-top:only-child .result-ret { line-height: 20px; }
.result-top { display: flex; align-items: center; gap: 8px; }
.result-floor { font-family: var(--font-label); font-size: 20px; line-height: 20px; flex: 1; }
.result-ret { font-family: var(--font-display); font-size: 30px; line-height: 20px; font-variant-numeric: tabular-nums; }
.result-answer { font-family: var(--font-display); font-size: 30px; line-height: 1; overflow-wrap: anywhere; }
.result-why { color: var(--ink-2); }
.result-purse { padding-top: 8px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.result-purse b { font-weight: 500; }

.fact { border-left: 4px solid var(--gold); padding-left: 12px; color: var(--ink-2); max-width: 52ch; }

.book { display: flex; flex-direction: column; gap: 8px; }
.book-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-family: var(--font-label); font-size: 20px; line-height: 20px; }
.book-title span { font-family: var(--font-body); font-size: 12px; color: var(--ink-3); }
.book-rows { border: 2px solid var(--ink); background: var(--card); }
.book-row { display: grid; grid-template-columns: minmax(0, 1fr) 72px 48px 24px; align-items: center; gap: 8px; padding: 4px 8px; min-height: 28px; font-size: 13px; }
.book-row + .book-row { border-top: 1px solid var(--line); }
.book-row.is-you { background: var(--gold); color: #17211b; }
.book-row.is-you .book-share, .book-row.is-you .book-code { color: #17211b; }
.book-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-bar { height: 8px; background: var(--raised); }
.book-bar i { display: block; height: 100%; background: var(--ink); min-width: 1px; }
.book-row.is-you .book-bar { background: rgba(23, 33, 27, 0.18); }
.book-row.is-you .book-bar i { background: #17211b; }
.book-share { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.book-code { font-size: 12px; color: var(--ink-3); text-align: right; }
.book-gap { padding: 0 8px; color: var(--ink-3); font-size: 12px; line-height: 20px; border-top: 1px solid var(--line); }

.traps { display: flex; flex-direction: column; border: 2px solid var(--ink); background: var(--card); }
.traps li { padding: 6px 8px; font-size: 13px; line-height: 20px; }
.traps li + li { border-top: 1px solid var(--line); }
.traps b { font-weight: 500; }
.traps span { color: var(--ink-2); }
.traps li.is-you { background: var(--down); color: #fff; }
.traps li.is-you span { color: #fff; }
.traps .hits { white-space: nowrap; font-size: 12px; color: var(--ink-3); }

/* ── closing statement ── */

.final { display: flex; flex-direction: column; gap: 4px; }
.final-value { font-family: var(--font-display); font-size: 60px; line-height: 0.9; font-variant-numeric: tabular-nums; }
.final-sub { color: var(--ink-2); }
.final-sub b { font-weight: 500; color: var(--ink); }
.standing { color: var(--ink-2); }
.standing b { font-weight: 500; color: var(--ink); }
.trades { border: 2px solid var(--ink); background: var(--card); }
.trades li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px; }
.trades li + li { border-top: 1px solid var(--line); }
/* a trade that opens to today's answers */
.trades li.has-today { display: block; padding: 0; }
.trade-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 12px; gap: 8px; align-items: center; padding: 8px; cursor: pointer; list-style: none; }
.trade-row::-webkit-details-marker { display: none; }
.trade-row::after { content: "+"; font-family: var(--font-label); font-size: 20px; color: var(--ink-3); text-align: center; }
details[open] > .trade-row::after { content: "\2212"; }
.trade-row:hover { background: var(--raised); }
.today { padding: 4px 8px 12px; display: flex; flex-direction: column; gap: 6px; border-top: 1px dashed var(--line); }
.today-head { display: flex; justify-content: space-between; font-size: 12px; line-height: 16px; color: var(--ink-3); padding-top: 6px; }
.today-rows li { display: grid; grid-template-columns: 28px minmax(0, 1fr) 64px 44px; gap: 8px; align-items: center; padding: 3px 0; border: 0; font-size: 13px; }
.today-rows li + li { border-top: 0; }
.today-rank { color: var(--ink-3); font-variant-numeric: tabular-nums; text-align: right; }
.today-name { overflow-wrap: anywhere; line-height: 18px; }
.today-name b { font-weight: 500; color: var(--down); }
.today-n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.today-rows li.is-you { background: var(--gold); color: #17211b; margin-inline: -4px; padding-inline: 4px; }
.today-rows li.is-you .today-rank, .today-rows li.is-you .today-name b { color: #17211b; }
.today-rows li.is-you .book-bar { background: rgba(23, 33, 27, 0.18); }
.today-rows li.is-you .book-bar i { background: #17211b; }
.today-rows li.today-gap { display: block; color: var(--ink-3); padding: 0 0 0 36px; line-height: 12px; }
.today-total { font-size: 12px; line-height: 16px; color: var(--ink-2); }
.trade-text { display: flex; flex-direction: column; min-width: 0; }
.trade-q { font-size: 12px; line-height: 16px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trade-a { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trade-ret { font-family: var(--font-label); font-size: 20px; font-variant-numeric: tabular-nums; }
.share-text { white-space: pre-wrap; border: 2px dashed var(--ink-3); padding: 8px 12px; font-size: 13px; user-select: all; }

/* ── dialogs ── */

.sheet {
  width: min(520px, calc(100vw - 32px)); max-height: min(720px, calc(100vh - 48px));
  padding: 0; border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.35);
}
.sheet::backdrop { background: rgba(10, 14, 12, 0.6); }
.sheet[open] { display: flex; flex-direction: column; animation: enter 240ms var(--ease); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 12px 12px 20px; border-bottom: 2px solid var(--ink); }
.sheet-head h2 { font-family: var(--font-display); font-size: 30px; line-height: 28px; }
.sheet-body { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.sheet-body h3 { font-family: var(--font-label); font-size: 20px; line-height: 24px; }
.sheet-body p { color: var(--ink-2); max-width: 56ch; }
.sheet-body p b { color: var(--ink); font-weight: 500; }
.steps { display: flex; flex-direction: column; gap: 8px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 8px; color: var(--ink-2); }
.steps li::before { counter-increment: step; content: counter(step); font-family: var(--font-label); font-size: 20px; line-height: 20px; height: 20px; text-align: center; background: var(--chip); color: var(--chip-ink); }
.steps b { color: var(--ink); font-weight: 500; }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 2px solid var(--ink); background: var(--card); }
.stat-grid div { padding: 12px; }
.stat-grid div:nth-child(even) { border-left: 1px solid var(--line); }
.stat-grid div:nth-child(n + 3) { border-top: 1px solid var(--line); }
.stat-grid dt { font-size: 12px; line-height: 16px; color: var(--ink-3); }
.stat-grid dd { font-family: var(--font-display); font-size: 30px; line-height: 32px; font-variant-numeric: tabular-nums; }
.tally { border: 2px solid var(--ink); background: var(--card); }
.tally li { display: grid; grid-template-columns: 44px 112px minmax(0, 1fr) 32px; gap: 8px; align-items: center; padding: 4px 8px; min-height: 32px; font-size: 13px; }
.tally li + li { border-top: 1px solid var(--line); }
.tally .book-bar i { background: var(--ink); }
.tally .n { text-align: right; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── intro ── */
.meta { font-size: 12px; line-height: 18px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.meta span { white-space: nowrap; }

/* ── the order book drawer on the reveal ── */
.more { border-top: 1px solid var(--line); padding-top: 12px; }
.more > summary {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  min-height: 32px; cursor: pointer; list-style: none;
  font-family: var(--font-label); font-size: 20px; line-height: 28px;
}
.more > summary::-webkit-details-marker { display: none; }
.more > summary .count { font-family: var(--font-body); font-size: 12px; color: var(--ink-3); }
.more > summary .toggle { font-family: var(--font-body); font-size: 13px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.more > summary .toggle::after { content: "Show"; }
.more[open] > summary .toggle::after { content: "Hide"; }
.more > summary:hover .toggle { color: var(--ink); }
.more-body { display: flex; flex-direction: column; gap: 20px; padding-top: 12px; }

/* ── closing statement: two columns when the console is wide ── */
.done-grid { display: grid; gap: 16px; }
.done-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (min-width: 880px) {
  .done-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; align-items: start; }
}
