/* ==========================================================================
   WealthFlow — dark financial terminal
   Tokens first, then primitives, then screens. Hairlines and tight radii;
   density over whitespace. Numbers are always tabular.
   ========================================================================== */

:root {
  --bg:      oklch(0.175 0.010 255);
  --panel:   oklch(0.215 0.011 255);
  --panel2:  oklch(0.245 0.012 255);
  --raise:   oklch(0.285 0.013 255);
  --line:    oklch(0.295 0.012 255);
  --line2:   oklch(0.375 0.014 255);
  --tx:      oklch(0.955 0.004 255);
  --tx2:     oklch(0.740 0.011 255);
  --tx3:     oklch(0.585 0.013 255);

  --pos:     oklch(0.760 0.130 168);
  --neg:     oklch(0.700 0.150 25);
  --pos-dim: color-mix(in oklab, var(--pos) 16%, transparent);
  --neg-dim: color-mix(in oklab, var(--neg) 16%, transparent);
  --pos-ink: oklch(0.20 0.03 168);

  /* Categorical ramp: one lightness, one chroma, hue only. No category shouts. */
  --c1: oklch(0.70 0.11 255);
  --c2: oklch(0.70 0.11 60);
  --c3: oklch(0.70 0.11 300);
  --c4: oklch(0.70 0.11 330);
  --c5: oklch(0.70 0.11 205);
  --c6: oklch(0.70 0.11 140);
  --c7: oklch(0.70 0.11 25);
  --c8: oklch(0.70 0.11 90);

  --r1: 4px;
  --r2: 8px;
  --r3: 12px;

  --font: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Only for genuine code tokens — cookie names, shell commands, hosts. The
     system stack, so it matches whatever terminal the reader already knows. */
  --code: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --rail: 216px;
  --page-max: 1560px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--tx);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(900px 420px at 22% -8%, color-mix(in oklab, var(--pos) 6%, transparent), transparent 70%),
    var(--bg);
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
input, select, textarea { background: none; border: 0; outline: none; min-width: 0; }
a { color: var(--pos); text-decoration: none; }
a:hover { color: color-mix(in oklab, var(--pos) 75%, white); }

::selection { background: var(--pos-dim); }

/* Focus is indicated once, by whichever element owns the visible box.
   Note: no border-radius here — an outline already follows the element's own
   radius, and forcing one would square off the corners of focused buttons. */
:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--pos) 75%, transparent);
  outline-offset: 2px;
}

/* A control wrapped in .field-box must not draw its own ring: the input is
   inset from the wrapper horizontally but full-height vertically, so an offset
   outline lands outside the box top and bottom and inside it left and right.
   The wrapper's own border is the indicator, and it matches the real corner
   radius by construction. */
.field-box :is(input, select, textarea):focus-visible { outline: none; }

/* Controls sitting inside an overflow-hidden shell would have an offset ring
   clipped away, so theirs is drawn just inside the element instead. */
.segmented .seg:focus-visible,
.stepper .ghost-icon:focus-visible,
.popover .pop-item:focus-visible { outline-offset: -2px; }

/* ------------------------------------------------------------- primitives */

/* Figures line up in columns without setting them in a monospace: tabular
   figures give every digit the same advance width in the body face. */
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; letter-spacing: -0.005em; }
.code { font-family: var(--code); font-variant-numeric: tabular-nums; font-size: 0.94em; letter-spacing: 0; }
.muted { color: var(--tx3); }
.tiny { font-size: 10.5px; }
.strong { font-weight: 600; }
.right { text-align: right; justify-self: end; }
.center { text-align: center; justify-self: center; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.spacer { flex: 1; }
.ellipsis { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.lbl {
  font-size: 10px; font-weight: 600; letter-spacing: 0.055em;
  text-transform: uppercase; color: var(--tx3);
}
.lbl.right { text-align: right; }
.lbl.center { text-align: center; }

.dot { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.dot.round { border-radius: 999px; }
.dot.live { background: var(--pos); }
.dot.idle { background: var(--line2); }
.dot.warn { background: var(--c8); }

.tag {
  font-family: var(--code); font-size: 10px; color: var(--tx3);
  border: 1px solid var(--line); border-radius: var(--r1); padding: 2px 6px;
}
.tag-mini { margin-left: auto; font-size: 9px; letter-spacing: 0.08em; }
.count {
  margin-left: auto; font-size: 10px; color: var(--tx3);
  border: 1px solid var(--line); border-radius: var(--r1); padding: 0 4px;
}

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r3); min-width: 0; }
.panel-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 13px 16px 12px; border-bottom: 1px solid var(--line);
}
.panel-head h3 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: -0.005em; }
.panel-sub { font-size: 11px; color: var(--tx3); text-align: right; }
.panel-body { padding: 14px 16px; }
.panel-body.flush { padding: 0; }
.panel-pad { padding: 0 16px 14px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 20px; padding: 0 7px;
  border-radius: var(--r1); background: var(--panel2); border: 1px solid var(--line);
  font-size: 11px; font-weight: 500; color: var(--tx2); max-width: 100%;
}
.chip.strong { font-weight: 600; height: 22px; }
.chip.warn  { border-color: color-mix(in oklab, var(--c8) 46%, transparent); background: color-mix(in oklab, var(--c8) 12%, transparent); color: var(--c8); }
.chip.c5    { border-color: color-mix(in oklab, var(--c5) 46%, transparent); background: color-mix(in oklab, var(--c5) 12%, transparent); color: var(--c5); }
.chip.bad   { border-color: color-mix(in oklab, var(--neg) 46%, transparent); background: var(--neg-dim); color: var(--neg); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 32px; padding: 0 12px; border-radius: var(--r2);
  border: 1px solid var(--line2); background: var(--panel2);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.btn:hover { background: var(--raise); }
.btn.pri { background: var(--pos); border-color: var(--pos); color: var(--pos-ink); }
.btn.pri:hover { background: color-mix(in oklab, var(--pos) 88%, white); }
.btn.lg { height: 40px; border-radius: 9px; font-size: 13px; }
.btn.full { width: 100%; }
.btn[disabled] { opacity: 0.42; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; align-items: center; }

.ghost-icon {
  display: inline-grid; place-items: center; width: 26px; height: 26px;
  border-radius: var(--r2); color: var(--tx3);
}
.ghost-icon:hover { background: var(--panel2); color: var(--tx); }

.link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; color: var(--pos);
}
.link:hover { color: color-mix(in oklab, var(--pos) 75%, white); }

