:root {
  --desk: #31443a;
  --on-desk: #f9f5e8;
  --on-desk-soft: #a9bbae;
  --on-desk-bright: #ccd8cf;
  --on-desk-faint: rgba(249, 245, 232, 0.25);
  --inset: rgba(0, 0, 0, 0.18);
  --inset-border: rgba(249, 245, 232, 0.12);
  --paper: #f9f5e8;
  --paper-hi: #fffdf4;
  --feint: #b9c9da;
  --feint-soft: #cfdae6;
  --ink: #1c2420;
  --soft: #6d7365;
  --red: #b3282d;
  --red-lift: #e37d74;
  --red-faint: rgba(179, 40, 45, 0.45);
  --green: #2c6a4a;
  --stamp-blend: multiply;
  --display: "Besley", "Iowan Old Style", Georgia, serif;
  --mono: "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --body: "Spline Sans", -apple-system, "Segoe UI", sans-serif;
  --line: 41px; /* the ledger's ruling grid */
}

/* ---------- stationery (themes) ---------- */

:root[data-theme="sage"] {
  --desk: #e9efdd;
  --on-desk: #22301f;
  --on-desk-soft: #6e7c64;
  --on-desk-bright: #43513f;
  --on-desk-faint: rgba(34, 48, 31, 0.3);
  --inset: rgba(34, 48, 31, 0.06);
  --inset-border: rgba(34, 48, 31, 0.16);
  --paper: #f6f8ec;
  --paper-hi: #fdfef6;
  --ink: #22301f;
  --soft: #6e7c64;
  --red: #a32b33;
  --red-lift: #a32b33;
  --red-faint: rgba(163, 43, 51, 0.45);
  --green: #2f6b4c;
}

:root[data-theme="manila"] {
  --desk: #dfd3b4;
  --on-desk: #35301f;
  --on-desk-soft: #7c7357;
  --on-desk-bright: #4d4630;
  --on-desk-faint: rgba(53, 48, 31, 0.3);
  --inset: rgba(53, 48, 31, 0.07);
  --inset-border: rgba(53, 48, 31, 0.16);
  --paper: #f8f4e6;
  --paper-hi: #fffdf2;
  --ink: #29251a;
  --soft: #766e54;
  --red: #a8362e;
  --red-lift: #a8362e;
  --red-faint: rgba(168, 54, 46, 0.45);
  --green: #2f6b4c;
}

:root[data-theme="bankers-blue"] {
  --desk: #1d2c40;
  --on-desk: #eee9da;
  --on-desk-soft: #97a4b4;
  --on-desk-bright: #c5cdd8;
  --on-desk-faint: rgba(238, 233, 218, 0.22);
  --inset: rgba(0, 0, 0, 0.22);
  --inset-border: rgba(238, 233, 218, 0.12);
  --paper: #f7f3e6;
  --paper-hi: #fffcf1;
  --ink: #202634;
  --soft: #6b7280;
  --red: #b3282d;
  --red-lift: #e37d74;
  --red-faint: rgba(179, 40, 45, 0.45);
  --green: #2c6a4a;
}

:root[data-theme="oxblood"] {
  --desk: #3f2226;
  --on-desk: #f2e9dc;
  --on-desk-soft: #b59d95;
  --on-desk-bright: #d8c8bd;
  --on-desk-faint: rgba(242, 233, 220, 0.22);
  --inset: rgba(0, 0, 0, 0.2);
  --inset-border: rgba(242, 233, 220, 0.12);
  --paper: #f8f2e4;
  --paper-hi: #fffcf0;
  --ink: #241c18;
  --soft: #77685c;
  --red: #a82c2c;
  --red-lift: #d9a862;
  --red-faint: rgba(168, 44, 44, 0.45);
  --green: #2f6b4c;
}

:root[data-theme="nightwatch"] {
  color-scheme: dark;
  --desk: #10171a;
  --on-desk: #e6e1cf;
  --on-desk-soft: #8b948b;
  --on-desk-bright: #c2c8bb;
  --on-desk-faint: rgba(230, 225, 207, 0.22);
  --inset: rgba(255, 255, 255, 0.05);
  --inset-border: rgba(230, 225, 207, 0.14);
  --paper: #1e2622;
  --paper-hi: #2a332e;
  --feint: #3b4a56;
  --feint-soft: #2e3a44;
  --ink: #e6e1cf;
  --soft: #939c90;
  --red: #d95f58;
  --red-lift: #e58079;
  --red-faint: rgba(217, 95, 88, 0.5);
  --green: #63b389;
  --stamp-blend: normal;
}

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

html { color-scheme: light; }

