/* ============================================================
   Personal Finance — v1.2 design system
   Warm light / deep-slate dark · selectable accent · no decorative motion
   ============================================================ */
:root {
  --bg: #f3f5f8; --surface: #ffffff; --surface-2: #eef1f5; --surface-3: #e1e6ec; --border: #e3e8ee; --border-strong: #cfd6df;
  --text: #121a24; --muted: #5f6b7a; --dim: #a7b0bc;
  --pos: #1b7f4b; --pos-soft: rgba(27, 127, 75, .1); --neg: #c4262e; --neg-soft: rgba(196, 38, 46, .08); --warn: #b25e09; --warn-soft: rgba(178, 94, 9, .1);
  --accent: #117aca; --accent-strong: #0b5fa0; --accent-soft: rgba(17, 122, 202, .1); --on-accent: #ffffff;
  --navy: #0c2c55; --navy-2: #0f3a6e;
  --radius: 12px; --radius-sm: 10px; --shadow: 0 1px 3px rgba(18, 26, 36, .08), 0 1px 1px rgba(18, 26, 36, .04); --shadow-lg: 0 20px 60px rgba(12, 44, 85, .25);
  --sidebar: 232px; --tabbar: 58px; --pad: 16px; --gap: 14px;
  --serif: "Playfair Display", "Didot", "Bodoni 72", Georgia, serif;
}
:root[data-theme="dark"] {
  --bg: #08121c; --surface: #102030; --surface-2: #16293c; --surface-3: #1f354b; --border: #1d3146; --border-strong: #2a4560;
  --text: #eef3f8; --muted: #93a4b7; --dim: #4b6077;
  --pos: #4cc38a; --pos-soft: rgba(76, 195, 138, .14); --neg: #ff6b6b; --neg-soft: rgba(255, 107, 107, .12); --warn: #f0a64a; --warn-soft: rgba(240, 166, 74, .14);
  --accent: #3d9be0; --accent-strong: #66b2ea; --accent-soft: rgba(61, 155, 224, .16); --on-accent: #ffffff;
  --navy: #0a1f3b; --navy-2: #0d2a50; --shadow: none; --shadow-lg: 0 20px 60px rgba(0, 0, 0, .7);
}
:root[data-accent="red"] { --accent: #c4262e; --accent-strong: #9e1e25; }
:root[data-accent="green"] { --accent: #1b7f4b; --accent-strong: #146239; }
:root[data-accent="orange"] { --accent: #c86a10; --accent-strong: #a0540b; }
:root[data-accent="purple"] { --accent: #6b46c1; --accent-strong: #55389b; }
:root[data-density="compact"] { --pad: 14px; --gap: 12px; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: -apple-system, "SF Pro Text", BlinkMacSystemFont, "Helvetica Neue", Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14.5px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1, "cv11" 1, "ss01" 1; letter-spacing: -.005em; }
body.modal-open { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: 21px; } h2 { font-size: 19px; } h3 { font-size: 14.5px; } h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
p { margin: 0 0 .6em; } p:last-child { margin-bottom: 0; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
small, .small { font-size: 12.5px; } .muted { color: var(--muted); } .dim { color: var(--dim); }
.pos { color: var(--pos); } .neg { color: var(--neg); } .neu { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.center { text-align: center; } .spacer { flex: 1; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
kbd { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; }
.ico { width: 19px; height: 19px; flex: none; }
.logo { width: 28px; height: 28px; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Boot ---- */
.boot { min-height: 100vh; display: grid; place-content: center; text-align: center; color: var(--muted); gap: 12px; }
.boot-logo { width: 40px; height: 40px; margin: 0 auto; border-radius: 11px; background: var(--accent); }

/* ---- Buttons & inputs ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 13px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: background-color .1s, border-color .1s; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--neg); border-color: transparent; background: var(--neg-soft); }
.btn.danger.ghost { background: transparent; }
.btn.danger:hover { background: var(--neg); color: #fff; }
.btn.small { padding: 5px 10px; font-size: 12.5px; }
.btn.lg { padding: 11px 18px; font-size: 14.5px; }
.btn.block { width: 100%; }
.btn .ico { width: 16px; height: 16px; }
.icon-btn { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); font: inherit; font-size: 15px; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.link:hover { text-decoration: underline; }
.btn-row { display: flex; gap: 8px; align-items: center; } .btn-row.wrap { flex-wrap: wrap; }
.input { width: 100%; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 14.5px; min-width: 0; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input:disabled { background: var(--surface-2); color: var(--muted); }
select.input { appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23888' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
select.input.mini { padding: 4px 26px 4px 8px; font-size: 12.5px; width: auto; max-width: 180px; }
input[type="file"].input { padding: 7px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field .label { font-size: 12px; font-weight: 700; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--dim); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid.four { grid-template-columns: repeat(4, 1fr); }
.form-grid > .field, .form-grid > div { min-width: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.form-row .field { margin-bottom: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; margin: 6px 0 12px; cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--accent); }
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: 10px; gap: 3px; }
.seg > button, .seg-opt span { padding: 7px 13px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; display: block; text-align: center; }
.seg > button.on, .seg-opt input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.radio-seg { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; margin-bottom: 14px; }
.seg-opt { position: relative; } .seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { position: relative; width: 24px; height: 24px; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; inset: 0; }
.swatch span { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--c); border: 3px solid transparent; }
.swatch input:checked + span { border-color: var(--surface); box-shadow: 0 0 0 2px var(--c); }
.radio-row { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.radio-card { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card input { accent-color: var(--accent); width: 17px; height: 17px; flex: none; }
.radio-card span { display: flex; flex-direction: column; gap: 2px; } .radio-card small { color: var(--muted); }
.radio-card.wide { grid-column: 1 / -1; }
.accent-picker { display: flex; gap: 12px; flex-wrap: wrap; }
.accent-picker label { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.accent-picker input { position: absolute; opacity: 0; }
.accent-picker i { width: 32px; height: 32px; border-radius: 50%; background: var(--c); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); }
.accent-picker input:checked + i { box-shadow: 0 0 0 2px var(--c); }
.toggle-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.toggle-list label { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13.5px; cursor: pointer; }
.toggle-list input { accent-color: var(--accent); width: 16px; height: 16px; }

/* ---- Auth ---- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 410px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 30px 26px; box-shadow: var(--shadow-lg); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; color: var(--text); font-size: 16px; }
.brand.big { font-size: 20px; justify-content: center; margin-bottom: 6px; } .brand.big .logo { width: 36px; height: 36px; }
.auth-sub { text-align: center; color: var(--muted); margin-bottom: 20px; }
.auth-title { text-align: center; margin: 10px 0 6px; }
.auth .seg { width: 100%; display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 18px; }
.pw { position: relative; } .pw .input { padding-right: 60px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.auth-err { min-height: 18px; color: var(--neg); font-size: 13px; margin: -4px 0 12px; } .auth-err.ok { color: var(--pos); }
.auth-links { text-align: center; margin-top: 14px; font-size: 13.5px; }
.auth-foot { text-align: center; color: var(--dim); font-size: 12px; margin-top: 22px; }

/* ---- Shell ---- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px; background: var(--surface); border-right: 1px solid var(--border); }
.sidebar .brand { padding: 4px 10px 16px; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px; color: var(--muted); font-weight: 700; font-size: 13.5px; }
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.on { background: var(--accent-soft); color: var(--accent); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 800; flex: none; }
.user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; } .user-meta strong { font-size: 13px; } .user-meta small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.version { font-size: 11px; color: var(--dim); padding: 0 6px; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 26px 0; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.sync-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.sync-pill:hover { color: var(--text); } .sync-pill.busy { color: var(--accent); border-color: var(--accent); }
.sync-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pos); } .sync-pill.busy .dot { background: var(--accent); } .sync-pill.stale .dot { background: var(--warn); }
.view { padding: 14px 26px 48px; display: flex; flex-direction: column; gap: var(--gap); max-width: 1220px; }
.tabbar { display: none; }

/* ---- Cards & layout ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--pad); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head .input { width: auto; padding: 5px 28px 5px 9px; font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--gap); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head .btn-row { flex-wrap: wrap; }
.greet { font-size: 22px; }
.month-nav { display: inline-flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; padding: 3px; }
.month-label { background: none; border: 0; font: inherit; font-weight: 800; font-size: 13.5px; color: var(--text); padding: 4px 8px; cursor: pointer; min-width: 140px; }
.month-nav .icon-btn { font-size: 19px; width: 28px; height: 28px; }
.banner { padding: 11px 14px; border-radius: 11px; background: var(--accent-soft); color: var(--text); font-size: 13.5px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.banner.warn { background: var(--warn-soft); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.chip.warn { background: var(--warn-soft); color: var(--warn); } .chip.ok { background: var(--pos-soft); color: var(--pos); } .chip.tiny { padding: 1px 6px; font-size: 10.5px; } .chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip .link { font-size: 12px; }
.section-title { margin: 4px 0 -6px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .07em; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.stats.compact { display: flex; gap: 26px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; gap: 1px; }
.stat-label { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat-value { font-size: 25px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stats.compact .stat-value { font-size: 19px; }
.stat-sub { font-size: 12.5px; color: var(--muted); }
.stat.accent { border-color: var(--accent); background: linear-gradient(160deg, var(--accent-soft), var(--surface) 70%); }
.delta { font-weight: 700; } .delta.up { color: var(--neg); } .delta.down { color: var(--pos); }

/* Progress rows */
.brow { display: flex; gap: 11px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border); } .brow:last-child { border-bottom: 0; }
.brow-icon { width: 32px; height: 32px; border-radius: 9px; background: color-mix(in srgb, var(--c) 16%, transparent); display: grid; place-items: center; font-size: 16px; flex: none; }
.brow-main { flex: 1; min-width: 0; } .brow-top { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 700; margin-bottom: 5px; gap: 8px; }
.bar { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar.warn span { background: var(--warn); } .bar.danger span { background: var(--neg); }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; } .list-item:last-child { border-bottom: 0; }
.li-icon { width: 32px; height: 32px; border-radius: 9px; background: color-mix(in srgb, var(--c) 16%, transparent); display: grid; place-items: center; font-size: 16px; flex: none; }
.li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; } .li-main strong { font-size: 13.5px; } .li-main small { color: var(--muted); }
.li-amt { font-weight: 800; font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 22px 12px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 5px; }
.empty-icon { font-size: 28px; } .empty h3 { color: var(--text); } .empty p { max-width: 340px; font-size: 13.5px; } .empty .btn { margin-top: 6px; }

/* CSS donut + legend */
.donut-wrap { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; }
.donut { position: relative; width: 150px; height: 150px; border-radius: 50%; background: var(--donut, var(--surface-3)); }
.donut::after { content: ""; position: absolute; inset: 20%; border-radius: 50%; background: var(--surface); }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; z-index: 1; pointer-events: none; } .donut-center small { color: var(--muted); font-size: 11.5px; } .donut-center strong { font-size: 18px; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.legend li { display: flex; align-items: center; gap: 8px; } .legend b { margin-left: auto; font-variant-numeric: tabular-nums; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.chart-wrap { position: relative; height: 230px; } .chart-wrap.tall { height: 290px; }

/* CSS bar charts (dashboard) */
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; align-items: end; height: 120px; padding-top: 6px; }
.bars .col { display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .stack { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.bars .b { width: 100%; max-width: 26px; border-radius: 4px 4px 2px 2px; background: var(--surface-3); min-height: 2px; }
.bars .b.in { background: var(--pos); } .bars .b.out { background: var(--neg); opacity: .85; } .bars .b.spend { background: var(--accent); } .bars .col.today .b.spend { background: var(--accent-strong); }
.bars .lbl { font-size: 11px; color: var(--muted); white-space: nowrap; } .bars .col.today .lbl { color: var(--text); font-weight: 800; }
.bars .val { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.legend-inline { display: flex; gap: 14px; font-size: 12px; color: var(--muted); } .legend-inline span { display: inline-flex; align-items: center; gap: 5px; } .legend-inline i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* Insights */
.insights { display: flex; flex-direction: column; gap: 8px; }
.insight { display: flex; gap: 10px; align-items: flex-start; padding: 9px 11px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; }
.insight.warn { background: var(--warn-soft); } .insight.good { background: var(--pos-soft); } .insight.bad { background: var(--neg-soft); }
.insight .ins-icon { font-size: 16px; line-height: 1.3; }
.insight a { font-weight: 700; }

/* Review queue */
.review-row { display: grid; grid-template-columns: 32px 1fr auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.review-row:last-child { border-bottom: 0; }
.review-main { min-width: 0; display: flex; flex-direction: column; } .review-main strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .review-main small { color: var(--muted); }

/* Transactions */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar .input { width: auto; min-width: 140px; }
.search { position: relative; flex: 1; min-width: 200px; } .search span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 15px; } .search .input { width: 100%; padding-left: 34px; }
.toolbar-actions { display: flex; gap: 8px; margin-left: auto; }
.summary-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); padding: 0 4px; align-items: center; }
.txn-card { padding: 4px 8px; }
.txn-day-head { display: flex; justify-content: space-between; padding: 11px 11px 3px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.txn { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 11px; border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; border-radius: 10px; cursor: pointer; position: relative; }
.txn:hover { background: var(--surface-2); }
.txn-icon { width: 36px; height: 36px; border-radius: 10px; background: color-mix(in srgb, var(--c) 16%, transparent); display: grid; place-items: center; font-size: 17px; flex: none; }
.txn-main { flex: 1; min-width: 0; display: flex; flex-direction: column; } .txn-payee { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; } .txn-sub { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.txn-amt { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.txn-list.compact .txn { padding: 7px 6px; } .txn-list.compact .txn-icon { width: 32px; height: 32px; font-size: 15px; }
.newdot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; display: inline-block; }

/* Budget */
.rta { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; border-left: 4px solid var(--accent); }
.rta > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.rta.neg { border-left-color: var(--neg); } .rta.neg .stat-value { color: var(--neg); } .rta.zero { border-left-color: var(--pos); }
.rta .stat-value { font-size: 30px; }
.rta-meta { display: flex; gap: 20px; flex-wrap: wrap; } .rta-meta span { display: flex; flex-direction: column; } .rta-meta small { color: var(--muted); font-size: 11.5px; } .rta-meta b { font-size: 14.5px; font-variant-numeric: tabular-nums; }
.budget-table { padding: 0; overflow: hidden; }
.bhead, .bgroup-head, .bline { display: grid; grid-template-columns: 1fr 125px 115px 125px; gap: 12px; align-items: center; padding: 9px 16px; }
.bhead { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.bgroup-head { background: var(--surface-2); font-weight: 800; font-size: 13px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.bgroup:first-of-type .bgroup-head { border-top: 0; }
.bline { border-bottom: 1px solid var(--border); } .bline:last-child { border-bottom: 0; }
.bline-name { display: flex; align-items: center; gap: 11px; min-width: 0; } .bline-name > span:last-child { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 13.5px; }
.bline-name .bar { height: 5px; }
.bline-input { position: relative; } .bline-input .prefix { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
.budget-input { padding: 7px 10px 7px 22px; text-align: right; font-weight: 700; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-weight: 800; font-size: 12.5px; background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums; }
.pill.ok { background: var(--pos-soft); color: var(--pos); } .pill.danger { background: var(--neg-soft); color: var(--neg); }

/* Accounts */
.acct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--gap); }
.acct { border-top: 3px solid var(--c); } .acct.archived { opacity: .6; }
.acct-top { display: flex; align-items: center; gap: 8px; } .acct-top strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-bal { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 5px 0 6px; font-variant-numeric: tabular-nums; }
.acct-linked { display: flex; align-items: center; gap: 8px; margin: -2px 0 8px; flex-wrap: wrap; }
.acct-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* Calendar */
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-head span { text-align: center; font-size: 11px; color: var(--muted); font-weight: 700; padding: 2px 0 6px; }
.cal-cell { min-height: 54px; border-radius: 7px; background: var(--surface-2); padding: 4px; font-size: 11px; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cal-cell.pad { background: transparent; } .cal-cell.today { outline: 2px solid var(--accent); }
.cal-d { font-weight: 800; color: var(--muted); font-size: 11px; }
.cal-item { background: var(--surface); border-left: 3px solid var(--neg); padding: 1px 4px; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-item.pos { border-left-color: var(--pos); } .cal-item.posted { opacity: .55; text-decoration: line-through; }
.cal-more { color: var(--muted); }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; } .table tr:last-child td { border-bottom: 0; }
.table.small td, .table.small th { padding: 6px 8px; font-size: 12.5px; }
.dim-row { opacity: .5; }
.table .btn-row, .table td .btn { display: inline-flex; }

/* Goals */
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--gap); }
.goal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ring { width: 70px; height: 70px; flex: none; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 8; }
.ring-fg { fill: none; stroke: var(--c); stroke-width: 8; stroke-linecap: round; }
.ring text { transform: rotate(90deg); transform-origin: 40px 40px; font-size: 22px; }
.goal-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; } .goal-meta strong { font-size: 14.5px; } .goal-pct { font-size: 21px; font-weight: 800; color: var(--c); }
.goal-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.goal-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--gap); }
.goal-mini { display: flex; gap: 11px; align-items: center; } .goal-mini > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; } .goal-mini small { color: var(--muted); }
.goal-mini-icon { width: 38px; height: 38px; border-radius: 11px; background: color-mix(in srgb, var(--c) 16%, transparent); display: grid; place-items: center; font-size: 19px; flex: none; }

/* Settings */
.settings { display: flex; flex-direction: column; gap: var(--gap); max-width: 780px; }
.settings .card h3 { margin-bottom: 10px; }
.settings .card h3 small { font-weight: 500; color: var(--muted); margin-left: 6px; }
.danger-zone { border-color: var(--neg-soft); }
.rule-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; } .rule-row:last-child { border-bottom: 0; }
.rule-row code { background: var(--surface-2); padding: 2px 6px; border-radius: 5px; font-size: 12.5px; }

/* Modals */
.modal-backdrop { position: fixed; inset: 0; background: rgba(12, 14, 20, .5); display: grid; place-items: center; padding: 20px; z-index: 50; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 40px); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.modal.wide { max-width: 760px; } .modal.onboard { max-width: 560px; } .modal.sheet { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.modal-body { padding: 14px 20px 20px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 8px; }
.amount-field { position: relative; margin-bottom: 14px; }
.amount-field .prefix { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 22px; font-weight: 800; color: var(--muted); }
.amount-field .input { font-size: 28px; font-weight: 800; padding: 10px 14px 10px 36px; letter-spacing: -.02em; }
.lead { font-size: 14.5px; color: var(--muted); margin-bottom: 14px; }
.onboard-tips { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; } .onboard-tips li { margin-bottom: 4px; }
.cat-add { background: var(--surface-2); border-radius: 11px; padding: 13px; display: flex; flex-direction: column; gap: 8px; } .cat-add .form-grid { margin-top: 4px; } .cat-add .field { margin-bottom: 6px; } .cat-add .btn { align-self: flex-start; }
.cat-group { margin-bottom: 12px; } .cat-group h4 { margin-bottom: 6px; }
.cat-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); } .cat-row:last-child { border-bottom: 0; } .cat-name { flex: 1; font-weight: 700; font-size: 13.5px; }
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.more-item { display: flex; align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--border); border-radius: 11px; color: var(--text); font-weight: 700; } .more-item:hover { background: var(--surface-2); text-decoration: none; }

/* Toasts */
#toast-root { position: fixed; right: 20px; top: 16px; display: flex; flex-direction: column; gap: 6px; z-index: 60; width: min(400px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; }
.toast { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 11px; background: var(--text); color: var(--bg); font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg); }
.toast span { flex: 1; } .toast.error { background: var(--neg); color: #fff; } .toast.warn { background: var(--warn); color: #1a1200; }
.toast.out { opacity: 0; }
.toast-undo { background: rgba(255, 255, 255, .2); border: 0; color: inherit; font: inherit; font-weight: 800; padding: 4px 10px; border-radius: 7px; cursor: pointer; }
.toast-x { background: none; border: 0; color: inherit; opacity: .7; font: inherit; cursor: pointer; }

/* ---- Responsive ---- */
@media (max-width: 1080px) { .stats { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 14px 16px 0; } .topbar h1 { font-size: 19px; }
  .view { padding: 12px 16px calc(var(--tabbar) + 28px + env(safe-area-inset-bottom)); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .card { padding: 15px; border-radius: 13px; }
  .greet { font-size: 19px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--border); z-index: 40; }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font: inherit; font-size: 10.5px; font-weight: 700; background: none; border: 0; cursor: pointer; }
  .tabbar a.on, .tabbar button.on { color: var(--accent); }
  .tabbar .tab-add { align-self: center; justify-self: center; width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: var(--on-accent); margin-top: -20px; }
  .tabbar .tab-add .ico { width: 22px; height: 22px; }
  .bhead { display: none; }
  .bgroup-head, .bline { grid-template-columns: 1fr 100px; }
  .bgroup-head .num:nth-child(3), .bgroup-head .num:nth-child(4) { display: none; }
  .bline-spent { display: none; }
  .bline-avail { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--muted); }
  .bline-avail::before { content: "Available"; }
  .form-grid, .form-grid.four { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .rta .stat-value { font-size: 26px; }
  .toolbar .input { flex: 1; }
  .toolbar-actions { width: 100%; margin-left: 0; } .toolbar-actions .btn { flex: 1; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { max-width: none; border-radius: 16px 16px 0 0; max-height: 92vh; }
  .month-label { min-width: 120px; }
  .review-row { grid-template-columns: 32px 1fr auto; } .review-row .review-cat { grid-column: 2 / -1; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  #toast-root { top: auto; right: auto; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar) + 14px + env(safe-area-inset-bottom)); }
}
@media (max-width: 480px) { .stats { grid-template-columns: 1fr 1fr; gap: 10px; } .stat-value { font-size: 20px; } .bars { gap: 4px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }


/* ============================================================
   v1.3 — Pro dashboard components
   ============================================================ */
.card { border-radius: var(--radius); }
.card-head h3 { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; gap: 8px; }
.card-head .link { font-size: 12.5px; }
.count { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: var(--on-accent); letter-spacing: 0; }
.topbar h1 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }

/* Hero: net worth */
.hero { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 18px 18px 12px; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.hero-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.hero-value { font-size: 38px; font-weight: 750; letter-spacing: -.035em; line-height: 1.1; margin: 4px 0 4px; font-variant-numeric: tabular-nums; }
.hero-sub { font-size: 13.5px; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.chg { font-weight: 700; font-variant-numeric: tabular-nums; } .chg.pos { color: var(--pos); } .chg.neg { color: var(--neg); }
.hero-chart { position: relative; height: 150px; margin: 10px -4px 6px; touch-action: pan-y; cursor: crosshair; }
.hero-chart svg { width: 100%; height: 100%; display: block; }
.scrub-line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border-strong); pointer-events: none; }
.scrub-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 3px var(--surface); pointer-events: none; }
.range-tabs { display: flex; gap: 4px; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 10px; }
.range-tabs button { flex: 1; background: none; border: 0; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 700; padding: 6px 0; border-radius: 8px; cursor: pointer; }
.range-tabs button.on { background: var(--surface-2); color: var(--text); }

/* KPI strip (horizontal scroll on phones) */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.kpi { position: relative; display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 15px; min-width: 0; color: var(--text); overflow: hidden; }
a.kpi:hover { text-decoration: none; border-color: var(--accent); }
.kpi.accent { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: linear-gradient(160deg, var(--accent-soft), var(--surface) 75%); }
.kpi-label { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.kpi-value { font-size: 22px; font-weight: 750; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; font-weight: 600; } .kpi-sub.neg { color: var(--neg); }
.kpi .spark { position: absolute; right: 12px; top: 14px; width: 70px; height: 24px; opacity: .9; }
.spark { display: block; }

.month-row { display: flex; align-items: center; gap: 12px; }
.dash-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: var(--gap); align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

/* Pace chart */
.pace-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.big-num { font-size: 24px; font-weight: 750; letter-spacing: -.025em; }
.pace-top .chg { font-size: 12.5px; }
svg.chart { width: 100%; height: 120px; display: block; }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }
.chart-legend i.dash { background: repeating-linear-gradient(90deg, var(--dim) 0 3px, transparent 3px 6px); }
.card-head .chart-legend { margin: 0; }

/* Accounts list */
.acct-group + .acct-group { margin-top: 10px; }
.acct-group-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 0 6px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.acct-row { display: grid; grid-template-columns: 10px 1fr 64px auto; gap: 10px; align-items: center; width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.acct-row:last-child { border-bottom: 0; }
.acct-row:hover .acct-name { color: var(--accent); }
.acct-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.acct-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .acct-name small { color: var(--dim); font-weight: 500; }
.acct-row .spark { width: 64px; height: 22px; }
.acct-amt { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }

/* Category bars */
.catbars { display: flex; flex-direction: column; gap: 4px; }
.catbar { display: grid; grid-template-columns: 130px 1fr 64px; gap: 10px; align-items: center; background: none; border: 0; padding: 6px 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; border-radius: 6px; }
.catbar:hover .catbar-label { color: var(--accent); }
.catbar-label { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catbar-track { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.catbar-track span { display: block; height: 100%; border-radius: 999px; }
.catbar-amt { text-align: right; font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; }

/* Budget rows: compact */
.brow { padding: 8px 0; }
.brow-top { font-size: 13.5px; } .brow-top .neg { color: var(--neg); font-weight: 700; }

/* Upcoming date chip */
.date-chip { width: 38px; height: 40px; border-radius: 10px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; flex: none; }
.date-chip b { font-size: 15px; } .date-chip small { font-size: 10px; color: var(--muted); text-transform: uppercase; margin-top: 2px; }

/* Review rows */
.review-row { grid-template-columns: 1fr auto; gap: 4px 10px; }
.review-row .review-cat { grid-column: 1 / -1; }
.review-row .input.mini { width: 100%; max-width: none; }

/* Insights: quieter */
.insight { background: var(--surface-2); border: 1px solid var(--border); }
.insight.warn { background: var(--warn-soft); border-color: transparent; } .insight.good { background: var(--pos-soft); border-color: transparent; } .insight.bad { background: var(--neg-soft); border-color: transparent; }
.insight .ins-icon { width: 18px; text-align: center; font-weight: 800; }

/* Bars (cash flow) */
.bars { height: 130px; }
.bars .b.in { background: var(--pos); } .bars .b.out { background: var(--neg); opacity: .9; }

/* Shell refinements */
.sidebar { background: var(--bg); }
.nav-link.on { background: var(--surface-2); color: var(--text); }
.nav-link.on .ico { color: var(--accent); }
.btn.primary { box-shadow: none; }
.txn-icon { border-radius: 12px; }
.txn-amt.pos, .li-amt.pos { color: var(--pos); }
.banner { border: 1px solid var(--border); background: var(--surface); }
.banner.warn { background: var(--warn-soft); border-color: transparent; }

@media (max-width: 1080px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .topbar { position: sticky; top: 0; z-index: 30; background: var(--bg); padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
  .topbar h1 { font-size: 18px; }
  .view { padding-top: 4px; }
  .dash-grid { grid-template-columns: 1fr; }
  .hero { border-radius: 18px; padding: 16px 14px 10px; }
  .hero-value { font-size: 34px; }
  .hero-chart { height: 130px; }
  .kpis { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .kpis::-webkit-scrollbar { display: none; }
  .kpi { flex: 0 0 64%; scroll-snap-align: start; }
  .catbar { grid-template-columns: 110px 1fr 58px; }
  .tabbar { background: var(--surface); }
}

/* Tabs (who owes you) */
.who { margin: 2px 0 12px; } .who .label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; } .who .hint { display: block; font-size: 12px; color: var(--dim); margin-top: 6px; }
.who-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.who-chips label { position: relative; cursor: pointer; } .who-chips input { position: absolute; opacity: 0; }
.who-chips span, .who-add { display: inline-block; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 13.5px; font-weight: 600; background: var(--surface); color: var(--text); }
.who-chips input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.who-add { border-style: dashed; color: var(--muted); cursor: pointer; font: inherit; font-size: 13.5px; }
.tab-card { display: flex; flex-direction: column; gap: 14px; }
.tab-head { display: flex; align-items: center; gap: 12px; } .tab-who { flex: 1; display: flex; flex-direction: column; } .tab-who strong { font-size: 16px; }
.tab-avatar { width: 44px; height: 44px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; font-size: 22px; flex: none; } .tab-avatar.sm { width: 34px; height: 34px; font-size: 17px; border-radius: 10px; }
.tab-balance { display: flex; flex-direction: column; gap: 2px; } .tab-amt { font-size: 36px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tab-ledger { border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.tab-line, .pick { display: grid; grid-template-columns: 62px 1fr auto 86px; gap: 10px; align-items: center; width: 100%; padding: 10px 0; border: 0; border-bottom: 1px dashed var(--border-strong); background: none; color: var(--text); font: inherit; text-align: left; }
button.tab-line { cursor: pointer; } button.tab-line:hover .tab-desc { color: var(--accent); }
.pick { grid-template-columns: 22px 62px 1fr auto; cursor: pointer; } .pick input { width: 18px; height: 18px; accent-color: var(--accent); }
.pick-list { max-height: 52vh; overflow-y: auto; }
.tab-date { font-size: 12px; color: var(--muted); } .tab-desc { font-weight: 600; font-size: 14px; display: flex; flex-direction: column; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .tab-desc small { color: var(--dim); font-weight: 500; font-size: 12px; }
.tab-num { font-weight: 700; } .tab-run { text-align: right; color: var(--muted); font-size: 13px; display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
.icon-btn.tiny { width: 22px; height: 22px; font-size: 11px; }
.tab-mini { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); } .tab-mini:last-child { border-bottom: 0; }
.tab-mini-amt { font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .tab-line { grid-template-columns: 54px 1fr auto; } .tab-run { display: none; } .pick { grid-template-columns: 22px 1fr auto; } .pick .tab-date { display: none; } }

/* Business / personal */
.scope-switch { display: inline-flex; padding: 3px; gap: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; align-self: flex-start; }
.scope-switch button { border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; padding: 6px 14px; border-radius: 9px; cursor: pointer; }
.scope-switch button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.chip.biz { background: rgba(255, 176, 32, .16); color: var(--warn); }
button.chip { border: 0; cursor: pointer; font: inherit; font-size: 10.5px; font-weight: 700; }


/* ============================================================
   v2.0 — Luxury
   ============================================================ */
body { font-weight: 400; letter-spacing: 0; }
h1, h2, .hero-value, .tab-amt, .acct-bal, .stat-value, .kpi-value, .big-num { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; }
.stat-value, .kpi-value, .acct-bal, .tab-amt { font-size: 30px; }
.card, .hero, .kpi { background: var(--surface); border: 1px solid var(--border); }
.card-head h3 { font-weight: 500; letter-spacing: .14em; font-size: 11px; }
.btn { border-radius: 999px; font-weight: 600; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.nav-link { font-weight: 500; letter-spacing: .02em; }
.nav-link.on { background: transparent; color: var(--accent); }
.brand span { font-family: var(--serif); font-weight: 400; font-size: 22px; letter-spacing: 0; }
.tabbar { border-top: 1px solid var(--border); }
.tabbar .tab-add { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.tabbar a.on, .tabbar button.on { color: var(--accent); }
.sync-pill { border-color: var(--border); background: transparent; font-weight: 500; }
.sync-pill .dot { background: var(--accent); }
.scope-switch { border-radius: 999px; } .scope-switch button { border-radius: 999px; font-weight: 500; letter-spacing: .04em; }
.scope-switch button.on { background: var(--text); color: var(--bg); }
.toast { background: var(--text); color: var(--bg); border-radius: 999px; font-weight: 500; }

.lx { max-width: 640px; width: 100%; display: flex; flex-direction: column; gap: 28px; padding-bottom: 20px; }
.lx-kicker { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.lx-greet { font-family: var(--serif); font-weight: 400; font-size: 46px; line-height: 1.02; letter-spacing: -.01em; margin: 0 0 18px; }
.lx-letter { font-family: var(--serif); font-size: 27px; line-height: 1.3; margin: 0 0 12px; color: var(--text); }
.lx-amt { font-style: normal; color: var(--accent); white-space: nowrap; }
.lx-sub { font-size: 15px; line-height: 1.6; color: var(--muted); margin: 0; }
.lx-sub .lx-amt { font-family: inherit; font-weight: 600; }
.lx-figures { display: flex; gap: 0; margin-top: 24px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.lx-figures div { flex: 1; padding: 14px 0; display: flex; flex-direction: column; gap: 3px; }
.lx-figures div + div { border-left: 1px solid var(--border); padding-left: 16px; }
.lx-figures span { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.lx-figures b { font-family: var(--serif); font-weight: 400; font-size: 24px; font-variant-numeric: tabular-nums; }
.lx-muted { color: var(--muted); font-size: 13.5px; margin: 0; }
.lx-note { font-size: 13.5px; color: var(--warn); border: 1px solid var(--border); padding: 10px 14px; border-radius: 12px; }

.lx-tab { border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); border-radius: 22px; padding: 22px; background: linear-gradient(150deg, var(--accent-soft), transparent 60%), var(--surface); }
.lx-tab.empty { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lx-tab-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.lx-tab-amt { font-family: var(--serif); font-size: 52px; line-height: 1; margin: 2px 0 8px; font-variant-numeric: tabular-nums; }
.lx-tab-actions { display: flex; align-items: center; gap: 14px; }
.lx-btn { border: 1px solid var(--border-strong); background: transparent; color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; letter-spacing: .04em; padding: 11px 20px; border-radius: 999px; cursor: pointer; }
.lx-btn.gold { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.lx-link { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--accent); cursor: pointer; letter-spacing: .03em; }

.lx-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.lx-head h2 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 0; }
.lx-j { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--accent); color: var(--accent); font-size: 10px; }
.lx-review { display: block; font-size: 13px; color: var(--warn); margin: 2px 0 8px; }
.lx-list { border-top: 1px solid var(--border); }
.lx-row { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); }
.lx-row-main { flex: 1; min-width: 0; display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 15px 0; background: none; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.lx-date { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }
.lx-payee { font-size: 15px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; flex-direction: column; }
.lx-payee small { font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.lx-sum { font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 500; }
.lx-sum.in { color: var(--pos); }
.lx-tag, .lx-tag-space { width: 34px; height: 34px; flex: none; }
.lx-tag { border-radius: 50%; border: 1px solid var(--border-strong); background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; letter-spacing: .02em; cursor: pointer; display: grid; place-items: center; }
.lx-tag:hover { border-color: var(--accent); color: var(--accent); }
.lx-tag.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.lx-row.is-j .lx-payee, .lx-row.is-j .lx-sum { color: var(--muted); }
.lx-row.is-j .lx-payee small::after { content: " · Javier"; color: var(--accent); }
.lx-more { width: 100%; margin-top: 10px; padding: 12px; background: none; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font: inherit; font-size: 13px; letter-spacing: .06em; cursor: pointer; }
.lx-section .lx-line { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 14px 0; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; font-variant-numeric: tabular-nums; }
.lx-section .lx-line:first-of-type { border-top: 1px solid var(--border); }
.lx-line span:first-child { display: flex; flex-direction: column; font-weight: 500; } .lx-line small { color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 2px; }
.lx-neg { color: var(--neg); }

@media (max-width: 900px) {
  .lx { gap: 26px; }
  .lx-greet { font-size: 40px; }
  .lx-letter { font-size: 23px; }
  .lx-tab-amt { font-size: 46px; }
  .lx-figures b { font-size: 20px; }
  .lx-row-main { grid-template-columns: 44px 1fr auto; }
}


/* ============================================================
   v2.1 — Apple Card × Tesla
   ============================================================ */
body { letter-spacing: -.01em; }
h1, h2, .hero-value, .tab-amt, .acct-bal, .stat-value, .kpi-value, .big-num { font-family: var(--serif); font-weight: 700; letter-spacing: -.02em; }
.brand span { font-family: var(--serif); font-weight: 700; font-size: 17px; }
.btn { border-radius: 10px; }
.nav-link.on { color: var(--accent); background: var(--surface); }
.scope-switch button.on { background: var(--surface-3); color: var(--text); }
.toast { border-radius: 14px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.card, .hero, .kpi { border: 0; }
@media (max-width: 900px) { .topbar { background: var(--bg); } .tabbar { background: color-mix(in srgb, var(--bg) 94%, transparent); border-top: .5px solid var(--border); } .tabbar .tab-add { width: 44px; height: 44px; margin-top: 0; background: var(--accent); } }

.ap { max-width: 560px; width: 100%; display: flex; flex-direction: column; gap: 22px; }
.ap-title p { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.ap-title h1 { margin: 2px 0 0; font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.ap-alert { display: flex; justify-content: space-between; align-items: center; background: var(--surface); border-radius: 12px; padding: 12px 14px; color: var(--warn); font-size: 15px; font-weight: 500; }
.ap-alert.soft { color: var(--accent); margin-bottom: 8px; } .ap-alert span { color: var(--muted); font-size: 20px; line-height: 1; } .ap-alert:hover { text-decoration: none; }

.ap-card { position: relative; display: flex; flex-direction: column; aspect-ratio: 1.586; border-radius: 18px; padding: 20px 22px; color: #fff; overflow: hidden; box-shadow: 0 18px 40px rgba(0,0,0,.35), inset 0 0 0 .5px rgba(255,255,255,.4); }
.ap-card:hover { text-decoration: none; }
.ap-card-glass { position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255,255,255,.28), rgba(255,255,255,0) 45%), linear-gradient(0deg, rgba(0,0,0,.28), rgba(0,0,0,0) 55%); pointer-events: none; }
.ap-card > span { position: relative; }
.ap-card-top { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.ap-card-mark .logo { width: 30px; height: 30px; }
.ap-card-big { margin-top: auto; font-size: 40px; font-weight: 700; letter-spacing: -.03em; text-shadow: 0 1px 8px rgba(0,0,0,.25); font-variant-numeric: tabular-nums; }
.ap-card-name { font-size: 13px; font-weight: 600; letter-spacing: .12em; opacity: .9; margin-top: 4px; }

.ap-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ap-tile { background: var(--surface); border-radius: 14px; padding: 14px 15px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ap-tile small { font-size: 15px; font-weight: 600; color: var(--text); }
.ap-tile b { font-size: 26px; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.ap-tile span { font-size: 13px; color: var(--muted); }
.ap-tile-j b { color: var(--neg); }
.ap-pill { align-self: flex-start; margin-top: 6px; border: 0; background: var(--accent); color: var(--on-accent); font: inherit; font-size: 14px; font-weight: 600; padding: 6px 14px; border-radius: 999px; cursor: pointer; }

.ap-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ap-actions > * { display: flex; flex-direction: column; align-items: center; gap: 7px; background: none; border: 0; color: var(--text); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; padding: 0; }
.ap-actions > *:hover { text-decoration: none; }
.ap-actions span { width: 58px; height: 58px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 22px; color: var(--text); }
.ap-actions > *:active span { background: var(--surface-2); }

.ap-sec-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 2px 8px; }
.ap-sec-head h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.ap-sec-head > span { font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ap-group { background: var(--surface); border-radius: 14px; overflow: hidden; }
.ap-week { padding: 16px 16px 12px; }
.ap-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; height: 130px; }
.ap-bar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ap-bar { flex: 1; width: 100%; max-width: 22px; display: flex; flex-direction: column-reverse; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.ap-bar i { display: block; width: 100%; }
.ap-bar-col span { font-size: 12px; color: var(--muted); font-weight: 600; } .ap-bar-col span.on { color: var(--text); }
.ap-foot { margin: 12px 0 0; padding-top: 10px; border-top: .5px solid var(--border); font-size: 13px; color: var(--muted); }

.ap-row { display: flex; align-items: center; padding-right: 12px; position: relative; }
.ap-row + .ap-row::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; border-top: .5px solid var(--border); }
.ap-row-main { flex: 1; min-width: 0; display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 11px 6px 11px 14px; background: none; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ap-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--c); display: grid; place-items: center; font-size: 19px; color: #fff; }
.ap-txt { display: flex; flex-direction: column; min-width: 0; }
.ap-txt b { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-txt small { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.35; }
.ap-amt { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; align-self: start; padding-top: 2px; }
.ap-amt.in { color: var(--pos); }
.ap-j { width: 30px; height: 30px; flex: none; border-radius: 50%; border: 1.5px solid var(--border-strong); background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; display: grid; place-items: center; }
.ap-j.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ap-j-mini { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border-strong); font-size: 10px; color: var(--muted); }
.ap-jtag { color: var(--accent); font-weight: 600; }
.ap-more { margin-top: 10px; width: 100%; background: var(--surface); border: 0; border-radius: 12px; padding: 13px; color: var(--accent); font: inherit; font-size: 16px; cursor: pointer; }
.ap-empty { padding: 20px 16px; margin: 0; color: var(--muted); }
@media (max-width: 900px) { .topbar h1:empty { display: none; } .ap-title h1 { font-size: 32px; } }
.ap-actions span .ico { width: 24px; height: 24px; }


/* ============================================================
   v2.2 — Chase × Apple Card, luxury serif
   ============================================================ */
h1, h2, .tab-amt, .acct-bal, .stat-value, .kpi-value, .big-num, .hero-value, .rta .stat-value { font-family: var(--serif); font-weight: 600; letter-spacing: -.005em; font-variant-numeric: lining-nums tabular-nums; }
.brand span { font-family: var(--serif); font-weight: 700; font-size: 19px; }
.card, .kpi, .hero, .ap-tile, .ap-group, .ap-more, .ap-alert { box-shadow: var(--shadow); }
.btn { border-radius: 8px; }
.btn.primary { background: var(--accent); border-color: var(--accent); }
.toast { background: var(--navy); color: #fff; border: 0; border-radius: 10px; }
.tabbar .tab-add { background: var(--accent); }

body[data-route="dashboard"] .topbar { background: var(--navy); color: #fff; }
body[data-route="dashboard"] .topbar .sync-pill { border-color: rgba(255,255,255,.3); color: rgba(255,255,255,.85); background: transparent; }
body[data-route="dashboard"] .topbar .btn.ghost { color: rgba(255,255,255,.8); }
.ap { position: relative; }
.ap > * { position: relative; z-index: 1; }
.ap > .cx-band { position: absolute; z-index: 0; left: -26px; right: -26px; top: -14px; height: 250px; background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); border-radius: 0 0 28px 28px; }
.ap-title p { color: rgba(255,255,255,.7); font-weight: 500; letter-spacing: .08em; font-size: 12px; }
.ap-title h1 { color: #fff; font-family: var(--serif); font-weight: 600; font-size: 34px; letter-spacing: -.005em; margin-top: 4px; }
.ap .scope-switch { background: rgba(255,255,255,.12); border-color: transparent; }
.ap .scope-switch button { color: rgba(255,255,255,.75); } .ap .scope-switch button.on { background: #fff; color: var(--navy); }
.ap-card { box-shadow: 0 16px 36px rgba(12, 44, 85, .35), inset 0 0 0 .5px rgba(255,255,255,.5); }
.ap-card-big { font-family: var(--serif); font-weight: 600; font-size: 42px; letter-spacing: 0; font-variant-numeric: lining-nums tabular-nums; }
.ap-card-top { font-weight: 500; letter-spacing: .1em; text-transform: uppercase; font-size: 12px; }

.ap-tile { color: var(--text); border-radius: 12px; }
a.ap-tile:hover { text-decoration: none; box-shadow: 0 0 0 1.5px var(--accent); }
.ap-tile small { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; color: var(--accent); }
.ap-tile b { font-family: var(--serif); font-weight: 600; font-size: 28px; letter-spacing: 0; font-variant-numeric: lining-nums tabular-nums; margin-top: 4px; }
.ap-tile span { font-size: 12.5px; }
.ap-tile-j small { color: var(--neg); }
.ap-pill { border-radius: 8px; }

.cx-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cx-actions > * { display: flex; align-items: center; justify-content: center; padding: 12px 10px; border-radius: 8px; border: 1.5px solid var(--accent); background: var(--surface); color: var(--accent); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; text-align: center; }
.cx-actions > *:first-child { background: var(--accent); color: var(--on-accent); }
.cx-actions > *:hover { text-decoration: none; filter: brightness(.97); }

.ap-sec-head h2 { font-family: var(--serif); font-weight: 600; font-size: 23px; letter-spacing: 0; }
.ap-group { border-radius: 12px; }
.ap-ico { border-radius: 50%; }
.ap-j.on { background: var(--accent); border-color: var(--accent); }
.ap-more { color: var(--accent); font-weight: 600; border-radius: 10px; }
@media (max-width: 900px) { .ap > .cx-band { left: -16px; right: -16px; top: -12px; height: 240px; border-radius: 0 0 24px 24px; } }

/* v2.3 — band hero (no card), business prompt, audit log */
.cx-hero { display: flex; flex-direction: column; gap: 4px; color: #fff; padding: 2px 0 18px; }
.cx-hero-label { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.7); font-weight: 600; }
.cx-hero-num { font-family: var(--serif); font-weight: 600; font-size: 48px; line-height: 1.05; font-variant-numeric: lining-nums tabular-nums; }
.cx-hero-sub { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: rgba(255,255,255,.85); }
.cx-hero-sub .spark { width: 120px; height: 26px; }
.cx-hero-sub .up { color: #9fe0b8; } .cx-hero-sub .dn { color: #ffb4b4; }
.ap > .cx-band { height: 230px; }
@media (max-width: 900px) { .ap > .cx-band { height: 220px; } .cx-hero-num { font-size: 44px; } }
.cx-ask { background: var(--surface); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.cx-ask b { font-size: 16px; } .cx-ask p { margin: 4px 0 12px; color: var(--muted); font-size: 13.5px; }
.cx-ask-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.cx-ask-list button { border: 1.5px solid var(--accent); background: none; color: var(--accent); font: inherit; font-weight: 600; font-size: 14px; padding: 8px 14px; border-radius: 8px; cursor: pointer; }
.tab-audit { margin-top: 6px; border-top: 1px solid var(--border); padding-top: 10px; }
.tab-audit summary { cursor: pointer; font-weight: 600; color: var(--accent); font-size: 14px; }
.tab-audit-row { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.tab-audit-row > span:first-child { color: var(--muted); font-size: 12.5px; }
.tab-audit-row small { display: block; color: var(--muted); font-size: 12px; }
.cx-top { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); margin: -14px -26px 0; padding: 14px 26px 22px; border-radius: 0 0 28px 28px; display: flex; flex-direction: column; gap: 14px; }
.cx-top .cx-hero { padding: 0; }
.ap > .cx-band { display: none; }
@media (max-width: 900px) { .cx-top { margin: -12px -16px 0; padding: 12px 16px 20px; border-radius: 0 0 24px 24px; } }

/* v2.5 — logos, avatar, header row, quick actions */
body[data-route="dashboard"] .topbar { display: none; }
.cx-toprow { display: flex; justify-content: space-between; align-items: center; }
.cx-toprow .sync-pill { border-color: rgba(255,255,255,.28); color: rgba(255,255,255,.88); background: rgba(255,255,255,.06); }
.avatar-btn { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; flex: none; background: rgba(255,255,255,.16); color: #fff; font-weight: 700; font-size: 16px; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.avatar-btn:hover { text-decoration: none; }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-btn.sm { width: 32px; height: 32px; font-size: 13px; background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.avatar-btn.lg { width: 64px; height: 64px; font-size: 24px; background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.photo-row { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; } .photo-row p { margin: 2px 0 8px; }

.cx-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; background: var(--surface); border-radius: 14px; padding: 12px 6px; box-shadow: var(--shadow); }
.cx-quick > * { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; color: var(--text); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 2px; text-align: center; }
.cx-quick > *:hover { text-decoration: none; }
.cx-quick span { width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 18px; font-weight: 700; }
.cx-quick span .ico { width: 20px; height: 20px; }
.cx-quick > *:first-child span { background: var(--accent); color: var(--on-accent); }

.ap-ico.has-logo, .txn-icon.has-logo { background: #fff; box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.ap-ico.has-logo img, .txn-icon.has-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* v2.6 — multi-person tags, held money, payday */
.ap-jset { display: flex; gap: 6px; flex: none; }
.ap-j.hold { border-style: dashed; }
.ap-j.hold.on { border-style: solid; background: var(--pos); border-color: var(--pos); }
.ap-tile-hold small { color: var(--pos); } .ap-tile-hold b { color: var(--text); }
.ap-tile-hold .ap-pill { background: var(--pos); }
.cx-pay { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); color: var(--text); overflow: hidden; }
.cx-pay:hover { text-decoration: none; box-shadow: 0 0 0 1.5px var(--accent); }
.cx-pay > div { padding: 14px 15px; display: flex; flex-direction: column; gap: 2px; }
.cx-pay > div + div { border-left: 1px solid var(--border); }
.cx-pay small { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; color: var(--accent); }
.cx-pay .cx-pay-free small { color: var(--pos); }
.cx-pay b { font-family: var(--serif); font-weight: 600; font-size: 24px; font-variant-numeric: lining-nums tabular-nums; }
.cx-pay span { font-size: 12.5px; color: var(--muted); }

/* v2.7 — card statements */
.cx-stmt { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; color: var(--text); position: relative; }
.cx-stmt:hover { text-decoration: none; background: var(--surface-2); }
.cx-stmt + .cx-stmt::before, .cx-stmt-ask::before { content: ""; position: absolute; top: 0; left: 70px; right: 0; border-top: .5px solid var(--border); }
.cx-stmt-date { width: 44px; height: 46px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.cx-stmt-date b { font-size: 17px; } .cx-stmt-date small { font-size: 10px; text-transform: uppercase; margin-top: 3px; font-weight: 700; }
.cx-stmt.soon .cx-stmt-date { background: var(--neg-soft); color: var(--neg); }
.cx-stmt.paid .cx-stmt-date { background: var(--pos-soft); color: var(--pos); }
.cx-stmt .ap-amt { display: flex; flex-direction: column; align-items: flex-end; } .cx-stmt-cap { font-size: 11px; color: var(--muted); font-weight: 500; }
.cx-stmt.paid .ap-amt { color: var(--muted); text-decoration: line-through; }
.cx-stmt-ask { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; font-size: 14px; }
.cx-stmt-ask .ap-pill { margin: 0; flex: none; }
.manual-stmt { background: var(--surface-2); border-radius: 12px; padding: 12px 14px 4px; margin: 4px 0 12px; } .manual-stmt p { margin: 2px 0 8px; }
/* v2.8.1 — minimum payment made */
.cx-stmt.minpaid .cx-stmt-date { background: var(--pos-soft); color: var(--pos); }
.cx-stmt small .pos { color: var(--pos); font-weight: 600; }
/* v2.9.0 — pay plan: full statement vs 0% promo */
.cx-tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 6px; font-size: 10px; font-weight: 700; letter-spacing: .02em; vertical-align: 2px; background: var(--surface-2); color: var(--muted); }
.cx-tag.promo { background: var(--accent-soft); color: var(--accent); }
.cx-stmt.minonly .cx-stmt-date { background: var(--neg-soft); color: var(--neg); }
.cx-stmt.minonly .ap-amt { color: var(--neg); }
.cx-stmt small .neg, .cx-stmt > .ap-txt > small.neg { color: var(--neg); font-weight: 600; }
.cx-stmt .ap-txt > small.neg, .cx-ask-plan { display: block; margin-top: 3px; }
.cx-ask-plan { font-size: 12px; color: var(--muted); }
/* v2.10.0 — reports: month / year / custom range */
.rep-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.rep-custom { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; width: 100%; }
.rep-custom label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.rep-custom .input { min-width: 150px; }
.rep-presets { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.chip-btn { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip-btn:hover { background: var(--surface-2); }
.rep-stats { grid-template-columns: repeat(5, 1fr); margin-bottom: var(--gap); }
@media (max-width: 1080px) { .rep-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .rep-stats { grid-template-columns: 1fr 1fr; } .rep-custom label { flex: 1; } .rep-custom .input { min-width: 0; width: 100%; } }
.cx-stmt .ap-txt small { white-space: normal; overflow: visible; text-overflow: clip; }
/* v2.11.0 — paycheck plan & heads-up */
.cx-heads { background: var(--surface); border-radius: 16px; padding: 14px 16px; margin: 12px 0; box-shadow: var(--shadow); }
.cx-heads.warn { border-left: 4px solid #f5a524; }
.cx-heads-msg { margin: 0 0 10px; font-size: 14px; line-height: 1.45; }
.cx-plan + .cx-plan { margin-top: 12px; }
.cx-plan h4 { display: flex; justify-content: space-between; margin: 0 0 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cx-plan ul { list-style: none; margin: 0; padding: 0; }
.cx-plan li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: .5px solid var(--border); font-size: 14px; }
.cx-plan li > span { display: flex; flex-direction: column; min-width: 0; } .cx-plan li small { color: var(--muted); font-size: 12px; }
.cx-close { margin: 10px 0 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.cx-remind { margin-top: 10px; font-size: 13px; }
/* v2.11.1 — Paycheck Plan, redesigned */
.pp { background: var(--surface); border-radius: 20px; padding: 18px 18px 14px; margin: 14px 0; box-shadow: var(--shadow); }
.pp-head small { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--muted); }
.pp-head h3 { font-family: var(--serif); font-weight: 600; font-size: 24px; line-height: 1.2; margin: 4px 0 6px; letter-spacing: -.01em; }
.pp-head h3 span { color: var(--warn); }
.pp-head p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.pp-meter { height: 6px; border-radius: 99px; background: var(--surface-2); margin: 14px 0 4px; overflow: hidden; }
.pp-meter i { display: block; height: 100%; border-radius: inherit; background: var(--warn); }
.pp-meter-cap { margin: 0; font-size: 11.5px; color: var(--muted); }
.pp-group { margin-top: 16px; }
.pp-ghead { display: flex; align-items: center; gap: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-bottom: 6px; }
.pp-ghead b { font-weight: 700; color: var(--text); }
.pp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); flex: none; }
.pp-group.cur .pp-dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.pp-gtot { margin-left: auto; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.pp ul { list-style: none; margin: 0; padding: 0; }
.pp-row { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px; padding: 10px 0; border-top: .5px solid var(--border); }
.pp-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: var(--c); letter-spacing: .02em; }
.pp-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pp-main b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-main small { font-size: 12.5px; color: var(--muted); }
.pp-due.warm { color: var(--warn); font-weight: 600; } .pp-due.hot { color: var(--neg); font-weight: 600; }
.pp-amt { font-size: 15.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pp-group:not(.cur) .pp-amt, .pp-group:not(.cur) .pp-main b { color: var(--muted); font-weight: 600; }
.pp-group:not(.cur) .pp-ico { opacity: .55; }
.pp-notes { margin-top: 14px; display: grid; gap: 8px; }
.pp-note { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.pp-note p { margin: 0; font-size: 13px; line-height: 1.4; color: var(--muted); } .pp-note b { color: var(--text); }
.pp-cal { margin-top: 14px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 11px; background: var(--accent-soft); color: var(--accent); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
/* v2.12.0 — subscriptions, monthly statements, Face ID lock */
.subs-alert { margin: 0 0 10px; padding: 9px 12px; border-radius: 10px; background: var(--neg-soft); color: var(--neg); font-size: 13.5px; }
.subs-list { list-style: none; margin: 0; padding: 0; }
.subs-list li { display: grid; grid-template-columns: 36px 1fr auto 24px; align-items: center; gap: 12px; padding: 10px 0; border-top: .5px solid var(--border); }
.subs-logo { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); font-weight: 800; color: var(--muted); overflow: hidden; }
.subs-logo img { width: 100%; height: 100%; object-fit: cover; }
.subs-main { min-width: 0; display: flex; flex-direction: column; } .subs-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .subs-main small { color: var(--muted); font-size: 12.5px; }
.subs-amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.subs-more { display: block; margin-top: 8px; font-weight: 600; } .subs-foot { margin: 10px 0 0; }
.ms-ask { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 16px; padding: 12px 14px; margin: 10px 0; box-shadow: var(--shadow); color: var(--text); }
.ms-ask:hover { text-decoration: none; }
.ms-ask > div { flex: 1; min-width: 0; display: flex; flex-direction: column; } .ms-ask small { color: var(--muted); font-size: 12.5px; }
.ms-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); display: grid; place-items: center; font-size: 17px; flex: none; }
.ms-ask .ap-pill { margin: 0; flex: none; } .ms-chev { color: var(--muted); font-size: 20px; }
body.locked { overflow: hidden; }
#lock { position: fixed; inset: 0; z-index: 10000; background: var(--navy, #0c2c55); display: grid; place-items: center; padding: 24px; }
.lock-box { width: 100%; max-width: 320px; text-align: center; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lock-box .logo { width: 56px; height: 56px; }
.lock-box h2 { font-family: var(--serif); font-size: 28px; margin: 6px 0 0; } .lock-box p { margin: 0 0 12px; opacity: .75; }
.lock-box .link { color: #fff; opacity: .8; } .lock-msg { min-height: 1em; opacity: .8; }
/* v2.13.0 — who pays for each subscription */
.subs-sum { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 2px 0 12px; }
.subs-sum small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.subs-sum b { font-family: var(--serif); font-size: 24px; font-weight: 600; } .subs-sum b span { font-family: inherit; font-size: 13px; color: var(--muted); margin-left: 2px; }
.subs-sum em { display: block; font-style: normal; font-size: 12px; color: var(--muted); }
.subs-list button.subs-main { all: unset; cursor: pointer; min-width: 0; display: flex; flex-direction: column; }
.subs-list button.subs-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub-tag { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 6px; font-size: 10.5px; font-weight: 700; vertical-align: 2px; background: var(--surface-2); color: var(--muted); }
.sub-tag.ok { background: var(--pos-soft); color: var(--pos); } .sub-tag.bad { background: var(--neg-soft); color: var(--neg); } .sub-tag.who { background: var(--accent-soft); color: var(--accent); }
.subs-list li.covered .subs-amt { color: var(--muted); text-decoration: line-through; font-weight: 600; }
/* v2.14.1 — scrolling fixes (iPhone Safari) */

body { -webkit-overflow-scrolling: touch; }
.modal-backdrop { height: 100vh; height: 100dvh; overscroll-behavior: contain; }
.modal { max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow: hidden; min-height: 0; }
.modal-head { flex: none; padding-bottom: 6px; }
.modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.modal-foot { position: sticky; bottom: -20px; margin: 12px -20px -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); z-index: 2; }
@media (max-width: 760px) {
  .modal { max-height: 92vh; max-height: calc(100dvh - 12px); }
}
.input, select.input, textarea.input { max-width: 100%; min-width: 0; }
input[type="date"].input, input[type="time"].input { -webkit-appearance: none; appearance: none; display: block; width: 100%; min-width: 0; min-height: 44px; text-align: left; }
input[type="date"].input::-webkit-date-and-time-value { text-align: left; margin: 0; }
.field { min-width: 0; } .form-grid > * { min-width: 0; }
.pick-list, .tab-ledger, .table-wrap, .kpis { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.table-wrap { overflow-x: auto; touch-action: pan-x pan-y; }
.hero-chart { touch-action: pan-y; }
/* v2.15.0 — subscriptions, card payments and paydays on the calendar */
.cal-item.k-sub { border-left-color: #8b5cf6; }
.cal-item.k-card { border-left-color: var(--neg); font-weight: 700; }
.cal-item.k-pay { border-left-color: var(--pos); }
.li-amt.strike { text-decoration: line-through; }
.list-item .li-icon.has-logo { background: #fff; overflow: hidden; } .list-item .li-icon.has-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cal-item.k-pay.posted { text-decoration: none; opacity: .7; }
/* v2.16.0 — William's page (shared view) + invite */
body[data-route="viewer"] { background: var(--bg); }
.wv { max-width: 560px; margin: 0 auto; min-height: 100vh; }
.wv-top { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2, #12386b) 100%); color: #fff; padding: calc(14px + env(safe-area-inset-top)) 20px 26px; border-radius: 0 0 28px 28px; display: flex; flex-direction: column; gap: 10px; }
.wv-row { display: flex; justify-content: space-between; align-items: center; }
.wv-upd { font-size: 12.5px; padding: 6px 11px; border-radius: 99px; border: 1px solid rgba(255,255,255,.28); color: rgba(255,255,255,.85); }
.wv-date { margin: 6px 0 0; font-size: 13px; color: rgba(255,255,255,.7); }
.wv-greet { font-family: var(--serif); font-weight: 600; font-size: 30px; letter-spacing: -.01em; margin: 0; color: #fff; }
.wv-hero { display: flex; flex-direction: column; margin-top: 8px; }
.wv-hero small { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; color: rgba(255,255,255,.7); }
.wv-hero b { font-family: var(--serif); font-weight: 600; font-size: 52px; line-height: 1.05; letter-spacing: -.02em; color: #fff; font-variant-numeric: tabular-nums; }
.wv-hero b.neg { color: #ff8a8a; }
.wv-hero span { font-size: 14px; color: rgba(255,255,255,.78); }
.wv-meter { height: 8px; border-radius: 99px; background: rgba(255,255,255,.16); overflow: hidden; margin-top: 4px; }
.wv-meter i { display: block; height: 100%; border-radius: inherit; background: #4cc38a; }
.wv-body { padding: 16px 16px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 18px; }
.wv-body .ms-ask { margin: 0; }
.wv-line { display: flex; align-items: center; gap: 12px; padding: 12px 14px; position: relative; }
.wv-line + .wv-line::before { content: ""; position: absolute; top: 0; left: 62px; right: 0; border-top: .5px solid var(--border); }
.wv-line .ap-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wv-amts { display: flex; flex-direction: column; align-items: flex-end; } .wv-amts small { font-size: 12px; color: var(--muted); } .wv-amts small.neg { color: var(--neg); }
.wv-foot { text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
.wv-foot .btn-row { justify-content: center; }
.wv-inv-badge { width: 64px; height: 64px; border-radius: 20px; background: var(--navy); color: #fff; display: grid; place-items: center; font-family: var(--serif); font-size: 30px; font-weight: 600; margin: 0 auto 6px; }
.wv-inv-title { font-family: var(--serif); font-weight: 600; font-size: 30px; text-align: center; margin: 4px 0 6px; }
.wv-invite .auth-sub { text-align: center; }
.share-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.share-box > div:first-child { display: flex; flex-direction: column; min-width: 0; flex: 1 1 220px; } .share-box small { color: var(--muted); font-size: 12.5px; }
.share-box.on { background: var(--pos-soft); }
/* v2.17.0 — privacy blur when the app is in the background */
body.privacy #app, body.privacy #modal-root { filter: blur(22px); }
body.privacy::after { content: ""; position: fixed; inset: 0; background: var(--navy, #0c2c55); opacity: .55; z-index: 9000; pointer-events: none; }
/* v2.18.0 — desktop dashboard: full-width band, two columns */
.dash-grid { display: flex; flex-direction: column; gap: 22px; }
.dash-main, .dash-side { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
@media (min-width: 1100px) {
  body[data-route="dashboard"] .view { max-width: 1320px; }
  .ap { max-width: none; }
  .cx-top { padding-left: 32px; padding-right: 32px; }
  .cx-top .cx-hero { max-width: 760px; }
  .dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 28px; align-items: start; }

  .dash-main .ap-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ap-sec-head h2 { font-size: 24px; }
}
@media (min-width: 1500px) {
  .dash-main .ap-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Desktop polish across pages */
@media (min-width: 901px) {
  .acct-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .list-item, .ap-row, .tab-line, .subs-list li, .pp-row { transition: background-color .12s ease; }
  .ap-row:hover, .subs-list li:hover, .tab-line:hover { background: var(--surface-2); }
  .settings { max-width: 860px; }
}
.cx-band-stats { display: none; }
@media (min-width: 1100px) {
  .cx-top { position: relative; }
  .cx-band-stats { display: flex; gap: 14px; position: absolute; right: 32px; bottom: 26px; }
  .cx-band-stats > div { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: 12px 18px; min-width: 150px; }
  .cx-band-stats small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .09em; color: rgba(255,255,255,.65); }
  .cx-band-stats b { font-family: var(--serif); font-weight: 600; font-size: 24px; color: #fff; font-variant-numeric: tabular-nums; }
}
