/* MoneyBat design system (docs/design.md): tokens, base, controls, the app shell, charts and pages.
   Inter with tabular numbers, an 8 point grid, a calm neutral palette with one emerald accent, light and dark as
   equals. No gradients anywhere. */
:root {
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --bg: #f6f6f3; --surface: #ffffff; --surface-2: #f1f1ed; --surface-3: #e8e8e3; --overlay: #ffffff;
  --ink: #16181d; --ink-2: #4a4f59; --ink-3: #737885; --ink-4: #a2a6ae;
  --line: rgba(22, 24, 29, .08); --line-2: rgba(22, 24, 29, .14);
  --accent: #0f7a5c; --accent-ink: #ffffff; --accent-soft: #e3f3ec; --accent-line: #0f7a5c33; --accent-text: #0b6b50;
  --pos: #12804f; --neg: #d1432f; --warn: #b7791f; --pos-soft: #e5f4ec; --neg-soft: #fbe9e6; --warn-soft: #fbf1df;
  --shadow-1: 0 1px 2px rgba(16, 18, 24, .04), 0 1px 1px rgba(16, 18, 24, .03);
  --shadow-2: 0 2px 6px rgba(16, 18, 24, .05), 0 12px 28px rgba(16, 18, 24, .07);
  --shadow-3: 0 12px 40px rgba(16, 18, 24, .18), 0 2px 8px rgba(16, 18, 24, .08);
  --r-sm: 8px; --r: 10px; --r-lg: 14px; --r-xl: 20px;
  --g-income: #15803d; --g-housing: #7c3aed; --g-bills: #0369a1; --g-food: #ea580c; --g-transport: #0d9488; --g-shopping: #db2777;
  --g-health: #dc2626; --g-personal: #4f46e5; --g-entertainment: #ca8a04; --g-financial: #475569; --g-transfer: #94a3b8; --g-other: #a8a29e;
  --chart-grid: rgba(22, 24, 29, .06); --chart-fill: rgba(15, 122, 92, .10);
  --sidebar: 248px; --tabbar: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #0e1116; --surface: #161a21; --surface-2: #1c2129; --surface-3: #262c36; --overlay: #1b2028;
  --ink: #eef0f3; --ink-2: #b9bec8; --ink-3: #8b919d; --ink-4: #5d6470; --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .13);
  --accent: #34c79a; --accent-ink: #062a1f; --accent-soft: rgba(52, 199, 154, .13); --accent-line: rgba(52, 199, 154, .35); --accent-text: #5fd9b1;
  --pos: #3fcf8e; --neg: #ff7a66; --warn: #f0b45a; --pos-soft: rgba(63, 207, 142, .12); --neg-soft: rgba(255, 122, 102, .12); --warn-soft: rgba(240, 180, 90, .12);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35); --shadow-2: 0 2px 6px rgba(0, 0, 0, .3), 0 12px 28px rgba(0, 0, 0, .35); --shadow-3: 0 16px 48px rgba(0, 0, 0, .55);
  --g-income: #4ade80; --g-housing: #a78bfa; --g-bills: #38bdf8; --g-food: #fb923c; --g-transport: #2dd4bf; --g-shopping: #f472b6;
  --g-health: #f87171; --g-personal: #818cf8; --g-entertainment: #facc15; --g-financial: #94a3b8; --g-transfer: #64748b; --g-other: #a8a29e;
  --chart-grid: rgba(255, 255, 255, .06); --chart-fill: rgba(52, 199, 154, .14); color-scheme: dark; } }
:root[data-theme="dark"] { --bg: #0e1116; --surface: #161a21; --surface-2: #1c2129; --surface-3: #262c36; --overlay: #1b2028;
  --ink: #eef0f3; --ink-2: #b9bec8; --ink-3: #8b919d; --ink-4: #5d6470; --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .13);
  --accent: #34c79a; --accent-ink: #062a1f; --accent-soft: rgba(52, 199, 154, .13); --accent-line: rgba(52, 199, 154, .35); --accent-text: #5fd9b1;
  --pos: #3fcf8e; --neg: #ff7a66; --warn: #f0b45a; --pos-soft: rgba(63, 207, 142, .12); --neg-soft: rgba(255, 122, 102, .12); --warn-soft: rgba(240, 180, 90, .12);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35); --shadow-2: 0 2px 6px rgba(0, 0, 0, .3), 0 12px 28px rgba(0, 0, 0, .35); --shadow-3: 0 16px 48px rgba(0, 0, 0, .55);
  --g-income: #4ade80; --g-housing: #a78bfa; --g-bills: #38bdf8; --g-food: #fb923c; --g-transport: #2dd4bf; --g-shopping: #f472b6;
  --g-health: #f87171; --g-personal: #818cf8; --g-entertainment: #facc15; --g-financial: #94a3b8; --g-transfer: #64748b; --g-other: #a8a29e;
  --chart-grid: rgba(255, 255, 255, .06); --chart-fill: rgba(52, 199, 154, .14); color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font: 400 14px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.015em; line-height: 1.2; }
p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
.num, .money { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum', 'cv11'; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.pos { color: var(--pos); } .neg { color: var(--neg); } .warn { color: var(--warn); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }

/* Icons (Lucide, ISC) as CSS masks so they take the current colour */
.i { display: inline-block; width: 18px; height: 18px; flex: none; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.i.sm { width: 16px; height: 16px; } .i.xs { width: 14px; height: 14px; } .i.lg { width: 22px; height: 22px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface);
  color: var(--ink); font-weight: 560; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .08s, box-shadow .15s; box-shadow: var(--shadow-1); text-decoration: none !important; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); background: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--neg); }
.btn.danger.solid { background: var(--neg); color: #fff; border-color: transparent; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn.icon { width: 40px; padding: 0; } .btn.icon.sm { width: 32px; }
.btn[aria-disabled="true"], .btn:disabled { opacity: .55; pointer-events: none; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink-4); border-top-color: var(--ink); animation: spin .7s linear infinite; }
.btn.primary.is-busy::after { border-color: rgba(255, 255, 255, .4); border-top-color: var(--accent-ink); }
@keyframes spin { to { transform: rotate(360deg); } }
.input, select.input, textarea.input { width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 560; color: var(--ink-2); }
.field small { color: var(--ink-3); font-size: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 16px; }
.switch { position: relative; width: 40px; height: 24px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg { display: inline-flex; padding: 3px; border-radius: var(--r); background: var(--surface-2); gap: 2px; }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 560; color: var(--ink-3); cursor: pointer; transition: background .15s, color .15s; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12.5px; font-weight: 560; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; border: 0; }
.chip.pos { background: var(--pos-soft); color: var(--pos); } .chip.neg { background: var(--neg-soft); color: var(--neg); } .chip.warn { background: var(--warn-soft); color: var(--warn); } .chip.accent { background: var(--accent-soft); color: var(--accent-text); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--c, var(--ink-4)); }
.cat-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 28px; padding: 0 10px 0 8px; border-radius: 99px; border: 1px solid transparent;
  background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--ink); font-size: 13px; font-weight: 520; cursor: pointer; transition: border-color .15s, background .15s; }