body {
  background: var(--desk);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 16px 56px;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

:focus-visible {
  outline: 2px dashed currentColor;
  outline-offset: 3px;
}

/* ---------- masthead (on the desk) ---------- */

.masthead {
  width: min(560px, 100%);
  text-align: center;
  margin-bottom: 28px;
  color: var(--on-desk);
}

.wordmark {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(44px, 10vw, 58px);
  letter-spacing: -0.01em;
  line-height: 1;
}

.wordmark .stop { color: var(--red-lift); }

.meta {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-desk-soft);
  margin-top: 12px;
}

.tagline {
  font-family: var(--display);
  font-weight: 500;
  font-style: italic;
  font-size: 17px;
  color: var(--on-desk-soft);
  margin-top: 6px;
}

.rules {
  margin-top: 16px;
  font-size: 14px;
  color: var(--soft);
}

.rules summary {
  cursor: pointer;
  display: inline-block;
  font-weight: 500;
  color: var(--on-desk);
  border-bottom: 1px dashed var(--on-desk-soft);
}

.rules summary:hover { border-bottom-color: var(--on-desk); }

.rules-body {
  max-width: 46ch;
  margin: 16px auto 0;
  text-align: left;
  color: var(--on-desk-bright);
  background: var(--inset);
  border: 1px solid var(--inset-border);
  border-radius: 4px;
  padding: 16px 20px;
}

.rules-steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 8px;
}

.rules-steps li {
  counter-increment: step;
  position: relative;
  padding-left: 26px;
}

.rules-steps li::before {
  content: counter(step) ".";
  position: absolute;
  left: 0;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--red-lift);
}

.rules .key {
  display: inline-block;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  color: var(--red-lift);
  border: 1px solid color-mix(in srgb, var(--red-lift) 55%, transparent);
  border-radius: 4px;
  padding: 2px 5px 3px;
}

.rules .eg {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--on-desk);
}

.rules em {
  font-family: var(--display);
  color: var(--red-lift);
}

.rules-fine {
  list-style: none;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--on-desk-faint);
  display: grid;
  gap: 5px;
  font-size: 13px;
  color: var(--on-desk-soft);
}

.rules-fine li {
  position: relative;
  padding-left: 16px;
}

.rules-fine li::before {
  content: "·";
  position: absolute;
  left: 2px;
  font-weight: 700;
  color: var(--red-lift);
}

/* ---------- the sheet: one ivory leaf on the desk ---------- */

.sheet {
  position: relative;
  width: min(560px, 100%);
  background: var(--paper);
  border-radius: 2px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.25),
    0 24px 48px -20px rgba(0, 0, 0, 0.55);
  padding: 30px 30px 26px 66px;
}

/* the double red account rule of a real ledger leaf */
.sheet::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 42px;
  width: 5px;
  border-left: 1.5px solid var(--red-faint);
  border-right: 1.5px solid var(--red-faint);
  pointer-events: none;
}

/* ---------- amount due: a double-ruled total ---------- */

.due {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.due-label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--soft);
}

.due-value {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(48px, 12vw, 64px);
  line-height: 0.95;
  color: var(--red);
  padding: 0 6px 8px;
  border-bottom: 7px double var(--red);
  font-variant-numeric: lining-nums;
}

/* ---------- tiles ---------- */

.tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.tile {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 22px;
  min-width: 64px;
  height: 52px;
  padding: 0 12px;
  background: var(--paper-hi);
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 80ms ease, box-shadow 80ms ease;
}

.tile:not(:disabled):hover { transform: translateY(-1px); }

.tile.selected {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(3px);
  box-shadow: none;
}

/* results are pencilled in, not printed */
.tile.made { border-style: dashed; box-shadow: 0 3px 0 var(--soft); border-color: var(--ink); }

.tile.used {
  opacity: 0.35;
  text-decoration: line-through 2px var(--red);
  border-color: var(--soft);
  box-shadow: none;
  cursor: default;
}

/* ---------- operations ---------- */

.ops {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}

.op {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 22px;
  width: 46px;
  height: 46px;
  border: 2px solid var(--red);
  border-radius: 50%;
  color: var(--red);
  transition: background 80ms ease, color 80ms ease;
}

.op.selected,
.op:not(:disabled):hover {
  background: var(--red);
  color: var(--paper);
}

.op:disabled { opacity: 0.35; cursor: default; }

/* ---------- notes / errors ---------- */

.note {
  font-family: var(--display);
  font-style: italic;
  font-size: 14px;
  color: var(--red);
  min-height: 22px;
  margin-bottom: 8px;
}

.note.shake { animation: shake 240ms ease; }

@keyframes shake {
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
}

/* ---------- the ledger: blue feint ruling, entries on the lines ---------- */

.ledger ol {
  list-style: none;
  counter-reset: line;
  min-height: calc(var(--line) * 5);
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--line) - 1px),
    var(--feint) calc(var(--line) - 1px),
    var(--feint) var(--line)
  );
}

.ledger li {
  counter-increment: line;
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 17px;
  height: var(--line);
  line-height: var(--line);
}

