/* Household Budget — clean editorial theme.
   Palette: warm white background, one deep green, one muted brass accent.
   The only other colours are soft status tints (green / red / amber) used
   for badges and pills only. No gradients, no purple/blue "AI" look. */
:root {
  --green: #20392f;
  --green-deep: #172a22;
  --brass: #b08d57;
  --bg: #faf9f7;
  --card: #ffffff;
  --text: #1c1c1a;
  --muted: #6e6a63;
  --hairline: #e7e3dc;
  --input-border: #d8d3ca;
  --soft-green-bg: #eaf3ec;
  --soft-green: #2e6b3e;
  --soft-red-bg: #f9ecea;
  --soft-red: #a63a2e;
  --soft-amber-bg: #fbf3e2;
  --soft-amber: #8a5a12;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--green-deep);
  margin: 0 0 10px;
}
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }

/* Header: white, not a dark block. */
.topbar {
  background: var(--card);
  color: var(--text);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--hairline);
}
.topbar strong { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.badge {
  background: var(--soft-amber-bg);
  color: var(--soft-amber);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 8px;
  margin-left: 8px;
  vertical-align: middle;
}
.demo-banner {
  background: #f7f1e6;
  border-bottom: 1px solid #e8dcc4;
  padding: 11px 16px;
  font-size: 14px;
  color: #5d4a2a;
}

/* Tabs: plain text with a brass underline for the active one — no pills. */
.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 12px;
  background: var(--card);
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 57px;
  z-index: 9;
}
.tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  padding: 12px 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
}
.tab.active { color: var(--green); border-bottom-color: var(--brass); }

main { max-width: 720px; margin: 0 auto; padding: 20px 14px 48px; }
.card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
}
.hero .big {
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--green-deep);
  line-height: 1.1;
}
.hero .big.negative { color: var(--soft-red); }
.num {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--green-deep);
}
.kicker {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid .card { margin-bottom: 0; }

/* Buttons: deep green primary, white/green outline secondary. */
.btn {
  border: 1px solid var(--green);
  background: var(--card);
  color: var(--green);
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-small { padding: 7px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { display: block; width: 100%; margin: 8px 0; padding: 14px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

input, select, textarea {
  width: 100%;
  padding: 11px 12px;
  margin: 6px 0 14px;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  font-size: 16px;
  font-family: var(--sans);
  background: #fff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brass);
  outline-offset: 0;
  border-color: var(--brass);
}
label { font-size: 14px; font-weight: 600; }
/* Compact manual-add form: the three short-value fields (amount, date,
   card suffix) share one row instead of stacking full-width. Font stays
   16px so iOS does not zoom on focus; min-width: 0 lets the date input
   shrink inside its grid cell. Merchant stays full-width: names run long. */
#section-manual .form-row-3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 0.9fr); gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.form-row-3 label, .form-row-3 select, .form-row-3 input { min-width: 0; box-sizing: border-box; }
#section-manual .form-row-3 label { min-width: 0; }
#section-manual .form-row-3 input { min-width: 0; }
#section-manual input { padding: 9px 10px; }
/* R12 Add money: money input capped instead of full-width (audit P1-3
   pattern), and the confirmation checkbox sits inline, not full-width. */
#section-fund-add input[name="amount"] { max-width: 220px; }
/* R13 charity: same capped money-input pattern for gift/income forms. */
#section-charity-gift input[name="amount"], #section-charity-income input[name="amount"] { max-width: 220px; }
#section-fund-add .check-label { display: flex; align-items: flex-start; gap: 8px; }
#section-fund-add .check-label input[type="checkbox"] { width: auto; margin: 2px 0 14px; accent-color: var(--green); }
/* Two-column short-field row (savings movement: kind + amount). */
.form-row-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.form-row-2 label, .form-row-2 select, .form-row-2 input { min-width: 0; box-sizing: border-box; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { border-bottom: 1px solid var(--hairline); padding: 11px 0; }
.plain li:last-child { border-bottom: 0; }
.tx-amount { font-weight: 700; }
.tx-amount.negative { color: var(--soft-green); }

/* Section navigation: stops the live app feeling like one long scroll.
   Sticky tab bar, live-app only, so the demo is untouched. */
#view-app .app-nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  background: #faf9f7; padding: 10px 2px 8px; margin: 0 0 8px;
  border-bottom: 1px solid #e8e2d8;
}
#view-app .app-nav::-webkit-scrollbar { display: none; }
#view-app .app-nav-link {
  flex: 0 0 auto; background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 8px 12px; font-size: 14px; font-weight: 600; color: var(--muted);
  cursor: pointer; font-family: var(--sans); white-space: nowrap;
}
#view-app .app-nav-link.active { color: var(--green); border-bottom-color: var(--brass); font-weight: 800; }
#view-app .card[id^="section-"] { scroll-margin-top: 64px; }

/* Live-app polish only — scoped under #view-app / body.live so the demo is untouched. */
#view-app .card { margin-bottom: 16px; padding: 20px; }
#view-app .card h2 { margin-bottom: 4px; }
#view-app .card > .muted.small { line-height: 1.6; }
#view-app .hero { padding: 20px 22px; }
#view-app .grid { gap: 10px; }
#view-app .grid .card { padding: 14px 16px; }
#view-app .stat-hint { margin: 2px 0 8px; }
/* Header: title centered, profile icon on the right (no stray buttons). */
#liveTopbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; z-index: 30; }
#liveTopbar .topbar-title { text-align: center; }
#liveTopbar .topbar-right { display: flex; justify-content: flex-end; }
#liveTopbar .badge { margin-left: 4px; }
.profile-btn { width: 42px; height: 42px; border-radius: 50%; background: #f3efe8;
  border: 1px solid #ddd3bf; color: var(--green); display: flex; align-items: center;
  justify-content: center; cursor: pointer; }
.profile-menu { position: absolute; right: 14px; top: 62px; background: #fff;
  border: 1px solid var(--hairline); border-radius: 14px; padding: 16px;
  box-shadow: 0 12px 30px rgba(0,0,0,.15); width: 250px; z-index: 40; }
.profile-menu p { margin: 4px 0; overflow-wrap: anywhere; }
.profile-menu .btn { margin-top: 12px; width: 100%; }
/* Filter chips: real tap targets (was 6px padding, easy to miss). */
.tx-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 14px; }
.tx-chip {
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 10px 12px; font-size: 15px; font-weight: 600; color: var(--muted);
  cursor: pointer; font-family: var(--sans);
}
.tx-chip.active { color: var(--green); border-bottom-color: var(--brass); font-weight: 800; }
.tx-week-toggle { margin: 0 0 10px; }
.tx-week-toggle.active { background: var(--green); color: #fff; }
.tx-count { margin: 2px 0 8px; }
/* Transaction rows: merchant truncates with ellipsis, amount never pushed off. */
.tx-row { padding: 14px 0; }
.tx-line1 { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; min-width: 0; }
.tx-line1 .tx-name {
  flex: 1 1 auto; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
}
.tx-line1 .tx-amount { flex: 0 0 auto; white-space: nowrap; font-size: 16px; }
.tx-line2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.tx-line2 .pill { margin-left: 0; }
.tx-line2 .tx-meta { min-width: 0; }
.tx-line2 .btn-small { margin-left: auto; flex: 0 0 auto; }
.tx-excluded { opacity: 0.55; }
.tx-empty { color: var(--muted); font-size: 14px; line-height: 1.5; }
/* Bank card buttons + fund queue buttons: breathing room, wrap cleanly. */
#view-app .card .btn + .btn { margin-left: 8px; }
#fundQueue li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@media (max-width: 480px) {
  #view-app .card { padding: 20px 18px; }
  #view-app .grid .num { font-size: 20px; }
  #view-app .grid .kicker { font-size: 11px; }
  .tx-line1 .tx-amount { font-size: 15px; }
}

/* Status pills: soft tints only. */
.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--soft-green-bg);
  color: var(--soft-green);
  margin-left: 6px;
}
.pill.warn { background: var(--soft-amber-bg); color: var(--soft-amber); }
.pill.ok { background: var(--soft-green-bg); color: var(--soft-green); }

.result {
  margin-top: 8px;
  padding: 12px;
  border-radius: 10px;
  background: #f3f1ed;
  font-size: 14px;
  white-space: pre-wrap;
}
.result.error { background: var(--soft-red-bg); color: var(--soft-red); }
.result:empty { display: none; }
.hidden { display: none !important; }
.inline-form { margin-bottom: 12px; }
.foot { text-align: center; padding: 16px; }
/* P2-C5: scheduled-sync staleness warning in the footer — dark red
   text on the plain footer, same error colour as other warnings. */
.sync-stale-warn { color: #dc2626; }
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .hero .big { font-size: 36px; }
}

/* View screens + tappable rows (live app only). */
#view-app .stat-card { cursor: pointer; }
#view-app .tx-head { cursor: pointer; }
#view-app .tx-detail { margin-top: 10px; padding-top: 10px; border-top: 1px solid #e8e2d8; }
#view-app .tx-detail p { margin: 4px 0; }
#view-app .tx-detail .btn { margin-right: 6px; margin-top: 4px; }
#view-app #weekBreakdown { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.25); }

/* In-app sheet (replaces browser prompt/confirm/alert boxes). */
#sheetOverlay { position: fixed; inset: 0; z-index: 50; background: rgba(32,57,47,.45);
  display: flex; align-items: flex-end; justify-content: center; padding: 16px; overscroll-behavior: contain; }
#sheetOverlay .sheet { background: #fff; border-radius: 16px; padding: 22px; width: 100%; max-width: 480px;
  max-height: 85vh; max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  box-shadow: 0 12px 40px rgba(0,0,0,.25); }