.cat-chip:hover { border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.cat-chip .i { color: var(--c); }
.cat-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 11px; font-weight: 600; color: var(--ink-3); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 24px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-h h2 { font-size: 15px; font-weight: 620; letter-spacing: -.01em; }
.card-h .more { margin-left: auto; font-size: 13px; font-weight: 560; color: var(--ink-3); display: inline-flex; align-items: center; gap: 4px; }
.card-h .more:hover { color: var(--ink); text-decoration: none; }
.label { font-size: 12.5px; font-weight: 560; color: var(--ink-3); letter-spacing: .01em; }
.big { font-size: 44px; font-weight: 650; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.mid { font-size: 26px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.grid { display: grid; gap: 24px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.main-side { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
@media (max-width: 1080px) { .grid.main-side, .grid.three { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) { .grid.two { grid-template-columns: minmax(0, 1fr); } .card { padding: 16px; border-radius: var(--r-lg); } .grid { gap: 16px; } .big { font-size: 36px; } }

/* ---------- the app shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 4px; padding: 20px 12px 16px; border-right: 1px solid var(--line); background: var(--bg); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; color: var(--ink); font-weight: 680; font-size: 17px; letter-spacing: -.02em; text-decoration: none !important; }
.brand svg { width: 30px; height: 30px; }
.brand b { color: var(--accent-text); font-weight: 680; }
.nav a { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 10px; border-radius: 9px; color: var(--ink-2); font-weight: 530; font-size: 14px; text-decoration: none; transition: background .12s, color .12s; position: relative; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); border: 1px solid var(--line); height: 38px; }
.nav a[aria-current="page"] .i { color: var(--accent); }
.nav a .badge[hidden] { display: none; }
.nav a .badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--neg); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 10px; }
.nav-h { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); padding: 12px 10px 6px; }
.side-foot { margin-top: auto; display: grid; gap: 8px; padding-top: 12px; }
.side-search { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-3); cursor: pointer; font-size: 13.5px; margin-bottom: 12px; width: 100%; text-align: left; }
.side-search .kbd { margin-left: auto; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; border: 0; background: transparent; width: 100%; text-align: left; }
.me:hover { background: var(--surface-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 650; flex: none; background: var(--accent-soft); color: var(--accent-text); }
.main { min-width: 0; padding: 32px 40px 64px; max-width: 1260px; width: 100%; margin: 0 auto; }
.page-h { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-h h1 { font-size: 26px; letter-spacing: -.025em; }
.page-h p { color: var(--ink-3); margin-top: 4px; }
.page-h .acts { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.topbar { display: none; }
.tabbar { display: none; }
.view { animation: rise .22s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .main { padding: 16px 16px calc(var(--tabbar) + 24px + env(safe-area-inset-bottom)); }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 20; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
  .topbar .brand { padding: 0 4px; font-size: 16px; }
  .topbar .brand svg { width: 26px; height: 26px; }
  .topbar .sp { flex: 1; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px); border-top: 1px solid var(--line); }
  .tabbar a { display: grid; place-items: center; align-content: center; gap: 3px; color: var(--ink-3); font-size: 11px; font-weight: 560; text-decoration: none; min-height: 44px; }
  .tabbar a[aria-current="page"] { color: var(--accent-text); }
  .page-h { margin-bottom: 16px; }
  .page-h h1 { font-size: 22px; }
  .page-h .acts { margin-left: 0; width: 100%; }
  .page-h .acts:not(:has(> :not(.hide-sm))) { display: none; }
}

/* ---------- lists ---------- */
.list { display: grid; grid-template-columns: minmax(0, 1fr); }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 56px; border-top: 1px solid var(--line); position: relative; background: var(--surface); transition: background .12s; }
.list > .li:first-child { border-top: 0; }
/* Lists inside a flush card line up with the card's header: amounts keep the same right margin as the header links */
.list.inset > .li, .list.inset > .swipe-wrap > .li { padding-left: 20px; padding-right: 24px; }
.li:hover { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.li .t { font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .s { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .amt { min-width: 104px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.li .amt.in { color: var(--pos); }
.li .amt.muted { color: var(--ink-3); font-weight: 500; }
.day-h { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; padding: 8px 16px; font-size: 12px; font-weight: 600; color: var(--ink-3); background: var(--surface-2); border-top: 1px solid var(--line); letter-spacing: .01em; }
.logo { width: 36px; height: 36px; border-radius: 10px; flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 700; letter-spacing: -.02em; overflow: hidden;
  background: color-mix(in srgb, var(--c, var(--ink-4)) 16%, var(--surface)); color: color-mix(in srgb, var(--c, var(--ink-3)) 80%, var(--ink)); }
.logo img { width: 100%; height: 100%; object-fit: cover; }
.logo.round { border-radius: 50%; }
.logo.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 11px; }
.tag { font-size: 11.5px; font-weight: 560; color: var(--ink-3); background: var(--surface-2); border-radius: 6px; padding: 1px 6px; }
.badge-pending { font-size: 11px; font-weight: 600; color: var(--warn); background: var(--warn-soft); border-radius: 6px; padding: 1px 6px; }
.swipe-acts { position: absolute; inset: 0 0 0 auto; display: flex; }
.swipe-acts button { width: 84px; border: 0; color: #fff; font-weight: 600; font-size: 12.5px; display: grid; place-items: center; gap: 2px; align-content: center; }
.swipe-wrap { position: relative; overflow: hidden; }
.swipe-wrap > .li { transition: transform .22s var(--ease); touch-action: pan-y; }

/* ---------- progress and budget bars ---------- */
.bar { position: relative; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--c, var(--accent)); width: 0; transition: width .7s var(--ease); transform-origin: left center; animation: bar-fill .9s var(--ease) .08s both; }
@keyframes bar-fill { from { transform: scaleX(0); } }
.bar.over > i { background: var(--neg); }
.bar.near > i { background: var(--warn); }
.bar .pace { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 2px; background: var(--ink); opacity: .55; }
.budget-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; padding: 16px; border-top: 1px solid var(--line); align-items: center; cursor: pointer; transition: background .12s; }
.budget-row:hover { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.budget-row:first-child { border-top: 0; }
.budget-row .bar { grid-column: 1 / -1; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis { fill: var(--ink-4); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.chart .area { fill: var(--chart-fill); }
.chart .scrub-line { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .scrub-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.chart .tip { position: absolute; top: 0; transform: translateX(-50%); pointer-events: none; padding: 6px 10px; border-radius: 9px; background: var(--overlay); box-shadow: var(--shadow-2); border: 1px solid var(--line);
  font-size: 12px; white-space: nowrap; opacity: 0; transition: opacity .12s; z-index: 3; }
.chart .tip b { display: block; font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.chart.scrubbing .tip { opacity: 1; }
.draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw .9s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.fade-in { animation: fadein .6s .25s var(--ease) both; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.grow-y { transform-box: fill-box; transform-origin: bottom; animation: growy .6s var(--ease) both; }
@keyframes growy { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.donut-seg { transition: opacity .15s, stroke-width .15s; cursor: pointer; }
.donut:hover .donut-seg { opacity: .45; }
.donut:hover .donut-seg:hover, .donut .donut-seg.on { opacity: 1; }
.legend { display: grid; gap: 2px; }
.legend button { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 8px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.legend button:hover, .legend button.on { background: var(--surface-2); }
.legend .pct { color: var(--ink-3); font-size: 12.5px; width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.ranges { display: inline-flex; gap: 2px; }
.ranges button { border: 0; background: transparent; height: 28px; padding: 0 10px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); cursor: pointer; font-variant-numeric: tabular-nums; }
.ranges button:hover { color: var(--ink); background: var(--surface-2); }
.ranges button[aria-pressed="true"] { color: var(--ink); background: var(--surface-2); }
.ring circle { fill: none; stroke-linecap: round; }
.ring .track { stroke: var(--surface-3); }
.ring .val { transition: stroke-dashoffset 1s var(--ease); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; } .draw { stroke-dashoffset: 0; } }

/* ---------- skeletons, empty states ---------- */
.sk { display: block; border-radius: 8px; background: var(--surface-3); position: relative; overflow: hidden; }
.sk::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: color-mix(in srgb, var(--surface) 55%, transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.empty { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 48px 24px; }
.empty svg.art { width: 132px; height: 104px; margin-bottom: 4px; }
.empty h3 { font-size: 17px; }
.empty p { color: var(--ink-3); max-width: 400px; }

/* ---------- overlays: modal, sheet, popover, toast, palette ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(10, 12, 16, .42); display: grid; place-items: center; padding: 24px; animation: fadein .16s both; }
.modal { width: min(560px, 100%); max-height: min(86vh, 900px); overflow: auto; background: var(--overlay); border-radius: var(--r-xl); box-shadow: var(--shadow-3); border: 1px solid var(--line); animation: pop .2s var(--ease) both; }
.modal.wide { width: min(760px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-h { display: flex; align-items: center; gap: 12px; padding: 20px 24px 0; }
.modal-h h2 { font-size: 18px; }
.modal-h .x { margin-left: auto; }
.modal-b { padding: 16px 24px 24px; display: grid; gap: 16px; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 0 24px 24px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .scrim { place-items: end stretch; padding: 0; }
  .modal { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; animation: sheet .26s var(--ease) both; padding-bottom: env(safe-area-inset-bottom); }
  .modal::before { content: ''; display: block; width: 40px; height: 5px; border-radius: 99px; background: var(--line-2); margin: 8px auto 0; }
  .modal-h { padding: 12px 16px 0; } .modal-b { padding: 12px 16px 16px; } .modal-f { padding: 0 16px 16px; }
  .modal-f .btn { flex: 1; }
}
@keyframes sheet { from { transform: translateY(100%); } to { transform: none; } }
.pop { position: fixed; z-index: 70; width: 300px; max-height: 380px; display: flex; flex-direction: column; background: var(--overlay); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-3); animation: pop .14s var(--ease) both; overflow: hidden; }
.pop input { border: 0; border-bottom: 1px solid var(--line); height: 44px; padding: 0 14px; background: transparent; outline: none; }
.pop .opts { overflow: auto; padding: 6px; }
.pop .opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 8px; border-radius: 8px; border: 0; background: transparent; text-align: left; cursor: pointer; font-size: 13.5px; }
.pop .opt:hover, .pop .opt.active { background: var(--surface-2); }
.pop .grp { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); padding: 10px 8px 4px; }
.toasts { position: fixed; z-index: 90; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); }
@media (max-width: 900px) { .toasts { bottom: calc(var(--tabbar) + 12px + env(safe-area-inset-bottom)); } }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: 12px; background: #1b1f26; color: #f3f4f6; box-shadow: var(--shadow-3); font-size: 13.5px; animation: pop .2s var(--ease) both; }
:root[data-theme="dark"] .toast { background: #2a303a; }
.toast.error { background: #8f2a1d; }
.toast button { margin-left: auto; border: 0; background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600; height: 30px; padding: 0 12px; border-radius: 8px; cursor: pointer; }
.palette { position: fixed; inset: 0; z-index: 80; background: rgba(10, 12, 16, .42); display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; animation: fadein .12s both; }
.palette .box { width: min(620px, 100%); background: var(--overlay); border-radius: 16px; box-shadow: var(--shadow-3); border: 1px solid var(--line); overflow: hidden; animation: pop .16s var(--ease) both; }
.palette input { width: 100%; height: 56px; border: 0; padding: 0 20px 0 52px; font-size: 16px; background: transparent; outline: none; border-bottom: 1px solid var(--line); }
.palette .q { position: relative; }
.palette .q .i { position: absolute; left: 20px; top: 19px; color: var(--ink-3); }
.palette .res { max-height: 52vh; overflow: auto; padding: 8px; }
.palette .opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 0; background: transparent; text-align: left; cursor: pointer; font-size: 14px; }
.palette .opt.active { background: var(--surface-2); }
.palette .opt .i { color: var(--ink-3); }
.palette .opt small { margin-left: auto; color: var(--ink-3); }
.palette .foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }

/* ---------- page specifics ---------- */
.nw-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.nw-head .ranges { margin-left: auto; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.kpis > div { background: var(--surface); padding: 16px 20px; display: grid; gap: 4px; min-width: 0; }
.kpis b { font-size: 20px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpis b { font-size: 17px; } .kpis > div { padding: 12px 14px; } }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.search { position: relative; flex: 1 1 320px; min-width: 240px; }
.search .i { position: absolute; left: 12px; top: 11px; color: var(--ink-3); }
.search input { padding-left: 38px; }
.bulkbar { position: sticky; top: 8px; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; margin-bottom: 12px; border-radius: 12px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-2); animation: pop .16s both; }
.bulkbar .btn { height: 32px; background: rgba(255, 255, 255, .12); color: inherit; border: 0; box-shadow: none; }
:root[data-theme="dark"] .bulkbar .btn { background: rgba(0, 0, 0, .1); }
.check { width: 18px; height: 18px; accent-color: var(--accent); flex: none; cursor: pointer; }
.detail-amt { font-size: 34px; font-weight: 650; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px 16px; align-items: center; font-size: 13.5px; }
.kv > span:nth-child(odd) { color: var(--ink-3); }
.health { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 560; }
.health::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--pos); }
.health.relink::before, .health.error::before { background: var(--neg); }
.health.syncing::before, .health.waiting::before { background: var(--warn); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.cal > div { background: var(--surface); min-height: 86px; padding: 8px; font-size: 12px; min-width: 0; }
.cal .dow { min-height: 0; padding: 8px; font-weight: 600; color: var(--ink-3); background: var(--surface-2); text-align: center; }
.cal .d { font-weight: 600; color: var(--ink-3); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.cal .today .d { color: var(--accent-text); }
.cal .off { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
.cal .ev { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 6px; margin-top: 2px; border-radius: 5px; background: color-mix(in srgb, var(--c, var(--accent)) 14%, transparent); font-size: 11.5px; font-weight: 550; }
@media (max-width: 720px) { .cal > div { min-height: 54px; padding: 4px; } .cal .ev { font-size: 0; height: 6px; padding: 0; } }
/* Ask about your money: one centred conversation column, past conversations on the left, the composer docked */
.ask { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; align-items: start; }
.ask-hist { position: sticky; top: 24px; display: grid; gap: 2px; align-content: start; max-height: calc(100dvh - 48px); overflow-y: auto; }
.ask-hist .new { justify-content: flex-start; margin-bottom: 8px; }
.ask-hist .nav-h { padding: 8px 10px 6px; }
.hist-list { display: grid; gap: 2px; }
.hitem { display: flex; align-items: center; border-radius: 9px; border: 1px solid transparent; transition: background .12s; }
.hitem:hover, .hitem.on { background: var(--surface-2); }
.hitem.on { background: var(--surface); box-shadow: var(--shadow-1); border-color: var(--line); }
.hitem .open { flex: 1; min-width: 0; display: grid; gap: 1px; text-align: left; border: 0; background: transparent; padding: 7px 10px; border-radius: 9px; cursor: pointer; color: var(--ink-2); font-size: 13.5px; }
.hitem .open b { font-weight: 540; color: var(--ink); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hitem .open small { font-size: 11.5px; color: var(--ink-4); }
.hitem .acts { display: inline-flex; gap: 0; padding-right: 2px; opacity: 0; transition: opacity .12s; }
.hitem:hover .acts, .hitem:focus-within .acts { opacity: 1; }
.hitem .acts .btn { width: 28px; height: 28px; }
.in-sheet { position: static; max-height: none; }
.in-sheet .hitem .acts { opacity: 1; }
.ask-main { display: flex; flex-direction: column; width: 100%; max-width: 720px; margin: 0 auto; min-height: calc(100dvh - 148px); }
.ask-thread { flex: 1; display: grid; align-content: start; gap: 24px; padding: 4px 0 20px; }
.ask-thread.empty { align-content: center; }
.ask-hello { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 16px 0 8px; }
.ask-hello .mark.big { width: 48px; height: 48px; margin-bottom: 8px; }
.ask-hello .mark.big svg { width: 48px; height: 48px; display: block; }
.ask-hello h2 { font-size: 24px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
.ask-hello p { color: var(--ink-3); max-width: 440px; }
.ask-sugg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 20px; width: 100%; }
.ask-sugg button { display: flex; align-items: center; gap: 12px; text-align: left; min-height: 52px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 13.5px; font-weight: 520; line-height: 1.35; cursor: pointer; box-shadow: var(--shadow-1); transition: border-color .15s, box-shadow .15s, color .15s, transform .08s; }
.ask-sugg button:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); color: var(--ink); }
.ask-sugg button:active { transform: scale(.99); }
.ask-sugg .i { color: var(--accent); flex: none; }
.mrow { position: relative; display: flex; gap: 12px; align-items: flex-start; scroll-margin-bottom: 132px; animation: rise .22s var(--ease) both; }
.mrow.me { justify-content: flex-end; }
.mrow .mark { width: 28px; height: 28px; flex: none; margin-top: 2px; }
.mrow .mark svg { width: 28px; height: 28px; display: block; }
.msg { max-width: 86%; min-width: 0; padding: 12px 16px; border-radius: 16px; line-height: 1.55; font-variant-numeric: tabular-nums; }
.msg.me { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.bot { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); border-bottom-left-radius: 5px; }
.mrow time { position: absolute; bottom: -18px; font-size: 11.5px; color: var(--ink-4); opacity: 0; transition: opacity .15s; white-space: nowrap; pointer-events: none; }
.mrow.me time { right: 4px; }
.mrow.bot time { left: 44px; }
.mrow:hover time, .mrow:focus-within time { opacity: 1; }
.md > * + * { margin-top: 8px; }
.md p.lead { font-weight: 600; }
.md ul, .md ol { padding-left: 20px; display: grid; gap: 4px; margin: 0; }
.md code { font: 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 1px 5px; border-radius: 5px; background: var(--surface-2); }
.md .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.md table { border-collapse: collapse; width: 100%; font-size: 13px; margin-top: 10px; }
.md th, .md td { padding: 6px 8px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.md th { color: var(--ink-3); font-weight: 560; font-size: 12px; border-top: 0; padding-top: 0; }
.md .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.figs { display: grid; gap: 10px; margin-top: 12px; }
.figs.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fig { display: grid; gap: 4px; min-width: 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.fig .label { font-size: 12px; font-weight: 560; color: var(--ink-3); }
.fig .val { font-size: 26px; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fig .sub { font-size: 12.5px; color: var(--ink-3); }
.fig .delta { font-size: 12.5px; }
.fig-h { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; font-weight: 560; color: var(--ink-3); margin-bottom: 4px; }
.fig-h b { color: var(--ink); font-weight: 620; font-variant-numeric: tabular-nums; }
.brow { display: grid; grid-template-columns: minmax(64px, 120px) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.brow .bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.brow .bar { height: 8px; }
.brow .bv { font-size: 12.5px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.brow .bv small { color: var(--ink-4); font-weight: 500; }
.brow .bv small.up { color: var(--warn); font-weight: 600; }
.brow.over .bar > i { background: var(--neg); }
.trend { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; align-items: end; height: 80px; margin-top: 4px; }
.trend .col { display: grid; align-content: end; justify-items: center; gap: 4px; height: 100%; }
.trend .col i { display: block; width: 100%; max-width: 36px; border-radius: 6px 6px 3px 3px; background: var(--accent); opacity: .55; transform-origin: bottom; animation: bar-up .6s var(--ease) both; }
.trend .col.last i { opacity: 1; }
.trend .col small { font-size: 11px; color: var(--ink-4); }
@keyframes bar-up { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.src { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.src a { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 8px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-size: 12px; font-weight: 560; transition: border-color .15s, color .15s; }
.src a:hover { border-color: var(--accent); color: var(--accent-text); }
.msg-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; margin: 8px -8px -6px 0; }
.msg .note { font-size: 11.5px; color: var(--ink-4); }
.msg-acts { display: flex; gap: 2px; margin-left: auto; opacity: 0; transition: opacity .15s; }
@media (pointer: coarse) { .msg-acts { opacity: 1; } }
.mrow:hover .msg-acts, .mrow:focus-within .msg-acts, .msg-acts.show { opacity: 1; }
.msg-acts button { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-3); font-size: 12px; font-weight: 560; cursor: pointer; }
.msg-acts button:hover { background: var(--surface-2); color: var(--ink); }
.typing { display: inline-flex; align-items: center; gap: 10px; min-height: 22px; color: var(--ink-3); font-size: 13px; }
.typing .dots { display: inline-flex; gap: 4px; }
.typing .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: blink 1.2s infinite ease-in-out; }
.typing .dots i:nth-child(2) { animation-delay: .2s; }
.typing .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
.ask-dock { position: sticky; bottom: 0; padding: 8px 0 12px; background: var(--bg); }
.ask-composer { display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 18px; background: var(--overlay); border: 1px solid var(--line-2); box-shadow: var(--shadow-2); transition: border-color .15s, box-shadow .15s; }
.ask-composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-2); }
.ask-composer textarea { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; resize: none; padding: 9px 0; font-size: 15px; line-height: 1.4; min-height: 24px; max-height: 168px; color: var(--ink); }
.ask-composer textarea::placeholder { color: var(--ink-4); }
.ask-composer .send { width: 40px; height: 40px; border-radius: 12px; flex: none; }
.ask-composer .send.stop { background: var(--ink); color: var(--bg); }
.ask-composer .send.stop::before { content: ''; width: 12px; height: 12px; border-radius: 3px; background: currentColor; }
.ask-composer .send.stop:hover { filter: none; background: var(--ink-2); }
.ask-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 12px; margin: 10px 0 0; font-size: 12px; color: var(--ink-4); text-align: center; }
.only-phone { display: none; }
.page-h.ask-h { align-items: center; }
@media (max-width: 900px) { .page-h.ask-h .acts { width: auto; margin-left: auto; } }
@media (max-width: 1080px) { .ask { grid-template-columns: minmax(0, 1fr); } .ask-hist { display: none; } .only-phone { display: inline-flex; } }
@media (max-width: 900px) { .ask-dock { bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); } .ask-main { min-height: calc(100dvh - var(--tabbar) - 150px); } }
@media (max-width: 720px) { .ask-sugg { grid-template-columns: minmax(0, 1fr); gap: 8px; } .ask-sugg button { min-height: 48px; } .ask-sugg button:nth-child(n+7) { display: none; } .msg { max-width: 94%; } .figs.two { grid-template-columns: minmax(0, 1fr); } .mrow .mark { display: none; } .mrow.bot time { left: 4px; } .ask-hello h2 { font-size: 21px; } .ask-hello { padding-top: 0; } .brow { grid-template-columns: minmax(56px, 96px) minmax(0, 1fr) auto; } }
.settings-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 24px; }
.settings-nav a { height: 34px; padding: 0 14px; border-radius: 99px; display: inline-flex; align-items: center; font-weight: 560; font-size: 13.5px; color: var(--ink-2); background: var(--surface-2); text-decoration: none; }
.settings-nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.set-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.set-row:first-child { border-top: 0; padding-top: 0; }
.set-row .grow b { display: block; font-weight: 580; }
.set-row .grow span { color: var(--ink-3); font-size: 13px; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; }
.notice.warn { background: var(--warn-soft); } .notice.neg { background: var(--neg-soft); } .notice.accent { background: var(--accent-soft); }
.notice .i { margin-top: 1px; flex: none; }
.progress-steps { display: grid; gap: 10px; }
.progress-steps div { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 14px; }
.progress-steps div.on { color: var(--ink); font-weight: 560; }
.progress-steps div.done { color: var(--ink-2); }
.progress-steps .st { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; display: grid; place-items: center; }
.progress-steps .on .st { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
.progress-steps .done .st { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.page-loading { display: grid; gap: 24px; }
#upload-pills { position: fixed; right: 16px; bottom: 16px; z-index: 95; display: grid; gap: 8px; }
.upload-pill { width: 260px; padding: 10px 12px; border-radius: 12px; background: var(--overlay); border: 1px solid var(--line); box-shadow: var(--shadow-2); font-size: 13px; }
.upload-pill .up-row { display: flex; gap: 8px; align-items: center; } .upload-pill .up-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-pill .up-x { border: 0; background: transparent; cursor: pointer; color: var(--ink-3); }
.upload-pill .up-bar { height: 4px; border-radius: 99px; background: var(--surface-3); margin-top: 8px; overflow: hidden; } .upload-pill .up-bar span { display: block; height: 100%; width: 0; background: var(--accent); }
@media (max-width: 720px) { .hide-sm { display: none !important; } }
@media (max-width: 900px) { .nw-body { grid-template-columns: minmax(0, 1fr) !important; gap: 20px !important; } }
@media (max-width: 720px) { .donut-wrap { grid-template-columns: minmax(0, 1fr) !important; justify-items: center; gap: 16px !important; } .donut-wrap .legend { width: 100%; } }

/* The marketing site's styles are in site.css (loaded by the public pages only). */

.bgroup { display: flex; justify-content: space-between; padding: 12px 16px 8px; font-size: 12px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); border-top: 1px solid var(--line); background: var(--surface-2); }
.bgroup:first-child { border-top: 0; }
.bgroup + .budget-row { border-top: 0; }

.show-sm { display: none; }
@media (max-width: 720px) {
  .show-sm { display: inline; }
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px; flex-wrap: wrap; }
  .filters .search { flex: 1 1 100%; }
  .filters select.input { flex: 1 1 0; min-width: 0 !important; height: 36px; font-size: 13px; padding: 0 8px; }
  .filters > .btn { flex: none; }
  .page-h .acts .btn { height: 36px; padding: 0 12px; font-size: 13px; }
  .li { padding: 12px 14px; gap: 10px; }
  .list.inset > .li, .list.inset > .swipe-wrap > .li { padding-left: 16px; padding-right: 18px; }
  .li .amt { min-width: 0; }
}

/* ---------- Overview (docs/dashboard-redesign.md) ---------- */
.page-h p .dot-sep { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); vertical-align: middle; margin: 0 10px; }
.status-link { color: var(--warn); font-weight: 600; }
:root .status-link { color: color-mix(in srgb, var(--warn) 80%, var(--ink)); }
.dash { display: grid; gap: 24px; }
.dash-full { display: grid; gap: 24px; }
.dash-cols { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(300px, 1fr); gap: 24px; align-items: start; }
.dash-col { display: grid; gap: 24px; align-content: start; min-width: 0; }
.dash-foot { display: none; }
.card-h.pad { padding: 20px 24px 4px; margin: 0; }
.card-h .count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 650; background: var(--warn-soft); color: color-mix(in srgb, var(--warn) 75%, var(--ink)); font-variant-numeric: tabular-nums; }
.pad-b { padding: 4px 24px 22px; }
.ta-r { text-align: right; }

/* Today */
.ins-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ins { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px 12px 12px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1);
  color: var(--ink); text-decoration: none !important; font-size: 13.5px; line-height: 1.4; transition: border-color .15s, transform .12s var(--ease), box-shadow .15s; }
.ins:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.ins:active { transform: scale(.99); }
.ins > .i:last-child { color: var(--ink-4); }
.ins-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--ink-2); }
.ins.pos .ins-ic { background: var(--pos-soft); color: var(--pos); }
.ins.warn .ins-ic { background: var(--warn-soft); color: var(--warn); }
.ins-t { flex: 1; min-width: 0; color: var(--ink-2); }
.ins-t b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }

/* Net worth */
.nw .big { margin-top: 6px; }
.nw h2.label { font-size: 13px; }
.nw-sub { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.nw-sub .pctv { margin-left: 6px; padding: 1px 7px; border-radius: 99px; font-size: 12px; background: color-mix(in srgb, currentColor 12%, transparent); }
.nw-body { display: grid; grid-template-columns: minmax(0, 1fr) 248px; gap: 32px; margin-top: 16px; align-items: start; }
.nw-side { display: grid; gap: 22px; padding-left: 24px; border-left: 1px solid var(--line); }
.nw-side-b { display: grid; gap: 10px; }
.nw-side-b b { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.nw-rows { display: grid; gap: 6px; }
.nw-rows .num { font-weight: 560; }
.stack-bar { display: flex; gap: 2px; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-3); }
.stack-bar.thin { height: 6px; }
.stack-bar.lg { height: 14px; gap: 3px; }
.stack-bar > i, .stack-bar > .seg-b { min-width: 3px; border: 0; padding: 0; transition: opacity .15s, filter .15s; }
.stack-bar > .seg-b { cursor: pointer; }
.stack-bar.hl > .seg-b { opacity: .35; }
.stack-bar.hl > .seg-b.on { opacity: 1; }

/* This month */
.mstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-bottom: 18px; }
.mstat { display: grid; gap: 2px; min-width: 0; align-content: start; }
.mstat b { font-size: 26px; font-weight: 650; letter-spacing: -.025em; line-height: 1.15; white-space: nowrap; }
.mstat-s { font-size: 12.5px; min-height: 18px; }
.mstat-s > span { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.mstat + .mstat { padding-left: 24px; border-left: 1px solid var(--line); }
.minibar { display: block; width: 100%; height: 4px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.minibar > i { display: block; height: 100%; border-radius: 99px; background: var(--pos); }
.minibar.lg { height: 6px; margin: 0; flex: 1; }
.minibar.lg > i { background: var(--accent); }
.chart .typical { fill: none; stroke: var(--ink-4); stroke-width: 1.75; stroke-dasharray: 4 4; stroke-linecap: round; }
.chart .today-line { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .today-label { fill: var(--ink-2); font-weight: 600; }
.chart .scrub-dot.typ { stroke: var(--ink-3); stroke-width: 2; }
.legend-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }
.legend-line > span { display: inline-flex; align-items: center; gap: 8px; }
.legend-line .k { display: inline-block; width: 16px; height: 0; border-top: 2.25px solid var(--accent); border-radius: 2px; }
.legend-line .k.dash { border-top: 2px dashed var(--ink-4); }
.legend-line .proj { margin-left: auto; }
.legend-line b { color: var(--ink); font-weight: 600; }

/* Needs attention */
.att-list { display: grid; padding: 4px 0 8px; }
.att { display: flex; align-items: center; gap: 12px; padding: 12px 20px 12px 20px; cursor: pointer; transition: background .12s, opacity .2s, transform .2s var(--ease); border-top: 1px solid var(--line); }
.att:first-child { border-top: 0; }
.att:hover { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.att.leaving { opacity: 0; transform: translateX(12px); }
.att .t { font-weight: 580; font-size: 13.5px; line-height: 1.35; }
.att .s { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; margin-top: 2px; }
.att .btn { flex: none; }
.att-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; align-self: flex-start; background: var(--surface-2); color: var(--ink-2); }
.att.high .att-ic { background: var(--neg-soft); color: var(--neg); }
.att.medium .att-ic { background: var(--warn-soft); color: var(--warn); }

/* Spending */
.sp-lead, .bu-lead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.bar-wrap { position: relative; }
.bar-tip { position: absolute; left: 0; top: -34px; padding: 4px 10px; border-radius: 8px; background: var(--overlay); border: 1px solid var(--line); box-shadow: var(--shadow-2); font-size: 12.5px; white-space: nowrap; opacity: 0; transition: opacity .12s; pointer-events: none; font-variant-numeric: tabular-nums; }
.bar-tip.show { opacity: 1; }
.sp-cols { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; margin-top: 20px; }
.sp-h { display: flex; gap: 8px; padding: 0 8px 6px; font-size: 12px; }
.cat-list, .mer-list { display: grid; }
.cat-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 72px; align-items: center; gap: 10px; min-height: 36px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; color: var(--ink); font-size: 13.5px; }
.cat-row:hover, .cat-row.on { background: var(--surface-2); }
.cat-row .dot { width: 10px; height: 10px; border-radius: 3px; }
.cat-row .nm, .mer-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.cat-row .am, .mer-row .am { font-weight: 600; }
.dl { display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; font-size: 12px; font-weight: 560; font-variant-numeric: tabular-nums; }
.dl.up { color: var(--warn); } .dl.down { color: var(--pos); }
.mer-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 8px; border-radius: 8px; color: var(--ink); text-decoration: none !important; font-size: 13.5px; }
.mer-row:hover { background: var(--surface-2); }
.mer-row .grow { display: grid; min-width: 0; }

/* Budgets: colour means something (on track green, near or ahead amber, over red), with today's even pace marked */
.bbar { position: relative; height: 8px; border-radius: 99px; background: var(--surface-3); }
.bbar > i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--pos); transform-origin: left center; animation: bar-fill .9s var(--ease) .08s both; }
.bbar.near > i, .bbar.ahead > i { background: var(--warn); }
.bbar.over > i { background: var(--neg); }
.bbar.paid > i { background: color-mix(in srgb, var(--pos) 55%, var(--surface-3)); }
.bbar .pace { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px var(--surface); }
.bu-key { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; }
.pace-k { width: 2px; height: 12px; border-radius: 2px; background: var(--ink); }
.blines { display: grid; margin: 4px -8px 0; }
.bline { display: grid; gap: 7px; padding: 12px 8px; border-radius: 10px; color: var(--ink); text-decoration: none !important; transition: background .12s; }
.bline + .bline { border-top: 1px solid var(--line); border-radius: 0; }
.bline:hover { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.bline .nm { font-weight: 560; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bline .st { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.more-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 13px; font-weight: 560; color: var(--ink-3); }
.empty.compact { padding: 16px 8px 8px; gap: 8px; }
.empty.compact svg.art { width: 96px; height: 76px; }

/* Coming up */
.li.up { color: var(--ink); text-decoration: none !important; }
.datebox { width: 44px; flex: none; display: grid; justify-items: center; padding: 4px 0; border-radius: 10px; background: var(--surface-2); line-height: 1.1; }
.datebox span { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.datebox b { font-size: 17px; font-weight: 650; }
.datebox.soon { background: var(--warn-soft); }
.datebox.soon span { color: color-mix(in srgb, var(--warn) 80%, var(--ink)); }
.up-total { display: flex; justify-content: space-between; padding: 12px 24px 16px 20px; border-top: 1px solid var(--line); font-size: 13.5px; }
.up-total b { font-weight: 650; }

/* Accounts */
.ac-list { padding-bottom: 8px; }
.ac-gh { display: flex; justify-content: space-between; padding: 14px 24px 6px 20px; font-size: 11.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.ac-gh .num { letter-spacing: 0; }
.ac { display: flex; align-items: center; gap: 12px; padding: 8px 24px 8px 20px; min-height: 52px; color: var(--ink); text-decoration: none !important; transition: background .12s; }
.ac:hover { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.ac .t { font-weight: 560; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac .s { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.ac .s.neg { color: var(--neg); font-weight: 560; }
.ac .am { font-weight: 600; font-size: 13.5px; min-width: 76px; text-align: right; }
.ac.stale .am { color: var(--ink-3); }
.ac .spark { flex: none; opacity: .95; }

/* Getting started */
.eyebrow { font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }
.onb { display: grid; gap: 24px; }
.onb-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; padding: 32px; align-items: center; }
.onb-main { display: grid; gap: 14px; }
.onb-main h2 { font-size: 26px; letter-spacing: -.025em; }
.onb-main > p { max-width: 520px; }
.onb-prog { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.onb-alt { margin-top: 4px; }
.checklist { list-style: none; margin: 4px 0 0; padding: 0; display: grid; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.checklist li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--line); min-height: 64px; }
.checklist li:first-child { border-top: 0; }
.checklist li.current { background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }
.checklist .ck { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 650; border: 1.5px solid var(--line-2); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.checklist .current .ck { border-color: var(--accent); color: var(--accent-text); }
.checklist .done .ck { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.checklist .done .t { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-4); }
.checklist .locked { color: var(--ink-3); }
.checklist .t { font-weight: 580; display: flex; align-items: center; gap: 8px; }
.checklist .s { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.checklist .opt { font-size: 11px; font-weight: 600; color: var(--ink-3); background: var(--surface-2); border-radius: 6px; padding: 1px 6px; }
.checklist .lock { color: var(--ink-4); display: grid; place-items: center; width: 32px; }
.checklist.compact { border: 0; border-radius: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.checklist.compact li { border: 1px solid var(--line); border-radius: 12px; min-height: 0; padding: 10px 12px; gap: 10px; }
.checklist.compact li:first-child { border-top: 1px solid var(--line); }
.checklist.compact .btn { height: 28px; padding: 0 10px; font-size: 12.5px; }
.onb-art { display: grid; place-items: center; }
.onb-sketch { width: 100%; max-width: 360px; display: grid; gap: 12px; padding: 20px; border-radius: var(--r-xl); background: var(--surface-2); }
.sk-card { background: var(--surface); border-radius: 12px; padding: 14px; display: grid; gap: 8px; box-shadow: var(--shadow-1); }
.sk-card svg.art { width: 100%; height: auto; max-height: 110px; }
.sk-card i { display: block; height: 8px; border-radius: 99px; background: var(--surface-3); }
.sk-card .l1 { width: 38%; } .sk-card .l2 { width: 62%; height: 14px; background: var(--ink-4); opacity: .5; }
.sk-card .bar { height: 6px; } .sk-card .b1 { width: 72%; background: var(--accent); } .sk-card .b2 { width: 40%; background: var(--warn); } .sk-card .b3 { width: 86%; } .sk-card .b4 { width: 54%; }
.sk-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.onb-trust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.trust { display: flex; gap: 12px; align-items: flex-start; padding: 4px 4px; }
.trust p { margin-top: 2px; }

/* Customize */
.cust-list { display: grid; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.cust-row { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 16px; border-top: 1px solid var(--line); min-height: 56px; background: var(--surface); }
.cust-row:first-child { border-top: 0; }
.cust-row .grow { display: grid; }
.cust-row b { font-weight: 580; }
.cust-row.off b { color: var(--ink-3); }
.cust-row .switch { margin-left: 8px; }
.cust-row .btn:disabled { opacity: .3; }

@media (max-width: 1080px) {
  .dash-cols { grid-template-columns: minmax(0, 1fr); }
  .nw-body { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .nw-side { grid-template-columns: 1fr 1fr; padding-left: 0; border-left: 0; padding-top: 16px; border-top: 1px solid var(--line); }
}
@media (max-width: 900px) {
  /* One column in the person's order: the columns dissolve and each card's order applies */
  .dash, .dash-full { gap: 16px; }
  .dash-cols, .dash-col { display: contents; }
  .dash-full { display: contents; }
  .dash-foot { display: flex; justify-content: center; margin-top: 16px; }
  .onb-hero { grid-template-columns: minmax(0, 1fr); padding: 20px; gap: 20px; }
  .onb-art { display: none; }
  .onb-trust { grid-template-columns: minmax(0, 1fr); }
  .checklist.compact { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .page-h p { font-size: 13.5px; }
  .ins-row { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; margin: 0 -16px; padding: 2px 16px 4px; scrollbar-width: none; }
  .ins-row::-webkit-scrollbar { display: none; }
  .ins { flex: 0 0 82%; scroll-snap-align: start; scroll-margin-left: 16px; }
  .card-h.pad { padding: 16px 16px 4px; }
  .pad-b { padding: 4px 16px 18px; }
  .nw .big { font-size: 36px; }
  .nw-head .ranges { margin-left: 0; width: 100%; justify-content: space-between; }
  .nw-head .ranges button { flex: 1; }
  .nw-side { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .nw-rows { display: none; }
  .mstat-s .i { display: none; }
  .mstats { gap: 12px; margin-bottom: 14px; }
  .mstat + .mstat { padding-left: 12px; }
  .mstat b { font-size: 19px; }
  .mstat .label { font-size: 12px; }
  .mstat-s { font-size: 11.5px; }
  .legend-line .proj { margin-left: 0; width: 100%; }
  .sp-cols { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .mer-list .mer-row:nth-child(n + 4) { display: none; }
  .att { padding: 12px 16px; align-items: flex-start; }
  .att .btn { align-self: center; }
  .ac { padding: 8px 16px; }
  .ac-gh { padding: 14px 16px 6px; }
  .up-total { padding: 12px 18px 14px 16px; }
  .recent .list > :nth-child(n + 6) { display: none; }
  .checklist li { padding: 12px; gap: 10px; }
  .checklist .s { display: none; }
  .checklist.compact { grid-template-columns: minmax(0, 1fr); }
  .onb-main h2 { font-size: 22px; }
}
@media (max-width: 380px) { .ac .spark { display: none; } }
.ac-note { display: flex; align-items: center; gap: 10px; margin: 8px 16px 4px; padding: 10px 12px; border-radius: 10px; background: var(--neg-soft); color: var(--neg); text-decoration: none !important; }
.ac-note .grow { display: grid; color: var(--ink); }
.ac-note b { font-weight: 600; font-size: 13.5px; }
.ac-note .tiny { color: var(--ink-2); }
.stale-tag { font-size: 11px; font-weight: 600; color: color-mix(in srgb, var(--neg) 80%, var(--ink)); background: var(--neg-soft); border-radius: 6px; padding: 0 6px; margin-right: 6px; }

/* ---------- goal planner (pages/goals.js) ---------- */
.center { text-align: center; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 560; color: var(--ink-3); margin-bottom: 12px; }
.back:hover { color: var(--ink); text-decoration: none; }
.compose { display: grid; gap: 16px; padding: 24px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.compose-h { display: flex; gap: 14px; align-items: flex-start; }
.compose-h h2 { font-size: 18px; margin-bottom: 2px; }
.compose-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-text); }
.compose-row { display: flex; gap: 10px; }
.compose-in { flex: 1; min-width: 0; height: 52px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); font-size: 16px; transition: border-color .15s, box-shadow .15s, background .15s; }
.compose-in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface); }
.compose-row .btn { height: 52px; padding: 0 22px; border-radius: 14px; font-size: 15px; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; }
.examples button { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); height: 32px; padding: 0 12px; border-radius: 99px; font-size: 13px; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.examples button:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line-2); }
.compose-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 4px; border-top: 1px solid var(--line); padding-top: 14px; }
.free-line { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-lg); background: var(--surface-2); color: var(--ink-2); font-size: 13px; }
.free-line b { color: var(--ink); font-variant-numeric: tabular-nums; }
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.goal-card { display: grid; gap: 14px; color: var(--ink); text-decoration: none !important; transition: box-shadow .15s, border-color .15s, transform .08s; }
.goal-card:hover { box-shadow: var(--shadow-2); border-color: var(--line-2); }
.goal-card:active { transform: scale(.99); }
.gc-top { display: flex; align-items: center; gap: 16px; }
.gc-name { font-weight: 640; font-size: 16px; letter-spacing: -.01em; line-height: 1.3; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.gc-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; align-self: flex-start; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); }
.gc-ic.lg { width: 40px; height: 40px; border-radius: 12px; }
.gc-plan { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.gc-foot { display: flex; align-items: center; gap: 8px; color: var(--ink-4); }
.goal-card[data-status="behind"] { border-color: color-mix(in srgb, var(--warn) 30%, var(--line)); }
.ring-wrap { position: relative; display: grid; place-items: center; flex: none; }
.ring-wrap .ring-pct { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 650; font-size: 15px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.big-ring .ring-pct { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; }
.big-ring .ring-pct b { font-size: 28px; font-weight: 680; letter-spacing: -.02em; line-height: 1.1; }
.acc-picks { display: grid; gap: 4px; max-height: 200px; overflow: auto; padding: 4px; border-radius: var(--r); border: 1px solid var(--line); }
.acc-pick { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; cursor: pointer; }
.acc-pick:hover { background: var(--surface-2); }
.draft-quote { font-size: 15px; color: var(--ink-2); font-style: italic; }
.draft-src { display: flex; align-items: center; gap: 8px; color: var(--accent-text); }
.draft-notes { margin: 0; padding: 10px 12px 10px 28px; border-radius: var(--r); background: var(--warn-soft); color: var(--ink-2); }

.plan-head { margin-bottom: 20px; display: grid; gap: 6px; }
.plan-head h1 { font-size: 26px; }
.plan-cols { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 24px; align-items: start; }
.plan-main, .plan-side { display: grid; gap: 24px; min-width: 0; }
.hero { display: flex; gap: 28px; align-items: center; }
.hero-body { display: grid; gap: 2px; min-width: 0; }
.hero-plan { margin-top: 10px; font-size: 15px; color: var(--ink-2); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; color: var(--ink-3); }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.celebrate { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--ink); }
.celebrate.pop { animation: pop .5s var(--ease); }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.cel-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent); color: var(--accent-ink); }
.checkin { display: flex; gap: 14px; align-items: flex-start; }
.ci-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--pos-soft); color: var(--pos); }
.checkin.behind { border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); }
.checkin.behind .ci-ic { background: var(--warn-soft); color: var(--warn); }
.checkin b { font-size: 16px; font-weight: 650; }
.catchup { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 14px; }
.cu { display: grid; gap: 2px; text-align: left; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s, transform .08s; color: var(--ink); }
.cu:hover { border-color: var(--accent); background: var(--accent-soft); }
.cu:active { transform: scale(.98); }
.cu b { font-size: 15px; font-variant-numeric: tabular-nums; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
.tile { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); min-width: 0; }
.tile b { font-size: 20px; font-weight: 650; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .tiny { color: var(--ink-3); }
.tile.pos .tiny { color: var(--pos); font-weight: 600; }
.plan-chart { height: 230px; margin: 16px 0 8px; }
.plan-chart .target-line { stroke: var(--ink-3); stroke-width: 1.25; stroke-dasharray: 4 4; }
.plan-chart .date-line { stroke: var(--line-2); stroke-width: 1.25; stroke-dasharray: 2 4; }
.plan-chart .base-line { fill: none; stroke: var(--ink-4); stroke-width: 1.75; stroke-dasharray: 5 5; }
.plan-chart .end-dot { fill: var(--accent); }
.plan-chart .axis.strong { fill: var(--ink-3); font-weight: 600; }
.fz-live { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; color: var(--ink-2); margin-bottom: 18px; }
.sliders { display: grid; gap: 18px; padding-top: 18px; border-top: 1px solid var(--line); margin-bottom: 14px; }
.slider output { font-weight: 650; font-variant-numeric: tabular-nums; font-size: 14px; }
.rng { position: relative; height: 28px; margin-top: 4px; }
.rng-track, .rng-fill { position: absolute; left: 0; top: 50%; height: 6px; margin-top: -3px; border-radius: 99px; pointer-events: none; }
.rng-track { right: 0; background: var(--surface-3); }
.rng-fill { width: var(--p, 0%); background: var(--accent); }
.rng input { position: relative; width: 100%; height: 28px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.rng input::-webkit-slider-runnable-track { height: 28px; background: transparent; }
.rng input::-moz-range-track { background: transparent; }
.rng input::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: 2px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); box-shadow: var(--shadow-2); transition: transform .1s; }
.rng input::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); box-shadow: var(--shadow-2); }
.rng input:active::-webkit-slider-thumb { transform: scale(1.12); }
.rng input:focus-visible { outline: none; }
.rng input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-2); }
.method { padding: 16px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); display: grid; align-content: start; }
.method.on { background: var(--accent-soft); border-color: var(--accent-line); }
.fz-rows { display: grid; gap: 0; }
.fz-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 13.5px; color: var(--ink-2); border-top: 1px solid var(--line); }
.fz-row:first-child { border-top: 0; }
.fz-row b { color: var(--ink); font-weight: 600; }
.fz-row.sum b { font-weight: 700; }
.ideas { display: grid; }
.idea { display: flex; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); transition: opacity .2s, transform .2s var(--ease); }
.idea:first-child { border-top: 0; }
.idea.leaving { opacity: 0; transform: translateX(12px); }
.idea.done .idea-t { color: var(--ink-3); }
.idea-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-text); }
.idea-t { font-size: 13.5px; line-height: 1.45; color: var(--ink); }
.idea-a { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.pad-x { padding: 4px 20px 16px; }
@media (max-width: 1080px) { .plan-cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  .compose { padding: 16px; border-radius: var(--r-lg); }
  .compose-row { flex-direction: column; }
  .compose-row .btn { width: 100%; }
  .examples { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  .examples button { flex: none; }
  .hero { gap: 18px; }
  .big-ring svg { width: 104px; height: 104px; }
  .big-ring .ring-pct b { font-size: 22px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles .tile:first-child { grid-column: 1 / -1; }
  .plan-chart { height: 190px; }
  .plan-cols, .plan-main, .plan-side { gap: 16px; }
  .idea { padding: 14px 16px; }
  .pad-x { padding: 4px 16px 16px; }
}
.fx { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.fx.pos { color: var(--pos); }
.ideas-card .card-h h2, .feas .card-h h2 { white-space: nowrap; }

/* ---------- Import statements (pages/import.js) ---------- */
.steps { display: flex; gap: 8px; list-style: none; margin: 0 0 20px; padding: 0; counter-reset: step; }
.steps li { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--ink-3); font-size: 13px; font-weight: 560; }
.steps li .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 11.5px; font-weight: 650; border: 1.5px solid var(--line-2); font-variant-numeric: tabular-nums; }
.steps li.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); border: 1px solid var(--line); }
.steps li.on .n { border-color: var(--accent); color: var(--accent-text); }
.steps li.done { color: var(--ink-2); }
.steps li.done .n { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.steps li .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-pane { padding: 24px; }
.imp-below { margin-top: 24px; }
.imp-h { font-size: 15px; font-weight: 620; letter-spacing: -.01em; margin-top: 4px; }
.imp-drop { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 44px 24px; border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.imp-drop:hover, .imp-drop.over, .imp-drop:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.imp-drop b { font-size: 16px; }
.imp-drop-ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 6px; }
.imp-formats { justify-content: center; margin-top: 8px; gap: 6px; }
.imp-tips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.imp-tip { display: flex; gap: 12px; align-items: flex-start; }
.imp-tip b { display: block; font-weight: 600; margin-bottom: 2px; }
.imp-tip-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--ink-2); }
.imp-file { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.imp-file-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface); color: var(--accent-text); border: 1px solid var(--line); }
.imp-facts { display: flex; flex-wrap: wrap; gap: 6px; min-height: 40px; align-items: center; }
.imp-match { display: grid; gap: 8px; margin-top: 12px; }
.imp-match-r { display: grid; grid-template-columns: minmax(0, 1fr) 16px minmax(220px, 1fr); align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.imp-match-r > .i { color: var(--ink-4); }
.imp-map { display: grid; gap: 16px; padding-top: 8px; border-top: 1px solid var(--line); }
.imp-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.imp-more summary { cursor: pointer; font-size: 13px; font-weight: 560; color: var(--ink-2); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.imp-more summary::before { content: ''; width: 0; height: 0; border: 5px solid transparent; border-left-color: var(--ink-3); border-right: 0; transition: transform .15s; }
.imp-more[open] summary::before { transform: rotate(90deg); }
.imp-more > .grid { margin-top: 12px; }
.imp-two { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.imp-raw { overflow: auto; border: 1px solid var(--line); border-radius: 12px; max-width: 100%; }
.imp-raw table { border-collapse: collapse; font-size: 12.5px; min-width: 100%; }
.imp-raw th, .imp-raw td { padding: 6px 10px; text-align: left; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid var(--line); }
.imp-raw th { background: var(--surface-2); font-weight: 600; color: var(--ink-2); vertical-align: bottom; }
.imp-raw td.on { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.imp-role { display: inline-block; font-size: 10.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--c, var(--ink-3)); margin-bottom: 2px; }
.imp-mini { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 13px; }
.imp-mini-h, .imp-mini-r { display: grid; grid-template-columns: 96px minmax(0, 1fr) 100px; gap: 10px; padding: 7px 12px; align-items: center; }
.imp-mini-h { background: var(--surface-2); font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.imp-mini-r { border-top: 1px solid var(--line); }
.imp-mini-r .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 540; }
.imp-mini-f { padding: 8px 12px; border-top: 1px solid var(--line); font-size: 12.5px; }
.imp-date .seg { margin-top: 8px; }
.imp-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.imp-lead { display: grid; gap: 8px; }
.imp-big { font-size: 15px; color: var(--ink-2); }
.imp-big b { font-size: 34px; font-weight: 650; letter-spacing: -.03em; color: var(--ink); margin-right: 4px; line-height: 1; }
.imp-table { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.imp-tr { display: grid; grid-template-columns: 32px 84px minmax(0, 1fr) 190px 128px 36px; gap: 10px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); min-height: 48px; transition: background .12s; }
.imp-tr:first-child { border-top: 0; }
.imp-tr.imp-th { background: var(--surface-2); font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); min-height: 40px; }
.imp-tr.skip { opacity: .5; }
.imp-tr.skip .imp-name { text-decoration: line-through; text-decoration-color: var(--ink-4); }
.imp-tr.has-warn { background: color-mix(in srgb, var(--warn-soft) 45%, var(--surface)); }
.imp-name { border: 0; background: transparent; padding: 0; text-align: left; font: inherit; font-weight: 560; color: var(--ink); cursor: text; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; border-radius: 4px; }
.imp-name:hover { color: var(--accent-text); }
.imp-flags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; min-height: 0; }
.imp-flag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.imp-flag.dup { background: var(--warn-soft); color: color-mix(in srgb, var(--warn) 80%, var(--ink)); }
.imp-flag.warn { background: var(--neg-soft); color: var(--neg); }
.imp-amt { font-weight: 600; display: grid; justify-items: end; line-height: 1.2; }
.imp-amt.pos { color: var(--pos); }
.imp-bal { font-weight: 500; color: var(--ink-3); }
.imp-more-rows { display: grid; place-items: center; padding: 12px; border-top: 1px solid var(--line); }
.imp-opts { display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.imp-opt { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-top: 1px solid var(--line); }
.imp-opt:first-child { border-top: 0; }
.imp-opt .grow b { display: block; font-weight: 580; }
.imp-done-hero { display: flex; align-items: center; gap: 20px; }
.imp-done-ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--pos-soft); color: var(--pos); flex: none; }
.imp-done-lines { display: grid; gap: 8px; color: var(--ink-2); }
.imp-done .big { font-size: 40px; }
@media (max-width: 1080px) { .imp-two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  .steps { gap: 4px; margin-bottom: 12px; }
  .steps li { padding: 8px; justify-content: center; }
  .steps li .l { display: none; }
  .steps li.on { flex: 2.2; }
  .steps li.on .l { display: inline; }
  .imp-pane { padding: 16px; }
  .imp-drop { padding: 32px 16px; }
  .imp-tips, .imp-cols, .imp-setup { grid-template-columns: minmax(0, 1fr); }
  .imp-match-r { grid-template-columns: minmax(0, 1fr); }
  .imp-match-r > .i { display: none; }
  .imp-tr { grid-template-columns: 24px 50px minmax(0, 1fr) 88px; gap: 8px; padding: 10px 10px; }
  .imp-bal { display: none; }
  .imp-tr > .num.muted.small { font-size: 12px; }
  .imp-tr.imp-th { display: none; }
  .imp-name { white-space: normal; line-height: 1.3; }
  .imp-actions .btn { flex: 1; }
  .imp-opt { flex-wrap: wrap; }
  .imp-opt select.input { width: 100%; max-width: none !important; }
  .imp-done-hero { flex-direction: column; align-items: flex-start; gap: 12px; }
  .imp-done .big { font-size: 34px; }
}

/* AI categorisation marks on transaction rows */
.ai-chip { display: inline-flex; align-items: center; height: 16px; padding: 0 5px; border-radius: 99px; font-size: 10.5px; font-weight: 650; letter-spacing: .02em; background: var(--accent-soft); color: var(--accent-text); vertical-align: 1px; cursor: default; }
.ai-suggest { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.ai-suggest .i { color: var(--accent-text); }
.ai-suggest button { border: 0; background: var(--accent-soft); color: var(--accent-text); font: inherit; font-weight: 600; height: 20px; padding: 0 8px; border-radius: 99px; cursor: pointer; }
.ai-suggest button:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.ai-progress { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
