/* Hearth — design tokens
   Mist canvas, ink type, an evergreen brand, and one warm ember glow saved for the hearth panel. */
@font-face {
  font-family: "Manrope";
  src: url("/vendor/manrope.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
:root {
  --bg: #eef1f4;
  --panel: #ffffff;
  --panel-2: #f6f8fa;
  --border: #e1e6ec;
  --text: #172033;
  --muted: #5e6b7e;
  --faint: #95a1b2;
  --brand: #0f6e5f;
  --brand-2: #14917c;
  --brand-soft: #e2f3ef;
  --ember: #f2994a;
  --ink: #172033;
  --household: #3a7beb;
  --household-soft: #e6effd;
  --business: #9b5de5;
  --business-soft: #f1e9fc;
  --income: #12a06b;
  --expense: #e5484d;
  --warn: #c2410c;
  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 12px;
  --shadow: 0 1px 0 rgba(23, 32, 51, 0.04), 0 10px 30px -22px rgba(23, 32, 51, 0.35);
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1219;
    --panel: #151c27;
    --panel-2: #1a2331;
    --border: #243041;
    --text: #e8edf3;
    --muted: #9aa7b8;
    --faint: #66748a;
    --brand: #2fc4a8;
    --brand-2: #4fd8be;
    --brand-soft: #123a35;
    --household: #6ea0ff;
    --household-soft: #1a2a45;
    --business: #b98bf2;
    --business-soft: #2b2140;
    --income: #3dd598;
    --expense: #ff6b70;
    --warn: #ff9b5c;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1; }
a { color: var(--brand); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
h1 { font-size: 26px; margin: 0; font-weight: 750; letter-spacing: -0.025em; }
h2 { font-size: 15px; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 13px; margin: 0; font-weight: 700; color: var(--muted); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--income); }
.neg { color: var(--expense); }
.right { text-align: right; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.hidden { display: none !important; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { padding: 22px 16px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -0.03em; padding: 0 8px; }
.brand img { width: 30px; height: 30px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r-md); color: var(--muted); font-weight: 600; text-decoration: none; }
.nav a:hover { background: var(--panel); color: var(--text); }
.nav a.active { background: var(--ink); color: #fff; box-shadow: 0 8px 20px -12px rgba(23, 32, 51, 0.8); }
@media (prefers-color-scheme: dark) { .nav a.active { background: var(--brand); color: #04140f; } }
.sidebar .foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 0 8px; }
.main { padding: 26px 32px 64px; max-width: 1320px; width: 100%; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }

/* scope switch */
.scope-switch { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.scope-switch button { border: 0; background: transparent; padding: 6px 6px; border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--muted); }
.scope-switch button.on { background: var(--ink); color: #fff; }
.scope-switch button.on[data-scope="household"] { background: var(--household); }
.scope-switch button.on[data-scope="business"] { background: var(--business); }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill.household { background: var(--household-soft); color: var(--household); }
.pill.business { background: var(--business-soft); color: var(--business); }
.pill.gray { background: var(--panel-2); color: var(--muted); }
.pill.pending { background: transparent; color: var(--muted); border: 1px dashed var(--faint); }
.pill.ok { background: var(--brand-soft); color: var(--brand); }

/* ---------- surfaces ---------- */
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.split { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.span-2 { grid-column: span 2; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px 22px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.card-head a { font-size: 12.5px; margin-left: auto; }
.stat .label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 26px; font-weight: 780; letter-spacing: -0.03em; margin-top: 4px; line-height: 1.15; }
.stat .delta { font-size: 12px; margin-top: 4px; }
.chart-box { position: relative; height: 230px; }
.chart-box.tall { height: 310px; }
.chart-box.short { height: 160px; }

/* The hearth: the one bold panel on the dashboard */
.hearth { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 28px 30px; color: #eef2f7; background: var(--ink); isolation: isolate; margin-bottom: 18px; }
.hearth::before { content: ""; position: absolute; inset: auto -10% -60% auto; width: 70%; height: 140%; background: radial-gradient(closest-side, rgba(242, 153, 74, 0.55), rgba(242, 153, 74, 0.12) 55%, transparent 75%); z-index: -1; }
.hearth::after { content: ""; position: absolute; inset: -40% auto auto -15%; width: 55%; height: 120%; background: radial-gradient(closest-side, rgba(20, 145, 124, 0.35), transparent 70%); z-index: -1; }
@media (prefers-color-scheme: dark) { .hearth { background: #111a26; border: 1px solid var(--border); } }
.hearth-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) 220px minmax(0, 1fr); gap: 28px; align-items: center; }
.hearth .hello { font-size: 14px; color: rgba(238, 242, 247, 0.7); font-weight: 600; }
.hearth .big { font-size: 52px; font-weight: 800; letter-spacing: -0.045em; line-height: 1.05; margin: 6px 0 8px; }
.hearth .sub { color: rgba(238, 242, 247, 0.72); font-size: 13px; }
.hearth .chg { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); }
.hearth .chg.up { color: #7ee2b8; }
.hearth .chg.down { color: #ff9a9d; }
.hearth .donut-wrap { position: relative; height: 200px; }
.hearth .legend { display: flex; flex-direction: column; gap: 9px; }
.hearth .legend .li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: rgba(238, 242, 247, 0.85); }
.hearth .legend .li b { margin-left: auto; color: #fff; font-variant-numeric: tabular-nums; }
.hearth .split { margin-top: 18px; }
.hearth .split .bar { height: 8px; background: rgba(255, 255, 255, 0.1); border: 0; }
.hearth a { color: #9fe8d6; }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }

/* donut center label */
.donut-wrap { position: relative; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; }
.donut-center .v { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
.donut-center .l { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.hearth .donut-center .l { color: rgba(238, 242, 247, 0.6); }
.donut-row { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 22px; align-items: center; }
.legend-list { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.legend-list .li { display: flex; align-items: center; gap: 10px; font-size: 13px; min-width: 0; color: inherit; text-decoration: none; font-weight: 500; }
.legend-list .li span.n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-list .li b { margin-left: auto; font-variant-numeric: tabular-nums; }
.legend-list .li .pct { color: var(--muted); font-size: 12px; width: 38px; text-align: right; }

/* bars */
.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-item .top { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.bar-item .top .amt { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; }
.bar { height: 7px; background: var(--panel-2); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.bar.over > span { background: var(--expense); }
.bar.household > span { background: var(--household); }
.bar.business > span { background: var(--business); }
a.bar-item { color: inherit; display: block; font-weight: 500; text-decoration: none; }
a.bar-item:hover .top span:nth-child(2) { text-decoration: underline; }

/* compare */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.compare .side { border-radius: var(--r-md); padding: 14px 16px; background: var(--panel-2); }
.compare .side.household { box-shadow: inset 3px 0 0 var(--household); }
.compare .side.business { box-shadow: inset 3px 0 0 var(--business); }
.compare .k { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; }
.compare .k b { font-variant-numeric: tabular-nums; }

/* ---------- logos & avatars ---------- */
.logo { width: 34px; height: 34px; border-radius: 10px; flex: none; object-fit: contain; background: #fff; border: 1px solid var(--border); padding: 3px; }
.logo.sm { width: 22px; height: 22px; border-radius: 6px; padding: 2px; }
.logo.lg { width: 44px; height: 44px; border-radius: 13px; padding: 4px; }
.avatar { width: 34px; height: 34px; border-radius: 10px; background: var(--panel-2); display: grid; place-items: center; font-size: 16px; flex: none; }

/* ---------- tables / lists ---------- */
.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--panel); position: sticky; top: 0; z-index: 1; }
.list th.right { text-align: right; }
.list td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.list tr:last-child td { border-bottom: 0; }
.list tr.click { cursor: pointer; }
.list tr.click:hover td { background: var(--panel-2); }
.list tr.day td { background: var(--panel-2); font-size: 12px; font-weight: 700; color: var(--muted); padding: 7px 14px; }
.list tr.selected td { background: var(--brand-soft); }
.list td.amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.list.fixed { table-layout: fixed; }
.list.fixed td.amt { width: 112px; }
.merchant { display: flex; align-items: center; gap: 12px; min-width: 0; }
.merchant .name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.unrev { background: var(--brand); }

.acct-group { margin-bottom: 18px; }
.acct-group .head { display: flex; align-items: center; gap: 10px; padding: 14px 20px; font-weight: 700; border-bottom: 1px solid var(--border); }
.acct-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); cursor: pointer; }
.acct-row:last-child { border-bottom: 0; }
.acct-row:hover { background: var(--panel-2); }
.acct-row .bal { margin-left: auto; text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; font-size: 15px; }
.acct-row.is-hidden { opacity: 0.5; }

/* ---------- forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); background: var(--panel); padding: 8px 14px; border-radius: var(--r-md); cursor: pointer; font-weight: 700; font-size: 13px; white-space: nowrap; text-decoration: none; color: var(--text); }
.btn:hover { background: var(--panel-2); text-decoration: none; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #26324a; }
@media (prefers-color-scheme: dark) { .btn.primary { background: var(--brand); border-color: var(--brand); color: #04140f; } }
.btn.danger { color: var(--expense); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.input, select.input, textarea.input { border: 1px solid var(--border); background: var(--panel); border-radius: var(--r-md); padding: 8px 11px; min-width: 0; }
.input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
textarea.input { width: 100%; min-height: 70px; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12.5px; font-weight: 650; color: var(--muted); }
.field .input { width: 100%; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; cursor: pointer; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 13px; cursor: pointer; font-weight: 700; font-size: 12px; color: var(--muted); border-radius: 999px; }
.seg button.on { background: var(--ink); color: #fff; }
@media (prefers-color-scheme: dark) { .seg button.on { background: var(--brand); color: #04140f; } }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .input { height: 36px; }
.budget-input { width: 96px; text-align: right; padding: 5px 9px; }

.tabs { display: flex; gap: 6px; margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 1px solid transparent; background: none; padding: 7px 14px; cursor: pointer; font-weight: 700; color: var(--muted); border-radius: 999px; white-space: nowrap; }
.tabs button:hover { background: var(--panel); }
.tabs button.on { background: var(--panel); border-color: var(--border); color: var(--text); box-shadow: var(--shadow); }

.notice { border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--border); padding: 12px 16px; font-size: 13px; }
.notice.warn { background: #fff4e8; border-color: #f7d6b3; }
.notice.err { background: #fdeced; border-color: #f6c6c8; }
@media (prefers-color-scheme: dark) { .notice.warn { background: #2d1f12; border-color: #5a3a1c; } .notice.err { background: #2d1416; border-color: #5a2328; } }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }

.bulk { position: sticky; top: 8px; z-index: 5; display: flex; gap: 8px; align-items: center; background: var(--ink); color: #fff; padding: 9px 14px; border-radius: var(--r-md); margin-bottom: 12px; flex-wrap: wrap; }
.bulk .input { background: var(--panel); color: var(--text); height: 32px; padding: 3px 8px; }

/* ---------- modal & toast ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(13, 18, 25, 0.45); backdrop-filter: blur(3px); display: flex; justify-content: flex-end; z-index: 50; }
.backdrop.center { justify-content: center; align-items: center; }
.drawer { background: var(--panel); width: min(480px, 100%); height: 100%; overflow-y: auto; padding: 24px 26px; box-shadow: -20px 0 40px rgba(0, 0, 0, 0.18); }
.dialog { background: var(--panel); width: min(500px, calc(100% - 24px)); max-height: 90vh; overflow-y: auto; border-radius: var(--r-lg); padding: 24px 26px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.4); }
.modal-head { display: flex; align-items: center; margin-bottom: 18px; gap: 10px; }
.modal-head h2 { font-size: 18px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
#toast-root { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }
.toast.err { background: var(--expense); }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(60% 50% at 80% 90%, rgba(242, 153, 74, 0.25), transparent), radial-gradient(50% 50% at 10% 10%, rgba(20, 145, 124, 0.2), transparent), var(--bg); }
.auth .card { width: min(420px, 100%); padding: 32px; border-radius: var(--r-xl); }
.auth .brand { justify-content: center; margin-bottom: 8px; font-size: 22px; }

/* ---------- institutions ticker ---------- */
.ticker { display: flex; align-items: center; gap: 12px; height: 42px; font-size: 12.5px; overflow: hidden; margin: 0 32px; border-bottom: 1px solid var(--border); }
.ticker.empty { color: var(--muted); }
.ticker .tlabel { flex: none; padding-right: 14px; color: var(--muted); font-weight: 700; border-right: 1px solid var(--border); height: 22px; display: flex; align-items: center; }
.ticker .ttrack { flex: 1; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
.ticker .tmove { display: inline-flex; align-items: center; gap: 18px; white-space: nowrap; animation: tick linear infinite; padding-left: 18px; }
.ticker:hover .tmove { animation-play-state: paused; }
.ticker .tick { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-weight: 500; text-decoration: none; }
.ticker .tick:hover b { text-decoration: underline; }
.ticker .tmuted { color: var(--muted); }
.ticker .tsep { color: var(--faint); }
.tdot { width: 7px; height: 7px; border-radius: 50%; background: var(--income); display: inline-block; }
.tdot.attention { background: var(--warn); }
.tdot.manual { background: var(--faint); }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker .tmove { animation: none; } .ticker .ttrack { overflow-x: auto; } }

/* ---------- mobile ---------- */
.mobile-top { display: none; }
@media (max-width: 1100px) {
  .hearth-grid { grid-template-columns: minmax(0, 1fr) 200px; }
  .hearth-grid .legend { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; }
  .grid.split { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 40; transform: translateX(-100%); transition: transform .2s; height: 100%; background: var(--bg); }
  .shell.nav-open .sidebar { transform: none; box-shadow: 10px 0 30px rgba(0, 0, 0, .2); }
  .mobile-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg); position: sticky; top: 0; z-index: 30; }
  .mobile-top .scope-switch { flex: 1; max-width: 290px; margin-left: auto; }
  .main { padding: 14px 14px 60px; }
  .ticker { margin: 0 14px; }
  .ticker .tlabel { display: none; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .hide-sm { display: none !important; }
  .compare { grid-template-columns: 1fr; }
  .stat .value { font-size: 22px; }
  .hearth { padding: 22px; border-radius: 22px; }
  .hearth-grid { grid-template-columns: 1fr; gap: 18px; }
  .hearth-grid .legend { grid-template-columns: 1fr; }
  .hearth .big { font-size: 40px; }
  .hearth .donut-wrap { height: 180px; }
  .donut-row { grid-template-columns: 1fr; }
}
.content { min-width: 0; }
#ticker-slot { max-width: 1320px; }

/* points & miles */
.card.click { cursor: pointer; transition: border-color .15s, transform .15s; }
.card.click:hover { border-color: var(--brand); }
.prog { display: flex; flex-direction: column; gap: 10px; }
.prog-bal { font-size: 28px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; margin-top: 4px; }
.prog-bal .muted { font-size: 14px; font-weight: 600; letter-spacing: 0; }
.prog-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }
.prog-foot .pill { margin-left: auto; }
.pill.warnpill { background: #fff1e4; color: var(--warn); }
@media (prefers-color-scheme: dark) { .pill.warnpill { background: #3a2412; } }
.add-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 1.5px dashed var(--border); background: transparent; box-shadow: none; cursor: pointer; color: var(--muted); font-weight: 700; min-height: 180px; }
.add-card:hover { border-color: var(--brand); color: var(--brand); }
.add-card svg.i { width: 26px; height: 26px; }
.catalog { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cat-item { display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--border); background: var(--panel); border-radius: var(--r-md); padding: 10px; cursor: pointer; }
.cat-item:hover { border-color: var(--brand); background: var(--brand-soft); }
.cat-item > span { display: flex; flex-direction: column; min-width: 0; }
.cat-item b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; counter-reset: s; }
.steps > div { display: grid; grid-template-columns: 28px 1fr; column-gap: 12px; row-gap: 3px; align-items: start; }
.steps > div::before { content: counter(s); counter-increment: s; grid-row: span 3; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.steps .btn { justify-self: start; margin-top: 6px; }
.modal-head svg.i { width: 22px; height: 22px; }

/* ---------- depth: soft, layered, lit from above ---------- */
:root {
  --lift-1: 0 1px 1px rgba(23, 32, 51, 0.04), 0 2px 4px rgba(23, 32, 51, 0.04), 0 8px 16px -6px rgba(23, 32, 51, 0.08), 0 22px 40px -24px rgba(23, 32, 51, 0.22);
  --lift-2: 0 2px 2px rgba(23, 32, 51, 0.05), 0 6px 12px rgba(23, 32, 51, 0.06), 0 18px 30px -10px rgba(23, 32, 51, 0.16), 0 40px 70px -30px rgba(23, 32, 51, 0.35);
  --rim: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -1px 0 rgba(23, 32, 51, 0.03);
}
@media (prefers-color-scheme: dark) {
  :root {
    --lift-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 24px -10px rgba(0, 0, 0, 0.6);
    --lift-2: 0 2px 4px rgba(0, 0, 0, 0.45), 0 24px 48px -16px rgba(0, 0, 0, 0.75);
    --rim: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }
}
.card { background: linear-gradient(180deg, var(--panel) 0%, var(--panel) 60%, color-mix(in srgb, var(--panel) 96%, var(--bg)) 100%); border-color: color-mix(in srgb, var(--border) 70%, transparent); box-shadow: var(--rim), var(--lift-1); }
.card.click, a.card, .card[data-href] { transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
.card.click:hover, a.card:hover { transform: translateY(-3px); box-shadow: var(--rim), var(--lift-2); }
@media (prefers-reduced-motion: reduce) { .card.click:hover, a.card:hover { transform: none; } }

.hearth { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 30px 60px -28px rgba(23, 32, 51, 0.75), 0 12px 24px -12px rgba(23, 32, 51, 0.35); }
.hearth .legend { background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)); border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 18px; padding: 16px 18px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); backdrop-filter: blur(6px); }
.donut-center::before { content: ""; position: absolute; width: 56%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 70%); box-shadow: inset 0 3px 10px rgba(23, 32, 51, 0.08); z-index: -1; }
.donut-center { isolation: isolate; }
.hearth .donut-center::before { background: radial-gradient(circle at 50% 25%, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0) 70%); box-shadow: inset 0 4px 14px rgba(0, 0, 0, 0.45); }
@media (prefers-color-scheme: dark) { .donut-center::before { background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.06), transparent 70%); box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.5); } }

.btn { box-shadow: var(--rim), 0 1px 2px rgba(23, 32, 51, 0.06); }
.btn.primary { background: linear-gradient(180deg, #2a3650, var(--ink)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 6px 14px -6px rgba(23, 32, 51, 0.6); }
.btn.ghost { box-shadow: none; }
@media (prefers-color-scheme: dark) { .btn.primary { background: linear-gradient(180deg, #4fd8be, var(--brand)); } }
.nav a.active { background: linear-gradient(180deg, #2a3650, var(--ink)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 22px -10px rgba(23, 32, 51, 0.8); }
@media (prefers-color-scheme: dark) { .nav a.active { background: linear-gradient(180deg, #4fd8be, var(--brand)); } }
.seg, .scope-switch { box-shadow: inset 0 1px 2px rgba(23, 32, 51, 0.08); background: color-mix(in srgb, var(--panel) 70%, var(--bg)); }
.seg button.on, .scope-switch button.on { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 3px 8px -3px rgba(23, 32, 51, 0.5); }
.bar { box-shadow: inset 0 1px 2px rgba(23, 32, 51, 0.1); }
.bar > span { background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 60%); }
.logo { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 3px 8px -2px rgba(23, 32, 51, 0.18); }
.avatar { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 6px -2px rgba(23, 32, 51, 0.15); background: linear-gradient(180deg, var(--panel), var(--panel-2)); }
.compare .side { box-shadow: inset 0 1px 3px rgba(23, 32, 51, 0.06); }
.compare .side.household { box-shadow: inset 3px 0 0 var(--household), inset 0 1px 3px rgba(23, 32, 51, 0.06); }
.compare .side.business { box-shadow: inset 3px 0 0 var(--business), inset 0 1px 3px rgba(23, 32, 51, 0.06); }
.add-card { box-shadow: none; background: transparent; }

/* ---------- savings ---------- */
.save-list { display: flex; flex-direction: column; gap: 12px; }
.save-item { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 16px 18px; border-radius: var(--r-md); background: linear-gradient(180deg, var(--panel), var(--panel-2)); border: 1px solid var(--border); box-shadow: var(--rim), 0 4px 12px -8px rgba(23, 32, 51, 0.3); color: inherit; text-decoration: none; font-weight: 500; }
a.save-item:hover { border-color: var(--brand); text-decoration: none; }
.save-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: linear-gradient(160deg, #ffffff, #e7ecf1); box-shadow: inset 0 1px 0 #fff, inset 0 -2px 4px rgba(23, 32, 51, 0.08), 0 6px 12px -6px rgba(23, 32, 51, 0.35); }
@media (prefers-color-scheme: dark) { .save-ico { background: linear-gradient(160deg, #24303f, #19212d); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 6px 12px -6px rgba(0,0,0,.6); } }
.save-item b { display: block; font-size: 14px; font-weight: 750; }
.save-item .d { color: var(--muted); font-size: 13px; margin-top: 3px; line-height: 1.45; }
.save-amt { font-weight: 800; color: var(--income); white-space: nowrap; text-align: right; font-size: 15px; }
.save-amt small { display: block; font-weight: 600; color: var(--muted); font-size: 11px; }
.save-amt.shore { color: var(--warn); font-size: 12px; }
.alert-bar { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-md); background: linear-gradient(180deg, #fff6f6, #fdecec); border: 1px solid #f6c6c8; box-shadow: var(--rim), 0 6px 14px -10px rgba(229, 72, 77, 0.6); margin-bottom: 12px; }
.alert-bar.fee { background: linear-gradient(180deg, #fffaf3, #fff1e3); border-color: #f7d6b3; box-shadow: var(--rim), 0 6px 14px -10px rgba(242, 153, 74, 0.7); }
@media (prefers-color-scheme: dark) { .alert-bar { background: #2d1416; border-color: #5a2328; } .alert-bar.fee { background: #2d1f12; border-color: #5a3a1c; } }
.alert-bar .t { font-weight: 750; }
.alert-bar .d { color: var(--muted); font-size: 13px; margin-top: 2px; }
.alert-bar .btn { margin-left: auto; flex: none; }
.ticker .tsave { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 3px 10px; border-radius: 999px; background: linear-gradient(180deg, #e9f8f1, #d7f1e5); color: var(--brand); font-weight: 750; text-decoration: none; box-shadow: inset 0 1px 0 #fff, 0 2px 6px -2px rgba(15, 110, 95, 0.4); }
.ticker .tsave.alert { background: linear-gradient(180deg, #fff1f1, #fde0e0); color: var(--expense); }
@media (prefers-color-scheme: dark) { .ticker .tsave { background: var(--brand-soft); box-shadow: none; } .ticker .tsave.alert { background: #3a1719; } }
.sub-row .opt { font-size: 12px; color: var(--income); font-weight: 650; }
.sub-row .opt.small { color: var(--muted); font-weight: 500; }
.flag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 750; padding: 2px 8px; border-radius: 999px; background: #fdecec; color: var(--expense); }
.flag.good { background: var(--brand-soft); color: var(--brand); }
.flag.warn { background: #fff1e4; color: var(--warn); }
@media (prefers-color-scheme: dark) { .flag { background: #3a1719; } .flag.warn { background: #3a2412; } }
.usual-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); border-radius: 2px; opacity: .55; }
.bar.rel { position: relative; overflow: visible; }
.alert-wrap { max-width: 1320px; padding: 18px 32px 0; }
.alert-bar svg.i { color: var(--expense); margin-top: 2px; }
.alert-bar.fee svg.i { color: var(--warn); }
@media (max-width: 760px) { .alert-wrap { padding: 12px 14px 0; } .alert-bar { flex-wrap: wrap; } }
#alert-slot:not(:empty) + .main { padding-top: 16px; }
.spark { margin-top: 6px; }
@media (max-width: 900px) { #wi-grid { grid-template-columns: 1fr !important; } }

/* ---------- Ask Hearth ---------- */
.ask-slot { padding: 16px 32px 0; max-width: 1320px; }
.ask-bar { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 5px 6px 5px 16px; box-shadow: var(--lift-1, var(--shadow)); transition: border-color .15s, box-shadow .15s; }
.ask-bar:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft), var(--lift-1, var(--shadow)); }
.ask-bar > .i { width: 18px; height: 18px; color: var(--brand); flex: none; }
.ask-bar input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 14.5px; color: var(--text); outline: none; padding: 7px 0; }
.ask-bar input::placeholder { color: var(--faint); }
.ask-bar kbd, .card kbd { font: 600 11px var(--font); color: var(--muted); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--panel-2); }
.ask-bar .btn { border-radius: 999px; }
.ask-link { font-weight: 700; color: #9fe3d4; }
.backdrop .drawer:has(.ask-panel) { width: min(620px, 100%); }
.ask-panel .modal-head { display: flex; align-items: center; margin-bottom: 14px; }
.ask-title { display: flex; align-items: center; gap: 8px; margin: 0; }
.ask-title .i { width: 22px; height: 22px; color: var(--brand); }
.ask-panel .modal-head .btn { margin-left: auto; }
.ask-bar.in-panel { box-shadow: none; }
.ask-private { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin: 10px 4px 18px; }
.ask-private .i { width: 14px; height: 14px; color: var(--brand); }
.ask-answer h2 { font-size: 20px; margin: 4px 0 8px; letter-spacing: -0.01em; }
.ask-summary { font-size: 15px; line-height: 1.55; margin: 0 0 16px; }
.ask-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 18px; }
.ask-stats > div { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; }
.ask-stats .v { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.ask-stats .l { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.ask-sec { margin-bottom: 18px; border-left: 3px solid var(--border); padding-left: 12px; }
.ask-sec.cut { border-left-color: var(--expense); }
.ask-sec.switch { border-left-color: var(--brand); }
.ask-sec.review { border-left-color: var(--ember); }
.ask-sec h3 { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); margin-bottom: 6px; }
.ask-sec h3 .n { font-size: 11px; color: var(--muted); background: var(--panel-2); border-radius: 999px; padding: 0 7px; }
.ask-sec ul { list-style: none; margin: 0; padding: 0; }
.ask-sec li { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.ask-sec li:last-child { border-bottom: 0; }
.ask-sec li .logo { flex: none; margin-top: 2px; }
.ask-sec .txt { flex: 1; min-width: 0; }
.ask-sec .row1 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ask-sec .lab { font-weight: 700; }
.ask-sec .note { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.ask-sec .val { font-weight: 800; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.ask-sec .save { font-size: 11.5px; font-weight: 700; color: var(--brand); }
.ask-follow { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.chip { border: 1px solid var(--border); background: var(--panel); color: var(--text); font: 600 12.5px var(--font); padding: 6px 12px; border-radius: 999px; cursor: pointer; text-align: left; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.ask-claude { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; padding: 14px 16px; border-radius: var(--r-md); background: var(--panel-2); border: 1px dashed var(--border); }
.ask-claude > div:first-child { flex: 1; min-width: 200px; }
.ask-claude.open, .ask-claude.reply { display: block; border-style: solid; }
.ask-claude .row { display: flex; gap: 8px; margin-top: 10px; }
.ask-sent { white-space: pre-wrap; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin: 10px 0 0; max-height: 260px; overflow: auto; }
.ask-claude.reply .who { display: flex; align-items: center; gap: 6px; font-weight: 800; margin-bottom: 6px; }
.ask-claude.reply .who .i { width: 16px; height: 16px; color: var(--ember); }
.ask-claude.reply p { margin: 0 0 10px; line-height: 1.55; }
@media (max-width: 860px) {
  .ask-slot { padding: 6px 14px 0; }
  .ask-bar input { font-size: 16px; }
}

/* ---------- Sort uncategorized ---------- */
.sort-hero .big { font-size: 56px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; margin: 6px 0 8px; }
.sort-hero .sub { max-width: 640px; opacity: .85; line-height: 1.5; }
.sort-list { display: flex; flex-direction: column; }
.sort-item { padding: 14px 20px; border-bottom: 1px solid var(--border); transition: background .3s; }
.sort-item:last-child { border-bottom: 0; }
.sort-item.done { background: var(--brand-soft); }
.sort-done { font-weight: 700; color: var(--brand); padding: 4px 0; }
.sort-main { display: flex; align-items: flex-start; gap: 12px; }
.sort-main .logo { margin-top: 2px; flex: none; }
.sort-txt { flex: 1; min-width: 0; }
.sort-name { font-weight: 800; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sort-raw { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sort-amt { font-weight: 800; white-space: nowrap; }
.sort-act { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 0 44px; }
.sort-act select.input { max-width: 240px; padding-top: 5px; padding-bottom: 5px; }
.sort-act .check { margin: 0; }
@media (max-width: 860px) {
  .sort-act { margin-left: 0; }
  .sort-act .spacer { display: none; }
  .sort-act select.input { max-width: none; flex: 1 1 100%; width: 100%; order: -1; }
  .sort-hero .big { font-size: 44px; }
}

/* ---------- Recurring breakdown ---------- */
.card.tap { text-align: left; font: inherit; color: inherit; cursor: pointer; width: 100%; transition: transform .15s, box-shadow .15s, border-color .15s; }
.card.tap:hover, .card.tap:focus-visible { border-color: var(--brand); transform: translateY(-1px); }
.card.tap:active { transform: scale(.99); }
.tap-hint { color: var(--brand); font-weight: 700; font-size: 12.5px; }
.backdrop .drawer:has(.rb) { width: min(680px, 100%); }
.rb .modal-head { display: flex; align-items: center; margin-bottom: 12px; }
.rb .modal-head h2 { margin: 0; }
.rb .modal-head .btn { margin-left: auto; }
.rb-top { display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: center; margin-bottom: 18px; }
.rb-top .donut-wrap { position: relative; width: 220px; height: 220px; }
.rb-top .donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.rb-top .donut-center .v { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.rb-top .donut-center .l { font-size: 12px; color: var(--muted); }
.rb-legend { display: flex; flex-direction: column; gap: 2px; }
.rb-legend .li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 13.5px; }
.rb-legend .li:hover { background: var(--panel-2); }
.rb-legend .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-legend .pct { color: var(--muted); font-size: 12px; width: 34px; text-align: right; }
.rb .swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.rb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 20px; }
.rb-stats > div { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; }
.rb-stats .v { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.rb-stats .l { font-size: 12px; color: var(--muted); font-weight: 600; }
.rb-stats .good .v { color: var(--brand); }
.rb h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0 0 8px; }
.rb-actions { margin-bottom: 22px; }
.rb-action { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 8px; background: var(--panel); }
.rb-action.card { border-style: dashed; }
.rb-action .txt { flex: 1; min-width: 0; }
.rb-action .t { font-weight: 700; }
.rb-action .save { color: var(--brand); font-weight: 800; white-space: nowrap; font-size: 13px; }
.rb-ico { font-size: 18px; width: 28px; text-align: center; }
.rb-bucket { margin-bottom: 20px; scroll-margin-top: 10px; }
.rb-advice { margin: 0 0 6px; line-height: 1.45; }
.rb-bucket ul { list-style: none; margin: 0; padding: 0; }
.rb-bucket li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.rb-bucket li:last-child { border-bottom: 0; }
.rb-bucket .txt { flex: 1; min-width: 0; }
.rb-bucket .row1 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rb-bucket .lab { font-weight: 700; }
.rb-bucket .note { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.rb-bucket .btn { margin-top: 6px; }
.rb-bucket .val { font-weight: 800; white-space: nowrap; text-align: right; }
.rb-bucket .save { font-size: 11.5px; color: var(--brand); }
.vtag { font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.vtag.cut { background: rgba(224, 93, 93, .15); color: var(--expense); }
.vtag.switch { background: var(--brand-soft); color: var(--brand); }
.vtag.review { background: rgba(242, 153, 74, .16); color: var(--ember); }
.vtag.notcost { background: rgba(138, 148, 166, .18); }
@media (max-width: 640px) {
  .rb-top { grid-template-columns: 1fr; justify-items: center; }
  .rb-legend { width: 100%; }
}
.demo-band { margin: 12px 32px 0; max-width: 1320px; padding: 8px 14px; border-radius: 999px; background: rgba(242, 153, 74, .14); color: var(--ember); font-weight: 700; font-size: 13px; text-align: center; }
@media (max-width: 860px) { .demo-band { margin: 8px 14px 0; } }