.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; }
.delta.good { color: var(--pos); }
.delta.bad  { color: var(--neg); }
.delta.flat { color: var(--tx3); }
.mark { flex: none; }

.bar { height: 6px; border-radius: 3px; background: var(--panel2); overflow: hidden; display: block; }
.bar.tall { height: 8px; }
.bar.thin { height: 4px; }
.bar-fill { display: block; height: 100%; border-radius: 3px; }

.banner {
  display: flex; gap: 9px; padding: 10px 12px; border-radius: var(--r2);
  border: 1px solid var(--line); background: var(--panel2);
  font-size: 11.5px; line-height: 1.5; color: var(--tx2);
}
.banner svg { flex: none; margin-top: 1px; }
.banner.info { color: var(--tx2); }
.banner.warn { border-color: color-mix(in oklab, var(--c8) 40%, var(--line)); background: color-mix(in oklab, var(--c8) 7%, transparent); }
.banner.warn svg { color: var(--c8); }
.banner.bad  { border-color: color-mix(in oklab, var(--neg) 42%, var(--line)); background: color-mix(in oklab, var(--neg) 8%, transparent); }
.banner.bad svg { color: var(--neg); }
.banner.good { border-color: color-mix(in oklab, var(--pos) 40%, var(--line)); background: color-mix(in oklab, var(--pos) 7%, transparent); }
.banner.good svg { color: var(--pos); }

.empty { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 34px 20px; text-align: center; }
.empty-title { font-size: 14px; font-weight: 600; }
.empty-body { font-size: 12.5px; color: var(--tx3); max-width: 460px; line-height: 1.55; text-wrap: pretty; }
.empty-action { margin-top: 8px; }
.empty-inline { padding: 22px 16px; font-size: 12.5px; color: var(--tx3); text-align: center; }

/* -------------------------------------------------------------- svg labels */

.axis { font-size: 10px; fill: var(--tx3); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.axis.axis-pos { fill: var(--pos); }
.axis.strong { font-weight: 500; font-size: 10.5px; }
.axis.strong-ink { fill: var(--tx2); font-size: 11px; font-weight: 600; }
.axis.on-c3 { fill: oklch(0.19 0.03 300); font-weight: 600; font-size: 9px; }
.chart-empty { padding: 40px 16px; text-align: center; font-size: 12.5px; color: var(--tx3); }

/* -------------------------------------------------------------- app shell */

.boot {
  min-height: 100vh; display: grid; place-items: center; gap: 12px;
  grid-auto-flow: row; color: var(--tx3); font-size: 12.5px;
}
.boot-mark { color: var(--pos); }

.app { display: flex; min-height: 100vh; }

.rail {
  width: var(--rail); flex: none; display: flex; flex-direction: column; gap: 22px;
  padding: 18px 14px; border-right: 1px solid var(--line);
  background: color-mix(in oklab, var(--panel) 55%, transparent);
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 0 4px; font-size: 14px; font-weight: 700; letter-spacing: -0.02em; }
.brand-mark { color: var(--pos); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px;
  border-radius: var(--r2); color: var(--tx2); font-size: 13px; font-weight: 500; text-align: left;
}
.nav-item svg { flex: none; }
.nav-item:hover { background: color-mix(in oklab, var(--panel2) 70%, transparent); color: var(--tx); }
.nav-item.on { background: var(--panel2); color: var(--tx); box-shadow: inset 0 0 0 1px var(--line); }
.nav-item.muted-item { opacity: 0.58; }
.nav-item.muted-item.on { opacity: 1; }

.rail-foot { margin-top: auto; }
.accounts { padding: 11px 12px; display: flex; flex-direction: column; gap: 8px; }
.account-list { display: flex; flex-direction: column; gap: 7px; }
.account { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--tx2); }
.accounts-foot { padding-top: 2px; border-top: 1px solid var(--line); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 56px; flex: none; display: flex; align-items: center; gap: 12px;
  padding: 0 24px; border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
}
.stepper {
  display: flex; align-items: center; border: 1px solid var(--line);
  border-radius: var(--r2); background: var(--panel); overflow: hidden;
}
.stepper .ghost-icon { border-radius: 0; width: 30px; height: 30px; }
.stepper-label {
  font-size: 12px; font-weight: 500; padding: 0 12px;
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
}
.avatar {
  width: 30px; height: 30px; flex: none; border-radius: var(--r2);
  background: var(--panel2); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--tx2);
}
.avatar:hover { color: var(--tx); background: var(--raise); }

