/* ==========================================================================
   [ui] Yosan app tokens. Dark is the default; light and auto override the same names.
   One set of colour roles for the whole app. Charts share it through the --viz-* palette
   further down ("four inks, two weights"): accent is cobalt / sky, positive is jade / pine,
   negative is rust, caution is ochre. See DESIGN.md, "App UI".
   ========================================================================== */
:root {
  --surface-0:#111418; --surface-1:#181c22; --surface-2:#1f242c; --surface-3:#272d38; --rule:#262c36; --rule-2:#353d4b; --field:#5f6a7e;
  --ink:#e6e9ef; --ink-2:#a3acbb; --ink-3:#8b94a6;
  --accent-ink:#4f9ccb; --accent-fill:#006ab8; --accent-weak:rgba(79,156,203,.14);
  --pos:#30ad69; --pos-weak:rgba(48,173,105,.13); --neg:#e5795a; --neg-weak:rgba(229,121,90,.13); --neg-fill:#af4b22;
  --caution:#cf9a2e; --caution-weak:rgba(207,154,46,.13);
  --pop-shadow:0 14px 36px rgba(0,0,0,.5);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --surface-0:#f2f3f6; --surface-1:#ffffff; --surface-2:#f4f5f8; --surface-3:#e9ebf0; --rule:#e4e7ec; --rule-2:#d0d5de; --field:#848d9d;
  --ink:#1b212c; --ink-2:#5b6474; --ink-3:#626b7d;
  --accent-ink:#135baf; --accent-fill:#135baf; --accent-weak:rgba(19,91,175,.08);
  --pos:#006d4c; --pos-weak:rgba(0,109,76,.09); --neg:#a43b03; --neg-weak:rgba(164,59,3,.08); --neg-fill:#a43b03;
  --caution:#8a5a00; --caution-weak:rgba(200,128,20,.14);
  --pop-shadow:0 14px 36px rgba(16,24,40,.16);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    --surface-0:#f2f3f6; --surface-1:#ffffff; --surface-2:#f4f5f8; --surface-3:#e9ebf0; --rule:#e4e7ec; --rule-2:#d0d5de; --field:#848d9d;
    --ink:#1b212c; --ink-2:#5b6474; --ink-3:#626b7d;
    --accent-ink:#135baf; --accent-fill:#135baf; --accent-weak:rgba(19,91,175,.08);
    --pos:#006d4c; --pos-weak:rgba(0,109,76,.09); --neg:#a43b03; --neg-weak:rgba(164,59,3,.08); --neg-fill:#a43b03;
    --caution:#8a5a00; --caution-weak:rgba(200,128,20,.14);
    --pop-shadow:0 14px 36px rgba(16,24,40,.16);
    color-scheme: light;
  }
}
:root {
  /* the names the older rules use, pointed at the roles above so every page follows the system */
  --bg:var(--surface-0); --panel:var(--surface-1); --panel2:var(--surface-2); --panel3:var(--surface-3);
  --text:var(--ink); --muted:var(--ink-3); --line:var(--rule); --line2:var(--rule-2);
  --accent:var(--accent-ink); --good:var(--pos); --good-weak:var(--pos-weak); --warn:var(--caution); --warn-weak:var(--caution-weak);
  --bad:var(--neg); --bad-weak:var(--neg-weak); --neutral-pill:var(--surface-3); --shadow:none;
  --ring:color-mix(in srgb, var(--accent-ink) 42%, transparent);
  /* shape, space, type, motion */
  --radius:8px; --radius-s:6px; --side:248px;
  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:20px; --s6:24px; --s8:32px;
  --font:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --font-display:"Segoe UI Variable Display","SF Pro Display",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --t-kicker:11px; --t-meta:12px; --t-small:13px; --t-body:14px; --t-lede:15px; --t-fig:18px; --t-title:24px; --t-num:28px; --t-hero:40px;
  --ease:cubic-bezier(.2,.7,.2,1); --dur:160ms;
}
* { box-sizing: border-box; }
html { scrollbar-color: var(--line2) transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 22px; font-weight: 700; margin: 0; } h2 { font-size: 15px; font-weight: 700; margin: 0 0 10px; } h3 { font-size: 14px; margin: 14px 0 8px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.hidden { display: none !important; }
.show-sm { display: none !important; }
.ic { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ic svg { display: block; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }

/* layout */
#app { display: flex; min-height: 100vh; }
#side { width: var(--side); background: var(--panel); border-right: 1px solid var(--line); position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; overflow-y: auto; z-index: 20; }
#side .brand { padding: 18px 18px 12px; font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 10px; }
#side .brand .dot { width: 26px; height: 26px; display: inline-block; flex: none; }
.dot svg { display: block; width: 100%; height: 100%; }
#side nav a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; margin: 1px 10px; border-radius: 8px; color: var(--text); }
#side nav a:hover { background: var(--panel2); text-decoration: none; }
#side nav a .ic { color: var(--muted); }
#side nav a:hover .ic, #side nav a.active .ic { color: var(--text); }
#side nav a.active { background: var(--accent-weak); color: var(--text); font-weight: 600; }
#side nav a .badge { margin-left: auto; }
.side-accounts { padding: 8px 0 8px; border-top: 1px solid var(--line); margin-top: 8px; }
.side-accounts .grp { display: flex; justify-content: space-between; padding: 8px 18px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.side-accounts a { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 30px; padding: 0 18px; color: var(--text); font-size: 13px; }
.side-accounts a:hover { background: var(--panel2); text-decoration: none; }
.side-accounts a.active { background: var(--accent-weak); }
.side-accounts a .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot { margin-top: auto; display: flex; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--panel); }
.side-foot .btn { padding: 0; width: 34px; justify-content: center; }
#main { margin-left: var(--side); flex: 1; min-width: 0; padding: 18px 22px 80px; }
#tabbar { display: none; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head .grow { flex: 1; }
.fab { display: none; }

/* controls */
.btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; border: 1px solid var(--line2); background: var(--panel2); padding: 6px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--panel3); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 28px; padding: 3px 9px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--panel2); }
.btn:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=number], input[type=date], input[type=month], input[type=password], input[type=search], input[type=email], input[type=url], select, textarea {
  background: color-mix(in srgb, var(--panel) 70%, var(--bg)); border: 1px solid var(--line2); border-radius: 8px; padding: 8px 10px; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
label.f > span { font-weight: 600; }
/* searchable category picker */
.catpick { position: relative; flex: 1 1 180px; min-width: 150px; display: block; }
.catpick input { width: 100%; }
.cp-pop { position: fixed; z-index: 5000; overflow-y: auto; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.35); padding: 4px; color: var(--text); font-size: 14px; }
.cp-grp { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px 3px; }
.cp-opt { padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.cp-opt.on { background: var(--accent-weak); }
.cp-opt.sel { font-weight: 600; }
.cp-opt.blank { color: var(--muted); }
.cp-opt.create { color: var(--accent); }
.cp-empty { padding: 10px; color: var(--muted); }
.cp-new { display: grid; gap: 10px; padding: 8px; }
.cp-h { font-weight: 700; }
label.f input, label.f select, label.f textarea { color: var(--text); font-size: 14px; }
label.chk { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--panel2); padding: 6px 11px; cursor: pointer; }
.seg button.on { background: var(--accent); color: #fff; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin-bottom: 14px; }
.cards > .card, .grid > .card, .budget-wrap > .card { margin-top: 0; }
.stat .k { font-size: 12px; color: var(--muted); } .stat .v { font-size: 22px; font-weight: 700; margin-top: 2px; } .stat .s { font-size: 12px; color: var(--muted); }
.badge { display: inline-block; min-width: 20px; padding: 1px 7px; font-size: 11px; font-weight: 700; border-radius: 999px; background: var(--bad); color: #fff; text-align: center; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-weight: 600; font-variant-numeric: tabular-nums; background: var(--neutral-pill); cursor: pointer; }
.pill.pos { background: var(--good-weak); color: var(--good); } .pill.neg { background: var(--bad-weak); color: var(--bad); }
.pill.credit { background: var(--warn-weak); color: var(--warn); } .pill.zero { color: var(--muted); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(90deg,#000 92%,transparent); mask-image: linear-gradient(90deg,#000 92%,transparent); }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 12px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.alert { padding: 10px 12px; border-radius: 8px; background: var(--warn-weak); margin-bottom: 12px; }
.alert.bad { background: var(--bad-weak); } .alert.good { background: var(--good-weak); } .alert.info { background: var(--accent-weak); }
/* condensed budget notices */
.notices { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.notice { flex: 1 1 280px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px 9px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); box-shadow: inset 3px 0 0 var(--line2); }
.notice.bad { box-shadow: inset 3px 0 0 var(--bad); } .notice.warn { box-shadow: inset 3px 0 0 var(--warn); }
.notice .nt { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex-wrap: wrap; }
.notice .nv { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px; }
.notice.bad .nv { color: var(--bad); } .notice.warn .nv { color: var(--warn); }
.notice .nl { color: var(--muted); font-size: 13px; }
.notice .na { display: flex; gap: 6px; flex-shrink: 0; }
/* reorder grips, hover tools, inline rename */
.bgrid .grip { cursor: grab; color: var(--muted); opacity: 0; margin-right: 6px; font-size: 12px; letter-spacing: -2px; user-select: none; vertical-align: -1px; transition: opacity .12s; }
.bgrid tr:hover .grip { opacity: .7; } .bgrid .grip:active { cursor: grabbing; }
.bgrid tr.dragging { opacity: .35; }
.bgrid tr.dragging td { background: var(--accent-weak); }
.bgrid .rowtools { float: right; opacity: 0; transition: opacity .12s; white-space: nowrap; }
.bgrid tr:hover .rowtools, .bgrid .rowtools:focus-within { opacity: 1; }
.bgrid .rowtools .btn { padding: 0 6px; min-height: 22px; line-height: 20px; }
.bgrid .ename { cursor: text; border-bottom: 1px dashed transparent; }
.bgrid .ename:hover { border-bottom-color: var(--line2); }
.bgrid input.ename-in { font: inherit; padding: 1px 6px; width: min(260px, 80%); background: var(--panel); }
@media (max-width: 860px) { .bgrid .grip { display: none; } .bgrid .rowtools { opacity: 1; } }
.bgrid tr.filter-note td { padding: 8px; font-size: 12px; color: var(--muted); background: var(--bad-weak); border-bottom: 1px solid var(--line); }
@media (max-width: 860px) { .notice { flex-basis: 100%; padding: 8px 10px 8px 12px; } .notice .nv { font-size: 14px; } .notice .nl { font-size: 12px; } }

/* tables */
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 1; }
table.t td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr.sel td { background: var(--accent-weak); }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: var(--panel2); }
.scroll-x { overflow-x: auto; }

/* budget grid */
.rta { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 12px; }
.rta.pos { background: var(--good-weak); } .rta.zero { background: var(--panel2); } .rta.neg { background: var(--bad-weak); }
.rta .amt { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rta .lbl { font-size: 12px; color: var(--muted); }
.budget-wrap { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 14px; align-items: start; }
.bgrid { width: 100%; border-collapse: collapse; }
.bgrid th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px; text-align: right; border-bottom: 1px solid var(--line); }
.bgrid th:first-child { text-align: left; }
.bgrid tr.grp td { background: var(--panel2); font-weight: 700; padding: 7px 8px; cursor: pointer; }
.bgrid tr.cat td { padding: 5px 8px; border-bottom: 1px solid var(--line); }
.bgrid tr.cat.sel td { background: var(--accent-weak); }
.bgrid td.nm { width: 45%; }
.bgrid td.nm .bar { height: 4px; border-radius: 3px; background: var(--neutral-pill); margin-top: 4px; overflow: hidden; }
.bgrid td.nm .bar > i { display: block; height: 100%; background: var(--good); }
.bgrid td.nm .bar.under > i { background: var(--warn); }
.bgrid .asg { width: 110px; text-align: right; border: 1px solid transparent; background: transparent; padding: 4px 6px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.bgrid .asg:hover { border-color: var(--line2); } .bgrid .asg:focus { background: var(--panel); border-color: var(--accent); }
.goal-note { font-size: 11px; color: var(--muted); }
.inspector { position: sticky; top: 12px; }

/* register */
.reg td.payee { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reg td.cat { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reg tr.unapproved td { font-weight: 600; } .reg tr.unapproved td:first-child { box-shadow: inset 3px 0 var(--accent); }
.flag { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.flag.red { background: #e03131; } .flag.orange { background: #f76707; } .flag.yellow { background: #fab005; } .flag.green { background: #37b24d; } .flag.blue { background: #1c7ed6; } .flag.purple { background: #ae3ec9; }
.clr { cursor: pointer; font-size: 13px; color: var(--muted); } .clr.on { color: var(--good); } .clr.rec { color: var(--accent); }
.bulkbar { position: sticky; top: 0; z-index: 3; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.bulkbar .btn { background: rgba(255,255,255,.15); color: #fff; border-color: transparent; }
.bulkbar select { color: var(--text); }
.txn-list { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.txn { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.txn:last-child { border-bottom: 0; }
.txn:active { background: var(--panel2); }
.txn.unapproved { box-shadow: inset 3px 0 var(--accent); }
.txn .mid { flex: 1; min-width: 0; }
.txn .l1, .txn .l2 { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.txn .l1 .p { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.txn .l2 { font-size: 12px; color: var(--muted); }
.txn .l2 .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.txn .l2 .dt { white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.txn .amt { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.txn.rev { display: block; cursor: default; }
.txn.rev .l3 { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.txn.rev .l3 select { flex: 1; min-width: 0; }

/* modal / toast / popover */
.modal-bg { position: fixed; inset: 0; background: rgba(8,10,14,.6); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px; z-index: 50; overflow-y: auto; }
.modal { background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; width: min(640px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.modal.wide { width: min(980px, 100%); }
.modal .mh { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 16px; }
.modal .mh .x { margin-left: auto; cursor: pointer; font-size: 20px; color: var(--muted); background: none; border: 0; }
.modal .mb { padding: 16px 18px; }
.modal .mf { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); }
.modal.sheet { width: min(560px, 100%); border-radius: 16px 16px 0 0; max-height: 92dvh; display: flex; flex-direction: column; min-height: 0; position: relative; align-self: flex-end; }
.modal-bg:has(.modal.sheet) { align-items: flex-end; padding: 0; overflow: hidden; }
.modal.sheet .mb { overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.modal.sheet .mf { padding-bottom: calc(12px + env(safe-area-inset-bottom)); position: sticky; bottom: 0; background: var(--panel); }
.modal.sheet .mf .btn { flex: 1; justify-content: center; }
.modal.sheet::before { content: ""; width: 36px; height: 4px; border-radius: 999px; background: var(--line2); margin: 8px auto 0; flex: none; }
.modal.sheet .mh:empty { display: none; }
.sheet-list { display: grid; gap: 2px; }
.sheet-list .btn { width: 100%; justify-content: flex-start; min-height: 44px; }
.sheet-list .btn.on { background: var(--accent-weak); }
#toasts { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { background: var(--panel3); color: var(--text); border: 1px solid var(--line2); padding: 10px 14px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.3); display: flex; gap: 12px; align-items: center; }
.toast.err { background: var(--bad); color: #fff; border-color: transparent; }
.toast button { background: none; border: 0; color: var(--accent); font-weight: 700; cursor: pointer; }
.toast.err button { color: #fff; }
.pop { position: absolute; z-index: 60; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.35); padding: 12px; width: min(280px, calc(100vw - 24px)); }
.menu { position: absolute; z-index: 60; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.35); padding: 6px; min-width: 220px; }
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.menu button:hover { background: var(--panel2); }
.chart-box { position: relative; height: 300px; } .chart-box.tall { height: 380px; } .chart-box.short { height: 220px; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .ic { display: flex; margin: 0 auto 8px; opacity: .6; }
.login { max-width: 380px; margin: 12vh auto; text-align: center; }
.login .grid { text-align: left; }
.login .dot { width: 48px; height: 48px; display: block; margin: 0 auto 14px; }
.splits { border: 1px dashed var(--line2); border-radius: 8px; padding: 10px; margin-top: 8px; }
.heat td.v { font-variant-numeric: tabular-nums; text-align: right; }
.heat td:first-child, .heat th:first-child { position: sticky; left: 0; background: var(--panel); z-index: 1; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.kv .k { color: var(--muted); }
details.sec { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 10px; }
details.sec > summary { padding: 12px 14px; cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; }
details.sec > summary::after { content: "▸"; margin-left: auto; color: var(--muted); }
details.sec[open] > summary::after { content: "▾"; }
details.sec > .in { padding: 0 14px 14px; }
.person, .acct-box { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; background: var(--panel2); }
.alloc-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin-top: 6px; }
.alloc-bar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.ssgrid td { text-align: center; font-size: 11px; padding: 4px; border: 1px solid var(--panel); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.kbd { font: 11px ui-monospace, monospace; border: 1px solid var(--line2); border-bottom-width: 2px; padding: 0 5px; border-radius: 4px; }
.rpt-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dotsync { font-size: 9px; vertical-align: 2px; margin-left: 4px; }

@media (max-width: 1100px) { .budget-wrap { grid-template-columns: 1fr; } .inspector { position: static; } }
@media (max-width: 860px) {
  body { font-size: 15px; }
  input, select, textarea { font-size: 16px !important; }
  .btn { min-height: 40px; }
  .btn.sm { min-height: 36px; padding: 4px 10px; }
  .hide-sm { display: none !important; }
  .show-sm { display: inline-flex !important; }
  #side { display: none; }
  #main { margin-left: 0; padding: 12px 14px calc(96px + env(safe-area-inset-bottom)); }
  #tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--panel); border-top: 1px solid var(--line); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
  #tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; font-size: 11px; color: var(--muted); position: relative; text-decoration: none; }
  #tabbar a.active { color: var(--accent); font-weight: 700; }
  #tabbar a .tb-badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 16px; padding: 0 5px; font-size: 10px; line-height: 16px; border-radius: 999px; background: var(--bad); color: #fff; text-align: center; }
  .fab { display: flex; align-items: center; justify-content: center; position: fixed; right: 16px; bottom: calc(68px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; z-index: 25; box-shadow: 0 6px 20px rgba(0,0,0,.35); cursor: pointer; }
  #toasts { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .bgrid td.nm { width: auto; }
  .bgrid .asg { width: 72px; padding: 4px 4px; }
  .bgrid td.right { width: 1%; white-space: nowrap; }
  .bgrid th, .bgrid tr.cat td, .bgrid tr.grp td { padding-left: 8px; padding-right: 8px; }
  .bgrid th, .bgrid tr.cat td, .bgrid tr.grp td { padding-left: 4px; padding-right: 4px; }
  .bgrid .pill { min-width: 68px; }
  .bgrid .pill { min-width: 72px; text-align: center; }
  .budget-wrap .inspector { display: none; }
  .rta { flex-wrap: wrap; gap: 8px 14px; }
  .rta .amt { font-size: 26px; }
  .rta .kv { font-size: 12px; grid-template-columns: auto auto auto auto; }
  .cards { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
  .cards.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .cards.three .stat .k { font-size: 12px; } .cards.three .stat .v { font-size: 16px; }
  .stat .v { font-size: 20px; }
  .reg td.payee { max-width: 130px; }
  .reg th:first-child, .reg td:first-child { display: none; }
  .tabs { scroll-snap-type: x proximity; }
  .tabs a { min-height: 40px; display: inline-flex; align-items: center; scroll-snap-align: start; }
  .rpt-controls { display: grid; gap: 8px; }
  .rpt-controls > * { width: 100%; }
  .rpt-controls .dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .rpt-controls .btn { justify-self: end; width: auto; }
  .bulkbar { top: 0; } .bulkbar select { flex: 1 1 45%; }
  table.t tr.mrow td { height: 48px; }
  .modal-bg { align-items: flex-end; padding: 0; overflow: hidden; }
  .modal { width: 100%; border-radius: 16px 16px 0 0; max-height: 92dvh; display: flex; flex-direction: column; min-height: 0; border-bottom: 0; position: relative; }
  .modal::before { content: ""; width: 36px; height: 4px; border-radius: 999px; background: var(--line2); margin: 8px auto 0; flex: none; }
  .modal .mb { overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
  .modal .mf { padding-bottom: calc(12px + env(safe-area-inset-bottom)); position: sticky; bottom: 0; background: var(--panel); }
  .modal .mf .btn { flex: 1; justify-content: center; }
  .modal.sheet { width: 100%; }
  .login { margin: 8vh auto; }
  .rta .rta-kv { flex: 1 1 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; text-align: left; font-size: 12px; }
  .rta .grow { display: none; }
  .card:has(> table.t), .card:has(> .row + table.t) { overflow-x: auto; }
}

/* sidebar options, rearrange & rename */
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 0 18px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); min-height: 26px; }
.side-head .gear { border: 0; background: none; cursor: pointer; color: var(--muted); line-height: 1; padding: 4px 6px; border-radius: 6px; display: inline-flex; }
.side-head .gear:hover { background: var(--panel2); color: var(--text); }
.side-hidden { padding: 2px 18px 4px; font-size: 11px; color: var(--muted); }
.side-edit-row { display: flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; cursor: grab; }
.side-edit-row.dragging { opacity: .4; }
.side-edit-row .grip { color: var(--muted); font-size: 12px; letter-spacing: -2px; user-select: none; padding: 0 2px; }
.side-edit-row input { flex: 1; min-width: 0; font-size: 13px; padding: 3px 6px; }
.side-edit-row .sf { color: var(--good); font-size: 12px; }
.side-pop { display: grid; gap: 10px; }
.asset-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.asset-card .kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; }

/* portfolio ideas */
.sugg { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-top: 10px; }
.sugg.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.sugg h3 { margin: 0; font-size: 15px; }
.cards.mini { margin: 8px 0 0; gap: 8px; }
.cards.mini .stat { padding: 8px 10px; margin: 0; }
.cards.mini .stat .v { font-size: 17px; }

.chip.ai { font-size: 10px; padding: 1px 6px; border-radius: 999px; background: var(--accent-weak); color: var(--accent); font-weight: 700; margin-left: 6px; display: inline-block; white-space: nowrap; line-height: 1.5; }
button.chip { border: 0; cursor: pointer; font-family: inherit; }

/* save feedback (category inspector) */
.btn.savebtn { justify-content: center; min-width: 130px; transition: background .2s, border-color .2s, color .2s; }
.btn.savebtn.saving { cursor: progress; opacity: .85; }
.btn.savebtn.saved, .btn.savebtn.saved:disabled, .btn.savebtn.saved:hover { background: var(--good-weak); border-color: var(--good); color: var(--good); opacity: 1; font-weight: 600; cursor: default; filter: none; }
@keyframes savedFlash { 0%, 60% { background: var(--good-weak); } 100% { background: transparent; } }
.bgrid tr.cat.just-saved td { animation: savedFlash 2.2s ease-out; }
.bgrid tr.cat.just-saved td:first-child { box-shadow: inset 3px 0 var(--good); }

/* background sync indicator (bg() in core.js) */
body.syncing .brand::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 8px; animation: syncPulse 1s ease-in-out infinite; }
@keyframes syncPulse { 0%,100% { opacity: .25; } 50% { opacity: 1; } }

/* budget instant saves + badges */
.notices-slot { display: contents; }
.side-accounts a .n { flex: 1 1 0; min-width: 0; }
.side-accounts a .acct-badge, .side-accounts a .badge { flex-shrink: 0; }
.side-accounts a .num { flex-shrink: 0; white-space: nowrap; }
.btn.savebtn.saved, .btn.savebtn.saved:hover { cursor: pointer; }


/* register instant saves */
.btn.approved { background: var(--good, #2e9e5b); color: #fff; border-color: transparent; pointer-events: none; }
.rev-sec { margin-bottom: 18px; }
.rev-h { margin: 14px 0 8px; font-size: 14px; color: var(--muted); font-weight: 600; }


/* settings + connect flow */
.card-head { gap: 10px; margin-bottom: 6px; }
.card-head h2 { margin: 0; }
.scope-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--neutral-pill); color: var(--muted); white-space: nowrap; }
.scope-tag.all { background: var(--warn-weak); color: var(--warn); }
.admin-badge { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 7px; border-radius: 999px; background: var(--accent-weak); color: var(--accent); margin-left: 6px; vertical-align: middle; }
ol.steps { list-style: none; counter-reset: st; margin: 10px 0 14px; padding: 0; display: grid; gap: 10px; }
ol.steps li { counter-increment: st; display: grid; grid-template-columns: 28px 1fr; column-gap: 10px; align-items: start; }
ol.steps li::before { content: counter(st); grid-row: 1 / span 2; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-weak); color: var(--accent); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
ol.steps li > span { grid-column: 2; }
.sf-list { margin: 8px 0; }
.sf-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sf-row .sf-main { display: grid; min-width: 0; }
.sf-row .sf-choice { grid-column: 1 / -1; }
.sf-row select { width: 100%; }
.tok-reveal .tok { flex: 1; min-width: 0; overflow-wrap: anywhere; user-select: all; }
.row.nowrap { flex-wrap: nowrap; }
details.dev > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
details.dev > summary::-webkit-details-marker { display: none; }
details.dev > summary h2 { margin: 0; }
details.dev[open] > summary { margin-bottom: 10px; }
.card .kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; }


/* rules editor */
.rb { display: grid; gap: 12px; }
.rb-head { font-weight: 700; margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rb-seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; }
.rb-seg-b { border: 0; background: var(--panel2); padding: 4px 14px; cursor: pointer; font-weight: 600; color: var(--muted); }
.rb-seg-b.on { background: var(--accent); color: #fff; }
.rb-list { display: grid; gap: 8px; }
.rb-row { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); transition: opacity .15s; }
.rb-row.off { opacity: .5; }
.rb-row.off .rb-ctrls { filter: grayscale(1); }
.rb-ctrls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.rb-ctrls > select, .rb-ctrls > input[type=text], .rb-ctrls > .catpick { flex: 1 1 140px; min-width: 0; width: auto; }
.rb-multi { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.rb-offchk { white-space: nowrap; font-size: 12px; color: var(--muted); }
.rb-x { align-self: flex-start; }
.rb-err { margin: 0; }
.rb-apply { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent-weak); cursor: pointer; }
.rb-apply.dim { border-color: var(--line2); background: var(--panel2); cursor: default; }
.rb-apply input { margin-top: 3px; }
.rb-apply-main { font-weight: 600; }
.rl-sum .rl-when { font-weight: 500; }
@media (max-width: 860px) {
  .rb-row { flex-direction: column; align-items: stretch; }
  .rb-x { align-self: flex-end; }
}

/* sidebar pending badges keep the accent colour */
.side-accounts a .acct-badge { background: var(--accent); }

/* receipt scanning */
.rc-status { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); }
.rc-err { margin: 8px 0 0; }
.rc-panel { border: 1px solid var(--line2); background: var(--panel2); border-radius: 10px; padding: 10px; margin-top: 8px; display: grid; gap: 8px; }
.rc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rc-match { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.rc-items { display: grid; gap: 6px; }
.rc-item { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 6px 8px; display: grid; gap: 4px; }
.rc-item.low { border-color: var(--warn); background: var(--warn-weak); }
.rc-line { display: flex; align-items: center; gap: 8px; justify-content: space-between; min-width: 0; }
.rc-line .catpick { flex: 1 1 140px; min-width: 0; }
.rc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rc-amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-extra { color: var(--muted); }
.rc-sums { border-top: 1px dashed var(--line2); padding-top: 6px; display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.rc-flag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--warn-weak); color: var(--warn); white-space: nowrap; }
.rc-flag.ok { background: var(--good-weak); color: var(--good); }
.rc-diff { margin: 0; }
.rc-actions { margin-top: 2px; }
@media (max-width: 420px) { .rc-actions .btn { flex: 1; justify-content: center; } .rc-line .catpick { flex-basis: 100%; } }


/* payee insights */
.pi-wrap { display: inline-flex; align-items: center; gap: 3px; max-width: 100%; min-width: 0; vertical-align: bottom; }
.pi-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: underline dotted var(--muted); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.pi-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.pi-btn:hover, .pi-btn:focus-visible { color: var(--accent); background: var(--accent-weak); outline: none; }
.pi-btn:focus-visible { box-shadow: 0 0 0 2px var(--ring); }
.pi-tip { position: fixed; z-index: 1000; max-width: min(340px, calc(100vw - 16px)); padding: 8px 10px; border-radius: 8px; background: var(--panel3); color: var(--text); border: 1px solid var(--line2); box-shadow: 0 8px 24px rgba(0,0,0,.3); font-size: 12.5px; line-height: 1.4; pointer-events: none; white-space: normal; }
.pi-tip b { font-weight: 700; }
.pi-pop { position: fixed; z-index: 1001; width: min(340px, calc(100vw - 16px)); background: var(--panel); color: var(--text); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.35); padding: 14px; }
.pi-card { display: grid; gap: 8px; min-width: 0; }
.pi-m { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.pi-t { color: var(--muted); font-size: 12px; margin-top: -6px; }
.pi-d { margin: 0; line-height: 1.45; font-size: 14px; }
.pi-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.pi-chip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-weak); color: var(--accent); }
.pi-raw { display: grid; gap: 2px; }
.pi-lbl { font-size: 11px; color: var(--muted); }
.pi-raw code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; overflow-wrap: anywhere; }
.pi-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.pi-ta { width: 100%; resize: vertical; min-height: 84px; box-sizing: border-box; }
.pi-inline { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 2px 0; border: 0; background: none; color: var(--accent); font-size: 12px; cursor: pointer; align-self: flex-start; }
.pi-inline:hover { text-decoration: underline; }
@media (max-width: 860px) {
  .pi-btn { width: 24px; height: 24px; }
  .pi-name { text-decoration-thickness: 1.5px; }
  .pi-card .btn.sm { flex: 1; justify-content: center; }
}

/* dividend bundles */
.bd-wrap { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; vertical-align: middle; }
.bd-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-wrap .chip.bd-chip { flex: none; font-size: 10px; padding: 1px 7px; border-radius: 999px; background: var(--good-weak); color: var(--good); font-weight: 700; line-height: 1.5; white-space: nowrap; }
.bd-btn { flex: none; width: 24px; height: 24px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; }
.bd-btn:hover, .bd-btn:focus-visible { background: var(--panel3); color: var(--text); }
.reg td.payee:has(.bd-wrap) { max-width: 380px; }
.bd-pop-h { font-weight: 600; margin-bottom: 6px; }
.bd-pop .bd-leg { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; width: 100%; min-height: 44px; padding: 6px 8px; text-align: left; border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer; }
.bd-pop .bd-leg:hover, .bd-pop .bd-leg:focus-visible { background: var(--panel2); }
.bd-leg-mid { display: flex; flex-direction: column; min-width: 0; }
.bd-leg-pay { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-role { font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px; white-space: nowrap; background: var(--good-weak); color: var(--good); }
.bd-role.reinvest { background: var(--accent-weak); color: var(--accent); }
.bd-pop p { margin: 8px 0; }
.bd-link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
@media (max-width: 860px) {
  .txn .l1 .p:has(.bd-wrap) { white-space: normal; overflow: visible; }
  .bd-wrap { flex-wrap: wrap; row-gap: 2px; }
  .bd-label { flex: 1 1 100%; }
  .bd-btn { width: 32px; height: 32px; }
}

/* bulk review */
.bk { max-width: 1100px; }
.bk-prog { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 12px; }
.bk-prog-t { font-weight: 700; }
.bk-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.bk-pill { padding: 2px 10px; border-radius: 999px; background: var(--neutral-pill); color: var(--muted); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bk-pill.on { background: var(--accent-weak); color: var(--accent); }
.bk-blurb { color: var(--muted); margin: 0 0 10px; }
.bk-busy { text-align: center; padding: 28px 16px; color: var(--muted); }
.bk-sum { text-align: center; padding: 28px 16px; }
.bk-sum .ic { margin: 0 auto 8px; color: var(--good); }
.bk-ideas:not(:empty) { margin-bottom: 12px; }
.bk-idea { border-left: 3px solid var(--accent); }
.bk-idea + .bk-idea { margin-top: 10px; }
.bk-idea-t { line-height: 1.4; }
.bk-group { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; box-shadow: var(--shadow); }
.bk-gh { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--panel2); cursor: pointer; user-select: none; }
.bk-gh .grow { flex: 1; }
.bk-gname { font-weight: 700; }
.bk-gtot { min-width: 80px; }
.bk-chev { color: var(--muted); width: 14px; text-align: center; }
.bk-cb { width: 18px; height: 18px; accent-color: var(--accent); flex: none; margin: 0; cursor: pointer; }
.bk-cb.sm { width: 15px; height: 15px; }
.bk-row { display: grid; grid-template-columns: 26px minmax(150px, 1.5fr) minmax(120px, .8fr) 84px minmax(170px, 1.2fr) 64px; gap: 4px 12px; align-items: center; padding: 8px 14px; border-top: 1px solid var(--line); }
.bk-row.off { opacity: .6; }
.bk-chk { display: flex; align-items: center; justify-content: center; cursor: pointer; }
.bk-payee { font-weight: 600; overflow-wrap: anywhere; }
.bk-desc { overflow-wrap: anywhere; }
.bk-conf { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; font-size: 10px; font-weight: 700; background: var(--neutral-pill); color: var(--muted); vertical-align: 1px; }
.bk-conf.hi { background: var(--good-weak); color: var(--good); }
.bk-conf.mid { background: var(--accent-weak); color: var(--accent); }
.bk-conf.lo { background: var(--warn-weak); color: var(--warn); }
.bk-cat .catpick { min-width: 0; width: 100%; }
.bk-rule { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); cursor: pointer; }
.bk-rl-l { display: none; }
.bk-bar { position: sticky; bottom: 0; z-index: 6; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-top: 14px; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius); box-shadow: 0 -4px 16px rgba(0,0,0,.18); }
.bk-bar .grow { flex: 1; }
@media (max-width: 860px) {
  .bk-gh { padding: 12px; }
  .bk-gh .small.muted { display: none; }
  .bk-cb { width: 26px; height: 26px; }
  .bk-cb.sm { width: 22px; height: 22px; }
  .bk-row { grid-template-columns: 40px 1fr auto; grid-template-areas: "chk main amt" "chk meta meta" "chk cat cat" "chk rule rule"; padding: 12px; gap: 4px 10px; }
  .bk-chk { grid-area: chk; align-self: start; padding-top: 2px; }
  .bk-main { grid-area: main; }
  .bk-amt { grid-area: amt; align-self: start; }
  .bk-meta { grid-area: meta; }
  .bk-cat { grid-area: cat; margin-top: 4px; }
  .bk-rule { grid-area: rule; margin-top: 4px; font-size: 13px; gap: 8px; }
  .bk-rl-s { display: none; }
  .bk-rl-l { display: inline; overflow-wrap: anywhere; }
  .bk-bar { bottom: calc(56px + env(safe-area-inset-bottom)); margin-left: -4px; margin-right: -4px; }
  .bk-bar .grow { display: none; }
  .bk-bar .btn { flex: 1 1 auto; justify-content: center; }
  .bk-selinfo { flex-basis: 100%; }
  .bk-pills { margin-left: 0; }
}

/* amazon split */
.rc-amt-in { width: 92px; text-align: right; font-variant-numeric: tabular-nums; }

/* payee lookups */
.pi-lookup { display: grid; gap: 4px; justify-items: start; margin-top: 4px; }
.pi-tip .pi-lookup { margin-top: 6px; }
.pi-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-weak); color: var(--accent); }
.pi-addr { font-size: 12.5px; line-height: 1.4; user-select: text; -webkit-user-select: text; cursor: text; overflow-wrap: anywhere; }
.pi-src { font-size: 12px; color: var(--accent); }
.pi-note { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* transfers */
.tr-chip { position: relative; display: inline-flex; align-items: center; max-width: 100%; vertical-align: middle; font: inherit; font-size: 11px; font-weight: 700; line-height: 1.5; padding: 1px 8px; border-radius: 999px; border: 1px solid transparent; background: var(--accent-weak); color: var(--accent); cursor: pointer; }
.tr-chip:hover { filter: brightness(1.12); }
.tr-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tr-chip::after { content: ""; position: absolute; inset: -9px -4px; }
.tr-chip .tr-lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-chip.wait { background: var(--warn-weak); color: var(--warn); border: 1px dashed var(--warn); }
.tr-chip.stale { background: var(--warn-weak); color: var(--warn); border: 1px solid var(--warn); }
.tr-cell { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; max-width: 100%; }
tr.tr-flash td, .txn.tr-flash { animation: tr-flash 2.4s ease-out; }
@keyframes tr-flash { 0%, 35% { background: var(--accent-weak); box-shadow: inset 3px 0 var(--accent); } 100% { background: transparent; } }
.tr-box { margin: 0; }
.tr-sug { padding: 10px 12px; margin-bottom: 14px; }
.tr-sug-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); }
.tr-sug-row.busy { opacity: .5; pointer-events: none; }
.tr-sug-main { min-width: 0; flex: 1; }
.tr-sug-t { font-weight: 600; }
.tr-sug-d { overflow-wrap: anywhere; }
.tr-sug-act { display: flex; gap: 8px; flex: none; }
@media (max-width: 860px) {
  .tr-chip { font-size: 12px; }
  .tr-chip::after { inset: -14px -8px; }
  .tr-sug-row { flex-direction: column; align-items: stretch; }
  .tr-sug-act .btn { flex: 1; justify-content: center; min-height: 44px; }
  .tr-box .btn { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { tr.tr-flash td, .txn.tr-flash { animation: none; background: var(--accent-weak); } }

/* benchmarks */
.bench-page { max-width: 880px; }
.bench-ctl { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 12px; }
.bench-ctl .seg button:disabled { opacity: .45; cursor: default; }
.bench-i { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line2); background: var(--panel2); color: var(--accent); font-weight: 700; font-style: italic; cursor: pointer; }
.bench-info { background: var(--accent-weak); border: 1px solid var(--line2); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
.bench-card { margin-bottom: 14px; }
.bench-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.bench-amt { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
/* [bench-nums] numbers lifted out of the prose so the cards scan at a glance */
.bench-nums { display: flex; gap: 8px; margin-left: auto; align-items: stretch; flex-shrink: 0; }
.bench-num { display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-end; min-width: 76px; padding: 3px 10px; border-radius: 8px; background: var(--panel3); }
.bench-num small { font-size: 9px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.bench-num b { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.35; }
.bench-num.off { background: var(--accent-weak); }
.bench-num.off b { color: var(--accent); }
.bench-nums.big .bench-num b { font-size: 20px; }
@media (max-width: 640px) { .bench-nums { margin-left: 0; width: 100%; justify-content: flex-end; } }
.bench-line { font-size: 12px; color: var(--muted); margin-top: 3px; }
.bench-vs { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--neutral-pill); color: var(--text); font-weight: 600; font-size: 12px; margin-left: 4px; }
.bench-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--neutral-pill); color: var(--muted); font-size: 11px; font-weight: 600; margin-left: 4px; }
.bench-badge.est { background: var(--warn-weak); color: var(--warn); }
.bench-track { position: relative; height: 12px; border-radius: 6px; background: var(--panel3); margin: 10px 0 6px; }
.bench-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--accent); }
.bench-mark { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1px; border-radius: 2px; background: var(--text); }
.bench-q { position: absolute; top: 2px; bottom: 2px; width: 1px; background: var(--muted); opacity: .7; }
.bench-rank { font-size: 13px; margin-top: 6px; }
.bench-sub { border-top: 1px solid var(--line); padding: 10px 0 2px; margin-top: 10px; }
.bench-sub .bench-track { height: 8px; }
.bench-list { padding: 4px 16px; }
.bench-row { padding: 10px 0; border-top: 1px solid var(--line); }
.bench-list > .bench-row:first-child { border-top: 0; }
.bench-row.bench-stack { display: block; }
.bench-det summary { cursor: pointer; list-style: none; }
.bench-det summary::-webkit-details-marker { display: none; }
.bench-det > .bench-sub { margin-left: 12px; }
.bench-h { margin: 20px 0 8px; font-size: 14px; color: var(--muted); }
.bench-untag, .bench-share { margin-top: 14px; }
.bench-note { margin-top: 8px; }
.bench-foot { font-size: 12px; color: var(--muted); margin-top: 22px; line-height: 1.5; }
.bench-foot ul { padding-left: 18px; margin: 6px 0; }
.bench-more { margin: 10px 0; }
.bench-more > summary { cursor: pointer; color: var(--muted); padding: 8px 0; min-height: 44px; display: flex; align-items: center; }
.bench-tags td select { max-width: 240px; }
@media (max-width: 700px) {
  .bench-ctl .seg button, .bench-i { min-height: 44px; min-width: 44px; }
  .bench-page select, .bench-page input, .bench-tags select { min-height: 44px; }
  .bench-amt { font-size: 20px; }
}

/* ---- help tips, page banners, tracking accounts, card/loan details, due soon (help.js, debt.js) ---- */
.help-tip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-left: 5px; padding: 0; vertical-align: middle;
  border: 1px solid var(--line2); border-radius: 50%; background: var(--panel2); color: var(--muted); font: italic 700 10px/1 Georgia, serif; cursor: help; flex: none; }
.help-tip::after { content: ""; position: absolute; inset: -8px; }
.help-tip:hover, .help-tip[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-weak); }
.help-label { display: inline-flex; align-items: center; flex-wrap: wrap; }
.help-pop { position: fixed; z-index: 6000; width: max-content; max-width: min(320px, calc(100vw - 16px)); padding: 10px 12px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.35); font-size: 13px; line-height: 1.45; font-weight: 400; text-transform: none; letter-spacing: 0; text-align: left; }
.help-pop b { display: block; margin-bottom: 3px; }
.help-pop p { margin: 0 0 6px; }
.help-pop p:last-child { margin-bottom: 0; }
.help-learn { background: none; border: 0; padding: 2px 0; color: var(--accent); cursor: pointer; font-size: 12px; font-weight: 600; }
.help-learn:hover { text-decoration: underline; }
.page-banner { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; padding: 12px 14px; background: var(--accent-weak); border: 1px solid var(--line); border-radius: var(--radius); }
.page-banner .pb-body { flex: 1; min-width: 0; }
.page-banner .pb-title { font-weight: 700; margin-bottom: 4px; }
.page-banner p { margin: 0 0 6px; }
.page-banner ul { margin: 0; padding-left: 18px; }
.page-banner li { margin: 2px 0; }
.page-banner .pb-x { flex: none; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.page-banner .pb-x:hover { background: var(--panel2); color: var(--text); }
.help-link { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line2); background: var(--panel2); color: var(--muted); font-weight: 700; cursor: pointer; padding: 0; }
.help-link:hover { color: var(--accent); border-color: var(--accent); }
.trk-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--neutral-pill); color: var(--muted); font: 700 10px/1.5 var(--font); letter-spacing: .02em; text-transform: none; vertical-align: middle; white-space: nowrap; }
.side-accounts a .n { display: inline-flex; align-items: center; gap: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chip.trk { display: inline-block; padding: 2px 10px; border: 0; border-radius: 999px; background: var(--neutral-pill); color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip.trk:hover { background: var(--panel3); }
.chip.trk.none { color: var(--muted); font-weight: 400; font-style: italic; }
.trk-cell { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.terms-card, .terms-cost { margin-bottom: 12px; }
.terms-card p { margin: 4px 0 8px; }
.terms-cost ul { margin: 6px 0 4px; padding-left: 18px; }
.terms-cost li { margin: 3px 0; }
.terms-sec .in { padding-top: 8px; }
.due-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; padding: 8px 12px; background: var(--warn-weak); border-radius: var(--radius); }
.due-strip .ds-t { font-weight: 700; display: inline-flex; align-items: center; }
.due-strip .ds-item { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; color: var(--text); font-size: 13px; }
.due-strip .ds-item:hover { text-decoration: none; border-color: var(--accent); }
.due-strip .ds-item.late { border-color: var(--bad); }
.due-strip .ds-n { font-weight: 600; }
.due-strip .ds-d { color: var(--muted); }
.due-strip .ds-a { font-variant-numeric: tabular-nums; }
.due-strip .ds-a small { color: var(--muted); }
.whatif { background: var(--good-weak); }
@media (max-width: 860px) {
  .help-tip { width: 20px; height: 20px; font-size: 12px; }
  .help-tip::after { inset: -12px; }
  .help-learn { min-height: 44px; padding: 0 4px; }
  .page-banner .pb-x { width: 44px; height: 44px; margin: -8px -8px 0 0; }
  .help-link { width: 44px; height: 44px; }
  .due-strip .ds-item { min-height: 44px; }
  .chip.trk { min-height: 32px; }
}

/* home */
.home-grid { display: grid; gap: 12px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 700px) { .home-grid { grid-template-columns: repeat(2, 1fr); } .home-tile.s-L { grid-column: span 2; } }
@media (min-width: 1200px) { .home-grid { grid-template-columns: repeat(3, 1fr); } .home-tile.s-L { grid-column: span 2; } }
.home-tile { margin: 0 !important; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.home-tile.go { cursor: pointer; } .home-tile.go:hover { border-color: var(--line2); }
.home-tile.dash { border-style: dashed; }
.home-tile.s-S .home-body > .home-item:nth-child(n+4), .home-tile.s-S .home-txn:nth-child(n+3), .home-tile.s-S .home-row:nth-child(n+4) { display: none; }
.home-head { display: flex; align-items: center; gap: 8px; min-height: 28px; flex-wrap: wrap; }
.home-title { font-weight: 600; color: var(--text); text-decoration: none; flex: 1; }
.home-go { color: var(--muted); font-size: 22px; text-decoration: none; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; margin: -8px -10px -8px 0; }
.home-edit { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.home-eb, .home-edit .seg button { min-width: 44px; min-height: 44px; }
.home-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.home-big { font-size: 28px; font-weight: 700; line-height: 1.1; }
.home-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.home-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .home-stat b { font-size: 18px; }
.home-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; min-height: 28px; } .home-l { min-width: 0; overflow-wrap: anywhere; }
.home-item { display: flex; flex-direction: column; gap: 4px; }
.home-sub { margin-top: 2px; }
.home-bar { height: 6px; background: var(--panel3); border-radius: 4px; overflow: hidden; } .home-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.home-bar i.bad { background: var(--bad); } .home-bar i.warn { background: var(--warn); }
.home-spark { width: 100%; max-width: 220px; height: 40px; }
.home-ok, .home-empty { color: var(--muted); margin: 0; }
.home-attn { display: flex; align-items: center; gap: 12px; padding: 8px 10px; min-height: 44px; border-radius: 8px; background: var(--warn-weak); color: var(--text); text-decoration: none; }
.home-attn.bad { background: var(--bad-weak); } .home-attn b { min-width: 28px; text-align: center; font-size: 18px; } .home-attn > span:nth-child(2) { flex: 1; }
.home-txn { display: flex; align-items: center; gap: 10px; min-height: 44px; border-bottom: 1px solid var(--line); } .home-txn:last-child { border-bottom: 0; }
.home-txn-m { flex: 1; min-width: 0; color: var(--text); text-decoration: none; } .home-txn-m b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-review { background: var(--accent); color: #fff; text-decoration: none; min-height: 28px; display: inline-flex; align-items: center; }
.home-skel i { display: block; height: 14px; margin: 8px 0; border-radius: 6px; background: var(--panel3); animation: homepulse 1.2s ease-in-out infinite; } .home-skel i:nth-child(2) { width: 70%; } .home-skel i:nth-child(3) { width: 45%; }
@keyframes homepulse { 50% { opacity: .45; } }
.home-tip { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 5px; border-radius: 50%; border: 1px solid var(--line2); background: transparent; color: var(--muted); font: italic 11px/1 serif; cursor: help; padding: 0; vertical-align: middle; }
.home-tip-body { max-width: 260px; padding: 10px 12px; }
.home-picker { display: flex; flex-direction: column; gap: 8px; } .home-picker h3 { margin: 10px 0 4px; text-transform: uppercase; letter-spacing: .04em; }
.home-pick { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; text-align: left; width: 100%; padding: 10px 12px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); color: var(--text); cursor: pointer; min-height: 44px; }
.home-pick .small { grid-column: 1; } .home-add { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.home-opts .f { margin-bottom: 12px; }
/* earnings pace */
.earn-top { display: flex; align-items: center; gap: 6px; } .earn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); animation: homepulse 1.6s infinite; }
.earn-big { font-variant-numeric: tabular-nums; line-height: 1.05; } .earn-main { font-size: 38px; font-weight: 700; } .earn-sub { font-size: 20px; color: var(--muted); font-weight: 500; }
.earn-big.sm .earn-main { font-size: 30px; } .earn-big.sm .earn-sub { font-size: 16px; }
.earn-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.earn-c { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; min-height: 44px; border-radius: 8px; background: var(--panel2); color: var(--text); text-decoration: none; min-width: 0; }
a.earn-c-in { box-shadow: inset 0 -2px 0 var(--good); } a.earn-c-out { box-shadow: inset 0 -2px 0 var(--warn); }
.earn-v, .earn-pl { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px; } .earn-pg { display: flex; justify-content: space-between; margin-top: 4px; }
.earn-ne { font-weight: 600; } .earn-steps { display: flex; gap: 6px; } .earn-steps i { flex: 1; height: 8px; border-radius: 4px; background: var(--panel3); } .earn-steps i.on { background: var(--good); }
.earn-page { max-width: 980px; } .earn-back { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; }
.earn-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; } .earn-head h1 { margin: 0 0 2px; }
.earn-tot { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--warn); }
.earn-banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: var(--accent-weak); margin-bottom: 14px; } .earn-banner p { margin: 0; } .earn-banner.warn { background: var(--warn-weak); } .earn-banner.teal { background: var(--good-weak); }
.earn-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 14px; } .earn-card { display: flex; flex-direction: column; gap: 3px; margin: 0 !important; } .earn-card b { font-size: 17px; }
.earn-tbl { min-width: 520px; } .earn-tr { display: grid; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: center; font-variant-numeric: tabular-nums; } .earn-th { font-size: 12px; color: var(--muted); } .earn-tr .r { text-align: right; }
.earn-chart { width: 100%; height: auto; } .earn-chart-h { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; } .earn-chart-h h2 { margin: 0 0 8px; font-size: 16px; }
.earn-legend { display: flex; gap: 12px; flex-wrap: wrap; } .earn-legend .lg { display: inline-block; width: 14px; height: 4px; margin-right: 5px; vertical-align: middle; border-radius: 2px; } .lg.l1 { background: var(--accent); } .lg.l2 { background: var(--muted); } .lg.l3 { background: var(--warn); height: 8px; width: 8px; border-radius: 50%; }
.earn-foot { margin: 12px 0; } .earn-link { margin-bottom: 20px; min-height: 44px; }
.earn-picks { display: flex; flex-direction: column; max-height: 50vh; overflow: auto; } .earn-pick { display: flex; align-items: flex-start; gap: 10px; padding: 8px 2px; min-height: 44px; cursor: pointer; } .earn-pick input { margin-top: 3px; width: 20px; height: 20px; }

.home-due { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: baseline; padding: 8px 10px; min-height: 44px; border-radius: 8px; background: var(--panel2); color: var(--text); text-decoration: none; box-shadow: inset 3px 0 0 var(--line2); }
.home-due.warn { box-shadow: inset 3px 0 0 var(--warn); } .home-due.bad { box-shadow: inset 3px 0 0 var(--bad); } .home-due-sub { grid-column: 1 / -1; }
.page-banner-slot .page-banner { margin-bottom: 14px; }

/* Pay & paychecks */
.pay-page { max-width: 980px; }
.pay-page .btn, .pay-page input, .pay-page select { min-height: 44px; }
.pay-page input[type=checkbox] { min-height: 0; width: 22px; height: 22px; }
.pay-tabs a { display: inline-flex; align-items: center; min-height: 44px; }
.pay-step-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; } .pay-step-h h2 { margin: 0; font-size: 16px; }
.pay-n { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-weak); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.pay-step { margin-top: 14px; } .pay-empty { text-align: left; }
.pay-grp { margin-bottom: 12px; } .pay-grp-h { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line2); }
.pay-line { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; } .pay-line .grow { flex: 1; min-width: 170px; }
.pay-line input[type=text] { flex: 1; min-width: 120px; } .pay-line input[type=number] { width: 120px; }
.pay-none { padding: 8px 0; } .pay-helper { margin-top: 12px; padding: 12px; border-radius: var(--radius); background: var(--panel2); display: grid; gap: 8px; }
.pay-stats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin: 10px 0; } .pay-stat { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; background: var(--panel2); min-width: 0; } .pay-stat b { font-size: 16px; font-variant-numeric: tabular-nums; }
.pay-stack { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: var(--panel3); } .pay-stack i { display: block; min-width: 2px; }
.pay-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; margin: 6px 0 10px; color: var(--muted); } .pay-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.pay-c-net { background: var(--good); } .pay-c-tax { background: var(--bad); } .pay-c-sav { background: var(--accent); } .pay-c-health { background: var(--warn); } .pay-c-other { background: var(--muted); } .pay-c-gross { background: var(--line2); }
.pay-wf { display: grid; gap: 6px; margin: 10px 0 14px; } .pay-wf-row { display: grid; grid-template-columns: minmax(100px, 1fr) 3fr minmax(84px, .8fr); gap: 10px; align-items: center; }
.pay-wf-track { position: relative; height: 18px; background: var(--panel2); border-radius: 4px; } .pay-wf-bar { position: absolute; top: 0; bottom: 0; border-radius: 4px; } .pay-wf .r { text-align: right; }
.pay-h3 { margin: 18px 0 0; font-size: 14px; } .pay-checks { margin: 12px 0; } .pay-checks summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.pay-recon { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; } .pay-recon h2 { font-size: 16px; margin: 0 0 6px; }
@media (max-width: 600px) { .pay-wf-row { grid-template-columns: 1fr 2fr; } .pay-wf-row .num { grid-column: 1 / -1; text-align: right; } }