/* folio numbers live in the outer margin, clear of the red rule */
.ledger li::before {
  content: counter(line, decimal-leading-zero);
  position: absolute;
  left: -30px;
  transform: translateX(-100%);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--soft);
}

.ledger .leader {
  flex: 1;
  border-bottom: 1px dotted var(--soft);
  opacity: 0.55;
  transform: translateY(-5px);
}

.ledger .amt { font-weight: 700; }

.ledger li.hit .amt { color: var(--red); }

.ledger li.empty,
.ledger li.pending {
  color: var(--soft);
}

.ledger li.empty,
.ledger li.audit-label { counter-increment: none; }

.ledger li.empty::before,
.ledger li.audit-label::before { content: ""; }

.ledger li.empty {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 15px;
}

.ledger .caret {
  display: inline-block;
  width: 9px;
  height: 17px;
  background: var(--soft);
  animation: blink 1.1s steps(1) infinite;
  transform: translateY(2px);
}

@keyframes blink { 50% { opacity: 0; } }

.ledger li.audit-label {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 15px;
  color: var(--green);
}

.ledger li.audit { color: var(--green); }

/* ---------- controls ---------- */

.controls {
  display: flex;
  gap: 18px;
  margin-top: 20px;
}

.ghost {
  font-size: 14px;
  font-weight: 500;
  color: var(--soft);
  border-bottom: 1px dashed var(--soft);
  padding-bottom: 1px;
}

.ghost:not(:disabled):hover { color: var(--ink); border-bottom-color: var(--ink); }

.ghost:disabled { opacity: 0.35; cursor: default; }

.ghost.danger { margin-left: auto; }

.ghost.danger:not(:disabled):hover { color: var(--red); border-bottom-color: var(--red); }

.ghost.confirm { color: var(--red); border-bottom-color: var(--red); font-weight: 600; }

/* ---------- the stamp ---------- */

.stamp {
  position: absolute;
  top: 52%;
  left: 50%;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(48px, 12vw, 64px);
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  border: 4px double var(--red);
  border-radius: 8px;
  padding: 8px 22px 12px;
  transform: translate(-50%, -50%) rotate(-7deg);
  mix-blend-mode: var(--stamp-blend);
  opacity: 0.88;
  pointer-events: none;
  animation: stamp-in 360ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes stamp-in {
  from { transform: translate(-50%, -50%) rotate(-7deg) scale(2.1); opacity: 0; }
  to   { transform: translate(-50%, -50%) rotate(-7deg) scale(1); opacity: 0.88; }
}

/* ---------- result & footer (on the desk) ---------- */

.result {
  width: min(560px, 100%);
  text-align: center;
  margin-top: 24px;
  font-family: var(--display);
  font-size: 19px;
  color: var(--on-desk);
}

.result button {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--red);
  border-radius: 3px;
  padding: 10px 20px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}

.result button:active { transform: translateY(3px); box-shadow: none; }

.new-badges {
  margin-top: 8px;
  font-style: italic;
  font-size: 16px;
  color: var(--red-lift);
}

/* ---------- the books ---------- */

.books {
  width: min(560px, 100%);
  margin-top: 28px;
  text-align: center;
}

.books summary {
  cursor: pointer;
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  color: var(--on-desk-soft);
  border-bottom: 1px dashed var(--on-desk-soft);
}

.books summary:hover { color: var(--on-desk); border-bottom-color: var(--on-desk); }

.books-body {
  margin-top: 14px;
  text-align: left;
  background: var(--paper);
  border-radius: 2px;
  padding: 12px 20px 16px;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.5);
}

#bookFigures {
  list-style: none;
}

#bookFigures li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 14px;
  padding: 7px 0 5px;
  border-bottom: 1px solid var(--feint-soft);
}

#bookFigures .leader {
  flex: 1;
  border-bottom: 1px dotted var(--soft);
  opacity: 0.55;
  transform: translateY(-4px);
}

#bookFigures .amt { font-weight: 700; }

#bookDist {
  list-style: none;
  margin-top: 14px;
  display: grid;
  gap: 7px;
}

#bookDist li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--soft);
}

.dist-label { flex: none; width: 11ch; white-space: nowrap; }

.dist-track { flex: 1; }

.dist-bar {
  display: block;
  height: 12px;
  border-radius: 2px;
  background: var(--green);
  min-width: 2px;
}

.dist-bar.zero { background: var(--feint-soft); }

.dist-count {
  flex: none;
  width: 3ch;
  text-align: right;
  font-weight: 700;
  color: var(--ink);
}

/* ---------- past accounts ---------- */

.history {
  width: min(560px, 100%);
  margin-top: 28px;
  text-align: center;
}

.history summary {
  cursor: pointer;
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  color: var(--on-desk-soft);
  border-bottom: 1px dashed var(--on-desk-soft);
}

