/* 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 */
    --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) */
    --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; }
  .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); }
  .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; }

  /* 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); }
  .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; }
  /* 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); }
  .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; }
  /* 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; }
  .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); }
  .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; }                          /* the chart is wide — scroll it on a phone, never the page */
  .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%; }
  .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--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); }
  /* 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; }
  .ana-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-bottom: var(--gap); }
  .ana-controls--chart { margin-top: 2px; }
  .ana-customrange { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
  .ana-customrange__lbl { font-size: 12px; }
  .ana-shape { margin-left: 2px; }
  .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: var(--border-subtle); stroke-width: 1; }
  .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); }
  .ana-eratable__num { text-align: right; }
  /* 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; }
  /* 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; }
  }

  /* 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); }
  /* 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; }
  .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; }
  .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); } }
  .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); }

  /* 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-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); }
  .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; }
  }