/* ---- About me, Income, Setup (colors come from the theme variables, so dark and light both work) */
.about-page .about-card, .income-card, .setup-item { margin-top: 14px; }
.about-from { font-size: 12px; color: var(--muted); }
.about-from a { color: var(--accent); }
.about-ro { min-height: 44px; display: flex; align-items: center; padding: 0 2px; font-weight: 600; }
.about-flag { margin: 8px 0; }
.about-dep { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.about-dep input, .about-dep select { flex: 1 1 130px; min-height: 44px; }
.about-dep .btn { min-height: 44px; }
.about-size { margin: 12px 0 8px; }
.about-summary .home-row { padding: 6px 0; }
.about-card input, .about-card select, .income-row input[type=text], .income-row select { min-height: 44px; }
.income-jump { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.income-jump .btn { min-height: 44px; }
.income-pay { margin-bottom: 4px; }
.income-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.income-row:first-of-type { border-top: 0; }
.income-row.off { opacity: .6; }
.income-main { flex: 1 1 220px; min-width: 0; }
.income-main input { width: 100%; }
.income-ctl { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.income-hint { flex: 1 1 100%; }
.income-chart { width: 100%; height: auto; display: block; margin-top: 12px; }
.income-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.income-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.income-gt { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 8px; }
.setup-link { display: flex; align-items: center; gap: 8px; }
.setup-link .setup-pct { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--accent-weak); color: var(--accent); }
.setup-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.setup-ring svg { position: absolute; inset: 0; }
.setup-ring b { position: relative; font-size: 14px; }
.setup-hero { display: flex; gap: 16px; align-items: center; }
.setup-tile { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.setup-next { margin: 4px 0; min-height: 44px; }
.setup-tile-foot { margin-top: 8px; align-items: center; }
.setup-group { margin-top: 18px; }
.setup-item-h { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.setup-item-t { flex: 1 1 200px; min-width: 0; }
.setup-item-h .btn { min-height: 44px; display: inline-flex; align-items: center; }
.setup-mark { width: 22px; text-align: center; color: var(--muted); }
.setup-item.done .setup-mark { color: var(--good); }
.setup-why { margin-top: 6px; }
.setup-acct { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--line); }
.setup-acct .btn { min-height: 44px; display: inline-flex; align-items: center; }
.setup-extra { margin-top: 8px; }
.about-plan-banner { margin: 8px 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--accent-weak); }
.about-plan-banner .btn { min-height: 44px; margin: 6px 0; }

/* register: mobile Select all row (44px touch targets) */
.sel-all-row { min-height: 44px; padding: 0 4px; font-size: 14px; color: var(--muted); }
.sel-all-row input[type=checkbox] { width: 24px; height: 24px; margin: 10px; flex: none; }

/* tile containment: every tile keeps its content inside, scaling down on narrow tiles */
.home-tile { container-type: inline-size; overflow: hidden; }
.home-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-stat > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-stat b { font-size: clamp(15px, 4.2cqi, 18px); font-variant-numeric: tabular-nums; }
.home-big { font-size: clamp(22px, 9cqi, 28px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.home-row .home-l { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
.home-row > :last-child { flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.home-txn .num { flex: none; white-space: nowrap; }
.home-2.small > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@container (max-width: 280px) {
  .home-2 { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .home-big { font-size: 22px; }
}


/* needs-data notes, pay history, employer plan, W-4 extras, household view (Pay extras) */
.needs-note { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card-2, var(--card)); font-size: 14px; }
.needs-note a { display: inline-flex; align-items: center; min-height: 44px; }
.needs-note.soft { opacity: .85; }
.pp-hist-wrap { margin-top: 8px; display: grid; gap: 6px; }
.pp-hist summary, .pp-w4 summary, .pp-timeline summary, .pp-hh-st summary { min-height: 44px; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.pp-hist-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--line); }
.pp-hist-row .btn, .pp-hist-wrap > .btn { min-height: 44px; }
.pp-w4 { margin: 8px 0; padding: 4px 12px; border: 1px solid var(--line); border-radius: 10px; }
.pp-w4-body { display: grid; gap: 10px; padding-bottom: 10px; }
.pp-maxout { display: grid; gap: 8px; padding: 8px 0; }
.pp-tier { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.pp-tier input { width: 84px; min-height: 44px; }
.pp-sub { margin: 8px 0; }
.pp-choices { display: grid; gap: 10px; grid-column: 1 / -1; }
.pp-choice { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.pp-choice label { display: block; min-height: 44px; cursor: pointer; }
.pp-choice input[type=radio] { width: 20px; height: 20px; vertical-align: middle; }
.pp-hh { display: grid; gap: 10px; }
.pp-tl-row { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.pp-tl-date { flex: none; min-width: 92px; }
.pp-timeline { margin: 12px 0; }
.pp-nudge { display: grid; gap: 4px; margin-bottom: 12px; }
.home-tile .pp-mo { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); min-width: 0; }
.home-tile .pp-mo-row { min-width: 0; }
.earn-banner.warn { border-color: var(--warn); }

/* RECS-BEGIN Recommendations (experimental) - delete this whole block to remove (see REMOVING_RECS.md) */
.recs-exp { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--warn-weak); color: var(--warn); vertical-align: middle; text-transform: uppercase; letter-spacing: .04em; }
.recs-total { margin: 12px 0; } .recs-big { font-size: clamp(18px, 4.5vw, 24px); font-weight: 700; }
.recs-sum { margin: 8px 0 0; } .recs-gh { margin: 22px 0 2px; font-size: 17px; } .recs-gs { margin: 0 0 10px; }
.recs-list { display: grid; gap: 10px; } .recs-list > .card + .card { margin-top: 0; }
.recs-card { padding: 0; overflow: hidden; }
.recs-head { display: flex; width: 100%; gap: 12px; align-items: flex-start; justify-content: space-between; text-align: left; border: 0; background: transparent; color: var(--text); font: inherit; padding: 12px 16px 6px; min-height: 44px; cursor: pointer; }
.recs-ht { min-width: 0; flex: 1 1 auto; font-weight: 600; overflow-wrap: anywhere; } .recs-per { font-weight: 400; }
.recs-sav { flex: none; font-weight: 700; color: var(--good); white-space: nowrap; }
.recs-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px; }
.recs-chip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line2); color: var(--muted); }
.recs-chip.e-easy, .recs-chip.i-low { background: var(--good-weak); border-color: transparent; color: var(--good); }
.recs-chip.e-hard, .recs-chip.i-high { background: var(--bad-weak); border-color: transparent; color: var(--bad); }
.recs-chip.c-low, .recs-chip.est { background: var(--warn-weak); border-color: transparent; color: var(--warn); }
.recs-one { margin: 6px 16px 12px; }
.recs-detail { display: none; padding: 0 16px 14px; border-top: 1px solid var(--line); }
.recs-card.open .recs-detail { display: block; } .recs-card.open .recs-one { display: none; }
.recs-detail h4 { margin: 14px 0 6px; font-size: 13px; }
.recs-tw { overflow-x: auto; } .recs-acts { margin: 0; padding-left: 18px; }
.recs-as { display: grid; gap: 4px; margin-bottom: 10px; }
.recs-as-in { display: flex; align-items: center; gap: 10px; }
.recs-rng { flex: 1 1 auto; min-width: 0; min-height: 44px; } .recs-num { width: 96px; min-height: 44px; flex: none; }
.recs-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.recs-btns .btn, .recs-assump .btn, .recs-done .btn, .recs-hidden .btn { min-height: 44px; }
.recs-done { margin-bottom: 10px; } .recs-hidden { margin-top: 18px; } .recs-hidden summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.recs-segrow{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;padding:4px 0;border-bottom:1px solid var(--border,rgba(128,128,128,.25))}
.recs-segn{flex:1 1 140px;min-width:0}
.recs-segb{display:flex;gap:6px}
.recs-segb .btn{min-height:44px;min-width:44px}
/* RECS-END */

/* [start-date] [sweep] budget start month + cash sweeps */
.pre-start { opacity: .55; }
.pre-start .payee, .txn.pre-start .p { font-style: italic; }
.sw-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; line-height: 18px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.sw-chip.inv { color: var(--good); }
.sw-hist { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.sweep-hint { margin-top: 6px; padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--warn); background: var(--panel); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sweep-hint .sw-btns { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.sweep-hint .btn { min-height: 44px; min-width: 44px; }
.sw-start .sw-pick { align-items: flex-end; gap: 12px; }
.sw-start .sw-preview { margin-top: 10px; display: grid; gap: 4px; }
.sw-start select { min-height: 44px; }
@media (max-width: 640px) { .sw-hist { flex: 1 1 100%; } }   /* [start-date] mobile register: history toggle on its own line */
.sw-history .btn { min-height: 44px; }

/* ================= [polish] UI polish (v35) ================= */
/* tab bars wrap instead of clipping ("Data & pr…") */
.tabs { flex-wrap: wrap; overflow-x: visible; row-gap: 0; }
@media (max-width: 700px) { .tabs a { padding: 8px 10px; min-height: 40px; } }
/* Income sub-nav as a segmented control */
.income-jump { display: inline-flex; flex-wrap: wrap; gap: 0; max-width: 100%; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; background: var(--panel2); margin-bottom: 12px; }
.income-jump .btn { border: 0; border-radius: 0; background: transparent; box-shadow: none; min-height: 44px; padding: 0 14px; color: var(--muted); font-weight: 600; border-right: 1px solid var(--line); }
.income-jump .btn:last-child { border-right: 0; }
.income-jump .btn:hover { color: var(--text); background: var(--panel3); }
.income-jump .btn.on { background: var(--accent); color: #fff; }
/* sidebar accounts: ellipsis on the name only, fixed-width balance */
.side-accounts a .n { display: flex; align-items: center; gap: 6px; flex: 1 1 0; min-width: 0; overflow: hidden; }
.side-accounts a .n .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-accounts a .n .trk-badge { flex: none; margin-left: 0; }
.side-accounts a .num { flex: 0 0 6.2em; text-align: right; white-space: nowrap; }
/* needs-data notes read as a sentence */
.needs-note svg { flex: none; margin-top: 1px; color: var(--accent); }
.needs-note.needs-req svg { color: var(--warn); }
.needs-note a { display: inline; min-height: 0; padding: 2px 0; }
.needs-note p { margin: 0; line-height: 1.5; }
.plan-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 20px; }
.plan-empty h2 { margin: 0; } .plan-empty p { margin: 0; max-width: 60ch; } .plan-empty svg { color: var(--accent); }
/* Home grid: tiles pack upward, no holes under short tiles */
.home-grid { grid-auto-flow: row dense; }
.home-grid.masonry { grid-auto-rows: 4px; row-gap: 0; }
.home-grid.masonry .home-tile { align-self: start; }
.home-tile.compact { padding-top: 10px; padding-bottom: 10px; } .home-tile.compact .home-body { gap: 4px; }
.home-ell { overflow: hidden; } .home-ell b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-review { background: transparent; color: var(--muted); border: 1px solid var(--line2); font-weight: 600; }
.home-review:hover { color: var(--text); border-color: var(--accent); }
/* setup detail as a short list */
.setup-bullets { margin: 4px 0 0; padding-left: 18px; } .setup-bullets li { margin: 1px 0; }
/* bank sync error details */
.sync-err-more { margin-top: 6px; } .sync-detail { margin-top: 6px; padding: 6px 8px; border-radius: 6px; background: var(--panel3); overflow-wrap: anywhere; }
/* Recommendations hero */
.recs-hero { text-align: left; } .recs-hero .recs-big { font-size: clamp(28px, 7vw, 40px); line-height: 1.1; }
.recs-cap { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 4px 0 8px; }
/* Income page */
.pay-tax-warn { align-items: center; flex-wrap: wrap; } .pay-tax-warn p { flex: 1 1 260px; } .pay-tax-warn .btn { margin: 4px 0 0 4px; }
.pay-banner-more { margin-bottom: 12px; } .pay-banner-more > summary { color: var(--muted); }
.pp-hist-wrap .pp-change { border: 1px solid var(--accent); color: var(--accent); background: transparent; font-weight: 600; }
.pp-hist-wrap .pp-change:hover { background: var(--accent-weak); }
.pp-plan-sum { margin: 8px 0; padding: 8px 10px; border-radius: 8px; background: var(--accent-weak); }
details.pp-w4 > summary, details.pp-hist > summary, details.pp-hh-st > summary, details.pp-timeline > summary, details.pay-checks > summary, details.pay-banner-more > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 44px; }
details.pp-w4 > summary::-webkit-details-marker, details.pp-hist > summary::-webkit-details-marker, details.pp-hh-st > summary::-webkit-details-marker,
details.pp-timeline > summary::-webkit-details-marker, details.pay-checks > summary::-webkit-details-marker, details.pay-banner-more > summary::-webkit-details-marker { display: none; }
details.pp-w4 > summary::before, details.pp-hist > summary::before, details.pp-hh-st > summary::before, details.pp-timeline > summary::before,
details.pay-checks > summary::before, details.pay-banner-more > summary::before { content: '›'; display: inline-block; font-size: 22px; line-height: 1; color: var(--muted); transition: transform .15s; }
details[open].pp-w4 > summary::before, details[open].pp-hist > summary::before, details[open].pp-hh-st > summary::before, details[open].pp-timeline > summary::before,
details[open].pay-checks > summary::before, details[open].pay-banner-more > summary::before { transform: rotate(90deg); }
details.pp-hh-st > summary { color: var(--accent); font-weight: 600; } details.pp-hh-st > summary:hover { text-decoration: underline; }
details.pp-w4 > summary { font-weight: 600; }
.pp-hh .home-2 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: start; text-align: left; }
.pp-hh .home-stat { align-items: flex-start; text-align: left; }
.sw-suggest { align-items: center; } .sw-suggest .btn { margin-left: 4px; }

/* Amazon order sync (amazonsync.js) */
.az-btn { min-height: 44px; }
.az-code { margin-top: 12px; }
.az-code input { width: 100%; min-height: 44px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.az-bar { margin-bottom: 10px; }
.az-card { margin-bottom: 12px; overflow: hidden; }
.az-head { align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.az-lines { margin: 10px 0; display: grid; gap: 6px; }
.az-line { display: grid; grid-template-columns: minmax(0, 1fr) 84px minmax(150px, 220px); gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.az-t { overflow-wrap: anywhere; }
.az-cat { min-height: 44px; width: 100%; }
.az-acts { flex-wrap: wrap; gap: 8px; }
.az-split { color: var(--muted); margin: 6px 0; }
.az-panel { margin-top: 8px; }
.az-det { border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; background: var(--panel2); }
.az-det > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.az-items { list-style: none; margin: 0; padding: 0; }
.az-items li { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; border-top: 1px solid var(--line); }
.az-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.az-empty { text-align: center; padding: 28px 16px; }
@media (max-width: 700px) { .az-line { grid-template-columns: minmax(0, 1fr) auto; } .az-line .az-cat { grid-column: 1 / -1; } }

/* [streak] Home streak tile */
.streak-item { color: inherit; text-decoration: none; min-width: 0; padding: 4px 0; }
.streak-item + .streak-item { border-top: 1px solid var(--line); }   /* [streak-review] :last-of-type matched by tag (a vs div), so the wrong row lost its border */
.streak-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.streak-n { font-size: clamp(16px, 5cqi, 22px); font-variant-numeric: tabular-nums; }

/* [notices] one compact bar for what Yosan changed; Recent changes list; no lone help icon in a banner */
.av-done { box-shadow: inset 3px 0 0 var(--good); }
.av-multi { display: block; }
.av-bar { flex-basis: 100%; }
.av-bar .nt { flex-wrap: nowrap; flex: 1 1 auto; align-items: center; }
.av-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.av-head .nt { display: flex; align-items: center; min-width: 0; }
.av-ok { color: var(--good); font-weight: 700; margin-right: 8px; flex-shrink: 0; }
.av-title { font-weight: 600; font-size: 14px; min-width: 0; }
.av-rows { margin-top: 6px; border-top: 1px solid var(--line); }
.av-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.av-row:last-child { border-bottom: 0; }
.av-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; cursor: pointer; }
.av-text.wrap { white-space: normal; }
.av-bar .nl.av-text { color: var(--text); font-size: 13px; }
.notice .nl .help-tip { display: inline-flex; }
@media (max-width: 860px) { .av-head { flex-wrap: wrap; } .av-row { flex-wrap: wrap; } .av-row .av-text { flex-basis: 100%; } }

/* [reimb] work reimbursements */
.sw-chip.rb { color: var(--accent); border-color: var(--accent); }
.rb-owed { margin: 12px 0; }
.rb-big { display: flex; flex-direction: column; margin-bottom: 8px; }
.rb-big b { font-size: 28px; }
.rb-line { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.rb-panel { margin: 12px 0; }

/* [xfer] Payment / Transfer toggle, transfer suggestion chip, inline work-account question */
.xfer-seg { justify-self: start; }
.xfer-seg button { min-height: 36px; }
.xfer-chip { justify-self: start; border: 1px dashed var(--accent); background: var(--accent-weak); color: var(--accent); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12.5px; cursor: pointer; text-align: left; }
.xfer-to select { width: 100%; }
.rb-ask { margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: var(--accent-weak); }
.rb-ask p { margin: 4px 0; }
.rb-ask ul { margin: 4px 0 4px 18px; padding: 0; }
.rb-ask .row { gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.rb-ask.rb-flash { outline: 2px solid var(--warn, #e67700); }
@media (max-width: 860px) { .xfer-seg button, .xfer-chip { min-height: 44px; } .rb-ask .btn { flex: 1; min-height: 44px; } }

/* ==========================================================================
   [design] Yosan data-viz system. See DESIGN.md.
   One palette, defined once. "Four inks, two weights": blue, green, purple and
   earth, each in a deep and a mid tone. Slot order is fixed (it is what keeps
   neighbours apart for colour-blind readers), so never reorder or cycle.
   Dark values are the same eight hues re-stepped for the dark panel.
   ========================================================================== */
:root {
  --viz-1:#006ab8; --viz-2:#30ad69; --viz-3:#88568d; --viz-4:#be8817;
  --viz-5:#c07aa2; --viz-6:#107757; --viz-7:#4f9ccb; --viz-8:#af4b22;
  --viz-other:#606978; --viz-mute:#4a5261;
  --viz-in:#30ad69; --viz-out:#af4b22; --viz-warn:#be8817;
  --viz-ink:#e6e9ef; --viz-text:#a3acbb; --viz-grid:#232933; --viz-leader:#5f6979; --viz-surface:#181c22;
  --viz-tip-bg:#262c36; --viz-tip-ink:#e6e9ef; --viz-tip-sub:#a3acbb; --viz-tip-line:#3a4250;
  --viz-seq-1:#1b2a40; --viz-seq-2:#1c3f66; --viz-seq-3:#14558f; --viz-seq-4:#006ab8; --viz-seq-5:#4f9ccb;
  --viz-div-neg:#af4b22; --viz-div-mid:#3a4250; --viz-div-pos:#107757;
}
:root[data-theme="light"] {
  --viz-1:#135baf; --viz-2:#45a56f; --viz-3:#7c2c79; --viz-4:#c88014;
  --viz-5:#b168a6; --viz-6:#006d4c; --viz-7:#4795eb; --viz-8:#a43b03;
  --viz-other:#8c93a0; --viz-mute:#b4bac6;
  --viz-in:#006d4c; --viz-out:#a43b03; --viz-warn:#c88014;
  --viz-ink:#1b212c; --viz-text:#5b6474; --viz-grid:#eceef2; --viz-leader:#a3aab7; --viz-surface:#ffffff;
  --viz-tip-bg:#1b212c; --viz-tip-ink:#ffffff; --viz-tip-sub:#c5cad3; --viz-tip-line:#1b212c;
  --viz-seq-1:#dbe6f6; --viz-seq-2:#a9c2e6; --viz-seq-3:#6f99d3; --viz-seq-4:#3d75be; --viz-seq-5:#135baf;
  --viz-div-neg:#a43b03; --viz-div-mid:#e4e7ec; --viz-div-pos:#006d4c;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    --viz-1:#135baf; --viz-2:#45a56f; --viz-3:#7c2c79; --viz-4:#c88014;
    --viz-5:#b168a6; --viz-6:#006d4c; --viz-7:#4795eb; --viz-8:#a43b03;
    --viz-other:#8c93a0; --viz-mute:#b4bac6;
    --viz-in:#006d4c; --viz-out:#a43b03; --viz-warn:#c88014;
    --viz-ink:#1b212c; --viz-text:#5b6474; --viz-grid:#eceef2; --viz-leader:#a3aab7; --viz-surface:#ffffff;
    --viz-tip-bg:#1b212c; --viz-tip-ink:#ffffff; --viz-tip-sub:#c5cad3; --viz-tip-line:#1b212c;
    --viz-seq-1:#dbe6f6; --viz-seq-2:#a9c2e6; --viz-seq-3:#6f99d3; --viz-seq-4:#3d75be; --viz-seq-5:#135baf;
    --viz-div-neg:#a43b03; --viz-div-mid:#e4e7ec; --viz-div-pos:#006d4c;
  }
}
/* the old --c1..--c8 chart colours now point at the one palette, so nothing can drift */
:root, :root[data-theme="light"], :root[data-theme="auto"] {
  --c1:var(--viz-1); --c2:var(--viz-2); --c3:var(--viz-3); --c4:var(--viz-4);
  --c5:var(--viz-5); --c6:var(--viz-6); --c7:var(--viz-7); --c8:var(--viz-8);
}

/* ---- report card: kicker, headline number, takeaway, chart, quiet footnote ---- */
.vz-card { padding: 22px 24px 18px; display: flex; flex-direction: column; }
.vz-head { display: flex; gap: 12px 28px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.vz-lede { min-width: 0; flex: 1 1 320px; }
.vz-kicker, .stat .k { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--viz-text); }
.vz-kicker { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
/* the brand mark (forest coin, tiny cut) opens every report card */
.vz-kicker::before { content: ""; width: 14px; height: 14px; flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-42.25 -42.25 84.5 84.5'%3E%3Cdefs%3E%3CclipPath id='yc'%3E%3Ccircle r='31'/%3E%3C/clipPath%3E%3C/defs%3E%3Ccircle r='38' fill='%23f3ead8'/%3E%3Cg clip-path='url(%23yc)' stroke='%23f3ead8' stroke-width='4.5' stroke-linejoin='round'%3E%3Cpath d='M0 -31L19 23L-19 23Z' fill='%23135baf'/%3E%3Cpath d='M-12 -8L7 38L-31 38Z' fill='%2345a56f'/%3E%3Cpath d='M12 -8L31 38L-7 38Z' fill='%237c2c79'/%3E%3C/g%3E%3Ccircle r='38' fill='none' stroke='%23c88014' stroke-width='7.5'/%3E%3C/svg%3E") center/contain no-repeat; }
.vz-value { font-size: 40px; line-height: 1.05; font-weight: 650; letter-spacing: -.025em; color: var(--viz-ink); overflow-wrap: anywhere; }
.vz-value.neg { color: var(--bad); }
.vz-take { margin: 10px 0 0; font-size: 15px; line-height: 1.5; color: var(--text); max-width: 58ch; text-wrap: pretty; }
.vz-take b { font-weight: 650; }
.vz-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.vz-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 0 22px; margin: 18px 0 0; }
.vz-stat { border-top: 1px solid var(--line); padding: 10px 0 2px; min-width: 0; }
.vz-stat .k { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--viz-text); }
.vz-stat .v { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 3px; color: var(--viz-ink); }
.vz-stat .s { font-size: 12px; color: var(--viz-text); margin-top: 1px; }
.vz-plot { margin-top: 18px; }
.vz-plot .chart-box { height: 320px; } .vz-plot .chart-box.tall { height: 400px; } .vz-plot .chart-box.short { height: 220px; }
.vz-foot { margin: 16px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.5; color: var(--viz-text); }
.vz-sub { margin: 0 0 12px; }
.vz-sub .vz-kicker { margin: 0; }
.vz-sub .vz-kicker::before { display: none; }
.vz-table-card { padding-top: 16px; }
.vz-card + .grid, .vz-card + .alert, .alert + .vz-table-card { margin-top: 14px; }

/* stat tiles everywhere pick up the same voice */
.stat .v { font-weight: 650; letter-spacing: -.015em; font-variant-numeric: tabular-nums; color: var(--viz-ink); margin-top: 5px; }
.stat .s { margin-top: 2px; color: var(--viz-text); }

/* ---- line key: a short stroke and plain text, never a colour chip ---- */
.vz-key { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 12px; color: var(--viz-text); }
.vz-key span { display: inline-flex; align-items: center; gap: 7px; min-height: 20px; }
.vz-key i { display: block; width: 16px; height: 0; border-top: 2px solid var(--viz-other); border-radius: 1px; flex: none; }
.vz-key i.dash { border-top-style: dashed; }
.vz-key b { font-weight: 600; color: var(--text); }
/* [ui] stacked-bar readout: the selected bar's parts, top to bottom as stacked, each with a thin bar in its colour */
/* [pl-cards] the hover key that follows the pointer over a Planner chart */
.vz-hk { position: absolute; z-index: 5; pointer-events: none; min-width: 190px; max-width: min(320px, 94%); padding: 8px 10px; background: var(--viz-tip-bg); color: var(--viz-tip-ink); border: 1px solid var(--viz-tip-line); border-radius: 8px; font-size: 12px; line-height: 1.4; }
.vz-hk-h { font-weight: 600; margin-bottom: 5px; }
.vz-hk-r { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 1px 0; }
.vz-hk-r .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vz-hk-r b { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vz-hk-r i.sw { display: block; width: 10px; height: 10px; border-radius: 2px; }
.vz-hk-r i.sw.ln { width: 12px; height: 0; border-top: 2px solid; border-radius: 1px; }
.vz-hk-r i.sw.none { background: none; }
.vz-hk-r.tot { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--viz-tip-line); }
.vz-hk-r.tot b, .vz-hk-r.tot .n { font-weight: 600; }
.vz-stack { margin-top: 14px; border-top: 1px solid var(--viz-grid); }
.vz-stack-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--viz-text); }
.vz-stack-h b { font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--text); font-variant-numeric: tabular-nums; }
.vz-stack button.vz-stack-r { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 5px 12px; width: 100%; margin: 0; padding: 8px 0 9px; min-height: 0;
  background: none; border: 0; border-bottom: 1px solid var(--viz-grid); border-radius: 0; color: var(--text); font-size: 13px; text-align: left; cursor: pointer; transition: opacity .2s; }
.vz-stack button.vz-stack-r:last-child { border-bottom: 0; }
.vz-stack-r span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vz-stack-r b { font-weight: 500; font-variant-numeric: tabular-nums; }
.vz-stack-r i { grid-column: 1 / -1; display: block; height: 3px; border-radius: 2px; }
.vz-stack-r.on span, .vz-stack-r.on b { font-weight: 650; }
.vz-stack-r.off { opacity: .45; }
.vz-stack-r:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vz-stack-none { padding: 8px 0; font-size: 13px; color: var(--viz-text); }
.legend i, .income-legend i { width: 16px; height: 2px; border-radius: 1px; vertical-align: middle; margin-right: 7px; }
.legend, .income-legend { color: var(--viz-text); gap: 6px 18px; }

/* ---- ranked list (the donut's small-screen partner) ---- */
.vz-rank { display: none; margin-top: 6px; }
.vz-narrow > .vz-rank, .vz-rank.on { display: block; }
.vz-rank-row { padding: 11px 0 10px; border-top: 1px solid var(--line); min-height: 44px; }
.vz-rank-row:first-child { border-top: 0; }
.vz-rank-h { display: flex; align-items: baseline; gap: 10px; }
.vz-rank-n { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--text); }
.vz-rank-a { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text); }
.vz-rank-p { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--viz-text); min-width: 4ch; text-align: right; font-size: 12px; }
.vz-rank-bar { height: 3px; border-radius: 2px; background: var(--viz-grid); margin-top: 8px; overflow: hidden; }
.vz-rank-bar i { display: block; height: 100%; border-radius: 2px; background: var(--viz-other); min-width: 2px; }
a.vz-rank-row, button.vz-rank-row { display: block; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); color: inherit; cursor: pointer; font: inherit; }
a.vz-rank-row:hover { text-decoration: none; }
details.vz-rank-row > summary { list-style: none; cursor: pointer; }
details.vz-rank-row > summary::-webkit-details-marker { display: none; }
details.vz-rank-row .vz-rank-n::after { content: " ▾"; color: var(--viz-text); font-weight: 400; }
details.vz-rank-row[open] .vz-rank-n::after { content: " ▴"; }
.vz-rank-kids { margin: 10px 0 2px; padding-left: 12px; border-left: 1px solid var(--line2); font-size: 13px; }
.vz-rank-kids div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; color: var(--viz-text); }
.vz-rank-kids div span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.vz-rank-kids div span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }

.vz-donut .chart-box { height: 400px; }
.vz-donut.vz-narrow .chart-box { height: 220px; }
.vz-donut canvas { cursor: pointer; }

/* ---- plan bars (budget vs actual): a thin fill against a tick at 100% of plan ---- */
.vz-plan { position: relative; height: 4px; border-radius: 2px; background: var(--viz-grid); min-width: 110px; }
.vz-plan i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--viz-in); }
.vz-plan.over i { background: var(--viz-out); }
.vz-plan::after { content: ""; position: absolute; left: 66.7%; top: -4px; bottom: -4px; width: 1px; background: var(--viz-ink); opacity: .55; }

/* heat table: one hue, light to dark */
.heat td.v { background: color-mix(in srgb, var(--viz-1) calc(var(--vz-h, 0) * 1%), transparent); }

/* existing meters and bars move onto the palette */
.home-bar { height: 3px; border-radius: 2px; background: var(--viz-grid); }
.home-bar i { background: var(--viz-1); border-radius: 2px; }
.home-bar i.bad { background: var(--viz-out); } .home-bar i.warn { background: var(--viz-warn); }
.bench-track { background: var(--viz-grid); height: 6px; border-radius: 3px; }
.bench-fill { background: var(--viz-1); border-radius: 3px; }
.bench-sub .bench-track { height: 4px; }
.bench-mark { top: -5px; bottom: -5px; width: 2px; background: var(--viz-ink); }
.alloc-bar { height: 6px; border-radius: 3px; gap: 2px; background: transparent; }
.alloc-bar i { border-radius: 1px; }

@media (max-width: 860px) {
  .vz-card { padding: 18px 16px 14px; }
  .vz-card > .vz-plot { order: 2; } .vz-card > .vz-stats { order: 3; } .vz-card > .vz-foot { order: 4; }
  .vz-value { font-size: 32px; }
  .vz-take { font-size: 14px; }
  .vz-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
  .vz-stat .v { font-size: 16px; }
  .vz-plot .chart-box { height: 260px; } .vz-plot .chart-box.tall { height: 300px; }
  .vz-key { gap: 4px 14px; }
  .vz-key span { min-height: 24px; }
  .vz-plan { min-width: 64px; }
}
@media (prefers-reduced-motion: reduce) { .vz-rank-bar i, .vz-plan i { transition: none; } }

/* [ui-begin] ================================================================
   [ui] Yosan app UI system: the house style of the reports, extended to the whole app.
   Tokens are at the top of this file; this block is the component layer. See DESIGN.md, "App UI".
   Rules of thumb: chrome is monochrome (ink on quiet surfaces); colour is kept for what money is
   doing (jade in, rust out or over, ochre needs a look, cobalt for links and focus). Few boxes:
   one card surface, hairline rules inside it, small-caps kickers, tabular money numerals.
   ========================================================================== */