.page {
  padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 14px;
  width: 100%; max-width: var(--page-max);
}
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0 0 3px; font-size: 21px; font-weight: 600; letter-spacing: -0.025em; }
.page-head p { margin: 0; font-size: 12.5px; color: var(--tx3); max-width: 72ch; text-wrap: pretty; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- overview */

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); gap: 14px; }
.split-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.split-grid.wide-left { grid-template-columns: minmax(0, 1.38fr) minmax(0, 1fr); }
.split-grid.cat-grid { grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr); }

.kept-panel { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 18px; }
.kept-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.kept-main { display: flex; flex-direction: column; gap: 5px; }
.kept-figure { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.kept-value { font-size: clamp(30px, 3.2vw, 46px); font-weight: 500; letter-spacing: -0.035em; line-height: 1; color: var(--pos); }
.kept-rate { font-size: 15px; font-weight: 500; color: var(--tx2); }
.kept-foot { font-size: 12px; color: var(--tx3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kept-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.kept-avg { font-size: 18px; font-weight: 500; color: var(--tx2); }

.flow { display: flex; flex-direction: column; gap: 9px; }
.flow-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.flow-track { display: flex; gap: 2px; height: 34px; }
.flow-seg { display: flex; align-items: center; padding-left: 8px; min-width: 2px; overflow: hidden; }
.flow-seg:last-child { border-radius: 0 var(--r1) var(--r1) 0; }
.flow-seg-label { font-size: 11px; font-weight: 600; white-space: nowrap; }
.flow-kept {
  background: var(--pos-dim); border: 1px solid var(--pos);
  justify-content: flex-end; padding: 0 10px 0 8px;
}
.flow-kept .flow-seg-label { color: var(--pos); }
.flow-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.flow-key { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--tx2); }

.stats-panel { display: flex; flex-direction: column; }
.stat-row { flex: 1; display: flex; align-items: center; gap: 14px; padding: 14px 18px; min-height: 92px; }
.stat-row + .stat-row { border-top: 1px solid var(--line); }
.stat-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.stat-value { font-size: 21px; font-weight: 500; letter-spacing: -0.02em; }
.stat-foot { font-size: 11px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.stat-chart { flex: none; }

.insight-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.insight { display: flex; gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--line); }
.insight:nth-child(odd) { border-right: 1px solid var(--line); }
.insight-grid .insight:nth-last-child(-n+2):nth-child(odd) { border-bottom: 0; }
.insight-grid .insight:last-child { border-bottom: 0; }
.insight-dot { width: 8px; height: 8px; border-radius: 999px; flex: none; margin-top: 5px; }
.insight-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.insight-title { font-size: 13px; font-weight: 600; }
.insight-body { font-size: 12px; color: var(--tx2); line-height: 1.5; text-wrap: pretty; }

.bar-table { display: flex; flex-direction: column; }
.bar-row {
  display: grid; grid-template-columns: minmax(96px, 1.15fr) minmax(0, 1.5fr) 86px 50px 62px;
  gap: 12px; align-items: center; height: 32px;
  border-top: 1px solid color-mix(in oklab, var(--line) 55%, transparent);
}
.bar-row.head { height: 26px; border-top: 0; }
.bar-row:first-of-type { border-top: 0; }
.bar-name { display: flex; align-items: center; gap: 7px; font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-amount { font-size: 12px; text-align: right; }
.bar-share { font-size: 10.5px; text-align: right; color: var(--tx3); }
.bar-delta { text-align: right; justify-content: flex-end; display: flex; }

.source-list { display: flex; flex-direction: column; gap: 13px; }
.source-row { display: flex; flex-direction: column; gap: 6px; }
.source-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.source-note { font-size: 10.5px; color: var(--tx3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mini-table { display: flex; flex-direction: column; }
.mini-row {
  display: grid; grid-template-columns: 68px minmax(0, 1fr) minmax(0, 190px) minmax(0, 130px) 104px;
  gap: 14px; align-items: center; height: 34px; font-size: 12.5px;
  border-top: 1px solid color-mix(in oklab, var(--line) 55%, transparent);
}
.mini-row.head { height: 26px; border-top: 0; }

/* ------------------------------------------------------------ transactions */

.filter-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; flex-wrap: wrap; }
.filter-months { display: flex; align-items: center; gap: 7px; }
.filter-months input {
  height: 32px; padding: 0 8px; border: 1px solid var(--line);
  border-radius: var(--r2); background: var(--panel2); font-size: 12px; color: var(--tx);
}
.filter-months input::-webkit-calendar-picker-indicator { filter: invert(0.7); cursor: pointer; }
.filter-months input:focus-visible {
  outline: none;
  border-color: var(--pos);
  box-shadow: 0 0 0 3px var(--pos-dim);
}

.txn-layout { display: grid; grid-template-columns: minmax(0, 1fr) 296px; gap: 14px; align-items: start; }
.txn-panel { overflow: visible; }
.txn-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.txn-table { display: flex; flex-direction: column; padding: 4px 16px 0; }
.txn-grid {
  display: grid; grid-template-columns: 62px minmax(0, 1fr) minmax(0, 216px) minmax(0, 120px) 104px 8px;
  gap: 12px; align-items: center; font-size: 12.5px;
}
.txn-grid.head { height: 30px; }
.txn-row { height: 40px; border-top: 1px solid color-mix(in oklab, var(--line) 55%, transparent); }
.txn-row:hover { background: color-mix(in oklab, var(--panel2) 55%, transparent); }
.txn-row.open { position: relative; z-index: 20; }
.txn-cat { position: relative; min-width: 0; }
.cat-button {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  height: 22px; padding: 0 7px; border-radius: var(--r1);
  border: 1px solid var(--line); background: var(--panel2);
  font-size: 11px; font-weight: 500; color: var(--tx2);
}
.cat-button:hover { border-color: var(--line2); color: var(--tx); }
.cat-button.on { border-color: var(--pos); background: var(--pos-dim); color: var(--pos); }
.txn-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line); }

.popover {
  position: absolute; top: 28px; left: 0; z-index: 40; width: 288px;
  background: var(--raise); border: 1px solid var(--line2); border-radius: 10px;
  box-shadow: 0 22px 48px oklch(0.10 0.01 255 / 0.66); overflow: hidden;
}
.pop-head { padding: 9px 11px; border-bottom: 1px solid var(--line); }
.pop-body { max-height: 320px; overflow-y: auto; padding: 7px 6px; }
.pop-section { display: flex; flex-direction: column; }
.pop-section .lbl { padding: 5px 8px; }
.pop-item {
  display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px;
  border-radius: var(--r2); font-size: 12.5px; color: var(--tx2); text-align: left;
}
.pop-item:hover { background: var(--panel2); color: var(--tx); }
.pop-item.on { background: var(--pos-dim); color: var(--pos); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--pos) 40%, transparent); }
.pop-item svg { margin-left: auto; flex: none; }
.pop-empty { padding: 2px 8px 6px; font-size: 11.5px; color: var(--tx3); }
.pop-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 10px; border-top: 1px solid var(--line); background: var(--panel2);
}
.pop-foot .btn { height: 26px; font-size: 11.5px; }