#sheetOverlay .sheet h3 { margin: 0 0 8px; font-family: var(--serif); }
#sheetOverlay .sheet p { margin: 0 0 14px; color: var(--muted); line-height: 1.5; }
/* Design item 4 (owner, Nov 5): failure dialogs use the soft-red error
   style — background #fef2f2, text #dc2626, border #fecaca — the same
   as inline .result.error boxes and error toasts. Success/info sheets
   stay white. Applied only when showSheet is called with kind:'error'
   (showAlert); showConfirm and form sheets are unaffected. */
#sheetOverlay .sheet.sheet-error { background: #fef2f2; border: 1px solid #fecaca; }
#sheetOverlay .sheet.sheet-error h3 { color: #dc2626; }
#sheetOverlay .sheet.sheet-error p { color: #7f1d1d; }
#sheetOverlay .sheet.sheet-error .sheet-handle { background: #fecaca; }
#sheetOverlay .sheet label { display: block; margin-bottom: 14px; font-weight: 600; }
#sheetOverlay .sheet input { width: 100%; margin-top: 6px; }
#sheetOverlay .sheet-btns { display: flex; gap: 10px; justify-content: center; }
/* Smaller cents, like a finance app: $372.25 with a smaller .25. */
.cents { font-size: 1em; }
/* Buttons + chips, live app only (demo untouched): filled, warm, clear. */
#view-app .btn { background: #f3efe8; border: 1px solid #ddd3bf; color: var(--green); }
#view-app .btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
#view-app .btn:active, #liveTopbar .btn:active { opacity: .75; }
#liveTopbar .btn:disabled { opacity: .6; }
#view-app .tx-chip { background: #f3efe8; color: var(--green); border: 0; border-radius: 8px;
  padding: 8px 14px; font-weight: 700; }
#view-app .tx-chip.active { background: var(--green); color: #fff; border: 0; }
#view-app .app-nav-link.active { border-bottom-width: 3px; }

/* Long IDs must wrap instead of stretching the card. */
#householdId { word-break: break-all; }

/* App sections stay hidden until the view switcher shows one — no
   flashing every section while the first refresh is still loading. */
#view-app > .card, #view-app > .grid, #view-app > p, #view-app > .page-head { display: none; }
/* Header buttons match the in-app buttons (the header sits outside
   #view-app, so the earlier restyle missed them and they looked like
   a different app). Refresh is a normal secondary button; Sign out
   is quiet text, since it is not an action you take often. */
/* Side-by-side buttons get real breathing room (live app only). */
#view-app .btn { margin: 0 8px 8px 0; }
/* Transaction controls: each filter gets its own line, label above
   its dropdown, so "Month" no longer crowds the button above it. */
#section-transactions > label { display: block; margin: 10px 0 4px; font-weight: 600; }
#section-transactions > label select { display: block; width: 100%; margin-top: 4px; }
#section-transactions .tx-week-toggle { margin-bottom: 4px; }

/* Live app: one button size everywhere (the small variant made
   neighbouring buttons look mismatched). */
#view-app .btn-small { padding: 11px 16px; font-size: 15px; border-radius: 10px; }

/* ===== Live-app restyle (Nov 1, owner-picked reference: Fireart-style
   finance shots — white, near-black type, one blue accent, pill
   buttons, bottom tab bar). Scoped to body.live so the demo is untouched. */
body.live {
  --green: #2f6bff; --green-deep: #0f172a; --brass: #2f6bff;
  --bg: #ffffff; --card: #ffffff; --text: #0f172a; --muted: #6b7280;
  --hairline: #ececf1; --input-border: #e5e7eb;
  /* Typography: clean modern system sans throughout the live app,
     matching the reference page's look. No paid/licensed font and no
     web-font download: on iPhone this renders as the system sans,
     on Android as Roboto, on desktop as Segoe UI / Helvetica / Arial.
     No exact font name is claimed from the screenshot. */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-family: var(--sans);
  /* Room for the fixed bottom tab bar on every view, so no row ever
     hides behind it: the bar itself is ~62px plus the safe-area
     inset, so 72px plus the inset clears it with room to spare. */
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
body.live .card { border-radius: 20px; box-shadow: 0 1px 2px rgba(16,24,40,.05); }
/* Reference hierarchy: bold headings, large bold figures, smaller
   grey secondary labels. Headings are 800 (base was 600); figures
   were already 800 and stay so; secondary labels stay 12-13px grey
   (#6b7280) via .kicker / .muted.small. */
body.live h1, body.live h2, body.live h3 { letter-spacing: -0.02em; font-weight: 700; }
/* Header scrolls away; the tab bar is the persistent navigation now. */
body.live #liveTopbar { position: relative; background: #fff; border-bottom: 1px solid #ececf1; }
body.live #liveTopbar strong { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
/* Home-hero-fix (owner, Nov 4): profile icon was primary blue
   #2f6bff — wrong, owner wants MUCH LIGHTER, maybe not blue at
   all. It is now white with a dark icon and a light grey border,
   no blue fill, no glow. The hero sync button is covered by its
   own ancestor-independent rule below (see the specificity note
   there); the row rule that used to sit here lost to the pale
   #view-app .btn rule, which is why the sync button still looked
   pale on the owner's device despite the blue rule existing. */
body.live .profile-btn { background: #fff; border: 1px solid #e5e7eb; color: #0f172a; box-shadow: none; }
body.live .profile-menu { border-color: #ececf1; border-radius: 18px; box-shadow: 0 12px 32px rgba(16,24,40,.14); }
/* Bottom tab bar with icons, like the reference apps. */
body.live #view-app .app-nav { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 30;
  background: #fff; border-top: 1px solid #ececf1; border-bottom: 0; margin: 0;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom)); justify-content: space-around;
  /* Tab-bar hardening (owner bug report, Nov 3, ~10:37 PM: bar seen
     floating mid-list on iOS). Audit found no ancestor transform /
     filter / perspective / will-change and no JS that moves the nav,
     and body.live is static in HTML, so no static rule re-anchors it;
     the float matches iOS Safari leaving a fixed element painted at a
     stale scroll position. Promoting the nav itself to its own
     composited layer (a transform on the nav does NOT re-anchor the
     nav itself) keeps Safari repainting it at the viewport bottom. */
  -webkit-transform: translateZ(0); transform: translateZ(0); will-change: transform; }
body.live #view-app .app-nav-link { flex: 1 1 0; display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 4px 2px; font-size: 11px; font-weight: 600; color: #6b7280; border-bottom: 0; }
body.live #view-app .app-nav-link svg { width: 22px; height: 22px; display: block; }
body.live #view-app .app-nav-link.active { color: #2f6bff; border-bottom: 0; }
/* Bottom toast: in-app messages float above the tab bar instead of
   pushing cards around. Brand blue for success/info messages; red
   for errors (owner override, Nov 4 — blue did not read as an
   error). It sits well clear of the tab bar (owner: it was too
   close to the bottom).
   It auto-dismisses after 4 seconds; tapping it dismisses it sooner;
   switching tabs clears it. */
body.live .toast { position: fixed; left: 16px; right: 16px; bottom: 120px; z-index: 40;
  box-sizing: border-box; max-width: calc(100vw - 32px); overflow-wrap: break-word;
  background: #2f6bff; color: #fff; padding: 12px 14px; border-radius: 12px;
  font-size: 14px; line-height: 1.4; box-shadow: 0 8px 24px rgba(16,24,40,.25); }
/* Error-red-fix (owner, Nov 4): the error toast went off the screen
   a little on the sides. The fixed left/right 16px offsets only
   guarantee the margins if padding is inside the width, so the
   toast now declares box-sizing: border-box and
   max-width: calc(100vw - 32px) explicitly — it can never be wider
   than the viewport minus its 16px margins on both sides. */
/* Error-red-fix (owner, Nov 4): error pop-ups are RED, not blue —
   an owner override of the Nov 2 "no red toasts ever" rule, for
   genuine errors only. Success/info toasts stay brand blue #2f6bff;
   only showToast(..., true) gets the red background. The red is
   the LIGHTER red, the same as inline .result.error boxes and the
   soft status/badge reds: light red background #fef2f2, dark red
   text #dc2626, border #fecaca — NOT the old solid #dc2626 bar
   with white text, which was too heavy and dark. */
body.live .toast.error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; font-weight: 600; }
/* Buttons: light-grey secondary, blue primary, red destructive, quiet text.
   One gap system: rows use flex gap; standalone buttons use one margin. */
/* Button levels (Nov 4, pale option B): primary = strong #2f6bff
   fill, white text; secondary (base .btn) = pale light blue #bfdbfe
   fill, ink #0f172a text (option B: fill stays pale, wording goes
   ink — distinct from primary blue and from grey tertiary, and
   readable at phone size); tertiary = solid grey #e5e7eb fill, ink
   text; fourth (btn-mid) = solid ink #0f172a fill, white text. */
body.live #view-app .btn, body.live .btn { background: #bfdbfe; border: 0; color: #0f172a;
  border-radius: 14px; padding: 13px 18px; font-size: 15px; font-weight: 600; }
body.live #view-app .btn-primary, body.live .btn-primary { background: #2f6bff; color: #fff; }
body.live #view-app .btn-danger, body.live .btn-danger { background: #fef2f2; color: #dc2626; }
body.live #view-app .btn-quiet, body.live .btn-quiet { background: none; color: #6b7280; }
body.live #view-app .btn-small { padding: 8px 12px; font-size: 14px; border-radius: 10px; }
body.live #view-app .btn { margin: 0 10px 10px 0; }
/* Money inputs are sized to what is necessary (Nov 2 design rule):
   a 4–6 digit figure never needs the full card width. */
