/* Fonts are self-hosted (web/vendor.sh), so the GUI makes no third-party requests. */
@font-face { font-family: 'Public Sans'; font-weight: 400; font-display: swap; src: url(fonts/public-sans-400.woff2) format('woff2'); }
@font-face { font-family: 'Public Sans'; font-weight: 500; font-display: swap; src: url(fonts/public-sans-500.woff2) format('woff2'); }
@font-face { font-family: 'Public Sans'; font-weight: 600; font-display: swap; src: url(fonts/public-sans-600.woff2) format('woff2'); }
@font-face { font-family: 'Public Sans'; font-weight: 700; font-display: swap; src: url(fonts/public-sans-700.woff2) format('woff2'); }
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 700; font-display: swap; src: url(fonts/bricolage-grotesque-700.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-mono-500.woff2) format('woff2'); }

/* Styles for the GUI, carried over from mockups/gui.html.
   Layout: phone = one column with a bottom tab bar; desktop (>=960px) = sidebar | content | detail panel. */
:root {
  --bg: #F3F5F2; --surface: #FFFFFF; --surface-2: #E9EDE8; --ink: #17201C; --muted: #5B6862; --line: #D5DCD6;
  --accent: #2B4C9B; --accent-ink: #FFFFFF; --accent-soft: #E2E8F6;
  --in: #1B7A4B; --warn: #9A5A08; --warn-soft: #FBF0DC; --danger: #B3261E; --danger-soft: #FBE4E2;
  --font-ui: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Bricolage Grotesque', 'Public Sans', system-ui, sans-serif;
  --font-num: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --tabbar-h: 58px; --r: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101513; --surface: #18201C; --surface-2: #222B27; --ink: #E4EBE7; --muted: #97A59F; --line: #2D3833;
    --accent: #94AEF2; --accent-ink: #0F1A3A; --accent-soft: #1F2A47;
    --in: #56C98F; --warn: #E3A64A; --warn-soft: #33281A; --danger: #F2857D; --danger-soft: #3A1F1D;
    color-scheme: dark;
  }
}
/* Page basics: content stays clear of phone notches and home indicators. */
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; }
img { max-width: 100%; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-ui); font-size: 15px; line-height: 1.4; }
a { color: var(--accent); }
.tabbar a, .sidebar a, .list-card > a, a.txn-row { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
input, textarea { font: inherit; font-size: 16px; color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
small { font-size: 12px; }

/* ---------- Shell ---------- */
.sidebar { display: none; }
main { padding: 0 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 32px); max-width: 640px; margin: 0 auto; }
.mock-note { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); padding: 10px 0 10px; display: flex; align-items: center; gap: 12px; }
.topbar h1 { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -0.015em; margin: 0; flex: 1; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px); display: grid; grid-template-columns: repeat(5, 1fr); }
.tabbar a { height: var(--tabbar-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); position: relative; }
.tabbar a[aria-current="page"] { color: var(--accent); }
.tabbar svg, .sidebar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar .t-add svg { background: var(--accent); color: var(--accent-ink); stroke: var(--accent-ink); border-radius: 999px; padding: 3px; width: 28px; height: 28px; }
.badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--warn); color: var(--surface); font-size: 11px; line-height: 18px; text-align: center; }

@media (min-width: 960px) {
  /* The columns scroll separately, so the transaction panel stays put while the list scrolls. */
  .app { display: grid; grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: 100vh; overflow: hidden; }
  .app.has-panel { grid-template-columns: 220px minmax(0, 1fr) 440px; }
  .tabbar { display: none; }
  .sidebar { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; padding: 20px 12px; border-right: 1px solid var(--line); background: var(--surface); }
  .sidebar .brand { font-family: var(--font-display); font-weight: 700; font-size: 20px; padding: 0 10px 18px; letter-spacing: -0.01em; text-align: center; }
  .sidebar .emblem { display: block; width: 96px; height: 96px; margin: 0 auto 12px; }
  .sidebar a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; font-weight: 600; color: var(--muted); position: relative; }
  .sidebar a:hover { background: var(--surface-2); }
  .sidebar a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
  .sidebar .badge { position: static; margin-left: auto; }
  .sidebar .mock-note { margin-top: auto; padding: 0 10px; }
  main { padding: 8px 32px 48px; max-width: none; margin: 0; overflow-y: auto; min-height: 0; }
  main > .inner { max-width: 720px; }
}