.sum-main { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; }
.sum-value { font-size: 26px; font-weight: 500; letter-spacing: -0.03em; }
.sum-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sum-grid > div { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }

.side-bars { display: flex; flex-direction: column; gap: 9px; }
.side-bar { display: grid; grid-template-columns: minmax(0, 1fr) 72px; grid-template-areas: "name value" "bar bar"; gap: 4px 10px; align-items: center; }
.side-bar-name { grid-area: name; display: flex; align-items: center; gap: 6px; font-size: 11.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-bar-value { grid-area: value; font-size: 11.5px; text-align: right; }
.side-bar .bar { grid-area: bar; }
.side-list { display: flex; flex-direction: column; gap: 9px; }
.side-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12px; }

/* ------------------------------------------------------------------ trends */

.kpi-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r3); overflow: hidden;
}
.kpi-strip > div { display: flex; flex-direction: column; gap: 3px; padding: 12px 15px; background: var(--panel); }
.kpi-strip .num { font-size: 14px; font-weight: 500; }

.tendency-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tendency {
  display: flex; flex-direction: column; gap: 9px; padding: 13px 15px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.tendency-name { display: flex; align-items: center; gap: 7px; font-size: 12px; min-width: 0; }
.tendency-figure { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.tendency-figure .num { font-size: 15px; font-weight: 500; letter-spacing: -0.02em; }

.subs-table { display: flex; flex-direction: column; }
.subs-row {
  display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr) 104px 112px;
  gap: 14px; align-items: center; height: 34px; font-size: 12.5px;
  border-top: 1px solid color-mix(in oklab, var(--line) 55%, transparent);
}
.subs-row.head { height: 26px; border-top: 0; }
.subs-row.total { height: 40px; border-top: 1px solid var(--line2); margin-top: 4px; }
.subs-name { display: flex; align-items: center; gap: 7px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* -------------------------------------------------------------- categories */

.cat-table { display: flex; flex-direction: column; padding: 4px 16px 0; }
.cat-row {
  display: grid; grid-template-columns: 16px minmax(0, 1fr) 104px 92px 48px 40px 46px;
  gap: 10px; align-items: center; height: 34px;
  border-top: 1px solid color-mix(in oklab, var(--line) 55%, transparent);
}
.cat-row.head { height: 26px; border-top: 0; }
.cat-row:hover { background: color-mix(in oklab, var(--panel2) 45%, transparent); }
.cat-row.off { opacity: 0.5; }
.cat-drag { display: grid; place-items: center; color: var(--tx3); opacity: 0.55; }
.cat-name { display: flex; align-items: center; gap: 8px; min-width: 0; height: 34px; font-size: 12.5px; font-weight: 600; }
.cat-row.child .cat-name { font-weight: 400; font-size: 12px; }
.tree-tick { position: relative; width: 18px; height: 100%; flex: none; }
.tree-tick::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 1px; background: var(--line2); }
.tree-tick.last::before { bottom: 50%; }
.tree-tick::after { content: ""; position: absolute; left: 8px; top: 50%; width: 8px; height: 1px; background: var(--line2); }
.cat-spark { display: grid; place-items: center; }
.cat-menu { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.cat-menu .ghost-icon { width: 22px; height: 22px; }
.cat-foot { padding: 11px 0; border-top: 1px solid var(--line); margin-top: 4px; }

.rule-list { display: flex; flex-direction: column; gap: 11px; }
.rule { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--tx2); }
.rule-note { margin: 12px 0 0; padding-top: 11px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--tx3); line-height: 1.55; text-wrap: pretty; }