body.live input[type="number"] { max-width: 220px; }
/* Sort row: the native select keeps the secondary (light-blue)
   treatment; the direction button beside it is grey tertiary, so
   the two adjacent controls never share a treatment (P2-F3, Nov 8,
   2026 — the button used to be a bare .btn, pale like the select).
   Same padding, font, radius — only the treatment differs. */
body.live #txSortField { background: #bfdbfe; border: 0; border-radius: 14px; padding: 13px 18px; font-size: 15px; font-weight: 600; color: #0f172a; }
body.live #view-app .card .btn + .btn { margin-left: 0; }
body.live #view-app .tx-detail .btn { margin-right: 10px; }
body.live .btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
/* Home-hero-stat-alignment (owner feedback, Nov 4, morning): the
   sync button used to sit in .hero-head beside the week kicker, high
   above the number — it crowded and truncated the kicker text and
   added card height. It now sits in its own number row, vertically
   centered against the big figure; the kicker row is full width and
   wraps freely. Button treatment, aria-label, handler, and the
   number's own tap target are unchanged, and the button is a sibling
   of the number target, never nested inside it. */
body.live .hero-head { display: flex; align-items: center; gap: 10px; }
body.live .hero-number-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
body.live .hero-number-row #weeklyAvailable { flex: 1; min-width: 0; }
body.live .hero-number-row .hero-sync-btn { margin: 0; width: 44px; height: 44px; min-width: 44px; padding: 0; font-size: 22px; line-height: 1; border-radius: 50%; }
/* Home-hero-fix (owner, Nov 4): the sync button still looked pale
   on the owner's device even though a blue rule existed. Why: the
   old rule was `body.live .hero-number-row .hero-sync-btn`
   (specificity 0,3,1), but the button also carried the plain `btn`
   class, so `body.live #view-app .btn` (specificity 1,2,1 — the
   #view-app ID) won and painted it pale #bfdbfe. The class-name
   tests only checked the blue rule existed, never the rendered
   colour. Fix, belt and braces: the button no longer carries the
   `btn` class (live.html), and this rule is ancestor-independent
   with ID-level specificity (1,2,1) placed AFTER the pale .btn
   rule, so it wins even if `btn` is ever re-added. */
body.live #view-app .hero-sync-btn { background: #2f6bff; color: #fff; border: 0; box-shadow: none; }
/* Design-questions (owner, Nov 5): when no weekly allowance is set
   yet, "Set Your Weekly Allowance" is the hero's only primary blue
   control — the sync button goes grey tertiary (same #e5e7eb / ink
   as .btn-tertiary) until an allowance is set, then returns to
   primary blue. Placed after the blue rule so it wins when the
   .sync-unset class is present. */
body.live #view-app .hero-sync-btn.sync-unset { background: #e5e7eb; color: #0f172a; border: 1px solid #e5e7eb; }
/* Excluded-decisions: the hero number is the Weekly breakdown target
   (the small stat card is gone). Only the number is tappable — the
   Sync button beside it is a separate control. */