/* ---- base type ---- */
body { font: var(--t-body)/1.5 var(--font); color: var(--ink); background: var(--surface-0); }
h1 { font: 650 var(--t-title)/1.15 var(--font-display); letter-spacing: -.02em; }
h2 { font-size: 15px; font-weight: 650; letter-spacing: -.005em; }
h3 { font-size: 13px; font-weight: 650; margin: 16px 0 8px; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
b, strong { font-weight: 650; }
.muted { color: var(--ink-3); }
.num, .vz-num, table.t td.num, .bgrid .asg { font-variant-numeric: tabular-nums lining-nums; }
::selection { background: color-mix(in srgb, var(--accent-fill) 60%, transparent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-ink); box-shadow: 0 0 0 3px var(--ring); }

/* the money numeral: dollars first, the cents step down (VIZ.num) */
.cents { font-size: .5em; font-weight: 600; letter-spacing: 0; color: var(--ink-2); margin-left: .05em; }
.vz-value .cents { font-size: .48em; }
.neg > .cents, .vz-value.neg .cents { color: inherit; opacity: .8; }
/* kickers: small caps, tracked. The stepped mark opens headline cards and page titles; .plain leaves it off */
.vz-kicker.plain::before { display: none; }
.vz-kicker { color: var(--ink-2); }

/* ---- shell: sidebar ---- */
#side { background: var(--surface-0); border-right: 1px solid var(--rule); }
#side .brand { padding: 20px 18px 14px; font: 650 16px/1 var(--font-display); letter-spacing: -.01em; gap: 10px; align-items: center; }
#side .brand .dot { width: 26px; height: 26px; color: var(--ink); }
#side nav { padding: 2px 0 8px; }
#side nav a { position: relative; height: 34px; padding: 0 10px 0 12px; margin: 1px 8px; border-radius: var(--radius-s); color: var(--ink-2); font-weight: 500; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
#side nav a:hover { background: var(--surface-2); color: var(--ink); }
#side nav a .ic, #side nav a:hover .ic { color: currentColor; }
#side nav a.active { background: var(--surface-1); color: var(--ink); font-weight: 650; }
#side nav a.active .ic { color: var(--ink); }
#side nav a.active::before, .side-accounts a.active::before { content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 2px; border-radius: 1px; background: var(--ink); }
.side-accounts a.active::before { left: 0; top: 7px; bottom: 7px; }
.side-accounts { border-top: 1px solid var(--rule); margin-top: 6px; padding: 8px 0; }
.side-head, .side-accounts .grp { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.side-accounts .grp { padding: 12px 18px 4px; }
.side-accounts .grp .num { letter-spacing: 0; font-weight: 500; }
.side-accounts a { position: relative; min-height: 30px; padding: 0 18px; color: var(--ink-2); transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.side-accounts a:hover { background: var(--surface-2); color: var(--ink); }
.side-accounts a.active { background: var(--surface-1); color: var(--ink); font-weight: 600; }
.side-accounts a .num { color: var(--ink); } .side-accounts a .num.bad { color: var(--neg); }
.side-accounts .side-list .trk-badge { display: none; }   /* the group heading already says Tracking */
.side-foot { background: var(--surface-0); border-top: 1px solid var(--rule); }
.setup-link .setup-pct { background: transparent; color: var(--ink-3); font-weight: 600; padding: 0; }
body.syncing .brand::after { background: var(--accent-ink); }

/* counts that want a look: ochre on a faint ochre ground, never a red alarm */
.badge, .side-accounts a .acct-badge, .side-accounts a .badge { min-width: 18px; padding: 0 6px; font: 650 11px/18px var(--font); font-variant-numeric: tabular-nums; border-radius: 9px; background: var(--caution-weak); color: var(--caution); }
.trk-badge { background: transparent; border: 1px solid var(--rule-2); color: var(--ink-3); font: 600 10px/1.5 var(--font); letter-spacing: .05em; text-transform: uppercase; padding: 0 5px; border-radius: 4px; }

/* ---- shell: page ---- */
#main { padding: 26px 30px 80px; }
.page-head { gap: 10px 12px; margin-bottom: 20px; min-height: 40px; }
.page-head .ph-t { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.page-head .ph-t .vz-kicker { margin: 0; }

/* ---- buttons: quiet by default, ink for the one primary action, rust for danger ---- */
.btn { min-height: 34px; padding: 6px 12px; border: 1px solid var(--rule-2); background: transparent; color: var(--ink); border-radius: var(--radius-s); font-weight: 500; text-decoration: none;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease); }
a.btn:hover { text-decoration: none; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--ink); color: var(--surface-0); border-color: var(--ink); font-weight: 650; }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--surface-0)); border-color: transparent; filter: none; }
.btn.danger { color: var(--neg); }
.btn.danger:hover { background: var(--neg-weak); border-color: color-mix(in srgb, var(--neg) 45%, transparent); }
.btn.primary.danger, .btn.primary.danger:hover { background: var(--neg-fill); border-color: var(--neg-fill); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { min-height: 28px; padding: 3px 10px; font-size: 12px; }
.btn.on { background: var(--surface-3); border-color: var(--rule-2); font-weight: 650; }
.btn:disabled { opacity: .45; }
.btn.approved { background: var(--pos-weak); color: var(--pos); border-color: transparent; }
.fab { background: var(--ink); color: var(--surface-0); }
.bulkbar { background: var(--ink); color: var(--surface-0); border-radius: var(--radius); }
.bulkbar .btn { background: transparent; color: inherit; border-color: color-mix(in srgb, var(--surface-0) 35%, transparent); }
.bulkbar .btn:hover { background: color-mix(in srgb, var(--surface-0) 14%, transparent); }

/* ---- segmented controls and tabs: the chosen one is ink, not a colour fill ---- */
.seg, .income-jump { border: 1px solid var(--rule-2); border-radius: var(--radius-s); background: transparent; padding: 2px; gap: 2px; overflow: visible; }
.seg button, .income-jump .btn { background: transparent; color: var(--ink-2); border: 0; border-radius: 4px; padding: 4px 10px; font-weight: 500; min-height: 28px; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.seg button:hover, .income-jump .btn:hover { color: var(--ink); background: transparent; }
.seg button.on, .income-jump .btn.on, .rb-seg-b.on { background: var(--surface-3); color: var(--ink); font-weight: 650; }
.seg button:disabled { opacity: .45; cursor: default; }
.income-jump .btn { border-right: 0; min-height: 36px; padding: 0 12px; }
.tabs { gap: 0 4px; border-bottom: 1px solid var(--rule); margin-bottom: 18px; -webkit-mask-image: none; mask-image: none; }
.tabs a { padding: 9px 10px 10px; margin-bottom: -1px; color: var(--ink-3); font-weight: 500; border-bottom: 2px solid transparent; transition: color var(--dur) var(--ease); }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); font-weight: 650; border-bottom-color: var(--ink); }

/* ---- fields ---- */
input[type=text], input[type=number], input[type=date], input[type=month], input[type=password], input[type=search], input[type=email], input[type=url], select, textarea {
  background: color-mix(in srgb, var(--surface-1) 55%, var(--surface-0)); border: 1px solid var(--field); border-radius: var(--radius-s); color: var(--ink); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
::placeholder { color: var(--ink-3); opacity: .85; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent-fill); }
label.f > span { font-weight: 600; color: var(--ink-2); }
.kbd { border-color: var(--rule-2); color: var(--ink-2); }

/* ---- surfaces: one card, hairline rules inside; stat tiles become a ruled row of figures ---- */
.card { background: var(--surface-1); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px 20px; box-shadow: none; }
.cards { gap: 0 22px; margin-bottom: 18px; }
.cards > .stat { background: transparent; border: 0; border-top: 1px solid var(--rule-2); border-radius: 0; padding: 10px 0 8px; }
.cards.mini > .stat { padding: 8px 0 6px; }
.stat .v { font-size: 20px; }
details.sec { background: var(--surface-1); border-color: var(--rule); }
details.sec > summary { font-weight: 650; }
.person, .acct-box, .asset-box, .sugg { border-color: var(--rule); background: transparent; border-radius: var(--radius); }
.empty { padding: 48px 16px; color: var(--ink-3); }
.spinner { border-color: var(--rule-2); border-top-color: var(--ink-2); }
.kv { gap: 0 16px; } .kv > * { padding: 6px 0; border-bottom: 1px solid var(--rule); } .kv > :nth-last-child(-n+2) { border-bottom: 0; }
.kv .k { color: var(--ink-2); }

/* the ledger line: label, dotted leader, figure. The app's key-and-value row (VIZ-style leader lines, in HTML) */
.ledger { display: grid; }
.lr, .home-row { display: flex; align-items: baseline; gap: 8px; min-height: 30px; }
.lr > .k { color: var(--ink-2); min-width: 0; }
.lead { flex: 1 1 12px; min-width: 12px; height: 0; align-self: baseline; border-bottom: 1px dotted var(--viz-leader); transform: translateY(-4px); opacity: .75; }
.lr > .v { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

/* ---- tables ---- */
table.t th, .bgrid th { font-size: 11px; font-weight: 600; letter-spacing: .09em; color: var(--ink-3); padding: 8px 10px 9px; border-bottom: 1px solid var(--rule-2); }
table.t th { background: var(--surface-1); }
table.t th.right, table.t th.num { text-align: right; }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--rule); }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tr.click:hover td { background: var(--surface-2); }
table.t tr.sel td { background: var(--accent-weak); }
.reg tr.unapproved td:first-child, .txn.unapproved { box-shadow: inset 2px 0 var(--caution); }
.txn-list { background: var(--surface-1); border-color: var(--rule); }
.txn .l1 .p { font-weight: 600; }

/* ---- chips and pills ---- */
.pill { padding: 3px 9px; border-radius: var(--radius-s); font-weight: 600; background: var(--surface-2); color: var(--ink); transition: background var(--dur) var(--ease); }
.pill:hover { background: var(--surface-3); }
.pill.pos { background: transparent; color: var(--ink); } .pill.pos:hover { background: var(--surface-2); }
@media (hover: none) { .pill.pos { background: var(--surface-2); } }
.pill.zero { background: transparent; color: var(--ink-3); }
.pill.neg { background: var(--neg-weak); color: var(--neg); }
.pill.credit { background: var(--caution-weak); color: var(--caution); }
.chip.ai, .setup-pct { border-radius: 4px; }
.chip.trk { border-radius: var(--radius-s); background: var(--surface-2); }
.xfer-chip { border-color: var(--rule-2); border-style: solid; background: transparent; color: var(--accent-ink); border-radius: var(--radius-s); }

/* ---- banners and notices. One shape, three voices, each with its own mark as well as its colour:
        ring = for your information, dot = needs a look, diamond = something is wrong, tick = done for you ---- */
.alert, .page-banner, .earn-banner, .due-strip, .rb-ask, .bench-info, .card.whatif { background: var(--surface-1); border: 1px solid var(--rule); border-radius: var(--radius); color: var(--ink); }
.alert.bad, .alert.good, .alert.info, .earn-banner.warn, .earn-banner.teal { background: var(--surface-1); }
.alert { position: relative; padding: 11px 14px 11px 36px; }
.alert::before, .notice::before, .page-banner::before, .home-attn::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--caution); }
.alert::before { position: absolute; left: 15px; top: 18px; }
.alert.bad::before, .notice.bad::before, .home-attn.bad::before { border-radius: 1px; background: var(--neg); transform: rotate(45deg) scale(.9); }
.alert.info::before, .page-banner::before { background: transparent; box-shadow: inset 0 0 0 2px var(--accent-ink); }
.alert.good::before { width: 5px; height: 9px; border-radius: 0; background: transparent; border: solid var(--pos); border-width: 0 2px 2px 0; transform: rotate(45deg); top: 15px; left: 17px; }
.page-banner { padding: 14px 16px; gap: 12px; }
.page-banner::before { margin-top: 7px; }
.page-banner .pb-title { font-weight: 650; }
.notice { background: var(--surface-1); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: none; padding: 10px 12px 10px 15px; justify-content: flex-start; }
.notice.bad, .notice.warn, .av-done { box-shadow: none; }
.notice::before { background: var(--ink-3); }
.notice.warn::before { background: var(--caution); }
.notice.av-done::before, .notice.av-multi::before { display: none; }
.notice .nt { flex: 1 1 auto; }
.notice .nv { font-weight: 650; }
.notice .nl { color: var(--ink-2); }
.due-strip { padding: 10px 14px; } .due-strip .ds-item { background: transparent; border-color: var(--rule-2); border-radius: var(--radius-s); }
.due-strip .ds-item:hover { border-color: var(--ink-2); }
.bgrid tr.filter-note td { background: transparent; color: var(--ink-2); border-bottom: 1px solid var(--rule-2); }