/* ------------------------------------------------------------- investments */

.phase2 { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 30px 20px 34px; text-align: center; }
.phase2-mark {
  width: 62px; height: 62px; border-radius: 16px; display: grid; place-items: center;
  color: var(--c5); background: color-mix(in oklab, var(--c5) 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c5) 32%, transparent);
}
.phase2-copy h2 { margin: 0 0 6px; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.phase2-copy p { margin: 0; font-size: 12.5px; color: var(--tx2); max-width: 62ch; line-height: 1.6; text-wrap: pretty; }
.phase2-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px; width: 100%; max-width: 940px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r3); overflow: hidden; }
.phase2-list > div { display: flex; flex-direction: column; gap: 4px; padding: 13px 15px; background: var(--panel2); text-align: left; font-size: 12px; color: var(--tx2); }
.phase2 .banner { max-width: 940px; text-align: left; }

/* -------------------------------------------------------------------- forms */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-box {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: var(--r2); background: var(--panel2);
  font-size: 12.5px; color: var(--tx); min-width: 0;
}
.field-box.grow { flex: 1; min-width: 200px; }
.field-box.tight { height: 30px; padding: 0 8px; }
.field-box svg { flex: none; color: var(--tx3); }
.field-box input, .field-box select { flex: 1; min-width: 0; height: 100%; }
.field-box input::placeholder { color: var(--tx3); }
.field-box:focus-within { border-color: var(--pos); box-shadow: 0 0 0 3px var(--pos-dim); }
.field-box.muted-box { color: var(--tx3); opacity: 0.7; }
.field.bad .field-box,
.field-box.bad-box { border-color: color-mix(in oklab, var(--neg) 60%, var(--line)); box-shadow: 0 0 0 3px var(--neg-dim); }
.field-tail { display: flex; align-items: center; color: var(--tx3); flex: none; }
.field-hint { font-size: 10.5px; color: var(--tx3); line-height: 1.45; }
.select-box { position: relative; }
.select-box select { appearance: none; cursor: pointer; padding-right: 4px; }
.select-box option { background: var(--panel); color: var(--tx); }
input[disabled], select[disabled] { color: var(--tx3); cursor: not-allowed; }

.form-col { display: flex; flex-direction: column; gap: 14px; }
.form-message { margin: 0; font-size: 11.5px; color: var(--tx3); min-height: 14px; }
.form-message.good { color: var(--pos); }
.form-message.bad { color: var(--neg); }
.form-message.warn { color: var(--c8); }

.segmented { display: flex; height: 34px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--panel); overflow: hidden; }
.seg { flex: 1; display: grid; place-items: center; padding: 0 11px; font-size: 12px; color: var(--tx3); white-space: nowrap; }
.seg + .seg { border-left: 1px solid var(--line); }
.seg:hover { color: var(--tx2); }
.seg.on { background: var(--pos-dim); color: var(--pos); font-weight: 600; box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--pos) 36%, transparent); }

.switch {
  width: 26px; height: 15px; border-radius: 999px; flex: none;
  background: var(--raise); box-shadow: inset 0 0 0 1px var(--line2);
  display: inline-flex; align-items: center; padding: 2px; transition: background 120ms ease;
}
.switch .knob { width: 11px; height: 11px; border-radius: 999px; background: var(--tx3); transition: transform 120ms ease, background 120ms ease; }
.switch.on { background: var(--pos); box-shadow: none; }
.switch.on .knob { transform: translateX(11px); background: var(--pos-ink); }

