/* styles.css: Budget · Umbrella Street, the pixel kit (Hex, 2026-11-26).
   Spec and reasons: ../Budget - Umbrella Street kit.css
   Every colour, size and step is a token in :root. Restyle there first. */

/* --- Fonts: three voices, one job each, bundled (never loaded from Google) ---
   Pixelify Sans  names: the month, headings, pot names. Never under 18px.
   VT323          what the machine types: amounts, labels, stamps, buttons. Never under 19px.
   Nunito         sentences. 14px and up. */
@font-face { font-family: 'Pixelify Sans'; src: url('fonts/PixelifySans.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'VT323'; src: url('fonts/VT323-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('fonts/Nunito.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }

/* --- Tokens ---------------------------------------------------------------- */
:root {
  --paper: #FEE9D4;
  --card: #FFFAF4;
  --ink: #4A2C40;          /* plum: words and money */
  --ink-soft: #7A5A6E;     /* hints, labels, a pot going down */
  --line: #D3A9BF;         /* quiet line: bar track edge, dotted leaders, tab bar edge */
  --tap-line: #A9718F;     /* the pixel edge, ONLY on things you can tap */
  --cut-shadow: #F6D2B8;   /* cards sit on the paper like cut-outs */
  --accent: #4A2C40;       /* primary button, toast, the check button */
  --reached: #F7D98B;      /* butter: a threshold reached, sparkles */
  --stamp: #8E3B6B;        /* PAID / DECLARED / CHECKED / MOVED */
  --fragile: #F06E95;
  --fragile-ink: #B8325E;
  --error: #B8325E;        /* a failed save or a destructive action. Never a money state. */
  --note: #E9DDF2;         /* reminder slips */

  /* More pixel (Hex, 2026-11-26): the ground, window frames, square dots. */
  --ground-dot: #F3D2B6;   /* the dither on the paper: one 2px square every 8px */
  --frame: #E3B49C;        /* the window edge around a card */
  --frame-shadow: #EDC1A4; /* the stepped shadow under a card */
  --bevel-hi: #FFFFFF;     /* light catches the top-left inner edge */
  --bevel-lo: #F6E2D0;     /* and leaves the bottom-right */
  --dots: linear-gradient(90deg, var(--line) 4px, transparent 4px); /* square dots, 8px apart */

  /* Pot colours by job; an account can pick its own from the sticker sheet. */
  --job-bills: #42B1BB;
  --job-daily: #AFC194;
  --job-flex: #C1A4D4;
  --job-buffer: #F06E95;
  --job-other: #9FB7C2;
  --job: var(--job-other);

  /* The sticker sheet. Fills and sprites only, never small text. */
  --sheet-lagoon: #42B1BB;
  --sheet-sage: #AFC194;
  --sheet-lilac: #C1A4D4;
  --sheet-cupid: #F06E95;
  --sheet-butter: #F7D98B;
  --sheet-rain: #9FB7C2;
  --sheet-lolly: #FC9390;
  --sheet-thistle: #9295C0;
  --sheet-candy: #EFBDD6;
  --sheet-tangerine: #FB8244;

  /* Income bar. */
  --level-0: #FBE0CB;      /* the track */
  --level-1: #EBC9B4;      /* fill while still under the first threshold */
  --level-2: #F7D98B;      /* fill once any threshold is reached */

  --font: 'Nunito', system-ui, sans-serif;
  --font-name: 'Pixelify Sans', system-ui, sans-serif;
  --font-machine: 'VT323', ui-monospace, monospace;

  /* The pixel step. Cards notch at 4px, things you tap at 3px. Nothing is round. */
  --step: 4px;
  --step-tap: 3px;

  --gap: 18px;             /* cards need room: their shadow reaches 8px out */
  --tabs-h: 76px;
}

/* --- The pixel frame, written once ------------------------------------------
   Four hard shadows, one each way, one step wide; each covers a side but not
   the corner, so corners come out notched. A component sets:
     --s      the step          --edge   the frame colour
     --under  what sits beneath (the cut shadow, or the pressable bottom edge) */
.card, .block, .history li, .reminders li a, .legend li, .pill, .tag, .toast,
.btn, .icon, .chip, .row-btn, .stamp-off, .pick-item, .actual,
input:not([type=checkbox]), select, .tabs .tab-check {
  border: 0;
  border-radius: 0;
  /* Custom properties inherit: without this reset, every field and button
     inside a card wore the card's bevel and shadow. Each frame starts bare;
     cards and tappables set their own below. */
  --inner: 0 0 transparent;
  --under: 0 0 transparent;
  box-shadow:
    var(--inner, 0 0 transparent),
    0 calc(var(--s) * -1) 0 0 var(--edge),
    0 var(--s) 0 0 var(--edge),
    calc(var(--s) * -1) 0 0 0 var(--edge),
    var(--s) 0 0 0 var(--edge),
    var(--under, 0 0 transparent);
}
/* Cards are game windows: a notched edge, a bevel inside (light top-left,
   shade bottom-right), and a stepped shadow under. --inner holds the bevel. */
.card, .block {
  --s: var(--step); --edge: var(--frame);
  --inner: inset var(--step) var(--step) 0 0 var(--bevel-hi), inset calc(var(--step) * -1) calc(var(--step) * -1) 0 0 var(--bevel-lo);
  --under: var(--step) calc(var(--step) * 2) 0 0 var(--frame-shadow), calc(var(--step) * 2) var(--step) 0 0 var(--frame-shadow);
  background: var(--card);
}
/* Things you tap: the plum edge and a thicker bottom, and they press. */
.btn, .icon, .chip, .row-btn, .stamp-off, .pick-item {
  --s: var(--step-tap); --edge: var(--tap-line);
  --under: 0 calc(var(--step-tap) * 2) 0 0 var(--tap-line);
  cursor: pointer;
}
/* Press and hover live in "Feel" at the end, so they come after everything they move. */
/* Fields are sunk in, buttons stand up: a quiet edge and a shade along the
   top-left inside. The plum edge only arrives while you're in the field. */
input:not([type=checkbox]), select { --s: 2px; --edge: var(--line); --inner: inset 3px 3px 0 0 var(--ground-dot); }
input:not([type=checkbox]):focus, select:focus { --edge: var(--tap-line); }

/* --- Page ------------------------------------------------------------------ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  /* The ground: paper, with one small square of --ground-dot in each 8px
     cell. The top layer covers all but a 2px corner of the bottom layer. */
  background:
    linear-gradient(90deg, var(--paper) 6px, transparent 6px) 0 0 / 8px 8px,
    linear-gradient(var(--paper) 6px, var(--ground-dot) 6px) 0 0 / 8px 8px;
  background-color: var(--paper);
  color: var(--ink);
  font: 15px/1.45 var(--font);
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 28px);
}
body.no-nav { padding-bottom: 28px; }
body.no-nav .tabs { display: none; }
.wrap { max-width: 720px; margin: 0 auto; padding: calc(22px + env(safe-area-inset-top)) 20px 0; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* --- Type ------------------------------------------------------------------ */
h1, h2, h3, .name, .group { font-family: var(--font-name); font-weight: 500; line-height: 1.15; }
h1 { font-size: 26px; margin: 8px 0 6px; }
h2 { font-size: 21px; margin: 0 0 10px; }
h3 { font-size: 19px; margin: 0; }
.band strong { font-family: var(--font-name); font-weight: 500; font-size: 19px; }

.money { font-family: var(--font-machine); font-weight: 400; font-size: 1.35em; line-height: 1; }
/* An amount on its own is typed by the machine; an amount inside a sentence
   is said out loud, so it takes the sentence's voice (bold, figures aligned). */
small .money, .hint .money, .chg .money, .lede .money, .band .money,
.reminders .money, .flash .money, .toast .money, .kv dt .money {
  font-family: var(--font); font-weight: 700; font-size: inherit;
  font-variant-numeric: tabular-nums; line-height: inherit;
}
.big, .mid, .kv dd, .amt, .amt-btn, .history .v, .checks .v, .lines li > span:last-child,
.legend li, .eyebrow, .section, .pill, .tag, .stamp, .stamp-off, .btn, .icon, .chip, .tabs {
  font-family: var(--font-machine); font-weight: 400;
}
.big .money, .mid .money, .kv dd .money, .amt .money, .amt-btn .money, .history .v .money,
.checks .v .money, .lines li > span:last-child .money, .legend li .money, .btn .money { font-size: inherit; }
.big { font-size: 56px; line-height: 1; margin: 6px 0 8px; }
.mid { font-size: 32px; line-height: 1; margin: 6px 0; }
.eyebrow, .section { font-size: 20px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); line-height: 1; }
.eyebrow { margin: 0; }
.section { margin: 28px 2px 12px; }
.lede { font-size: 15px; color: var(--ink-soft); margin: 0 0 18px; }
.hint { font-size: 14px; color: var(--ink-soft); margin: 4px 0; }
.muted { color: var(--ink-soft); }
small { font-size: 14px; color: var(--ink-soft); font-family: var(--font); }
.neg { color: var(--ink); }   /* the minus sign does the work */

/* --- Money states: no red anywhere ---------------------------------------- */
.chg { margin: 2px 0 8px; font-size: 14px; }
.chg.down, .chg.up { color: var(--ink-soft); }
.block.protected .chg.down { color: var(--fragile-ink); }

/* --- Cards ----------------------------------------------------------------- */
.card { padding: 16px; margin: 0 0 var(--gap); }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

/* --- Month header ---------------------------------------------------------- */
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.month-nav h1 { margin: 0; flex: 1; text-align: center; }
.icon { width: 40px; height: 40px; font-size: 26px; line-height: 1; background: var(--paper); color: var(--ink); }
.icon.del { --under: 0 0 transparent; box-shadow: none; width: 32px; height: 32px; font-size: 22px; background: none; color: var(--ink-soft); }

/* --- Reminders: slips of paper --------------------------------------------- */
.reminders { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-direction: column; gap: 14px; }
.reminders li a {
  --s: var(--step); --edge: var(--note);
  display: flex; align-items: center; gap: 12px; padding: 8px 10px;
  background: var(--note); text-decoration: none; font-size: 15px;
}

/* --- Sprites: drawn without an outline; this draws the plum edge ------------ */
.sprite {
  flex: none;
  filter:
    drop-shadow(3px 0 0 var(--ink))
    drop-shadow(-3px 0 0 var(--ink))
    drop-shadow(0 3px 0 var(--ink))
    drop-shadow(0 -3px 0 var(--ink))
    drop-shadow(3px 3px 0 var(--cut-shadow));
}

/* A sprite with a bare layer (the umbrella's handle): two SVGs stacked, the
   bare one underneath, only the top one wears the .sprite outline. */
.sprite-stack { position: relative; display: inline-block; flex: none; }
.sprite-stack svg { position: absolute; inset: 0; }

/* --- Income ---------------------------------------------------------------- */
.income { position: relative; }
.sparkles { position: absolute; inset: 0; pointer-events: none; } /* out of the flow, so the grid never gives it a cell */
.sparkles svg { position: absolute; }
.sparkles svg:nth-child(1) { top: 16px; right: 18px; }
.sparkles svg:nth-child(2) { top: 40px; right: 44px; }
.sparkles svg:nth-child(3) { top: 66px; right: 14px; }
.band { margin: 0 0 16px; font-size: 15px; color: var(--ink-soft); }
.band strong { color: var(--ink); }

/* The bar fills block by block and never empties to scold. */
.bar { position: relative; height: 18px; margin: 10px 0 8px; background: repeating-linear-gradient(90deg, var(--level-0) 0 10px, transparent 10px 13px); }
.bar .fill { height: 100%; background: repeating-linear-gradient(90deg, var(--level-fill, var(--level-2)) 0 10px, transparent 10px 13px); }
.bar .tick { position: absolute; top: -4px; bottom: -4px; width: 4px; margin-left: -2px; background: var(--tap-line); }
.bar.thin { height: 10px; margin: 8px 0 2px; background: repeating-linear-gradient(90deg, var(--level-0) 0 6px, transparent 6px 8px); }
.bar.thin .fill { background: repeating-linear-gradient(90deg, var(--job) 0 6px, transparent 6px 8px); }
.income.level-0 { --level-fill: var(--level-1); }
.income:not(.level-0) { --level-fill: var(--level-2); }

.legend { list-style: none; padding: 0; margin: 18px 0 8px; display: flex; flex-wrap: wrap; gap: 12px; }
.legend li { --s: 2px; --edge: var(--line); padding: 3px 8px; font-size: 22px; line-height: 1; color: var(--ink-soft); display: flex; gap: 6px; }
.legend li b { font-weight: 400; }
.legend li.met { --s: 3px; --edge: var(--reached); background: var(--reached); color: var(--ink); }
.legend li.met::before { content: '✓'; }

/* Lines: label, dotted leader, amount. */
.lines { list-style: none; padding: 0; margin: 14px 0 0; }
.lines li { display: flex; align-items: flex-end; gap: 6px; padding: 6px 0; }
.lines li::before { content: ''; order: 1; flex: 1; min-width: 12px; height: 4px; margin: 0 2px 6px; background: var(--dots) 0 0 / 8px 4px repeat-x; }
.lines li > :first-child { order: 0; max-width: 70%; font-family: var(--font-machine); font-size: 23px; line-height: 1.05; }
.lines li > :first-child small { display: block; font-family: var(--font); font-size: 14px; line-height: 1.3; margin-top: 2px; }
.lines li > :last-child { order: 2; font-size: 23px; line-height: 1; white-space: nowrap; }
.lines li.aside { color: var(--ink-soft); }
.lines li.actual-row { display: block; }
.lines li.actual-row::before { content: none; }

/* --- Things you tap ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 12px; font-size: 22px; line-height: 1;
  text-decoration: none; color: var(--ink); background: var(--paper);
}
.btn.primary { background: var(--accent); color: var(--paper); }
.btn.small { font-size: 20px; min-height: 36px; padding: 0 10px; }
.btn.danger { color: var(--error); }
.link { background: none; border: 0; padding: 4px 0; font: 14px var(--font); color: var(--ink-soft); text-decoration: underline; cursor: pointer; }
.link.danger { color: var(--error); }
.link.center { display: block; margin: -4px auto 14px; }
.amt-btn {
  background: none; border: 0; padding: 0 0 0 4px; cursor: pointer; color: inherit;
  font-size: 23px; line-height: 1; white-space: nowrap; text-align: right;
  text-decoration: underline dotted var(--tap-line); text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.pill { --s: 2px; --edge: var(--line); display: inline-block; margin-left: 6px; padding: 1px 5px; background: var(--note); color: var(--ink); font-size: 19px; line-height: 1; text-transform: uppercase; vertical-align: 2px; text-decoration: none; }
.pill.soft { background: var(--card); color: var(--ink-soft); }

/* --- Forms ----------------------------------------------------------------- */
.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-size: 14px; color: var(--ink-soft); margin-bottom: 6px; }
.field-title { margin: 10px 0 8px; font-size: 14px; color: var(--ink-soft); }
input:not([type=checkbox]), select {
  width: 100%; min-height: 44px; padding: 10px 12px; margin: 2px 0;
  font: 16px var(--font); color: var(--ink); background: var(--paper);
}
input:focus-visible, select:focus-visible, .btn:focus-visible, .chip:focus-visible, .row-btn:focus-visible, .amt-btn:focus-visible { outline: 3px solid var(--stamp); outline-offset: 5px; }
.big-input input { font-family: var(--font-machine); font-size: 40px; line-height: 1; padding: 8px 12px; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.rowset { border: 0; margin: 0 0 16px; padding: 0 0 12px; background: var(--dots) left bottom / 8px 4px repeat-x; }
.rowfoot { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.tick { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; min-height: 32px; }
.tick input { width: 18px; height: 18px; accent-color: var(--stamp); }
.ticks { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; }
.save-bar {
  position: sticky; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 10px);
  display: flex; gap: 14px; padding: 12px 10px; margin: 0 0 var(--gap);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
}
.flash { margin: 12px 0 0; color: var(--stamp); }
.actual { --s: 2px; --edge: var(--paper); background: var(--paper); padding: 12px; margin: 6px 2px 10px; }
.actual .field { margin-bottom: 8px; }

/* --- Stamps: one for each tick in the app; a grid does not tilt ------------- */
.stamp {
  display: inline-block; align-self: flex-start; padding: 1px 6px;
  border: 2px dashed var(--stamp); color: var(--stamp);
  font-size: 20px; line-height: 1; text-transform: uppercase; white-space: nowrap;
}
.stamp.solid { border-style: solid; }
.stamp.boxed { border: 4px double var(--stamp); }
.block .stamp { margin-top: 8px; }
.stamp-toggle { display: inline-flex; align-items: center; justify-content: flex-end; cursor: pointer; min-height: 32px; }
.stamp-toggle:has(input:focus-visible) { outline: 3px solid var(--stamp); outline-offset: 4px; }
.stamp-off { display: inline-block; min-width: 22px; min-height: 22px; padding: 1px 6px; background: var(--paper); color: var(--ink-soft); font-size: 20px; line-height: 20px; }

/* --- The Fragile tag ------------------------------------------------------- */
.tag {
  --s: 3px; --edge: var(--fragile);
  position: absolute; top: -12px; right: -8px; z-index: 1;
  padding: 2px 7px; background: #FFF0F4; color: var(--fragile-ink);
  font-size: 20px; line-height: 1; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
}

/* --- Account blocks (laid out like the sheet) ------------------------------ */
.job-bills { --job: var(--job-bills); }
.job-daily { --job: var(--job-daily); }
.job-flex { --job: var(--job-flex); }
.job-buffer { --job: var(--job-buffer); }
.block { position: relative; padding: 16px 14px 16px; margin-bottom: 26px; }
/* The title band: the pot's name on a strip of its own colour, like a game
   window's title bar. It reaches to the card's edges (minus the padding). */
.block-head {
  display: flex; align-items: center; gap: 12px;
  margin: -16px -14px 10px; padding: 12px 14px 10px;
  background: color-mix(in srgb, var(--job) 35%, var(--card));
  border-bottom: 4px solid var(--job);
}
.block-head .sprite {           /* one size up in the band: 7 squares at 4px */
  width: 28px; height: auto;
  filter:
    drop-shadow(4px 0 0 var(--ink))
    drop-shadow(-4px 0 0 var(--ink))
    drop-shadow(0 4px 0 var(--ink))
    drop-shadow(0 -4px 0 var(--ink));
}
.block .bank { margin: 0 0 6px; }
.block > .btn { margin-top: 14px; }
.block .goal { margin: 10px 0 0; }
.group { margin: 14px 0 4px; font-size: 18px; color: var(--ink-soft); }
.checked { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0 0; }
.checked .stamp { margin: 0; }

.bill-list { list-style: none; padding: 0; margin: 0; }
.bill-list.card { padding: 6px 14px; }
.bill {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 64px; align-items: center; gap: 10px;
  padding: 6px 0 10px; background: var(--dots) left bottom / 8px 4px repeat-x;
}
.bill:last-child { background-image: none; }
.bill .nm { text-decoration: none; min-width: 0; }
.bill .nm small { display: block; }
.bill .amt { font-size: 23px; line-height: 1; text-align: right; white-space: nowrap; }
.bill .stamp-toggle { justify-self: end; }
.bill.paid .nm, .bill.paid .amt-btn { color: var(--ink-soft); }
.bill-list .actual-row { list-style: none; }

/* Label, dotted leader, amount. */
.kv { margin: 8px 0 0; }
.kv > div { display: flex; align-items: flex-end; gap: 6px; padding: 5px 0; }
.kv > div::after { content: ''; order: 1; flex: 1; height: 4px; margin: 0 2px 6px; background: var(--dots) 0 0 / 8px 4px repeat-x; }
.kv dt { order: 0; color: var(--ink-soft); }
.kv dd { order: 2; margin: 0; font-size: 23px; line-height: 1; text-align: right; white-space: nowrap; }
.kv dd small { font-size: 14px; }
.kv .total { margin-top: 4px; padding-top: 8px; border-top: 3px solid var(--line); }
/* A total is a receipt line, typed: TOTAL, END OF MONTH. Pixelify stays for names. */
.kv .total dt { font-family: var(--font-machine); font-weight: 400; font-size: 22px; letter-spacing: .04em; text-transform: uppercase; line-height: 1; color: var(--ink); }
.kv .total dd { font-size: 26px; }
.tally .due dd { color: var(--ink); }
.tally .clear dd { color: var(--stamp); }

.checks { list-style: none; padding: 0; margin: 0; }
.checks li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: end; padding: 5px 0 9px; background: var(--dots) left bottom / 8px 4px repeat-x; }
.checks .d, .checks .n { color: var(--ink-soft); font-size: 14px; }
.checks .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checks .v { font-size: 23px; line-height: 1; }

