/* Hearth styles (static shell, Phase 2). Migrated from user-script/Styles.html — this file is now the source. */
  /* Hearth colour tokens — Bible §24 (exact). */
  :root {
    --bg-base: #0c0c12;
    --bg-surface: #13131e;
    --bg-elevated: #1a1a28;
    --bg-input: #1e1e2e;
    --bg-hover: #22223a;
    --border-subtle: #1e1e30;
    --border-default: #2a2a40;
    --border-strong: #3a3a58;
    --text-primary: #f0f0f8;
    --text-secondary: #a0a0c0;
    --text-tertiary: #6a6a88;
    --accent-primary: #7c6aff;          /* purple — brand, household, human moments */
    --accent-glow: rgba(124,106,255,0.18);
    --accent-warm: #e8834a;             /* amber — DESTRUCTIVE actions + error/status feedback (Bible §3). NB: outgoing
                                           MONEY moved to --accent-out (lavender trial, 2026-06-23) — amber kept here so
                                           Remove/destructive never collides with the purple primary. */
    --accent-out: #da82ff;              /* TRIAL (2026-06-23, human-directed) — outgoing money amounts. Calmer than the
                                           old amber, but COLLIDES with purple (brand/household/primary); revisit (maybe
                                           pink). See tone-and-language.md. Was amber #e8834a. */
    --accent-teal: #3ecfaa;             /* teal — income, positive, goals */
    --accent-red: #f06070;              /* red — genuine alerts ONLY */
    --accent-gold: #e8c547;             /* gold — milestones */
    /* S10 (D2 ratified 2026-07-03, plan analysis-consistency.md §5) — THREE new CHART-IDENTIFIER-ONLY hues, never
       semantic. They join teal/lavender(--accent-out)/gold as the ordered SIX WHO-compare-person / WHAT-compare-
       bucket colours (analysis.js idPalette()). Chosen by CIE76 Lab-space perceptual distance (script + swatch
       review, not eyeballed hex): each maximizes minimum ΔE from every existing token (teal/lavender/gold/purple/
       amber/red) and from each other, while excluding the blue/blue-violet hue band (~185-262°, the no-blue
       non-negotiable) and staying legible on the dark theme (contrast ratio ≥4.5 against --bg-base). Human
       taste-check pending at end review.
       ΔE(min) vs the 6 existing tokens: id4=67 · id5=40 · id6=45 (all comfortably >26, the "clearly different"
       threshold used in the search — see poc/verify-s10.mjs for the live re-check). */
    --accent-id4: #3ecc3e;              /* grass green — identifier only */
    --accent-id5: #c87eaf;              /* dusty rose/mauve — identifier only */
    --accent-id6: #a5998d;              /* warm taupe/greige (deliberate calm neutral 6th) — identifier only */
    --on-accent-primary: #ffffff;       /* derived: text on purple primary buttons */
    --on-accent-warm: #1a0f06;          /* derived: dark ink for text on amber buttons (not a semantic colour) */
    /* calendar "paper zones" (§31, Option 2): the PAST vs FUTURE half tones meeting at the "now" seam */
    --cal-zone-past: #191926;           /* PAST/today — a raised, lighter surface (ink; it happened) */
    --cal-zone-past-border: #2e2e46;
    --cal-zone-future: #0e0e16;         /* FUTURE — a sunken, darker surface (pencil; expected) */
    --cal-zone-empty-border: #16161f;   /* empty days recede — transparent bg + this faint border */
    --radius: 14px;
    --gap: 16px;
  }

  * { box-sizing: border-box; }
  /* lock the page to the viewport width: nothing may cause a horizontal PAGE scroll on a phone
     (the nav becomes its own scrollable strip below — the screen itself never pans sideways). */
  /* overflow-x: CLIP (not hidden) still blocks sideways scroll but does NOT create a scroll container, so
     position:sticky descendants (the Bulk live-ledger) keep working. */
  html, body { margin: 0; padding: 0; overflow-x: clip; max-width: 100%;
    /* a horizontal swipe is OURS (swipe between tabs on mobile) — don't let the browser hijack it as a
       back/forward navigation gesture (edge-swipe). Inner scrollers (nav strip, CSV columns) still scroll. */
    overscroll-behavior-x: none;
    /* RESERVE the vertical scrollbar's space permanently (Windows/classic scrollbars take ~15px). Without this the
       centred .app shifts sideways whenever a tab is tall enough to need a scrollbar vs not — and the per-switch
       re-render toggles it = a left/right FLICKER on every tab change (only visible once the frame stopped jumping).
       Overlay scrollbars (mobile) reserve nothing, so phones are unaffected. */
    scrollbar-gutter: stable; }
  body {
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: 'DM Sans', system-ui, sans-serif;
    font-weight: 400;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: env(safe-area-inset-bottom);
  }
  /* ONE fixed app FRAME at every tab (human-ratified: cap 1500, adaptive). It fills the window up to the cap,
     then centres so a big monitor/TV gets calm gutters instead of a sprawled app. The nav/header span this frame
     and never jump between tabs — only the CONTENT (.view) re-caps per screen. Never binds on a phone. */
  .app { width: min(100%, 1500px); margin: 0 auto; padding: 24px 20px 64px; }
  /* CONTENT width per screen, centred inside the steady frame. Forms read best as a calm narrow column; data
     screens use more (.app--wide); dense grids fill the frame (.app--bulk/.app--csv, below). This is the ONLY
     thing that changes between tabs — the frame above stays put. (conventions.md HYBRID rule, now frame-steady.) */
  .view { max-width: 680px; margin: 0 auto; }
  .app--wide .view { max-width: 1100px; }
  /* MOBILE swipe between tabs: new content glides in from the swiped-toward edge so the gesture feels native
     instead of snapping (the human's ask). transform + opacity only (compositor-cheap); the page's overflow-x:clip
     hides the brief off-screen slide so no horizontal scrollbar appears. A tab CLICK stays instant (no class added). */
  @keyframes hearthViewNext { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
  @keyframes hearthViewPrev { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
  .view--enter-next { animation: hearthViewNext 210ms cubic-bezier(0.22, 0.61, 0.36, 1); }
  .view--enter-prev { animation: hearthViewPrev 210ms cubic-bezier(0.22, 0.61, 0.36, 1); }
  @media (prefers-reduced-motion: reduce) { .view--enter-next, .view--enter-prev { animation: none; } }
  .app__header { display: flex; align-items: center; gap: 12px 16px; margin-bottom: 24px; flex-wrap: wrap; }
  .brand { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 28px; letter-spacing: -0.01em; margin: 0;
    color: var(--accent-primary); }   /* purple = brand colour (Bible §3) */

  /* header right cluster: active-context dropdown + nav */
  .app__headerright { display: flex; align-items: center; gap: 16px; margin-left: auto; flex-wrap: wrap; }
  .app__headerright .dropdown { width: auto; }
  .app__headerright .dropdown__trigger { padding: 8px 10px; font-size: 14px; }
  .app__headerright .dropdown__list { min-width: 180px; }
  .ctxslot { display: flex; align-items: center; gap: 8px; }
  .ctxslot__label { font-size: 12px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; }
  .nav { display: flex; gap: 4px; }
  .nav__btn {
    appearance: none; background: none; border: 1px solid transparent; cursor: pointer; white-space: nowrap;
    color: var(--text-secondary); font-family: inherit; font-size: 14px; padding: 6px 12px; border-radius: 8px;
  }
  .nav__btn:hover { color: var(--text-primary); background: var(--bg-hover); }
  .nav__btn--active { color: var(--text-primary); background: var(--bg-elevated); border-color: var(--border-default); }

  /* calm offline indicator (slim, neutral — not amber/red; this is information, not alarm) */
  .offlinebar {
    background: var(--bg-elevated); border: 1px solid var(--border-default); color: var(--text-secondary);
    border-radius: 10px; padding: 8px 12px; margin-bottom: var(--gap); font-size: 13px; text-align: center;
  }

  /* profiles — the 6-slot pool */
  .slot {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--bg-surface); border: 1px solid var(--border-subtle);
    border-radius: 10px; padding: 14px 16px; margin-bottom: 10px;
  }
  .slot--empty { border-style: dashed; border-color: var(--border-default); }
  .slot--confirm { border-color: var(--border-strong); background: var(--bg-elevated); flex-wrap: wrap; }
  .slot__name { font-size: 16px; font-weight: 500; }
  .slot__confirm { display: flex; flex-direction: column; gap: 2px; flex: 1 1 240px; }
  .slot__actions { display: flex; gap: 8px; align-items: center; }
  .slot__add { display: flex; gap: 8px; align-items: center; flex: 1; }
  .slot__add input { flex: 1; min-width: 0; }

  /* NB: ALL .btn--* modifiers live AFTER the base .btn (below) so they actually win — .btn--sm sat
     here (before .btn) and was silently overridden: every "small" button rendered FULL-SIZE. */

  /* "＋ Add someone" — reveals the next empty seat (progressive, not all 6 at once) */
  .addbtn {
    appearance: none; width: 100%; cursor: pointer;
    background: none; border: 1px dashed var(--border-default); color: var(--text-secondary);
    font-family: inherit; font-size: 14px; padding: 12px; border-radius: 10px; margin-bottom: 10px;
  }
  .addbtn:hover { color: var(--text-primary); background: var(--bg-hover); border-color: var(--border-strong); }

  /* row action icons — calm grey at rest, intent colour on hover (purple = neutral, amber = destructive) */
  .iconbtn {
    appearance: none; background: none; border: none; cursor: pointer;
    color: var(--text-tertiary); padding: 7px; border-radius: 8px; line-height: 0;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .iconbtn:hover { background: var(--bg-hover); color: var(--text-secondary); }
  .iconbtn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }
  .iconbtn:disabled { opacity: 0.5; cursor: default; }
  .iconbtn svg { display: block; }
  .iconbtn--edit:hover { color: var(--accent-primary); }   /* purple = neutral action */
  .iconbtn--danger:hover { color: var(--accent-warm); }    /* amber = destructive */
  .iconbtn--locked, .iconbtn--locked:hover { color: var(--accent-primary); } /* purple = a PIN is set (the intimate layer) */

  /* modal overlay (reusable) */
  .modal__overlay {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(6,6,12,0.66);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 32px 16px; overflow-y: auto;
  }
  .modal {
    width: 100%; max-width: 420px;
    background: var(--bg-surface); border: 1px solid var(--border-default);
    border-radius: var(--radius); box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  }
  .modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 0; }
  .modal__head h2 { margin: 0; }
  .modal__body { padding: 14px 18px 20px; }
  .modal__body .field { margin-bottom: 12px; }
  .modal__body > .btn { width: 100%; margin-top: 4px; }

  /* PIN flows */
  .pin-menu { display: flex; flex-direction: column; gap: 8px; }
  .pin-menu > .btn { width: 100%; }
  .pin-menu--row { flex-direction: row; flex-wrap: wrap; margin-top: 8px; }
  .pin-menu--row > .btn { width: auto; }
  .pin-recovery {
    text-align: center; font-size: 32px; letter-spacing: 0.18em;
    color: var(--accent-primary); background: var(--bg-elevated);
    border: 1px solid var(--border-default); border-radius: 10px; padding: 18px; margin: 6px 0;
  }
  .pin-or { text-align: center; color: var(--text-tertiary); font-size: 13px; margin: 16px 0 8px; }
  .admin-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 4px; }

  /* households */
  .hh-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .hh-card__head h2 { margin: 0 0 2px; }
  .hh-card__head p { margin: 0; }
  .split__row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
  .split__name { flex: 1; min-width: 0; color: var(--text-secondary); }
  .split__row input { width: 84px; }
  .split__pct { color: var(--text-tertiary); }
  /* per-category split overrides (Bible §6) */
  .hh-card__ov { margin-top: 4px; }
  .hh-card__customise { margin-top: 8px; padding: 0; }
  .hhcat { max-height: 52vh; overflow-y: auto; margin: 8px 0 4px; border: 1px solid var(--border-default); border-radius: 10px; }
  .hhcat__group { padding: 8px 12px 4px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-tertiary); background: var(--bg-elevated); position: sticky; top: 0; z-index: 1; }
  .hhcat-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--border-default); }
  .hhcat-row__name { flex: 1; min-width: 0; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hhcat-row__ctrl { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
  .hhcat-row__base { color: var(--text-tertiary); }
  .hhcat-row--on { background: var(--accent-glow); }
  .hhcat-mini { width: 54px; padding: 6px 8px; }
  .hhcat-mini__lbl { color: var(--text-tertiary); font-size: 13px; }
  /* PROPORTIONAL_INCOME notable-swing prompt (§6) */
  .hh-prop-swing { margin-top: 12px; padding: 12px; border: 1px solid var(--accent-primary); border-radius: 10px; background: var(--accent-glow); }
  .hh-prop-swing__msg { margin: 0 0 10px; color: var(--text-primary); }
  .hh-prop-swing__actions { display: flex; gap: 8px; flex-wrap: wrap; }
  /* pre-save income-split choice (in the create/edit modal): a selectable pair of pills, "use" pre-selected */
  .hh-prop-choice { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 2px; }
  .hh-prop-choice__opt { appearance: none; font-family: inherit; font-size: 14px; cursor: pointer;
    padding: 9px 14px; border-radius: 999px; border: 1px solid var(--border-default);
    background: var(--bg-elevated); color: var(--text-secondary); transition: background .12s, border-color .12s, color .12s; }
  .hh-prop-choice__opt:hover { color: var(--text-primary); background: var(--bg-hover); }
  .hh-prop-choice__opt.is-selected { background: var(--accent-primary); color: var(--on-accent-primary); border-color: var(--accent-primary); }
  @media (max-width: 480px) {
    .hhcat-row { flex-wrap: wrap; }
    .hhcat-row__name { flex: 1 0 100%; white-space: normal; }
  }
  .readonly { padding: 11px 12px; color: var(--text-primary); background: var(--bg-elevated);
    border: 1px solid var(--border-subtle); border-radius: 10px; }

  /* categories */
  .cat-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 16px; }
  .cat-tab { appearance: none; background: none; border: 1px solid var(--border-default); color: var(--text-secondary);
    font-family: inherit; font-size: 14px; padding: 8px 14px; border-radius: 999px; cursor: pointer; }
  .cat-tab:hover { color: var(--text-primary); background: var(--bg-hover); }
  .cat-tab--active { color: var(--on-accent-primary); background: var(--accent-primary); border-color: var(--accent-primary); }
  /* groups (headers) read larger; categories sit indented beneath them for a clear hierarchy */
  .cat-header__line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
  .cat-header__namewrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .cat-header__name { font-size: 20px; margin: 0; }
  .cat-lock { display: inline-flex; color: var(--accent-primary); }
  .cat-lock svg { display: block; }
  .cat-locked { display: flex; align-items: center; gap: 12px; padding: 8px 2px 2px; }
  .cat-locked p { margin: 0; flex: 1; }
  .cat-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 9px 2px 9px 14px; border-top: 1px solid var(--border-subtle); }
  .cat-row--edit { padding-left: 2px; }
  .cat-row--managed .slot__name { color: var(--text-secondary); }
  .cat-managed { gap: 8px; }
  .cat-managed__t { font-size: .82rem; }
  .cat-row .slot__add { flex: 1; }
  .cat-inline { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
  .cat-inline__err { font-size: 13px; }
  .cat-addrow { padding-top: 10px; }
  .cat-add { margin-top: 10px; margin-bottom: 0; }
  .cat-archived { margin-top: 8px; padding-top: 6px; }
  .cat-archived__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 2px; }
  .move-opt { margin-bottom: 16px; }
  .move-opt > .btn { width: 100%; }
  .move-opt p { margin: 6px 0 0; }

  /* change history */
  .history-link { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: var(--gap); }
  .history-filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: var(--gap); }
  .history-filters .field { margin-bottom: 0; flex: 1; min-width: 140px; }
  .history-row { padding: 11px 2px; border-top: 1px solid var(--border-subtle); }
  .history-row:first-child { border-top: none; }
  .history-row__desc { font-size: 15px; color: var(--text-primary); }
  .history-row__meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 3px; }
  .history-row__who { font-size: 13px; color: var(--text-secondary); }
  .history-row__when { font-size: 12px; color: var(--text-tertiary); }

  h2 { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 20px; margin: 0 0 4px; }
  .muted { color: var(--text-secondary); }
  .tertiary { color: var(--text-tertiary); font-size: 13px; }

  .card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: var(--gap);
  }

  .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
  .field > label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
  select, input {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    border-radius: 10px;
    padding: 11px 12px;
    font-family: inherit;
    font-size: 15px;
    width: 100%;
  }
  select:focus, input:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-glow); }
  /* number inputs: no ±spinner steppers (people type the amount; nudging by a cent is noise) */
  input[type="number"]::-webkit-outer-spin-button,
  input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

  /* searchable combobox (currency / country / time zone) */
  .combo { position: relative; }
  .combo__list {
    position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
    margin: 0; padding: 4px; list-style: none; max-height: 260px; overflow-y: auto;
    background: var(--bg-elevated); border: 1px solid var(--border-default);
    border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,0.45);
  }
  .combo__opt { padding: 9px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; color: var(--text-primary); }
  .combo__opt:hover, .combo__opt[aria-selected="true"] { background: var(--bg-hover); }
  .combo__empty { padding: 9px 10px; font-size: 13px; color: var(--text-tertiary); }
  /* THEMED scrollbar for the popup lists (the default Windows bar is bright white against the dark popup) */
  .combo__list, .lcat-box { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

  /* tag input (Phase 5): chips + autocomplete, looks like one text field; stores a comma-separated string */
  .taginput {
    position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    padding: 6px 8px; min-height: 44px; cursor: text;
    background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 10px;
  }
  .taginput:focus-within { border-color: var(--border-strong); }
  .taginput__chip {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 3px 3px 3px 10px; border-radius: 999px; font-size: 13px;
    background: var(--bg-elevated); border: 1px solid var(--border-default); color: var(--text-primary);
  }
  .taginput__chipx {
    appearance: none; background: none; border: 0; padding: 0; cursor: pointer;
    width: 18px; height: 18px; line-height: 1; font-size: 15px; border-radius: 999px;
    color: var(--text-tertiary); display: inline-flex; align-items: center; justify-content: center;
  }
  .taginput__chipx:hover { color: var(--accent-warm); background: var(--bg-hover); }
  .taginput__field {
    flex: 1 1 90px; min-width: 90px; border: 0; background: none; padding: 4px 2px; margin: 0;
    color: var(--text-primary); font-size: 14px; outline: none; box-shadow: none;
  }
  /* keyboard-highlighted suggestion (↑/↓ nav) — matches the combobox hover treatment */
  .taginput__opt--hi { background: var(--bg-hover); }

  /* tag chips shown on a ledger row (read-only) */
  .tx__tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
  .tx__tag { font-size: 11px; padding: 2px 9px; border-radius: 999px; background: var(--bg-elevated); border: 1px solid var(--border-subtle); color: var(--text-secondary); }
  .tx__tag::before { content: '#'; opacity: 0.5; }
  .combo__list::-webkit-scrollbar, .lcat-box::-webkit-scrollbar { width: 10px; }
  .combo__list::-webkit-scrollbar-track, .lcat-box::-webkit-scrollbar-track { background: transparent; }
  .combo__list::-webkit-scrollbar-thumb, .lcat-box::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid var(--bg-elevated); background-clip: content-box; }
  .combo__list::-webkit-scrollbar-thumb:hover, .lcat-box::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); background-clip: content-box; }

  /* app-native dropdown (short fixed lists) — reuses the combobox popup look (.combo__list / .combo__opt) */
  .dropdown { position: relative; }
  .dropdown__trigger {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    width: 100%; text-align: left; line-height: 1.4;
    background: var(--bg-input); color: var(--text-primary);
    border: 1px solid var(--border-default); border-radius: 10px;
    padding: 11px 12px; font-family: inherit; font-size: 15px; cursor: pointer;
    -webkit-appearance: none; appearance: none;
  }
  .dropdown__trigger:focus-visible { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-glow); }
  .dropdown--open .dropdown__trigger { border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-glow); }
  .dropdown__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dropdown__chevron { flex: none; display: flex; color: var(--text-tertiary); transition: transform 0.15s ease; }
  .dropdown--open .dropdown__chevron { transform: rotate(180deg); }
  .dropdown__opt--active { background: var(--bg-hover); }
  .dropdown__opt[aria-selected="true"] { font-weight: 600; }
  .dropdown__opt[aria-disabled="true"] { color: var(--text-tertiary); opacity: 0.5; cursor: not-allowed; }
  .dropdown__opt[aria-disabled="true"]:hover { background: transparent; }

  /* the ONE grouped category picker (single-select popup; same grouped look as the Ledger filter box) */
  .pick__placeholder { color: var(--text-tertiary); }
  /* typable trigger (click → the value is selected so you can type to filter) + a fully scrollable grouped popup
     (the popup inherits .combo__list's overflow-y:auto, so it scrolls through every category). */
  .catpick__box { max-height: 320px; }
  .catpick__input { width: 100%; box-sizing: border-box; padding-right: 38px; cursor: text; }
  /* the chevron is a real toggle target (pointer-events:auto) with a comfortable 36px hit area down the right
     edge, so tapping it while open closes the picker (you no longer have to click off the field to dismiss). */
  .catpick__chev { position: absolute; right: 0; top: 0; bottom: 0; width: 36px; display: flex; align-items: center; justify-content: center; pointer-events: auto; cursor: pointer; color: var(--text-tertiary); }
  .catpick.dropdown--open .catpick__chev { transform: rotate(180deg); }
  .catpick__h { cursor: default; }
  .catpick__h:hover { background: transparent; }
  .catpick__opt { justify-content: space-between; }
  .catpick__opt > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .catpick__opt--active { background: var(--bg-hover); }
  /* MULTI picker (the checkbox "selector box"): checkbox + label sit together (not space-between); headers are
     clickable select-all; flat lists (no header, e.g. merchants) aren't indented; a "Clear all" row sits on top. */
  .catpick--multi .catpick__opt { justify-content: flex-start; }
  .catpick--multi .catpick__opt > span:first-child { overflow: visible; text-overflow: clip; white-space: normal; }
  .catpick--multi .catpick__opt > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .catpick--multi .catpick__opt--flat { padding-left: 10px; }
  .catpick--multi .catpick__h { cursor: pointer; }
  .catpick--multi .catpick__h:hover { background: var(--bg-hover); }
  .catpick__clear { padding: 8px 10px; font-size: 12px; color: var(--text-secondary); cursor: pointer; border-bottom: 1px solid var(--border-subtle); }
  .catpick__clear:hover { background: var(--bg-hover); color: var(--accent-primary); }
  .catpick__check { flex: none; display: flex; color: var(--accent-primary); }

  /* themed date picker (replaces the OS-drawn <input type=date> popup) */
  .datepick__pop {
    position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; width: 272px; max-width: 86vw;
    background: var(--bg-elevated); border: 1px solid var(--border-default);
    border-radius: 12px; box-shadow: 0 10px 28px rgba(0,0,0,0.45); padding: 12px;
  }
  /* (horizontal placement is clamped inline by dateInput's positionPop — stays inside card + viewport) */
  .datepick__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
  .datepick__title { font-weight: 600; font-size: 14px; color: var(--text-primary); }
  .datepick__nav { display: flex; gap: 4px; }
  .datepick__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
  .datepick__wd { text-align: center; font-size: 11px; color: var(--text-tertiary); padding: 4px 0; }
  .datepick__day { appearance: none; border: none; background: none; color: var(--text-primary);
    font-family: inherit; font-size: 13px; padding: 7px 0; border-radius: 8px; cursor: pointer; text-align: center; }
  .datepick__day:hover { background: var(--bg-hover); }
  .datepick__day--out { color: var(--text-tertiary); opacity: 0.55; }
  .datepick__day--disabled { color: var(--text-tertiary); opacity: 0.28; cursor: default; }   /* out of min/max range */
  .datepick__day--disabled:hover { background: none; }
  .datepick__day--today { box-shadow: inset 0 0 0 1px var(--border-strong); }
  .datepick__day--active { background: var(--bg-hover); }
  .datepick__day--sel { background: var(--accent-primary); color: var(--on-accent-primary); font-weight: 600; }
  .datepick__day--sel:hover { background: var(--accent-primary); }
  .datepick__foot { display: flex; justify-content: space-between; margin-top: 8px; }
  /* typeable date field (opt-in): a borderless input + a calendar button, inside the trigger frame */
  .datepick__trigwrap { display: flex; align-items: center; padding: 0; }
  .datepick__trigwrap:focus-within { border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-glow); }
  .datepick__input { flex: 1; min-width: 0; border: none; background: none; box-shadow: none; outline: none;
    padding: 10px 12px; font-family: inherit; font-size: 14px; color: var(--text-primary); }
  .datepick__input:focus { border: none; box-shadow: none; outline: none; }
  .datepick__iconbtn { flex: none; background: none; border: none; color: var(--text-secondary); padding: 0 10px;
    cursor: pointer; display: flex; align-items: center; }
  .datepick__iconbtn:hover { color: var(--accent-primary); }
  .datepick__err { font-size: 12px; color: var(--accent-warm); margin-top: 5px; }   /* "that's not a date" feedback */

  .hint { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 6px; font-size: 12px; color: var(--text-tertiary); }
  .linkbtn { appearance: none; background: none; border: none; padding: 0; cursor: pointer;
    color: var(--accent-primary); font-family: inherit; font-size: 12px; }
  .linkbtn:hover { text-decoration: underline; }

  /* numbers / amounts always in mono — Bible §25 */
  .mono, .preview__value { font-family: 'DM Mono', ui-monospace, monospace; }

  .preview {
    display: flex; flex-wrap: wrap; gap: 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 10px; padding: 14px 16px; margin-top: 4px;
  }
  .preview__item { display: flex; flex-direction: column; gap: 2px; }
  .preview__label { font-size: 12px; color: var(--text-tertiary); }
  .preview__value { font-size: 16px; color: var(--text-primary); }
  .preview__value--amount { color: var(--accent-out); }   /* outgoing amount (lavender trial; was amber) */

  /* primary CTA = purple (brand/neutral actions: Save, Add, Continue). Bible §3. */
  .btn {
    appearance: none; border: none; cursor: pointer;
    background: var(--accent-primary); color: var(--on-accent-primary);
    font-family: 'DM Sans', sans-serif; font-weight: 600; font-size: 15px;
    padding: 12px 20px; border-radius: 10px;
    transition: filter .12s ease, transform .06s ease; /* tactile feedback on hover/press (app-wide) */
  }
  .btn:hover { filter: brightness(1.08); }
  .btn:active { filter: brightness(0.92); transform: translateY(1px); }
  .btn:disabled { opacity: 0.6; cursor: default; filter: none; transform: none; }
  /* ghost = a subtle, secondary action (Cancel, Use different…) — outlined, not a loud purple primary.
     MUST sit after the base .btn (same specificity, later source) so its transparent background wins. */
  .btn--ghost { background: none; border: 1px solid var(--border-default); color: var(--text-secondary); }
  .btn--ghost:hover { color: var(--text-primary); background: var(--bg-hover); filter: none; }
  .btn--ghost:active { background: var(--bg-hover); transform: translateY(1px); }
  /* amber variant = money-outgoing & destructive actions only (e.g. Remove). Bible §3. */
  .btn--warm { background: var(--accent-warm); color: var(--on-accent-warm); }
  /* small variant for row-level / secondary placements (MUST sit after .btn — see the NB above) */
  .btn--sm { padding: 8px 12px; font-size: 13px; }

  .toast { margin-top: 14px; font-size: 14px; min-height: 20px; }
  .toast--ok { color: var(--accent-teal); }
  .toast--err { color: var(--accent-red); }

  /* settings section: sub-nav (left sidebar on desktop) + content panel */
  .settings-section { display: flex; gap: var(--gap); align-items: flex-start; }
  /* desktop: a compact ICON RAIL — the icon carries the meaning, a small label sits beneath it, the full
     name is the tooltip. Same width on every sub-tab (stable frame) and ~125px narrower than a text sidebar,
     which the data-heavy panels (CSV import) reclaim. Collapses to a top text strip on phones (below). */
  .settings-subnav { display: flex; flex-direction: column; gap: 4px; flex: none; width: 78px; }
  .settings-navbtn {
    appearance: none; background: none; border: none; cursor: pointer;
    width: 100%; border-radius: 10px; font-family: inherit; color: var(--text-secondary);
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    padding: 10px 4px; text-align: center; font-size: 10.5px; line-height: 1.2;
  }
  .settings-navbtn__icon { display: flex; color: var(--text-tertiary); }
  .settings-navbtn__icon svg { width: 20px; height: 20px; }
  .settings-navbtn__lbl { display: block; }
  .settings-navbtn:hover { background: var(--bg-hover); color: var(--text-primary); }
  .settings-navbtn:hover .settings-navbtn__icon { color: var(--text-primary); }
  .settings-navbtn--active {
    background: var(--bg-surface); color: var(--accent-primary); font-weight: 600;
    box-shadow: inset 3px 0 0 var(--accent-primary);
  }
  .settings-navbtn--active .settings-navbtn__icon { color: var(--accent-primary); }
  .settings-navbtn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }
  .settings-panel { flex: 1; min-width: 0; }
  /* the global form caps its own content width (wide forms read worse) — the SECTION frame stays
     stable across sub-tabs; data sub-tabs (archive, change log, merchant rules) use the full panel */
  .settings-panel--narrow { max-width: 680px; }

  /* phone: the sidebar becomes a top tab-strip (a left rail won't fit ~390px) */
  @media (max-width: 640px) {
    .settings-section { flex-direction: column; }
    /* once stacked, the panel must FILL the column — without this it sizes to its max-content and a wide data
       panel (e.g. the CSV review tab-strip) blows past the viewport and clips on the right. width:100% +
       min-width:0 keeps it at the section width; its own wide children (the tabs) scroll within. */
    .settings-panel { width: 100%; min-width: 0; }
    .settings-subnav { flex-direction: row; flex-wrap: wrap; width: 100%; gap: 6px; margin-bottom: 4px; }
    /* phone: icon beside label in a row pill (the rail's column layout is desktop-only) */
    .settings-navbtn { width: auto; flex: 1; min-width: 96px; flex-direction: row; gap: 7px;
      padding: 9px 10px; font-size: 13px; border: 1px solid var(--border-default); }
    .settings-navbtn__icon svg { width: 17px; height: 17px; }
    .settings-navbtn--active { box-shadow: none; border-color: var(--accent-primary); background: var(--bg-elevated); }

    /* the top nav becomes a full-width, horizontally-SCROLLABLE strip (the TABS scroll, not the page).
       The header right-cluster drops below the brand and the context picker sits on its own row. */
    .app__headerright { margin-left: 0; width: 100%; gap: 12px; }
    .nav {
      width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px;
      -webkit-overflow-scrolling: touch;            /* momentum scroll on iOS */
      scrollbar-width: none; -ms-overflow-style: none; /* hide the scrollbar (Firefox/IE) */
    }
    .nav::-webkit-scrollbar { display: none; }       /* hide the scrollbar (WebKit) */
    .nav__btn { flex: 0 0 auto; }                    /* keep intrinsic width; let the strip scroll */
  }

  /* merchant rules */
  .merchant-add { margin-bottom: var(--gap); }
  .mrule { display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 2px; border-top: 1px solid var(--border-subtle); }
  .mrule:first-child { border-top: none; }
  .mrule__main { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; min-width: 0; flex: 1; }
  .mrule__pattern { font-size: 15px; color: var(--text-primary); word-break: break-word; }
  .mrule__arrow { color: var(--text-tertiary); flex: none; }
  .mrule__cat { font-size: 14px; color: var(--text-secondary); }
  .mrule__archived { font-size: 12px; color: var(--text-tertiary); font-style: italic; }
  .mrule__meta { display: flex; align-items: center; gap: 12px; flex: none; }

  /* confidence indicator — plain words + a 3-dot meter. Purple = neutral/brand (not amber/teal). */
  .conf { display: inline-flex; align-items: center; gap: 7px; }
  .conf__dots { display: inline-flex; gap: 3px; }
  .conf__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border-default); }
  .conf__dot--on { background: var(--accent-primary); }
  .conf__label { font-size: 12px; color: var(--text-tertiary); white-space: nowrap; }

  /* first responsive breakpoint — scoped to the merchant rows so a phone stacks them cleanly */
  @media (max-width: 540px) {
    .mrule { flex-direction: column; align-items: stretch; gap: 8px; }
    .mrule__meta { justify-content: space-between; }
  }

  /* ＋Add nav button — the daily core, emphasised (purple); solid pill when it's the active tab */
  .nav__btn--add { color: var(--accent-primary); border-color: var(--border-default); font-weight: 600; }
  .nav__btn--add:hover { background: var(--accent-glow); color: var(--accent-primary); }
  .nav__btn--add.nav__btn--active { background: var(--accent-primary); color: var(--on-accent-primary); border-color: var(--accent-primary); }

  /* quick manual entry */
  .entry-types { display: flex; gap: 8px; margin-bottom: 8px; }
  .entry-type { flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--border-default);
    background: none; color: var(--text-secondary); font-family: inherit; font-size: 15px; cursor: pointer; }
  .entry-type:hover { background: var(--bg-hover); }
  .entry-type--active { background: var(--accent-primary); color: var(--on-accent-primary); border-color: var(--accent-primary); }
  /* phone: 4 type pills can't fit one row (the long "Reimbursement" word overflows the card with no
     h-scroll) — wrap them to a 2×2 grid. Placed AFTER the base .entry-type so it wins the cascade. */
  @media (max-width: 640px) {
    .entry-types { flex-wrap: wrap; }
    .entry-type { flex: 1 1 calc(50% - 4px); }
  }
  .numpad__display { font-family: 'DM Mono', ui-monospace, monospace; font-size: 34px; text-align: right;
    padding: 12px 10px 6px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; }
  .numpad__display--in { color: var(--accent-teal); }
  .numpad__display--reimb { color: var(--accent-gold); }
  .numpad__display--neutral { color: var(--text-secondary); }   /* transfer = neutral movement, muted (§5.1) */
  /* FX (§9) — currency chip beside the amount + the live conversion preview */
  .entry-amountrow { display: flex; align-items: center; gap: 8px; }
  .entry-amountrow .numpad__display { flex: 1; min-width: 0; }
  .entry-ccychip { flex: 0 0 auto; padding: 6px 12px; border-radius: 20px; border: 1px solid var(--border-default);
    background: none; color: var(--text-secondary); font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
  .entry-ccychip:hover { background: var(--bg-hover); }
  .entry-ccychip--on { color: var(--accent-primary); border-color: var(--accent-primary); background: var(--accent-glow); }
  .entry-ccypick { margin: 6px 0 2px; }
  /* date chip (§22 past-data entry) — compact "Today ▾" pill on the LEFT of the amount row; mirrors .entry-ccychip */
  .entry-amountrow .entry-datechip { flex: 0 0 auto; }
  .entry-datechip .dropdown__trigger { width: auto; gap: 5px; padding: 6px 10px 6px 12px; border-radius: 20px;
    background: none; color: var(--text-secondary); font-size: 14px; font-weight: 600; }
  .entry-datechip .dropdown__trigger:hover { background: var(--bg-hover); }
  .entry-datechip .dropdown__chevron svg { width: 16px; height: 16px; }
  .entry-fx { margin: 2px 0 8px; padding: 8px 12px; border-radius: 10px; background: var(--bg-surface); }
  .entry-fx__line { font-size: 15px; color: var(--text-primary); }
  .entry-fx__note, .entry-fx__attr { font-size: 12px; margin-top: 3px; }
  .numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 6px; }
  .numpad__key { padding: 15px 0; font-size: 20px; font-family: 'DM Mono', ui-monospace, monospace;
    background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: 10px;
    color: var(--text-primary); cursor: pointer; }
  .numpad__key:hover { background: var(--bg-hover); }
  .numpad__key:active { transform: translateY(1px); }
  .numpad__key--back { color: var(--accent-warm); }
  .entry-suggest { display: inline-block; margin-top: 8px; font-size: 13px; font-family: inherit; }
  .entry-suggest--applied { background: none; border: none; padding: 0;
    color: var(--accent-teal); }   /* the chosen category MATCHES the suggestion — a calm confirmation (no action needed) */
  .entry-suggest--chip { appearance: none; cursor: pointer; padding: 6px 12px; border-radius: 16px;
    border: 1px solid var(--accent-primary); background: var(--accent-glow); color: var(--accent-primary);
    font-family: inherit; }
  .entry-suggest--chip:hover { background: var(--accent-primary); color: var(--on-accent-primary); }
  .entry-label { display: block; font-size: 13px; color: var(--text-secondary); margin: 14px 0 8px; }
  .cat-tiles { display: flex; flex-wrap: wrap; gap: 8px; }
  .cat-tile { padding: 9px 14px; border-radius: 20px; border: 1px solid var(--border-default);
    background: none; color: var(--text-secondary); font-family: inherit; font-size: 14px; cursor: pointer; }
  .cat-tile:hover { background: var(--bg-hover); }
  .cat-tile--active { background: var(--accent-primary); color: var(--on-accent-primary); border-color: var(--accent-primary); }
  .cat-tile--more { font-style: italic; }
  .entry-more { margin-top: 10px; }
  .entry-chosen { margin-top: 10px; font-size: 13px; color: var(--accent-primary); }
  .entry-hh { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-subtle); }
  .entry-hh__split { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px;
    font-size: 14px; color: var(--text-secondary); }
  .entry-hh__q { font-size: 13px; color: var(--text-secondary); margin: 14px 0 8px; }
  .entry-hh__btns { display: flex; flex-wrap: wrap; gap: 8px; }
  .entry-hh__hint { margin-top: 8px; font-size: 12px; color: var(--text-tertiary); }
  .entry-hh__override { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
  .entry-hh__field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 110px; }
  .entry-hh__field > label { font-size: 12px; color: var(--text-tertiary); }
  .entry-pill { appearance: none; cursor: pointer; padding: 9px 16px; border-radius: 20px;
    border: 1px solid var(--border-default); background: none; color: var(--text-secondary);
    font-family: inherit; font-size: 14px; }
  .entry-pill:hover { background: var(--bg-hover); }
  .entry-pill--active { background: var(--accent-primary); color: var(--on-accent-primary); border-color: var(--accent-primary); }
  .entry-pill--ghost { border-style: dashed; font-size: 13px; }
  .entry-log { width: 100%; margin-top: 16px; }
  /* reimbursement entry (5d·5): the linkable-expense candidate list + the over-ask */
  .reimb-cands { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
  .reimb-cand { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%;
    text-align: left; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border-default);
    background: none; color: var(--text-secondary); font-family: inherit; font-size: 14px; cursor: pointer; }
  .reimb-cand:hover { background: var(--bg-hover); }
  .reimb-cand__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .reimb-cand__t { color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .reimb-cand__m { font-size: 12px; color: var(--text-tertiary); }
  .reimb-cand__r { flex: 0 0 auto; font-size: 12px; color: var(--accent-gold); }
  /* shared reimbursement→expense finder: a category filter + working search above a scrollable list (no cap) */
  .reimb-finder { display: flex; flex-direction: column; gap: 8px; }
  .reimb-finder__controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
  .reimb-finder__controls > * { flex: 1 1 150px; min-width: 0; }
  .reimb-finder__search { font: inherit; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border-default);
    background: var(--bg-input); color: var(--text-primary); }
  .reimb-finder__search:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-glow); }
  /* locked-category chip: the refund's category is fixed (bulk/Ledger finish) — shown, not pickable */
  .reimb-finder__fixedcat { flex: 0 1 auto; display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 10px;
    background: rgba(124,106,255,.12); color: var(--text-primary); font-weight: 600; font-size: 0.92em;
    border: 1px solid var(--border-subtle); }
  .reimb-finder__hint { margin: 0; font-size: 0.85em; }
  .reimb-finder .reimb-cands { max-height: 300px; overflow-y: auto; }
  .entry-overask { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
  .entry-overask .entry-hh__btns { margin-top: 8px; }
  /* §28 pattern double-log nudge — calm awareness (purple-tinted), never amber; only at commit */
  .entry-patdup { margin-top: 14px; padding: 10px 12px; background: var(--accent-glow); border: 1px solid var(--border-default); border-radius: 10px; }
  .entry-patdup .entry-hh__btns { margin-top: 8px; }

  /* amortisation — "pay over time" (§4.12): the inline config on the expense form */
  .entry-amort { margin-top: 14px; padding: 12px 14px; border-radius: 12px;
    border: 1px solid var(--border-default); background: var(--bg-surface); }
  .entry-amort__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
  .entry-amort__title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
  .entry-amort__sub { font-size: 12px; color: var(--text-tertiary); }
  .entry-amort__close { margin-left: auto; }
  .entry-amort .entry-hh__btns { margin-top: 10px; }
  .entry-amort__preview { margin-top: 10px; font-size: 13px; color: var(--accent-primary); }
  /* compound selector beats the base .tx__note (which sets italic) regardless of source order */
  .tx__note.tx__note--amort { font-style: normal; color: var(--text-tertiary); }
  /* §8 pre-funded draw-down — gold = money previously set aside (tone-and-language.md) */
  .tx__note.tx__note--fund { font-style: normal; color: var(--accent-gold); }
  .txd__amort { margin-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

  /* pay-over-time plans surface */
  .plan { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 14px 2px; border-top: 1px solid var(--border-subtle); }
  .plan:first-child { border-top: none; }
  .plan--inactive { opacity: 0.7; }
  .plan__main { min-width: 0; flex: 1; }
  .plan__titlerow { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
  .plan__title { font-size: 15px; color: var(--text-primary); word-break: break-word; }
  .plan__shared { font-size: 12px; color: var(--accent-primary); }  /* a household plan seen in a personal view (your share) */
  .plan__sub { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 3px;
    font-size: 13px; color: var(--text-secondary); }
  .plan__type { color: var(--accent-primary); }
  .plan__prog { font-size: 12px; margin-top: 4px; }
  .plan__next { font-size: 12px; margin-top: 2px; }
  .plan__right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
  .plan__total { font-size: 15px; color: var(--text-primary); }
  .plan__status { font-size: 11px; padding: 2px 9px; border-radius: 20px; border: 1px solid var(--border-default); }
  .plan__status--active { color: var(--accent-teal); border-color: var(--accent-teal); }
  .plan__status--complete { color: var(--accent-primary); border-color: var(--accent-primary); }
  .plan__status--cancelled { color: var(--text-tertiary); }
  .plan__cancel { font-size: 12px; }
  .plan__confirm { flex-basis: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    flex-wrap: wrap; margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: var(--bg-surface); }
  .plan__confirmq { font-size: 13px; color: var(--text-secondary); }
  .plan__confirmbtns { display: flex; gap: 8px; flex: none; }

  /* reserves & goals surface (§8) — teal = kept/goals, gold = a milestone reached, purple = shared */
  .reserve { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 14px 2px; border-top: 1px solid var(--border-subtle); }
  .reserve:first-child { border-top: none; }
  .reserve--inactive { opacity: 0.72; }
  .reserve__main { min-width: 0; flex: 1; }
  .reserve__titlerow { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
  .reserve__title { font-size: 15px; color: var(--text-primary); word-break: break-word; }
  .reserve__kind { font-size: 11px; color: var(--accent-teal); border: 1px solid var(--accent-teal);
    border-radius: 20px; padding: 1px 8px; }
  .reserve__shared { font-size: 12px; color: var(--accent-primary); }
  .reserve__reached { font-size: 11px; color: var(--accent-gold); border: 1px solid var(--accent-gold);
    border-radius: 20px; padding: 1px 8px; }   /* a goal reaching 100% — gold milestone celebration (§3/§8) */
  .reserve__bar { position: relative; height: 7px; border-radius: 6px; background: var(--bg-surface); overflow: hidden;
    margin: 8px 0 5px; max-width: 320px; }
  .reserve__barfill { height: 100%; background: var(--accent-teal); border-radius: 6px; transition: width .25s ease; }
  .reserve__barfill--done { background: var(--accent-gold); }   /* target reached — gold (§3 milestone) */
  .reserve__bartick { position: absolute; top: 0; width: 2px; height: 100%; background: var(--bg-elevated); }
  .reserve__bartick--hit { background: var(--accent-gold); }    /* a 25/50/75% milestone reached */
  .reserve__prog { font-size: 13px; color: var(--text-secondary); }
  .reserve__people { font-size: 12px; margin-top: 4px; word-break: break-word; }
  .reserve__mine { font-size: 12px; color: var(--accent-primary); margin-top: 2px; }
  .reserve__drawn { font-size: 12px; margin-top: 2px; }
  .reserve__right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
  .reserve__status { font-size: 11px; padding: 2px 9px; border-radius: 20px; border: 1px solid var(--border-default); }
  .reserve__status--active { color: var(--accent-teal); border-color: var(--accent-teal); }
  .reserve__status--closed { color: var(--text-tertiary); }
  .reserve__status--released { color: var(--accent-primary); border-color: var(--accent-primary); }
  .reserve__give, .reserve__editbtn, .reserve__release, .reserve__archive { font-size: 12px; }
  .reserve__archive { color: var(--accent-warm); }   /* Remove = amber, destructive (Bible §3) */
  .reserve__form { flex-basis: 100%; margin-top: 8px; padding: 12px; border-radius: 10px; background: var(--bg-surface); }
  .reserve__formlabel { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
  .reserve__form input[type="number"] { width: 100%; }
  .reserve__who { font-size: 13px; color: var(--text-secondary); margin: 10px 0 6px; }
  .reserve__formbtns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
  .reserve__confirm { flex-basis: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    flex-wrap: wrap; margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: var(--bg-surface); }
  .reserve__confirmq { font-size: 13px; color: var(--text-secondary); }
  .reserve__confirmbtns { display: flex; gap: 8px; flex: none; }
  .reserve__confirm { flex-wrap: wrap; }
  /* min-width 100% (NOT max-width) — a flex item's max-width CLAMPS its flex base size, so a 62ch cap let the
     "full-width" line slip up beside the buttons on a wide strip instead of wrapping. min wins the clamp.
     Secondary (not tertiary) text — the explainers must be clearly readable (human review, 2026-07-15). */
  .reserve__relinfo { flex-basis: 100%; min-width: 100%; margin: 0; font-size: 12.5px; color: var(--text-secondary); }
  .reserve__howlink { display: block; margin-top: 8px; }
  .reserve__started { font-size: 12px; margin-top: 2px; }
  .reserve__starthelp { font-size: 12.5px; margin: -4px 0 12px; max-width: 52ch; }
  .reserve__unrelease { font-size: 12px; color: var(--accent-teal); }
  .reserve__howinfo { max-width: 62ch; margin: 6px 0 0; font-size: 13px; color: var(--text-secondary); }
  /* expanded list of a reserve's linked draw-down expenses (each jumps to its ledger row) */
  .reserve__draws { flex-basis: 100%; margin-top: 8px; padding: 4px 12px; border-radius: 10px; background: var(--bg-surface); }
  .reserve__draw { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border-subtle); }
  .reserve__draw:first-child { border-top: none; }
  .reserve__drawmain { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
  .reserve__drawt { font-size: 13px; color: var(--text-primary); word-break: break-word; }
  .reserve__drawm { font-size: 11px; }
  .reserve__drawamt { font-size: 13px; color: var(--text-secondary); flex: none; }
  .reserve__drawgo { font-size: 12px; flex: none; }
  /* money input with a base-currency prefix (the Target field) */
  .reserve__money { display: flex; align-items: center; gap: 4px; border: 1px solid var(--border-default);
    border-radius: 10px; padding: 0 10px; background: var(--bg-surface); }
  .reserve__money:focus-within { border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-glow); }
  .reserve__moneysym { flex: none; color: var(--text-secondary); font-size: 14px; }
  .reserve__money input { flex: 1; min-width: 0; border: none; background: none; box-shadow: none; outline: none; padding: 10px 0; }
  .reserve__money input:focus { border: none; box-shadow: none; outline: none; }

  /* ledger / transaction list */
  .tx { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 12px 2px; border-top: 1px solid var(--border-subtle); }
  .tx:first-child { border-top: none; }
  .tx--pending { opacity: 0.72; }
  .tx__main { min-width: 0; flex: 1; }
  .tx__title { font-size: 15px; color: var(--text-primary); word-break: break-word; }
  .tx__sub { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 3px; }
  .tx__cat { font-size: 13px; color: var(--text-secondary); }
  .tx__date { font-size: 12px; color: var(--text-tertiary); }
  .tx__pending { font-size: 12px; color: var(--accent-primary); }
  .tx__note { font-size: 13px; color: var(--text-secondary); font-style: italic; margin-top: 3px; word-break: break-word; }
  .tx__right { display: flex; align-items: center; gap: 8px; flex: none; }
  /* the actions slot is ALWAYS rendered at a fixed width (empty when a row has no actions) so the
     amounts sit in ONE aligned column whether or not a row is deletable (share rows aren't). */
  .tx__act { flex: none; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; }
  .tx__amt { font-size: 15px; }
  .tx__amt--out { color: var(--accent-out); }   /* outgoing money (lavender trial 2026-06-23; was amber §3) */
  .tx__amt--in { color: var(--accent-teal); }     /* income = teal */
  .tx__amt--reimb { color: var(--accent-gold); }  /* reimbursement = gold — money returned, distinct from income at a glance (§3 amendment, 5d·5 refine) */
  .tx__amt--neutral { color: var(--text-secondary); }  /* transfer/provision = neutral money movement, muted — neither spend nor income (§5.1/§8) */
  .tx__shared { font-size: 12px; color: var(--accent-primary); }   /* a household tx seen in a personal view (share) */
  .tx__fx { font-size: 12px; color: var(--text-tertiary); }        /* the original foreign amount beside the base (§9) */
  .tx__amt--pending { color: var(--text-tertiary); font-style: italic; }  /* a not-yet-converted foreign row */
  .txd__fxnote, .txd__fxattr { font-size: 12px; margin-top: 6px; }
  .settings-fieldnote { font-size: 12px; margin: -4px 0 10px; }  /* the base-currency change note sits under its field */
  /* global toast — a brief background-op failure message, shown app-wide (optimistic-write rollback, §20) */
  .hearth-toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 16px); z-index: 60;
    max-width: 90%; padding: 11px 16px; border-radius: 12px; font-size: 14px; pointer-events: none;
    background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-default);
    box-shadow: 0 8px 28px rgba(0,0,0,0.45); opacity: 0; visibility: hidden; transition: opacity .18s, transform .18s; }
  .hearth-toast--show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
  .hearth-toast--err { border-color: var(--accent-warm); color: var(--accent-warm); }
  /* S3: an actionable toast (e.g. "Comparison cleared — Undo") lays its message + one purple action button in a row
     and becomes pointer-interactive (the ordinary status toast stays pointer-events:none so it never blocks). */
  .hearth-toast { display: inline-flex; align-items: center; gap: 14px; }
  .hearth-toast--action { pointer-events: auto; }
  .hearth-toast__action { appearance: none; background: none; border: none; font-family: inherit; font-size: 14px;
    font-weight: 600; cursor: pointer; color: var(--accent-primary); padding: 2px 4px; border-radius: 8px; flex: none; }
  .hearth-toast__action:hover { text-decoration: underline; }
  .tx__owner { font-size: 12px; color: var(--accent-primary); }    /* whose income (a member's income in the household view) */

  /* ── Dashboard / financial summary (Phase 9a, §4) — width-aware data screen ───────────────────── */
  .dash-block { margin-bottom: 18px; }
  .dash-eranote, .dash-note { margin: 8px 2px; }
  .dash-empty { text-align: center; }
  /* 2b — this month's plans (reuses the .intent-track* row styles from the Intentions Track view) */
  .dash-plans__title { margin: 0 0 6px; font-size: 1rem; }
  .dash-plans__foot { display: flex; justify-content: flex-end; margin-top: 8px; }
  .dash-plans__link { color: var(--accent-primary); text-decoration: none; font-size: 0.92rem; cursor: pointer; }
  .dash-plans__link:hover { text-decoration: underline; }
  .dash-plans__empty { display: inline-block; margin-top: 2px; }
  /* headline tiles: Arrived · Went out · Kept rate — side by side, wrap on a phone */
  .dash-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); margin-bottom: var(--gap); }
  .dash-tile { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 16px 18px; }
  .dash-tile__label { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
  .dash-tile__value { font-size: 26px; font-weight: 500; line-height: 1.1; }
  .dash-tile__value--muted { color: var(--text-tertiary); }
  .dash-tile__sub { margin-top: 4px; }
  .dash-tile--in .dash-tile__value { color: var(--accent-teal); }
  .dash-tile--out .dash-tile__value { color: var(--accent-out); }
  /* month picker row */
  .dash-controls { margin-bottom: var(--gap); }
  /* a quiet "vs last month" delta under a tile — teal when favourable, muted otherwise (never alarming) */
  .dash-delta { margin-top: 5px; font-size: 12px; color: var(--text-tertiary); }
  .dash-delta--good { color: var(--accent-teal); }
  .dash-delta--soft { color: var(--text-secondary); }
  /* body: surplus structure | where it went — two columns on a wide screen, stacked on a phone */
  .dash-cols { display: grid; grid-template-columns: 1fr; gap: var(--gap); }
  .dash-card__title { font-size: 15px; margin: 0 0 12px; color: var(--text-primary); }
  /* the three-line surplus (Kept → − Set aside → Free to use) */
  .dash-surplus__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 0; }
  .dash-surplus__label { display: flex; flex-direction: column; gap: 1px; }
  .dash-surplus__hint { font-size: 12px; }
  .dash-surplus__amt { font-size: 18px; font-weight: 500; white-space: nowrap; }
  .dash-surplus__row--total .dash-surplus__label > span:first-child { font-weight: 600; }
  .dash-surplus__row--total .dash-surplus__amt { font-size: 22px; }
  .dash-surplus__rule { height: 1px; background: var(--border-default); margin: 6px 0; }
  .dash-surplus__named { margin: 2px 0 4px; }
  .dash-surplus__none { margin: 4px 0 0; }
  /* §8: release event line + pre-funded notes — gold-tinted calm lines (money returned / previously set aside) */
  .dash-surplus__released { margin: 6px 0 0; color: var(--accent-teal); }   /* released = savings in hand (human-directed 2026-07-15; was gold) */
  /* fund-story note colours (human-directed 2026-07-15, supersedes all-gold): PAID-FROM-FUND notes wear the
     outgoing colour (they describe spending); RELEASED notes wear teal (the money is savings in hand again).
     NB this is a deliberate per-surface deviation from "returned = gold" (Bible §3 amendment) for these NOTE
     LINES only — amounts/badges elsewhere (ledger fund badge, Sankey gold bands) keep gold. */
  .dash-funded, .ana-fundnote { color: var(--accent-out); opacity: 0.9; }
  .ana-relnote { color: var(--accent-teal); opacity: 0.9; }
  /* the kept-split one-liner is a HEADLINE in words (human: "make it really prominent") — primary text */
  .ana-keptsplit { color: var(--text-primary); font-size: 14px; }
  .dash-amt--pos { color: var(--accent-teal); }
  .dash-amt--neg { color: var(--accent-red); }       /* below the zero line — red is the only zero/below colour (§3) */
  .dash-amt--gold { color: var(--accent-gold); }      /* set aside / reserved (§3 gold) */
  /* where it went — a CALM ranked list (no heavy bars): name · % · amount. List ⇄ Groups toggle. */
  .dash-cats__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
  .dash-cats__head .dash-card__title { margin: 0; }
  .dash-seg { display: inline-flex; border: 1px solid var(--border-default); border-radius: 999px; padding: 2px; gap: 2px; }
  .dash-seg__btn { appearance: none; background: none; border: none; font-family: inherit; font-size: 12px; cursor: pointer;
    color: var(--text-secondary); padding: 4px 11px; border-radius: 999px; }
  .dash-seg__btn.is-on { background: var(--accent-primary); color: var(--on-accent-primary); }
  /* §4 fix #6: an honestly-disabled tab (e.g. the Table panel's Over-time at 1 month / on a #tag subject) must NOT
     read as a live, clickable control — dimmed + not-allowed cursor; its `title` (set in JS) carries the reason. */
  .dash-seg__btn:disabled { color: var(--text-tertiary); opacity: 0.5; cursor: not-allowed; }
  .dash-seg__btn:disabled:hover { background: none; }
  .dash-cat { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); }
  .dash-cat:last-child { border-bottom: none; }
  .dash-cat--sub { padding-left: 18px; }
  .dash-cat--sub .dash-cat__name { color: var(--text-secondary); }
  .dash-cat--toggle { cursor: pointer; }
  .dash-cat--toggle:hover .dash-cat__name { color: var(--text-primary); }
  .dash-cat__l { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
  .dash-cat__name { color: var(--text-primary); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dash-cat__chev { color: var(--text-tertiary); font-size: 12px; transition: transform .15s; display: inline-block; }
  .dash-cat__chev.is-open { transform: rotate(180deg); }
  .dash-cat__r { display: flex; align-items: baseline; gap: 12px; flex: none; }
  .dash-cat__pct { font-size: 12px; min-width: 30px; text-align: right; }
  .dash-cat__amt { color: var(--text-primary); }
  @media (min-width: 760px) {
    .dash-cols { grid-template-columns: 1fr 1fr; align-items: start; }
  }
  @media (max-width: 520px) {
    .dash-tiles { grid-template-columns: 1fr; }
    .dash-tile__value { font-size: 23px; }
  }

  /* ── Simple analysis — the four-tier Sankey (Phase 9a2, §15) ──────────────────────────────────── */
  .ana-tiles { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }   /* 4 or 5 (with the internal-transfers tile) across, wraps on narrow */
  /* internal transfers — listed CATEGORY BY CATEGORY (each its own total), never summed across categories */
  .ana-tile--xfer .dash-tile__label { margin-bottom: 7px; }
  .ana-xfer-list { display: flex; flex-direction: column; gap: 4px; }
  .ana-xfer-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; min-width: 0; }
  .ana-xfer-row__name { font-size: 13px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ana-xfer-row__amt { font-size: 15px; color: var(--text-secondary); flex: none; }   /* neutral — muted, not income/spend coloured */
  .ana-tile--kept .dash-tile__value, .ana-tile--rate .dash-tile__value { color: var(--accent-teal); }
  .ana-tile--neg .dash-tile__value { color: var(--accent-red); }
  .ana-card { overflow-x: auto; position: relative; }       /* the chart is wide — scroll it on a phone, never the page; relative = the expand button's containing block (S8) */
  /* Slice 2 — chart cards go DEEP BLACK (#08080d, human-approved) so the raised/gradient bars pop. Scoped with :has
     to cards that actually CONTAIN a chart svg — text cards (accordion, table, era table) keep the surface bg. */
  .ana-card:has(.ana-chart, .ana-donut, .ana-sankey) { background: #08080d; }
  /* Slice 2 — raised bars: soft lift + brighten on hover (the drop-shadow lives on the SVG bars group filter). */
  .ana-bar { transition: transform .12s ease, filter .12s ease; }
  .ana-bar--hi { transform: translateY(-3px); filter: brightness(1.18); }
  .ana-arc { transition: filter .12s ease, stroke-width .12s ease; }
  .ana-arc--hi { filter: brightness(1.15); }
  .ana-dlrow { border-radius: 7px; transition: background .12s ease; padding: 2px 4px; }
  .ana-dlrow--hi { background: var(--bg-hover); }
  .ana-sankey__wrap { position: relative; min-width: 720px; }
  .ana-sankey { display: block; width: 100%; height: auto; }
  .ana-sankey__labels { position: absolute; inset: 0; pointer-events: none; }
  .ana-lbl { position: absolute; transform: translateY(-50%); display: flex; flex-direction: column; line-height: 1.15;
    max-width: 40%; width: max-content;
    /* soft dark HALO (not a boxy pill — human-directed Round-6) so a label over a ribbon never dissolves into it */
    text-shadow: 0 1px 3px rgba(10, 10, 18, 0.9), 0 -1px 3px rgba(10, 10, 18, 0.9), 1px 0 3px rgba(10, 10, 18, 0.9), -1px 0 3px rgba(10, 10, 18, 0.9); }
  .ana-lbl__name { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ana-lbl__amt { font-size: 12px; color: var(--text-primary); }
  .ana-lbl--hdr, .ana-lbl--cat, .ana-lbl--goal { flex-direction: row; align-items: baseline; gap: 6px; }
  .ana-lbl__row { display: flex; align-items: baseline; gap: 6px; }                 /* name+amt line of a two-line label */
  .ana-lbl__sub { font-size: 10.5px; color: var(--accent-gold); opacity: .85; white-space: nowrap; }   /* "now holds …" */
  .ana-lbl--hassub { flex-direction: column; }
  .ana-lbl--gold .ana-lbl__name { color: var(--accent-gold); }                      /* Into {fund} / paid-from-funds */
  .ana-lbl--teal .ana-lbl__name { color: var(--accent-teal); }                      /* Free to use */
  /* the two mid TOTALS (Went out · Kept) sit LEFT of the middle bar, mirroring Income (Round-6 label layout) */
  .ana-lbl--mid { flex-direction: row; align-items: baseline; gap: 6px; justify-content: flex-end; text-align: right; transform: translate(-100%, -50%); }
  .ana-lbl--mid .ana-lbl__name { color: var(--text-primary); font-weight: 600; }
  /* the Kept LEGEND CARD (crowded stack → one card instead of leader spaghetti) */
  .ana-lgd { position: absolute; width: 250px; max-width: 46%; background: var(--bg-elevated); border: 1px solid var(--border-default);
    border-radius: 10px; padding: 8px 12px 10px; pointer-events: auto; }
  .ana-lgd__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--border-default); }
  .ana-lgd__hname { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
  .ana-lgd__hamt { font-size: 12.5px; color: var(--text-primary); }
  .ana-lgd__row { display: flex; align-items: baseline; gap: 8px; padding: 2.5px 0; }
  .ana-lgd__sw { width: 9px; height: 9px; border-radius: 2.5px; flex: 0 0 auto; align-self: center; }
  .ana-lgd__name { font-size: 12px; color: var(--text-secondary); flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ana-lgd__name--teal { color: var(--accent-teal); }
  .ana-lgd__amt { font-size: 12px; color: var(--text-primary); }
  .ana-lgd__sub { font-size: 10.5px; color: var(--accent-gold); opacity: .85; padding-left: 17px; margin-top: -2px; }
  .ana-lbl--hdr { pointer-events: auto; cursor: pointer; }
  .ana-lbl--hdr:hover .ana-lbl__name { color: var(--text-primary); }
  .ana-lbl--hdr .ana-lbl__amt, .ana-lbl--cat .ana-lbl__amt, .ana-lbl--goal .ana-lbl__amt { color: var(--text-secondary); }
  .ana-lbl--note .ana-lbl__name { color: var(--text-tertiary); font-size: 11px; font-style: italic; }
  .ana-lbl__chev { color: var(--text-tertiary); font-size: 11px; transition: transform .15s; }
  .ana-lbl__chev.is-open { transform: rotate(180deg); }
  .ana-lbl--warn .ana-lbl__name, .ana-lbl--warn .ana-lbl__amt { color: var(--accent-warm); }
  .ana-hnode { cursor: pointer; }
  .ana-hnode.is-open { stroke: var(--accent-out); stroke-width: 1.5; }
  .ana-mnode { cursor: pointer; }
  .ana-mnode:hover { stroke: var(--accent-teal); stroke-width: 1.5; }
  .ana-cnode { cursor: pointer; }                                /* a category with merchants — tap to drill in */
  .ana-cnode.is-open { stroke: var(--accent-out); stroke-width: 1.25; }
  .ana-lbl[role="button"] { cursor: pointer; }
  .ana-leader { stroke: var(--text-tertiary); stroke-width: 1; opacity: .4; }    /* connects a pushed-off label to its node */
  /* income-stream labels sit to the LEFT of the income bar (Method A), right-aligned toward it */
  .ana-lbl--inc { flex-direction: row; align-items: baseline; gap: 6px; justify-content: flex-end; text-align: right; transform: translate(-100%, -50%); }
  .ana-lbl--inc .ana-lbl__amt { color: var(--text-secondary); }
  .ana-lbl--inc.ana-lbl--indent { font-size: 11px; }
  .ana-lbl--inc.ana-lbl--indent .ana-lbl__name { color: var(--text-tertiary); }
  .ana-lbl--inc.ana-lbl--total .ana-lbl__name { color: var(--text-primary); }    /* the income TOTAL heads its streams */

  /* ── Analysis: the WHO / WHAT / WHEN axis bar — three dropdown menus (9a2 redesign) ─────────── */
  .ana-axisbar { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 10px 14px; margin-bottom: var(--gap); }
  .ana-menu { width: auto; }
  .ana-menu__trigger { width: auto; min-width: 140px; max-width: 340px; gap: 10px; padding: 9px 12px; }
  .ana-menu__lbl { flex: none; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-tertiary); }
  .ana-menu__val { flex: 1 1 auto; min-width: 0; font-size: 14px; color: var(--text-primary); }
  .ana-menu__pop { min-width: 240px; max-width: 360px; padding: 6px; }
  /* WHAT is the biggest list → give it most of the screen height so there's far less scrolling */
  .ana-menu--what .ana-menu__pop { max-height: min(72vh, 640px); }
  /* Slice 5 — the unified WHAT ▾ dropdown (Idea C): mode toggle + search + tabs + list.
     §4 fix #4: the popup was clamped to its trigger's width (300–400px) while the 5 tabs (Overall · Categories ·
     Merchants · Tags · Transfers) need ~390–410px on ONE line — and the strip's scrollbar was hidden (scrollbar-
     width:none + a webkit display:none rule), so an overflowing tab (Transfers) was reachable by NOTHING visible.
     Widened the popup and let the tab strip WRAP to a second line instead of hiding an invisible scroll affordance. */
  .ana-menu--what2 .ana-menu__pop { min-width: 420px; max-width: 460px; max-height: min(74vh, 660px); padding: 8px; }
  .ana-whatmode2 { width: 100%; margin-bottom: 8px; }
  .ana-whatmode2 .dash-seg__btn { flex: 1 1 0; }
  .ana-whatsearch { position: relative; margin-bottom: 8px; }
  .ana-whatsearch__input { width: 100%; box-sizing: border-box; }
  .ana-whatsearch__pop { position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 6; max-height: 240px; }
  .ana-whattabs { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-bottom: 6px; border-bottom: 1px solid var(--border-subtle); padding-bottom: 6px; }
  .ana-whattab { flex: 0 0 auto; appearance: none; background: transparent; border: 0; font-family: inherit; font-size: 13px; color: var(--text-tertiary); cursor: pointer; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
  .ana-whattab:hover { background: var(--bg-hover); color: var(--text-secondary); }
  .ana-whattab.is-on { background: var(--accent-glow); color: var(--accent-primary); font-weight: 600; }
  .ana-whatlist { max-height: 46vh; overflow-y: auto; }
  .ana-whatempty { padding: 12px 8px; font-size: 12.5px; }
  .ana-whatoverall, .ana-whatmerch { padding-left: 10px; }
  .lcat-cb--drill { visibility: hidden; }   /* alignment spacer where a checkbox would sit (single-mode drill rows) */
  .ana-breadcrumb--slim { margin-top: 4px; }
  .ana-by { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: 8px; }
  .ana-by--none { display: none; }
  .ana-by__lbl { text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
  .ana-by__seg { flex-wrap: wrap; }
  .ana-unit { display: inline-flex; align-items: center; gap: 6px; }
  .ana-unit__lbl { text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
  .ana-unit__seg { flex-wrap: wrap; }
  .ana-unitcaption { margin-top: 8px; font-size: 13px; }
  .ana-leaf__count { margin: 0 0 10px; font-size: 13px; }
  .ana-leaf__list { display: flex; flex-direction: column; }
  .ana-leaf__more { margin-top: 8px; }
  .ana-overlapnote { margin: 0 0 8px; font-size: 13px; }
  .ana-backcompare { margin-top: 6px; }
  .ana-backcompare__btn { font-size: 13px; padding: 2px 0; }
  .ana-compsums__item--tap { cursor: pointer; background: none; border: 1px solid transparent; border-radius: 8px; padding: 2px 6px; font: inherit; color: inherit; }
  .ana-compsums__item--tap:hover { border-color: var(--border-default); background: var(--bg-input); }
  /* transfers (neutral) view — a calm muted tile + note (transfers are neither spending nor income) */
  .ana-tile--xfer .dash-tile__value { color: var(--text-secondary); }
  .ana-xfernote { margin: -4px 0 10px; }
  /* mobile: the WHAT popup becomes a full-width bottom SHEET (not pinned under the trigger); the tab strip wraps.
     §4 fix #4 gotcha: `width:auto` does NOT clear a `min-width` set by another rule (they're different properties
     and both apply) — the desktop `.ana-menu--what2 .ana-menu__pop { min-width:420px }` rule was still flooring
     the sheet's width on a 390px phone (only 8px insets either side → an 8px overflow past the viewport edge).
     min-width:0 here lets left:8px/right:8px genuinely size the sheet to the viewport. */
  @media (max-width: 640px) {
    .ana-menu--what2 .ana-whatmenu-pop { position: fixed; left: 8px; right: 8px; bottom: 8px; top: auto; width: auto; min-width: 0; max-width: none; max-height: 78vh; }
    /* S8: the sheet scrolls internally without the page bleeding through underneath it (overscroll containment) */
    .ana-menu--what2 .ana-whatlist { max-height: 50vh; overscroll-behavior: contain; }
    /* S8: the floating Table (left) / Ledger (right) panel HANDLES sit at a fixed vertical-mid position and can
       occlude the sheet's (now-wrapping) tab strip at some scroll positions. Hide + inert them while the sheet is
       open; :has() reacts live to the popup's own `dropdown--open` class, so closing the sheet restores them with
       no extra JS/state to keep in sync. */
    body:has(.ana-menu--what2.dropdown--open) .ana-lpanel-handle,
    body:has(.ana-menu--what2.dropdown--open) .ana-tpanel-handle { opacity: 0; pointer-events: none; }
    /* S8: comfortable (~44px) tap targets inside the sheet — tabs and rows were sized for a mouse pointer */
    .ana-menu--what2 .ana-whattab { padding: 13px 14px; font-size: 13.5px; }
    .ana-menu--what2 .ana-cbrow, .ana-menu--what2 .lcat-crow, .ana-menu--what2 .lcat-hrow { padding-top: 13px; padding-bottom: 13px; }
  }
  /* an explicit "Clear all" reset row (distinct from the "Total life costs" comparison unit) */
  .ana-clearall { appearance: none; background: none; border: none; font-family: inherit; cursor: pointer;
    display: block; width: 100%; text-align: left; padding: 6px 10px; border-radius: 7px;
    font-size: 12.5px; color: var(--text-tertiary); }
  .ana-clearall:hover { background: var(--bg-hover); color: var(--accent-warm); }
  /* flat checkbox row (WHO entities + the "Total life costs" reset) — same look as the Ledger filter rows */
  .ana-cbrow { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text-secondary); }
  .ana-cbrow:hover { background: var(--bg-hover); }
  .ana-cbrow.lcat-crow--on { color: var(--text-primary); }
  .ana-opt__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ana-opt--off { color: var(--text-tertiary); opacity: 0.45; cursor: not-allowed; }
  .ana-opt--off:hover { background: transparent; }
  /* the Compare/Add toggle sticks to the popup's bottom edge so it stays reachable in a long category list */
  .ana-menu__foot { position: sticky; bottom: -6px; background: var(--bg-elevated); border-top: 1px solid var(--border-subtle);
    margin: 6px -6px -6px; padding: 8px 8px 8px; }
  .ana-menu__footrow { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
  .ana-menu__foot-lbl { font-size: 12px; color: var(--text-tertiary); }
  .ana-menu__footnote { font-size: 11px; margin-top: 6px; line-height: 1.35; }
  /* WHAT comparison buckets (A/B/C) */
  .ana-buckets { padding: 6px 2px 8px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 4px; }
  .ana-buckets__row { display: flex; flex-wrap: wrap; gap: 6px; }
  .ana-bucket { appearance: none; font-family: inherit; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 9px; border-radius: 999px; background: var(--bg-input); border: 1px solid var(--border-default); color: var(--text-secondary); max-width: 100%; }
  .ana-bucket.is-active { border-color: var(--accent-primary); box-shadow: 0 0 0 2px var(--accent-glow); color: var(--text-primary); }
  .ana-bucket__dot { width: 11px; height: 11px; border-radius: 3px; flex: none; }
  .ana-bucket__lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ana-bucket__x { flex: none; margin-left: 2px; font-size: 14px; line-height: 1; opacity: 0.7; }
  .ana-bucket__x:hover { opacity: 1; }
  .ana-bucket--add { font-size: 16px; line-height: 1; padding: 5px 11px; color: var(--text-tertiary); }
  .ana-bucket--total { cursor: default; }   /* the Total bucket isn't a fill target — it's "everything" */
  .ana-buckets__hint { font-size: 11px; margin-top: 6px; }
  /* a category's bucket mark: the bucket COLOUR square with its letter (replaces the plain checkbox in compare mode) */
  .ana-bcb { color: #15151f; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
  .ana-limitnote { margin: 0 0 12px; }
  /* WHEN: the dropdown holds the custom range; the quick presets sit beside it */
  .ana-whengroup { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
  .ana-when-presets { flex-wrap: wrap; }
  .ana-when-pop { overflow: visible; max-height: none; min-width: 280px; padding: 12px; }
  .ana-when-lbl { font-size: 12px; margin-bottom: 8px; }
  .ana-rangerow { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 8px; margin-top: 6px; }
  /* discrete-period comparison controls (the WHEN "Compare periods" mode) */
  .ana-whenmode { margin-bottom: 10px; }
  .ana-prow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
  .ana-prow__lbl { flex: 0 0 auto; }
  .ana-prow .dash-seg { flex-wrap: wrap; }
  .ana-prow .dropdown { min-width: 130px; }
  .ana-pyears { margin-top: 10px; }
  .ana-pyears > .ana-prow__lbl { display: block; margin-bottom: 4px; }
  .ana-pyears__box { display: flex; flex-wrap: wrap; gap: 2px 14px; max-height: 160px; overflow-y: auto; }
  .ana-pyears__box .ana-cbrow { flex: 0 0 auto; padding: 5px 4px; }
  .ana-customrange { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
  .ana-customrange__lbl { font-size: 12px; }
  .ana-shape { margin-left: 2px; }
  /* Slice 3 — the shape ICON STRIP (replaces the breakdown-shape dropdown; hover an icon for its name). */
  .ana-shaperow { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .ana-shapestrip { display: inline-flex; gap: 3px; background: var(--bg-input); border: 1px solid var(--border-default);
    border-radius: 12px; padding: 4px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .ana-shapestrip::-webkit-scrollbar { display: none; }
  .ana-shbtn { position: relative; flex: 0 0 auto; width: 38px; height: 36px; display: inline-flex; align-items: center;
    justify-content: center; background: transparent; border: 0; border-radius: 9px; cursor: pointer; color: var(--text-tertiary); padding: 0; }
  .ana-shbtn:hover { background: var(--bg-hover); color: var(--text-secondary); }
  .ana-shbtn.is-on { background: var(--accent-glow); color: var(--accent-primary); }
  .ana-shbtn svg { width: 20px; height: 20px; }
  .ana-shbtn__tip { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: #000;
    color: var(--text-primary); font-size: 12px; padding: 4px 9px; border-radius: 6px; white-space: nowrap; opacity: 0;
    pointer-events: none; transition: opacity .12s ease; border: 1px solid var(--border-strong); z-index: 5; }
  .ana-shbtn:hover .ana-shbtn__tip, .ana-shbtn:focus-visible .ana-shbtn__tip, .ana-shbtn--tip .ana-shbtn__tip { opacity: 1; }   /* §4 fix #9: --tip is the touchstart-revealed state (JS-toggled) */
  /* §4 fix #9: the active shape's NAME, always visible beside the icon strip (touch can't hover an icon to learn it) */
  .ana-shaperow__label { font-size: 12.5px; white-space: nowrap; }
  .ana-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; }
  .ana-legend__item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
  .ana-legend__dot { width: 11px; height: 11px; border-radius: 3px; flex: none; }
  .ana-chart__wrap { position: relative; }
  .ana-chart { display: block; width: 100%; height: auto; max-width: 860px; margin: 0 auto; }
  .ana-grid { stroke: rgba(255, 255, 255, .06); stroke-width: 1; }   /* Slice 2: softer gridlines on the deep-black chart card */
  .ana-axis { fill: var(--text-tertiary); font-family: inherit; font-size: 12.5px; }
  .ana-eratable { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
  .ana-eratable th { text-align: left; color: var(--text-tertiary); font-weight: 500; font-size: 12px; padding: 6px 10px; border-bottom: 1px solid var(--border-default); }
  .ana-eratable td { padding: 8px 10px; border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); }
  /* numeric column: right-align the HEADER too (the `.ana-eratable th` rule out-specifies a bare `.ana-eratable__num`,
     so the header was left-aligned while its number was right-aligned → they drifted far apart in a wide column). */
  .ana-eratable th.ana-eratable__num, .ana-eratable td.ana-eratable__num { text-align: right; }
  /* keep the numbers from sprawling to the far edge of a very wide frame — a calmer fixed currency column + a cap */
  .ana-eratable th:first-child, .ana-eratable td:first-child { width: 120px; }
  /* §9 per-era SECTIONS: one labelled block per currency era when a range spans a base-currency change. A clear
     divider + a header (currency name · date span) sets each era apart; sections stack single-column on a phone. */
  .ana-era-section { margin-top: 18px; padding-top: 14px; border-top: 2px solid var(--border-default); }
  .ana-era-section:first-of-type { margin-top: 14px; }
  .ana-era-section__hd { font-family: var(--font-head, inherit); font-size: 17px; font-weight: 600; color: var(--text-primary); margin: 0 2px 10px; }

  /* ── Analysis → Ledger linked panel (floating, filtered ledger view) ───────────────────────────── */
  /* SLIM + GLASS handles (2026-07-16, human-picked "variant C" from the mockup artifact): the icon leads the word
     along ONE vertical line (flex-direction: row in vertical-rl = the inline/vertical axis → ~25px wide, half the
     old tab), and the tab is translucent purple + blur so a covered card title stays readable through it. Hover /
     focus restores full purple — the tap target is never a ghost. (rgba literal of --accent-primary, the
     --accent-glow precedent.) */
  .ana-lpanel-handle {
    position: fixed; top: 50%; right: 0; transform: translateY(-50%);
    z-index: 60; display: flex; flex-direction: row; align-items: center; gap: 5px;
    background: rgba(124, 106, 255, 0.40); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    color: #fff; border: none; cursor: pointer;
    padding: 10px 5px; border-radius: 12px 0 0 12px; box-shadow: -3px 0 14px rgba(0,0,0,0.35);
    writing-mode: vertical-rl; font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.15s ease;
  }
  .ana-lpanel-handle svg { transform: rotate(90deg); }
  .ana-lpanel-handle:hover, .ana-lpanel-handle:focus-visible { background: var(--accent-primary); }
  .ana-lpanel-handle--gone { opacity: 0; transform: translateY(-50%) translateX(110%); pointer-events: none; }

  .ana-lpanel {
    position: fixed; top: 0; right: 0; height: 100vh; width: min(380px, 92vw);
    z-index: 61; display: flex; flex-direction: column;
    background: var(--bg-surface); border-left: 1px solid var(--border-default);
    box-shadow: -6px 0 26px rgba(0,0,0,0.4);
    transform: translateX(100%); transition: transform 0.22s ease, width 0.18s ease;
  }
  .ana-lpanel--open { transform: translateX(0); }
  .ana-lpanel--wide { width: min(620px, 96vw); }
  .ana-lpanel__head { padding: 14px 14px 10px; border-bottom: 1px solid var(--border-subtle); flex: 0 0 auto; }
  .ana-lpanel__titlerow { display: flex; align-items: center; gap: 6px; }
  .ana-lpanel__title { font-family: var(--font-head, inherit); font-size: 16px; font-weight: 600; color: var(--text-primary); }
  .ana-lpanel__spacer { flex: 1 1 auto; }
  .ana-lpanel__expand svg { transition: transform 0.18s ease; }
  .ana-lpanel--wide .ana-lpanel__expand svg { transform: rotate(180deg); }
  .ana-lpanel__meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 8px; }
  .ana-lpanel__count { font-size: 13px; }
  .ana-lpanel__net { font-size: 15px; font-weight: 500; }
  .ana-lpanel__sortrow { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
  .ana-lpanel__sortlbl { font-size: 12px; }
  .ana-lpanel__filters { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 10px; }
  .ana-lpanel__filters:empty { display: none; }
  .ana-lpanel__filter { display: flex; flex-direction: column; gap: 3px; flex: 1 1 100%; min-width: 0; }
  .ana-lpanel--wide .ana-lpanel__filter { flex: 1 1 200px; }   /* side-by-side only when there's room (expanded panel) */
  .ana-lpanel__filterhd { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
  .ana-lpanel__filterhd > span { font-size: 11px; }
  .ana-lpanel__clear { font-size: 11px; color: var(--text-secondary); }
  .ana-lpanel__clear:hover { color: var(--accent-primary); }
  .ana-lpanel__filter .dropdown, .ana-lpanel__filter .catpick, .ana-lpanel__filter .combo { width: 100%; min-width: 0; }
  .ana-lpanel__filter .dropdown__trigger, .ana-lpanel__filter .catpick__input, .ana-lpanel__filter .combo input { width: 100%; min-width: 0; box-sizing: border-box; }
  .ana-lpanel__body .tx__detail { width: 100%; margin-top: 4px; }
  .ana-lpanel__body .txd__golink { margin-top: 8px; }
  .ana-lpanel__body { flex: 1 1 auto; overflow-y: auto; padding: 6px 10px 18px; }
  .ana-lpanel__body .tx { padding: 9px 4px; border-bottom: 1px solid var(--border-subtle); }
  .ana-lpanel__empty { padding: 24px 8px; text-align: center; font-size: 14px; }
  .ana-lpanel__more { padding: 12px 4px; font-size: 13px; display: flex; align-items: center; gap: 10px; }
  @media (max-width: 900px) {
    .ana-lpanel { width: 100vw; }
    .ana-lpanel--wide { width: 100vw; }
  }

  /* ── Slice 4: the LEFT-sliding Table panel + its edge handle (mirror of the right ledger panel) ─────────── */
  .ana-tpanel-handle {
    position: fixed; top: 42%; left: 0; transform: translateY(-50%);
    z-index: 60; display: flex; flex-direction: row; align-items: center; gap: 5px;
    background: rgba(124, 106, 255, 0.40); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    color: #fff; border: none; cursor: pointer;
    padding: 10px 5px; border-radius: 0 12px 12px 0; box-shadow: 3px 0 14px rgba(0,0,0,0.35);
    writing-mode: vertical-rl; font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.15s ease;
  }
  .ana-tpanel-handle:hover, .ana-tpanel-handle:focus-visible { background: var(--accent-primary); }
  .ana-tpanel-handle--gone { opacity: 0; transform: translateY(-50%) translateX(-110%); pointer-events: none; }
  /* S7: .ana-tpanel-handle--hidden removed — the panel is ALWAYS-ON (the review-#2 compare/periods hide is gone). */
  .ana-tpanel {
    position: fixed; top: 0; left: 0; height: 100vh; width: min(var(--tpanel-w, min(560px, 94vw)), 94vw);
    z-index: 61; display: flex; flex-direction: column;
    background: var(--bg-surface); border-right: 1px solid var(--border-default);
    box-shadow: 6px 0 26px rgba(0,0,0,0.4);
    transform: translateX(-102%); transition: transform 0.24s cubic-bezier(.2,.8,.2,1), width 0.2s ease;
  }
  .ana-tpanel--open { transform: translateX(0); }
  .ana-tpanel--max { width: min(1400px, 96vw); }                 /* S7 §3.7: maximise → ~full width */
  .ana-tpanel--dragging { transition: none; user-select: none; }  /* S7: no width transition mid-drag */
  /* S7 §3.7: the right-edge drag GRIP (new code — pointer events; data-noswipe so mobile swipe-nav can't hijack it) */
  .ana-tpanel__grip {
    position: absolute; top: 0; right: 0; width: 12px; height: 100%; z-index: 3;
    cursor: col-resize; touch-action: none;
  }
  .ana-tpanel__grip::after {
    content: ''; position: absolute; top: 50%; right: 3px; width: 3px; height: 46px; transform: translateY(-50%);
    border-radius: 3px; background: var(--border-default); transition: background 0.15s ease;
  }
  .ana-tpanel__grip:hover::after, .ana-tpanel--dragging .ana-tpanel__grip::after { background: var(--accent-primary); }
  .ana-tpanel__max { flex: 0 0 auto; }
  .ana-tpanel__max.is-on { color: var(--accent-primary); }
  .ana-tpanel__head { padding: 14px 14px 10px; border-bottom: 1px solid var(--border-subtle); flex: 0 0 auto; }
  .ana-tpanel__titlerow { display: flex; align-items: center; gap: 8px; }
  .ana-tpanel__title { font-family: var(--font-head, inherit); font-size: 16px; font-weight: 600; color: var(--text-primary);
    flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ana-tpanel__seg { flex: 0 0 auto; }
  .ana-tpanel__sub { font-size: 12.5px; margin-top: 8px; }
  .ana-tpanel__pctrow { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
  .ana-tpanel__pctrow:empty { display: none; }
  .ana-tpanel__pctlbl { font-size: 12px; }
  .ana-tpanel__body { flex: 1 1 auto; overflow: auto; padding: 8px 6px 24px; }
  .ana-tpanel__empty { padding: 24px 8px; text-align: center; font-size: 14px; }
  .ana-mtab { border-collapse: collapse; width: 100%; font-size: 13px; }
  .ana-mtab th, .ana-mtab td { padding: 8px 10px; text-align: right; white-space: nowrap; }
  .ana-mtab th:first-child, .ana-mtab td.ana-mtab__name, .ana-mtab td:first-child { text-align: left; position: sticky; left: 0; background: var(--bg-surface); }
  .ana-mtab thead th { color: var(--text-tertiary); font-weight: 600; border-bottom: 1px solid var(--border-default); position: sticky; top: 0; background: var(--bg-surface); z-index: 1; }
  .ana-mtab td.mono { font-family: var(--font-mono, inherit); font-weight: 500; }   /* DM Mono has no weight > 500 */
  .ana-mtab tbody tr:hover { background: rgba(255, 255, 255, .03); }
  .ana-mtab tr.ana-mtab__tot td { border-top: 1px solid var(--border-default); color: var(--text-primary); font-weight: 600; }
  .ana-mtab__totcol { border-left: 1px solid var(--border-subtle); color: var(--text-primary); }
  .ana-mtab__dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 7px; vertical-align: middle; }
  .ana-mtab thead th.ana-mtab__num .ana-mtab__dot { margin-right: 5px; }   /* S7: person/bucket column-header identifier dots */
  .ana-mtab__partial { opacity: 0.72; }   /* S7: the in-progress month/period column */
  /* S7 §3.7: phone/tablet — the panel is already full-width, so drag/maximise are hidden (a graceful no-op) */
  @media (max-width: 900px) {
    .ana-tpanel, .ana-tpanel--max { width: 100vw; }
    .ana-tpanel__grip, .ana-tpanel__max { display: none; }
  }
  /* comparison card head + per-series totals (used by WHO/WHAT comparison views) */
  .ana-comphead { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 10px; }
  .ana-comphead .dash-card__title { margin: 0; }
  .ana-measure { margin-left: auto; }
  .ana-compsums { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 12px; }
  .ana-compsums__item { display: inline-flex; align-items: baseline; gap: 6px; font-size: 13px; color: var(--text-secondary); }
  .ana-compsums__dot { width: 10px; height: 10px; border-radius: 3px; align-self: center; flex: none; }
  .ana-compsums__amt { color: var(--text-primary); }
  .ana-combined { margin: -4px 0 12px; }
  /* S10 phone gate: the ranked-list-per-unit fallback for a grouped-bars compare that would be too dense at
     narrow widths (analysis.js tooManyBarsForNarrow / drawCategoryCompare) — a stack of per-person mini-lists,
     reusing the existing .ana-bdrow list-row look. */
  .ana-comparenarrow__note { margin: 0 0 12px; }
  .ana-comparenarrow__unit { margin-bottom: 18px; }
  .ana-comparenarrow__unit:last-child { margin-bottom: 0; }
  .ana-comparenarrow__hd { display: flex; align-items: center; gap: 8px; padding: 6px 6px 8px; border-bottom: 1px solid var(--border-default); }
  .ana-comparenarrow__name { font-weight: 600; color: var(--text-primary); flex: 1 1 auto; min-width: 0; }
  .ana-comparenarrow__amt { color: var(--text-primary); }
  /* ── R0 redesign: control surface (breadcrumb-drill + verbs) · lens switcher · breakdown accordion ───── */
  .ana-controls2 { margin-bottom: var(--gap); }
  /* R4: saved reports strip */
  .ana-presets { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
  .ana-presets__lbl { font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; margin-right: 2px; }
  /* Slice 6 — the ★ Saved ▾ dropdown (apply · × delete · "Save this view" inside). */
  .ana-menu--saved .ana-menu__lbl { display: none; }   /* no uppercase axis label — just "★ Saved" */
  .ana-menu--saved .ana-menu__trigger { min-width: auto; }
  .ana-menu--saved .ana-menu__val { font-size: 13px; color: var(--text-secondary); }
  .ana-saved-pop { min-width: 240px; max-width: 320px; padding: 6px; }
  .ana-saved__empty { padding: 10px 8px; font-size: 12.5px; }
  .ana-saved__row { display: flex; align-items: center; gap: 4px; }
  .ana-saved__apply { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; appearance: none; background: transparent; border: 0; font-family: inherit; font-size: 13.5px; color: var(--text-secondary); cursor: pointer; text-align: left; padding: 8px; border-radius: 7px; }
  .ana-saved__apply:hover { background: var(--bg-hover); color: var(--text-primary); }
  .ana-saved__star { color: var(--accent-gold); flex: none; }
  .ana-saved__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ana-saved__x { flex: none; appearance: none; background: transparent; border: 0; color: var(--text-tertiary); font-size: 16px; line-height: 1; cursor: pointer; padding: 6px 8px; border-radius: 6px; }
  .ana-saved__x:hover { color: var(--accent-warm); background: var(--bg-hover); }
  .ana-saved__sep { height: 1px; background: var(--border-subtle); margin: 6px 2px; }
  .ana-saved__saverow { display: flex; align-items: center; gap: 6px; padding: 2px; }
  .ana-saved__nameinput { flex: 1 1 auto; min-width: 0; box-sizing: border-box; }
  .ana-saved__savebtn { flex: none; padding: 8px 12px; font-size: 13px; }
  .ana-preset { appearance: none; display: inline-flex; align-items: center; gap: 6px; font-family: inherit; font-size: 13px;
    cursor: pointer; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border-default); background: var(--bg-input); color: var(--text-primary); }
  .ana-preset:hover { border-color: var(--border-strong); }
  .ana-preset--starter { background: var(--bg-surface); color: var(--text-secondary); }
  .ana-preset--save { border-style: dashed; color: var(--accent-primary); border-color: var(--accent-primary); background: none; }
  .ana-preset__x { color: var(--text-tertiary); font-size: 15px; line-height: 1; }
  .ana-preset__x:hover { color: var(--accent-warm); }
  .ana-preset__name { width: 180px; max-width: 52vw; padding: 7px 10px; font-size: 13px; }
  .ana-preset__savebtn { padding: 7px 14px; font-size: 13px; }
  .ana-whowrap { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; }
  /* the Single/Add/Compare mode toggle at the top of the WHO dropdown (gates single vs multi select) */
  .ana-whomode { display: flex; margin-bottom: 8px; }
  .ana-whomode .dash-seg__btn { flex: 1 1 0; text-align: center; }
  .ana-menu__hint { font-size: 11px; line-height: 1.35; margin: -2px 2px 8px; }
  /* "one comparison at a time" info panel — anchored to the Compare button the user clicked (2026-07-09 review) */
  .ana-blocknote { position: fixed; z-index: 300; max-width: 260px; display: flex; gap: 8px; align-items: flex-start;
    padding: 10px 12px; border-radius: 10px; background: var(--bg-elevated); border: 1px solid var(--border-default);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45); color: var(--text-primary); font-size: 13px; line-height: 1.4;
    opacity: 0; transform: translateY(-4px); transition: opacity 0.14s ease, transform 0.14s ease; }
  .ana-blocknote--show { opacity: 1; transform: translateY(0); }
  .ana-blocknote__icon { flex: 0 0 auto; color: var(--accent-primary); font-weight: 700; }
  .ana-blocknote__msg { flex: 1 1 auto; }
  /* breadcrumb-drill row */
  .ana-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin-top: 12px; }
  .ana-crumb { appearance: none; background: none; border: none; font-family: inherit; font-size: 14px; padding: 4px 6px; border-radius: 8px; }
  .ana-crumb--link { color: var(--text-secondary); cursor: pointer; }
  .ana-crumb--link:hover { color: var(--text-primary); background: var(--bg-hover); }
  .ana-crumb--cur { color: var(--text-primary); font-weight: 600; }
  .ana-crumb__sep { color: var(--text-tertiary); font-size: 13px; }
  /* typeable jump — §4 fix #8: the bare `.ana-jump` wrapper was only the (now-deleted) dead buildJump's own div;
     the `.ana-jump__*` piece classes below stay LIVE (shared by buildWhatSearch, the WHAT popup's search box). */
  .ana-jump__input { width: 150px; max-width: 46vw; padding: 7px 10px; font-size: 13px; }
  .ana-jump__pop { position: absolute; top: calc(100% + 4px); left: 0; z-index: 40; min-width: 240px; max-width: 330px; padding: 4px; }
  .ana-jump__opt { display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
  .ana-jump__opt:hover, .ana-jump__opt--hi { background: var(--bg-hover); }
  .ana-jump__type { flex: 0 0 64px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
  .ana-jump__lbl { color: var(--text-primary); font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* lens switcher strip (under the headline tiles) */
  .ana-lensstrip { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 12px; }
  /* S4 (D6): an honestly-DISABLED tab/segment button — greyed with a reason tooltip (title attr), never a
     live-looking dead control and never hidden (stable geography). Wired via class + aria-disabled (a disabled
     attr would swallow the hover tooltip); the :disabled selector is covered too for any future native wiring. */
  .dash-seg__btn:disabled, .dash-seg__btn--off { opacity: 0.38; cursor: default; }
  .dash-seg__btn--off:hover { background: none; color: inherit; }
  .ana-shbtn--disabled { opacity: 0.35; cursor: default; }
  .ana-shbtn--disabled:hover { background: none; }
  /* S3 (§3.3/D1): the "Comparing: A vs B ✕" pill sits in the lens-tab row with TAB-CLASS visual weight (a bordered,
     elevated, semibold pill — not a slim chip a thumb misses). ✕ is the one consistent, undoable compare exit. */
  /* S7.5 #2: the current-subject check on WHAT-popup rows (Single mode) */
  .ana-curmark { margin-left: auto; display: inline-flex; align-items: center; color: var(--accent-primary); flex: none; }
  .ana-curmark svg { width: 14px; height: 14px; }
  .ana-comparepill { display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
    border: 1px solid var(--accent-primary); background: var(--bg-elevated); border-radius: 999px;
    padding: 4px 5px 4px 13px; }
  .ana-comparepill__lbl { font-size: 12px; font-weight: 600; color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ana-comparepill__x { appearance: none; background: none; border: none; cursor: pointer; flex: none;
    color: var(--text-secondary); font-size: 13px; line-height: 1; width: 22px; height: 22px; padding: 0;
    border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; }
  .ana-comparepill__x:hover { background: var(--bg-hover); color: var(--text-primary); }
  /* the breakdown accordion (the Direction-C calm vertical composition). Extra right padding keeps the right-aligned
     amounts clear of the floating Ledger-panel handle (fixed at the right edge, vertically centred). */
  .ana-accordion { padding-top: 6px; padding-bottom: 6px; padding-right: 44px; }
  /* §4 fix #5: name/bar/amount used to be THREE competing flex(grow+shrink) columns — a longer name or a wider
     amount both silently ate into the bar's share, so the bars never lined up into a column row-to-row. Now name
     and amount are FIXED-basis (never grow/shrink) and the bar is the ONLY flexible column, so its left edge (and
     right edge) sit at the same x on every row regardless of label length or depth. flex-wrap lets the (optional)
     plan annotation drop to its own second line instead of squeezing/overflowing the row (see __plan below). */
  .ana-bdrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 9px 6px; border-bottom: 1px solid var(--border-subtle); }
  .ana-bdrow:last-child { border-bottom: none; }
  .ana-bdrow--sub { font-size: 13px; }
  .ana-bdrow--sub .ana-bdrow__name { color: var(--text-secondary); }
  .ana-bdrow--drill { cursor: pointer; border-radius: 8px; }
  .ana-bdrow--drill:hover { background: var(--bg-hover); }
  .ana-bdrow--drill:hover .ana-bdrow__name { color: var(--text-primary); }
  .ana-bdrow__chev { appearance: none; background: none; border: none; cursor: pointer; color: var(--text-tertiary);
    flex: none; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
  .ana-bdrow__chev svg { width: 14px; height: 14px; transition: transform 0.15s ease; }
  .ana-bdrow__chev.is-open svg { transform: rotate(180deg); }
  .ana-bdrow__chev--none { cursor: default; }
  .ana-bdrow__name { flex: 0 0 34%; min-width: 0; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ana-bdrow__barwrap { flex: 1 1 auto; height: 7px; min-width: 40px; border-radius: 999px; background: var(--bg-input); overflow: hidden; }
  .ana-bdrow__fill { display: block; height: 100%; border-radius: 999px; }
  .ana-bdrow__fill--out { background: var(--accent-out); }
  .ana-bdrow__fill--in { background: var(--accent-teal); }
  .ana-bdrow__fill--gold { background: var(--accent-gold); }
  .ana-bdrow__fill--neg { background: var(--accent-red); }   /* §4 fix #1 — a below-zero row (e.g. negative liquid) */
  .ana-bdrow__pct { flex: 0 0 38px; text-align: right; font-size: 12px; }
  .ana-bdrow__amt { flex: 0 0 92px; min-width: 0; text-align: right; color: var(--text-primary); font-weight: 500; }   /* §4 fix #5: fixed, not content-width — stops it nudging the bar per row */
  .ana-leafhint { margin-bottom: 8px; }
  /* R1: breakdown SHAPES — donut + table + the shape dropdown */
  .ana-shapedd .dropdown__trigger { min-width: 110px; }
  .ana-donutwrap { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 28px; }
  .ana-donut { width: 184px; height: 184px; flex: none; }
  .ana-donut__total { fill: var(--text-primary); font-size: 20px; font-family: var(--font-mono, inherit); font-weight: 500; }
  .ana-donutlegend { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .ana-dlrow { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border-subtle); }
  .ana-dlrow:last-child { border-bottom: none; }
  .ana-dl__dot { width: 11px; height: 11px; border-radius: 3px; flex: none; align-self: center; }
  .ana-dl__lbl { flex: 1 1 auto; min-width: 0; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ana-dl__pct { flex: 0 0 40px; text-align: right; font-size: 12px; }
  .ana-dl__amt { flex: 0 0 auto; min-width: 76px; text-align: right; color: var(--text-primary); }
  /* R3: interactive chart tooltip. S8 "tooltip z-index fix": was 80 — a tap/hover on a chart element INSIDE the
     per-chart expand overlay (.ana-expand, z-index 90) still needs its tooltip visible, so this now paints above
     the overlay (96 > 90); nothing else in the app uses 81-95, so the gap is deliberate headroom. */
  .ana-tip { position: fixed; z-index: 96; pointer-events: none; max-width: 260px; padding: 8px 11px;
    background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: 10px;
    box-shadow: 0 6px 22px rgba(0,0,0,0.45); font-size: 13px; }
  .ana-tip__lbl { color: var(--text-primary); font-weight: 500; margin-bottom: 2px; }
  .ana-tip__amt { color: var(--text-primary); font-family: var(--font-mono, inherit); }
  .ana-tip__meta { font-size: 11px; margin-top: 3px; }
  /* ── S8 (§3.7 "Phone user"): per-chart EXPAND overlay — move-the-live-node pattern ─────────────────────────
     A small button on every chart CARD moves that card's live body (chart + legend, exactly as rendered — not
     a re-render) into a full-screen overlay; closing restores it to its original spot. See analysis.js
     wireChartExpands/openChartExpand/closeChartExpand for the JS half (the "close-on-draw" rule lives there). */
  .ana-card__expand { position: absolute; top: 8px; right: 8px; z-index: 2; width: 34px; height: 34px;
    background: rgba(0,0,0,0.35); border: 1px solid var(--border-default); border-radius: 9px; color: var(--text-primary); }
  .ana-card__expand:hover { background: rgba(0,0,0,0.55); }
  .ana-card__expand svg { width: 15px; height: 15px; }
  .ana-card__body { position: relative; }
  .ana-expand { position: fixed; inset: 0; z-index: 90; display: none; }
  .ana-expand.is-open { display: block; }
  .ana-expand__backdrop { position: absolute; inset: 0; background: rgba(4,4,10,0.94); }
  .ana-expand__bar { position: absolute; top: 0; left: 0; right: 0; z-index: 1; display: flex;
    justify-content: flex-end; gap: 8px; padding: 10px 12px; }
  .ana-expand__btn { position: relative; width: 42px; height: 42px; display: flex; align-items: center;
    justify-content: center; background: rgba(255,255,255,0.08); border: 1px solid var(--border-default);
    border-radius: 11px; color: var(--text-primary); cursor: pointer; padding: 0; }
  .ana-expand__btn:hover { background: rgba(255,255,255,0.18); }
  .ana-expand__btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }
  .ana-expand__btn svg { width: 18px; height: 18px; }
  /* the landscape-rotation aid is a portrait-phone affordance only — pointless on desktop/landscape */
  .ana-expand__rotbtn { display: none; }
  @media (max-width: 640px) and (orientation: portrait) { .ana-expand__rotbtn { display: flex; } }
  .ana-expand__stage { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: calc(100% - 32px); height: calc(100% - 92px); display: flex; align-items: center; justify-content: center;
    overflow: auto; padding: 8px; box-sizing: border-box; }
  .ana-expand__stage > * { width: 100%; }
  .ana-expand__stage--rot { width: calc(100vh - 32px); height: calc(100vw - 92px);
    transform: translate(-50%, -50%) rotate(90deg); }
  /* a landscape-shaped chart (fixed 760x300 viewBox) still reads small-with-margins on a narrow portrait stage —
     that's exactly what the rotate toggle is FOR (turn the phone / rotate the chart to use the tall axis as the
     chart's WIDE axis instead). Tried a height-filling flex override here first; reverted — the SVG's own
     preserveAspectRatio="meet" re-letterboxes inside any taller box (the box grows, the drawn content doesn't),
     so it added flex complexity with no visible gain. Keep it simple: same centred sizing as the source card. */
  @media (prefers-reduced-motion: no-preference) { .ana-expand__backdrop { transition: opacity .15s ease; } }
  /* R5: intentions overlay — the "Compare to plan" toggle, the per-row plan annotation, the trend target line */
  .ana-plantoggle { appearance: none; font-family: inherit; font-size: 12px; cursor: pointer; padding: 6px 12px;
    border-radius: 999px; border: 1px solid var(--border-default); background: var(--bg-input); color: var(--text-secondary); }
  .ana-plantoggle:hover { border-color: var(--border-strong); color: var(--text-primary); }
  .ana-plantoggle.is-on { background: var(--accent-gold); border-color: var(--accent-gold); color: #1a1407; }
  /* §4 fix #5: the plan chip used to squeeze in after the amount (nowrap could spill past the card edge on a
     narrower row). flex-basis:100% forces it onto its OWN second line (the row is flex-wrap now), indented to
     roughly line up under the name text — never fights the fixed name/bar/amount columns for width. */
  .ana-bdrow__plan { flex: 0 0 100%; margin-left: 0; padding-left: 34px; font-size: 12px; white-space: normal; }
  .ana-bdrow__plan--over { color: var(--accent-warm); }
  .ana-bdrow__plan--under { color: var(--text-tertiary); }
  .ana-bdrow__plan--nobasis { color: var(--text-tertiary); font-style: italic; }   /* S9: calm no-basis chip (never a fake $0) */
  .ana-refline { stroke: var(--accent-gold); stroke-width: 1.4; stroke-dasharray: 5 4; opacity: 0.8; }
  .ana-refline__lbl { fill: var(--accent-gold); }
  /* S9: the stepped per-month target series (intentions overlay v2) — gold dashed step path over the trend/stack. */
  .ana-refseries { fill: none; stroke: var(--accent-gold); stroke-width: 1.6; stroke-dasharray: 5 4; opacity: 0.85; }
  /* S9: the compare "· intended {amt}" annotation under each bucket sum, and the Table's Intended column/rows. */
  .ana-compsums__plan { color: var(--accent-gold); font-size: 12px; }
  .ana-mtab__intended { color: var(--accent-gold); }
  .ana-mtab__introw .ana-mtab__name { font-style: italic; color: var(--text-secondary); }
  tr.ana-mtab__introw td { border-top: 1px dashed var(--border-default); }
  /* Slice 1: the floating-baseline ZERO line (kept < 0). Red is the ONE sanctioned use — a genuine zero/below-zero
     boundary (§3), NOT routine spending; only rendered when a chart actually dips below zero. */
  .ana-zeroline { stroke: var(--accent-red); stroke-width: 1.4; stroke-dasharray: 5 4; opacity: 0.85; }
  .ana-zeroline__lbl { fill: var(--accent-red); }

  /* phone: stack the axis menus full-width so the summaries aren't truncated */
  @media (max-width: 560px) {
    .ana-axisbar { flex-direction: column; align-items: stretch; }
    .ana-menu, .ana-whengroup { width: 100%; }
    .ana-menu__trigger { width: 100%; max-width: none; }
    .ana-menu__pop { max-width: none; }
    .ana-whowrap { width: 100%; }
    .ana-whowrap .ana-menu { flex: 1 1 auto; }
    .ana-jump__input { width: 100%; max-width: none; box-sizing: border-box; }
    .ana-bdrow__barwrap { display: none; }   /* keep name · % · amount on a phone (the % carries the proportion) */
    .ana-bdrow__name { flex: 1 1 auto; }   /* §4 fix #5: no bar to align with here, so let the name reclaim the freed width */
  }

  /* category avatar (Phase 5b) — neutral chip, glyph/letter tinted by ENGINE (B2) */
  .catav { flex: none; width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
    background: var(--bg-elevated); border: 1px solid var(--border-default); }
  .catav svg { width: 19px; height: 19px; }
  .catav--mono { font-weight: 700; font-size: 15px; }
  .catav--life_costs { color: var(--accent-warm); }
  .catav--income { color: var(--accent-teal); }
  .catav--reserves { color: var(--accent-gold); }
  .catav--neutral { color: var(--text-secondary); }
  /* SESSION VEIL (§4.7): a locked private row — calm, muted, tap-to-unlock. Never alarm colours. */
  .catav--veil { color: var(--text-tertiary); }
  .catav--veil svg { width: 16px; height: 16px; }
  .tx--veiled .tx__title { color: var(--text-secondary); font-style: italic; }
  .tx__veilhint { font-size: 12px; color: var(--text-tertiary); }
  .tx__amt--veiled { color: var(--text-tertiary); letter-spacing: 0.12em; }
  .bulk-le--veiled { cursor: pointer; }
  .bulk-le--veiled .bulk-le__t { color: var(--text-secondary); font-style: italic; }
  .bulk-le__a--veiled { color: var(--text-tertiary); letter-spacing: 0.12em; }
  .ana-veilnote { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 13px; margin: 2px 0 10px; }
  .cat-tile--private { display: inline-flex; align-items: center; gap: 7px; }
  .cat-tile--private svg { width: 13px; height: 13px; color: var(--text-tertiary); flex: none; }
  .cat-tile--private.cat-tile--active svg { color: currentColor; }
  .bulk-row--veil { cursor: pointer; }
  .bulk-cn--veil { display: inline-flex; align-items: center; gap: 7px; color: var(--text-secondary); font-style: italic; }
  .bulk-veil__ic svg { width: 13px; height: 13px; color: var(--text-tertiary); display: block; }
  .history-row--veiled .history-row__desc { color: var(--text-secondary); font-style: italic; cursor: pointer;
    display: inline-flex; align-items: baseline; gap: 10px; }
  /* tap-to-detail + inline edit (Phase 5b) */
  .tx__main--tap { cursor: pointer; }
  .tx__detail { flex-basis: 100%; margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--border-subtle); }
  .txd__grid, .txd__split { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 18px; }
  .txd__split { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-subtle); }
  .txd__splitt { grid-column: 1 / -1; font-size: 11px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; }
  .txd__row { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .txd__k { font-size: 11px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; }
  .txd__v { font-size: 14px; color: var(--text-primary); word-break: break-word; }
  .txd__note { margin-top: 10px; font-size: 13px; color: var(--text-secondary); font-style: italic; }
  .txd__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
  .txd__hint { font-size: 13px; }
  .txd__edit { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 16px; }
  .txd__f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
  .txd__f > label { font-size: 12px; color: var(--text-secondary); }
  .txd__edit .txd__actions, .txd__edit .toast { grid-column: 1 / -1; }
  .txd__edit .txd__wide { grid-column: 1 / -1; margin: 0; } /* a full-width intro line in an inline form */
  .txd__hh { grid-column: 1 / -1; } /* the household split/who-paid section spans the edit grid */
  /* linked-transaction peek card (5d·5 refine): the OTHER side of a reimbursement link, shown inside
     an open detail so the pair reads side by side even across months/filters */
  .txd__peek { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; min-width: 0;
    padding: 8px 10px; background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: 10px; }
  .txd__peek__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .txd__peek__amt { flex: 0 0 auto; text-align: right; }
  .txd__peeknet { font-size: 11px; }
  /* "Go to →" jump link on a linked peek card (purple = neutral/brand action, §3) */
  .txd__peekgo { align-self: flex-start; margin-top: 3px; background: none; border: 0; padding: 2px 0;
    color: var(--accent-primary); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
  .txd__peekgo:hover { text-decoration: underline; }
  /* brief highlight when the list jumps to a row (purple glow, fades) — "here it is", not an alert */
  @keyframes txflash { 0% { background: rgba(124, 106, 255, 0.22); } 100% { background: transparent; } }
  .tx--flash { animation: txflash 1.7s ease-out; border-radius: 10px; }

  /* archive (Settings → Archive): amber marks the impending PURGE (destructive), nothing else */
  .arc-warn { border-color: var(--accent-warm); }
  .arc-warn p { margin: 0; color: var(--text-primary); font-size: 14px; }
  .arc-soon { color: var(--accent-warm); }
  .arc-norestore { font-size: 12px; max-width: 170px; text-align: right; }
  /* archive rows get extra breathing room (three info lines per row read cramped at list padding) */
  .tx--arc { padding: 16px 2px; }
  .tx--arc .tx__right { gap: 14px; }
  .tx__settle { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
  .tx__settlehint { font-size: 12px; color: var(--text-tertiary); }
  .tx__settled { margin-top: 6px; font-size: 12px; color: var(--accent-teal); }
  /* month-end settle-up summary: gentle, NOT alarming (teal/info, never red) — Bible §4.3 */
  .settle-summary { border-color: var(--accent-teal); background: rgba(62, 207, 170, 0.06); }
  .settle-summary p { color: var(--text-secondary); font-size: 14px; margin: 0; }
  /* teal button variant — income/settled money (Bible §3); dark ink on light teal */
  .btn--teal { background: var(--accent-teal); color: var(--bg-base); }
  /* gold button variant — reimbursement actions (§3 amendment, 5d·5 refine); dark ink on gold */
  .btn--gold { background: var(--accent-gold); color: var(--bg-base); }
  /* inline remove confirm — a slim full-width strip BELOW the row (no modal; stays in sightline) */
  .tx__confirm { flex-basis: 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px;
    margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border-subtle); }
  .tx__confirmq { font-size: 13px; color: var(--text-secondary); margin-right: auto; }
  .tx__confirmbtns { display: flex; gap: 8px; flex: none; }   /* keep Cancel + Remove together as a unit */
  .tx__confirmerr { flex-basis: 100%; font-size: 12px; color: var(--accent-warm); }

  /* ledger filter toolbar / panel / groups (Phase 5a) */
  .ledger-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
  .ledger-inline { display: inline-flex; align-items: center; gap: 6px; }
  .ledger-inline__l { font-size: 12px; color: var(--text-tertiary); white-space: nowrap; }
  .ledger-inline .dropdown { width: auto; }
  .ledger-inline .dropdown__trigger { padding: 7px 10px; font-size: 13px; }
  .ledger-filterbtn--on { border-color: var(--accent-primary); color: var(--accent-primary); }
  /* the filter panel: two labelled flex-wrap rows (desktop: Date·Type·Merchant·Category, then
     Amount·Search); mid widths wrap naturally and a phone stacks single-column (basis 190px) */
  .ledger-panel { display: flex; flex-direction: column; gap: 12px;
    margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-subtle); }
  .ledger-prow { display: flex; flex-wrap: wrap; gap: 12px 16px; }
  .ledger-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 190px; }
  .ledger-field > label { font-size: 12px; color: var(--text-secondary); }
  .ledger-amt { display: flex; align-items: center; gap: 8px; }
  .ledger-amt input { flex: 1; min-width: 0; }
  .ledger-cat__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
  /* removable filter chips */
  .ledger-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
  .ledger-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px;
    border-radius: 14px; background: var(--accent-glow); color: var(--accent-primary); font-size: 12px; }
  .ledger-chip__x { display: inline-flex; align-items: center; justify-content: center; padding: 2px;
    background: none; border: none; cursor: pointer; color: var(--accent-primary); opacity: 0.75; }
  .ledger-chip__x:hover { opacity: 1; }
  .ledger-chip__x svg { width: 12px; height: 12px; }
  /* result summary + group headers */
  .ledger-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-subtle); }
  .ledger-net { font-size: 15px; }
  /* slice 5 (fetch half, §A): the scope net — default = last + this month (two figures), each labelled with
     its month; a filter shows the one filtered-scope net. Wraps cleanly on a phone. */
  .ledger-nets { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
  .ledger-netfig { display: inline-flex; align-items: baseline; gap: 6px; }
  .ledger-netfig__l { font-size: 12.5px; }
  .ledger-checking { font-size: 12px; opacity: .8; }   /* §C "checking earlier…" reconcile hint (deep-scroll list) */
  /* F2: provisional net at complete:false — the figure dims slightly + carries a small "checking…" qualifier so a
     not-yet-reconciled number reads as still-verifying, never as a wrong number that silently corrects. */
  .ledger-netfig--checking .ledger-net { opacity: .55; }
  .ledger-netfig__checking { font-size: 11.5px; opacity: .8; font-style: italic; }
  .ledger-more { height: 1px; }   /* slice 5: the paged-list scroll sentinel (IntersectionObserver target) */
  .ledger-group { display: flex; align-items: baseline; gap: 10px; padding: 14px 2px 8px;
    border-top: 1px solid var(--border-subtle); }
  .ledger-group:first-child { border-top: none; }
  .ledger-group__l { font-weight: 600; color: var(--text-primary); }
  .ledger-group__c { font-size: 12px; }
  .ledger-group__n { margin-left: auto; font-size: 14px; }
  /* Sort/View popups: let them grow past the (narrow) trigger instead of clipping the option text */
  .ledger-inline .dropdown__list { right: auto; min-width: 160px; }
  .ledger-inline .dropdown__opt { white-space: nowrap; }
  /* grouped, ticked Category multi-select */
  .lcat { position: relative; }
  .lcat-trigger { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
    text-align: left; background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border-default);
    border-radius: 10px; padding: 11px 12px; font-family: inherit; font-size: 15px; cursor: pointer; }
  .lcat-trigger--open { border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-glow); }
  .lcat-trigger__v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* a floating popup (like every other dropdown in the filter row) — overlays the list instead of
     expanding the card and pushing rows down. Anchored to the trigger (.lcat is position:relative). */
  .lcat-box { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0;
    min-width: 220px; max-width: 86vw; max-height: 300px; overflow-y: auto; padding: 4px;
    border: 1px solid var(--border-default); border-radius: 10px; background: var(--bg-elevated);
    box-shadow: 0 10px 28px rgba(0,0,0,0.45); }
  .lcat-empty { padding: 12px; }
  .lcat-hrow, .lcat-crow { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
  .lcat-hrow:hover, .lcat-crow:hover { background: var(--bg-hover); }
  .lcat-hrow { margin-top: 4px; }
  .lcat-hrow:first-child { margin-top: 0; }
  .lcat-hlabel { font-weight: 600; color: var(--text-primary); font-size: 14px; }
  /* §schema tags section in the WHAT menu (Phase 5) — a quiet divider above it; tag rows read as #pills inline */
  .lcat-hrow--tags { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border-subtle); cursor: default; }
  .lcat-hrow--tags:hover { background: none; }
  .ana-tagrow { color: var(--text-secondary); }
  .lcat-crow { padding-left: 30px; font-size: 14px; color: var(--text-secondary); }
  .lcat-crow--on { color: var(--text-primary); }
  .lcat-cb { flex: none; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border-strong);
    display: inline-flex; align-items: center; justify-content: center; color: var(--on-accent-primary); }
  .lcat-cb--on, .lcat-cb--mix { background: var(--accent-primary); border-color: var(--accent-primary); }
  .lcat-cb__mix { width: 9px; height: 2px; background: var(--on-accent-primary); border-radius: 1px; }

  /* ── Bulk entry (§4d) — category-anchored grid + live month ledger. Two-pane on desktop (the view
     registers wide:true), single-column on phones; mobile hides the Merchant/Note columns. ────────── */
  .bulk-topbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
  .bulk-topbar__title { margin: 0; font-size: 20px; font-weight: 700; }
  .bulk-monthsel { position: relative; min-width: 150px; }
  .bulk-monthsel .dropdown__trigger { border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-glow); }
  /* free-form month/year picker popup */
  .bulk-monthpop { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; width: 260px;
    background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0,0,0,.45); padding: 10px; }
  .bulk-monthpop__nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
  .bulk-monthpop__arrow { background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 6px; border-radius: 8px; display: inline-flex; line-height: 0; }
  .bulk-monthpop__arrow:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); }
  .bulk-monthpop__arrow:disabled { opacity: .3; cursor: default; }
  .bulk-monthpop__yr { font-weight: 700; font-size: 15px; color: var(--text-primary); }
  .bulk-monthpop__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .bulk-monthpop__m { background: var(--bg-input); border: 1px solid transparent; color: var(--text-secondary);
    border-radius: 8px; padding: 9px 0; font-family: inherit; font-size: 13px; cursor: pointer; }
  .bulk-monthpop__m:hover:not(:disabled) { border-color: var(--border-strong); color: var(--text-primary); }
  .bulk-monthpop__m--sel { background: var(--accent-primary); color: var(--on-accent-primary); font-weight: 600; }
  .bulk-monthpop__m:disabled { opacity: .3; cursor: default; }
  /* shared month/year picker (HUI.monthPicker) — same look as the bulk one, reusable (e.g. the refund finder) */
  .hmonthsel { position: relative; }
  .hmonthsel .dropdown__trigger { width: 100%; }
  .hmonthpop { position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; width: 260px; max-width: 80vw;
    background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0,0,0,.45); padding: 10px; }
  .hmonthpop__any { display: block; width: 100%; text-align: left; background: var(--bg-input); border: 1px solid transparent;
    color: var(--text-secondary); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; font: inherit; cursor: pointer; }
  .hmonthpop__any:hover { border-color: var(--border-strong); color: var(--text-primary); }
  .hmonthpop__any--sel { background: var(--accent-primary); color: var(--on-accent-primary); font-weight: 600; }
  .hmonthpop__nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
  .hmonthpop__arrow { background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 6px; border-radius: 8px; display: inline-flex; line-height: 0; }
  .hmonthpop__arrow:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); }
  .hmonthpop__arrow:disabled { opacity: .3; cursor: default; }
  .hmonthpop__yr { font-weight: 700; font-size: 15px; color: var(--text-primary); }
  .hmonthpop__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .hmonthpop__m { background: var(--bg-input); border: 1px solid transparent; color: var(--text-secondary);
    border-radius: 8px; padding: 9px 0; font-family: inherit; font-size: 13px; cursor: pointer; }
  .hmonthpop__m:hover:not(:disabled) { border-color: var(--border-strong); color: var(--text-primary); }
  .hmonthpop__m--sel { background: var(--accent-primary); color: var(--on-accent-primary); font-weight: 600; }
  .hmonthpop__m:disabled { opacity: .3; cursor: default; }
  .bulk-topbar__grow { flex: 1; }
  .bulk-topbar__as { font-size: 13px; color: var(--text-tertiary); }
  .bulk-topbar__ctx { font-size: 14px; font-weight: 600; color: var(--accent-primary); border: 1px solid var(--border-default);
    background: var(--bg-input); border-radius: 16px; padding: 4px 12px; }
  .bulk-intro { margin: 8px 0 4px; }
  .bulk-intro b { color: var(--text-primary); font-weight: 600; }

  /* Dense grids fill the whole frame (bulk = two category columns + the ledger; CSV = the 3-column triage board).
     LATER in source order than `.app--wide .view`, so they win when a view carries BOTH classes (e.g. the CSV
     board lives inside Settings, which is app--wide AND app--csv). Phones/laptops collapse gracefully (below). */
  .app--bulk .view, .app--csv .view, .app--analysis .view { max-width: 100%; }
  .bulk-panes { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; margin-top: 14px; }
  .bulk-entry { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius); overflow: hidden; }
  /* each engine is its own section; a stronger divider (border-strong) separates engines, so the eye reads
     SPENDING · INCOME · TRANSFERS · GOALS at a glance (vs the subtle within-engine group dividers). */
  .bulk-engine + .bulk-engine { border-top: 2px solid var(--border-strong); }
  /* the categories area splits into two balanced columns on wide screens (≥1200px), one column otherwise */
  .bulk-cols { display: grid; grid-template-columns: 1fr; }
  .bulk-ehead, .bulk-row { display: grid; grid-template-columns: 1.5fr 52px 1.1fr 1fr 116px; align-items: center; }
  .bulk-ehead { background: var(--bg-elevated); border-bottom: 1px solid var(--border-default); }
  .bulk-h { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-tertiary); font-weight: 600; padding: 10px 12px; }
  .bulk-h.h--amt { text-align: right; } .bulk-h.h--day { text-align: center; }
  .bulk-group { padding: 9px 12px 5px; font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
    color: var(--text-tertiary); border-top: 1px solid var(--border-subtle); }
  .bulk-group__note { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-tertiary); opacity: .7; margin-left: 8px; }
  /* engine-coloured group headers (Bible §3 language): income = teal, transfers = muted, goals = gold;
     spending (life_costs) keeps the calm default. The note next to the label takes the same hue, dimmed. */
  .bulk-group--income { color: var(--accent-teal); }
  .bulk-group--neutral { color: var(--text-secondary); }
  .bulk-group--reserves { color: var(--accent-gold); }
  .bulk-group--income .bulk-group__note, .bulk-group--neutral .bulk-group__note, .bulk-group--reserves .bulk-group__note { color: currentColor; opacity: .6; }
  .bulk-row { border-top: 1px solid var(--border-subtle); }
  .bulk-row:hover { background: var(--bg-hover); }
  .bulk-row--focus { background: var(--accent-glow); box-shadow: inset 3px 0 0 var(--accent-primary); }
  /* a composer entry lands on its row → a brief, faint BRAND-purple flash (cohesive, not obtrusive) (Q1) */
  .bulk-row--flash { animation: bulkrowflash 0.9s ease; }
  @keyframes bulkrowflash { 0%, 100% { background: transparent; } 25% { background: var(--accent-glow); } }
  /* §28 pattern double-log nudge under a grid row — calm (purple-tinted), never amber */
  .bulk-dupask { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; margin: 2px 0;
    background: var(--accent-glow); border: 1px solid var(--border-default); border-radius: 8px; }
  .bulk-dupask__q { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
  .bulk-clabel { padding: 8px 12px; min-width: 0; }
  .bulk-cn { font-size: 14px; font-weight: 600; }
  .bulk-ct2 { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--text-tertiary); }
  .bulk-ct2 b { color: var(--text-secondary); font-weight: 500; }
  .bulk-row--in .bulk-ct2 b { color: var(--accent-teal); }
  .bulk-row[data-engine="income"] .bulk-ct2 b { color: var(--accent-teal); }
  .bulk-row[data-engine="reserves"] .bulk-ct2 b { color: var(--accent-gold); }
  .bulk-row[data-engine="neutral"] .bulk-ct2 b { color: var(--text-secondary); }
  .bulk-cell { min-width: 0; }
  .bulk-i { width: 100%; background: none; border: none; outline: none; color: var(--text-primary); font-family: inherit; font-size: 14px; padding: 11px 10px; min-width: 0; }
  .bulk-i::placeholder { color: var(--text-tertiary); }
  .bulk-i--day { font-family: 'DM Mono', monospace; text-align: center; padding: 11px 4px; }
  /* the sticky-day placeholder is barely-there (you can tell it's there; it stays out of the way) */
  .bulk-i--day::placeholder { color: var(--border-strong); opacity: 1; }
  .bulk-i--amt { font-family: 'DM Mono', monospace; text-align: right; }
  .bulk-i:focus { background: var(--bg-input); box-shadow: inset 0 0 0 2px var(--accent-primary); border-radius: 6px; }

  .bulk-strip { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: rgba(124,106,255,.06);
    border-top: 1px dashed var(--border-default); flex-wrap: wrap; }
  .bulk-strip__lbl { font-size: 12px; color: var(--text-tertiary); }
  .bulk-mk { appearance: none; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-secondary);
    border-radius: 16px; padding: 5px 11px; font-family: inherit; font-size: 12px; cursor: pointer; }
  .bulk-mk:hover { border-color: var(--border-strong); color: var(--text-primary); }
  .bulk-mk--on { border-color: var(--accent-warm); color: var(--accent-warm); background: rgba(232,131,74,.10); font-weight: 600; }
  .bulk-mk--purple.bulk-mk--on { border-color: var(--accent-primary); color: var(--accent-primary); background: rgba(124,106,255,.12); }
  .bulk-mk--teal.bulk-mk--on { border-color: var(--accent-gold); color: var(--accent-gold); background: rgba(232,197,71,.12); }
  .bulk-strip__tip { margin-left: auto; font-size: 11px; color: var(--text-tertiary); }
  /* "Log" commit button — TOUCH-ONLY (a numeric keyboard has no Enter key). Desktop commits with Enter, so the
     button is hidden there (it only cluttered the tag strip). Shown on touch devices (incl. a landscape phone,
     which is wider than the mobile breakpoint but still has no Enter) OR any narrow viewport. */
  .bulk-strip__log { display: none; flex: 0 0 auto; }
  @media (max-width: 820px), (hover: none) and (pointer: coarse) { .bulk-strip__log { display: block; } }
  .bulk-strip__log:disabled { opacity: .45; cursor: default; }
  /* mobile-only merchant field — in portrait the merchant column is hidden, so set it here. Desktop: column is used. */
  .bulk-strip__merch { display: none; font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 8px;
    border: 1px solid var(--border-default); background: var(--bg-input); color: var(--text-primary); min-width: 0; }
  .bulk-strip__merch:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-glow); }
  /* §schema tags in the bulk strip (Phase 5): a calm reveal + a compact tagInput so it fits the dense strip */
  .bulk-strip__addtags { font-size: 12px; padding: 2px 0; }
  .bulk-strip__tags { flex: 1 1 200px; min-width: 160px; min-height: 36px; padding: 4px 6px; }
  .bulk-strip__tags .taginput__field { min-width: 70px; }

  /* month totals — compact, at the top of the always-visible ledger (normal size, not a big footer) */
  .bulk-metric { display: inline-flex; align-items: baseline; }
  .bulk-k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-tertiary); }
  .bulk-v { font-family: 'DM Mono', monospace; font-size: 14px; font-weight: 500; margin-left: 6px; }
  .bulk-v--out { color: var(--accent-out); } .bulk-v--in { color: var(--accent-teal); }
  .bulk-foot__note { color: var(--text-tertiary); font-weight: 400; }
  .bulk-foot--settle { color: var(--accent-primary); }

  /* the live ledger STAYS IN VIEW as you scroll the long category list (sticky), and its list is sized to the
     viewport so the whole panel fits on screen — so an entry you just made (top of the list) is always visible. */
  .bulk-ledger { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius); position: sticky; top: 16px; overflow: hidden; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
  .bulk-ledger__head { padding: 12px 16px; border-bottom: 1px solid var(--border-default); background: var(--bg-elevated); }
  .bulk-ledger__row1 { display: flex; align-items: center; gap: 8px; }
  .bulk-ledger__row1 h3 { margin: 0; font-size: 15px; font-weight: 700; flex: 1; }
  .bulk-pend { display: inline-flex; align-items: center; gap: 5px; background: rgba(232,131,74,.12); color: var(--accent-warm);
    border: 1px solid rgba(232,131,74,.4); border-radius: 14px; padding: 3px 9px; font-size: 12px; font-weight: 600; cursor: pointer; }
  .bulk-ledger__money { display: flex; gap: 18px; flex-wrap: wrap; align-items: baseline; margin-top: 8px; }
  .bulk-ledger__ctxline { font-size: 12px; font-weight: 600; margin-top: 6px; }
  .bulk-ledger__ctxline[hidden] { display: none; }
  .bulk-ledger__sub { display: block; font-size: 12px; color: var(--text-tertiary); margin-top: 6px; }
  .bulk-ledger__list { flex: 1; min-height: 120px; overflow: auto; }
  .bulk-empty { padding: 28px 16px; color: var(--text-tertiary); font-size: 13px; text-align: center; }
  .bulk-le { display: flex; align-items: flex-start; gap: 8px; padding: 7px 12px 7px 16px; border-bottom: 1px solid var(--border-subtle); }
  .bulk-le:hover { background: var(--bg-hover); }
  .bulk-le--pending { opacity: .72; }
  .bulk-le__day { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--text-tertiary); width: 42px; flex: none; padding-top: 1px; }
  .bulk-le__main { flex: 1; min-width: 0; line-height: 1.35; }
  .bulk-le__t { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bulk-le__m { font-size: 12px; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* badges on their own wrapping line under the name → always fully visible, never lost to the title ellipsis */
  .bulk-le__badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
  .bulk-badge { display: inline-block; font-size: 10px; font-weight: 600; border-radius: 5px; padding: 1px 5px; vertical-align: middle; }
  .bulk-badge--neutral { background: var(--bg-input); color: var(--text-secondary); }
  .bulk-badge--shared { background: rgba(124,106,255,.16); color: var(--accent-primary); }
  .bulk-badge--mark { background: rgba(232,131,74,.14); color: var(--accent-warm); }
  .bulk-badge--ref { background: rgba(232,197,71,.14); color: var(--accent-gold); }
  .bulk-badge--settled { background: rgba(62,207,170,.14); color: var(--accent-teal); }   /* reflects the Ledger's settled state (teal = resolved) */
  .bulk-badge--session { background: transparent; color: var(--text-tertiary); border: 1px dashed var(--border-default); } /* faint = this-session only, drops on reload */
  .bulk-le__a { font-family: 'DM Mono', monospace; font-size: 14px; white-space: nowrap; padding: 2px 4px; border-radius: 5px; }
  .bulk-le__a--edit { cursor: text; }
  .bulk-le__a--edit:hover { background: var(--bg-input); box-shadow: inset 0 0 0 1px var(--border-default); }
  .bulk-le__a--in { color: var(--accent-teal); } .bulk-le__a--ref { color: var(--accent-gold); } .bulk-le__a--neutral { color: var(--text-tertiary); }
  .bulk-le__aedit { width: 82px; font-family: 'DM Mono', monospace; font-size: 14px; text-align: right; background: var(--bg-input);
    border: none; box-shadow: inset 0 0 0 2px var(--accent-primary); border-radius: 6px; color: var(--text-primary); padding: 3px 5px; outline: none; }
  .bulk-le__rm { background: none; border: none; color: var(--text-tertiary); cursor: pointer; font-size: 16px; flex: none; padding: 2px 6px; border-radius: 5px; line-height: 1; }
  .bulk-le__rm:hover { color: var(--accent-warm); background: var(--bg-input); }
  .bulk-confirm { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 16px; background: var(--bg-elevated); border-bottom: 1px solid var(--border-subtle); }
  .bulk-confirm__q { font-size: 13px; color: var(--text-secondary); }
  .bulk-confirm__btns { display: flex; gap: 6px; margin-left: auto; }

  .bulk-jump { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--bg-elevated);
    border: 1px solid var(--accent-primary); box-shadow: 0 8px 24px rgba(0,0,0,.5), 0 0 0 3px var(--accent-glow);
    border-radius: 24px; padding: 9px 18px; font-size: 14px; z-index: 50;
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px; max-width: min(560px, calc(100vw - 24px)); }
  .bulk-jump b { color: var(--accent-primary); } .bulk-jump__k { color: var(--text-tertiary); }
  /* the buffer is a REAL focused input (native typing/backspace/caret) styled to read as inline accent text */
  .bulk-jump__in { font: inherit; color: var(--accent-primary); background: transparent; border: none; outline: none;
    padding: 0; margin: 0; min-width: 4ch; caret-color: var(--accent-primary); }
  .bulk-jump__in::placeholder { color: var(--text-tertiary); }
  /* selectable jump pills — one per candidate (category or learned merchant); the highlighted one is purple-ringed */
  .bulk-jump__pills { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
  .bulk-jump__pill { font: inherit; cursor: pointer; border-radius: 14px; padding: 3px 10px; line-height: 1.3;
    background: var(--bg-hover); border: 1px solid var(--border-default); color: var(--text-secondary); }
  .bulk-jump__pill:hover { border-color: var(--border-strong); }
  .bulk-jump__pill--on { border-color: var(--accent-primary); background: var(--accent-glow); color: var(--text-primary);
    box-shadow: 0 0 0 1px var(--accent-primary); }
  .bulk-jump__m { color: var(--accent-primary); font-weight: 600; }   /* a merchant name → this pill fills the merchant cell */
  .bulk-jump__c, .bulk-jump__hint { color: var(--text-tertiary); }
  .bulk-jump__c2 { color: var(--text-primary); }
  .bulk-jump__hint { font-size: 12px; }
  /* composer chips — the locked day + category/merchant, shown left of the amount box in the AMOUNT stage */
  .bulk-jump__chips { display: inline-flex; align-items: center; gap: 6px; }
  .bulk-jump__chips:empty { display: none; }
  .bulk-jump__day { font-size: 12px; font-weight: 600; color: var(--accent-gold); background: rgba(232,197,71,.12);
    border-radius: 12px; padding: 3px 9px; white-space: nowrap; }
  .bulk-jump__catchip { font-size: 13px; font-weight: 600; color: var(--text-primary); background: var(--accent-glow);
    border: 1px solid var(--accent-primary); border-radius: 12px; padding: 3px 10px; white-space: nowrap; }

  /* wide screens → two category columns side by side (the second carries a divider). When stacked (narrow),
     the second column's header is hidden so the two columns read as one continuous list. */
  @media (min-width: 1200px) {
    .bulk-cols { grid-template-columns: 1fr 1fr; }
    .bulk-cols--single { grid-template-columns: 1fr; }   /* a one-group engine (income/transfers/goals) spans full width */
    .bulk-col--second { border-left: 1px solid var(--border-subtle); }
  }
  @media (max-width: 1199px) {
    .bulk-col--second > .bulk-ehead { display: none; }
  }
  @media (max-width: 820px) {
    .bulk-panes { grid-template-columns: 1fr; }
    .bulk-ledger { position: static; max-height: none; }   /* stacked below the categories → grows naturally, no nested scroll */
    .bulk-ledger__list { min-height: 0; }
    .bulk-ehead, .bulk-row { grid-template-columns: 1.4fr 44px 96px; }
    .bulk-h.h--merch, .bulk-h.h--note, .bulk-cell--merch, .bulk-cell--note { display: none; }
    /* the merchant column is gone in portrait → set the merchant in the focus strip instead; stack the strip:
       merchant on top, chips in the middle, a full-width "Log" button at the bottom. The desktop Enter tip is
       meaningless on a phone (no Enter key), so hide it. */
    .bulk-strip__merch { display: block; flex: 1 1 100%; }
    .bulk-strip__log { flex: 1 1 100%; }
    .bulk-strip__tip { display: none; }
  }

  /* §4d "to finish" — a clickable badge/button (bulk) + the gentle row nudge (ledger) + the shared modal */
  .bulk-badge--btn { cursor: pointer; border: none; font: inherit; font-size: 10px; font-weight: 600; }
  .bulk-badge--btn:hover { filter: brightness(1.15); }
  .bulk-le--flash { animation: bulkflash 1.2s ease; }
  @keyframes bulkflash { 0%, 100% { background: transparent; } 30% { background: var(--accent-glow); } }
  .tx__finish { display: inline-block; margin-top: 4px; background: rgba(232,131,74,.10); color: var(--accent-warm);
    border: 1px solid rgba(232,131,74,.35); border-radius: 8px; padding: 3px 9px; font: inherit; font-size: 12px;
    font-weight: 600; cursor: pointer; }
  .tx__finish:hover { background: rgba(232,131,74,.18); }
  .finish-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin: 6px 0 4px; }
  .finish-row__go { flex: 0 0 auto; margin-left: auto; } /* "Set up plan" sits inline, pushed to the row's end */
  .finish-field { display: flex; flex-direction: column; gap: 5px; }
  .finish-field label { font-size: 12px; color: var(--text-secondary); }
  .finish-field input { width: 120px; background: var(--bg-input); border: 1px solid var(--border-default);
    border-radius: 8px; padding: 9px 10px; color: var(--text-primary); font-family: inherit; font-size: 14px; }
  .finish-field input:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-glow); }
  .finish-preview { min-height: 18px; margin: 2px 0 8px; font-family: 'DM Mono', monospace; }
  .finish-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
  .finish-untag { margin-top: 12px; text-align: center; border-top: 1px solid var(--border-default); padding-top: 10px; }
  .finish-cands { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; max-height: 320px; overflow: auto; }
  .finish-cand { display: flex; flex-direction: column; gap: 2px; text-align: left; background: var(--bg-input);
    border: 1px solid var(--border-default); border-radius: 10px; padding: 10px 12px; cursor: pointer; font: inherit; }
  .finish-cand:hover { border-color: var(--accent-primary); background: var(--bg-hover); }
  .finish-cand__t { font-size: 14px; font-weight: 600; color: var(--text-primary); }
  .finish-cand__m { font-size: 12px; color: var(--text-tertiary); font-family: 'DM Mono', monospace; }
  /* "N to finish" list (§4d Slice 3): an ACCORDION — collapsed one-liners you expand to finish */
  .finish-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
  .finish-acc { border: 1px solid var(--border-default); border-radius: 12px; background: var(--bg-input); overflow: hidden; }
  .finish-acc--done { opacity: 0.7; }
  .finish-acc__head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px;
    background: none; border: none; cursor: pointer; font: inherit; text-align: left; color: var(--text-primary); }
  .finish-acc__head:hover:not(:disabled) { background: var(--bg-hover); }
  .finish-acc__head:disabled { cursor: default; }
  .finish-acc__t { font-weight: 600; min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .finish-acc__amt { font-family: 'DM Mono', monospace; color: var(--text-secondary); flex: 0 0 auto; }
  .finish-acc__needs { flex: 0 0 auto; font-size: 11px; padding: 2px 8px; border-radius: 999px;
    background: rgba(124,106,255,.12); color: var(--accent-primary); }
  .finish-acc__needs--done { background: transparent; color: var(--accent-teal); font-weight: 600; }
  .finish-acc__chev { flex: 0 0 auto; display: inline-flex; line-height: 0; color: var(--text-tertiary); transition: transform .15s ease; }
  .finish-acc--open .finish-acc__chev { transform: rotate(180deg); }
  .finish-acc__body { padding: 4px 14px 14px; border-top: 1px solid var(--border-subtle); }
  .finish-acc__body .finish-untag { margin-top: 10px; }

  /* ── CSV import (Settings → Import, §11.4) ─────────────────────────────────────────────── */
  .csv-lanes { font-size: 12px; background: rgba(124,106,255,.07); border: 1px solid var(--border-subtle);
    border-radius: 10px; padding: 9px 12px; }
  .csv-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
    padding: 26px 18px; margin-top: 14px; border: 1.5px dashed var(--border-subtle); border-radius: 14px;
    cursor: pointer; transition: border-color .15s ease, background .15s ease; }
  .csv-drop:hover, .csv-drop:focus-visible { border-color: var(--accent-primary); background: var(--bg-hover); outline: none; }
  .csv-drop--drag { border-color: var(--accent-primary); border-style: solid; background: var(--bg-hover); }
  /* Start-over escape hatch: a discreet ghost button (pushed to the right) that arms an inline confirm. */
  .csv-reset__btn { margin-left: auto; }
  .csv-reset { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .csv-reset__msg { font-size: 13px; }
  .csv-drop__icon { font-size: 22px; color: var(--accent-primary); }
  .csv-drop__t { font-weight: 600; }
  .csv-drop__h { font-size: 12px; }
  .csv-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
  .csv-err { margin-top: 12px; }

  .csv-map { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
  .csv-map__row { display: flex; align-items: center; gap: 12px; }
  .csv-map__row--ask { background: rgba(232,131,74,.07); border-radius: 10px; padding: 6px 8px; margin: -6px -8px; }
  .csv-map__lbl { flex: 0 0 200px; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
  .csv-map__row .dropdown { flex: 1; min-width: 0; }
  .csv-ask { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
    color: var(--accent-amber); background: rgba(232,131,74,.14); border-radius: 999px; padding: 2px 7px; }
  .csv-ok { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
    color: var(--accent-teal); background: rgba(58,191,176,.12); border-radius: 999px; padding: 2px 7px; }

  .csv-tablewrap { margin-top: 14px; overflow-x: auto; border: 1px solid var(--border-subtle); border-radius: 12px; }
  .csv-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .csv-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-tertiary); padding: 8px 12px; border-bottom: 1px solid var(--border-subtle); white-space: nowrap; }
  .csv-table td { padding: 7px 12px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
  .csv-table tr:last-child td { border-bottom: none; }
  .csv-td--desc { color: var(--text-secondary); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .csv-td--amt { text-align: right; white-space: nowrap; }
  .csv-row--bad td { background: rgba(232,131,74,.08); color: var(--text-tertiary); }
  .csv-more { padding: 8px 12px; font-size: 12px; }

  .csv-warn { margin-top: 12px; font-size: 13px; background: rgba(232,131,74,.09);
    border: 1px solid rgba(232,131,74,.3); border-radius: 10px; padding: 9px 12px; }
  /* sign-MEANING control: a calm, brand-accented notice (not amber/teal — it's neutral, not a spend/income cue) */
  .csv-flip { margin-top: 14px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    background: var(--accent-glow); border: 1px solid var(--border-strong); border-radius: 12px; padding: 12px 14px; }
  .csv-flip__info { flex: 1 1 240px; min-width: 0; }
  .csv-flip__lbl { font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--text-secondary);
    text-transform: uppercase; margin-bottom: 4px; }
  .csv-flip__reading { font-size: 14px; color: var(--text-primary); line-height: 1.45; }
  .csv-flip__counts { font-size: 12px; margin-top: 4px; }
  .csv-flip__btn { flex: 0 0 auto; }
  .csv-ccy__combo { flex: 0 0 230px; max-width: 100%; }
  .csv-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
  .csv-soon { font-size: 12px; }

  /* ── CSV review (slice b) ── */
  /* top header: counter on the left, an import button on the right so you can commit what's ready without
     scrolling to the footer (it's in both places). Wraps on a phone. */
  .csv-tophead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; }
  .csv-tophead__left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
  .csv-tophead .csv-counter { margin: 0; }
  .csv-counter { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 14px; }
  .csv-counter__big { font-size: 28px; font-weight: 500; color: var(--accent-primary); font-family: 'DM Mono', monospace; } /* DM Mono's real heaviest is 500 (700 faux-bolds = blurry) */
  .csv-counter__lbl { font-size: 13px; }
  .csv-bulkbar { position: sticky; top: 6px; z-index: 4; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    background: var(--accent-primary); color: #fff; border-radius: 12px; padding: 8px 12px; margin-bottom: 14px; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
  .csv-bulkbar__n { font-weight: 600; margin-right: 4px; }
  .csv-bulkbar .btn { background: rgba(255,255,255,.16); border-color: transparent; color: #fff; }
  .csv-bulkbar .btn--warm { background: var(--accent-amber); }
  /* the import-selected button stands out on the purple bar: solid white pill, purple text (the primary action) */
  .csv-bulkbar .csv-bulkbar__go { background: #fff; color: var(--accent-primary); font-weight: 700; }
  .csv-bulkbar .csv-bulkbar__go:disabled { background: rgba(255,255,255,.4); color: rgba(124,106,255,.6); }

  .csv-sect { margin-top: 16px; }
  .csv-sect__head { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1.5px solid var(--border-subtle); }
  .csv-sect__t { font-weight: 600; }
  .csv-sect__n { font-size: 12px; color: var(--text-tertiary); background: var(--bg-hover); border-radius: 999px; padding: 1px 9px; }
  .csv-sect--transfer .csv-sect__t { color: var(--text-secondary); }
  .csv-sect__empty { padding: 10px 4px; font-size: 13px; }
  .csv-rows { display: flex; flex-direction: column; }

  /* a COMPACT two-line row (line 1 = select·date·raw·amount·skip; line 2 = merchant·category·tags) so a long
     statement stays scannable instead of scrolling forever. */
  .csv-r { display: flex; flex-direction: column; gap: 3px; padding: 6px 6px; border-bottom: 1px solid var(--border-subtle); }
  .csv-r:hover { background: var(--bg-hover); }
  .csv-r--sel { background: rgba(124,106,255,.08); }
  .csv-r--skip { opacity: .45; }
  .csv-r--skip .csv-r__raw, .csv-r--skip .csv-r__desc, .csv-r--skip .csv-r__merch { text-decoration: line-through; }
  .csv-r--sug { box-shadow: inset 3px 0 0 var(--accent-amber); }
  .csv-r__l1 { display: flex; align-items: center; gap: 8px; }
  .csv-r__l2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } /* merchant · category · tag icons */
  /* the row multi-select checkbox: custom-drawn so it's FAINT at rest (a subtle themed outline, not the bright
     native white square that was "too much in the eye") and a touch smaller; a clear purple fill + tick when
     ticked so a selection still reads. Scoped to the CSV review (the section select-all uses the same class). */
  /* padding:0 + box-sizing:border-box are REQUIRED — the global `select, input { padding: 11px 12px }` rule
     was inflating this appearance:none box to ~26px no matter what width was set (the real "size won't change"
     bug). With padding reset, width finally takes effect: 12px ≈ half of what it had been rendering. */
  .csv-check { appearance: none; -webkit-appearance: none; box-sizing: border-box; width: 12px; height: 12px;
    padding: 0; margin-top: 4px; flex: 0 0 auto; cursor: pointer; border: 1px solid #3f3f5c; border-radius: 3px;
    background: transparent; display: inline-grid; place-content: center;
    transition: background .12s ease, border-color .12s ease; } /* #3f3f5c = a touch more visible than --border-default */
  .csv-check::after { content: ""; width: 3px; height: 6px; margin-top: -1px; border: solid #fff;
    border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transform-origin: center; transition: transform .12s ease; }
  .csv-check:hover { border-color: var(--text-tertiary); }
  .csv-check:checked { background: var(--accent-primary); border-color: var(--accent-primary); }
  .csv-check:checked::after { transform: rotate(45deg) scale(1); }
  .csv-check:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }
  .csv-r__date { flex: 0 0 auto; font-size: 12px; color: var(--text-tertiary); white-space: nowrap; }
  /* the raw bank line shares line 1 with the date — it takes the slack and ellipsises */
  .csv-r__raw { flex: 1 1 auto; min-width: 0; font-size: 11px; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .csv-r__desc { flex: 1 1 auto; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* editable clean merchant (what gets stored & learned) — looks like text, reveals as an input on hover/focus.
     A FIXED basis (not flex-grow) keeps the category dropdown's left edge aligned down the column, instead of
     drifting right on rows with a short merchant (the "Pay / Uber" misalignment the human caught). */
  .csv-r__merch, .csv-r__desc { flex: 0 0 120px; min-width: 0; }
  .csv-r__merch { font-size: 13px; font-weight: 600; color: var(--text-primary);
    background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 3px 7px; }
  .csv-r__merch:hover { border-color: var(--border-subtle); }
  .csv-r__merch:focus { outline: none; border-color: var(--accent-primary); background: var(--bg-hover); }
  .csv-r__desc { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 0; }
  .csv-r__cat { flex: 1 1 0; display: flex; align-items: center; gap: 6px; min-width: 0; } /* basis 0 so it GROWS into the space left after the FIXED merchant + tags area (never claims content width → no spurious wrap); every dropdown ends up the same width down a column */
  .csv-r__cat .catpick { min-width: 0; width: 100%; }
  .csv-r__owner { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
  .csv-r__ownerlbl { font-size: 12px; }
  /* the tag chips = MONOCHROME icon buttons (currentColor SVG + tooltip). text-secondary at rest so they read
     clearly on the dark surface (the emoji set buried ↻/▦ into the background); purple fill when on. */
  /* a FIXED-width tag area (sized to hold the 4 expense icons on ONE row) so the category to its left is the
     same width on every row — a credit (1 icon) and an expense (4 icons) line up identically (the human's
     "choosers must match"). Icons wrap inside only in the rare 5-tag (2-member household) case. */
  .csv-tags { display: flex; gap: 2px; flex-wrap: wrap; align-items: center; flex: 0 0 100px; }
  .csv-tag { display: inline-flex; align-items: center; justify-content: center; color: var(--text-secondary);
    border: 1px solid var(--border-subtle); background: transparent; border-radius: 8px; padding: 2px; cursor: pointer; }
  .csv-tag svg { width: 16px; height: 16px; display: block; }
  .csv-tag:hover { color: var(--text-primary); border-color: var(--accent-primary); background: var(--bg-hover); }
  /* §schema LABEL tags on a CSV review row (Phase 5): the "＋ tags" reveal sits inline; the expanded chip input
     wraps to its OWN line within the (flex-wrap) l2 so it never disturbs the fixed merchant/category column widths. */
  .csv-r__addtags { flex: 0 0 auto; font-size: 12px; padding: 2px 0; }
  .csv-r__tags { flex: 1 1 100%; min-height: 36px; padding: 4px 6px; }
  .csv-r__tags .taginput__field { min-width: 70px; }
  .csv-tag--on { color: #fff; background: var(--accent-primary); border-color: var(--accent-primary); }
  .csv-r__amt { flex: 0 0 auto; text-align: right; white-space: nowrap; font-size: 13px; }
  .csv-r__amt--in { color: var(--accent-teal); }
  .csv-r__amt--ret { color: var(--accent-gold); } /* a refund = money returned (Bible §3) */
  .csv-r__skip { flex: 0 0 auto; background: transparent; border: none; color: var(--text-tertiary); font-size: 16px; cursor: pointer; padding: 0 4px; border-radius: 8px; line-height: 1; }
  .csv-r__skip:hover { background: var(--bg-hover); color: var(--accent-amber); }

  /* ── 3-column triage board (Sorted · To categorise · Transfers side by side on desktop) ──
     Columns use minmax(MIN, 1fr): they FILL the available width on a roomy screen but never shrink below MIN,
     and the board itself scrolls horizontally (overflow-x:auto = the safety net the human asked for) on a screen
     too small to hold the chosen column count — so a column can never silently run off the page again. It still
     collapses to 2 then 1 column at narrower viewports so scrolling is rarely needed. */
  .csv-cols { display: grid; grid-template-columns: 1fr; gap: 0 14px; align-items: start; }
  @media (min-width: 720px) { .csv-cols { grid-template-columns: repeat(2, minmax(300px, 1fr)); } }
  /* 3-up only when there's room; the board h-scrolls if a small screen can't hold three (the safety net). The
     overflow is scoped here (≥1180) so it never clips a category popup at narrower widths, where the per-column
     scroller below isn't active yet. */
  @media (min-width: 1180px) { .csv-cols { grid-template-columns: repeat(3, minmax(320px, 1fr)); overflow-x: auto; overflow-y: hidden; padding-bottom: 2px; } }
  .csv-cols .csv-sect { margin-top: 14px; min-width: 0; }
  .csv-cols .csv-r { padding: 6px 4px; }
  /* on a desktop board each column scrolls on its own with a sticky label, so all three stay in view at once */
  @media (min-width: 1080px) {
    .csv-cols .csv-sect__head { position: sticky; top: 0; background: var(--bg-surface); z-index: 2; }
    .csv-cols .csv-rows { max-height: calc(100vh - 300px); overflow-y: auto; overflow-x: hidden; }
  }
  /* FAINT, thin column scrollbars: invisible at rest, a faint thin thumb appears only while the cursor is over
     the column (i.e. while you're scrolling it) — never the chunky default bar. (The human: "too much to look
     at … should pretty much be invisible.") The 2px transparent border + content-box clip thins the thumb. */
  .csv-cols .csv-rows { scrollbar-width: thin; scrollbar-color: transparent transparent; }
  .csv-cols .csv-rows:hover { scrollbar-color: var(--border-default) transparent; }
  .csv-cols .csv-rows::-webkit-scrollbar { width: 8px; }
  .csv-cols .csv-rows::-webkit-scrollbar-track { background: transparent; }
  .csv-cols .csv-rows::-webkit-scrollbar-thumb { background: transparent; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
  .csv-cols .csv-rows:hover::-webkit-scrollbar-thumb { background: var(--border-default); background-clip: content-box; }
  .csv-cols .csv-rows::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); background-clip: content-box; }

  /* ── CSV duplicates (slice c) ── */
  .csv-overlap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; font-size: 13px;
    background: rgba(232,131,74,.10); border: 1px solid rgba(232,131,74,.3); border-radius: 10px; padding: 9px 12px; }
  .csv-rw { border-bottom: 1px solid var(--border-subtle); }
  .csv-rw .csv-r { border-bottom: none; }
  .csv-rw--dup { box-shadow: inset 3px 0 0 var(--accent-amber); background: rgba(232,131,74,.05); }
  .csv-r__descline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .csv-duppill { font-size: 11px; border: 1px solid rgba(232,131,74,.45); background: rgba(232,131,74,.12); color: var(--accent-amber);
    border-radius: 999px; padding: 1px 9px; cursor: pointer; white-space: nowrap; }
  .csv-dup { margin: 0 6px 10px 34px; background: var(--bg-hover); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 10px 12px; }
  .csv-dup__lead { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
  .csv-dup__match { display: flex; align-items: center; gap: 12px; font-size: 13px; padding: 6px 0; flex-wrap: wrap; }
  .csv-dup__desc { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .csv-dup__opts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
  .csv-res--on { outline: 2px solid var(--accent-primary); outline-offset: 1px; }
  .csv-dup__hint { font-size: 11px; margin-top: 8px; }

  /* ── review redesign: section tabs · merchant/category grouping · light category controls ──
     The two levers that kill the old "wall of boxes": FEWER pickers (group by merchant) and LIGHTER pickers
     (ghost "+ categorise" with no border at rest). Section tabs double as a focus control. */
  .csv-tabs { display: inline-flex; background: var(--bg-input); border: 1px solid var(--border-default);
    border-radius: 12px; padding: 3px; gap: 2px; margin: 4px 0 6px; max-width: 100%; overflow-x: auto; }
  .csv-tab { appearance: none; border: 0; background: transparent; color: var(--text-secondary); font: inherit;
    font-weight: 600; font-size: 13.5px; padding: 8px 14px; border-radius: 9px; cursor: pointer; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 7px; }
  .csv-tab__n { font-size: 12px; color: var(--text-tertiary); background: var(--bg-hover); border-radius: 999px; padding: 1px 8px; }
  .csv-tab--on { background: var(--accent-primary); color: #fff; }
  .csv-tab--on .csv-tab__n { color: #fff; background: rgba(255,255,255,.22); }
  .csv-tab--auto.csv-tab--on { background: var(--accent-teal); color: #06231b; }    /* Sorted = teal (positive, done) */
  .csv-tab--auto.csv-tab--on .csv-tab__n { color: #06231b; background: rgba(0,0,0,.16); }

  .csv-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0 8px; }
  .csv-toolbar__lbl { font-size: 13px; }
  .csv-toolbar .dropdown { width: auto; min-width: 150px; }
  .csv-toolbar__meta { font-size: 13px; margin-left: 6px; }
  /* credits-only segmented filter — money-in reads teal, so the active segment tints teal */
  .csv-creditseg { display: inline-flex; border: 1px solid var(--border-default); border-radius: 8px; overflow: hidden; }
  .csv-creditseg__b { appearance: none; border: 0; background: transparent; color: var(--text-tertiary);
    font: inherit; font-size: 12px; padding: 6px 12px; cursor: pointer; }
  .csv-creditseg__b + .csv-creditseg__b { border-left: 1px solid var(--border-default); }
  .csv-creditseg__b:hover { color: var(--text-primary); }
  .csv-creditseg__b--on { background: rgba(62,207,170,.14); color: var(--accent-teal); font-weight: 600; }

  /* BOARD — 3-up overview; columns fill the width, collapse to 2 then 1. No per-column scroll (the page scrolls). */
  .csv-board { display: grid; grid-template-columns: 1fr; gap: 6px 26px; align-items: start; margin-top: 14px; }
  @media (min-width: 760px) { .csv-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (min-width: 1100px) { .csv-board { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .csv-bcol { min-width: 0; }
  .csv-bcol__head { display: flex; align-items: center; gap: 10px; padding: 4px 2px 8px; border-bottom: 1px solid var(--border-default); }
  .csv-bcol__t { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 16px; }
  .csv-bcol--transfer .csv-bcol__t { color: var(--text-secondary); }
  .csv-focbtn { margin-left: auto; appearance: none; border: 1px solid var(--border-default); background: transparent;
    color: var(--text-tertiary); border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
  .csv-focbtn:hover { color: var(--text-primary); border-color: var(--border-strong); }

  /* FOCUS — one section full-width but capped for comfortable reading */
  .csv-focus { max-width: 880px; }

  /* the GROUP row — light + airy; one decision per merchant */
  .csv-grpwrap { border-bottom: 1px solid var(--border-subtle); }
  .csv-grp { display: flex; align-items: center; gap: 14px; padding: 15px 4px; }
  .csv-grp--compact { padding: 12px 2px; gap: 10px; }
  /* the group main area is tap-to-expand (mirrors the ledger row); padding+negative margin gives the hover a
     target without shifting the siblings (category control / chevron). */
  .csv-grp__main { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; cursor: pointer;
    border-radius: 8px; padding: 4px 6px; margin: -4px -6px; }
  .csv-grp__main:hover { background: var(--bg-hover); }
  .csv-grp__main:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }
  .csv-grp__name { flex: 1 1 auto; min-width: 0; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .csv-grp--compact .csv-grp__name { font-size: 14px; }
  .csv-chip { flex: none; font-size: 12px; color: var(--text-secondary); background: var(--bg-hover); border-radius: 999px; padding: 2px 9px; font-weight: 500; }
  .csv-grp__range { flex: none; font-size: 13px; }
  /* the board is the at-a-glance OVERVIEW — drop the amount range in its narrow columns so the merchant name
     keeps full width (amounts show in the focused single-column view). */
  .csv-grp--compact .csv-grp__range { display: none; }
  .csv-grp--in .csv-grp__range { color: var(--accent-teal); }            /* a credit group (refund/income in) reads teal */
  .csv-grp__dup { flex: none; font-size: 11px; color: var(--accent-amber); border: 1px solid rgba(232,131,74,.4);
    background: rgba(232,131,74,.1); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
  /* ghost category control: NO border at rest (the white space), becomes a real picker on engage */
  .csv-ghostcat { flex: none; appearance: none; border: 1px dashed transparent; background: transparent;
    color: var(--accent-primary); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; padding: 6px 10px; border-radius: 9px; }
  .csv-ghostcat:hover { border-color: var(--border-strong); background: var(--bg-elevated); }
  .csv-catset { flex: none; appearance: none; border: 1px solid var(--border-default); background: var(--bg-elevated);
    color: var(--text-primary); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; padding: 6px 12px;
    border-radius: 9px; display: inline-flex; align-items: center; gap: 7px; max-width: 220px; }
  .csv-catset__lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .csv-catset--various { color: var(--text-tertiary); font-weight: 500; }
  /* PARTIAL consensus — a leaning category with rows still blank; dashed (= not finished) + a purple "N to go"
     count signalling one tap fills the rest (mirrors the dashed ＋categorise ghost's actionable language). */
  .csv-catset--part { border-style: dashed; border-color: var(--border-strong); }
  .csv-catset__more { flex: none; color: var(--accent-primary); font-weight: 600; font-size: 12px; }
  .csv-tick { flex: none; color: var(--accent-teal); font-weight: 800; }
  .csv-grp .catpick { flex: none; width: 240px; max-width: 100%; }      /* the inline picker while choosing */
  .csv-grp--compact .catpick { width: 100%; }
  /* per-group one-click Import — shows once the whole group is ready; compact so a column of them stays calm */
  .csv-grpimport { flex: none; padding: 6px 14px; font-size: 13px; white-space: nowrap; }
  .csv-exp { flex: none; appearance: none; border: 0; background: transparent; color: var(--text-tertiary);
    cursor: pointer; font-size: 15px; padding: 6px; border-radius: 8px; width: 30px; line-height: 1; }
  .csv-exp:hover { background: var(--bg-hover); color: var(--text-primary); }
  /* expanded individual rows under a group (rowEl) — slightly inset + a calm background */
  .csv-sub { padding: 2px 0 10px 10px; }
  .csv-sub .csv-rw { border-bottom: 1px solid var(--border-subtle); }
  .csv-sub .csv-rw:last-child { border-bottom: none; }
  .csv-grphint { font-size: 13px; margin-top: 16px; }

  /* group merchant rename (one-shot, focus view) — the ✎ pencil beside the name + the inline rename box */
  .csv-grp__editbtn { flex: none; appearance: none; border: 0; background: transparent; color: var(--text-tertiary);
    cursor: pointer; font-size: 14px; padding: 6px 8px; border-radius: 8px; line-height: 1; }
  .csv-grp__editbtn:hover { background: var(--bg-hover); color: var(--accent-primary); }
  .csv-grp__rename { flex: 1 1 auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
  .csv-grp__renameinput { flex: 1 1 auto; min-width: 0; appearance: none; font: inherit; font-weight: 600; font-size: 15px;
    color: var(--text-primary); background: var(--bg-elevated); border: 1px solid var(--accent-primary); border-radius: 9px; padding: 7px 11px; }
  .csv-grp__renameinput:focus { outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }
  .csv-grp__renamehint { flex: none; font-size: 12px; white-space: nowrap; }

  /* duplicate review overlay — the "check each" gather-all (every flagged dup in one place) */
  .csv-dupreview__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; font-size: 13px; }
  .csv-dupreview__list { display: flex; flex-direction: column; gap: 12px; }
  .csv-dupreview__empty { font-size: 14px; }
  .csv-dupr { border: 1px solid var(--border-default); border-radius: 12px; padding: 11px 12px; background: rgba(232,131,74,.06); }
  .csv-dupr__row { display: flex; align-items: baseline; gap: 9px; font-size: 13px; }
  .csv-dupr__row--match { margin-top: 4px; opacity: .85; }
  .csv-dupr__tag { flex: none; width: 62px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
  .csv-dupr__date { flex: none; }
  .csv-dupr__desc { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .csv-dupr__amt { flex: none; font-weight: 500; } /* DM Mono ships no 600 → 600 faux-bolds (smeary/"blurry"); 500 is its real heaviest */
  .csv-dupr__opts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
  .csv-overlap__txt { flex: 1 1 auto; }

  @media (max-width: 640px) {
    .csv-map__row { flex-direction: column; align-items: stretch; gap: 6px; }
    .csv-map__lbl { flex: none; }
    .csv-dup { margin-left: 6px; }
    /* on a phone, drop line 2's indent so the merchant + category get the full row width (tags wrap beneath) */
    .csv-r__l2 { padding-left: 0; gap: 6px; }
    /* grouped review on a phone: let the group row wrap so the category control drops below the name (the name
       keeps priority), and the inline picker + focus column take the full width. */
    .csv-grp { flex-wrap: wrap; gap: 8px 10px; }
    .csv-grp__main { flex: 1 1 100%; }
    .csv-grp .catpick { width: 100%; }
    .csv-focus { max-width: 100%; }
    .csv-sub { padding-left: 4px; }
    /* preview/mapping table: keep ALL columns visible on a phone — esp. the AMOUNT (it was scrolling off the
       right edge inside the table's own scroller). Tighten padding + font and cap the description so the fixed
       date / type / amount columns always fit; a long raw bank line ellipsises instead of pushing them off. */
    .csv-table { font-size: 12px; }
    .csv-table th, .csv-table td { padding: 7px 8px; }
    .csv-td--desc { max-width: 92px; }
  }

  /* ── Intentions / Spending Plans (§4.14) — INLINE TREE editor: savings floor + the spending tree, each row a control ── */
  .intent__forctx { font-size: 12px; color: var(--text-tertiary); margin: -2px 0 0; }
  /* a row = name/hint on the left, the [ccy|%] + amount control on the right; rows WRAP so a long name never
     crushes the control (and vice-versa) — the control simply drops onto its own line when there's no room. */
  .intent-srow, .intent-hrow, .intent-crow { display: flex; align-items: center; justify-content: space-between; gap: 10px 12px;
    flex-wrap: wrap; padding: 10px 2px; border-top: 1px solid var(--border-subtle); }
  .intent-savecard { border-left: 3px solid var(--accent-teal); }     /* savings = teal (positive, §3) */
  .intent-goals__hdr { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin: 10px 2px 2px; }   /* "Saving toward" sub-heading */
  .intent-goalrow { border-top: 1px solid var(--border-subtle, var(--border-default)); padding-top: 8px; }
  /* "budget from reality" mirror (slice 5) */
  .intent-mirrorcta { display: flex; justify-content: flex-end; margin: 2px 2px 8px; }
  .intent-mirror__hdr { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
  .intent-mirror__title { margin: 0; font-size: 1rem; }
  .intent-mirror__intro { font-size: 12px; margin: 0 0 10px; }
  .intent-mirror__kept { font-size: 13px; margin: 0 0 6px; }
  .intent-mirror__kept--ok { color: var(--accent-teal); }
  .intent-mirror__kept--over { color: var(--accent-warm); }
  .intent-mirror__room { font-size: 12px; color: var(--text-secondary); margin: 0 0 12px; }
  .intent-mirror__hrow { display: flex; justify-content: space-between; align-items: baseline; margin: 12px 0 4px; font-weight: 500; }
  .intent-mirror__hamt { font-variant-numeric: tabular-nums; color: var(--text-secondary); }
  .intent-mirror__crow { display: flex; align-items: center; gap: 10px; padding: 5px 2px 5px 12px; cursor: pointer; }
  .intent-mirror__cname { flex: 1 1 auto; }
  .intent-mirror__camt { font-variant-numeric: tabular-nums; color: var(--text-secondary); }
  .intent-mirror__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
  .intent-srow { border-top: none; padding: 4px 2px; }
  .intent-tree__hint { font-size: 12px; margin: 0 0 8px; }
  .intent-rowmain { min-width: 140px; flex: 1 1 auto; display: flex; align-items: center; gap: 8px; }
  .intent-rowmain--btn { background: none; border: none; padding: 6px 4px; margin: -6px -4px; text-align: left; cursor: pointer; color: inherit; border-radius: 8px; }
  .intent-rowmain--btn:hover { background: var(--bg-hover); }
  .intent-hrow .intent-rowname { font-size: 15px; color: var(--text-primary); font-weight: 600; }
  /* categories sit clearly INDENTED under their header (a bullet-style nesting cue, on top of the lighter font) */
  .intent-crow { padding-left: 34px; }
  .intent-crow .intent-rowname { font-size: 14px; color: var(--text-secondary); }
  .intent-rowname { overflow-wrap: anywhere; }                        /* wrap at spaces; break only a too-long single word */
  .intent-rowname--savings { font-size: 15px; color: var(--accent-teal); }
  .intent-rowhint { font-size: 12px; margin: 2px 0 0; }
  .intent-srow .intent-rowmain { flex-direction: column; align-items: flex-start; gap: 1px; }
  .intent-chev { display: inline-flex; color: var(--text-tertiary); transition: transform .15s ease; }
  .intent-chev--collapsed { transform: rotate(-90deg); }
  /* the control — keeps its content size; wraps onto its own line under a long name. max-width caps it so a
     long resolved/warning line WRAPS within the column instead of stretching the row off the card edge. */
  /* max-width holds the $/% toggle + amount + cadence chip on ONE line (resolved/warn/midwin still wrap below,
     they're flex-basis:100%). Widened from 230 so the compact cadence chip sits INLINE, not on its own row. */
  .intent-ctrl { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; max-width: 272px; }
  /* the $/% toggle now lives INSIDE the amount field as a clickable symbol pill (the separate segment was removed
     to free space + a colour). Subtle at rest; purple on hover/focus = a tappable action. */
  .intent-money2 { display: flex; align-items: center; gap: 4px; border: 1px solid var(--border-default);
    border-radius: 9px; padding: 0 7px; background: var(--bg-surface); width: 116px; }
  .intent-money2:focus-within { border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-glow); }
  .intent-affix { flex: none; color: var(--text-tertiary); font-size: 13px; }
  .intent-affix--btn { cursor: pointer; border: none; background: var(--bg-elevated); color: var(--text-secondary);
    padding: 3px 6px; margin: 0; border-radius: 6px; font-size: 12px; font-weight: 500; line-height: 1; font-family: inherit; }
  .intent-affix--btn:hover { background: var(--accent-primary); color: var(--on-accent-primary); }
  .intent-affix--btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent-glow); }
  .intent-amt { flex: 1; min-width: 0; border: none; background: none; box-shadow: none; outline: none; padding: 9px 0; text-align: right; }
  .intent-amt:focus { border: none; box-shadow: none; outline: none; }
  .intent-resolved { font-size: 11px; color: var(--accent-teal); flex-basis: 100%; max-width: 100%; text-align: right; white-space: normal; overflow-wrap: anywhere; }
  .intent-resolved--needs { color: var(--accent-primary); }           /* calm purple nudge, never alarm */
  /* a HARD-block marker on a row (amber = needs a fix), + the input ring goes amber */
  .intent-warn { font-size: 11px; color: var(--accent-warm); flex-basis: 100%; max-width: 100%; text-align: right; white-space: normal; overflow-wrap: anywhere; }
  .intent-money2--bad { border-color: var(--accent-warm); }
  .intent-money2--bad:focus-within { border-color: var(--accent-warm); box-shadow: 0 0 0 3px rgba(232,168,80,.18); }
  /* PERIOD cadence chip (§4.14, Variant A) — a compact clock + letter; tap opens a small menu. Monthly reads muted,
     a longer cadence tints teal so it's visible at a glance. Sits INLINE with the $/% toggle + amount (no wrap). */
  /* a FIXED-WIDTH slot the cadence chip lives in — reserved on EVERY row (empty on savings/goals) so the amount
     boxes align in one clean column regardless of whether a row shows a chip or how wide the chip is. */
  .intent-cadslot { flex: 0 0 44px; display: flex; align-items: center; justify-content: center; }
  .intent-cad { display: inline-flex; align-items: center; gap: 3px; flex: 0 0 auto; border: 1px solid var(--border-default);
    background: var(--bg-surface); color: var(--text-tertiary); border-radius: 8px; padding: 5px 7px; line-height: 0; }
  .intent-cad svg { width: 15px; height: 15px; }
  .intent-cad__l { font-size: 11px; font-weight: 500; line-height: 1; font-family: 'DM Mono', ui-monospace, monospace; }
  .intent-cad:hover { border-color: var(--border-strong); color: var(--text-secondary); }
  .intent-cad--on { color: var(--accent-primary); border-color: color-mix(in srgb, var(--accent-primary) 50%, var(--border-default)); background: color-mix(in srgb, var(--accent-primary) 10%, var(--bg-surface)); }
  /* monthly = the ASSUMED default: a faint, icon-only clock (no letter) — a quiet "you could set a cadence here"
     affordance that doesn't repeat "Monthly" down every row. Brightens on hover. Non-monthly shows the teal chip. */
  .intent-cad--ghost { border-color: transparent; opacity: .4; }
  .intent-cad--ghost:hover { opacity: 1; border-color: var(--border-default); color: var(--text-secondary); }
  .intent-cad:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }
  /* the cadence menu (a small themed popover; position set inline by JS) */
  .intent-cadpop { position: fixed; z-index: 120; background: var(--bg-elevated); border: 1px solid var(--border-default);
    border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.5); padding: 5px; min-width: 148px; }
  .intent-cadpop__opt { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; background: none;
    border: none; color: var(--text-secondary); font-size: 13px; padding: 8px 10px; border-radius: 7px; }
  .intent-cadpop__opt:hover { background: var(--bg-hover); color: var(--text-primary); }
  .intent-cadpop__opt--sel { color: var(--accent-primary); }
  .intent-cadpop__tick { width: 12px; flex: none; font-size: 12px; }
  /* calm, informational mid-window creation note (not an apology) */
  .intent-midwin { font-size: 11px; color: var(--text-tertiary); flex-basis: 100%; max-width: 100%; text-align: right; white-space: normal; overflow-wrap: anywhere; margin-top: 2px; }
  /* "already committed" line (§11/§28) — quiet info; below-plan variant is a calm purple nudge, NEVER amber
     (it's the user's call, not a mistake to fix) */
  .intent-committed { font-size: 11px; color: var(--text-tertiary); flex-basis: 100%; max-width: 100%; text-align: right; white-space: normal; overflow-wrap: anywhere; margin-top: 2px; }
  .intent-committed--below { color: var(--accent-primary); }
  /* R3 (2026-07-19): the cadence "working" ("($1,000 fortnightly)") is tappable — a calm dotted underline says
     "there's more here" without shouting; tapping opens the anchored per-frequency math panel (.ana-blocknote). */
  .intent-cadinfo { cursor: help; text-decoration: underline dotted; text-decoration-color: var(--border-strong); text-underline-offset: 2px; border-radius: 3px; }
  .intent-cadinfo:hover, .intent-cadinfo:focus-visible { color: var(--text-secondary); text-decoration-color: var(--text-secondary); outline: none; }
  .intent-cadinfo:focus-visible { background: var(--accent-glow); }
  .intent-committedsum { font-size: 12px; color: var(--text-tertiary); margin: 6px 2px 0; }
  /* the window label under a non-monthly Track row's name ("this quarter (Jul–Sep)") + the forecast-annotation seam */
  .intent-track__win { display: block; font-size: 11px; color: var(--text-tertiary); margin-top: 1px; font-weight: 400; }
  .intent-track__annot { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }
  /* the sticky FOOTER — meter (or income ask) + the over-commit confirm + the save row, always visible */
  .intent-footer { position: sticky; bottom: 0; margin-top: 12px; padding: 10px 12px 12px;
    background: linear-gradient(to top, var(--bg-base) 78%, transparent); }
  .intent-savebar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
  .intent-applyfrom { display: flex; align-items: center; gap: 8px; margin-right: auto; }
  .intent-applyfrom__lbl { font-size: 12px; color: var(--text-tertiary); }
  .intent-savebar__count { font-size: 12px; color: var(--accent-primary); }
  .intent-savebar__count--bad { color: var(--accent-warm); }
  .intent-savebar__count--ok { color: var(--accent-teal); }
  /* ── Set-screen two-column workspace (Variant A) — tree left, "Your picture" card right on desktop ── */
  .intent-setmain { min-width: 0; }
  .intent-treehead { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
  .intent-treehead__ttl { font-size: 15px; font-weight: 600; color: var(--text-primary); margin: 0; }
  .intent-master { display: flex; align-items: center; gap: 8px; }
  .intent-master__lbl { font-size: 11px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .05em; }
  .intent-master__seg { display: inline-flex; border: 1px solid var(--border-default); border-radius: 8px; overflow: hidden; }
  .intent-master__b { background: var(--bg-surface); border: none; color: var(--text-tertiary); font-size: 12px; padding: 6px 11px; line-height: 1; cursor: pointer; min-width: 30px; }
  .intent-master__b + .intent-master__b { border-left: 1px solid var(--border-default); }
  .intent-master__b:hover { color: var(--text-secondary); background: var(--bg-hover); }
  .intent-master__b--on, .intent-master__b--on:hover { background: var(--accent-primary); color: var(--on-accent-primary); }   /* the chosen "set all" side fills with the app accent */
  /* gentle "you'd overwrite N rows that already have a value" confirm, under the master toggle (never blocks) */
  .intent-masterconfirm { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap;
    margin: 4px 0 10px; padding: 10px 12px; border: 1px solid var(--border-default); border-radius: 10px; background: var(--bg-elevated); }
  .intent-masterconfirm__msg { font-size: 12.5px; color: var(--text-secondary); flex: 1 1 200px; min-width: 0; }
  .intent-masterconfirm__btns { display: flex; gap: 8px; flex: 0 0 auto; }
  .intent-sidetitle { display: none; }
  @media (min-width: 900px) {
    .intent-setlayout { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 20px; align-items: start; }
    /* the footer becomes a sticky sidebar CARD (its phone form stays the bottom-pinned gradient bar below 900px) */
    .intent-footer { position: sticky; top: 16px; bottom: auto; margin-top: 0; padding: 16px; background: var(--bg-surface);
      border: 1px solid var(--border-subtle); border-radius: 14px; max-height: calc(100vh - 32px); overflow: auto; }
    .intent-footer .intent-meter { background: none; border: none; padding: 0; }
    .intent-sidetitle { display: block; font-size: 12px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }
    .intent-footer .intent-savebar { flex-direction: column; align-items: stretch; gap: 10px; }
    .intent-footer .intent-applyfrom { margin-right: 0; }
    .intent-footer .intent-savebar .btn { width: 100%; }
  }
  /* live meter */
  .intent-meter { padding: 10px 12px; border-radius: 12px; background: var(--bg-surface); border: 1px solid var(--border-subtle); }
  .intent-meter--over { border-color: var(--accent-warm); }
  .intent-meter__line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; }
  .intent-meter__planned { color: var(--text-primary); }
  .intent-meter__left { color: var(--accent-teal); font-variant-numeric: tabular-nums; }
  .intent-meter__left--over { color: var(--accent-warm); }
  .intent-meter__track { height: 6px; border-radius: 6px; background: var(--bg-base); overflow: hidden; margin: 7px 0 5px; }
  .intent-meter__fill { height: 100%; background: var(--accent-primary); border-radius: 6px; transition: width .18s ease; }
  .intent-meter--over .intent-meter__fill { background: var(--accent-warm); }
  .intent-meter__note { font-size: 11px; display: flex; gap: 6px; align-items: center; }
  .intent-meter__editincome { font-size: 11px; }
  /* inline rough-income ask (no income yet) */
  .intent-incomeask { padding: 12px; border-radius: 12px; background: var(--bg-surface); border: 1px solid var(--accent-primary); }
  .intent-incomeask__label { font-size: 14px; color: var(--text-primary); }
  .intent-incomeask__hint { font-size: 12px; margin: 2px 0 8px; }
  .intent-incomeask__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .intent-incomeask__row .intent-money2 { width: 160px; }
  .intent-incomeask__err { font-size: 12px; color: var(--accent-warm); flex-basis: 100%; }
  /* over-commitment courtesy — calm, never alarm (amber would read as a telling-off); purple accent + a soft surface */
  .intent-overcommit { margin-top: 8px; padding: 12px 14px; border-radius: 12px; background: var(--bg-surface);
    border: 1px solid var(--accent-primary); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
  .intent-overcommit__msg { font-size: 13px; color: var(--text-secondary); margin: 0; flex: 1 1 240px; }
  .intent-overcommit__btns { display: flex; gap: 8px; flex: none; }
  /* Set ⇄ Track toggle (in the header card) */
  .intent-modeseg { display: inline-flex; margin-top: 12px; border: 1px solid var(--border-default); border-radius: 10px; overflow: hidden; }
  .intent-modeseg__b { background: var(--bg-surface); border: none; color: var(--text-tertiary); font-size: 13px; padding: 8px 18px; cursor: pointer; }
  .intent-modeseg__b + .intent-modeseg__b { border-left: 1px solid var(--border-default); }
  .intent-modeseg__b:hover { color: var(--text-secondary); }
  .intent-modeseg__b--on { background: var(--accent-primary); color: var(--on-accent-primary, #fff); }
  /* TRACK view — actual-vs-intention rows (calm; tone by status, never alarm) */
  .intent-trackcard { display: flex; flex-direction: column; }
  .intent-track__hdr { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
  .intent-track__sub { font-size: 12px; margin: 0; }
  /* range selector */
  .intent-rangeseg { display: inline-flex; border: 1px solid var(--border-default); border-radius: 9px; overflow: hidden; flex: none; }
  .intent-rangeseg__b { background: var(--bg-surface); border: none; color: var(--text-tertiary); font-size: 12px; padding: 6px 11px; cursor: pointer; white-space: nowrap; }
  .intent-rangeseg__b + .intent-rangeseg__b { border-left: 1px solid var(--border-default); }
  .intent-rangeseg__b:hover { color: var(--text-secondary); }
  .intent-rangeseg__b--on { background: var(--accent-primary); color: var(--on-accent-primary, #fff); }
  .intent-rangeseg__b:disabled { opacity: .5; cursor: default; }
  /* income BASIS switcher (stated-income override) — reuses the .intent-rangeseg segmented control */
  .intent-incomebasis { flex-wrap: wrap; }
  .intent-incomebasis__lbl { font-weight: 500; color: var(--text-secondary); }
  .intent-incomeseg { flex-wrap: wrap; }
  .intent-incomebasis__entry { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; margin-top: 6px; }
  .intent-incomebasis__entry .intent-money2 { width: 150px; }
  @media (max-width: 480px) { .intent-incomeseg .intent-rangeseg__b { padding: 6px 8px; font-size: 11px; } }
  /* actual-vs-planned income awareness note (calm — teal for above/good news, muted for below; never alarm) */
  .intent-incomenote { font-size: 12px; margin: 2px 0 10px; }
  .intent-incomenote--above { color: var(--accent-teal); }
  .intent-incomenote--below { color: var(--text-tertiary); }
  /* TABLE-like: name · Planned · So far (aligned columns + a small header); calm — numbers are NOT coloured */
  .intent-track__cols, .intent-track__grid { display: grid; grid-template-columns: minmax(0, 1fr) 96px 96px; gap: 2px 16px; align-items: baseline; }
  .intent-track__cols { margin: 2px 0; padding: 0 2px; }
  .intent-track__collbl { font-size: 11px; color: var(--text-tertiary); text-align: right; }
  .intent-track { padding: 9px 2px; border-top: 1px solid var(--border-subtle); }
  .intent-track__name { font-size: 14px; color: var(--text-primary); min-width: 0; overflow-wrap: anywhere; }
  .intent-track__num { font-size: 14px; color: var(--text-secondary); text-align: right; font-variant-numeric: tabular-nums; }
  .intent-track__num--planned { color: var(--text-tertiary); }   /* the plan is the muted reference; "so far" is the live one */
  /* a THIN, SHORT bar + the over/under status line — the only coloured bits */
  .intent-track__foot { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
  .intent-track__bar { height: 4px; width: 150px; max-width: 42%; border-radius: 4px; background: var(--bg-surface); overflow: hidden; flex: none; }
  .intent-track__fill { height: 100%; border-radius: 4px; background: var(--accent-teal); transition: width .2s ease; }
  .intent-track__cap { font-size: 12px; color: var(--text-tertiary); }
  /* ceiling: within = teal; nearing/below = calm secondary; over = calm amber (still-within-your-picture, never red) */
  .intent-track--within .intent-track__cap { color: var(--accent-teal); }
  .intent-track--nearing .intent-track__cap { color: var(--text-secondary); }
  .intent-track--over .intent-track__fill { background: var(--accent-warm); }
  .intent-track--over .intent-track__cap { color: var(--accent-warm); }
  /* floor: met = TEAL/green (positive kept, not gold); below = calm, no warning */
  .intent-track--met .intent-track__fill { background: var(--accent-teal); }
  .intent-track--met .intent-track__cap { color: var(--accent-teal); }
  .intent-track--below .intent-track__cap { color: var(--text-secondary); }
  .intent-track--needsIncome .intent-track__cap { color: var(--accent-primary); }
  @media (max-width: 480px) { .intent-track__cols, .intent-track__grid { grid-template-columns: minmax(0, 1fr) 78px 78px; gap: 2px 10px; } }

  /* ── entry RULES (§28 amended 2026-07-16): the +Add quick bar · the Settings manager · bulk pill ── */
  .rules-bar { padding: 14px 16px; }
  .rules-bar__in { width: 100%; box-sizing: border-box; }
  .rules-bar__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
  .rules-bar__chips:empty { display: none; }
  .rules-bar__chip { appearance: none; font-family: inherit; cursor: pointer; display: inline-flex; flex-direction: column;
    align-items: flex-start; gap: 2px; text-align: left; padding: 7px 11px; border-radius: 10px; max-width: 100%;
    background: var(--bg-input); border: 1px solid var(--border-default); color: var(--text-secondary); }
  .rules-bar__chip:hover { background: var(--bg-hover); }
  .rules-bar__chip--on { border-color: var(--accent-primary); box-shadow: 0 0 0 2px var(--accent-glow); color: var(--text-primary); }
  .rules-bar__chipname { font-weight: 600; font-size: 14px; color: var(--text-primary); }
  .rules-bar__chipsum { font-size: 12px; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
  .rules-bar__stage { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
  .rules-bar__stage:empty { display: none; }
  .rules-bar__note { font-size: 13px; color: var(--text-secondary); }
  .rules-bar__amt { width: 130px; }
  .entry-savearule { margin-top: 10px; }
  /* manager rows (Settings → Rules) — mirrors the merchant-rule row */
  .rulerow__name { font-weight: 600; color: var(--text-primary); margin-right: 10px; }
  .rulerow__sum { font-size: 12.5px; display: block; margin-top: 2px; }
  .rulerow__stale { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--accent-warm); }
  .rulerow__confirm { flex-basis: 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 8px; }
  .rulerow__confirmq { font-size: 13px; color: var(--text-secondary); }
  .rulemodal__amtrow { display: flex; gap: 8px; }
  .rulemodal__amtrow input[type="number"] { flex: 1 1 auto; min-width: 0; }
  .rulemodal__amtrow .combo { flex: 0 0 150px; }
  .rulemodal__hint { margin: -4px 0 10px; }
  /* recurring-door framing (intro at top of modal · the accept-hint on a prefilled suggestion) */
  .rulemodal__intro { margin: 0 0 14px; }
  .rulemodal__accepthint { margin: 0 0 14px; color: var(--accent-primary); }
  .rulemodal__tags { margin-bottom: 4px; }
  /* the composer's rule pill — brand-purple ring so the takeover is visible (a rule beats a merchant match) */
  .bulk-jump__pill--rule { border-color: var(--accent-primary); box-shadow: 0 0 0 1px var(--accent-glow); }
  .rules-teaser { margin: -6px 2px 14px; }
  /* §28 (2026-07-20) — rule/recurring explanation lines + nameless-cost shortcut offer + shortcut-collision note */
  .reccard__what, .rules-managerwhat { margin: 4px 0 8px; font-size: 12.5px; }
  /* the manager explainer now sits under its own card heading (not loose under the recurring card) */
  .rules-manager .merchant-add { margin-top: 4px; }
  .rulemodal__shortcut { margin-top: 12px; border-top: 1px solid var(--border-default); padding-top: 12px; }
  .rulemodal__shortcutrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
  .rulemodal__shortcutrow input { flex: 1 1 180px; }
  /* calm (not amber) shortcut-namespace collision — a friendly open-to-edit, never a dead-end error */
  .rulemodal__collide, .rulemodal__collidebox { margin-top: 10px; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
  .rulemodal__collide .linkbtn { margin-left: 2px; }
  .rulemodal__del { margin-top: 8px; }
  /* "Your recurring costs" card (§28 consumer) — the honest annual burden of the rhythms; outgoing money
     wears --accent-out (never amber), amounts in DM Mono capped at weight 500 (its real heaviest) */
  .reccard__top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
  .reccard__title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
  .reccard__ctx { font-size: 12px; color: var(--text-tertiary); }
  .reccard__total { margin-left: auto; font-family: 'DM Mono', monospace; font-weight: 500; font-size: 15px; color: var(--accent-out); white-space: nowrap; }
  .reccard__grp { margin-top: 8px; font-size: 13px; color: var(--text-secondary); line-height: 1.6; overflow-wrap: anywhere; }
  .reccard__hname { font-weight: 600; color: var(--text-primary); }
  .reccard__amt { font-family: 'DM Mono', monospace; font-weight: 500; color: var(--accent-out); white-space: nowrap; }
  /* a recurring-cost entry is tap-to-edit — calm hover brighten + underline, never a button */
  .reccard__rule { cursor: pointer; border-radius: 4px; transition: color .12s ease, background .12s ease; }
  .reccard__rule:hover, .reccard__rule:focus-visible { color: var(--text-primary); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 2px; outline: none; }
  .reccard__rule:focus-visible { background: var(--accent-glow); }
  .reccard__foot { margin-top: 8px; font-size: 12.5px; color: var(--text-tertiary); }
  @media (max-width: 480px) { .reccard__total { margin-left: 0; flex-basis: 100%; } }
  /* income "arriving on a rhythm" — teal (money arriving), never mixed with the outgoing total */
  .reccard__incline { border-top: 1px solid var(--border-default); padding-top: 8px; margin-top: 10px; }
  .reccard__incamt { font-family: 'DM Mono', monospace; font-weight: 500; color: var(--accent-teal); white-space: nowrap; }
  .reccard__addrow { margin-top: 10px; }
  /* §28 slice 4 — the personal↔household OVERLAP ASK (save-time strip in the modal · card flag · footnote).
     Calm, never alarm — a purple-tinted awareness panel; the destructive "Retire it" is the only warm button. */
  .rulemodal__overlaps { margin-top: 14px; border-top: 1px solid var(--border-default); padding-top: 12px; }
  .rulemodal__overlapintro { margin: 0 0 8px; }
  .reccard__flags { margin-top: 10px; }
  .overlapask { background: var(--accent-glow); border: 1px solid var(--border-default); border-radius: 10px;
    padding: 10px 12px; margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
  .overlapask__q { font-size: 13px; color: var(--text-secondary); line-height: 1.5; overflow-wrap: anywhere; }
  .overlapask__btns { display: flex; gap: 8px; flex-wrap: wrap; }
  .overlapask--done { flex-direction: row; align-items: center; }
  .overlapask__donemsg { font-size: 13px; color: var(--text-tertiary); }
  .intent-committed__overlap { color: var(--text-tertiary); }
  /* "Looks recurring" — §28 source-2 suggestions (ask, never assume) */
  .sugblock__title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
  .sugblock__hint { font-size: 12.5px; margin: 2px 0 4px; }
  .sugrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--border-default); }
  .sugrow:first-of-type { border-top: none; }
  .sugrow__main { flex: 1 1 260px; min-width: 0; }
  .sugrow__msg { font-size: 13.5px; color: var(--text-primary); }
  .sugrow__meta { font-size: 12px; margin-top: 2px; }
  .sugrow__btns { display: flex; gap: 8px; flex-wrap: wrap; }
  .sugrow--done { color: var(--text-tertiary); font-size: 13px; gap: 8px; }
  .sugrow__donemsg { font-size: 13px; }
  /* rules bar "variant A" (2026-07-16, human-picked): the list OVERLAYS the form — zero height at any rule count */
  .rules-bar__combo { position: relative; }
  .rules-bar__pop { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 45;
    background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: 12px; padding: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,.5); max-height: 320px; overflow-y: auto; }
  .rules-bar__pop::-webkit-scrollbar { width: 8px; }
  .rules-bar__pop::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
  .rules-bar__opt { appearance: none; font-family: inherit; cursor: pointer; display: flex; width: 100%;
    align-items: baseline; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 8px;
    background: none; border: 0; text-align: left; }
  .rules-bar__opt:hover { background: var(--bg-hover); }
  .rules-bar__opt--hi { background: var(--accent-glow); }
  .rules-bar__optname { font-weight: 600; font-size: 14px; color: var(--text-primary); white-space: nowrap; }
  .rules-bar__optsum { font-size: 12px; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rules-bar__pophint { font-size: 11.5px; color: var(--text-tertiary); padding: 7px 10px 3px; border-top: 1px solid var(--border-subtle); margin-top: 4px; }
  /* §22 sticky-date PIN — quiet until back-dating; purple when holding the date */
  .entry-datepin { appearance: none; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 9px; background: none; border: 1px solid var(--border-default);
    color: var(--text-tertiary); cursor: pointer; padding: 0; }
  .entry-datepin:hover { color: var(--text-secondary); background: var(--bg-hover); }
  .entry-datepin--on { color: var(--accent-primary); border-color: var(--accent-primary); box-shadow: 0 0 0 2px var(--accent-glow); }

  /* ── Settings → Help (in-app FAQ): kept-model explainer port + rules/recurring Q&A ─────────────
     Colours map to Hearth's real tokens (teal = income/kept, --accent-out = went out, gold = fund,
     amber = negative/over). No new hues, no blue. DM Mono numbers stay ≤ weight 500 (its heaviest). */
  .help { color: var(--text-primary); }
  .help-seg { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 16px; background: var(--bg-elevated); border-radius: 12px; flex-wrap: wrap; }
  .help-seg__btn { appearance: none; border: 0; background: none; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--text-secondary); padding: 8px 14px; border-radius: 9px; cursor: pointer; }
  .help-seg__btn:hover { color: var(--text-primary); }
  .help-seg__btn--active { background: var(--accent-primary); color: var(--on-accent-primary); }
  .help-seg__btn--active:hover { color: var(--on-accent-primary); }

  .help .mono { font-weight: 500; }   /* DM Mono ships no weight > 500 — never faux-bold a number */
  .help-eyebrow { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-primary); font-weight: 600; }
  .help-h1 { font-size: 22px; line-height: 1.2; margin: 6px 0 10px; font-weight: 700; }
  .help-lede { color: var(--text-secondary); max-width: 62ch; margin: 0; }
  .help-lede b, .help-intro b { color: var(--text-primary); }

  .help-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 14px; font-size: 13px; color: var(--text-secondary); }
  .help-legend span { display: inline-flex; align-items: center; gap: 6px; }
  .help-swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
  .help-sw--teal { background: var(--accent-teal); }
  .help-sw--out { background: var(--accent-out); }
  .help-sw--gold { background: var(--accent-gold); }

  .help-model h3, .help-gloss h3 { font-size: 15px; margin: 0 0 4px; }
  .help-model ol { margin: 12px 0 4px; padding-left: 22px; color: var(--text-secondary); }
  .help-model li { margin: 8px 0; max-width: 72ch; }
  .help-model li b { color: var(--text-primary); }

  .help-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 20px; margin-bottom: var(--gap); }
  .help-card__head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
  .help-card__n { font-size: 12px; font-weight: 700; color: var(--accent-primary); background: var(--accent-glow); border-radius: 7px; padding: 2px 8px; white-space: nowrap; }
  .help-card__title { font-size: 17px; font-weight: 700; margin: 0; }
  .help-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
  .help-chip { font-size: 11px; color: var(--text-tertiary); border: 1px solid var(--border-default); border-radius: 999px; padding: 1px 9px; white-space: nowrap; }
  .help-story { color: var(--text-secondary); margin: 10px 0 14px; max-width: 68ch; }
  .help-story b { color: var(--text-primary); }

  .help-tblscroll { overflow-x: auto; }
  .help-facts, .help-ans { border-collapse: collapse; width: 100%; font-size: 13.5px; }
  .help-facts th, .help-ans th { text-align: right; font-weight: 600; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); padding: 5px 10px; border-bottom: 1px solid var(--border-default); white-space: nowrap; }
  .help-facts th:first-child, .help-ans th:first-child { text-align: left; }
  .help-facts td, .help-ans td { text-align: right; padding: 6px 10px; border-bottom: 1px solid var(--border-subtle); white-space: nowrap; }
  .help-facts td:first-child, .help-ans td:first-child { text-align: left; color: var(--text-secondary); }
  .help-facts tr:last-child td, .help-ans tr:last-child td { border-bottom: none; }
  .help td.v-in { color: var(--accent-teal); }
  .help td.v-out { color: var(--accent-out); }
  .help td.v-gold { color: var(--accent-gold); }
  .help td.v-neg { color: var(--accent-warm); }
  .help-focusrow td { background: var(--bg-elevated); }
  .help-relmark { color: var(--text-tertiary); }

  .help-sect { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-tertiary); font-weight: 700; margin: 18px 0 8px; }
  .help-why { margin: 12px 0 0; padding-left: 20px; color: var(--text-secondary); }
  .help-why li { margin: 7px 0; max-width: 72ch; }
  .help-why b { color: var(--text-primary); }
  .help-q { color: var(--text-primary); font-weight: 600; display: inline; font-size: inherit; margin: 0; }
  .help-windownote { background: var(--bg-elevated); border-radius: 10px; padding: 12px 14px; margin-top: 14px; font-size: 13.5px; color: var(--text-secondary); }
  .help-windownote b { color: var(--text-primary); }
  .help-diagram { margin-top: 16px; overflow-x: auto; }
  .help-diagram svg { display: block; }
  .help-dnote { font-size: 12.5px; color: var(--text-tertiary); margin-top: 4px; font-style: italic; }

  .help-gloss dl { margin: 10px 0 0; }
  .help-gloss dt { font-weight: 700; margin-top: 12px; }
  .help-gloss dd { margin: 3px 0 0; color: var(--text-secondary); max-width: 72ch; }
  .help-t--teal { color: var(--accent-teal); }
  .help-t--out { color: var(--accent-out); }
  .help-t--gold { color: var(--accent-gold); }
  .help-outro { color: var(--text-tertiary); font-size: 13.5px; margin-top: 8px; max-width: 68ch; }

  /* Rules & recurring Q&A */
  .help-qa { padding: 14px 0; border-bottom: 1px solid var(--border-subtle); }
  .help-qa:first-child { padding-top: 0; }
  .help-qa:last-child { border-bottom: none; padding-bottom: 0; }
  .help-faq .help-q { display: block; font-size: 15px; margin-bottom: 6px; }
  .help-a { color: var(--text-secondary); margin: 0; max-width: 72ch; }

  @media (max-width: 640px) {
    .help-card { padding: 16px; }
    .help-chips { margin-left: 0; }
    .help-h1 { font-size: 19px; }
  }

  /* Help accordion — each scenario / Q&A is a collapsed, tap-to-expand row (whole header is the target,
     like the ledger/csv group rows). Multiple may be open at once; deep-linked items flash briefly. */
  .help-accgroup { margin-top: 4px; }
  .help-acc { border: 1px solid var(--border-subtle); border-radius: var(--radius); background: var(--bg-surface); margin-bottom: 10px; }
  .help-acc__head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; user-select: none; border-radius: var(--radius); }
  .help-acc__head:hover { background: var(--bg-hover); }
  .help-acc__head:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent-primary); }
  .help-acc__label { display: flex; align-items: baseline; gap: 10px; flex: 1 1 auto; min-width: 0; flex-wrap: wrap; }
  .help-acc__n { font-size: 12px; font-weight: 700; color: var(--accent-primary); background: var(--accent-glow); border-radius: 7px; padding: 2px 8px; white-space: nowrap; flex: none; }
  .help-acc__title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
  .help-acc__chev { flex: none; color: var(--text-tertiary); display: inline-flex; transition: transform 160ms ease; }
  .help-acc--open > .help-acc__head .help-acc__chev { transform: rotate(180deg); }
  .help-acc--open > .help-acc__head { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  .help-acc__body { padding: 2px 18px 18px; }
  .help-acc__body > .help-chips { margin: 0 0 12px; }
  .help-acc__body > .help-story:first-child { margin-top: 0; }
  .help-acc__body .help-a { margin: 0; }
  .help-acc--flash { box-shadow: 0 0 0 2px var(--accent-primary), 0 0 18px var(--accent-glow); transition: box-shadow 200ms ease; }
  @media (max-width: 640px) {
    .help-acc__head { padding: 12px 14px; }
    .help-acc__body { padding: 2px 14px 16px; }
    .help-acc__title { font-size: 14px; }
  }

  /* ── Calendar (§31) ────────────────────────────────────────────────────────────────────────── */
  .cal-head .cal-headrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
  .cal-head h2 { margin: 0; }
  .cal-intro { margin: 6px 0 0; }
  .cal-seg, .cal-typeseg, .cal-certseg { display: inline-flex; border: 1px solid var(--border-default); border-radius: 999px; padding: 3px; background: var(--bg-elevated); gap: 2px; }
  .cal-seg__btn, .cal-typeseg__btn, .cal-certseg__btn { appearance: none; background: none; border: none; color: var(--text-secondary); font: inherit; font-size: 13px; padding: 6px 14px; border-radius: 999px; cursor: pointer; transition: background .12s, color .12s; }
  .cal-seg__btn--on, .cal-typeseg__btn--on, .cal-certseg__btn--on { background: var(--accent-primary); color: var(--on-accent-primary); }
  .cal-monthnav { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
  .cal-monthlabel { font-size: 17px; font-weight: 600; color: var(--text-primary); min-width: 150px; text-align: center; }
  .cal-addbtn { margin-left: auto; }

  /* grid */
  .cal-gridcard { padding: 12px; }
  .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(64px, 0.72fr); gap: 4px; }
  .cal-dow { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-secondary); text-align: center; padding: 4px 0; }
  .cal-dow--tot { color: var(--text-primary); }
  .cal-day { min-height: 92px; border: 1px solid var(--border-default); border-radius: 10px; padding: 5px 6px; background: var(--bg-elevated); display: flex; flex-direction: column; gap: 3px; cursor: pointer; overflow: hidden; transition: border-color .12s, background .12s; }
  .cal-day:hover { border-color: var(--accent-primary); }
  .cal-day:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent-glow); }
  .cal-day--off { visibility: hidden; }
  /* "PAPER ZONES" (Option 2, human-ratified): the PAST half is a raised, lighter surface at full brightness
     (ink — it happened); the FUTURE half is a sunken, darker surface (pencil — expected); TODAY keeps the raised
     surface + a 2px purple border + a faint glow; EMPTY days recede (transparent, faint border, dim number). No
     dashes, no gradients — the two zone tones meeting at the "now" seam do the talking. Amounts keep kind colours. */
  .cal-day--past { background: var(--cal-zone-past); border-color: var(--cal-zone-past-border); opacity: 1; }
  .cal-day--past .cal-day__num { color: var(--text-primary); }
  .cal-day--future { background: var(--cal-zone-future); border-color: var(--border-subtle); opacity: 1; }
  .cal-day--future .cal-day__num { color: var(--text-tertiary); font-weight: 500; }
  .cal-day--today { background: var(--cal-zone-past); border: 2px solid var(--accent-primary); box-shadow: 0 0 14px rgba(124, 106, 255, .25); opacity: 1; }
  .cal-day--today .cal-day__num { color: var(--accent-primary); }
  .cal-day--quiet { background: transparent; border-color: var(--cal-zone-empty-border); opacity: 1; }
  .cal-day--quiet .cal-day__num { color: #4a4a60; }
  .cal-day__top { display: flex; align-items: center; justify-content: space-between; min-height: 16px; }
  .cal-day__num { font-size: 13px; font-weight: 600; color: var(--text-primary); }
  .cal-day--today .cal-day__num { color: var(--accent-primary); }
  .cal-day__add { appearance: none; background: none; border: none; color: var(--accent-primary); font-size: 15px; line-height: 1; cursor: pointer; padding: 0 2px; opacity: 0; transition: opacity .12s; }
  .cal-day--addable:hover .cal-day__add, .cal-day__add:focus-visible { opacity: 1; outline: none; }
  @media (hover: none) { .cal-day__add { opacity: .55; } }   /* touch: no hover, so keep the ＋ faintly visible */
  .cal-day__chips { display: flex; flex-direction: column; gap: 1px; min-height: 0; }
  /* the chip TEXT carries the colour by kind — NO borders (declutters a dense month): expense lavender ·
     income teal · provision/fund/reimbursement gold · transfer muted/neutral (internal movement) */
  .cal-chip { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; font-size: 11px; padding: 1px 3px; border-radius: 5px; }
  /* the NAME is normal text (review round 2); only the AMOUNT carries the kind colour */
  .cal-chip__lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; color: var(--text-primary); }
  .cal-chip--past .cal-chip__lbl { color: var(--text-secondary); }
  .cal-chip__amt { font-size: 11px; flex: none; }
  .cal-ev--in { color: var(--accent-teal); }
  .cal-ev--out { color: var(--accent-out); }
  .cal-ev--gold { color: var(--accent-gold); }
  .cal-ev--neutral { color: var(--text-secondary); }
  .cal-chip--past { opacity: .9; }
  .cal-ev--soft { opacity: .82; }
  .cal-ev--dashed .cal-chip__lbl { text-decoration: underline dotted; text-underline-offset: 2px; opacity: .82; }
  .cal-more { appearance: none; background: none; border: none; color: var(--text-secondary); font: inherit; font-size: 11px; text-align: left; padding: 0 3px; cursor: pointer; }
  .cal-more:hover { color: var(--accent-primary); }
  .cal-day__net { margin-top: auto; font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 500; text-align: right; }
  .cal-net--pos { color: var(--accent-teal); } .cal-net--neg { color: var(--accent-out); }
  .cal-weektot { min-height: 92px; border: 1px dashed var(--border-default); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 2px; }
  .cal-weektot__val { font-family: 'DM Mono', monospace; font-size: 12px; font-weight: 500; text-align: right; }
  .cal-monthfoot { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-default); }
  .cal-monthfoot__row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: flex-end; }
  .cal-footpart { display: flex; align-items: baseline; gap: 8px; }
  .cal-footpart__lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); }
  .cal-footpart__val { font-family: 'DM Mono', monospace; font-size: 15px; font-weight: 500; }

  /* agenda */
  .cal-stripcard { padding: 12px; }
  .cal-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(24px, 1fr)); gap: 4px; }
  .cal-heat { appearance: none; border: 1px solid var(--border-subtle); border-radius: 6px; aspect-ratio: 1; font-size: 10px; color: var(--text-tertiary); background: var(--bg-surface); cursor: pointer; display: flex; align-items: center; justify-content: center; }
  .cal-heat--quiet { opacity: .5; }
  .cal-heat--busy { background: color-mix(in srgb, var(--accent-out) 26%, var(--bg-surface)); color: var(--text-secondary); border-color: var(--accent-out); }
  .cal-heat--in { background: color-mix(in srgb, var(--accent-teal) 24%, var(--bg-surface)); color: var(--text-secondary); border-color: var(--accent-teal); }
  .cal-heat--today { box-shadow: 0 0 0 2px var(--accent-primary); color: var(--text-primary); }
  .cal-agenda { padding: 4px 0; }
  .cal-agenda__group { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-tertiary); padding: 12px 16px 4px; }
  .cal-agenda__day { padding: 6px 16px; border-top: 1px solid var(--border-subtle); }
  .cal-agenda__day:first-of-type { border-top: none; }
  .cal-agenda__date { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
  .cal-agenda__evs { display: flex; flex-direction: column; gap: 3px; }
  .cal-arow { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 3px 0; }
  .cal-arow--editable { cursor: pointer; } .cal-arow--editable:hover .cal-arow__lbl { color: var(--accent-primary); }
  .cal-arow__left { min-width: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
  .cal-arow__lbl { color: var(--text-primary); font-size: 14px; }
  .cal-arow__cat { font-size: 12px; }
  .cal-arow__amt { font-size: 13px; flex: none; }
  .cal-agenda__add { align-self: flex-start; font-size: 13px; padding: 2px 0; }

  /* day detail */
  .cal-detaillist { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
  .cal-drow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); }
  .cal-drow__left { min-width: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
  .cal-drow__lbl { color: var(--text-primary); }
  .cal-drow__meta { font-size: 12px; }
  .cal-drow__amt { font-size: 14px; flex: none; }
  .cal-drow__edit { font-size: 12px; padding: 0; }

  /* paused / stale */
  .cal-paused { margin-top: 12px; }
  .cal-paused__head { appearance: none; background: none; border: none; color: var(--text-secondary); font: inherit; font-size: 14px; cursor: pointer; padding: 4px 0; }
  .cal-paused__head:hover { color: var(--text-primary); }
  .cal-paused__intro { margin: 6px 0 10px; }
  .cal-paused__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--border-subtle); flex-wrap: wrap; }
  .cal-paused__lbl { color: var(--text-primary); }
  .cal-paused__why { font-size: 12px; }

  /* add/edit modal bits */
  .cal-suggest { margin-top: 6px; font-size: 12px; color: var(--accent-primary); }
  .cal-certhint { margin: 4px 0 2px; line-height: 1.5; }
  .cal-notledger { margin: 10px 0 4px; padding: 8px 10px; border-radius: 8px; background: var(--accent-glow); color: var(--text-secondary); }
  .cal-removebtn { margin-top: 8px; }
  .cal-removeconfirm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; color: var(--text-secondary); font-size: 13px; }

  @media (max-width: 700px) {
    .cal-day { min-height: 76px; }
    .cal-weektot { display: none; }
    .cal-dow--tot { display: none; }
    .cal-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  }
  @media (max-width: 560px) {
    /* narrow grid: the chip label carries the meaning, the day net carries the number (avoids clipped amounts) */
    .cal-chip__amt { display: none; }
    .cal-chip { padding: 2px 4px; }
    .cal-day { padding: 4px 4px; }
  }

  /* ── Forecast (§29) — the verdict card (F1) + the Home tile (F2) ─────────────────────────────── */
  .cal-topseg { border-color: var(--accent-primary); }
  .fc-card { }
  .fc-title { margin: 0 0 6px; font-size: 15px; }
  .fc-verdict { font-size: 16px; line-height: 1.5; margin: 6px 0 2px; max-width: 62ch; color: var(--text-primary); }
  .fc-verdict--past { color: var(--text-secondary); }
  .fc-v--okay { color: var(--accent-teal); }
  .fc-v--tight { color: var(--text-primary); }
  .fc-v--under { color: var(--accent-warm); }
  .fc-range { color: var(--text-tertiary); font-size: 13px; margin: 2px 0 12px; }
  .fc-viewtog { display: inline-flex; border: 1px solid var(--border-default); border-radius: 999px; padding: 3px; background: var(--bg-elevated); gap: 2px; margin: 2px 0 12px; }
  .fc-viewtog__btn { appearance: none; background: none; border: none; color: var(--text-secondary); font: inherit; font-size: 12.5px; padding: 5px 13px; border-radius: 999px; cursor: pointer; }
  .fc-viewtog__btn--on { background: var(--accent-primary); color: var(--on-accent-primary); }

  .fc-bar { margin: 12px 0 4px; }
  .fc-bar__lab { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 5px; gap: 8px; }
  .fc-bar__amt { color: var(--text-primary); font-weight: 500; }
  .fc-bar__pm { color: var(--text-tertiary); }
  .fc-bar__track { display: flex; height: 26px; border-radius: 6px; overflow: hidden; background: var(--bg-elevated); }
  .fc-seg { position: relative; height: 100%; min-width: 2px; }
  .fc-seg + .fc-seg { margin-left: 2px; }
  /* band semantics: SOLID to (centre − spread), HATCHED to (centre + spread) — the hatch IS the ± window. */
  .fc-seg--band { background: linear-gradient(90deg, var(--seg-c) 0 var(--seg-solid), var(--seg-dim) var(--seg-solid) 100%); }
  .fc-seg--band::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: var(--tail, 18%);
    background: repeating-linear-gradient(-52deg, rgba(255,255,255,.72) 0 2px, rgba(255,255,255,0) 2px 5px); }
  .fc-bar__legend { display: flex; gap: 6px 14px; flex-wrap: wrap; margin-top: 7px; font-size: 12px; color: var(--text-tertiary); }
  .fc-bar__legend span { display: inline-flex; gap: 6px; align-items: center; }
  .fc-bar__vary { margin-left: auto; }
  .fc-sw { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex: 0 0 auto; }
  .fc-sw--hatch { background: repeating-linear-gradient(-52deg, rgba(255,255,255,.85) 0 2px, rgba(120,120,150,.25) 2px 4px); border: 1px solid var(--border-default); }

  .fc-drivers { margin: 14px 0 0; }
  .fc-drivers h4 { margin: 0 0 6px; font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--text-tertiary); }
  .fc-drv { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border-subtle); font-size: 14px; }
  .fc-drv:last-child { border-bottom: none; }
  .fc-drv--sub { padding-left: 14px; }
  .fc-drv--toggle, .fc-drv--tap { cursor: pointer; }
  .fc-drv--tap:hover .fc-drv__name { color: var(--text-primary); }
  .fc-drv__chev { display: inline-block; color: var(--text-tertiary); margin-right: 6px; transition: transform .12s; }
  .fc-drv__chev.is-open { transform: rotate(90deg); }
  .fc-drv__name { flex: 1; min-width: 0; }
  .fc-drv__pill { font-size: 11px; border: 1px solid var(--border-default); border-radius: 999px; padding: 1px 9px; color: var(--text-tertiary); white-space: nowrap; }
  .fc-drv__pill--known { border-color: var(--border-strong); color: var(--text-secondary); }
  .fc-drv__pill--estimated { border-style: dashed; }
  .fc-drv__pill--income { border-color: var(--accent-teal); color: var(--accent-teal); }
  .fc-drv__pill--tuned { border-color: var(--accent-primary); color: var(--accent-primary); }
  .fc-drv__pill--unpriced { border-style: dashed; border-color: var(--accent-warm); color: var(--accent-warm); }
  .fc-drv__amt { color: var(--accent-out); white-space: nowrap; }
  .fc-drv__amt--in { color: var(--accent-teal); }
  .fc-drv__var { color: var(--text-tertiary); font-size: 12.5px; min-width: 52px; text-align: right; }
  .fc-setaside { margin: 10px 0 0; color: var(--accent-gold); }

  /* per-driver explainer + tune */
  .fc-explain { background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 10px 12px; margin: 2px 0 8px; }
  .fc-explain__lead { margin: 0 0 6px; font-size: 13.5px; color: var(--text-primary); }
  .fc-explain__note { margin: 3px 0 0; font-size: 12.5px; color: var(--text-secondary); }
  .fc-explain__hist { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 6px; }
  .fc-explain__chip { font-size: 11.5px; color: var(--text-tertiary); border: 1px solid var(--border-subtle); border-radius: 7px; padding: 1px 7px; }
  .fc-explain__chip b { color: var(--text-secondary); font-weight: 500; }
  .fc-tune { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border-subtle); font-size: 13px; }
  .fc-tune__lead { flex: 1 1 100%; }
  .fc-tune__money { width: 130px; }
  .fc-tune__revert { color: var(--accent-primary); }

  .fc-simplelines { margin: 10px 0 4px; }
  .fc-sline { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; }
  .fc-sline__lbl { color: var(--text-secondary); }
  .fc-amt--in { color: var(--accent-teal); }
  .fc-amt--neg { color: var(--accent-warm); }

  .fc-affordcard { margin-top: 12px; }
  .fc-card__title { margin: 0 0 8px; font-size: 15px; }
  .fc-affordrow { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
  .fc-affordmoney { flex: 0 0 auto; width: 140px; }
  .fc-affordout { font-size: 14px; color: var(--text-primary); }
  .fc-affordunder { color: var(--accent-warm); }

  /* §31.1 calendar light filter */
  .cal-filter { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; }
  .cal-filterseg { flex-wrap: wrap; }
  .cal-filter .catpick, .cal-filter .multipick { flex: 1 1 200px; min-width: 160px; max-width: 320px; }
  .cal-filter__note { color: var(--accent-primary); }
  .cal-monthfoot__filtered { width: 100%; font-size: 12px; margin-bottom: 4px; color: var(--accent-primary); }

  /* F2 — Home tile */
  .dash-fc { cursor: pointer; }
  .dash-fc__line { font-size: 15px; }
  .dash-fc__go { color: var(--accent-primary); font-size: 13px; text-decoration: none; float: right; margin-left: 10px; }
  .dash-fc__sub { font-size: 12.5px; margin: 3px 0 8px; }
  .dash-fc__chart { margin-top: 4px; }
  .dash-fc__chart svg { display: block; }
  .dash-fc__chart svg text { font-family: 'DM Sans', system-ui, sans-serif; }
  .dash-fc__chart svg text.mono-t { font-family: 'DM Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