.box {
  width: 14px; height: 14px; flex: none; border-radius: var(--r1);
  border: 1px solid var(--line2); background: var(--panel2);
  display: grid; place-items: center; color: var(--pos-ink);
}
.box.on { background: var(--pos); border-color: var(--pos); }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--tx2); text-align: left; }
.check-row:hover { color: var(--tx); }

.icon-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-swatch {
  width: 34px; height: 32px; border-radius: 7px; display: grid; place-items: center;
  background: var(--panel2); box-shadow: inset 0 0 0 1px var(--line); color: var(--tx2);
}
.icon-swatch:hover { color: var(--tx); box-shadow: inset 0 0 0 1px var(--line2); }
.icon-swatch.on { background: var(--pos-dim); box-shadow: inset 0 0 0 1px var(--pos); color: var(--pos); }
.colour-picker { display: flex; gap: 8px; align-items: center; height: 32px; }
.colour-swatch { width: 22px; height: 22px; border-radius: 6px; }
.colour-swatch.on { box-shadow: 0 0 0 1px var(--panel), 0 0 0 2.5px currentColor; }

.preview-row {
  display: grid; grid-template-columns: 16px minmax(0, 1fr) auto 60px; gap: 10px; align-items: center;
  height: 34px; padding: 0 12px; border: 1px dashed var(--line2); border-radius: var(--r2); background: var(--panel2);
}

/* ------------------------------------------------------------------ drawer */

.drawer-scrim, .modal-scrim {
  position: fixed; inset: 0; z-index: 60;
  background: oklch(0.12 0.008 255 / 0.66); backdrop-filter: blur(3px);
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 70; width: min(560px, 100vw);
  display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid var(--line2);
  box-shadow: -30px 0 70px oklch(0.09 0.01 255 / 0.6);
}
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 15px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0 0 3px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.drawer-head p { margin: 0; font-size: 12px; color: var(--tx3); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 18px; }
.drawer-salary { display: flex; flex-direction: column; gap: 6px; }
.drawer-salary .field-box { height: 40px; font-size: 15px; }
.drawer-section { display: flex; flex-direction: column; gap: 9px; }
.drawer-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.drawer-rows { display: flex; flex-direction: column; gap: 6px; }
.drawer-row { display: grid; grid-template-columns: minmax(0, 1fr) 112px 132px; gap: 8px; align-items: center; }
.drawer-name { font-size: 12.5px; color: var(--tx2); }
.drawer-foot {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 20px; border-top: 1px solid var(--line); background: var(--panel2); flex-wrap: wrap;
}
.drawer-preview { display: flex; gap: 20px; }
.drawer-preview > div { display: flex; flex-direction: column; gap: 2px; }
.drawer-preview .num { font-size: 14px; font-weight: 500; }

/* ------------------------------------------------------------------- modal */

.modal {
  position: fixed; z-index: 70; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line2); border-radius: 14px;
  box-shadow: 0 40px 90px oklch(0.08 0.01 255 / 0.7); overflow: hidden;
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0 0 3px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.modal-head p { margin: 0; font-size: 12px; color: var(--tx3); max-width: 62ch; text-wrap: pretty; }
.modal-body { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.modal-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.modal-foot {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 20px; border-top: 1px solid var(--line); background: var(--panel2); flex-wrap: wrap;
}
.modal-error { margin: 0; padding: 0 20px 14px; font-size: 11.5px; color: var(--neg); background: var(--panel2); }

/* ---------------------------------------------------------- statement import */

/* Wider than the category modal: this one is a table the reader must scan. */
.modal.sheet { width: min(1080px, calc(100vw - 32px)); }

.import-controls {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
}
.field.inline { flex: 0 1 220px; }
.chip.ok-chip {
  border-color: color-mix(in oklab, var(--pos) 42%, transparent);
  background: var(--pos-dim); color: var(--pos); font-weight: 600; height: 34px;
}

.import-mapper { padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--panel2); }
.mapper-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 8px; }

.import-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 1px;
  margin: 14px 20px 0; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden;
}
.import-summary > div { display: flex; flex-direction: column; gap: 3px; padding: 9px 12px; background: var(--panel2); }
.import-summary .num { font-size: 15px; font-weight: 500; }

.modal.sheet .banner { margin: 14px 20px 0; }

.import-table { margin: 14px 20px 0; border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; }
.import-row {
  display: grid;
  grid-template-columns: 34px 58px minmax(0, 1fr) 96px minmax(0, 180px) minmax(0, 168px);
  gap: 10px; align-items: center; height: 38px; padding: 0 10px 0 4px; font-size: 12.5px;
}
.import-row.head { height: 32px; background: var(--panel2); border-bottom: 1px solid var(--line); }
.import-scroll { max-height: min(46vh, 420px); overflow-y: auto; }
.import-scroll .import-row { border-top: 1px solid color-mix(in oklab, var(--line) 55%, transparent); }
.import-scroll .import-row:first-child { border-top: 0; }
.import-row.off { opacity: 0.48; }
.import-row.blocked { background: color-mix(in oklab, var(--neg) 4%, transparent); }
.import-row:hover { background: color-mix(in oklab, var(--panel2) 55%, transparent); }