body.live #weeklyAvailable[role="button"] { cursor: pointer; }
/* R2: deletion lives in a distinct danger area inside Settings. */
body.live .danger-area { border: 1px solid #fecaca; border-radius: 12px; padding: 12px; margin-top: 12px; }
body.live .btn-row .btn { margin: 0; }
/* Settings bank buttons (owner, Nov 4): the three long buttons took up
   too much space. The two shortened buttons now share one row on a
   phone width — no wrap, equal halves, compact padding, no wrap of
   the label text — and Automatic Sync is a switch on its own row
   below them, not a third button. P1-F1 (Nov 8, 2026): below 360px
   the two labels physically cannot share one row (240–280px inner
   vs ~308px needed), so the row stacks there — full-width buttons,
   no clipping. Above 360px the owner's no-wrap row is unchanged. */
body.live #section-bank .btn-row { flex-wrap: nowrap; }
body.live #section-bank .btn-row .btn { flex: 1 1 0; min-width: 0; padding: 13px 8px; white-space: nowrap; }
@media (max-width: 360px) {
  body.live #section-bank .btn-row { flex-wrap: wrap; }
  body.live #section-bank .btn-row .btn { flex: 1 1 100%; }
}
body.live .auto-sync-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
body.live .auto-sync-label { font-size: 15px; font-weight: 600; color: #0f172a; }
body.live .auto-sync-switch { flex: none; width: 52px; height: 30px; border: 0; border-radius: 999px; background: #e5e7eb; padding: 0; cursor: pointer; position: relative; transition: background 0.15s ease; }
body.live .auto-sync-switch .auto-sync-knob { position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.15s ease; }
body.live .auto-sync-switch[aria-checked="true"] { background: #2f6bff; }
body.live .auto-sync-switch[aria-checked="true"] .auto-sync-knob { transform: translateX(22px); }
body.live .auto-sync-switch:focus-visible { outline: 2px solid #2f6bff; outline-offset: 2px; }
body.live .auto-sync-switch:disabled { opacity: 0.6; cursor: default; }
/* Chips: grey pills, blue when active. */
body.live #view-app .tx-chip { background: #bfdbfe; color: #1e40af; padding: 9px 15px; font-weight: 600; }
body.live #view-app .tx-chip.active { background: #2f6bff; color: #fff; }
/* Hero + stats: big bold numbers, thin progress bar. */
body.live .hero .big { font-size: 42px; font-weight: 800; letter-spacing: -0.02em; }
body.live .kicker { color: #6b7280; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; }
body.live .num { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
body.live .hero-progress { height: 6px; background: #eef1f6; border-radius: 999px; overflow: hidden; margin: 12px 0 6px; }
body.live .hero-progress > div { height: 100%; background: #2f6bff; border-radius: 999px; width: 0%; }
body.live .fund-balance { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 4px; }
/* Transaction rows: icon square + merchant, like the reference lists. */
body.live .tx-line1 { display: flex; align-items: center; gap: 10px; }
body.live .tx-icon { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; background: #eef1f6;
  color: #0f172a; font-weight: 700; display: flex; align-items: center; justify-content: center; }
body.live .tx-line1 .tx-name { flex: 1; }
body.live #view-app #weekBreakdown { border-top: 1px solid #ececf1; }
body.live input, body.live select { border-radius: 12px; }
body.live #txFilters { margin-top: 10px; }
body.live #txFilters label { display: block; margin: 10px 0 4px; font-weight: 600; }
body.live #txFilters label select { display: block; width: 100%; margin-top: 4px; }

/* Home stats (owner, Nov 8, 2026, mockup:
   home-stacked-fund-charity.png): Charity ABOVE Extra Fund, stacked
   vertically, both full-width — one column, not two. The old two-column
   row plus the expanded card spanning both columns is what made the
   Extra Fund box wrap down below the small Charity card when tapped
   (the bug: Charity is first in the row so it looked in place, Extra
   Fund is second so it jumped). Stacked, each card expands downward
   in place and the other stays collapsed in its own spot. The
   Recent purchases buttons get breathing room from the last row. */
body.live #section-stats { grid-template-columns: minmax(0, 1fr); gap: 10px; }
body.live #section-stats .stat-card { padding: 14px 12px; min-width: 0; }
body.live #section-stats .kicker { font-size: 11px; }
body.live #section-stats .num { font-size: 24px; }
body.live #section-recent .btn-row { margin-top: 20px; }
body.live #section-week .btn-row { margin-bottom: 12px; }

/* New branding: message boxes are a light blue tint, not the old warm beige. */
body.live .result { background: #eef4ff; color: #0f172a; }
/* Feedback-bundle (owner, Nov 4): ALL genuine error messages are
   RED platform-wide, not blue. This rule restores red for inline
   .result.error boxes in the live theme, which the blue .result
   override above would otherwise wash out. Plain .result boxes
   (mixed success/info messages) stay blue — only messages marked
   .error, and error toasts, go red. */
body.live .result.error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* ===== S4 live-only additions (scoped under body.live / #view-app) ===== */
body.live #sheetOverlay .sheet p { white-space: pre-wrap; overflow-wrap: anywhere; }
body.live .hero-progress.over > div { background: #dc2626; }
body.live .pill.rev { background: #eef1f6; color: #475569; }
body.live .tx-icon-logo { padding: 0; overflow: hidden; background: #fff; }
body.live .tx-logo { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
body.live .bank-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #ececf1; }
body.live .bank-row:last-child { border-bottom: 0; }
body.live .bank-info { flex: 1; min-width: 0; }
body.live .bank-logo, body.live .bank-logo-tile { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px; background: #eef1f6; color: #0f172a; font-weight: 700; display: flex; align-items: center; justify-content: center; overflow: hidden; }
/* Bank icon top-alignment (owner, Nov 3, ~11:25 PM, Connected
   accounts screenshot): .bank-row centers its children, so the
   40px logo tile sat mid-block against a tall multi-account
   institution block. Only the logo tile inside .bank-row is
   pinned to the top, aligned with the institution name; the row's
   own alignment is unchanged, and transaction merchant tiles are
   untouched. */
body.live .bank-row .bank-logo, body.live .bank-row .bank-logo-tile { align-self: flex-start; }
/* Disconnect top-alignment (overnight audit C3, owner approved
   Nov 4, 2026): the Disconnect button is the same story — it
   floated mid-block against tall multi-account items, reading as
   if it acted on whichever account line sat beside it. Scoped to
   the danger button inside .bank-row only; the info column and
   the row's own alignment are untouched. */
body.live .bank-row .btn-danger { align-self: flex-start; }
body.live .bank-logo-img { width: 100%; height: 100%; object-fit: contain; }
/* Connected accounts, one row per account (owner, Nov 4, 2026):
   the account row is a mature card row, not a grouped institution
   block. Top-aligned (logo, info, actions) so the Disconnect reads
   as acting on THIS account; the account name is the bold title and
   the bank is a quiet meta line. The shared .bank-row base rule
   above is untouched (other lists and tests rely on it). */
body.live .bank-row.bank-acct-row { align-items: flex-start; padding: 16px 0; }
body.live .bank-acct-name { font-size: 16px; font-weight: 700; color: #0f172a; overflow-wrap: break-word; }
body.live .bank-acct-meta { font-size: 13px; color: #6b7280; margin-top: 2px; overflow-wrap: break-word; }
body.live .bank-acct-sub { font-size: 13px; color: #6b7280; margin-top: 2px; overflow-wrap: break-word; }
body.live .bank-acct-fail { font-size: 13px; color: #dc2626; font-weight: 600; margin-top: 2px; overflow-wrap: break-word; }
body.live .bank-acct-row .btn-quiet { padding: 2px 0; margin-top: 6px; font-size: 13px; }
body.live .bank-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: 0 0 auto; align-self: flex-start; }
body.live .sav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
body.live .sav-grid > div { min-width: 0; }
body.live .sav-grid .num { font-size: 20px; overflow-wrap: break-word; }
@media (max-width: 480px) {
  body.live .sav-grid { grid-template-columns: 1fr; }
}
body.live #csvPreview:empty { display: none; }
body.live .csv-row.csv-dupe { opacity: 0.55; }
body.live #weekHistoryList li { line-height: 1.5; }
body.live #bankAccountsList:empty { display: none; }
body.live .error { color: #dc2626; }

/* ===== Delta package (Nov 3, 2026) — live app only ===== */
/* C1: every button centers its content (icon + label on one line,
   centered as a group). Icon-only buttons keep their 44px target. */
body.live .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
body.live .btn svg { flex: 0 0 auto; }
body.live .btn-block { display: flex; width: 100%; }
/* C2: third-level action treatments, from the existing palette.
   Primary stays filled brand blue, secondary is now the pale light
   blue above, destructive stays red. Tertiary must include #view-app
   like primary: the plain body.live .btn-tertiary selector LOST to
   body.live #view-app .btn (id specificity) for background/border/
   color, so tertiary rendered as grey secondary with dark text and
   the v27 border fix never showed.
   UX-review-fix (Nov 3, 2026, owner screenshot 7:50 PM): the owner
   REJECTED both pale/hollow treatments — tertiary tint #eef4ff and
   outline white/blue border — as too pale and hollow. Tertiary
   therefore took deep #1d4ed8, unmistakably darker than primary,
   and the fourth treatment (class btn-mid, formerly btn-outline)
   took mid #3b82f6. The fourth treatment never sits next to
   primary in any row: in detail rows it sits between tertiary and
   secondary-pale, and in Funds actions it sits after tertiary.
   SUPERSEDED for tertiary only (owner, Nov 3, ~11:23 PM, Settings
   Bank card screenshot): Connect (primary #2f6bff), Sync
   (secondary pale #bfdbfe), and Enable automatic sync (tertiary
   deep #1d4ed8) were too close in color. Tertiary is now a neutral
   grey — solid light-grey fill #e5e7eb with ink #0f172a text, from
   the grey family already used for card borders — clearly not blue,
   clearly readable, solid fill, not an outline. Primary and secondary
   are unchanged. Both rules sit after the base .btn
   rule, with #view-app scope.
   AUDIT-FIXES-MORNING (owner, Nov 4, 2026, overnight audit A1):
   btn-mid moves from mid blue #3b82f6 to dark ink fill #0f172a
   with white text — distinct from primary blue, secondary pale
   blue, and tertiary grey. NOT grey: in Funds actions it would sit
   adjacent to the grey tertiary Ask button and create a true
   duplicate pair. */
body.live #view-app .btn-tertiary, body.live .btn-tertiary { background: #e5e7eb; color: #0f172a; border: 1px solid #e5e7eb; }
body.live #view-app .btn-mid, body.live .btn-mid { background: #0f172a; color: #fff; border: 1px solid #0f172a; }
/* C3: Funds balance cards side by side (stacked only on very narrow
   screens, so numbers never overflow at 320px). */
body.live .fund-balance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: stretch; }
body.live .fund-balance-panel { min-width: 0; display: flex; flex-direction: column; }
body.live .fund-balance-panel .fund-balance { overflow-wrap: break-word; }
/* Delta3 Funds parity: both panels share title -> figure -> secondary
   lines, so the figures sit at the same height; secondary lines wrap
   inside the panel (the Period line used to run to the panel edge). */
/* Button-card-fix: the face is Title + Amount only. Secondary lines
   live only in the tap sheet. The whole panel is a tap target, so it
   gets a pointer cursor, a blue chevron, and a visible focus ring. */
body.live .fund-balance-panel p.muted { overflow-wrap: anywhere; }
body.live .fund-balance-panel[role="button"] { cursor: pointer; }
body.live .fund-balance-panel[role="button"]:focus-visible { outline: 2px solid #2f6bff; outline-offset: 2px; }
body.live .fund-balance-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
body.live .fund-balance-head h2 { margin: 0; min-width: 0; }
/* UX-review-fix: the chevron sits at the BOTTOM-RIGHT of its panel
   and faces DOWN (⌄ = more below), not top-right facing right
   (› = go to another page). The panel is a flex column, so
   margin-top:auto pushes it to the bottom; the whole panel stays
   the tap target, with the same size and accessibility label. */
body.live .fund-balance-chevron { color: #2f6bff; font-weight: 700; font-size: 22px; line-height: 1; align-self: flex-end; margin-top: auto; padding-top: 8px; }

/* Funds expand-in-place (owner approval, Nov 6, 2026, mockup:
   funds-expand-in-place.png): the card expands where it is — no
   overlay, no dimmed page, no sheet. The expanded card gets the
   brand-blue border from the mockup. Home stat cards are stacked
   vertically (owner, Nov 8, 2026, mockup:
   home-stacked-fund-charity.png), so an expanded Home card already
   spans the full width and needs no grid-column span — the old
   span rule is gone, it only existed for the two-column row that
   made the Extra Fund box wrap below Charity. Rows are the
   same three labeled rows as before (Available / Pending / Total
   for the fund, Available / Given / Total for charity). Buttons
   wrap instead of squeezing: the mockup's middle button text
   overflows its button at phone width, so the row wraps to keep
   every label readable. Chevron flip is text (⌄/⌃) in live.js. */
body.live .fund-balance-panel.fund-expanded, body.live .stat-card.fund-expanded { border-color: #2f6bff; }
body.live .fund-expand { margin-top: 12px; border-top: 1px solid #e5e7eb; padding-top: 4px; }
body.live .fund-expand-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #e5e7eb; font-size: 15px; color: #0f172a; }
body.live .fund-expand-row strong { font-weight: 700; color: #0f172a; white-space: nowrap; }
body.live .fund-expand-period { margin: 8px 0 0; }
body.live .fund-expand-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
body.live .fund-expand-btns .btn { flex: 1 1 auto; white-space: nowrap; }
@media (max-width: 420px) {
  body.live .fund-balance-grid { grid-template-columns: 1fr; }
}
/* B2: Transactions heading row (Add top right) and search row
   (search box + ONE compact Filters button beside it). P1-F2 (Nov 8,
   2026): the row wraps at 320px — title + Filters + Add need ~264px
   against a 240px inner width, so without a wrap the row overflows. */
body.live .tx-head-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
body.live .tx-head-row h2 { margin-bottom: 0; }
/* Filters on the header line (owner, Nov 3, ~10:38 PM): Filters sits
   immediately left of the + button, grouped at the right so the
   title stays left. Filters is grey tertiary (btn-tertiary) and + keeps primary
   blue — adjacent buttons never share a color.
   The search input now spans its row alone. */
body.live .tx-head-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; flex: 0 0 auto; }
body.live .tx-head-actions #txFiltersToggle { flex: 0 0 auto; }
@media (max-width: 380px) {
  body.live .tx-head-row { gap: 6px; }
  body.live .tx-head-actions { gap: 6px; }
  body.live .tx-head-actions #txFiltersToggle { padding: 11px 10px; font-size: 14px; }
}
body.live .tx-search-row { display: flex; gap: 10px; align-items: flex-start; }
body.live .tx-search-row input { flex: 1 1 auto; min-width: 0; margin: 6px 0 14px; }
body.live .tx-search-row .btn { flex: 0 0 auto; }
/* B2: applied filters as small individually removable labels. */
body.live .tx-active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; }
body.live .tx-active-filters:empty { display: none; }
body.live .tx-active-filter { background: #eef4ff; color: #2f6bff; border: 0; border-radius: 8px;
  padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--sans); }
/* B2: filters bottom sheet (backdrop + card). .hidden still wins
   over display:flex because it is !important. */
body.live .tx-sheet { position: fixed; inset: 0; z-index: 50; background: rgba(15,23,42,.45);
  display: flex; align-items: flex-end; justify-content: center; padding: 16px; overflow-y: auto; overscroll-behavior: contain; }
body.live .tx-sheet-card { background: #fff; border-radius: 16px; padding: 22px; width: 100%; max-width: 480px;
  max-height: 85vh; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; box-shadow: 0 12px 40px rgba(16,24,40,.25); }
body.live .tx-sheet-card h3 { margin: 0 0 8px; }
body.live .tx-sheet-card h4 { margin: 16px 0 4px; font-size: 14px; font-weight: 600; }
body.live .tx-sheet-card label { display: block; margin: 10px 0 4px; font-weight: 600; }
body.live .tx-sheet-card label select { display: block; width: 100%; margin-top: 4px; }
body.live .tx-sheet-card .check-label { display: flex; align-items: flex-start; gap: 8px; }
body.live .tx-sheet-card .check-label input[type="checkbox"] { width: auto; margin: 2px 0 14px; accent-color: #2f6bff; }
/* Filters-compact (Nov 3, 2026) — the Filters sheet only, not the
   whole app, so other forms keep their roomier controls. Before:
   card padding 22px, group headings 16px above, labels 10px above,
   inputs 11px vertical padding at 16px font with 6px/14px margins
   (about a 43px-tall control box, about 63px per control row with
   margins). After: card padding 14px, headings 10px above, labels
   6px above, inputs/selects 10px vertical padding at 15px font with
   2px/6px margins — a 40px-tall control box (10 + 10 + 18 line-height
   + 2 border), still a full tap target at 390px, with about 48px per
   control row. Sheet buttons compact the same way (13px → 10px
   vertical padding). Pairs stay side-by-side; Escape/focus-trap
   behaviour is untouched. */
body.live .tx-sheet-card { padding: 14px; }
body.live .tx-sheet-card h3 { margin: 0 0 4px; }
body.live .tx-sheet-card h4 { margin: 10px 0 2px; font-size: 13px; }
body.live .tx-sheet-card label { margin: 6px 0 2px; }
body.live .tx-sheet-card input, body.live .tx-sheet-card select { padding: 10px; margin: 2px 0 6px; font-size: 15px; }
body.live .tx-sheet-card .check-label input[type="checkbox"] { margin: 2px 0 6px; }
body.live .tx-sheet-card .btn { padding: 11px 14px; }
/* C3: activity disclosures (one per fund) and the collapsed Review area. */
body.live .activity-disclosure { margin-top: 14px; }
body.live .activity-disclosure summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
/* B3: the Home sync icon spins while a sync runs. */
@keyframes delta-spin { to { transform: rotate(360deg); } }
body.live .hero-sync-btn.syncing svg { animation: delta-spin 1s linear infinite; }

/* ===== UX audit fixes (Nov 3, 2026) — live app only ===== */
/* Audit 05: CSS chevron on transaction rows; it rotates when the
   row's detail opens (the .open class is toggled with the detail). */
body.live .tx-chevron { flex: 0 0 auto; width: 9px; height: 9px; border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-left: 2px; }
body.live .tx-head.open .tx-chevron { transform: rotate(45deg); }
/* Owner screenshot: closed weeks as scannable blocks — a heading
   plus one labeled row per figure — instead of a run-on sentence. */
body.live .week-block { padding: 14px 0; }
body.live .week-metrics { display: grid; gap: 4px; margin-top: 8px; }
body.live .week-metrics > div { display: flex; justify-content: space-between; gap: 12px; }
body.live .week-metrics > div > span:first-child { color: #6b7280; }
body.live .week-metrics > div > span:last-child { font-weight: 600; white-space: nowrap; }
/* Owner screenshot: profile menu as a proper menu card — header with
   email + role pill, menu rows with separation, Sign out in red.
   Width is capped to the viewport so it never runs off phone
   screens; ids and handlers are unchanged. */
body.live .profile-menu { width: min(280px, calc(100vw - 32px)); padding: 0; overflow: hidden; }
body.live .profile-menu-head { padding: 16px 16px 12px; border-bottom: 1px solid #ececf1; }
body.live .profile-menu-head p { margin: 4px 0; }
body.live .profile-email { font-size: 14px; overflow-wrap: anywhere; }
body.live .role-pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 10px;
  border-radius: 8px; background: #eef4ff; color: #2f6bff; text-transform: capitalize; }
body.live .profile-menu-rows { padding: 8px; }
body.live .profile-menu-row { display: block; width: 100%; text-align: left; background: none; border: 0;
  border-radius: 10px; padding: 12px; font-size: 15px; font-weight: 600; color: #0f172a;
  cursor: pointer; font-family: var(--sans); }
body.live .profile-menu-row:active { background: #f2f4f7; }
body.live .profile-menu-row-danger { color: #dc2626; }
/* Date-overlap bug (owner screenshot): side-by-side field rows stack
   at phone widths instead of colliding. The History From/To row
   (.form-row-2) and the manual-add triple (.form-row-3) both stack
   at 520px and below; every other side-by-side row was checked and
   already wraps or stacks (btn-row wraps, fund-balance-grid and
   sav-grid stack, tx-search-row input shrinks with min-width: 0). */
@media (max-width: 520px) {
  .form-row-2 { grid-template-columns: 1fr; }
  #section-manual .form-row-3 { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
}

/* Popup-padding-labels-fix (owner, Nov 4): the History From/To date
   pair stays side by side at every width — a date is short with a
   day picker, so full-width stacked fields waste the card. This
   ID-scoped rule outranks the ≤520px .form-row-2 stacking rule
   above. */
/* Popup-padding-labels-fix (owner, Nov 4): with the Email h3 and
   explainer deleted from #section-profile, the Email label sits
   directly under the Save name button; this margin keeps it from
   looking cramped. Email stays on the same card, not a new one.
   Same 20px section spacing above the Password h3, which sits
   directly under the Save email button — Name → Email → Password
   blocks evenly spaced within the one Profile card. The "at least
   8 characters" note itself moved out of this card entirely: the
   change-password sheet already states the requirement where the
   new password is entered, so it is not duplicated here. */
/* Feedback-bundle (owner, Nov 4): Past weeks From/To were not the
   same shape and ran into each other on phone. iOS Safari date
   inputs have a wide intrinsic width that ignores min-width: 0
   at phone card widths, so the two tracks overflowed into each
   other. Both fields now share one explicit rule (same padding,
   font, height, border, width: 100%, min-width: 0, labels as
   block grid items with overflow hidden so a track can never
   paint over its neighbour), with a 12px gap. At 390px each field
   is ~155px — a full tap target. At 320px two date inputs cannot
   fit side by side at any readable size, so they stack there
   (this intentionally supersedes the earlier "side by side at
   every width" rule — equal and non-overlapping wins). Real-phone
   proving at 320px and 390px is still owed. */
#section-history-filter .form-row-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
#section-history-filter .form-row-2 label { display: block; width: 100%; min-width: 0; overflow: hidden; box-sizing: border-box; }
#section-history-filter .form-row-2 input { width: 100%; min-width: 0; box-sizing: border-box; border: 1px solid #e5e7eb; background: #fff; padding: 10px 8px; font-size: 15px; margin: 6px 0 0; }
@media (max-width: 360px) {
  #section-history-filter .form-row-2 { grid-template-columns: 1fr; }
}
#section-profile .profile-email-label { display: block; margin-top: 20px; }
/* Header-back-swipe (owner, Nov 4): Password must be the SAME SIZE
   as Name and Email in the Profile card — it was an h3 (~17px bold)
   next to 14px/600 labels. Matched exactly to the label size. */
#section-profile h3 { font-size: 14px; font-weight: 600; margin-top: 20px; }

/* ===== Delta3 additions ===== */
/* Loading screen: on-brand S-mark treatment + app name, stable until
   boot() replaces it directly with auth, household, or app. A thin
   brand-blue ring turns slowly around a gently pulsing S — calm and
   classy, never flashy. */
/* Loading-indicators (owner, Nov 3, 10:01 PM): the old dots, dashes,
   "Loading…" text and plain spinner are gone from the loading
   surfaces. Figures and recent rows load behind brand-palette
   skeleton shimmer bars, sized like the content they stand in for,
   so nothing jumps when the real number arrives. */
/* Feedback-bundle (owner, Nov 4): the loading view fills the
   screen, not a card floating in white space. The header stays
   (it is app chrome); the section fills the rest of the viewport,
   with no card border, shadow, or surrounding gap, and the footer
   is hidden while loading (both the .is-loading body class set by
   show() and the :has fallback, so the footer never shows on the
   first paint before JS runs either). */
body.live .loading-screen { text-align: center; padding: 24px 22px calc(24px + env(safe-area-inset-bottom));
  min-height: calc(100dvh - 60px); display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #fff; border: 0; border-radius: 0; box-shadow: none; margin: 0; }
body.live.is-loading main { padding: 0; }
body.live.is-loading footer.foot, body.live:has(#view-loading:not(.hidden)) footer.foot { display: none; }
body.live:has(#view-loading:not(.hidden)) main { padding: 0; }
body.live .loading-mark { font-family: var(--serif); font-size: 28px; font-weight: 700; margin-bottom: 20px; }
body.live .loading-brand { position: relative; width: 72px; height: 72px; margin: 0 auto 20px; }
body.live .loading-brand-ring { position: absolute; inset: 0; border: 2px solid #dbeafe; border-top-color: #2f6bff; border-radius: 50%; animation: loading-ring 2.4s linear infinite; }
@keyframes loading-ring { to { transform: rotate(360deg); } }
@keyframes loading-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.75; transform: scale(0.96); } }
/* Screen-reader-only text for skeleton loading states. */
.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; }
/* Skeleton shimmer: pale-blue bar with a slow brand-blue-tinted sweep. */
body.live .skel { display: inline-block; background: #dbeafe; border-radius: 8px; position: relative; overflow: hidden; vertical-align: middle; }
body.live .skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(47, 107, 255, 0.18), transparent); transform: translateX(-100%); animation: skel-sweep 2.2s ease-in-out infinite; }
@keyframes skel-sweep { 60%, 100% { transform: translateX(100%); } }
body.live .skel-figure { width: 180px; height: 40px; }
body.live .skel-num { width: 110px; height: 28px; }
body.live .skel-kicker { width: 90px; height: 12px; border-radius: 6px; }
body.live .skel-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
body.live .skel-tile { width: 36px; height: 36px; border-radius: 50%; flex: none; }
body.live .skel-lines { display: flex; flex-direction: column; gap: 8px; }
body.live .skel-line { width: 140px; height: 12px; }
body.live .skel-line.short { width: 88px; }
@media (prefers-reduced-motion: reduce) {
  body.live .skel::after, body.live .loading-brand-ring, body.live .loading-brand-logo { animation: none; }
}
/* Inline card header: subtitle sits on the same line as the heading
   (Add card), so the card gets smaller. Wraps gracefully on very
   narrow screens instead of colliding. */
body.live .card-head-inline { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
body.live .card-head-inline h2 { margin: 0; }
body.live .card-head-inline p { margin: 0; }
/* Transaction detail: labeled metric rows instead of dense run-on
   lines. Values wrap so long merchant/card text never overflows. */
body.live .tx-detail-rows { display: grid; gap: 6px; margin: 10px 0; }
body.live .tx-detail-rows > div { display: flex; justify-content: space-between; gap: 12px; }
body.live .tx-detail-rows > div > span:first-child { color: var(--muted); }
body.live .tx-detail-rows > div > span:last-child { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
/* CSV import: styled file control. The native input stays the real
   control (keyboard + screen-reader accessible) but is visually
   hidden; the label looks like a button and the file name shows
   beside it. */
body.live .csv-file-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
body.live .csv-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
body.live .csv-file-btn { cursor: pointer; margin: 0; }
body.live .csv-file-name { overflow-wrap: anywhere; min-width: 0; }
/* Home breakdown sheets: labeled metric rows above the message. */
body.live #sheetOverlay .sheet-rows { display: grid; gap: 8px; margin: 0 0 14px; }
body.live #sheetOverlay .sheet-rows > div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid #ececf1; padding-bottom: 8px; }
body.live #sheetOverlay .sheet-rows > div:last-child { border-bottom: 0; padding-bottom: 0; }
body.live #sheetOverlay .sheet-rows > div > span:first-child { color: var(--muted); }
body.live #sheetOverlay .sheet-rows > div > span:last-child { font-weight: 600; text-align: right; overflow-wrap: normal; }
/* Audit-merge fix (audit A finding 3): the old overflow-wrap:anywhere
   broke "$0.00" mid-number on phones. Normal wrapping still lets a
   long value (e.g. the Left row's over-budget note) wrap at spaces. */

/* ===== UX-review-fix (Nov 3, 2026) — live app only ===== */
/* Sign-in password visibility: input + Show/Hide button on one row,
   so the toggle never pushes the form down. */
body.live .password-row { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
body.live .password-row input { flex: 1 1 auto; min-width: 0; margin-top: 0; }
body.live .password-row .btn { flex: 0 0 auto; margin: 0; }
/* Auth-card-cleanup (owner, Nov 4, 2026): on the sign-in card ONLY,
   the password eye sits INSIDE the field, so Email and Password end
   up exactly the same width (base inputs are width:100%). Scoped to
   #view-auth: the change-password sheet keeps the generic flex row
   with its side-by-side Show/Hide text toggle above. */
#view-auth .password-row { position: relative; display: block; margin-top: 6px; }
/* Feedback-bundle (owner, Nov 4): the eye icon sat low because the
   password input kept its 14px bottom margin inside the relatively
   positioned row, so 50% of the row was below the input's centre.
   The input's bottom margin is now 0 in this row, so top: 50% +
   translateY(-50%) truly centres the icon on the input. */
#view-auth .password-row input { width: 100%; box-sizing: border-box; margin: 0; padding-right: 48px; }
#view-auth .password-row .auth-eye-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: none; border: 0; color: #6b7280; cursor: pointer; padding: 0; margin: 0; font: inherit; }
#view-auth .password-row .auth-eye-btn svg { display: block; }
#view-auth .password-row .auth-eye-btn:focus-visible { outline: 2px solid #2f6bff; outline-offset: 2px; border-radius: 8px; }
/* Auth-card-cleanup: Sign in + Create account share one row, equal
   width, nothing between them. The household naming step reuses the
   same two-button row (Back + Create household). */
#view-auth .auth-btn-row, #view-household .auth-btn-row { display: flex; gap: 10px; flex-wrap: nowrap; }
#view-auth .auth-btn-row .btn, #view-household .auth-btn-row .btn { flex: 1 1 0; min-width: 0; margin: 0; }
/* Error-red-fix (owner, Nov 4): the Sign In / Create Account row
   hugged the password field. The eye-centring fix set the password
   input's bottom margin to 0, removing the standard 14px field gap
   every other input gets. Restore that gap on the sign-in button
   row only (margin-top: 14px, the same standard gap). The
   create-account name step and the household name step share the
   .auth-btn-row class, but their preceding inputs keep the 14px
   bottom margin, so they already have this gap and are unchanged.
   This is a gap inside the card only — it does not stretch the
   card or move the buttons anywhere. */
#view-auth #authSigninPanel .auth-btn-row { margin-top: 14px; }
/* P2-F10 (Nov 8, 2026): at 320/360px the two equal-width buttons
   squeezed "Create Account" onto two lines (nowrap row, flex
   1 1 0). At 380px and below the row wraps and each button takes
   the full width, so both labels stay on one line. Above 380px
   the side-by-side row is unchanged. */
@media (max-width: 380px) {
  #view-auth .auth-btn-row, #view-household .auth-btn-row { flex-wrap: wrap; }
  #view-auth .auth-btn-row .btn, #view-household .auth-btn-row .btn { flex: 1 1 100%; }
}
/* Possible-duplicates comparison cards: vertical, NOT a horizontal
   bank-row. Merchant on its own bold line (full name, wraps at word
   boundaries, never mid-word), labeled Amount/Date/Card/Source rows
   like the transaction detail, Keep and Possible stacked on phone
   and side-by-side only at wide widths, buttons below the comparison,
   checkbox with its explanation below the buttons. */
body.live .dedupe-card { border: 1px solid #ececf1; border-radius: 12px; padding: 14px; margin: 12px 0; }
body.live .dedupe-match { font-weight: 600; color: #1d4ed8; margin: 0 0 10px; }
body.live .dedupe-pair { display: grid; gap: 12px; }
@media (min-width: 640px) {
  body.live .dedupe-pair { grid-template-columns: 1fr 1fr; }
}
body.live .dedupe-side { min-width: 0; }
body.live .dedupe-side h4 { margin: 0 0 8px; font-size: 15px; overflow-wrap: break-word; }
body.live .dedupe-side .dedupe-merchant { font-size: 16px; font-weight: 600; overflow-wrap: break-word; word-break: normal; margin: 0 0 8px; }
body.live .dedupe-rows { display: grid; gap: 6px; }
body.live .dedupe-rows > div { display: flex; justify-content: space-between; gap: 12px; }
body.live .dedupe-rows > div > span:first-child { color: #6b7280; }
body.live .dedupe-rows > div > span:last-child { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
body.live .dedupe-card .btn-row { margin-top: 12px; }
body.live .dedupe-alias { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: 13px; color: #6b7280; }
body.live .dedupe-alias input { width: auto; margin: 2px 0 0; accent-color: #2f6bff; }
/* UX-review-fix weight map (owner: too much bold looked cheap and
   heavy, Nov 3, 7:51 PM). Bold only where it earns it, one dominant
   element per card:
   - Figures (hero .big, stat .num, fund .fund-balance): 800, kept —
     the dominant element of their card.
   - Headings (h1/h2/h3, topbar): 800 → 700.
   - Buttons, nav labels, chips, filter labels, menu rows, pills:
     700 → 600.
   - Detail/sheet/week/dedupe values, merchant names, row amounts,
     bank names: 700/800 → 600 (names and amounts stand out by size
     and position, not by weight).
   - Body text, labels (600 already), secondary lines, kickers:
     unchanged (regular/600 small labels).
   Sizes, colors, and layout are unchanged by this pass. */
body.live .tx-line1 .tx-name { font-weight: 600; }
body.live .tx-line1 .tx-amount { font-weight: 600; }
body.live .bank-info strong { font-weight: 600; }
/* Weekly sheet calculation, behind one tap: label + amount rows
   only, never a paragraph. Collapsed by default. */
body.live .sheet-disclosure { margin: 0 0 14px; }
body.live .sheet-disclosure summary { cursor: pointer; font-weight: 600; padding: 8px 0; color: #2f6bff; }
body.live .sheet-disclosure .sheet-rows { margin: 8px 0 0; }
/* Numbers-only stat cards: a negative weekly figure is red, matching
   the hero big figure. Positive figures stay ink. */
body.live .stat-card .num.negative { color: var(--soft-red); }
/* Profile menu header (owner, Nov 3, ~11:20 PM): first name plus
   the role pill on one line, email below it in smaller muted
   (non-bold) text. */
body.live .profile-name { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
body.live .profile-email { font-size: 14px; overflow-wrap: anywhere; }
/* Filters sheet pairs (owner screenshot Nov 3, 7:55 PM): paired
   fields share one line at half width, so the sheet gets shorter and
   Apply/Reset/Cancel sit closer. At 390px each half is ~200px wide —
   still a full-size tap target, not a squeezed control. Single
   fields (Status, Month, Card selects) stay full-width. */
/* Popup-padding-labels-fix (owner, Nov 4): the Filters pair overlap
   was a grid-track bug, not a width bug — a bare 1fr track's minimum
   is its content minimum, and a date input's intrinsic width is
   wider than half a phone card, so the two tracks overflowed into
   each other. minmax(0, 1fr) lets both inputs shrink below their
   intrinsic width; the label/input min-width: 0 rules below do the
   rest. At 390px each half is ~160px, still a full tap target. */
body.live .tx-sheet-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
body.live .tx-sheet-pair label { min-width: 0; }
body.live .tx-sheet-pair input { width: 100%; box-sizing: border-box; min-width: 0; }
@media (max-width: 360px) {
  body.live .tx-sheet-pair { grid-template-columns: 1fr; }
}
/* Add popup (owner design Nov 3, 9:49 PM): the Transactions header's
   blue + button opens this overlay. Options are one full-width row
   each; a chosen form's existing section is moved into the slot, so
   it keeps its own card styling and handlers. */
body.live .add-plus-btn { width: 44px; height: 44px; border-radius: 50%; font-size: 26px; line-height: 1; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
body.live .add-popup-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); display: flex; align-items: flex-start; justify-content: center; padding: 24px 16px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; z-index: 60; }
body.live .add-popup-overlay.hidden { display: none; }
body.live .add-popup-card { width: 100%; max-width: 480px; }
body.live .add-options-list { display: grid; gap: 10px; margin: 12px 0; }
body.live .add-option-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; }
body.live .add-option-title { font-weight: 600; font-size: 16px; }
body.live #addPopupFormSlot.hidden { display: none; }

/* Type scale live (owner, Nov 3, 10:12 PM): the revised proposed Home
   scale from the onbudget-mockups artifact, Part 1, put live. This is
   typography, spacing, and color treatment ONLY — no figure, label,
   button-level, or behavior change. Spacing uses 8/16/24 steps; cards
   share one border and radius. Dashboard amounts are 34px and stay
   ink; transaction amounts are brand blue ONLY when positive.
   Negative amounts stay soft-green with their minus sign: the
   negative rule below is more specific than the blue rule AND comes
   after it, so it always wins — blue means money out, green plus a
   minus means money back. Hero/stat negative figures stay soft-red
   (over-budget warning), as before. */
body.live { font-size: 16px; }
/* Popup-padding-labels-fix (owner, Nov 4): the footer sentence sits
   right after main, so the card-to-footer gap was card margin 16px +
   main bottom padding 48px + footer top padding 16px = 80px of dead
   scroll. Main bottom padding is now 0, so the gap is 16 + 0 + 16 =
   32px of breathing room — no more, no less. Tab-bar clearance is
   NOT touched: body padding-bottom (72px + safe-area) below the
   footer still keeps the footer clear of the fixed tab bar. */
/* Feedback-bundle (owner, Nov 4): pages must fill the screen, on
   phone and tablet. main stretches to at least the viewport height
   (minus the header) as a flex column, and #view-app stretches with
   it. Cards keep their natural height — nothing is stretched. */
body.live main { padding: 24px 16px 0; min-height: calc(100dvh - 60px); display: flex; flex-direction: column; }
body.live #view-app { flex: 1 1 auto; display: flex; flex-direction: column; }
body.live #view-app > .card, body.live #view-app > .grid { width: 100%; }
/* Design-questions (owner, Nov 5): the footer sits directly under
   the last card (margin-top 16px), not pushed to the bottom of the
   viewport — on Home the old margin-top:auto left a large dead gap
   between the Recent card and the footer. Any remaining space is
   below the footer, above the tab bar, not in the middle of the
   page. Tab-bar clearance is NOT touched: body padding-bottom
   (72px + safe-area) below the footer still keeps the footer clear
   of the fixed tab bar. */
body.live footer.foot { margin-top: 16px; }
/* Feedback-bundle (owner, Nov 4): the sign-in card also fills the
   page, on phone and iPad — layout only, no flow/field/button
   change. The card stretches to fill main's height and its panel
   centres vertically inside it, instead of a small card at the
   top with dead space below. .hidden still wins via !important
   when the view is not shown. */
/* Final little things (owner, Nov 4): sign-in/up smart fill —
   logo on top, natural-height card, useful bottom line. The old
   stretch (card fills main, panel centred vertically) is gone: the
   card is now its natural height, the larger OnBudget logo sits
   above it, and a quiet tagline + read-only trust line sits below
   it, so the page is complete top to bottom without a stretched
   empty card or a giant padded container. Applies to sign-in and
   sign-up/household pages; Home is untouched. */
body.live #view-auth, body.live #view-household { flex: 0 0 auto; display: block; }
body.live .auth-brand { text-align: center; padding: 12px 0 20px; }
body.live .auth-brand-logo { width: 72px; height: 72px; border-radius: 50%; }
body.live .auth-brand-name { font-family: var(--serif); font-size: 28px; font-weight: 700; margin-top: 10px; }
body.live .auth-foot { text-align: center; color: #6b7280; font-size: 14px; line-height: 1.6; margin: 20px 0 8px; }
body.live .auth-foot span { font-size: 13px; }
body.live .card { border: 1px solid #e5e7eb; border-radius: 16px; padding: 24px; margin-bottom: 16px; box-shadow: 0 4px 16px rgba(15, 23, 42, .06); }
/* Home-hero-fix (owner, Nov 4): the hero's blue wash did not
   match the rest of the page. The hero is now white like every
   other card, with a coloured outline instead: a 1.5px brand-blue
   border, no blue shadow, so it has life without a coloured fill. */
body.live .hero { background: #fff; border: 1.5px solid #2f6bff; box-shadow: none; }
/* Feedback-bundle (owner, Nov 4): the "Or Join A Household" section
   sat too close/claustrophobic under the Create button. It now
   sits clearly lower, with breathing room below the button. */
#householdChoicePanel > label { margin-top: 28px; display: block; }
/* Feedback-bundle (owner, Nov 4): Forgot Password did not look
   tapable and its grey was boring. It is now an underlined brand-
   blue link with the button's full tap area. #60a5fa was considered
   (owner's suggested light blue) but is too light for link text on
   white, so #2f6bff is used for readability. */
#forgotPasswordBtn { color: #2f6bff !important; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
body.live .quiet-link { color: #2f6bff; font-weight: 600; font-size: 15px; text-decoration: none; }
/* Task 7 (owner, Nov 4): Funds More rows — quiet tap rows with a ›
   chevron, no ▶ triangles, no explainer sentences. Same pattern as
   the Home History row: title left, chevron right, divider between. */
body.live .more-list { display: grid; }
body.live .more-row { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid #e5e7eb; padding: 14px 4px; font-size: 16px; color: #0f172a; cursor: pointer; font-family: inherit; }
body.live .more-row:last-child { border-bottom: 0; }
/* Task 7: sheet action buttons (Extra Fund sheet) sit in the same
   button row as Close; Close is quiet when actions are present so
   it cannot be mistaken for a fourth money action. */
body.live .sheet-btns { display: flex; flex-wrap: wrap; gap: 10px; }
body.live .settings-head-line { display: flex; justify-content: space-between; align-items: center; }
body.live .settings-head-line h2 { margin: 0; }
/* Header-back-swipe (owner, Nov 4): page headers are NOT cards —
   a header-only card is an empty card. .page-head is a plain header
   row: no card background, border, or shadow, just the title, the
   Back link, and (Past Weeks / Activity) one subtext line. */
body.live .page-head { background: none; border: 0; box-shadow: none; border-radius: 0; padding: 4px 4px 12px; margin-bottom: 4px; }
body.live .page-head .muted.small { margin: 6px 0 0; }
/* Header-back-swipe (owner, Nov 4): every Back control is the same
   light brand blue, bold, so it reads as tapable — the old grey
   (#475569) looked dead. #60a5fa was considered but is ~2.5:1 on
   white, too light for 15px link text; #3b82f6 is the brand light
   blue that stays readable. Auth sign-up Backs and form Backs use
   the same class now (owner: Back should ALWAYS be light blue),
   which supersedes the old primary+tertiary pair for Back buttons
   only — other two-button rows are unchanged. */
body.live .back-link, body.live .settings-back-link { background: none; border: 0; color: #3b82f6; font-weight: 700; font-size: 15px; cursor: pointer; padding: 4px 0; font-family: inherit; text-align: left; }
body.live .money-input-row { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
body.live .money-prefix { font-size: 16px; font-weight: 600; color: #0f172a; }
body.live .temp-increase-heading { margin-top: 28px; }
/* Design-questions (owner, Nov 5, item A; refined Nov 6): the $ amount
   and Weeks fields are symmetrical — same label style, same control
   height (46px), same border, radius and padding, same 4px gap under
   the label, aligned baselines. The $ field is capped at 200px so the
   Weeks field sits CLOSE beside it instead of being pushed to the far
   edge of a stretched field, and Weeks is a narrow 64px — the biggest
   number that ever goes in it is 4, one digit plus the dropdown
   arrow. Clear space (12px) sits between the fields and the "Set new
   total" button, so the field never touches the button. */
body.live .temp-increase-row { display: flex; align-items: flex-start; gap: 12px; flex-wrap: nowrap; }
body.live .temp-increase-row .temp-field-label { flex: 0 1 200px; min-width: 0; font-size: 14px; font-weight: 600; color: #0f172a; }
body.live .temp-increase-row .temp-field-label.weeks-field { flex: 0 0 64px; }
body.live .temp-increase-row .money-input-row { margin: 4px 0 0; }
body.live .temp-increase-row .money-input-row input, body.live .temp-increase-row .weeks-field select { width: 100%; height: 46px; margin: 0; padding: 11px 12px; font-size: 16px; border: 1px solid #e5e7eb; border-radius: 12px; min-width: 0; box-sizing: border-box; }
body.live .temp-increase-row .weeks-field select { display: block; margin-top: 4px; padding: 11px 6px; }
body.live #addTempBtn { margin-top: 12px; }
/* Design-questions (owner, Nov 6): invite code inline in the Account
   & Household card — a big monospace code box, no sheet. Copy is
   primary blue, Share is grey tertiary. */
body.live .invite-code-box { margin: 8px 0 0; padding: 14px; border: 1.5px solid #2f6bff; border-radius: 12px; background: #fff; }
body.live .invite-code { display: block; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 28px; font-weight: 700; letter-spacing: 4px; color: #0f172a; text-align: center; overflow-wrap: break-word; }
body.live .invite-code-btns { margin-top: 12px; }
/* Design-questions (owner, Nov 5, item C): household members list
   in the Account & Household card — one row per member, name on the
   left, role pill on the right. */
body.live .member-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eef1f6; }
body.live .member-row:last-child { border-bottom: 0; }
body.live .member-name { flex: 1; min-width: 0; font-weight: 600; color: #0f172a; }
/* Admin remove-member (Nov 8, 2026): the Remove button sits at the
   right edge of the row, after the role pill. */
body.live .member-row .btn-small { margin-left: auto; flex: 0 0 auto; }
body.live .activity-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; }
body.live .activity-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; }
body.live .activity-dot-money { background: #2f6bff; }
body.live .activity-dot-charity { background: #2e6b3e; }
body.live .activity-dot-system { background: #94a3b8; }
body.live .tx-action-row { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid #e5e7eb; padding: 14px 4px; font-size: 15px; color: #0f172a; cursor: pointer; font-family: inherit; }
/* P1-NEW1 (Nov 8, 2026): a disabled action row (Charity on a pending
   charge, or for a member) is visible but dimmed and never fires. */
body.live .tx-action-row[disabled] { opacity: .55; cursor: default; }
body.live .grid .card { margin-bottom: 0; }
body.live .grid, body.live #section-stats { gap: 16px; }
body.live #section-stats .stat-card { padding: 16px; }
body.live .hero .big { font-size: 34px; color: #0f172a; }
body.live .num, body.live #section-stats .num, body.live .fund-balance { font-size: 34px; color: #0f172a; }
body.live .kicker, body.live #section-stats .kicker { font-size: 13px; }
body.live .tx-row { padding: 16px 0; }
body.live .hero-progress { margin: 16px 0 8px; }
body.live .tx-line1 .tx-amount { color: #2f6bff; }
body.live .tx-line1 .tx-amount.negative { color: #2e6b3e; }
body.live .hero .big.negative { color: var(--soft-red); }
body.live .stat-card .num.negative { color: var(--soft-red); }
body.live #section-recent .quiet-link { color: #2f6bff; }

/* Native-style-live (owner, Nov 4, 7:11 PM, mockup direction):
   combined Home hero, bottom sheets for all popups, Past weeks
   inside Transactions, quiet Trash link, Title Case / Today /
   Yesterday display, breathing room, and the original-picture
   logo as the header O and loading mark. UI only: no figure,
   week, fund, or charity math changes here. */
body.live #liveTopbar strong { display: inline-flex; align-items: center; gap: 0; }
body.live .wordmark-logo { width: 1em; height: 1em; flex: 0 0 auto; vertical-align: middle; }
body.live .loading-brand-logo { position: absolute; inset: 6px; width: 60px; height: 60px; border-radius: 50%; animation: loading-pulse 2.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { body.live .loading-brand-logo { animation: none; } }
body.live .hero { padding: 28px 24px 24px; }
body.live .hero .big { font-size: 44px; line-height: 1.1; }
body.live .hero-spent-line { display: flex; justify-content: space-between; gap: 12px; margin: 14px 0 4px; font-size: 15px; font-weight: 600; color: #0f172a; }
body.live .hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border-top: 1px solid #e5e7eb; margin-top: 14px; padding-top: 14px; }
body.live .hero-stat { display: flex; flex-direction: column; gap: 2px; }
body.live .hero-stat-label { font-size: 13px; color: #64748b; }
body.live .hero-stat-value { font-size: 18px; font-weight: 700; color: #0f172a; }
body.live .stat-card { position: relative; }
body.live .pot-chevron { position: absolute; right: 20px; bottom: 18px; font-size: 22px; font-weight: 700; color: #2f6bff; }
/* Home-stat-chevron fix (owner, Nov 8, 2026): the chevron is
   absolutely positioned at the card's bottom-right, so on an expanded
   card it overlapped the Total row's amount. The expanded detail gets
   bottom clearance, so the chevron sits in clear space below the
   rows instead of on top of them. Collapsed cards are untouched. */
body.live #section-stats .stat-card.fund-expanded .fund-expand { padding-bottom: 44px; }
body.live .trash-link-row { margin: 2px 0 10px; }
body.live .trash-link { font-size: 14px; font-weight: 600; color: #64748b; }
body.live .past-weeks-section { margin-top: 28px; border-top: 3px solid #e5e7eb; }
body.live .sheet-handle { display: block; width: 40px; height: 5px; border-radius: 3px; background: #e5e7eb; margin: 2px auto 12px; }
body.live .sheet-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
body.live .sheet-top h3 { flex: 1; text-align: center; margin: 0; font-family: var(--sans); }
body.live .sheet-top-cancel { background: none; border: 0; color: #2f6bff; font-size: 15px; font-weight: 600; padding: 6px 4px; cursor: pointer; white-space: nowrap; }
body.live .sheet-top-spacer { width: 56px; flex: 0 0 auto; }
#sheetOverlay { padding: 0; }
#sheetOverlay .sheet { border-radius: 20px 20px 0 0; padding: 12px 22px calc(24px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto; max-height: 88dvh; box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.18); }
#sheetOverlay .sheet-btns { justify-content: stretch; }
#sheetOverlay .sheet-btns .btn { flex: 1 1 auto; }
body.live .tx-sheet { padding: 0; }
body.live .tx-sheet-card { border-radius: 20px 20px 0 0; padding: 12px 22px calc(22px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto; max-height: 88dvh; box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.18); }
body.live .add-popup-overlay { align-items: flex-end; padding: 0; }
body.live .add-popup-card { border-radius: 20px 20px 0 0; padding: 12px 22px calc(22px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto; max-height: 88dvh; box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.18); }
body.live .tx-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.live .tx-amount { flex: 0 0 auto; }

/* Merged-audit A13: the Add popup is a true bottom sheet, matching
   the other sheets — solid background and its own scroll, with the
   handle on the card, not on the scrim. */
body.live .add-popup-card { background: #ffffff; overflow-y: auto; }
/* Merged-audit A11: narrow-screen fund amounts. The two fund cards
   stack sooner (below 420px, as before) and, at 390px and below,
   the big numbers shrink so a four- or five-digit balance with
   cents still fits its card; cents stay readable at 22px. */
@media (max-width: 390px) {
  body.live #section-stats .num, body.live .stat-card .num, body.live .fund-balance { font-size: 22px; white-space: nowrap; overflow-wrap: normal; }
  body.live .hero .big { font-size: 36px; white-space: nowrap; overflow-wrap: normal; }
}
/* P2-F13 (Nov 8, 2026): the old overflow-wrap:anywhere above broke
   five-digit amounts mid-number at 320px ("$12,345.67" split across
   lines). Numbers now never wrap mid-number; at 360px and below the
   hero figure also shrinks to 30px, because it shares its row with
   the sync button and 36px still does not fit a five-digit amount
   in the space left. */
@media (max-width: 360px) {
  body.live .hero .big { font-size: 30px; }
}
/* Merged-audit A12: negative Charity/Extra Fund pots turn red, like
   the hero. (.stat-card .num.negative already exists.) */
body.live .fund-balance.negative { color: var(--soft-red); }
body.live .stat-card .num.negative { color: var(--soft-red); }
/* Merged-audit A6: temporary highlight on a row reached from Home
   Recent, so the exact record is visible after the jump. */
body.live .tx-recent-highlight { outline: 2px solid #2f6bff; background: #eef4ff; }
/* Merged-audit B3: tappable closed-week blocks on Past Weeks,
   and the quiet page links at the top of Transactions. */
body.live .week-block-tappable { cursor: pointer; }
body.live .tx-page-links { display: flex; gap: 12px; margin: 0 0 8px; }
body.live .tx-page-links .quiet-link { background: none; border: none; color: #2f6bff; font-size: 14px; padding: 4px 0; cursor: pointer; }
/* Merged-audit B4: desktop-only "Add transaction" label next to +.
   Phone keeps + only; desktop shows a pill button with the label. */
body.live .add-label-desktop { display: none; }
@media (min-width: 768px) {
  body.live .add-plus-btn { width: auto; height: 44px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; font-size: 15px; }
  body.live .add-label-desktop { display: inline; }
}

/* Card standardization B5 (owner pick, Nov 4, 2026; mockup:
   card-standardization-mockup.html): same heading style, same
   chevron, same label-then-amount order on the amount cards.
   Heading: 17px, bold 700, sans, ink, 8px below. Amount: 34px
   bold (hero keeps 44px). Chevron: brand blue #2f6bff, 700,
   22px, line-height 1. No figure, math, flow, or destination
   change here — style/consistency only. Narrow-screen rules
   (hero 36px, pots/funds 22px at <=390px) are unchanged.
   Home-hero-fix (owner, Nov 4, later the same evening): the
   hero title chevron was removed entirely — it did nothing when
   tapped, so it did not belong there. Pot/fund chevrons remain. */
body.live .hero-title { font-family: var(--sans); font-size: 17px; font-weight: 700; color: #0f172a; letter-spacing: -0.02em; margin: 0 0 8px; }
body.live #section-stats .stat-card .kicker { font-family: var(--sans); font-size: 17px; font-weight: 700; color: #0f172a; letter-spacing: -0.02em; margin-bottom: 8px; }
body.live .pot-chevron { color: #2f6bff; font-weight: 700; font-size: 22px; line-height: 1; }
body.live .fund-balance-head h2 { font-family: var(--sans); font-size: 17px; font-weight: 700; color: #0f172a; letter-spacing: -0.02em; margin: 0 0 8px; }