/* ---- help, popovers, menus, modals, toasts ---- */
.help-tip, .home-tip, .bench-i { width: 16px; height: 16px; border: 1px solid var(--rule-2); background: transparent; color: var(--ink-3); font: 600 10px/1 var(--font); font-style: normal; transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.help-tip:hover, .help-tip[aria-expanded="true"], .bench-i:hover { color: var(--ink); border-color: var(--ink-2); background: transparent; }
.help-link { background: transparent; border-color: var(--rule-2); color: var(--ink-3); }
.help-link:hover { color: var(--ink); border-color: var(--ink-2); }
.help-learn { color: var(--accent-ink); }
.help-pop, .pop, .menu, .cp-pop { background: var(--surface-2); border: 1px solid var(--rule-2); border-radius: var(--radius); box-shadow: var(--pop-shadow); color: var(--ink); }
.menu button { border-radius: 4px; color: var(--ink); } .menu button:hover, .cp-opt.on { background: var(--surface-3); }
.cp-grp { letter-spacing: .09em; font-weight: 600; color: var(--ink-3); } .cp-opt.sel { font-weight: 650; }
.modal-bg { background: rgba(6,8,11,.62); }
.modal { background: var(--surface-1); border: 1px solid var(--rule-2); border-radius: 12px; box-shadow: 0 24px 64px rgba(0,0,0,.5); animation: uiRise 180ms var(--ease) both; }
.modal .mh { padding: 16px 20px; border-bottom: 1px solid var(--rule); font: 650 16px/1.3 var(--font-display); letter-spacing: -.01em; }
.modal .mb { padding: 18px 20px; }
.modal .mf { padding: 12px 20px; border-top: 1px solid var(--rule); }
.sheet-list .btn.on { background: var(--surface-3); }
@keyframes uiRise { from { opacity: 0; transform: translateY(8px); } }
.toast { background: var(--viz-tip-bg); color: var(--viz-tip-ink); border: 1px solid var(--viz-tip-line); border-radius: var(--radius); padding: 10px 14px; box-shadow: var(--pop-shadow); font-weight: 500; animation: uiRise 200ms var(--ease) both; }
.toast button { color: inherit; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.toast.err { background: var(--viz-tip-bg); color: var(--viz-tip-ink); border-color: #e5795a; }
.toast.err::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 1px; background: #e5795a; transform: rotate(45deg); }

/* ---- meters: a thin track on the grid colour, fills from the palette ---- */
.bgrid td.nm .bar { height: 3px; border-radius: 2px; background: var(--viz-grid); margin-top: 6px; max-width: 340px; }
.bgrid td.nm .bar > i { background: var(--viz-in); border-radius: 2px; transition: width 400ms var(--ease); }
.bgrid td.nm .bar.under > i { background: var(--viz-warn); }
.home-bar i, .vz-plan i, .bench-fill, .vz-rank-bar i { transition: width 400ms var(--ease); }
.earn-steps i { height: 3px; border-radius: 2px; background: var(--viz-grid); } .earn-steps i.on { background: var(--viz-in); }

/* ---- How you compare: the detail under the report card ---- */
.bench-page { max-width: none; } .bench-page > :not(.vz-card) { max-width: 880px; }
.bench-ctl { margin: 0; gap: 8px 10px; }
.bench-amt { font: 650 22px/1.1 var(--font-display); letter-spacing: -.015em; }
.bench-vs, .bench-badge { background: transparent; border: 1px solid var(--rule-2); border-radius: 4px; color: var(--ink-2); padding: 0 6px; }
.bench-badge.est { background: transparent; border-color: color-mix(in srgb, var(--caution) 50%, transparent); color: var(--caution); }
.bench-h { margin: 22px 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); }
.bench-q { background: var(--viz-leader); }

/* ---- Budget ---- */
.rta { align-items: stretch; gap: 0; flex-wrap: nowrap; margin-bottom: 14px; }
.rta.pos, .rta.zero, .rta.neg { background: var(--surface-1); }
.rta .rta-notes { margin-top: 8px; display: grid; gap: 2px; }
.rta .rta-over { color: var(--ink-2); } .rta .rta-over.warn { color: var(--caution); }
.budget-wrap { gap: 14px; }
.bgrid tr.grp td { background: transparent; padding: 16px 10px 7px; border-bottom: 1px solid var(--rule-2); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.bgrid tr.grp td:first-child { font-size: 11px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--ink); }
.bgrid tr.grp .muted.small { letter-spacing: 0; text-transform: none; font-weight: 400; }
.bgrid input.ename-in { text-transform: none; letter-spacing: 0; font-size: 13px; background: var(--surface-0); }
.bgrid tr.cat td { padding: 6px 10px; border-bottom: 1px solid var(--rule); transition: background var(--dur) var(--ease); }
.bgrid tr.cat:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
/* group and category names share one left edge; the drag grip and the open/close chevron sit in the gutter */
.bgrid tr.cat td.nm, .bgrid tr.grp td:first-child { position: relative; padding-left: 32px; }
.bgrid .grip { position: absolute; left: 3px; top: 50%; margin: -9px 0 0; }
.bgrid tr.grp .grip { top: auto; bottom: 7px; margin: 0; }
.bgrid tr.grp td:first-child > .ic { position: absolute; left: 13px; bottom: 9px; margin: 0 !important; }
.bgrid tr.grp td.g-asg { padding-right: 17px; } .bgrid tr.grp td.g-av { padding-right: 19px; }
.bgrid tr.cat.sel td { background: var(--surface-2); }
.bgrid tr.cat.sel td:first-child { box-shadow: inset 2px 0 var(--ink); }
.bgrid tr.cat td.nm > div:first-child { display: flex; align-items: center; gap: 4px; min-width: 0; }
.bgrid tr.cat .rowtools { float: none; margin-left: auto; flex: none; }
.bgrid tr.cat .ename, .bgrid tr.cat .nmtxt { min-width: 0; overflow-wrap: anywhere; }
.bgrid tr.dragging td { background: var(--surface-2); }
.bgrid .asg { border-radius: 4px; color: var(--ink); }
.bgrid .asg:hover { border-color: var(--field); } .bgrid .asg:focus { background: var(--surface-0); border-color: var(--accent-ink); }
.bgrid .c-act a { color: var(--ink-2); } .bgrid .c-act a:hover { color: var(--ink); }
.bgrid .pill { min-width: 84px; text-align: right; }
.goal-note { margin-top: 3px; color: var(--ink-3); }
.bgrid tr.cat.just-saved td:first-child { box-shadow: inset 2px 0 var(--pos); }
.inspector .card { padding: 18px 20px; }
.inspector .vz-sub { margin: 0 0 6px; }
.inspector .vz-sub + .ledger { margin-bottom: 16px; }
/* [qa] quick-assign actions read as buttons: a fill one step off the card (the surface tokens follow light and dark), a hairline edge, a hover step */
.qa { display: grid; gap: 8px; margin: 0 0 12px; }
.qa button { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 0 12px; background: var(--surface-2); border: 1px solid var(--rule-2); border-radius: var(--radius-s); color: var(--ink); font: inherit; font-weight: 550; text-align: left; cursor: pointer; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.qa button span:last-child { color: var(--ink-2); font-weight: 400; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qa button:hover:not(:disabled) { background: var(--surface-3); border-color: var(--field); }
.qa button:active:not(:disabled) { transform: translateY(1px); }
.qa button:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
@media (max-width: 720px) { .qa button { min-height: 44px; } }
.qa button:disabled { opacity: .45; cursor: default; }

/* ---- Home: every tile reads kicker, figure, one sentence, then the detail ---- */
.home-page .page-head { margin-bottom: 22px; }
.home-tile { padding: 16px 18px 16px; gap: 10px; transition: border-color var(--dur) var(--ease); }
.home-tile.go:hover { border-color: var(--rule-2); }
.home-head { min-height: 18px; }
.home-title { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); }
.home-title:hover { color: var(--ink); text-decoration: none; }
.home-go { font-size: 18px; color: var(--ink-3); margin: -13px -14px -13px 0; }
.home-go:hover { color: var(--ink); text-decoration: none; }
.home-body { gap: 10px; }
.home-big { font: 650 var(--t-num)/1.1 var(--font-display); letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums lining-nums; text-align: left; }
.home-big.bad { color: var(--neg); }
.home-big .unit { font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--ink-2); margin-left: 6px; }
.home-take { margin: -2px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink); text-wrap: pretty; }
.home-take b { font-weight: 650; }
.home-kick { margin-top: 4px; font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.home-foot { margin: 0; font-size: 12px; line-height: 1.5; color: var(--ink-3); }
.home-2 { gap: 0 18px; }
.home-stat { border-top: 1px solid var(--rule-2); padding: 9px 0 2px; gap: 3px; }
.home-stat > .small, .earn-c > .small { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); display: inline-flex; align-items: center; }
.home-stat b, .earn-v, .earn-pl { font-size: 17px; font-weight: 650; text-align: left; color: var(--ink); }
.home-stat b.bad { color: var(--neg); } .home-stat b.good, .earn-v.good { color: var(--pos); } .home-stat b.warn { color: var(--caution); }
.home-stat .home-of { font-size: 12px; letter-spacing: 0; text-transform: none; font-weight: 400; color: var(--ink-3); }
.home-row .home-l { color: var(--ink-2); flex: 0 1 auto; }
.home-row > .num { font-weight: 600; color: var(--ink); } .home-row > .num.bad { color: var(--neg); } .home-row > .num.good { color: var(--pos); } .home-row > .num.warn { color: var(--caution); } .home-row > .num.muted { color: var(--ink-3); font-weight: 400; }
.home-item { gap: 5px; }
.home-item .home-row { min-height: 22px; }
.home-list { display: grid; }
.home-attn { background: transparent; border-radius: 0; padding: 11px 0; border-top: 1px solid var(--rule); gap: 12px; min-height: 48px; transition: color var(--dur) var(--ease); }
.home-attn.bad { background: transparent; }
.home-attn:first-child, .home-txn:first-child, .home-due:first-child { border-top: 0; }
.home-attn b.num { min-width: 26px; font: 650 20px/1 var(--font-display); text-align: left; }
.home-attn > span:last-child { color: var(--ink-3); }
.home-attn:hover { text-decoration: none; } .home-attn:hover > span:last-child { color: var(--ink); }
.setup-next::before { display: none; }
.setup-next b { font-size: 14px; min-width: 0; }
.setup-tile { margin-bottom: 2px; }
.setup-item .btn.primary { background: transparent; color: var(--ink); border-color: var(--rule-2); font-weight: 600; }   /* one primary action per screen: the hero's */
.setup-item .btn.primary:hover { background: var(--surface-2); }
.home-txn { border-bottom: 0; border-top: 1px solid var(--rule); min-height: 46px; }
.home-txn-m b { font-weight: 600; }
.home-txn .num { font-weight: 600; } .home-txn .num.good { color: var(--pos); }
.home-due { background: transparent; border-radius: 0; box-shadow: none; padding: 10px 0; border-top: 1px solid var(--rule); }
.home-due.warn, .home-due.bad { box-shadow: none; }
.home-due .num { font-weight: 600; } .home-due.warn .num { color: var(--caution); } .home-due.bad .num { color: var(--neg); }
.home-ok { color: var(--ink-2); }
.home-skel i { height: 10px; border-radius: 3px; background: var(--surface-2); }
.home-review, .badge.home-review { background: transparent; color: var(--ink-2); border: 1px solid var(--rule-2); border-radius: 4px; font-weight: 600; min-height: 24px; padding: 0 8px; line-height: 1; }
.home-review:hover { color: var(--ink); border-color: var(--ink-2); }
.home-pick { background: transparent; border-color: var(--rule); border-radius: var(--radius); }
.home-pick:hover { border-color: var(--rule-2); background: var(--surface-2); }
.home-picker h3 { font-size: 11px; letter-spacing: .09em; }
.streak-item { color: var(--ink); text-decoration: none; padding-top: 8px; border-top: 1px solid var(--rule); }
.streak-item:first-child { border-top: 0; padding-top: 0; }
a.streak-item:hover { text-decoration: none; }
/* earnings pace: the live figure keeps its own stepped-down digits; the three cells become a ruled row */
.earn-top b { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.earn-dot { width: 6px; height: 6px; background: var(--pos); }
.earn-main { font: 650 var(--t-hero)/1.05 var(--font-display); letter-spacing: -.025em; } .earn-sub { font-size: 19px; font-weight: 600; color: var(--ink-3); margin-left: 1px; }
.earn-3 { gap: 0 18px; }
.earn-c { background: transparent; border-radius: 0; padding: 9px 0 4px; border-top: 1px solid var(--rule-2); gap: 3px; transition: border-color var(--dur) var(--ease); }
a.earn-c-in, a.earn-c-out { box-shadow: none; }
a.earn-c:hover { text-decoration: none; border-top-color: var(--ink-2); }
.earn-v.warn { color: var(--ink); }
.earn-pl, .earn-v { white-space: nowrap; }
.earn-ne { font-weight: 650; }

/* ---- phones ---- */
@media (max-width: 860px) {
  #main { padding: 14px 16px calc(96px + env(safe-area-inset-bottom)); }
  h1 { font-size: 21px; }
  .card { padding: 16px 16px; }
  .btn { min-height: 44px; }
  .btn.sm { min-height: 36px; position: relative; }
  .btn.sm::after, .pill::after, .seg button::after { content: ""; position: absolute; inset: -5px -2px; }   /* 44px touch target without a taller control */
  .pill, .seg button { position: relative; }
  .seg button { min-height: 36px; }
  .tabs a { min-height: 44px; }
  input[type=text], input[type=number], input[type=date], input[type=month], input[type=password], input[type=search], input[type=email], input[type=url], select { min-height: 44px; }
  .bgrid .asg { min-height: 40px; width: 86px; }
  .earn-v, .earn-pl, .home-stat b { font-size: 15px; }
  #tabbar { background: color-mix(in srgb, var(--surface-0) 94%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--rule); }
  #tabbar a { color: var(--ink-3); }
  #tabbar a.active { color: var(--ink); font-weight: 650; }
  #tabbar a.active::before { content: ""; position: absolute; top: -1px; left: 30%; right: 30%; height: 2px; border-radius: 1px; background: var(--ink); }
  #tabbar a .tb-badge { background: var(--ink); color: var(--surface-0); font-weight: 650; }
  .cards { gap: 0 16px; }
  .bgrid tr.grp td, .bgrid tr.cat td, .bgrid th { padding-left: 6px; padding-right: 6px; }
  .bgrid tr.cat td.nm, .bgrid tr.grp td:first-child { padding-left: 24px; }
  .bgrid tr.grp td:first-child > .ic { left: 4px; }
  .bgrid tr.grp td.g-asg { padding-right: 11px; } .bgrid tr.grp td.g-av { padding-right: 15px; }
  .bgrid .pill { min-width: 76px; }
  .home-tile { padding: 14px 16px; }
  .earn-main { font-size: 32px; } .earn-sub { font-size: 16px; }
  .modal { border-radius: 14px 14px 0 0; }
  .notice { padding: 10px 12px; }
  /* 44px touch targets: small controls keep their size and grow an invisible hit area */
  .help-tip { width: 20px; height: 20px; font-size: 12px; }
  .bgrid .asg { min-height: 44px; }
  .pill::after { inset: -9px -2px; }
  .bgrid .rowtools .btn::after { inset: -11px -4px; }
  .home-title, .home-review, a.small { position: relative; }
  .home-title::after, .home-review::after, a.small::after { content: ""; position: absolute; inset: -14px -4px; }
  .home-txn { min-height: 52px; } .home-txn-m { padding: 4px 0; }
  details.vz-rank-row { padding-top: 0; padding-bottom: 0; } details.vz-rank-row > summary { padding: 11px 0 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
/* [ui] review fixes: six figures sit 3 + 3, never 5 + 1; the call-to-action inside a Needs attention row keeps body size */
@media (min-width: 721px) { .cards:has(> .stat:nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.home-attn .small b { min-width: 0; font-size: inherit; font-weight: 600; text-align: left; }
/* [ui2] ==== Phase 2: the same house style on every remaining page. See DESIGN.md, "App UI: the rest of the app". ==== */

/* ---- page head, section heads, long text ---- */
.page-head h1 { min-width: 0; overflow-wrap: anywhere; }
.page-head h1 .trk-badge { vertical-align: 5px; margin-left: 4px; }
.card > h2:first-child, .card > .row:first-child > h2 { margin-top: 0; }
.card h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card p { text-wrap: pretty; }
p.muted, .card > p.small, .small.muted { line-height: 1.55; }
.card > p:last-child { margin-bottom: 0; }
.vz-table-card > .vz-sub { margin-bottom: 4px; }
.vz-foot a { color: var(--accent-ink); }
hr { border: 0; border-top: 1px solid var(--rule); margin: 16px 0; }
small.muted, label.f small { font-size: 12px; line-height: 1.45; color: var(--ink-3); }
.empty { display: grid; justify-items: center; gap: 10px; text-wrap: balance; line-height: 1.5; }
.empty .ic { margin: 0; opacity: 1; color: var(--ink-3); }
.empty .spinner { margin-right: 0; }
.card.empty { padding: 44px 20px; color: var(--ink-2); }
.spinner { border-width: 2px; }

/* ---- fields and forms: one label style, one field height, selects with the app's own chevron ---- */
label.f { gap: 6px; font-size: 12px; }
label.f > span, .help-label { display: inline-flex; align-items: center; gap: 6px; }
label.f input, label.f select, label.f textarea { font-size: 14px; }
input[type=text], input[type=number], input[type=date], input[type=month], input[type=time], input[type=password], input[type=search], input[type=email], input[type=url], input[type=tel], select { min-height: 36px; padding: 6px 10px; }
input[type=time], input[type=tel] { background: color-mix(in srgb, var(--surface-1) 55%, var(--surface-0)); border: 1px solid var(--field); border-radius: var(--radius-s); color: var(--ink); }
textarea { padding: 8px 10px; line-height: 1.5; }
select { -webkit-appearance: none; appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; text-overflow: ellipsis; }
select[multiple] { background-image: none; padding-right: 10px; }
input:disabled, select:disabled, textarea:disabled { opacity: .55; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; flex: none; margin: 0; }
.chk { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; color: var(--ink); cursor: pointer; }
.btn { gap: 6px; }
.btn .ic { margin: 0 -1px; }
.btn.danger.sm { border-color: var(--rule-2); }

/* ---- Accounts: net worth card, then each group as a ruled list with its total ---- */
.acct-group { padding-bottom: 8px; }
.acct-group-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.acct-group-h .vz-kicker { color: var(--ink); gap: 7px; }
.acct-group-h > .num { font-weight: 600; color: var(--ink-2); }
.acct-group table.t { margin: 0 -10px; width: calc(100% + 20px); }
.acct-group td:first-child { font-weight: 600; }
.acct-group .acct-n { margin-right: 4px; }
.acct-group .acct-badge { margin-left: 6px; }
.sync { color: var(--ink-3); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.sync::before { content: ""; width: 7px; height: 7px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink-3); flex: none; }
.sync.ok { color: var(--ink-2); } .sync.ok::before { background: var(--pos); box-shadow: none; }
.sync.warn { color: var(--caution); } .sync.warn::before { background: var(--caution); box-shadow: none; }
.dotsync.good { color: var(--pos); } .dotsync.warn { color: var(--caution); }

/* ---- register ---- */
.reg-card { margin-bottom: 14px; }
.reg-card .vz-lede { flex-basis: 420px; }
.reg-card .vz-tools { justify-content: flex-end; max-width: 380px; }
.reg-aa::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--caution); }
.reg-tools { margin: 0 0 12px; gap: 8px 10px; }
.reg-tools input[type=search] { flex: 1 1 260px; max-width: 420px; }
.reg-tools > .muted.small { margin-left: auto; font-variant-numeric: tabular-nums; }
.reg-card-t, .rev-card { padding: 2px 10px 6px; }
table.reg th:first-child, table.reg td:first-child { width: 34px; padding-right: 0; }
table.reg td { padding-top: 8px; padding-bottom: 8px; vertical-align: middle; }
table.reg td.num { font-weight: 600; }
table.reg td.num.good { color: var(--pos); }
table.reg td.cat .warn { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
table.reg td.cat .warn::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--caution); flex: none; }
table.reg tr.unapproved td { font-weight: 600; }
table.reg td:last-child { white-space: nowrap; width: 1%; }
table.reg td .btn.sm { min-height: 26px; padding: 2px 7px; vertical-align: middle; }
.reg td.payee { max-width: 280px; } .reg td.cat { max-width: 240px; }
/* flags keep their six names and take their colours from the chart palette; a pennant, with the name on hover */
.flag { width: 9px; height: 11px; border-radius: 0; margin-right: 7px; vertical-align: -1px; clip-path: polygon(0 0, 100% 0, 72% 50%, 100% 100%, 0 100%); flex: none; }
.flag.red { background: var(--viz-8); } .flag.orange { background: color-mix(in srgb, var(--viz-8) 45%, var(--viz-4)); } .flag.yellow { background: var(--viz-4); }
.flag.green { background: var(--viz-2); } .flag.blue { background: var(--viz-7); } .flag.purple { background: var(--viz-5); }
/* cleared is a state, not money: a filled dot (cleared), a ring (not yet), a lock (reconciled), all in ink */
.clr { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; color: var(--ink-3); vertical-align: middle; transition: background var(--dur) var(--ease); }
.clr:hover { background: var(--surface-3); }
.clr .cm { display: block; width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.clr.on .cm { background: var(--ink-2); box-shadow: none; }
.clr.on, .clr.rec { color: var(--ink-2); }
.btn.approved { background: transparent; color: var(--pos); border-color: transparent; }
/* bulk actions: a raised strip that follows the page, count on the left, the way out on the right */
.bulkbar { top: 10px; z-index: 6; background: var(--surface-2); color: var(--ink); border: 1px solid var(--rule-2); border-radius: var(--radius); box-shadow: var(--pop-shadow); padding: 8px 10px 8px 14px; gap: 8px 14px; margin-bottom: 10px; flex-wrap: nowrap; }
.bulkbar .bb-n { flex: none; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bulkbar .bb-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1 1 auto; min-width: 0; }
.bulkbar .btn, .bulkbar .btn:hover { color: var(--ink); border-color: var(--rule-2); background: transparent; }
.bulkbar .btn:hover { background: var(--surface-3); }
.bulkbar .btn.danger { color: var(--neg); }
.bulkbar .btn.ghost { border-color: transparent; color: var(--ink-2); flex: none; }
.bulkbar select { min-height: 28px; padding-top: 2px; padding-bottom: 2px; font-size: 12px; max-width: 190px; background-color: transparent; border-color: var(--rule-2); }
.sel-all-row { color: var(--ink-2); }

/* ---- Review: the queue ---- */
.rev-lede { margin-bottom: 18px; }
.rev-lede .vz-value { font-variant-numeric: tabular-nums; }
.rev-h { margin: 22px 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); }
.rev-sec { margin-bottom: 8px; }
table.rev-t td { vertical-align: middle; padding-top: 7px; padding-bottom: 7px; }
table.rev-t td.num { font-weight: 600; } table.rev-t td.num.good { color: var(--pos); }
table.rev-t td:nth-child(3) { font-weight: 600; }
table.rev-t td:nth-child(3) .small { font-weight: 400; }
table.rev-t select { min-height: 32px; max-width: 260px; background-color: transparent; border-color: var(--rule-2); }
table.rev-t select:hover { border-color: var(--field); }
.rev-act { white-space: nowrap; text-align: right; width: 1%; }
.rev-act .btn + .btn { margin-left: 4px; }
.btn.rev-ok { border-color: var(--rule-2); font-weight: 600; }
.btn.rev-ok:hover { border-color: var(--ink-2); }
.chip.ai { background: transparent; border: 1px solid var(--rule-2); color: var(--ink-2); font-weight: 600; font-size: 11px; padding: 1px 6px; margin-left: 6px; }
button.chip.ai:hover { color: var(--ink); border-color: var(--ink-2); }
.tr-sug, .tr-box, .rb-panel, .sw-suggest { border-color: var(--rule); border-radius: var(--radius); background: var(--surface-1); }
.sw-chip, .xfer-chip { font-weight: 500; }

/* ---- the category picker and other pop-ups ---- */
.catpick input { padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; text-overflow: ellipsis; }
.cp-pop { padding: 6px; box-shadow: var(--pop-shadow); }
.cp-grp { font-size: 11px; padding: 10px 10px 4px; }
.cp-opt { border-radius: 4px; padding: 7px 10px; }
.cp-opt.sel::after { content: ""; float: right; width: 5px; height: 9px; margin: 3px 4px 0 0; border: solid var(--ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.cp-opt.create { color: var(--accent-ink); font-weight: 600; }
.cp-opt.blank, .cp-empty { color: var(--ink-3); }
.pop { padding: 14px; }
.menu { padding: 5px; min-width: 200px; }
.menu button { display: block; width: 100%; text-align: left; min-height: 32px; padding: 6px 10px; background: none; border: 0; font: inherit; cursor: pointer; }
.pi-tip, .pi-pop, .home-pop { background: var(--surface-2); border: 1px solid var(--rule-2); border-radius: var(--radius); box-shadow: var(--pop-shadow); color: var(--ink); }
.help-pop { padding: 12px 14px; line-height: 1.5; }
.help-pop b:first-child, .help-pop .hp-t { font-weight: 650; }

/* ---- modals and sheets ---- */
.modal .mh { gap: 12px; }
.modal .mh .x { width: 32px; height: 32px; margin: -6px -8px -6px auto; border-radius: var(--radius-s); color: var(--ink-3); line-height: 1; display: inline-flex; align-items: center; justify-content: center; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.modal .mh .x:hover { background: var(--surface-2); color: var(--ink); }
.modal .mb > p:first-child { margin-top: 0; } .modal .mb > p:last-child { margin-bottom: 0; }
.modal .mb h3:first-child { margin-top: 0; }
.modal .mb h3 { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); padding-bottom: 6px; border-bottom: 1px solid var(--rule-2); margin: 18px 0 2px; }
.modal .mf { background: var(--surface-1); border-radius: 0 0 12px 12px; }
.modal .mf .btn.danger:first-child { margin-right: auto; }
.modal .kv .num { font-weight: 600; }
.modal.sheet .mf, .modal .mf { background: var(--surface-1); }
.modal .alert { background: var(--surface-2); }
.xfer-seg, .modal .seg { display: inline-flex; }
.xfer-blk { border: 0; border-left: 2px solid var(--rule-2); border-radius: 0; background: transparent; padding: 2px 0 2px 14px; }
.modal .splits { border-top: 1px solid var(--rule); padding-top: 10px; }
#toasts { gap: 8px; }
.toast { max-width: min(560px, calc(100vw - 24px)); line-height: 1.4; }
.toast button { background: none; border: 0; cursor: pointer; font: inherit; padding: 4px 2px; white-space: nowrap; }

/* ---- phones ---- */
@media (max-width: 860px) {
  /* a page's tabs are one row you can swipe, never five wrapped lines; the edge fades where there is more */
  .tabs { flex-wrap: nowrap; overflow-x: auto; margin-left: -16px; margin-right: -16px; padding: 0 16px; scroll-padding: 0 40px; gap: 0 2px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 36px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 36px), transparent 100%); }
  .tabs a { flex: none; padding: 0 10px; }
  .page-head { gap: 8px 8px; margin-bottom: 14px; }
  .page-head h1 { flex: 1 1 auto; }
  .page-head .ph-t { flex: 1 1 auto; }
  .page-head .grow { display: none; }
  input[type=time], input[type=tel] { min-height: 44px; }
  input[type=text], input[type=number], input[type=date], input[type=month], input[type=time], input[type=password], input[type=search], input[type=email], input[type=url], select, textarea { font-size: 16px; }   /* no zoom on focus in iOS */
  .chk { min-height: 44px; }
  input[type=checkbox], input[type=radio] { width: 20px; height: 20px; }
  /* register: a list. Payee and amount on the first line; category, date and state on the second */
  .reg-card .vz-tools { display: none; }
  .reg-tools input[type=search] { max-width: none; flex: 1 1 100%; }
  .reg-tools select { flex: 1 1 auto; }
  .txn-list { border-radius: var(--radius); }
  .txn { min-height: 60px; padding: 9px 12px 9px 6px; gap: 2px; border-bottom-color: var(--rule); align-items: stretch; }
  .txn > input[type=checkbox] { width: 20px; height: 20px; margin: 0 8px 0 8px; align-self: center; }
  .txn .l1 { gap: 12px; } .txn .l1 .p { font-size: 15px; display: flex; align-items: center; min-width: 0; }
  .txn .l1 .amt { font-size: 15px; } .txn .amt.good { color: var(--pos); }
  .txn .l2 { margin-top: 3px; color: var(--ink-3); min-height: 24px; }
  .txn .l2 .dt { gap: 4px; color: var(--ink-3); }
  .txn .l2 .dt .btn.sm { min-height: 28px; min-width: 32px; padding: 0 6px; margin-left: 4px; }
  .txn.unapproved .l1 .p { font-weight: 650; }
  .txn .clr { width: 28px; height: 28px; position: relative; }
  .txn .clr::after, .txn .l2 .dt .btn.sm::after { content: ""; position: absolute; inset: -8px -4px; }
  .txn.rev { padding: 12px 14px; }
  .txn.rev .l3 { margin-top: 10px; gap: 6px; }
  .txn.rev .l3 select { min-height: 40px; }
  .txn.rev .l3 .btn.sm { min-height: 40px; }
  body:has(.bulkbar) .fab { display: none; }
  .bulkbar { position: fixed; top: auto; left: 8px; right: 8px; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 28; margin: 0; padding: 8px 8px 8px 12px; flex-wrap: wrap; gap: 6px 8px; }
  .bulkbar .bb-n { flex: 1 1 auto; align-self: center; }
  .bulkbar .bb-x { order: 2; }
  .bulkbar .bb-acts { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .bulkbar .bb-acts::-webkit-scrollbar { display: none; }
  .bulkbar .bb-acts > * { flex: none; }
  .bulkbar select { flex: none; min-height: 36px; font-size: 13px; max-width: 170px; }
  .acct-group table.t { margin: 0 -6px; width: calc(100% + 12px); }
  .modal .mh .x { width: 44px; height: 44px; margin: -12px -12px -12px auto; }
  .modal .mf { border-radius: 0; flex-wrap: wrap; }
  .modal .mf .btn.danger:first-child { margin-right: 0; }
  .menu button { min-height: 44px; }
  .cp-opt { padding: 11px 10px; }
  #toasts { left: 8px; right: 8px; align-items: stretch; }
  .toast { flex-wrap: wrap; }
}
/* [ui2] register and review refinements */
.acct-group table.t { table-layout: fixed; }
.acct-group th:nth-child(1) { width: 36%; } .acct-group th:nth-child(2) { width: 22%; } .acct-group th:nth-child(3) { width: 15%; } .acct-group th:nth-child(4) { width: 15%; } .acct-group th:nth-child(5) { width: 12%; padding-left: 18px; }
.acct-group td:nth-child(5) { padding-left: 18px; }
.acct-group td:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-trk .trk-badge { display: none; }
.tr-chip { background: transparent; border: 1px solid var(--rule-2); color: var(--ink-2); border-radius: 4px; font-weight: 600; padding: 1px 7px; }
.tr-chip:hover { filter: none; color: var(--ink); border-color: var(--ink-2); }
.tr-chip.wait, .tr-chip.stale { background: transparent; color: var(--caution); border-color: color-mix(in srgb, var(--caution) 55%, transparent); }
.tr-chip.wait { border-style: dashed; }
@media (max-width: 860px) {
  .page-head h1, .page-head .ph-t { flex: 1 1 0; min-width: 132px; }
  .page-head .btn { min-height: 40px; padding: 6px 11px; }
  .page-head .btn.ghost { padding: 6px 8px; }
  .acct-group th:nth-child(1) { width: auto; } .acct-group th:nth-child(4) { width: 42%; }
  .reg-card .vz-stat .s, .acct-lede .vz-stat .s { display: none; }
  .reg-card .vz-take { font-size: 13px; color: var(--ink-2); }
  .sel-all-row input[type=checkbox] { width: 20px; height: 20px; margin: 12px 10px 12px 14px; }
  #toasts { transform: none; }
}
/* [ui2] planner */
.pl-head { align-items: flex-end; }
.pl-head select { min-width: 150px; }
.pl-card .vz-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; }
.pl-card .vz-stat { padding-bottom: 12px; }
.pl-card .vz-stat .k { display: flex; align-items: center; gap: 6px; }
.pl-card .vz-kicker .help-tip, .vz-stat .k .help-tip { text-transform: none; letter-spacing: 0; }
.pl-card, .pl-chart, .pl-years { margin-bottom: 14px; }
.pl-chart { padding: 18px 20px 16px; }
.pl-chart .vz-sub { margin-bottom: 14px; }
.pl-chart .vz-foot { margin-top: 14px; }
.grid.g2 > .pl-chart { margin-bottom: 0; } .grid.g2:has(> .pl-chart) { margin-bottom: 14px; gap: 14px; }
/* [pl-cards] expand control, linked titles and the full pages */
.pl-chart, .pl-wrap { position: relative; }
.pl-chart .vz-sub { padding-right: 36px; }
.pl-expand { position: absolute; top: 10px; right: 10px; z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-s); color: var(--ink-2); }
.pl-expand:hover { color: var(--ink); background: var(--surface-3); }
.pl-expand:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pl-tl { color: inherit; text-decoration: none; }
.pl-tl:hover { text-decoration: underline; }
.pl-fv-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.pl-fv-top .grow { flex: 1; }
.pl-fv-t { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; }
.pl-fv-stats { padding: 14px 20px 18px; margin-bottom: 14px; }
.pl-fv-stats .vz-stats { margin: 0; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.chart-box.pl-fv-box { height: 460px; }
.pl-fv-kv { margin-bottom: 14px; }
.pl-nw { white-space: nowrap; }
/* [acct-cards] plan accounts as cards: one quiet line each until opened */
.pl-accts { display: grid; gap: 8px; }
.pl-acct.au-card { margin: 0; border: 1px solid var(--rule); border-radius: var(--radius); }
.pl-acct.open { border-color: var(--rule-2); }
.pl-acct .au-head { min-height: 52px; }
.pl-acct-v { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl-acct-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.pl-fv-tbl { max-height: 72vh; overflow: auto; }
@media (max-width: 860px) {
  .pl-expand { width: 44px; height: 44px; top: 2px; right: 2px; }
  .pl-chart .vz-sub { padding-right: 44px; }
  .chart-box.pl-fv-box { height: 320px; }
  .pl-fv-stats { padding: 12px 14px 14px; }
  .pl-fv-stats .vz-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
}
.pl-nospend { margin-bottom: 14px; line-height: 1.55; }
.pl-nospend a { font-weight: 600; }
#pl-status { font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .pl-card .vz-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
  .pl-card .vz-tools { width: 100%; }
  .pl-head #pl-status { flex: 1 1 100%; order: 9; }
  .pl-chart { padding: 16px 14px 14px; }
  .rpt-controls { display: flex; flex-wrap: wrap; }
  .rpt-controls > select, .rpt-controls > .dates { flex: 1 1 100%; }
  .rpt-controls .btn { flex: 0 0 auto; }
}
/* [ui2] Home: the budget tile's quiet lines */
.home-paid { position: relative; padding-left: 18px; color: var(--ink-2); }
.home-paid::before { content: ""; position: absolute; left: 3px; top: 3px; width: 5px; height: 9px; border: solid var(--pos); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.home-paid + .home-paid { margin-top: -4px; }
.home-over { display: flex; align-items: baseline; gap: 10px; min-height: 36px; padding: 4px 0; color: var(--ink); text-decoration: none; }
.home-over::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 1px; background: var(--neg); transform: rotate(45deg) scale(.9); align-self: center; }
.home-over > span:first-child { flex: 1; } .home-over b { font-weight: 650; }
.home-over > span:last-child { color: var(--ink-3); font-size: 18px; line-height: 1; }
.home-over:hover { text-decoration: none; } .home-over:hover > span:last-child { color: var(--ink); }
input[type=range] { accent-color: var(--accent-fill); }
details.sec > summary { padding: 14px 16px; font-size: 15px; }
details.sec > summary::after, details.sec[open] > summary::after { content: ""; width: 7px; height: 7px; border: solid var(--ink-3); border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); margin-right: 4px; transition: transform var(--dur) var(--ease); }
details.sec[open] > summary::after { transform: rotate(45deg) translate(-2px, -2px); }
details.sec > summary:hover::after { border-color: var(--ink); }
details.sec > .in { padding: 0 16px 16px; }
details.sec[open] > summary { border-bottom: 1px solid var(--rule); margin-bottom: 14px; }
.acct-box, .person, .asset-box, .sugg { padding: 14px; }
/* [ui2] entry pages: sign in, first run, create account, invite */
body.signed-out #main { padding: 0; }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 400px); gap: 72px; align-items: center; justify-content: center; padding: 40px 24px; }
.login-side { display: grid; gap: 18px; align-content: center; }
.login-brand { display: flex; align-items: center; gap: 12px; font: 650 22px/1 var(--font-display); letter-spacing: -.015em; }
.login-brand .dot { width: 40px; height: 40px; display: block; color: var(--ink); }
.login-brand .dot svg { display: block; width: 100%; height: 100%; }
.login-tag { margin: 6px 0 0; font: 650 32px/1.15 var(--font-display); letter-spacing: -.025em; text-wrap: balance; }
.login-side .ledger { margin-top: 4px; }
.login-side .lr { min-height: 36px; border-top: 1px solid var(--rule); }
.login-side .lr:first-child { border-top-color: var(--rule-2); }
.login-side .lr > .k { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); }
.login-side .lr > .v { font-weight: 500; color: var(--ink); white-space: normal; text-align: right; }
.login-side .lead { display: none; }
.login-side .lr { justify-content: space-between; align-items: center; }
.login-note { margin: 0; font-size: 12px; line-height: 1.55; color: var(--ink-3); max-width: 44ch; }
.card.login { max-width: none; margin: 0; text-align: left; padding: 28px 28px 24px; }
.card.login .vz-kicker { margin-bottom: 12px; }
.card.login h1 { font-size: 26px; }
.card.login .login-intro { margin: 10px 0 20px; color: var(--ink-2); line-height: 1.55; text-wrap: pretty; }
.card.login .grid { gap: 14px; }
.card.login input { min-height: 42px; width: 100%; }
.card.login .btn.primary { min-height: 44px; margin-top: 4px; justify-content: center; font-size: 15px; }
.card.login > p.small { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--rule); }
@media (max-width: 860px) {
  .login-wrap { grid-template-columns: minmax(0, 440px); gap: 22px; align-items: start; padding: 28px 16px 40px; min-height: 100dvh; }
  .login-side { gap: 10px; }
  .login-tag { font-size: 22px; margin: 2px 0 0; }
  .login-side .ledger, .login-note { display: none; }
  .card.login { padding: 22px 18px 20px; }
  .card.login h1 { font-size: 22px; }
}
@media (max-width: 860px) {
  .login-wrap { align-content: start; }
  /* Budget on a phone: the Left to plan card in a compact form, and names that wrap between words, never inside them */
  .rta.vz-card { padding: 14px 16px 12px; }
  .rta .vz-kicker { margin-bottom: 6px; }
  .rta .vz-value { font-size: 30px; }
  .rta .vz-take { font-size: 13px; line-height: 1.45; margin-top: 6px; color: var(--ink-2); }
  .rta .vz-take b { color: var(--ink); }
  .rta .vz-stats { margin-top: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rta .vz-stat { padding: 7px 0 5px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 8px; }
  .rta .vz-stat .k { font-size: 10px; letter-spacing: .07em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1 1 100%; }
  .rta .vz-stat .v { font-size: 15px; margin-top: 1px; }
  .rta .vz-stat .s { display: none; }
  .rta .rta-notes { margin-top: 6px; }
  .bgrid tr.cat .ename, .bgrid tr.cat .nmtxt { overflow-wrap: break-word; word-break: normal; hyphens: auto; text-wrap: balance; line-height: 1.3; }
  .bgrid tr.cat td.nm { padding-top: 9px; padding-bottom: 9px; }
  .bgrid tr.grp td:first-child { letter-spacing: .06em; line-height: 1.35; overflow-wrap: break-word; }
  .bgrid tr.grp td:first-child .help-tip { vertical-align: -4px; margin-left: 2px; }
  .bgrid tr.grp td { vertical-align: bottom; }
  .bgrid th { white-space: nowrap; }
  .bgrid { table-layout: fixed; }
  .bgrid th:nth-child(2) { width: 84px; } .bgrid th:last-child { width: 98px; }
  .bgrid .asg { width: 74px; padding-left: 2px; padding-right: 4px; font-size: 15px; }
  .bgrid .pill { min-width: 70px; padding: 3px 7px; }
  .bgrid tr.cat td.nm { font-size: 14px; padding-right: 0; }
  .bgrid tr.cat td.nm > div:first-child { gap: 0; }
  .bgrid tr.cat .rowtools .btn { padding: 0 4px; }
}
/* [ui2] a long option never makes a form wider than its dialog */
.grid > *, label.f, .f { min-width: 0; }
label.f select, label.f input, .f select { max-width: 100%; }
.setup-group > h2 { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); margin: 22px 0 6px; }
.setup-group > h2 + .small { margin-bottom: 8px; }
.scope-tag.me { color: var(--ink-2); }
@media (max-width: 860px) {
  /* 44px touch targets: fields, page-head buttons, section toggles, sliders, and the row checkboxes in lists */
  input[type=text], input[type=number], input[type=date], input[type=month], input[type=time], input[type=password], input[type=search], input[type=email], input[type=url], input[type=tel], select { min-height: 44px; }
  .page-head .btn { min-height: 44px; }
  details > summary { min-height: 44px; display: flex; align-items: center; }
  input[type=range] { min-height: 44px; }
  .txn > input[type=checkbox], .sel-all-row input[type=checkbox] { -webkit-appearance: none; appearance: none; width: 44px; height: 44px; margin: 0 0 0 -4px; border: 0; background: none; display: grid; place-items: center; flex: none; cursor: pointer; }
  .txn > input[type=checkbox]::before, .sel-all-row input[type=checkbox]::before { content: ""; width: 20px; height: 20px; border-radius: 4px; border: 1.5px solid var(--field); background: color-mix(in srgb, var(--surface-1) 55%, var(--surface-0)); }
  .txn > input[type=checkbox]:checked::before, .sel-all-row input[type=checkbox]:checked::before { border-color: var(--accent-fill); background: var(--accent-fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 14px no-repeat; }
  .txn > input[type=checkbox]:focus-visible::before, .sel-all-row input[type=checkbox]:focus-visible::before { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
  .sel-all-row input[type=checkbox] { margin: 0 2px 0 2px; }
  .txn { padding-left: 6px; }
}
@media (max-width: 860px) {
  .txn.rev .l3 select, .txn.rev .l3 .btn.sm { min-height: 44px; }
  .income-jump { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .income-jump::-webkit-scrollbar { display: none; }
  .income-jump .btn { flex: none; min-height: 40px; }
}
.pl-head .btn.sm { min-height: 36px; min-width: 36px; }
/* [info] one info control: a hairline "i" beside the title it explains; its popover holds the notes that used to sit on the page */
.help-tip { flex: none; text-transform: none; letter-spacing: 0; }
.help-tip::after { inset: -8px; }
.vz-kicker .help-tip, h2 .help-tip, summary .help-tip, .home-head .help-tip { margin-left: 0; }
.home-head .help-tip { margin-right: auto; margin-left: 8px; }
.help-pop { padding: 14px 40px 14px 16px; max-width: min(360px, calc(100vw - 16px)); font-size: 13px; line-height: 1.5; text-transform: none; letter-spacing: 0; font-weight: 400; }
.help-pop { max-height: min(72vh, 560px); overflow-y: auto; }
.help-pop > b { display: block; margin-bottom: 4px; font-weight: 650; font-size: 14px; }
.help-pop p { margin: 0 0 8px; color: var(--ink-2); text-wrap: pretty; }
.help-pop p:last-child, .help-sec:last-child p { margin-bottom: 0; }
.help-sec + .help-sec, .help-pop > p + .help-sec, .help-learn + .help-sec, .help-more + .help-sec { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule-2); }
.help-h { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink); margin-bottom: 3px; }
.help-x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border: 0; border-radius: var(--radius-s); background: none; color: var(--ink-3); font-size: 18px; line-height: 1; cursor: pointer; }
.help-x:hover { background: var(--surface-3); color: var(--ink); }
@media (max-width: 860px) {
  .help-tip::after { inset: -13px; }   /* a 44px target around a 20px glyph */
  .help-pop { left: 8px !important; right: 8px; top: auto !important; bottom: calc(66px + env(safe-area-inset-bottom)); width: auto; max-width: none; max-height: 62vh; overflow-y: auto; padding: 16px 48px 16px 16px; font-size: 14px; border-radius: 12px; animation: uiRise 180ms var(--ease) both; }
  body.signed-out .help-pop { bottom: 12px; }
  .help-x { width: 44px; height: 44px; top: 2px; right: 2px; font-size: 22px; }
}
/* [ui2] account lists: room for "Bank says ..." in the sync column */
.acct-group th:nth-child(1) { width: 31%; } .acct-group th:nth-child(2) { width: 19%; } .acct-group th:nth-child(5) { width: 20%; }
.acct-group td:nth-child(5) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 860px) { .acct-group th:nth-child(1) { width: auto; } }
/* [bva] budget vs actual: groups first, categories on demand */
.vz-grp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vz-grp-head > .vz-sub { margin-bottom: 0; }
.vz-grp > td { font-weight: 600; }
.vz-grp-toggle { display: inline-flex; align-items: center; flex-wrap: wrap; background: none; border: 0; padding: 6px 0; margin: 0; color: inherit; font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.vz-grp-toggle::before { content: ""; flex: none; width: 6px; height: 6px; margin: 0 12px 2px 2px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(-45deg); transition: transform var(--dur) var(--ease); }
.vz-grp-toggle[aria-expanded="true"]::before { transform: rotate(45deg); }
.vz-grp-toggle .small { font-weight: 400; white-space: pre; }
.vz-grp-over { color: var(--neg); }
.vz-grp-kid > td:first-child { padding-left: 30px; }
.vz-grp-kid[hidden] { display: none !important; }
.vz-plan-cell { width: 160px; }
@media (max-width: 720px) { .vz-grp-toggle { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { .vz-grp-toggle::before { transition: none; } }
/* [loan] ==== Loan paydown (static/js/loansim.js). See DESIGN.md, "Loan paydown". ==== */
/* Planner holds two tools: its kicker names the section and switches between them */
.vz-kicker.pk { flex-wrap: wrap; gap: 6px 10px; }
.pk-nav { display: inline-flex; gap: 14px; padding-left: 11px; border-left: 1px solid var(--rule-2); }
.pk-nav a { position: relative; padding: 1px 0; color: var(--ink-3); border-bottom: 2px solid transparent; transition: color var(--dur) var(--ease); }
.pk-nav a::after { content: ""; position: absolute; inset: -9px -6px; }
.pk-nav a:hover { color: var(--ink); text-decoration: none; }
.pk-nav a.on { color: var(--ink); font-weight: 650; border-bottom-color: var(--ink); }
.ln-head { align-items: flex-end; }
.ln-head select { min-width: 170px; max-width: 260px; }
.ln-actions [hidden] { display: none; }
.ln-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ln-lite { font-weight: 400; color: var(--ink-3); }
.ln-quiet h2 { margin: 0; } .ln-quiet p { margin: 0; max-width: 48ch; color: var(--ink-2); } .ln-quiet .btn { margin-top: 6px; }

/* the answer on the left, the question on the right; one column when there is no room for both */
.ln-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; margin-bottom: 14px; }
.ln-main { min-width: 0; container-type: inline-size; }
@media (min-width: 1280px) {
  .ln-wrap { grid-template-columns: minmax(0, 1fr) 348px; }
  .ln-side { position: sticky; top: 14px; max-height: calc(100vh - 116px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; border-radius: var(--radius); }
  .ln-actions { position: sticky; bottom: -16px; margin-bottom: -16px; padding-bottom: 16px; background: var(--surface-1); z-index: 1; }
}
.ln-card .vz-value { text-wrap: balance; }
.ln-hero-k { font-weight: 500; color: var(--ink-2); }
.ln-hero.neg { color: var(--neg); }
.ln-card .vz-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container (min-width: 600px) { .ln-card .vz-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ln-card .vz-stat .k { display: flex; align-items: center; gap: 6px; }
.ln-card .vz-plot { margin-top: 4px; }
.ln-cmp:empty { display: none; }
.ln-cmp { margin-top: 18px; }
.ln-cmp-k .vz-kicker { margin: 0 0 8px; color: var(--ink); }
.ln-cmp .vz-stats { margin: 0; }
.ln-notes:empty { display: none; }
.ln-notes { margin-top: 14px; }
.ln-notes > .ln-warn:first-child { margin-top: 0; }
.ln-cmp .vz-stat { border-top-color: var(--rule-2); padding-bottom: 8px; }
.ln-neg { color: var(--neg); }
.ln-ba s { color: var(--ink-3); font-weight: 500; text-decoration-thickness: 1px; }
.ln-be { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.ln-be li { position: relative; padding-left: 18px; }
.ln-be li::before { content: ""; position: absolute; left: 1px; top: 6px; width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--ink-3); }
.ln-warn { margin: 10px 0 0; font-size: 13px; line-height: 1.5; }
.ln-plot { margin-top: 18px; }
.ln-views { margin-bottom: 12px; max-width: 100%; }
.ln-views button { white-space: nowrap; }
.ln-events { display: none; list-style: none; margin: 12px 0 0; padding: 0; font-size: 13px; }
.ln-narrow > .ln-events { display: grid; }
.ln-events li { display: flex; align-items: center; gap: 10px; min-height: 34px; border-top: 1px solid var(--rule); }
.ln-ev-n { flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--rule-2); font: 650 11px/1 var(--font); color: var(--ink); }
.ln-ev-t { flex: 1 1 auto; min-width: 0; } .ln-ev-d { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* fields: the unit sits inside the box, beside the number */
.ln-af { position: relative; display: block; }
.ln-af > i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 14px; color: var(--ink-3); pointer-events: none; }
.ln-af > input { padding-left: 22px; }
.ln-af.after > i { left: auto; right: 10px; } .ln-af.after > input { padding-left: 10px; padding-right: 26px; }
.ln-what input:not([type=checkbox]), .ln-what select, .ln-form input:not([type=checkbox]), .ln-form select { width: 100%; }
.ln-fg { gap: 12px 12px; align-items: start; }
.ln-ferr { margin: 0; font-size: 12px; line-height: 1.45; color: var(--neg); display: flex; gap: 7px; align-items: baseline; }
.ln-ferr:empty { display: none; }
.ln-ferr::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 1px; background: var(--neg); transform: rotate(45deg) translateY(-1px); }
.ln-hint { margin: 0; font-size: 12px; line-height: 1.45; color: var(--ink-3); }
.ln-answer { margin: 0; font-weight: 600; } .ln-answer:empty { display: none; }

/* what if: each line is a ledger row until it is opened */
.ln-panel { padding: 16px 18px; }
.ln-panel > .vz-sub { margin-bottom: 8px; }
.ln-g { border-top: 1px solid var(--rule); }
.ln-what > .ln-g:first-child { border-top-color: var(--rule-2); }
.ln-g > summary { list-style: none; cursor: pointer; min-height: 42px; align-items: center; border-radius: 4px; }
.ln-g > summary::-webkit-details-marker, .ln-y > summary::-webkit-details-marker, .ln-more > summary::-webkit-details-marker { display: none; }
.ln-g > summary .k { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-weight: 500; white-space: nowrap; }
.ln-g > summary .v { font-size: 13px; font-weight: 650; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.ln-g > summary .lead { align-self: center; transform: none; }
.ln-g:not(.on) > summary .lead { visibility: hidden; }
.ln-g > summary::after, .ln-more > summary::after { content: ""; flex: none; width: 6px; height: 6px; margin: 0 3px 2px 4px; border: solid var(--ink-3); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform var(--dur) var(--ease); }
.ln-g[open] > summary::after, .ln-more[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.ln-g > summary:hover::after, .ln-more > summary:hover::after { border-color: var(--ink); }
.ln-g[open] > summary .k { font-weight: 650; }
.ln-g-in { display: grid; gap: 10px; padding: 2px 0 16px; }
.ln-lumps { display: grid; gap: 10px; justify-items: start; }
.ln-lump { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.ln-lump .ln-x { min-width: 36px; min-height: 36px; justify-content: center; font-size: 18px; line-height: 1; color: var(--ink-3); }
.ln-seg { display: flex; } .ln-seg button { flex: 1 1 0; white-space: nowrap; }
.ln-termf { display: grid; gap: 6px; } .ln-termf > span { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.ln-actions { display: flex; align-items: center; gap: 8px; padding-top: 14px; border-top: 1px solid var(--rule-2); }
.ln-run { flex: 1 1 auto; justify-content: center; min-height: 40px; }
.ln-run .spinner { width: 14px; height: 14px; margin: 0 2px 0 0; }
.ln-ftop:not(:empty) { margin: 0 0 12px; }
.ln-saved:empty, .ln-keep:empty { display: none; }
.ln-saved { padding: 2px 0 14px; }
.ln-saved-k, .ln-keep-k { margin-bottom: 7px; font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.ln-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ln-chip { display: inline-flex; max-width: 100%; border: 1px solid var(--rule-2); border-radius: 4px; transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.ln-chip:hover { border-color: var(--ink-2); }
.ln-chip.on { background: var(--surface-3); border-color: var(--ink-2); }
.ln-chip button { min-height: 28px; background: none; border: 0; cursor: pointer; font: inherit; font-size: 13px; color: var(--ink); border-radius: 3px; }
.ln-chip-b { padding: 0 2px 0 9px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ln-chip.on .ln-chip-b { font-weight: 650; }
.ln-chip .ln-chip-x { padding: 0 8px; color: var(--ink-3); font-size: 15px; line-height: 1; }
.ln-chip .ln-chip-x:hover { color: var(--ink); }
.ln-keep { padding-top: 14px; }
.ln-keep-r { display: flex; gap: 8px; } .ln-keep-r input { flex: 1 1 auto; min-width: 0; }

/* future payments: a year on each line, its months inside */
.ln-sched { padding: 16px 20px 6px; margin-bottom: 14px; }
.ln-sched-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.ln-sched-h .vz-sub { margin: 0; }
.ln-which { margin-left: 2px; font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-3); }
.ln-tr { display: grid; grid-template-columns: minmax(120px, 1.5fr) repeat(5, minmax(0, 1fr)); gap: 0 14px; align-items: center; min-height: 40px; margin: 0 -10px; padding: 0 10px; border-bottom: 1px solid var(--rule); }
.ln-tr > .num { font-variant-numeric: tabular-nums lining-nums; }
.ln-th { min-height: 34px; border-bottom-color: var(--rule-2); font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.ln-y > summary { list-style: none; cursor: pointer; transition: background var(--dur) var(--ease); }
.ln-y > summary:hover { background: var(--surface-2); }
.ln-y:last-child:not([open]) > summary, .ln-y:last-child .ln-m:last-child { border-bottom: 0; }
.ln-when { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.ln-y > summary .ln-when::before { content: ""; flex: none; width: 6px; height: 6px; margin: 0 4px 0 2px; border: solid var(--ink-3); border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); transition: transform var(--dur) var(--ease); }
.ln-y[open] > summary .ln-when::before { transform: rotate(45deg) translate(-1px, -1px); }
.ln-y[open] > summary { border-bottom-color: var(--rule-2); }
.ln-y > summary b { font-weight: 650; }
.ln-ev-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-2); }
.ln-m { min-height: 34px; font-size: 13px; color: var(--ink-2); background: color-mix(in srgb, var(--surface-0) 45%, var(--surface-1)); }
.ln-m .ln-when { padding-left: 20px; }
.ln-m.ev { color: var(--ink); }
.ln-note { grid-column: 1 / -1; position: relative; margin-top: -3px; padding: 0 0 9px 34px; font-size: 12px; line-height: 1.4; color: var(--ink); }
.ln-note::before { content: ""; position: absolute; left: 21px; top: 5px; width: 7px; height: 7px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.ln-m.ev { padding-top: 7px; }
.ln-zero { color: var(--ink-3); }
.ln-none { margin: 12px 0; color: var(--ink-2); }

/* chooser: every loan on one ledger line */
.ln-lede { margin-bottom: 14px; }
.ln-list { padding: 16px 20px 6px; }
.ln-list > .vz-sub { margin-bottom: 4px; }
.ln-li { display: grid; grid-template-columns: minmax(150px, 1.6fr) repeat(4, minmax(0, 1fr)) 14px; gap: 0 14px; align-items: center; min-height: 54px; margin: 0 -10px; padding: 0 10px; border-top: 1px solid var(--rule); color: var(--ink); transition: background var(--dur) var(--ease); }
a.ln-li:hover { background: var(--surface-2); text-decoration: none; }
.ln-li-h { min-height: 32px; border-top: 0; font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.ln-li-h + .ln-li { border-top-color: var(--rule-2); }
.ln-li-n { display: grid; min-width: 0; } .ln-li-n b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ln-li-n span { font-size: 12px; color: var(--ink-3); }
.ln-li-need { grid-column: 3 / 6; justify-self: end; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--caution); }
.ln-li-need::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--caution); }
.ln-li-go { font-size: 18px; line-height: 1; color: var(--ink-3); } a.ln-li:hover .ln-li-go { color: var(--ink); }

/* tell Yosan about this loan */
.ln-setup { max-width: 760px; padding: 22px 24px 20px; }
.ln-setup > .vz-kicker { margin-bottom: 10px; }
.ln-setup h2 { margin: 0 0 6px; font: 650 20px/1.2 var(--font-display); letter-spacing: -.015em; }
.ln-intro { margin: 0 0 16px; max-width: 62ch; color: var(--ink-2); }
.ln-form { display: grid; gap: 14px; }
.ln-bal { min-height: 40px; align-items: center; border-top: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule); }
.ln-bal .lead { transform: none; align-self: center; }
.ln-f { display: grid; gap: 6px; min-width: 0; align-content: start; }
.ln-sug { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 2px 0 0 17px; font-size: 12px; line-height: 1.45; color: var(--ink-2); }
.ln-sug::before { content: ""; position: absolute; left: 1px; top: 7px; width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--accent-ink); }
.ln-sug:has(.done)::before { left: 3px; top: 4px; width: 5px; height: 9px; border-radius: 0; box-shadow: none; border: solid var(--pos); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ln-sug b { color: var(--ink); } .ln-sug .btn { flex: none; }
.ln-more { border-top: 1px solid var(--rule); }
.ln-more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; }
.ln-more > summary::after { margin-left: auto; }
.ln-more[open] > summary { margin-bottom: 6px; }
.ln-term { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 8px; }
.ln-factions { display: flex; justify-content: flex-end; padding-top: 2px; }

@media (max-width: 860px) {
  .pk-nav a::after { inset: -15px -6px; }
  .ln-head select { flex: 1 1 100%; max-width: none; order: 5; }
  .ln-cmp { margin-top: 14px; }
  .ln-views { display: flex; overflow-x: auto; scrollbar-width: none; } .ln-views::-webkit-scrollbar { display: none; }
  .ln-views button { flex: 1 0 auto; padding-left: 9px; padding-right: 9px; }
  .ln-panel { padding: 14px 16px; }
  .ln-g > summary { min-height: 48px; }
  .ln-lump .ln-x { min-width: 44px; min-height: 44px; }
  .ln-run { min-height: 46px; }
  .ln-chip button { min-height: 44px; } .ln-chip .ln-chip-x { min-width: 40px; font-size: 18px; }
  .ln-seg button { min-height: 40px; }
  .ln-sched { padding: 14px 16px 4px; }
  .ln-sched-h { flex-wrap: wrap; }
  .ln-th { display: none; }
  .ln-tr { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px 10px; padding: 9px 6px 10px; margin: 0 -6px; align-items: start; }
  .ln-tr > .ln-when { grid-column: 1 / 3; min-height: 22px; }
  .ln-tr > .ln-bal-c { grid-column: 3 / 5; grid-row: 1; font-weight: 600; color: var(--ink); }
  .ln-tr > .num:not(.ln-bal-c) { text-align: left; font-size: 12px; white-space: nowrap; }
  .ln-tr > .num::before { content: attr(data-l); display: block; font-size: 10px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
  .ln-tr > .ln-bal-c::before { display: inline; margin-right: 6px; }
  .ln-y:first-of-type > summary { border-top: 1px solid var(--rule-2); }
  .ln-m .ln-when { padding-left: 16px; }
  .ln-note { margin: 0; padding: 3px 0 0 30px; } .ln-note::before { left: 17px; top: 8px; }
  .ln-m.ev { padding-top: 9px; }
  .ln-list { padding: 14px 16px 4px; }
  .ln-li-h { display: none; }
  .ln-li { grid-template-columns: repeat(3, minmax(0, 1fr)) 14px; gap: 4px 10px; padding: 12px 6px; margin: 0 -6px; }
  .ln-list > .ln-li:nth-child(3) { border-top-color: var(--rule-2); }
  .ln-li-n { grid-column: 1 / 3; } .ln-li > .num:nth-child(2) { grid-column: 3; font-weight: 600; }
  .ln-li-go { grid-column: 4; grid-row: 1 / 3; align-self: center; }
  .ln-li > .num:nth-child(n+3) { grid-row: 2; text-align: left; font-size: 13px; }
  .ln-li > .num:nth-child(n+3)::before { content: attr(data-l); display: block; font-size: 10px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
  .ln-li-need { grid-column: 1 / 4; grid-row: 2; justify-self: start; font-size: 13px; }
  .ln-setup { padding: 18px 16px; }
  .ln-sug { flex-wrap: wrap; } .ln-sug .btn { min-height: 40px; }
  .ln-factions .btn { flex: 1 1 auto; justify-content: center; }
  .ln-keep-r { flex-wrap: wrap; } .ln-keep-r .btn { flex: 1 1 auto; justify-content: center; }
}
.ln-paid { position: relative; margin: 0 -10px; padding: 12px 10px 12px 30px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--ink-2); }
.ln-paid::before { content: ""; position: absolute; left: 13px; top: 15px; width: 5px; height: 9px; border: solid var(--pos); border-width: 0 2px 2px 0; transform: rotate(45deg); }
/* [datepick] one date control everywhere: a typed field (MM/DD/YYYY or MM/YYYY) and a calendar that jumps by month and year */
.dp { position: relative; display: inline-flex; width: 100%; min-width: 0; vertical-align: middle; }
.dp-date { min-width: 148px; } .dp-month { min-width: 124px; }
.dp > .dp-in { flex: 1 1 auto; width: 100%; min-width: 0; padding-right: 38px; font-variant-numeric: tabular-nums; }
.dp[hidden] { display: none; } .dp > input.dp-native { display: none !important; }
.dp > .dp-btn { position: absolute; top: 1px; right: 1px; bottom: 1px; width: 36px; display: grid; place-items: center; padding: 0; background: none; border: 0; border-radius: 0 var(--radius-s) var(--radius-s) 0; color: var(--ink-3); cursor: pointer; }
.dp > .dp-btn:hover:not(:disabled), .dp > .dp-btn[aria-expanded="true"] { color: var(--ink); }
.dp > .dp-btn:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: -2px; }
.dp > .dp-btn:disabled { opacity: .4; cursor: default; }
.dp.dp-bad > .dp-in { border-color: var(--neg); }
.dp-msg { position: absolute; left: 0; top: calc(100% + 4px); z-index: 6; max-width: min(280px, 80vw); padding: 5px 8px; font-size: 12px; line-height: 1.35; color: var(--neg); background: var(--surface-1); border: 1px solid var(--rule-2); border-radius: 6px; box-shadow: var(--pop-shadow); white-space: normal; width: max-content; }
.dp-pop { position: fixed; z-index: 7000; width: 272px; padding: 12px; background: var(--surface-1); border: 1px solid var(--rule-2); border-radius: 10px; box-shadow: var(--pop-shadow); color: var(--ink); font-size: 14px; }
.dp-pop button { font: inherit; color: inherit; background: none; border: 0; border-radius: 6px; padding: 0; cursor: pointer; }
.dp-pop button:disabled { opacity: .3; cursor: default; }
.dp-pop button:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; }
.dp-head { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.dp-title { flex: 1; display: flex; justify-content: center; gap: 2px; }
.dp-nav { width: 32px; height: 32px; font-size: 18px; line-height: 1; color: var(--ink-2); }
.dp-t { padding: 6px 8px; font-family: var(--font-display); font-weight: 650; }
.dp-t.still { cursor: default; }
button.dp-t::after { content: ''; display: inline-block; margin-left: 6px; vertical-align: 2px; border: 4px solid transparent; border-top-color: var(--ink-3); border-bottom: 0; }
.dp-nav:hover:not(:disabled), button.dp-t:hover { background: var(--surface-3); color: var(--ink); }
.dp-grid { display: grid; gap: 2px; }
.dp-grid.days { grid-template-columns: repeat(7, 1fr); }
.dp-grid.big { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dp-dow { padding: 4px 0; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; text-align: center; color: var(--ink-3); }
.dp-c { height: 34px; font-variant-numeric: tabular-nums; }
.dp-grid.big .dp-c { height: 40px; }
.dp-c:hover:not(:disabled) { background: var(--surface-3); }
.dp-c.now { box-shadow: inset 0 0 0 1px var(--field); }
.dp-pop .dp-c.on { background: var(--ink); color: var(--surface-1); font-weight: 650; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--rule); }
.dp-pop .dp-f { padding: 6px 8px; font-size: 13px; color: var(--ink-2); }
.dp-pop .dp-f:hover:not(:disabled) { background: var(--surface-3); color: var(--ink); }
@media (max-width: 720px) {
  .dp > .dp-btn { width: 44px; } .dp > .dp-in { padding-right: 46px; }
  .dp-pop { width: min(320px, calc(100vw - 16px)); } .dp-c { height: 42px; } .dp-grid.big .dp-c { height: 44px; } .dp-nav { width: 44px; height: 44px; } .dp-pop .dp-f { padding: 10px 10px; }
}
@media (prefers-reduced-motion: no-preference) { .dp-pop { animation: dp-in var(--dur) var(--ease); } }
@keyframes dp-in { from { opacity: 0; transform: translateY(-4px); } }
/* [admin] the signed-up list scrolls inside its own box; the column heads stay put */
.ul { margin-top: 14px; }
.ul-head { align-items: center; gap: 10px; margin-bottom: 8px; }
.ul-head .vz-kicker { margin: 0; }
.ul-n { color: var(--ink-2); font-size: 13px; }
.ul-head .ul-find { width: auto; flex: 0 1 200px; min-width: 0; }
.ul-scroll { max-height: 360px; overflow: auto; border: 1px solid var(--rule); border-radius: var(--radius-s); overscroll-behavior: contain; }
.ul-scroll:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.ul-scroll table.t { margin: 0; width: 100%; }
.ul-scroll thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-1); box-shadow: inset 0 -1px 0 var(--rule-2); white-space: nowrap; }
.ul-scroll td, .ul-scroll th { padding-left: 12px; padding-right: 12px; }
.ul-scroll td.num, .ul-scroll th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ul-scroll tbody tr:last-child td { border-bottom: 0; }
.ul-act { text-align: right; white-space: nowrap; }
.ul-none { margin: 8px 0 0; }
@media (max-width: 720px) { .ul-scroll { max-height: 60vh; } }
/* [ui-end] */
/* [balance] shield / lock marks, the inspector's Balancing section and the Balance settings screen */
.bal-marks { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; color: var(--ink-2); }
.bal-mark { display: inline-flex; align-items: center; }
.bal-mark .ic { display: inline-flex; }
.bal-tog { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.bal-tog input { width: 16px; height: 16px; margin: 0; flex: none; }
.bal-sec { margin: 0 0 20px; }
.bal-sec:last-child { margin-bottom: 0; }
.bal-sec > h3 { margin: 0 0 8px; }
.bal-sec > select { max-width: 100%; }
.bal-none { margin: 6px 0 0; }
.bal-groups { display: grid; gap: 6px; }
.bal-grow { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.bal-grow:last-child { border-bottom: 0; }
.bal-gname { font-weight: 600; min-width: 130px; flex: 1 1 130px; }
.bal-grow .seg { flex: none; flex-wrap: wrap; }
.bal-ends { display: flex; align-items: center; justify-content: space-between; margin: 6px 0; }
.bal-hid { margin: 14px 0 6px; font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); }
.bal-list { display: grid; gap: 4px; }
.bal-row { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border: 1px solid var(--rule); border-radius: var(--radius-s); background: var(--surface-1); }
.bal-row.dragging { background: var(--surface-2); border-color: var(--rule-2); box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.bal-grip { flex: none; touch-action: none; cursor: grab; user-select: none; border: 0; background: transparent; color: var(--ink-3); font-size: 14px; letter-spacing: -2px; padding: 6px 8px; border-radius: 4px; line-height: 1; }
.bal-grip:active { cursor: grabbing; }
.bal-grip:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; }
.bal-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.bal-tag { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; line-height: 1.5; padding: 1px 8px; border-radius: 999px; color: var(--ink); background: var(--surface-3); }
.bal-tag.t-required { background: color-mix(in srgb, var(--viz-1) 22%, transparent); }
.bal-tag.t-savings { background: color-mix(in srgb, var(--viz-2) 22%, transparent); }
.bal-tag.t-discretionary { background: color-mix(in srgb, var(--viz-4) 24%, transparent); }
@media (max-width: 860px) { .bal-grip { min-width: 44px; min-height: 44px; font-size: 16px; } .bal-gname { flex-basis: 100%; } }
/* [ui] approve actions read as "yes": a subtle green wash, green outline and text, stronger on hover */
.btn.rev-ok, .btn[title="Approve"] { background: var(--good-weak); border-color: color-mix(in srgb, var(--good) 45%, transparent); color: var(--good); font-weight: 600; }
.btn.rev-ok:hover, .btn[title="Approve"]:hover { background: color-mix(in srgb, var(--good) 22%, transparent); border-color: var(--good); }
/* [ui] budget groups stand apart from their categories: larger bold label in full-strength ink, a faint tint across the row,
   a hairline above and a soft accent rule below. Quiet enough to keep the page calm. */
.bgrid tr.grp td { background: color-mix(in srgb, var(--ink, var(--text)) 5%, transparent); color: var(--ink, var(--text)); font-size: 15px; font-weight: 700;
  padding-top: 14px; padding-bottom: 10px; border-top: 1px solid var(--rule-2, var(--line)); border-bottom: 2px solid color-mix(in srgb, var(--accent-ink, var(--accent)) 40%, transparent); }
.bgrid tr.grp:first-child td { border-top: 0; }
.bgrid tr.grp:hover td { background: color-mix(in srgb, var(--ink, var(--text)) 8%, transparent); }
/* [spent] Spent column: visible on phones too, the amount is a quiet link to the category's transactions for the month */
.bgrid td.c-act, .bgrid td.g-act { white-space: nowrap; }
.bgrid a.spent-link { color: inherit; text-decoration: underline dotted color-mix(in srgb, var(--ink, var(--text)) 40%, transparent); text-underline-offset: 3px; }
.bgrid a.spent-link:hover { color: var(--accent-ink, var(--accent)); text-decoration-color: currentColor; }
@media (max-width: 860px) { .bgrid td.c-act, .bgrid td.g-act, .bgrid th.c-spent-h { font-size: 12px; } }
/* [balance] balancing: split button, preview (modal on desktop, sheet on phones) */
.bal-split { display: inline-flex; align-items: stretch; }
.bal-split .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.bal-split .bal-caret { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; padding-left: 8px; padding-right: 8px; min-width: 0; }
.bal-act { margin-top: 10px; }
.bal-prev { display: grid; gap: 10px; }
.bal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.bal-top { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.bal-styles { flex-wrap: wrap; justify-self: start; max-width: 100%; }
.bal-styles button:disabled { opacity: .45; cursor: not-allowed; }
.bal-blurb { margin: -4px 0 0; }
.bal-table { border-top: 1px solid var(--rule-2); }
.bal-mrow { display: grid; grid-template-columns: 24px minmax(0, 1.3fr) minmax(0, 1fr) 84px minmax(0, 1.6fr); gap: 4px 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 13px; }
.bal-mrow:last-child { border-bottom: 0; }
.bal-mrow.head { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); border-bottom: 1px solid var(--rule-2); }
.bal-mrow.off { opacity: .6; }
.bal-mrow .num { text-align: right; font-variant-numeric: tabular-nums; }
.bal-cb { width: 16px; height: 16px; margin: 0; align-self: center; }
.bal-em { border: 1px solid var(--rule-2); border-radius: var(--radius); padding: 10px 12px; background: var(--surface-2); }
.bal-em p { margin: 0 0 8px; }
/* [balance] "Adjust how balancing works" (collapsed by default), custom order, borrowed note and the quiet repay line */
.bal-adv > summary { cursor: pointer; font-weight: 600; padding: 6px 0; min-height: 32px; }
.bal-adv > summary:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; border-radius: 4px; }
.bal-adv-body { display: grid; gap: 12px; padding-top: 6px; }
.bal-adv-note { margin: 0; }
.bal-sents { display: grid; gap: 8px; }
.bal-sent { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-size: 14px; }
.bal-pct { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.bal-num { width: 68px; text-align: right; font-variant-numeric: tabular-nums; }
.bal-cust p { margin: 2px 0 8px; }
.bal-steps .bal-row.off { opacity: .6; }
.bal-stepname { flex: 1; min-width: 0; min-height: 32px; }
.bal-adv-foot { display: flex; justify-content: flex-end; }
.bal-borrow { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.bal-borrow > span { flex: 1 1 140px; }
.bal-repay { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 12px; padding: 4px 2px; font-size: 13px; color: var(--ink-2); }
.bal-repay > span { flex: 1 1 220px; }
@media (max-width: 860px) { .bal-borrow .btn, .bal-repay .btn { min-height: 44px; } .bal-num { min-height: 40px; } }
@media (max-width: 860px) {
  .bal-mrow { grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-areas: "cb from amt" ". to to" ". why why"; }
  .bal-mrow.head { display: none; }
  .bal-mrow > .bal-cb { grid-area: cb; width: 20px; height: 20px; }
  .bal-mrow .bm-from { grid-area: from; font-weight: 600; }
  .bal-mrow .bm-to { grid-area: to; color: var(--ink-2); }
  .bal-mrow .bm-to::before { content: "to "; }
  .bal-mrow .bm-amt { grid-area: amt; }
  .bal-mrow .bm-why { grid-area: why; }
  .bal-mrow.off .bm-to, .bal-mrow.off .bm-amt { display: none; }
  .bal-split .btn { min-height: 44px; }
  .bal-styles button { min-height: 44px; }
}
@media (max-width: 860px) {   /* [balance] the banner gains a fourth button: let the buttons drop under the text instead of widening the page */
  .notice:has(.bal-split) { flex-wrap: wrap; }
  .notice:has(.bal-split) .na { flex-wrap: wrap; flex-shrink: 1; flex: 1 1 100%; padding-left: 16px; }
}
/* [balance] easy button: the Result table and the tucked-away other styles */
.bal-sub { margin: 4px 0 -4px; font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.bal-rtable { border-top: 1px solid var(--rule-2); }
.bal-rrow { display: grid; grid-template-columns: minmax(0, 1.3fr) 96px minmax(0, 1.5fr) minmax(0, 1.6fr); gap: 4px 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 13px; }
.bal-rrow:last-child { border-bottom: 0; }
.bal-rrow.head { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); border-bottom: 1px solid var(--rule-2); }
.bal-rrow .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bal-rrow .br-name { font-weight: 500; }
.bal-rrow.gets .br-chg { color: var(--pos, var(--ink)); }
.bal-more { border-top: 1px solid var(--rule); padding-top: 4px; }
.bal-more > summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 6px 0; min-height: 32px; color: var(--ink-2); }
.bal-more > summary:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; border-radius: 4px; }
.bal-more-body { display: grid; gap: 10px; padding-top: 6px; }
@media (max-width: 860px) {
  .bal-rrow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name chg" "ba ba" "note note"; }
  .bal-rrow.head { display: none; }
  .bal-rrow .br-name { grid-area: name; font-weight: 600; }
  .bal-rrow .br-chg { grid-area: chg; }
  .bal-rrow .br-ba { grid-area: ba; text-align: left; }
  .bal-rrow .br-note { grid-area: note; }
  .bal-more > summary { min-height: 44px; }
}
/* [match] employer section */
.pp-plan { display: grid; gap: 12px; }
.pp-explain { border: 1px solid var(--rule-2); border-radius: var(--radius); padding: 10px 12px; background: var(--surface-2); }
.pp-explain.warn { border-color: color-mix(in srgb, var(--viz-warn, #d9a441) 55%, var(--rule-2)); }
.pp-big { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.pp-q { display: grid; gap: 6px; }
.pp-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pp-chip { border: 1px solid var(--rule-2); background: transparent; color: var(--ink-2); border-radius: 999px; padding: 4px 12px; font-size: 13px; line-height: 1.4; cursor: pointer; min-height: 32px; }
.pp-chip.sm { font-size: 12px; min-height: 28px; padding: 2px 10px; }
.pp-chip:hover { color: var(--ink); border-color: var(--ink-3); }
.pp-chip.on { color: var(--ink); border-color: var(--accent-ink); background: color-mix(in srgb, var(--accent-ink) 16%, transparent); }
.pp-chip:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.pp-sec { border-top: 1px solid var(--rule); padding-top: 10px; display: grid; gap: 8px; }
.pp-sec > h4 { margin: 0; font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.pp-sent { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 14px; }
.pp-sent input[type=number] { width: 74px; text-align: right; }
.pp-sent select { width: auto; }
.pp-tiers { display: grid; gap: 6px; }
.pp-more > summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); padding: 4px 0; min-height: 30px; }
.pp-more[open] { display: grid; gap: 10px; }
.pp-sub2 { display: grid; gap: 6px; padding-left: 2px; }
.pp-svc { display: grid; gap: 8px; padding-left: 22px; }
.pp-svc-step { display: grid; gap: 4px; border-left: 2px solid var(--rule-2); padding-left: 10px; }
.pp-vest { margin-top: 2px; }
/* [benefits] the Benefits block and breakdown */
.pay-ben .pay-ben-quick { display: grid; gap: 6px; padding: 4px 0 6px; }
.pay-ben .pay-ben-quick p { margin: 0; }
.pay-ben .row { gap: 8px; flex-wrap: wrap; align-items: center; }
.pay-ben-quick input[type=number] { width: 120px; }
.pay-ben-guess { margin: 4px 0 8px; }
.pay-ben-guess p { margin: 0 0 6px; }
.pay-ben-net { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 8px; }
.pay-ben-net input { width: 140px; }
.pay-ben-ok { margin: 2px 0 6px; }
.pay-ben-act { margin-top: 6px; }
.pay-sub { padding-left: 14px; }
.pay-maxed { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
/* [retire] non-employer retirement contributions */
.pp-rx-person { display: grid; gap: 6px; padding: 8px 0; border-top: 1px solid var(--rule); }
.pp-rx-person:first-of-type { border-top: 0; }
.pp-rx-person h3 { margin: 0; font-size: 14px; }
.pp-rx-person > .btn { justify-self: start; }
.pp-rx-note { margin: 0; }
@media (max-width: 860px) {
  .pp-chip { min-height: 40px; }
  .pp-chip.sm { min-height: 36px; }
  .pay-line .pay-maxed { order: 5; }
}
/* Employment cards (employ.js): one card per job or income stream, sections open one at a time */
.emp-owner { margin: 14px 0 4px; font-size: 15px; }
.emp-grp-h { margin: 12px 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: none; }
.emp-cards { display: grid; gap: 10px; }
.emp-past { margin-top: 12px; } .emp-past > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--muted); }
.emp-card { padding: 0; margin: 0; }
.emp-card.planned { border-style: dashed; }
.emp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; padding: 14px 16px; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.emp-head:focus-visible, .emp-sec-t:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.emp-face { display: grid; gap: 3px; min-width: 0; flex: 1; }
.emp-t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.emp-tag, .emp-mark { display: inline-block; padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; color: var(--muted); }
.emp-marks { display: flex; gap: 6px; flex-wrap: wrap; }
.emp-sub { font-size: 14px; }
.emp-chev { color: var(--muted); line-height: 1.6; }
.emp-body { padding: 0 12px 12px; }
.emp-sections { display: grid; gap: 0; }
.emp-sec { border-top: 1px solid var(--line); }
.emp-sec-t { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 44px; padding: 10px 4px; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.emp-sec-b { padding: 4px 4px 14px; display: grid; gap: 10px; }
.emp-sec-add { padding: 8px 4px; }
.emp-h4 { margin: 8px 0 0; font-size: 14px; }
.emp-switch { min-height: 44px; display: flex; align-items: center; gap: 6px; }
.emp-extras { display: grid; gap: 8px; margin-top: 10px; }
.emp-varies, .emp-tips { display: grid; gap: 8px; padding: 10px 12px; border-left: 3px solid var(--line); }
.emp-vsum { font-weight: 600; }
.emp-vest { display: grid; gap: 8px; }
.emp-vrows { display: grid; gap: 6px; }
.emp-vrow, .emp-band { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; min-width: 0; }
.emp-vrow > span, .emp-band > span { flex: none; }
.emp-vrow input[type=number], .emp-band input[type=number] { width: auto; flex: 1 1 56px; min-width: 0; max-width: 96px; }
.emp-vrow select, .emp-vrow input[type=text] { flex: 1 1 0; min-width: 0; width: auto; }
.emp-x { flex: none; width: 32px; min-width: 32px; padding: 0; justify-content: center; font-size: 18px; line-height: 1; }
.emp-vline { margin: 0; font-weight: 500; }
.emp-pn { display: grid; gap: 12px; }
.emp-bands { display: grid; gap: 6px; }
.emp-scroll { overflow-x: auto; max-width: 100%; min-width: 0; -webkit-overflow-scrolling: touch; }
.emp-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.emp-table th, .emp-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.emp-table th:first-child, .emp-table td:first-child { text-align: left; position: sticky; left: 0; z-index: 1; background: var(--panel); }
.emp-table tr.est td { color: var(--muted); font-style: italic; }
.emp-w2-form { margin: 8px 0 0; display: grid; gap: 10px; }
.emp-kinds { display: grid; gap: 4px; } .emp-kind { min-height: 44px; display: flex; align-items: center; }
.emp-from-job { margin-top: 6px; color: var(--muted); }
.emp-wf-row .btn { flex: none; }
@media (max-width: 860px) {
  .emp-head { padding: 12px; }
  .emp-switch { min-height: 44px; }
  .emp-vrow .btn.emp-x, .emp-band .btn.emp-x { min-height: 40px; min-width: 40px; width: 40px; }
}

/* Employment: tidy retirement section, containment at phone width, header row */
.emp-list, .emp-grp, .emp-cards, .emp-card, .emp-body, .emp-sections, .emp-sec, .emp-sec-b, .emp-pn, .emp-pn > *, .emp-pn-work, .emp-w2, .emp-w2-form, .emp-plan, .emp-vest-sec, .emp-foot, .emp-pn details, .emp-pn .pp-more { min-width: 0; max-width: 100%; }
.emp-cards, .emp-sections, .emp-sec-b, .emp-pn, .emp-pn-work, .emp-w2-form, .emp-pn .pp-more[open], .emp-plan-opts[open] { grid-template-columns: minmax(0, 1fr); }
.emp-pn-work { display: grid; gap: 8px; }
.emp-pn-work .pp-explain, .emp-plan .pp-explain { min-width: 0; }
.pp-big, .emp-plan-sent, .emp-vline { overflow-wrap: anywhere; white-space: normal; min-width: 0; }
.emp-sumrow { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.emp-sumrow > p { flex: 1 1 0; min-width: 0; margin: 0; }
.emp-sumrow > .btn { flex: none; }
.emp-plan-opts > summary { color: var(--muted); font-weight: 500; }
.emp-foot { display: grid; margin-top: 4px; }
.emp-foot .pp-hist-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; margin-top: 0; }
.emp-foot .pp-hist { flex: 1 1 100%; }
.emp-foot .pp-change { border: 0; font-weight: 500; font-size: 12px; padding: 3px 0; color: var(--muted); background: transparent; }
.emp-foot .pp-hist > summary { font-size: 12px; color: var(--muted); min-height: 32px; }
.emp-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 600px) {
  .emp-page-head h2 { flex: 1 1 100%; margin: 0; }
  .emp-page-head .grow { display: none; }
  .emp-page-head .emp-acts { flex: 1 1 100%; flex-wrap: nowrap; gap: 6px; }
  .emp-page-head .emp-acts .btn { flex: 1 1 auto; min-width: 0; min-height: 36px; padding: 4px 8px; font-size: 12px; justify-content: center; white-space: nowrap; }
}

/* [select-popup] the browser's drop-down list: solid panel background and full-strength text, so choices never look disabled */
select option, select optgroup { background-color: var(--panel); color: var(--text); }
select optgroup { color: var(--ink-3); font-weight: 600; font-style: normal; }
select optgroup option { color: var(--text); font-weight: 400; }

/* [paydown] locked paydown plans, plan copies, live loans and assets */
.lp-card { margin-bottom: 14px; }
.lp-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.lp-name { font-size: 1.05rem; }
.lp-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: .92rem; }
.lp-prog { height: 6px; border-radius: 3px; background: var(--viz-grid, rgba(127,127,127,.2)); overflow: hidden; margin: 6px 0 4px; }
.lp-prog > span { display: block; height: 100%; background: var(--accent, currentColor); }
.lp-list { margin: 6px 0 0 1.1em; padding: 0; }
.lp-list li { margin: 3px 0; }
.lp-more summary { cursor: pointer; margin-top: 10px; font-size: .9rem; }
.lp-sheet .f { margin-bottom: 10px; }
.lp-lines { margin: 8px 0 12px; }
.lp-conf { padding: 8px 0; border-top: 1px solid var(--viz-grid, rgba(127,127,127,.2)); }
.lp-loan { padding: 12px; margin: 6px 0 10px; }
.lp-assets { display: grid; gap: 6px; margin-bottom: 8px; }
.lp-asset { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.lp-split { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.lp-own { display: flex; gap: 18px; flex-wrap: wrap; margin: 4px 0 8px; font-size: .92rem; }
@media (max-width: 600px) { .lp-h, .lp-split { flex-direction: column; } .lp-row { flex-direction: column; } }

/* ---- [over] overfunded for its target: purple ---- */
:root { --over:#b79cf5; --over-weak:rgba(167,139,250,.16); }
:root[data-theme="light"] { --over:#6a3fc0; --over-weak:rgba(106,63,192,.10); }
@media (prefers-color-scheme: light) { :root[data-theme="auto"] { --over:#6a3fc0; --over-weak:rgba(106,63,192,.10); } }
.pill.over { background: var(--over-weak); color: var(--over); }
.c-goal .goal-note.over { color: var(--over); }
.c-goal .bar.over i { background: var(--over); }

/* [debts] ==== Loans & debt: the hub, the card page extras and the get out of debt plan (static/js/debts.js, cardpage.js, debtplan.js). Existing tokens only. ==== */
.dt-back { display: inline-block; margin-top: 4px; font-size: 13px; color: var(--ink-3); } .dt-back:hover { color: var(--ink); text-decoration: none; }
.dt-link { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; padding-left: 0; padding-right: 0; } .dt-link:hover { color: var(--ink); }
.dt-foot { margin: 10px 0 0; font-size: 13px; color: var(--ink-3); }
.dt-badge { display: inline-flex; align-items: center; margin-left: 8px; padding: 0 6px; border: 1px solid var(--rule-2); border-radius: 4px; font-size: 11px; line-height: 18px; color: var(--ink-2); white-space: nowrap; }
/* the hub: every debt on a ledger line, in groups */
.dt-list { padding: 16px 20px 6px; margin-bottom: 14px; }
.dt-list > .vz-sub { margin-bottom: 4px; }
.dt-li { display: grid; grid-template-columns: minmax(150px, 1.6fr) repeat(var(--cols, 4), minmax(0, 1fr)) 14px; gap: 0 14px; align-items: center; min-height: 54px; margin: 0 -10px; padding: 0 10px; color: var(--ink); transition: background var(--dur) var(--ease); }
a.dt-li:hover { background: var(--surface-2); text-decoration: none; }
a.dt-li:hover .ln-li-go { color: var(--ink); }
.dt-li-h { min-height: 32px; font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.dt-card { border-top: 1px solid var(--rule); }
.dt-li-h + .dt-card, .vz-sub + .dt-card { border-top-color: var(--rule-2); }
.dt-card:last-child { border-bottom: 0; }
.dt-li.need { grid-template-columns: minmax(150px, 1.6fr) minmax(0, 1fr) minmax(0, 2.4fr) 14px; }
.dt-miss { color: var(--caution); font-weight: 600; font-size: 13px; }
.dt-need { justify-self: end; text-align: right; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--caution); }
.dt-need::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--caution); }
.dt-ok { grid-column: 2 / 4; position: relative; padding-left: 20px; font-size: 13px; color: var(--ink-2); }
.dt-ok::before { content: ""; position: absolute; left: 3px; top: 3px; width: 5px; height: 9px; border: solid var(--pos); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.dt-st { margin: -6px 0 0; padding: 0 0 12px; font-size: 12px; line-height: 1.45; color: var(--ink-3); }
.dt-sub { padding: 0 0 12px; }
.dt-q { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; } .dt-q-t { font-size: 13px; color: var(--ink-2); } .dt-q-b { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.dt-off { padding-top: 6px; padding-bottom: 6px; }
.dt-off > summary { cursor: pointer; list-style: none; min-height: 44px; display: flex; align-items: center; justify-content: space-between; }
.dt-off > summary::-webkit-details-marker { display: none; }
.dt-off > summary .vz-kicker { margin: 0; }
.dt-off > summary::after { content: ""; flex: none; width: 6px; height: 6px; margin: 0 3px 2px 4px; border: solid var(--ink-3); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform var(--dur) var(--ease); }
.dt-off[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.dt-off .dt-li { grid-template-columns: minmax(150px, 1.6fr) minmax(0, 1fr) 14px; }
.dt-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; margin-bottom: 14px; }
.dt-cta p { margin: 0; } .dt-cta-t { margin: 4px 0 2px; font: 650 16px/1.3 var(--font-display); }
/* add a loan or card */
.dt-add { display: grid; gap: 14px; }
.dt-kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dt-kind { display: grid; gap: 2px; align-content: center; text-align: left; min-height: 56px; padding: 10px 12px; background: var(--surface-1); border: 1px solid var(--rule-2); border-radius: 6px; cursor: pointer; font: inherit; color: var(--ink); transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.dt-kind:hover { border-color: var(--ink-2); background: var(--surface-2); }
.dt-kind span { font-size: 12px; color: var(--ink-3); }
.dt-add-f { display: flex; justify-content: space-between; gap: 8px; padding-top: 2px; }
/* the card page */
.dt-extras { display: grid; gap: 10px; margin-bottom: 14px; } .dt-extras:empty { display: none; }
.dt-ask { padding: 14px 18px; }
.dt-planlink, .dt-reason { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.dt-paid .dt-reason { margin-top: 14px; }
.dt-explain { padding: 16px 20px; margin-bottom: 14px; }
.dt-explain dl { display: grid; grid-template-columns: minmax(130px, max-content) 1fr; gap: 10px 20px; margin: 8px 0 0; }
.dt-explain dt { font-weight: 600; } .dt-explain dd { margin: 0; color: var(--ink-2); }
.dt-acts { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 14px; }
@container (min-width: 600px) { .ln-card .vz-stats:has(> .vz-stat:nth-child(5)) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (min-width: 780px) { .ln-card .vz-stats:has(> .vz-stat:nth-child(5)) { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
/* the get out of debt plan */
.dt-sec { margin-bottom: 14px; } .dt-sec:empty { display: none; margin: 0; }
.dt-cost, .dt-plan, .dt-add-card, .dt-hist { margin-bottom: 14px; }
.dt-plan, .dt-add-card, .dt-hist, .dt-lock, .dt-play { padding: 16px 20px; }
.dt-plan-b { display: flex; gap: 8px; flex-wrap: wrap; }
.dt-drift { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rule); } .dt-drift p { margin: 0; flex: 1 1 280px; }
.dt-tg { margin-top: 14px; }
.dt-prs { margin-top: 14px; }
.dt-pr { display: grid; grid-template-columns: minmax(170px, 1.8fr) repeat(4, minmax(0, 1fr)); gap: 0 14px; align-items: center; min-height: 50px; border-top: 1px solid var(--rule); }
.dt-pr-h { min-height: 32px; border-top: 0; font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.dt-pr-h + .dt-pr { border-top-color: var(--rule-2); }
.dt-pr-n { min-width: 0; } .dt-pr-n .ln-li-n { min-width: 0; }
.dt-left { margin-top: 14px; }
.dt-left-r { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--rule); font-size: 13px; color: var(--ink-2); }
.dt-kind-note p { margin: 4px 0 0; max-width: 62ch; color: var(--ink-2); }
.dt-methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 8px; }
.dt-method { padding: 18px 20px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.dt-method h2 { margin: 0; font: 650 20px/1.2 var(--font-display); letter-spacing: -.015em; }
.dt-method .vz-stats { margin: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dt-how { margin: 0; color: var(--ink-2); }
.dt-order { list-style: none; counter-reset: o; margin: 0; padding: 0; }
.dt-order li { counter-increment: o; display: flex; align-items: baseline; gap: 10px; min-height: 34px; padding: 6px 0; border-top: 1px solid var(--rule); }
.dt-order li::before { content: counter(o); flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--rule-2); font: 650 11px/1 var(--font); color: var(--ink); align-self: center; }
.dt-o-n { flex: 1 1 auto; min-width: 0; } .dt-o-d { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dt-pc { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dt-pc ul { margin: 6px 0 0; padding-left: 1.1em; font-size: 13px; color: var(--ink-2); } .dt-pc li { margin: 4px 0; }
.dt-facts { margin: 12px 0 0; font-weight: 600; }
.dt-play-t { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 6px; }
.dt-sched { margin-top: 14px; }
.dt-tr { grid-template-columns: minmax(90px, 1.1fr) repeat(var(--n, 3), minmax(0, 1fr)) minmax(0, 1fr) minmax(0, 1fr); }
.dt-tr > .num { overflow: hidden; text-overflow: ellipsis; }
.dt-focus { font-weight: 650; color: var(--ink); }
.dt-lock-t { margin: 6px 0 2px; font: 650 16px/1.3 var(--font-display); }
.dt-lock-b { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.dt-pick { display: grid; gap: 10px; margin-top: 10px; }
@media (max-width: 860px) {
  .dt-list { padding: 14px 16px 4px; }
  .dt-li-h { display: none; }
  .dt-li { grid-template-columns: repeat(3, minmax(0, 1fr)) 14px; gap: 4px 10px; padding: 12px 6px; margin: 0 -6px; }
  .dt-li > .ln-li-n { grid-column: 1 / 4; } .dt-li > .ln-li-go { grid-column: 4; grid-row: 1 / 3; align-self: center; }
  .dt-li > .num { text-align: left; font-size: 13px; } .dt-li > .num:first-of-type { font-weight: 600; }
  .dt-li > .num::before { content: attr(data-l); display: block; font-size: 10px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
  .dt-li.need { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 14px; }
  .dt-li.need > .ln-li-n { grid-column: 1 / 3; } .dt-li.need > .num { grid-column: 1; grid-row: 2; } .dt-li.need > .dt-need { grid-column: 1 / 3; grid-row: 3; justify-self: start; text-align: left; font-size: 13px; } .dt-li.need > .ln-li-go { grid-column: 3; grid-row: 1 / 3; }
  .dt-off .dt-li { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 14px; } .dt-off .dt-li > .ln-li-n { grid-column: 1; } .dt-off .dt-ok { grid-column: 2; } .dt-off .dt-li > .ln-li-go { grid-column: 3; grid-row: 1; }
  .dt-cta { flex-direction: column; align-items: stretch; } .dt-cta .btn { justify-content: center; }
  .dt-explain dl { grid-template-columns: 1fr; gap: 2px; } .dt-explain dd { margin-bottom: 8px; }
  .dt-plan, .dt-add-card, .dt-hist, .dt-lock, .dt-play { padding: 14px 16px; }
  .dt-methods { grid-template-columns: 1fr; }
  .dt-method .vz-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dt-pr-h { display: none; }
  .dt-pr { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; padding: 10px 0; }
  .dt-pr > .dt-pr-n { grid-column: 1 / -1; }
  .dt-pr > .num { text-align: left; font-size: 13px; } .dt-pr > .num::before { content: attr(data-l); display: block; font-size: 10px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
  .dt-tr { grid-template-columns: repeat(3, minmax(0, 1fr)); } .dt-tr > .ln-when { grid-column: 1 / -1; }
  .dt-tr > .num:last-child { font-weight: 600; color: var(--ink); }
  .dt-kinds { grid-template-columns: 1fr; } .dt-kind { min-height: 52px; }
  .dt-q .btn { min-height: 40px; } .dt-link { min-height: 40px; }
  .dt-add-f .btn { flex: 1 1 auto; justify-content: center; }
}
@media (max-width: 560px) { .dt-pc { grid-template-columns: 1fr; } }
/* [debts] narrow screens: plan target rows and card what-if segments wrap instead of widening the page */
.dt-tg .lr{flex-wrap:wrap}
.dt-tg .lr .v{min-width:0;overflow-wrap:anywhere;text-align:right}
@media (max-width:480px){.ln-seg{flex-wrap:wrap;max-width:100%}.ln-seg button{white-space:normal;text-align:left}.ln-hint{overflow-wrap:anywhere}}
.dt-tg .lr .v{white-space:normal}
.dt-sub-l{display:block;font-size:.78em;color:var(--ink-3)}
.dt-methods > .card { margin-top: 0; }   /* [debts] the two method cards sit level */

/* [simple] the "More options" fold (moreOpts in core.js) */
.more-opts { min-width: 0; max-width: 100%; }
.more-opts > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; min-height: 36px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.more-opts > summary::-webkit-details-marker { display: none; }
.more-opts > summary::before { content: '›'; display: inline-block; font-size: 18px; line-height: 1; color: var(--ink-3); transition: transform .15s; }
.more-opts[open] > summary::before { transform: rotate(90deg); }
.more-opts > summary:hover { color: var(--ink); }
.more-opts .more-sum { font-weight: 400; color: var(--ink-3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more-opts > .more-in { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); padding: 4px 0 6px; }
@media (max-width: 860px) { .more-opts > summary { min-height: 44px; } }

/* [simple] agent A: sidebar account groups, budget panel, review header */
.side-accounts .grp-btn { width: 100%; border: 0; background: none; cursor: pointer; font: inherit; font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3, var(--muted)); display: flex; justify-content: space-between; align-items: center; padding: 12px 18px 4px; text-align: left; }
.side-accounts .grp-btn:hover { color: var(--ink, var(--text)); }
.side-accounts .grp-btn .grp-t { display: inline-flex; align-items: center; gap: 6px; }
.side-accounts .grp-btn .num { letter-spacing: 0; font-weight: 500; }
.side-accounts .chev { width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; display: inline-block; margin-right: 2px; }
.side-accounts .grp-btn[aria-expanded="true"] .chev { transform: rotate(45deg); }

.bal-em { margin: 8px 0 4px; }

/* [simple] agent B: reports, settings */
.tabs a.rpt-more-link { font-weight: 400; color: var(--muted); text-decoration: underline; background: none; border-color: transparent; }
.rpt-controls .rpt-more-btn { margin-left: auto; padding-left: 8px; padding-right: 8px; }
.rpt-pick-list { display: grid; gap: 2px; }
.rpt-pick-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 4px; cursor: pointer; }
.rpt-pick-row input { margin-top: 3px; flex: none; }
.rpt-pick-t { display: grid; gap: 2px; }
.rpt-pick-foot { margin-top: 10px; }
/* Settings: second row of page pills under the section tabs */
.tabs.set-pills { border-bottom: 0; margin-top: -8px; margin-bottom: 14px; gap: 6px; }
.tabs.set-pills a { padding: 4px 12px; min-height: 34px; margin-bottom: 0; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; }
.tabs.set-pills a.on { color: var(--text); border-color: var(--text); font-weight: 600; background: transparent; }
/* phone: the benchmark tags table scrolls inside its card instead of widening the page */
table.bench-tags { display: block; max-width: 100%; overflow-x: auto; }

/* [simple] pass 2, agent C: feature switches */
.feat-off h2 { margin: 0 0 6px; }
.feat-off p { margin: 0 0 14px; }
.feat-note { font-style: normal; }

/* [simple] pass 2, agent D: account page, forms, review */
/* [simple] history line under the register list */
.hist-line { margin: 10px 2px 4px; }
.hist-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.hist-btn:hover { color: var(--ink); }

/* [simple] pass 2, agent E: planner, income, banners */

/* planner input sections: title, then a short muted line of what is set inside */
details.sec > summary { min-width: 0; }
details.sec > summary > .sec-main { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex: 1; }
details.sec > summary > .sec-main > .sec-t { flex: none; }
details.sec > summary > .sec-main > .sec-sum { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; font-size: 13px; color: var(--ink-3, var(--muted)); }
@media (max-width: 600px) {
  details.sec > summary > .sec-main { flex-direction: column; align-items: stretch; gap: 2px; }
  details.sec > summary > .sec-main > .sec-t { flex: none; white-space: normal; }
}

/* [holding] Review: "Kept as a holding" where the category picker would be */
.sw-held { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.sw-held .hist-btn { padding: 0; }
/* [rows] budget groups read as headers, not rows: a tinted band with an accent edge and a gap above it; categories step in
   beneath. The group's "New category" button (shown on hover) and the header's "New group" button are words, not a bare plus. */
.bgrid tr.grp td { background: color-mix(in srgb, var(--accent-ink, var(--accent)) 15%, var(--surface-2, var(--panel2))); border-top: 10px solid var(--surface-1, var(--panel)); border-bottom: 0; padding-top: 11px; padding-bottom: 11px; }
.bgrid tr.grp:first-child td { border-top: 10px solid var(--surface-1, var(--panel)); }
.bgrid tr.grp:hover td { background: color-mix(in srgb, var(--accent-ink, var(--accent)) 22%, var(--surface-2, var(--panel2))); }
.bgrid tr.grp td:first-child { box-shadow: inset 3px 0 0 var(--accent-ink, var(--accent)); border-radius: 6px 0 0 6px; }
.bgrid tr.grp td:last-child { border-radius: 0 6px 6px 0; }
.bgrid tr.grp .grip { bottom: 11px; }
.bgrid tr.grp td:first-child > .ic { bottom: 13px; }
.bgrid tr.grp .rowtools { margin-top: -3px; margin-bottom: -3px; }
.bgrid tr.grp .rowtools .btn.grp-new { padding: 0 10px; min-height: 24px; line-height: 22px; margin-right: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; border-radius: 999px; color: var(--ink, var(--text)); border: 1px solid color-mix(in srgb, var(--accent-ink, var(--accent)) 55%, transparent); background: color-mix(in srgb, var(--accent-ink, var(--accent)) 18%, transparent); }
.bgrid tr.grp .rowtools .btn.grp-new:hover { background: var(--accent-fill, var(--accent)); border-color: var(--accent-fill, var(--accent)); color: #fff; }
.bgrid th .btn.grp-add { margin-left: 12px; padding: 0 10px; min-height: 22px; line-height: 20px; font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; border-radius: 999px; vertical-align: 1px; }
@media (min-width: 861px) { .bgrid tr.cat td.nm { padding-left: 46px; } }
@media (max-width: 860px) { .bgrid tr.grp .rowtools .btn.grp-new .lbl, .bgrid th .btn.grp-add { display: none; } .bgrid tr.grp .rowtools .btn.grp-new { padding: 0 8px; margin-right: 2px; } }

/* [about-us] About me / About us: starter card, tiles, one-open-at-a-time cards. */
.au-page { max-width: 880px; }
.au-back { display: inline-flex; align-items: center; min-height: 40px; color: var(--ink-2); }
.au-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.au-tile { display: grid; gap: 6px; align-content: start; min-height: 96px; margin: 0; padding: 16px; color: inherit; text-decoration: none; }
.au-tiles > .au-tile { margin: 0; }
.au-tile:hover { background: var(--surface-2); border-color: var(--rule-2); }
.au-tile b { font-size: 15px; color: var(--ink); }
.au-sub { color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; }
.au-prog { color: var(--ink-3); font-size: 12px; }
.au-card { padding: 0; margin: 0 0 10px; }
.au-head { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 12px 16px; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.au-head.au-static { cursor: default; }
.au-head:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: -2px; }
.au-face { display: grid; gap: 2px; min-width: 0; flex: 1; }
.au-state { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.au-st-done { color: var(--accent-ink); }
.au-chev { color: var(--ink-3); }
.au-body { display: grid; gap: 12px; padding: 4px 16px 16px; }
.au-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.au-actions .btn, .au-add .btn, .au-head.au-static .btn { min-height: 40px; }
.au-seg { display: flex; flex-wrap: wrap; gap: 8px; }
.au-seg-b { min-height: 40px; padding: 6px 14px; border: 1px solid var(--rule-2); border-radius: 8px; background: var(--surface-1); color: var(--ink-2); font: inherit; cursor: pointer; }
.au-seg-b.on { border-color: var(--accent-ink); background: var(--accent-weak); color: var(--ink); }
@media (max-width: 860px) {
  .au-tiles, .au-body .grid.g2 { grid-template-columns: minmax(0, 1fr); }
  .au-head.au-static { flex-wrap: wrap; }
}

/* [about-us-2] The Employment card on each person's About page: the job cards read as one clean list (no card inside a card), and the deposit-match line on a job. */
.au-emp-body { padding: 0 16px 12px; gap: 6px; }
.au-emp { min-width: 0; }
.au-emp-acts { display: flex; justify-content: flex-end; margin: 0 0 4px; }
.au-emp-none { padding: 6px 0 2px; }
.au-emp .emp-cards { gap: 0; }
.au-emp .card.emp-card { background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.au-emp .card.emp-card.planned { border-top-style: dashed; }
.au-emp .emp-head { padding: 12px 0; }
.au-emp .emp-body { padding: 0 0 10px; }
.au-emp .emp-grp-h { margin-top: 10px; }
.au-emp .emp-past > summary { padding: 0; }
.emp-match { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 2px 4px 8px; }
.emp-match-fix { min-height: 32px; padding: 0 10px; }
.inc-emp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 0 14px; }
.inc-emp-row .btn { min-height: 36px; }
@media (max-width: 860px) {
  .au-emp-body { padding: 0 12px 12px; }
  .au-emp-acts, .au-emp-acts .emp-acts { width: 100%; }
  .au-emp-acts .emp-acts .btn { flex: 1 1 auto; min-height: 44px; justify-content: center; }
  .au-emp .emp-head { padding: 12px 0; }
  .emp-match-fix { min-height: 44px; }
}

/* [about-us-3] Accounts, Property and Joint cards: quiet rows separated by hairlines, no cards inside the card. */
.au-own { gap: 14px; }
.au-agrp { display: grid; gap: 0; }
.au-ah { margin: 0 0 2px; font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-3); }
.au-arow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-height: 48px; padding: 8px 0; border-top: 1px solid var(--line); }
.au-agrp > .au-arow:first-child { border-top: 0; }
.au-ah + .au-arow { border-top: 0; }
.au-aname { display: flex; flex: 1 1 200px; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; overflow-wrap: anywhere; }
.au-atype { color: var(--ink-3); font-size: 12px; }
.au-tag { padding: 1px 8px; border-radius: 999px; background: var(--accent-weak); color: var(--accent-ink); font-size: 12px; }
.au-abal { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.au-claim { display: inline-flex; gap: 6px; }
.au-who { min-height: 36px; max-width: 180px; }
.au-self { display: grid; gap: 4px; padding-top: 6px; border-top: 1px solid var(--line); }
.au-self .pp-rx-embed { min-width: 0; }
.pl-owner-ro { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-height: 36px; padding-top: 6px; }
.inc-retire-row { padding-top: 4px; }
@media (max-width: 860px) {
  .au-arow { min-height: 52px; }
  .au-who, .au-claim .btn { min-height: 44px; }
  .au-who { max-width: none; flex: 1 1 100%; }
  .au-claim { flex: 1 1 100%; }
  .au-claim .btn { flex: 1 1 0; justify-content: center; }
  .inc-retire-row .btn { min-height: 44px; }
}

/* [about-us-4] Expected money card, the Planner pointer row, and the Paychecks report. */
.au-wact { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.au-ptr-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 0 10px; }
.au-ptr-row .btn { min-height: 36px; }
.income-gt-card .home-2 { margin-top: 8px; }
@media (max-width: 860px) {
  .au-wact { flex: 1 1 100%; }
  .au-wact .btn { min-height: 44px; }
  .au-wact .au-who { flex: 1 1 100%; }
  .au-ptr-row .btn { min-height: 44px; }
}

/* [roth] Roth IRA income limit report: levers list, the small table and the "does not lower it" line, inside the usual report card */
.rl-levers { margin-top: 10px; } .rl-levers ul { margin: 6px 0 0; padding-left: 20px; font-size: 15px; line-height: 1.5; }
.rl-table { margin-top: 16px; } .rl-table .rl-sec td { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--viz-text); padding-top: 12px; }
.rl-table .rl-total td { font-weight: 650; border-top: 1px solid var(--line); } .rl-not { margin: 10px 0 0; }

/* [roth-opt] Roth conversions: the choice on Plan inputs, the closed card, the comparison and the suggested years */
.pl-roth .more-opts { margin-top: 8px; } .pl-roth > .small.muted, .pl-roth > p.small { margin: 8px 0 0; } .pl-roth > div:last-child > .btn { margin-top: 8px; }
.pl-roth-line { margin: 4px 0 0; color: var(--viz-text); }
.pl-roth-panel .grid { align-items: end; margin-top: 8px; } .pl-roth-panel .spinner { margin-right: 6px; }
.pl-roth-cmp { margin-top: 12px; } .pl-roth-cmp td:first-child { white-space: nowrap; }
.pl-roth-yrs { margin: 10px 0 0; padding-left: 20px; line-height: 1.5; }
.pl-roth-act { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pl-wi-panel .grid { align-items: end; margin-top: 8px; } .pl-wi-panel .more-opts { margin-top: 10px; }
.pl-wi-act { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pl-wi-out { margin-top: 12px; } .pl-wi-out .spinner { margin-right: 6px; } .pl-wi-out .vz-stats { margin-top: 8px; }
.pl-wi-ul { margin: 6px 0; padding-left: 20px; line-height: 1.5; } .pl-wi-sum { margin: 10px 0 0; color: var(--viz-text); }
.pl-wi-save { margin-top: 10px; }

/* ux-feedback ---------------------------------------------------------------------------------------------------------- start (one block, safe to merge) */
.loading-box .loading-label { margin: 0; }
/* help panel */
.ux-help-q { padding: 0 0 12px; margin: 0 0 12px; border-bottom: 1px solid var(--rule); }
.ux-help-q p { margin: 4px 0 6px; color: var(--ink-2); }
.ux-help h3 { margin-top: 6px; }
/* overspent: one red, and the amount reads first */
.bgrid .pill.neg { font-weight: 700; box-shadow: inset 0 0 0 1px var(--neg); }
.over-cap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 2px 4px 8px; padding: 8px 12px; border-left: 3px solid var(--neg); color: var(--ink-2); font-size: 13px; }
.over-cap > span { flex: 1 1 240px; }
/* roth limit */
.rl-lead { display: block; font-size: 26px; line-height: 1.2; font-weight: 650; letter-spacing: -.015em; }
.rl-sub { font-weight: 600; color: var(--ink-2); }
.rl-axis { margin: 0 0 6px; }
/* transaction form: no blank strips from empty placeholders, and the buttons stay in view */
.txn-form > div:empty, .txn-form > .rc-panel-wrap:not(:has(> :not(input))) { display: none; }
@media (min-width: 861px) {
  .modal:has(.txn-form) { max-height: calc(100dvh - 12vh); display: flex; flex-direction: column; min-height: 0; }
  .modal:has(.txn-form) .mb { overflow-y: auto; flex: 1; min-height: 0; }
  .modal:has(.txn-form) .mf { position: sticky; bottom: 0; }
}
/* phone width: names get room, Assigned / Spent / Available sit under the name, and the + button stays clear */
@media (max-width: 860px) { #main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); } }
@media (max-width: 520px) {
  .bgrid thead { display: none; }
  .bgrid, .bgrid tbody { display: block; width: 100%; }
  .bgrid tr.filter-note { display: block; }
  .bgrid tr.grp { display: flex; align-items: center; }
  .bgrid tr.grp td:first-child { flex: 1 1 auto; min-width: 0; }
  .bgrid tr.grp td.g-asg, .bgrid tr.grp td.g-act { display: none; }
  .bgrid tr.grp td.g-av { flex: none; }
  .bgrid tr.cat { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; padding: 6px 0 8px; border-bottom: 1px solid var(--rule); }
  .bgrid tr.cat td { display: block; border-bottom: 0; padding: 2px 6px; text-align: left; width: auto; white-space: normal; }
  .bgrid tr.cat td.nm { grid-column: 1 / -1; min-width: 160px; }
  .bgrid tr.cat td[data-l]::before { content: attr(data-l); display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 2px; }
  .bgrid tr.cat td.right { width: auto; }
  .bgrid tr.cat .asg { width: 100%; max-width: 110px; text-align: left; }
  .bgrid tr.cat .pill { min-width: 0; text-align: left; }
}
/* ux-feedback ---------------------------------------------------------------------------------------------------------- end */

/* Choose for me (planner_goal.js) */
.pl-gl-head { margin: 4px 0 8px; font-size: 1.05em; line-height: 1.45; color: var(--viz-text); } .pl-gl-head.bad { color: var(--warn, #e0a050); }
.pl-gl-h { margin: 14px 0 4px; font-weight: 600; }
.pl-gl-tbl { width: 100%; border-collapse: collapse; margin: 6px 0; } .pl-gl-tbl th { text-align: left; font-weight: 500; font-size: .85em; opacity: .7; padding: 4px 8px; }
.pl-gl-tbl td { padding: 7px 8px; border-top: 1px solid rgba(255,255,255,.08); vertical-align: middle; } .pl-gl-tbl .num { text-align: right; }
.pl-gl-dim td { opacity: .55; }
.pl-gl-bar { height: 8px; min-width: 80px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; } .pl-gl-bar i { display: block; height: 100%; background: var(--accent, #6ea8fe); }
.pl-gl-in input { width: 92px; } .pl-gl-lock { margin-left: 8px; font-size: .85em; white-space: nowrap; }
.pl-gl-lv { display: flex; gap: 16px; align-items: end; flex-wrap: wrap; margin: 8px 0; } .pl-gl-lv .f { max-width: 220px; } .pl-gl-chk { min-width: 260px; }
.pl-gl-panel { margin-bottom: 14px; }

/* paychecks-report */
.pr-filters { margin-bottom: 12px; } .pr-filters .f { min-width: 140px; }
.pr-glance { display: grid; grid-template-columns: minmax(0, 65fr) minmax(0, 35fr); gap: 16px; align-items: start; }
.pr-flow { height: 232px; }
.pr-table { width: 100%; border-collapse: collapse; font-size: .95em; }
.pr-table th, .pr-table td { padding: 8px 8px; border-bottom: 1px solid rgba(255,255,255,.07); white-space: nowrap; text-align: left; }
.pr-table th { font-size: .8em; font-weight: 600; opacity: .7; }
.pr-table th.num, .pr-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.pr-kid { font-size: .92em; } .pr-kid td:first-child { padding-left: 30px; }
.pr-kid[hidden], .pr-detail[hidden] { display: none; }
.pr-bold td { font-weight: 700; }
.pr-tog { background: none; border: 0; color: inherit; font: inherit; padding: 0; min-height: 44px; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; text-align: left; }
.pr-mark { display: inline-block; width: 1em; opacity: .7; }
.pr-row { cursor: pointer; } .pr-row td { height: 44px; } .pr-row:hover { background: rgba(255,255,255,.04); }
.pr-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pr-detailbox { padding: 6px 4px 14px 22px; display: grid; gap: 8px; max-width: 520px; white-space: normal; }
.pr-dli { display: flex; justify-content: space-between; gap: 12px; font-size: .92em; padding: 2px 0; }
.pr-stack { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: rgba(255,255,255,.08); margin: 10px 0 6px; } .pr-stack i { display: block; height: 100%; }
.pr-s-tax { background: var(--viz-mute, #7c8594); } .pr-s-pre { background: var(--viz-other, #a3acb9); } .pr-s-post { background: var(--viz-1, #6ea8fe); } .pr-s-net { background: var(--viz-in, #4caf7d); }
.pr-legend { display: flex; gap: 14px; flex-wrap: wrap; } .pr-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; }
.pr-list { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 6px; } .pr-list li a { display: inline-block; padding: 10px 8px; }
.pr-more > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; margin-top: 8px; }
.pr-w2 { margin-top: 14px; } .pr-w2 h3 { margin: 0 0 6px; font-size: .95em; }
.pr-note a { display: inline-block; padding: 10px 4px; }
@media (max-width: 860px) { .pr-glance { grid-template-columns: minmax(0, 1fr); } .pr-table th, .pr-table td { padding: 8px 6px; } }

/* paychecks-report review: even row heights in the year table (the toggle keeps a 44px tap target) */
.pr-table td { height: 44px; padding-top: 0; padding-bottom: 0; }
.pr-detail td { height: auto; }

/* [byo] guided SimpleFIN connect: one step per screen, ending on a ready paste box */
.sf-flow h3 { margin: 4px 0 10px; font-size: 17px; }
.sf-progress { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.sf-dots { display: inline-flex; gap: 6px; }
.sf-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--surface-3); }
.sf-dots i.done { background: var(--accent-weak); } .sf-dots i.on { background: var(--accent); }
ol.sf-do { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 8px; }
ul.sf-points { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 8px; }
.sf-sample { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; padding: 8px 10px; border-radius: 8px; background: var(--accent-weak); margin: 4px 0 6px; }
textarea.sf-token { width: 100%; box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; resize: vertical; word-break: break-all; }
.sf-pasterow { margin-top: 8px; align-items: center; flex-wrap: wrap; }
.sf-hint.good { color: var(--good); } .sf-hint.bad { color: var(--bad); }
.sf-nav { margin-top: 12px; flex-wrap: wrap; }

/* [notes] the user's own note on a transaction */
.txn-note { font-style: italic; opacity: .85; white-space: pre-wrap; word-break: break-word; margin-top: 2px; }
textarea.txn-note-in { width: 100%; box-sizing: border-box; resize: vertical; min-height: 52px; font: inherit; }

/* [notes-review] add or change a note in place on Review rows */
.note-inline { margin-top: 3px; }
.note-inline .note-add { background: none; border: 0; padding: 2px 0; font: inherit; font-size: 12px; color: var(--accent); cursor: pointer; opacity: .85; }
.note-inline .note-add:hover { opacity: 1; text-decoration: underline; }
.note-inline .note-edit { display: block; background: none; border: 0; padding: 0; font: inherit; font-size: 12px; color: inherit; text-align: left; cursor: pointer; }
.note-inline .note-edit:hover { text-decoration: underline dotted; }
.note-inline textarea.txn-note-in { margin-top: 4px; min-width: 220px; }
.note-inline .note-btns { margin-top: 6px; gap: 6px; }
/* in the registers "+ Add note" only shows on the row under the pointer, so long lists stay clean */
.reg-memo .note-add { visibility: hidden; }
tr:hover .reg-memo .note-add, .reg-memo .note-add:focus-visible { visibility: visible; }
.note-inline .note-add { white-space: nowrap; }

/* [advance] the paycheck choice at the top of the balance preview */
.bal-pay { display: grid; gap: 6px; margin: 10px 0 12px; }
.bal-pay-head { display: flex; align-items: center; gap: 6px; }
.bal-choice { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.bal-choice.on { border-color: var(--accent); background: var(--accent-weak); }
.bal-choice input { margin-top: 3px; }
.bal-choice .bc-sub { display: block; margin-top: 2px; }

/* persona-fixes A */
.pl-rate-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 10px 0; }
.pl-rate-form .f { flex: 1 1 14rem; min-width: 0; }
.pl-est { display: block; margin-top: 4px; }
.pl-state-cue { margin: 2px 0 8px; }
.pl-counted { margin-top: 8px; }
.pl-jobpen { grid-column: span 2; }
@media (max-width: 520px) { .pl-jobpen { grid-column: auto; } }

/* persona-fixes B */
/* [dialog-sticky] a long dialog scrolls inside, so its action row stays on screen (phones already do this) */
@media (min-width: 721px) {
  .modal { display: flex; flex-direction: column; max-height: calc(100dvh - 12vh); min-height: 0; }
  .modal .mh, .modal .mf { flex: none; }
  .modal .mb { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
}
/* [banner-wrap] the Budget change banner lets its buttons wrap instead of running off the right edge */
.av-bar, .av-multi, .av-head, .av-rows { min-width: 0; max-width: 100%; }
.av-bar { flex-wrap: wrap; }
.av-head { flex-wrap: wrap; row-gap: 6px; }
.av-row { flex-wrap: wrap; row-gap: 4px; }
.av-row .av-text { flex: 1 1 14rem; }
.av-bar .na, .av-multi .na, .av-row .na, .av-head .na { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-left: auto; white-space: normal; flex-shrink: 1; }
@media (max-width: 860px) { .av-row .btn, .av-head .btn, .av-bar .btn { min-height: 44px; } }
/* [card-label] a "what if" line's label wraps instead of running into its value */
.ln-g > summary { flex-wrap: wrap; row-gap: 2px; }
.ln-g > summary .k { white-space: normal; flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
.ln-g > summary .v { flex: 0 1 auto; max-width: 100%; white-space: normal; text-align: right; margin-left: auto; }
.ln-g > summary .lead { flex: 0 0 0; min-width: 0; }
.ln-head select.ln-pick { min-height: 44px; min-width: 170px; color: var(--ink); }
/* [uncat-report] and the small links in the Left to plan notes: easy to tap */
.rpt-uncat { margin: 8px 2px 12px; }
@media (max-width: 860px) { .rpt-uncat a, .rta-over a, .home-sub a { display: inline-block; padding: 12px 2px; margin: -12px 0; } }

/* persona-fixes C */
/* "When does this start?" asked in place, and the "Change starting…" button */
.pp-ask { display: grid; gap: 8px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line2); }
.pp-ask p { margin: 0; }
.pp-ask-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pp-ask-row input[type=date] { flex: 1 1 11rem; min-height: 44px; }
.pp-ask-row .btn, .pp-ask-alt .btn { min-height: 44px; white-space: normal; text-align: left; }
.pp-ask-alt { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-hist-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.btn.pp-change { border-color: var(--accent); color: var(--accent); font-weight: 600; background: transparent; min-height: 36px; }
.btn.pp-change:hover { background: var(--panel2); }
.pay-stubcue { margin-top: 2px; }
@media (max-width: 860px) { .btn.pp-change, .pp-hist-row .btn { min-height: 44px; } .pp-hist > summary { min-height: 44px; display: flex; align-items: center; } }
/* Paychecks report: four distinct colours, tables that fit a phone */
.pr-s-tax { background: var(--viz-4); } .pr-s-pre { background: var(--viz-1); } .pr-s-post { background: var(--viz-3); } .pr-s-net { background: var(--viz-in); }
.pr-tablewrap { overflow-x: auto; }
.pr-table td:first-child, .pr-table th:first-child { white-space: normal; }
.pr-sub { display: block; font-size: .8em; font-weight: 400; opacity: .7; white-space: normal; }
.pr-pctin { display: none; }
.pr-under { display: grid; gap: 6px; margin-top: 8px; }
.pr-under p { margin: 0; }
.pr-refund a { display: inline-flex; align-items: center; min-height: 44px; opacity: .85; }
.pr-varies { margin: 6px 0; }
.pr-list li a { display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 640px) { .pr-pc { display: none; } .pr-pctin { display: inline; } .pr-table th, .pr-table td { padding-left: 4px; padding-right: 4px; } }

/* persona-fixes D */
html { scrollbar-gutter: stable; }
.only-sm { display: none; }
.home-edit { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; }
.home-edit > * { white-space: nowrap; }
.split-row { display: grid; grid-template-columns: 110px 1fr 1fr auto; gap: 8px; align-items: end; }
.split-x { min-width: 44px; min-height: 44px; }
.rpt-sm-row { border-bottom: 1px solid var(--line, rgba(128,128,128,.25)); padding: 6px 0; }
.rpt-sm-row > summary, .rpt-sm-total { display: flex; justify-content: space-between; gap: 10px; min-height: 44px; align-items: center; cursor: pointer; }
.rpt-sm-name { min-width: 0; overflow-wrap: anywhere; }
.rpt-sm-months > div { display: flex; justify-content: space-between; padding: 4px 0; }
.rpt-sm-act { margin-top: 6px; }
@media (max-width: 860px) {
  .only-sm { display: block; }
  .split-row { grid-template-columns: 1fr 1fr; }
  .split-row .split-cat, .split-row .split-memo { grid-column: 1 / -1; }
  .split-row .split-x { grid-column: 1 / -1; justify-self: end; }
  #main { padding-bottom: 150px; }
  #toasts { bottom: calc(132px + env(safe-area-inset-bottom)); }
  .page-banner { padding: 8px 10px; }
  .page-banner p { margin: 4px 0; }
}

/* persona-fixes E (designer) */
/* E1: controls are ink; colour stays for money */
input[type=checkbox], input[type=radio] { accent-color: var(--ink); }
.au-st-done { color: var(--ink-2); }
ol.steps li::before { background: var(--surface-3); color: var(--ink); }
.btn.rev-ok, .btn[title="Approve"] { background: var(--panel2); border-color: var(--line2); color: inherit; font-weight: inherit; }
.btn.rev-ok:hover, .btn[title="Approve"]:hover { background: var(--panel3); border-color: var(--line2); }
/* E3: the dialog itself takes focus when nothing inside does; no ring around the whole box */
.modal:focus { outline: none; }
/* E4: in a stacked (column) field the category picker keeps its own height; its flex-basis of 180px was meant for rows and left a blank gap */
label.f > .catpick, .f > .catpick { flex: 0 0 auto; }
/* E5: the round + steps aside while scrolling down */
.fab { transition: transform .18s var(--ease), opacity .18s var(--ease); }
.fab.fab-away { transform: translateY(96px); opacity: 0; pointer-events: none; }
/* E5: Setup on Home as one line */
.home-tile.setup-compact > .home-head { display: none; }
.home-tile.setup-compact .home-body { padding-top: 0; }
.setup-line { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.setup-line-a { flex: 1; display: flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--ink); }
.setup-line-x { min-width: 44px; min-height: 44px; justify-content: center; }
/* E6: what a transaction list opened from a report is showing */
.ctx-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--rule-2); border-radius: var(--radius); background: var(--surface-1); }
.ctx-back { display: inline-flex; align-items: center; min-height: 36px; font-weight: 600; color: var(--accent-ink); }
.ctx-chip { display: inline-flex; align-items: center; gap: 2px; min-height: 32px; padding: 0 4px 0 10px; border: 1px solid var(--rule-2); border-radius: 999px; background: var(--surface-2); color: var(--ink); font-size: 13px; max-width: 100%; }
.ctx-chip button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; color: var(--ink-2); font-size: 16px; line-height: 1; cursor: pointer; }
.ctx-chip button:hover { background: var(--surface-3); color: var(--ink); }
.ctx-total { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .ctx-back { min-height: 44px; }
  .ctx-chip button { width: 44px; height: 44px; margin: -6px 0; }
}
/* E9: About us uses the full content width (two columns of closed cards on wide screens; an open card spans both); the active tab is not bold, so the row never shifts */
.au-page { max-width: none; }
@media (min-width: 1100px) {
  .au-page { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; align-items: start; }
  .au-page > *:not(.au-card) { grid-column: 1 / -1; }
  .au-page > .au-card:has(.au-body) { grid-column: 1 / -1; }
}
.tabs a.on, .pk-nav a.on, #tabbar a.active { font-weight: 400; -webkit-text-stroke: .5px currentColor; }
/* E12: the balance preview lead is plain; only its amounts are bold. Paychecks filters sit in the usual control row. */
.bal-top { font-weight: 400; }
.bal-top b { font-weight: 650; }
.rpt-controls.pr-filters > select { min-width: 150px; }
/* E5: Budget rows on a phone: one shared three-column grid, labels on one line, a 44 px options button */
@media (max-width: 520px) {
  .bgrid tr.cat { position: relative; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 4px; row-gap: 0; align-items: center; padding: 6px 44px 6px 0; }
  .bgrid tr.cat td { padding: 0; }
  .bgrid tr.cat td.nm { grid-column: 1 / -1; min-width: 0; padding: 0 0 2px 9px; }
  .bgrid tr.cat td[data-l]::before { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; padding-left: 9px; line-height: 14px; }
  .bgrid tr.cat .asg, .bgrid tr.cat .spent-link, .bgrid tr.cat .pill { box-sizing: border-box; align-items: center; min-height: 30px; margin: 0; padding: 0 8px; border: 1px solid transparent; text-align: left; font-size: 14px; line-height: 1.2; }
  .bgrid tr.cat .asg { display: block; width: 100%; max-width: none; }
  .bgrid tr.cat .spent-link, .bgrid tr.cat .pill { display: inline-flex; width: auto; max-width: 100%; min-width: 0; }
  .bgrid tr.cat .rowtools { position: absolute; right: 0; top: 50%; transform: translateY(-50%); margin: 0; }
  .bgrid tr.cat .rowtools .btn { min-width: 44px; min-height: 44px; padding: 0; justify-content: center; }
}
/* E5: Planner head on a phone: section tabs in one sideways-scrolling row with the "..." beside them, then the title, then the plan selector at full width */
@media (max-width: 860px) {
  .pl-head { flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  .pl-head > .ph-t { display: contents; }
  .pl-head .vz-kicker.pk { order: 1; flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 10px; margin: 0; overflow: hidden; }
  .pl-head .pk-nav { display: flex; gap: 2px; flex: 1 1 auto; min-width: 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .pl-head .pk-nav::-webkit-scrollbar { display: none; }
  .pl-head .pk-nav a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; white-space: nowrap; }
  .pl-head > .btn.sm { order: 2; flex: none; min-height: 44px; min-width: 44px; }
  .pl-head > h1 { order: 3; flex: 1 1 100%; }
  .pl-head > select { order: 4; flex: 1 1 100%; width: 100%; min-width: 0; min-height: 44px; }
  .pl-head > .grow { display: none; }
  .pl-head > #pl-status { order: 9; }
}

/* persona-fixes F (review after QA) */
/* Loans & debt header on a phone: tabs on one row, the button on its own row */
@media (max-width: 860px) {
  .ln-head { flex-wrap: wrap; gap: 6px 8px; }
  .ln-head > .ph-t { flex: 1 1 100%; min-width: 0; }
  .ln-head .vz-kicker.pk { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .ln-head .pk-nav { display: flex; gap: 2px; flex: 1 1 auto; min-width: 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .ln-head .pk-nav::-webkit-scrollbar { display: none; }
  .ln-head .pk-nav a { flex: none; white-space: nowrap; }
  .ln-head > .grow { display: none; }
  .ln-head > .btn { flex: 1 1 100%; justify-content: center; min-height: 44px; }
}
.dt-li .num::before { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* About us in two columns: one even grid (the cards' own top margins made the right column sit lower) */
@media (min-width: 1100px) {
  .au-page { row-gap: 12px; }
  .au-page > .au-card { margin-top: 0; margin-bottom: 0; }
}
/* Home, edit mode on a wide screen: the tile tools fit on one row without being cut off */
@media (min-width: 861px) {
  .home-edit { gap: 4px; }
  .home-edit .seg button { min-width: 30px; padding: 0 8px; }
  .home-edit .home-eb { min-width: 32px; padding: 0 7px; }
}
/* Interest report on a phone: the table fits (balance is on the account's own page) */
@media (max-width: 600px) {
  .int-acct th:nth-child(3), .int-acct td:nth-child(3) { display: none; }
  .int-acct table.t th, .int-acct table.t td { padding: 8px 6px; font-size: 13px; }
  .int-acct table.t th { white-space: normal; }
}
/* Paychecks: rules and hover that work in the light theme too */
.pr-table th, .pr-table td { border-bottom-color: var(--rule, rgba(128,128,128,.25)); }
.pr-row:hover { background: color-mix(in srgb, var(--ink, #888) 5%, transparent); }
.pr-stack { background: var(--rule-2, rgba(128,128,128,.25)); }
@media (max-width: 860px) {
  .ln-head .pk-nav { gap: 14px; }
  /* debt rows on a phone: a short label that fits; an empty cell takes no room; a prompt in place of a number gets the room it needs */
  .dt-li > .num[data-l="Interest a month"]::before { content: "Interest / mo"; }
  .dt-li > .num.dt-miss:empty { display: none; }
  .dt-li > .num.dt-miss:not(:empty) { grid-column: span 2; }
}
@media (max-width: 600px) {
  .int-acct table.t { width: 100%; min-width: 0; }
  .int-acct table.t th, .int-acct table.t td { padding: 8px 4px; }
  .int-acct table.t th { font-size: 10px; letter-spacing: .04em; }
}
/* Recommendations: the headline can be a sentence ("Nothing to suggest right now"); it wraps instead of running off a phone screen */
.recs-hero .recs-big { white-space: normal; text-wrap: balance; }

/* [grp-target] group target total beside the group name */
.bgrid tr.grp td:first-child .g-tgt { margin-left: 10px; font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* [toast-corner] wider screens: messages (Undo, Make a rule, ...) sit in the bottom right corner, out of the way of the page */
@media (min-width: 861px) {
  #toasts { left: auto; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom)); transform: none; align-items: flex-end; }
  .toast { max-width: min(440px, calc(100vw - 48px)); }
}

/* [billing] the trial banner (only drawn while billing is on) and the owner's billing cards */
.billing-banner { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; justify-content: center; flex-wrap: wrap; padding: 7px 14px; margin-left: var(--side); font-size: 13px; background: var(--accent-weak); border-bottom: 1px solid var(--line); }
.billing-banner.warn { background: var(--warn-weak); }
.billing-banner.ended { background: var(--bad-weak); }
.billing-banner .bb-text { flex: 0 1 auto; }
.billing-banner .btn[disabled] { opacity: .75; cursor: default; }
@media (max-width: 860px) { .billing-banner { margin-left: 0; } }
details.bill-add { margin-top: 12px; }
details.bill-add > summary { cursor: pointer; color: var(--muted); }
.bill-app { padding: 10px 0; border-top: 1px solid var(--line); }
.bill-app:first-of-type { border-top: 0; }

/* [merge] links from the sign-in screen back to the public site */
.login-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 18px; font-size: 13px; }
.login-links a { color: var(--ink-3, var(--muted)); text-decoration: none; }
.login-links a:hover, .login-links a:focus-visible { color: var(--ink, inherit); text-decoration: underline; }

/* [merge] Sign out in the sidebar footer: a labelled button pushed to the right of the theme and help buttons */
.side-foot .btn.side-out { width: auto; margin-left: auto; padding: 0 10px; gap: 6px; font-size: 13px; color: var(--ink-2, var(--muted)); }
.side-foot .btn.side-out:hover { color: var(--ink, inherit); }

/* [clr] the cleared marker: a quiet check when cleared, a labelled amber chip when not, a lock when reconciled */
.clr { width: auto; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 999px; gap: 5px; cursor: pointer; white-space: nowrap; }
.clr.on { color: var(--pos, var(--good)); }
.clr.rec { cursor: default; color: var(--ink-3); }
.clr.off { padding: 0 9px 0 7px; color: var(--caution, #cf9a2e); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--caution, #cf9a2e) 60%, transparent);
  background: color-mix(in srgb, var(--caution, #cf9a2e) 10%, transparent); font-size: 12px; font-weight: 600; }
.clr.off .cm { width: 8px; height: 8px; box-shadow: inset 0 0 0 1.5px currentColor; }
.clr.off:hover { background: color-mix(in srgb, var(--caution, #cf9a2e) 20%, transparent); }
.clr:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
th.clr-h { white-space: nowrap; font-weight: inherit; }
@media (max-width: 860px) { .txn .clr.off .clr-t { display: inline; } .txn .clr.off { height: 22px; } }