.check-cell { display: grid; place-items: center; height: 100%; }
.check-cell[disabled] { opacity: 0.35; cursor: not-allowed; }
.import-cat { min-width: 0; }
.import-note { min-width: 0; }
.import-note input {
  width: 100%; height: 26px; padding: 0 8px; font-size: 12.5px; color: var(--tx);
  border: 1px solid transparent; border-radius: var(--r1); background: transparent;
}
.import-note input:hover { border-color: var(--line); background: var(--panel2); }
.import-note input:focus { border-color: var(--pos); background: var(--panel2); box-shadow: 0 0 0 2px var(--pos-dim); }
.import-cat .field-box { height: 26px; }
.import-why { font-size: 10.5px; color: var(--tx3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-why.good { color: var(--pos); }
.import-why.warn { color: var(--c8); }

.import-foot { justify-content: space-between; }
.import-tally { display: flex; align-items: baseline; gap: 8px; }
.import-count { font-size: 19px; font-weight: 600; }

@media (max-width: 860px) {
  .import-row { grid-template-columns: 30px minmax(0, 1fr) 84px minmax(0, 150px); }
  .import-row > :nth-child(2), .import-row > :nth-child(6) { display: none; }
  .import-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* -------------------------------------------------------------------- auth */

.auth { position: relative; min-height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.auth-dots {
  position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(oklch(0.40 0.012 255) 1px, transparent 1px);
  background-size: 32px 32px; opacity: 0.26;
  mask-image: radial-gradient(920px 520px at 50% 38%, black, transparent 76%);
  -webkit-mask-image: radial-gradient(920px 520px at 50% 38%, black, transparent 76%);
}
.auth-bar {
  position: relative; z-index: 2; height: 52px; flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 24px; border-bottom: 1px solid var(--line);
}
.auth-status { display: flex; align-items: center; gap: 9px; }
.auth-status-text { font-size: 11.5px; color: var(--tx2); }
.auth-main { position: relative; z-index: 2; flex: 1; display: grid; place-items: center; padding: 24px; }
.auth-col { width: min(396px, 100%); display: flex; flex-direction: column; gap: 20px; }
.auth-intro { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }
.auth-intro h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.03em; }
.auth-intro p { margin: 0; font-size: 13px; color: var(--tx2); line-height: 1.55; text-wrap: pretty; }
.auth-card { padding: 20px; display: flex; flex-direction: column; gap: 15px; }
.auth-card .field-box { height: 38px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-note { margin: 0; font-size: 11.5px; color: var(--tx3); line-height: 1.55; text-wrap: pretty; }
.auth-note.bordered { padding-top: 12px; border-top: 1px solid var(--line); }
.auth-actions { display: flex; flex-direction: column; gap: 8px; }
.auth-offline { gap: 16px; }
.offline-head { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 10px 0 4px; }
.offline-icon { color: var(--c8); }
.offline-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.offline-head p { margin: 0; font-size: 12px; color: var(--tx2); line-height: 1.55; }
.auth-foot {
  position: relative; z-index: 2; flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 13px 24px; border-top: 1px solid var(--line);
  font-size: 10.5px; color: var(--tx3);
}

/* ------------------------------------------------------------------ confirm */

.ask-scrim {
  position: fixed; inset: 0; z-index: 100;
  background: oklch(0.10 0.008 255 / 0.72); backdrop-filter: blur(3px);
}
.ask {
  position: fixed; z-index: 101; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(460px, calc(100vw - 28px));
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line2); border-radius: 13px;
  box-shadow: 0 34px 80px oklch(0.06 0.01 255 / 0.72); overflow: hidden;
}
/* A hairline of the tone across the top, so the stakes read before the words do. */
.ask::before { content: ""; height: 2px; flex: none; }
.ask-danger::before { background: var(--neg); }
.ask-warn::before { background: var(--c8); }
.ask-neutral::before { background: var(--pos); }

.ask-head { display: flex; gap: 12px; padding: 17px 19px 13px; }
.ask-icon { flex: none; margin-top: 1px; }
.ask-danger .ask-icon { color: var(--neg); }
.ask-warn .ask-icon { color: var(--c8); }
.ask-neutral .ask-icon { color: var(--pos); }
.ask-heading { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ask-heading h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.ask-op { color: var(--tx3); font-size: 10.5px; overflow-wrap: anywhere; }

.ask-body { padding: 0 19px 15px; display: flex; flex-direction: column; gap: 13px; }
.ask-body p { margin: 0; font-size: 12.5px; color: var(--tx2); line-height: 1.55; text-wrap: pretty; }
.ask-note { font-size: 11px !important; color: var(--tx3) !important; }
.ask-facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden;
}
.ask-facts > div { display: flex; flex-direction: column; gap: 3px; padding: 9px 11px; background: var(--panel2); }
.ask-facts .num { font-size: 13px; font-weight: 500; }

.ask-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 12px 19px; border-top: 1px solid var(--line); background: var(--panel2);
}
.ask-keys { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--tx3); }
.ask-keys-sep { opacity: 0.5; }
kbd {
  font-family: var(--code); font-size: 10px; line-height: 1;
  padding: 3px 5px; border-radius: 4px;
  background: var(--raise); border: 1px solid var(--line2); color: var(--tx2);
}

.btn.danger { background: var(--neg); border-color: var(--neg); color: oklch(0.17 0.03 25); }
.btn.danger:hover { background: color-mix(in oklab, var(--neg) 88%, white); }

@media (max-width: 480px) {
  .ask-facts { grid-template-columns: minmax(0, 1fr); }
  .ask-foot { justify-content: flex-end; }
  .ask-keys { display: none; }
}

/* ------------------------------------------------------------------- toast */

.toast {
  position: fixed; z-index: 90; bottom: 22px; left: 50%; transform: translateX(-50%);
  padding: 10px 16px; border-radius: 10px; font-size: 12.5px; font-weight: 500;
  background: var(--raise); border: 1px solid var(--line2);
  box-shadow: 0 20px 44px oklch(0.09 0.01 255 / 0.55);
}
.toast.good { border-color: color-mix(in oklab, var(--pos) 45%, var(--line2)); color: var(--pos); }
.toast.bad  { border-color: color-mix(in oklab, var(--neg) 45%, var(--line2)); color: var(--neg); }
.toast.warn { border-color: color-mix(in oklab, var(--c8) 45%, var(--line2)); color: var(--c8); }

/* -------------------------------------------------------------- responsive */

/* The transaction table needs a 296px rail plus room for six columns; it gives up
   the side-by-side layout earlier than the chart grids do. */
@media (max-width: 1200px) {
  .txn-layout { grid-template-columns: minmax(0, 1fr); }
  .txn-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}

@media (max-width: 1120px) {
  .hero-grid, .split-grid, .split-grid.wide-left, .split-grid.cat-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1080px) {
  .rail { width: 64px; padding: 18px 10px; }
  .rail .brand span, .nav-item span, .nav-item .count, .nav-item .lbl, .rail-foot { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .insight-grid { grid-template-columns: minmax(0, 1fr); }
  .insight:nth-child(odd) { border-right: 0; }
  .mini-row { grid-template-columns: 56px minmax(0, 1fr) 104px; }
  .mini-row > :nth-child(4), .mini-row > :nth-child(5) { display: none; }
  .mini-row > :nth-child(3) { display: none; }
}

@media (max-width: 760px) {
  .page { padding: 16px 14px 32px; }
  .topbar { padding: 0 14px; gap: 8px; }
  .page-head h1 { font-size: 19px; }

  /* Keep the top bar on one line: the period and chips must not wrap. */
  .stepper-label { white-space: nowrap; padding: 0 9px; font-size: 11.5px; }
  .chip { white-space: nowrap; }
  .topbar .btn.pri span { display: none; }
  .topbar .btn.pri { padding: 0 10px; }

  /* Date, category chip and the row menu go; description and amount stay. */
  .txn-grid { grid-template-columns: minmax(0, 1fr) 96px; }
  .txn-grid > :nth-child(1), .txn-grid > :nth-child(3), .txn-grid > :nth-child(4), .txn-grid > :nth-child(6) { display: none; }

  /* The filter bar becomes a stack; the month range keeps its own full-width row. */
  .filter-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .filter-bar > .field-box.grow, .filter-bar > .filter-months { grid-column: 1 / -1; }
  .filter-bar .field-box.grow { min-width: 0; }
  .filter-months input { flex: 1; min-width: 0; }

  .bar-row { grid-template-columns: minmax(0, 1fr) 80px 56px; }
  .bar-row > :nth-child(2), .bar-row > :nth-child(5) { display: none; }

  /* Drag handle, range sparkline and share go; the active toggle must stay reachable. */
  .cat-row { grid-template-columns: minmax(0, 1fr) 92px 40px 26px; gap: 8px; }
  .cat-row > :nth-child(1), .cat-row > :nth-child(3), .cat-row > :nth-child(5) { display: none; }
  .cat-table { padding: 4px 12px 0; }

  .subs-row { grid-template-columns: minmax(0, 1fr) 88px 92px; gap: 10px; }
  .subs-row > :nth-child(2) { display: none; }

  /* Stack the entry row rather than dropping the account picker — hiding it
     would silently fall back to a guessed account on every mobile save. */
  .drawer-row {
    grid-template-columns: minmax(0, 1fr) 112px;
    grid-template-areas: "name amount" "source source";
    gap: 6px 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid color-mix(in oklab, var(--line) 45%, transparent);
  }
  .drawer-row > :nth-child(1) { grid-area: name; }
  .drawer-row > :nth-child(2) { grid-area: amount; }
  .drawer-row > :nth-child(3) { grid-area: source; }

  .modal-cols { grid-template-columns: minmax(0, 1fr); }
  .drawer-preview { gap: 14px; }
  .kept-value { font-size: 30px; }
}