/* ---------- Activity ---------- */
.search input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.chips-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 4px; scrollbar-width: none; }
.fchip { flex: none; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 500; }
button.fchip { padding: 6px 12px; }
.fchip.on { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }
.fchip.on > button:first-child { padding: 6px 4px 6px 12px; }
.fchip .x { padding: 6px 10px 6px 6px; font-size: 16px; line-height: 1; }
.acct-card { margin: 12px 0 0; padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.acct-card .nm { font-weight: 700; font-size: 17px; flex: 1; }
.acct-card .bal { font-size: 22px; }
.acct-card .legend { flex-basis: 100%; display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.day { margin-top: 18px; }
.day h2 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 6px; }
.day-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.txn-row { width: 100%; display: flex; gap: 12px; align-items: center; padding: 11px 14px; border-top: 1px solid var(--line); }
.txn-row:first-child { border-top: 0; }
.txn-row:hover { background: var(--surface-2); }
.txn-row.sel { background: var(--accent-soft); }
.t-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.payee { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; }
.t-amt { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.amt { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 15px; white-space: nowrap; }
.amt.in { color: var(--in); }
.amt.xfer { color: var(--muted); }
.t-amt .bal { font-family: var(--font-num); font-size: 12px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.flag { font-size: 11px; font-weight: 700; color: var(--warn); background: var(--warn-soft); padding: 1px 6px; border-radius: 4px; }
.tagtxt { color: var(--accent); font-weight: 500; }
.empty-state { padding: 40px 16px; text-align: center; color: var(--muted); }
.empty-state b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

/* ---------- Editor ---------- */
.editor { display: flex; flex-direction: column; gap: 16px; padding-top: 4px; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface-2); border-radius: 10px; padding: 3px; }
.seg button { padding: 8px 0; border-radius: 8px; text-align: center; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.12); }
.amount-wrap { display: flex; align-items: flex-end; gap: 12px; }
.amount-wrap > div { flex: 1; min-width: 0; }
.lbl { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 6px; }
.amount-field { display: flex; align-items: baseline; gap: 4px; border-bottom: 2px solid var(--line); padding-bottom: 2px; }
.amount-field:focus-within { border-color: var(--accent); }
.amount-field span { font-family: var(--font-num); font-size: 28px; color: var(--muted); }
.amount-field input { flex: 1; min-width: 0; border: 0; background: none; font-family: var(--font-num); font-size: 38px; padding: 0; outline: none; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; padding-bottom: 10px; white-space: nowrap; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); }
.field input, .field textarea, .memo { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.field textarea { min-height: 64px; resize: vertical; }
.sugs { display: flex; flex-direction: column; margin-top: 4px; }
.sugs:empty, .tag-sug:empty { display: none; }
.sugs button { padding: 9px 12px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; background: var(--surface); }
.sugs button:first-child { border-radius: 10px 10px 0 0; border-top: 1px solid var(--line); }
.sugs button:last-child { border-radius: 0 0 10px 10px; }
.sugs button:only-child { border-radius: 10px; }
.sugs button { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.sugs small { color: var(--muted); }
.sugs button:focus { background: var(--surface-2); }
.tag-sug { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tagpick { padding: 5px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 14px; }
.tagpick.first { outline: 2px solid var(--accent); outline-offset: -2px; }
.tagpick small { font-weight: 400; margin-left: 6px; opacity: 0.8; }
.nosug { font-size: 13px; color: var(--muted); }
.notice { font-size: 13px; color: var(--muted); background: var(--surface-2); padding: 8px 12px; border-radius: 8px; display: flex; gap: 8px; align-items: center; }
.notice button { margin-left: auto; color: var(--accent); font-weight: 600; }
.side { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.side legend { padding: 0; margin-bottom: 6px; }
.erow.invalid { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.erow { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.erow-main { display: flex; gap: 8px; align-items: center; }
.target { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 6px 6px; border-radius: 8px; }
.target:hover { background: var(--surface-2); }
.target .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tpath { font-size: 12px; color: var(--muted); }
.tname { font-weight: 600; font-size: 16px; }
.tph { color: var(--accent); font-weight: 600; }
.chev { color: var(--muted); font-size: 20px; line-height: 1; }
.row-amt { width: 112px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-family: var(--font-num); text-align: right; }
.icon-btn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 22px; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--surface-2); }
.why { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; width: 100%; padding: 7px 10px; border-radius: 8px; font-size: 14px; background: var(--surface-2); }
.why .k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.why .src { font-size: 12px; color: var(--muted); margin-left: auto; }
.why.auto .v { color: var(--muted); }
.why.manual .v { color: var(--ink); font-weight: 600; }
.why.need { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.why.conflict { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.why.need .k, .why.conflict .k { color: inherit; }
.add-split { align-self: flex-start; color: var(--accent); font-weight: 600; padding: 4px 2px; }
.rem { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.rem.bad { color: var(--warn); }
.rem.ok { color: var(--in); }
.errors:empty { display: none; }
.errors { background: var(--danger-soft); color: var(--danger); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.errors ul { margin: 0; padding-left: 18px; }
.actions { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); background: var(--bg); padding: 10px 0; display: flex; gap: 10px; justify-content: flex-end; z-index: 4; }
.panel .actions { bottom: 0; background: var(--surface); padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
.btn { padding: 10px 18px; border-radius: 10px; font-weight: 700; border: 1px solid var(--line); background: var(--surface); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; min-width: 120px; text-align: center; }
.btn.danger { background: var(--danger); color: var(--surface); border-color: transparent; }
.btn.ghost { background: none; }
@media (min-width: 960px) { .actions { bottom: 0; } }

/* ---------- Panel (transaction view / edit) ---------- */
.panel { position: fixed; inset: 0; z-index: 30; background: var(--surface); overflow-y: auto; padding: env(safe-area-inset-top, 0px) 16px 0; }
@media (min-width: 960px) {
  .panel { position: static; height: 100%; min-height: 0; inset: auto; border-left: 1px solid var(--line); padding: 0 20px; }
}
.panel-head { position: sticky; top: 0; z-index: 5; background: var(--surface); display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); margin: 0 0 12px; }
.panel-head .ttl { flex: 1; font-weight: 700; }
.panel-head .ttl-id { font-weight: 400; color: var(--muted); font-family: var(--font-num); font-size: 0.9em; }
.v-hero { display: flex; flex-direction: column; gap: 2px; padding: 8px 0 16px; }
.v-type { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.v-payee { font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: -0.015em; text-wrap: balance; }
.v-amt { font-family: var(--font-num); font-size: 30px; }
.v-amt.in { color: var(--in); }
.v-date { color: var(--muted); }
.v-side { margin-top: 14px; }
.v-row { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.v-row-main { display: flex; gap: 12px; align-items: baseline; }
.v-row-main .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.v-status { font-size: 12px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.v-memo { font-size: 14px; color: var(--muted); }
.v-note { margin-top: 18px; padding: 12px; background: var(--surface-2); border-radius: 10px; }
.v-meta { margin: 18px 0; font-size: 13px; color: var(--muted); }
.confirm { margin: 0 0 24px; padding: 14px; border-radius: 10px; background: var(--danger-soft); display: flex; flex-direction: column; gap: 10px; }
.confirm div { display: flex; gap: 10px; }
.del-link { color: var(--danger); font-weight: 600; margin-bottom: 28px; padding: 6px 0; }

/* ---------- Review ---------- */
.rcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-top: 12px; overflow: hidden; }
a.rc-head, a.chip { color: inherit; text-decoration: none; }
a.chip.more { color: var(--accent); }
.rcard.sel { border-color: var(--accent); }
.rcard .errors { margin: 0 14px 12px; }
.rc-head { width: 100%; display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px 8px; }
.rc-head small { display: block; color: var(--muted); font-size: 13px; }
.rc-issue { padding: 8px 14px 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.rc-what { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 14px; }
.rc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); font-weight: 600; font-size: 14px; background: var(--bg); }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.more { color: var(--accent); }
.rcard.done { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 14px; background: none; color: var(--muted); }
.rcard.done b { color: var(--ink); }
.rc-note { padding: 0 14px 12px; font-size: 13px; color: var(--muted); }

/* ---------- Picker sheet ---------- */
.picker { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; justify-content: flex-end; }
.backdrop { position: absolute; inset: 0; background: rgba(10, 16, 14, 0.45); }
.sheet { position: relative; background: var(--surface); border-radius: 16px 16px 0 0; max-height: 86vh; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom, 0px); }
@media (min-width: 960px) {
  .picker { justify-content: center; align-items: center; }
  .sheet { width: 480px; max-height: 76vh; border-radius: 16px; }
}
.sheet-head { display: flex; align-items: center; padding: 12px 12px 4px 16px; }
.sheet-head h2 { flex: 1; margin: 0; font-family: var(--font-display); font-size: 20px; }
.kind-tabs { display: flex; gap: 6px; padding: 6px 16px 0; }
.kind-tabs button { padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--muted); }
.kind-tabs button.on { background: var(--accent-soft); color: var(--accent); }
.sheet-search { padding: 8px 16px; }
.sheet-search input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.sheet-body { overflow-y: auto; padding: 0 8px 16px; }
.pk-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 12px 8px 4px; }
.pk-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 8px; border-radius: 8px; }
.pk-item:hover, .pk-item:focus { background: var(--surface-2); }
.pk-item .pk-label { flex: 1; min-width: 0; }
.pk-item .pk-sub { font-size: 12px; color: var(--muted); text-align: right; }
.pk-item.back { color: var(--accent); font-weight: 600; }
.pk-item.all { font-weight: 600; }
.pk-item.auto .pk-label { font-weight: 600; }
.pk-item mark { background: var(--accent-soft); color: inherit; border-radius: 3px; }
.pk-path { display: block; font-size: 12px; color: var(--muted); }

/* ---------- Toast & misc ---------- */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px); z-index: 50;
  background: var(--ink); color: var(--bg); border-radius: 10px; padding: 10px 14px; display: flex; gap: 16px; align-items: center; max-width: calc(100% - 32px); box-shadow: 0 4px 16px rgba(0,0,0,0.2); }
.toast button { color: var(--accent-soft); font-weight: 700; }
@media (min-width: 960px) { .toast { bottom: 24px; } }
.section-h { font-family: var(--font-display); font-size: 18px; margin: 24px 0 8px; }
.list-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.list-card > * { display: flex; width: 100%; justify-content: space-between; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.list-card > *:first-child { border-top: 0; }
.list-card small { color: var(--muted); display: block; }
.muted { color: var(--muted); }
.bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--surface-2); margin: 10px 0 8px; }
.bar span { display: block; }
.planned { margin: 8px 0 0; padding-left: 20px; }
.planned li { margin: 4px 0; }
@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: rise 0.18s ease-out; }
  @keyframes rise { from { transform: translateY(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
}

/* ---------- Sign-in, loading, problems ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 32px 16px; }
.login form, .problem { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 16px; }
.login h1 { font-family: var(--font-display); font-size: 30px; letter-spacing: -0.015em; margin: 0 0 4px; }
.login .btn.primary { width: 100%; padding: 12px; }
.btn:disabled { opacity: 0.6; cursor: default; }
.splash { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Activity extras ---------- */
.more-row { display: flex; justify-content: center; padding: 16px 0; }
.status-icon { display: inline-flex; vertical-align: middle; }
.fchip.on > button:first-child { color: inherit; }

/* ---------- Accounts ---------- */
.section-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-row .btn { padding: 7px 14px; }
a.btn { display: inline-block; color: inherit; text-decoration: none; text-align: center; }
a.btn.primary { color: var(--accent-ink); }
.group-h { display: flex; justify-content: space-between; margin: 16px 2px 6px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
a.group-h { color: inherit; text-decoration: none; align-items: center; }
a.group-h .chev { font-size: 16px; }
.list-card > a.indent { padding-left: 32px; }
.linkish { color: var(--accent); font-weight: 600; padding: 12px 2px; }
.details > div { align-items: baseline; }
.details > div > span:last-child { text-align: right; min-width: 0; overflow-wrap: anywhere; }
.button-row.spaced { margin: 20px 0 28px; }
.choices { border: 0; margin: 0; padding: 0; min-width: 0; }
.choices legend { padding: 0; margin-bottom: 6px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr)); gap: 8px; }
.choices.owners .choice-grid { grid-template-columns: repeat(3, 1fr); }
.choice-grid button { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  font-weight: 600; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.choice-grid button small { font-weight: 400; color: var(--muted); }
.choice-grid button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.field.invalid input, .choices.invalid .choice-grid button { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 13px; margin-top: 4px; }
.field-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 16px; }
.field input.short { max-width: 8rem; }
.hint { font-size: 13px; color: var(--muted); margin: -8px 0 0; }
.hint.opening-hint { margin: 16px 0 0; }

/* Import (views/imports.js) and payee rules (views/rules.js) */
.file-btn { display: inline-block; margin: 4px 0 16px; cursor: pointer; }
.file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-btn.busy { opacity: 0.7; cursor: progress; }
.imp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.imp-card.fresh { border-color: var(--accent); }
.imp-card p { margin: 0; font-size: 14px; }
.imp-card .confirm { margin: 0; }
.imp-head small { display: block; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.imp-note { color: var(--muted); }
.imp-bal.ok { color: var(--in); font-weight: 600; }
.imp-bal.warn { color: var(--warn); font-weight: 600; }
.imp-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); font-size: 14px; }
.v-bank { font-size: 12px; color: var(--muted); font-family: var(--font-num); overflow-wrap: anywhere; }
.v-bank .k { font-family: inherit; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-right: 4px; }
.ed-bank { margin-top: 6px; }
.rc-bank { padding: 0 14px 8px; font-size: 12px; color: var(--muted); font-family: var(--font-num); overflow-wrap: anywhere; }
.rule-open { display: block; text-align: left; }
.rule-saved { color: var(--in); font-weight: 600; font-size: 14px; }
.rule-form { margin: 8px 0 20px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); display: flex; flex-direction: column; gap: 12px; }
.rule-form .field { margin: 0; }
.rule-form .hint { margin: 6px 0 0; overflow-wrap: anywhere; }
.rule-then { margin: 0; font-weight: 600; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