/* --- Reality check: account chips ------------------------------------------- */
.chips { display: flex; gap: 14px; overflow-x: auto; padding: 6px 4px 12px; margin: 0 -4px 6px; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--paper); color: var(--ink); text-decoration: none; font-size: 22px; line-height: 1; }
.chip::before { content: ''; width: 10px; height: 10px; background: var(--job); }
.chip.on { --edge: var(--stamp); background: var(--card); }

/* --- Lists ------------------------------------------------------------------ */
.history, .costs { list-style: none; padding: 0; margin: 0 0 var(--gap); }
.history li {
  --s: 2px; --edge: var(--card); --under: 3px 3px 0 2px var(--cut-shadow);
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 6px 12px;
  padding: 10px 12px; background: var(--card); margin-bottom: 14px;
}
.history li.waiting { --s: 3px; --edge: var(--reached); --under: 0 0 transparent; }
.history .d { color: var(--ink-soft); font-size: 14px; }
.history .v { font-size: 23px; line-height: 1; text-align: right; }
.history .name { grid-column: 1 / 3; }
.history .note, .history .ticks { grid-column: 1 / -1; color: var(--ink-soft); font-size: 14px; }
.history .chg { margin: 0; }
.costs li { margin-bottom: 14px; }
.costs li.ended { opacity: .6; }
.row-btn {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left;
  padding: 10px 12px; background: var(--card); color: inherit; font: 15px var(--font);
}
.row-btn .name { font-family: var(--font); font-weight: 600; }
.row-btn .v { font-family: var(--font-machine); font-size: 23px; line-height: 1; white-space: nowrap; }
.row-btn small { display: block; font-weight: 400; }
.costs .panel { margin: 10px 0 0; }
.panel h3 { margin: 0 0 8px; font-size: 18px; color: var(--ink-soft); }
.panel .actual { --edge: transparent; padding: 0; background: none; margin: 0; }
.panel hr { border: 0; height: 4px; margin: 16px 0; background: var(--dots) 0 0 / 8px 4px repeat-x; }