.history summary:hover { color: var(--on-desk); border-bottom-color: var(--on-desk); }

.history ol {
  list-style: none;
  margin-top: 14px;
  text-align: left;
  background: var(--paper);
  border-radius: 2px;
  padding: 10px 20px;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.5);
}

.history li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 14px;
  padding: 7px 0 5px;
  border-bottom: 1px solid var(--feint-soft);
}

.history li:last-child { border-bottom: none; }

.history .leader {
  flex: 1;
  border-bottom: 1px dotted var(--soft);
  opacity: 0.55;
  transform: translateY(-4px);
}

.history .amt { font-weight: 700; }

.history li.settled .amt { color: var(--green); }

.history li.open .amt { color: var(--soft); font-weight: 500; }

.history li.blank .amt { color: var(--soft); font-weight: 500; opacity: 0.6; }

.history .expr a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed var(--soft);
}

.history .expr a:hover {
  color: var(--red);
  border-bottom: 1px solid var(--red);
}

.history li.current .expr a {
  color: var(--red);
  font-weight: 700;
  border-bottom: 1px solid var(--red);
}

.archive-note {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--red-lift);
}

.archive-note a { color: inherit; }

/* ---------- commendations ---------- */

.badges {
  width: min(560px, 100%);
  margin-top: 24px;
  text-align: center;
}

.badges summary {
  cursor: pointer;
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  color: var(--on-desk-soft);
  border-bottom: 1px dashed var(--on-desk-soft);
}

.badges summary:hover { color: var(--on-desk); border-bottom-color: var(--on-desk); }

.badge-count { color: var(--on-desk); }

#badgeList {
  list-style: none;
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  text-align: left;
}

.badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border-radius: 2px;
  padding: 10px 12px;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.45);
}

.badge .seal,
.toast .seal {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--red);
  border: 3px double var(--red);
  border-radius: 50%;
  transform: rotate(-6deg);
  opacity: 0.9;
}

.badge:not(.earned) .seal {
  color: var(--soft);
  border: 1.5px dashed var(--soft);
  opacity: 0.5;
  transform: none;
}

.badge:not(.earned) .badge-name,
.badge:not(.earned) .badge-desc {
  opacity: 0.55;
}

.badge-name {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.25;
}

.badge-desc {
  display: block;
  font-size: 12.5px;
  color: var(--soft);
  line-height: 1.35;
}

.badge.fresh { box-shadow: 0 0 0 2px var(--red-faint), 0 6px 16px -8px rgba(0, 0, 0, 0.45); }

.badge.fresh .seal { animation: seal-in 360ms cubic-bezier(0.2, 1.4, 0.4, 1); }

@keyframes seal-in {
  from { transform: rotate(-6deg) scale(1.9); opacity: 0; }
  to   { transform: rotate(-6deg) scale(1); opacity: 0.9; }
}

/* ---------- toasts ---------- */

.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(340px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  color: var(--ink);
  border-radius: 3px;
  padding: 10px 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), 0 16px 32px -12px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 220ms ease, transform 260ms cubic-bezier(0.2, 1.2, 0.4, 1);
}

.toast.show { opacity: 1; transform: none; }

.toast-text { display: grid; gap: 1px; }

.toast-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--soft);
}

.toast-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
}

/* ---------- ticker ---------- */

.ticker {
  width: min(560px, 100%);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-desk-soft);
}

.also {
  width: min(560px, 100%);
  margin-top: 14px;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--on-desk-soft);
}

.also a { color: var(--on-desk); }

.stationery { position: relative; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-desk-soft);
}

.theme-label {
  border-bottom: 1px dashed var(--on-desk-soft);
  padding-bottom: 2px;
}

.theme-toggle:hover { color: var(--on-desk); }

.theme-toggle:hover .theme-label { border-bottom-color: var(--on-desk); }

/* a miniature of the design itself: paper leaf on a desk */
.chip {
  position: relative;
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.chip-leaf {
  position: absolute;
  inset: 4px;
  border-radius: 2px;
}

.theme-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  z-index: 10;
  min-width: 200px;
  background: var(--paper);
  border-radius: 4px;
  padding: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2), 0 14px 32px -10px rgba(0, 0, 0, 0.55);
  text-align: left;
}

.theme-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.theme-menu button:hover { background: var(--feint-soft); }

.theme-menu button.selected::after {
  content: "✓";
  margin-left: auto;
  font-weight: 700;
  color: var(--red);
}

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

@media (max-width: 480px) {
  body { padding: 24px 10px 44px; }

  .sheet { padding: 24px 18px 20px 48px; }
  .sheet::before { left: 30px; }

  .ledger li::before { left: -24px; font-size: 10px; }

  .tile { min-width: 56px; height: 48px; font-size: 20px; }
}

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