/* --- Welcome ----------------------------------------------------------------- */
.welcome { padding-top: 6vh; }
.welcome h1 { font-size: 30px; }
.pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 4px 2px 8px; }
.pick-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px; background: var(--paper); }
.pick-item::before { content: ''; flex: none; width: 12px; height: 12px; margin-top: 4px; background: var(--job); }
.pick-item input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--stamp); flex: none; }
.pick-item b { font-family: var(--font-name); font-weight: 500; font-size: 18px; }
.pick-item small { display: block; margin-top: 2px; }
.pick-item:has(input:checked) { --edge: var(--stamp); background: var(--card); }

/* --- Tab bar ----------------------------------------------------------------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center;
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--card); border-top: 4px solid var(--line);
}
.tabs a { text-align: center; text-decoration: none; font-size: 20px; color: var(--ink-soft); padding: 12px 2px; }
.tabs a.on { color: var(--ink); }
.tabs .tab-check {
  --s: var(--step); --edge: var(--accent); --under: 0 8px 0 0 var(--tap-line);
  justify-self: center; width: 56px; height: 56px; margin-top: -30px; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--accent); color: var(--paper);
}
.tabs .tab-check.on { color: var(--paper); }

.toast {
  --s: 3px; --edge: var(--accent);
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 16px); transform: translate(-50%, 20px);
  max-width: min(92vw, 480px); padding: 10px 16px; background: var(--accent); color: var(--paper);
  font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 10;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { --edge: var(--error); background: var(--error); color: #fff; }

/* --- Laptop: the whole month on one screen, like the sheet ------------------ */
@media (min-width: 860px) {
  body { padding-bottom: 32px; padding-top: 72px; }
  body[data-view="overview"] .wrap { max-width: 1180px; }
  .tabs { top: 0; bottom: auto; height: 64px; padding: 0 calc(50% - 360px); border-top: 0; border-bottom: 4px solid var(--line); }
  .tabs .tab-check { flex-direction: row; gap: 8px; width: auto; height: 40px; margin: 0; padding: 0 16px; --under: 0 6px 0 0 var(--tap-line); }
  .board { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 26px 22px; align-items: start; }
  .income { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
  .income .sparkles svg:nth-child(1) { right: calc(50% + 18px); }
  .income .sparkles svg:nth-child(2) { right: calc(50% + 44px); }
  .income .sparkles svg:nth-child(3) { right: calc(50% + 14px); }
  .income-lines .lines { margin-top: 0; }
  .save-bar { bottom: 12px; }
  .toast { bottom: 24px; }
}
@media (max-width: 380px) {
  .row3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .big { font-size: 48px; }
}

/* --- Feel: things you tap are raised blocks ----------------------------------
   Rest:  the bottom edge (--under) makes the block stand on the paper.
   Hover: it lifts 2px and the edge grows, so it floats.
   Press: it drops by the edge's height and the edge vanishes, so it's pushed in.
   Movement goes in whole steps (steps()), never a smooth glide: that's the 1992 in it. */
.btn, .icon, .chip, .row-btn, .stamp-off, .pick-item, .tabs .tab-check, .reminders li a, .amt-btn {
  transition: transform 90ms steps(2), box-shadow 90ms steps(2), background-color 90ms steps(1);
}
@media (hover: hover) {
  .btn:hover, .icon:hover, .chip:hover, .row-btn:hover, .pick-item:hover, .stamp-toggle:hover .stamp-off {
    transform: translateY(-2px);
    --under: 0 calc(var(--step-tap) * 2 + 2px) 0 0 var(--tap-line);
  }
  .tabs .tab-check:hover { transform: translateY(-2px); --under: 0 10px 0 0 var(--tap-line); }
  .reminders li a:hover { transform: translate(-2px, -2px); --under: 4px 4px 0 0 var(--line); }
  .amt-btn:hover { background: var(--reached); box-shadow: 0 -2px 0 0 var(--reached), 0 2px 0 0 var(--reached), -2px 0 0 0 var(--reached), 2px 0 0 0 var(--reached); text-decoration-color: transparent; }
  .stamp-toggle:hover .stamp { background: color-mix(in srgb, var(--stamp) 10%, transparent); }
  .bill:hover, .checks li:hover { background-color: color-mix(in srgb, var(--paper) 60%, transparent); } /* colour only, so the dots stay */
  .tabs a:not(.tab-check):hover { color: var(--ink); text-decoration: underline 3px dotted var(--tap-line); text-underline-offset: 6px; }
  .bill .nm:hover { text-decoration: underline 2px dotted var(--tap-line); text-underline-offset: 4px; }
}
/* :active is the mouse press; .pressed is the finger (set by pressOnTouch in ui.js). */
.btn:active, .icon:active, .chip:active, .row-btn:active, .pick-item:active, .stamp-toggle:active .stamp-off,
.btn.pressed, .icon.pressed, .chip.pressed, .row-btn.pressed, .pick-item.pressed, .stamp-toggle.pressed .stamp-off {
  transform: translateY(var(--step-tap));
  --under: 0 0 transparent;
}
.tabs .tab-check:active, .tabs .tab-check.pressed { transform: translateY(8px); --under: 0 0 transparent; }
.reminders li a:active, .reminders li a.pressed { transform: translate(1px, 1px); --under: 0 0 transparent; }
.amt-btn:active, .amt-btn.pressed { transform: translateY(2px); background: var(--reached); }
.stamp-toggle.pressed .stamp { transform: translateY(2px); }

/* No double-tap zoom delay on things you tap. */
.btn, .icon, .chip, .row-btn, .stamp-toggle, .pick-item, .tabs a, .reminders li a, .amt-btn { touch-action: manipulation; }

/* A stamp lands: big and faint, then down hard, then settled. */
@keyframes thunk {
  0%   { transform: scale(1.7); opacity: 0; }
  60%  { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1);   opacity: 1; }
}
.stamp.thunk { animation: thunk 260ms steps(4) both; }

/* The sparkles on the income card twinkle, each on its own beat. */
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.sparkles svg { animation: twinkle 2.4s steps(2) infinite; }
.sparkles svg:nth-child(2) { animation-delay: -.8s; animation-duration: 3.1s; }
.sparkles svg:nth-child(3) { animation-delay: -1.7s; animation-duration: 2.7s; }

/* If the device asks for less motion, nothing moves. Colours still change. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .btn:hover, .icon:hover, .chip:hover, .row-btn:hover, .pick-item:hover, .reminders li a:hover,
  .stamp-toggle:hover .stamp-off, .tabs .tab-check:hover { transform: none; }
}
