/* Budget & Debt Tracker — red / black / white theme */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #0e1520;
  --muted: #5b6472;
  --border: #e4e7ec;
  --track: #eef0f3;
  --red: #e11d2e;
  --red-text: #c8102e;
  --red-soft: #fdecee;
  --ink-inv: #ffffff;
  --input: #ffffff;
  --shadow: 0 1px 2px rgba(14, 21, 32, .04);
  --card-shadow: 0 1px 2px rgba(14, 21, 32, .06), 0 6px 16px rgba(14, 21, 32, .08);
  --card-shadow-hover: 0 2px 4px rgba(14, 21, 32, .08), 0 10px 24px rgba(14, 21, 32, .12);
  --radius: 18px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0a0f16;
  --surface: #121a25;
  --surface-2: #1b2534;
  --text: #f2f4f7;
  --muted: #9aa6b6;
  --border: #223043;
  --track: #223043;
  --red: #e11d2e;
  --red-text: #ff6b78;
  --red-soft: #2a1620;
  --ink-inv: #0a0f16;
  --input: #0f1620;
  --shadow: none;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .45);
  --card-shadow-hover: 0 2px 4px rgba(0, 0, 0, .5), 0 10px 26px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
.wrap { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 500; }
h2 { font-size: 18px; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; margin: 0; }
.small { font-size: 13px; }
.num { text-align: right; white-space: nowrap; }
.good { color: var(--text); }
.bad { color: var(--red-text); }
a { color: var(--red-text); }

/* ---------- header ---------- */
.top { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.top-inner { display: flex; align-items: center; gap: 12px 28px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 500; font-size: 17px; }
.brand img { display: block; border-radius: 10px; }
.page-title { display: none; font-size: 17px; }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 500; padding: 25px 12px 23px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); border-bottom-color: var(--red); }
.top-actions { display: flex; gap: 10px; margin-left: auto; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; padding: 0; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.flat { border: 0; background: var(--surface-2); }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
.burger { display: none; }

/* ---------- drawer (phone menu) ---------- */
.drawer { position: fixed; inset: 0; z-index: 30; display: flex; justify-content: flex-end; }
.drawer[hidden] { display: none; }
.scrim { position: absolute; inset: 0; background: rgba(5, 8, 12, .55); }
.panel { position: relative; width: min(300px, 86vw); height: 100%; background: var(--surface); display: flex; flex-direction: column; box-shadow: -12px 0 32px rgba(0, 0, 0, .25); animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.panel-head { height: 68px; padding: 0 12px 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.panel-head .brand { font-size: 16px; gap: 10px; }
.drawer-nav { padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.drawer-nav button { display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 14px; border-radius: 12px; border: 0; background: none; color: var(--text); font: inherit; font-size: 15px; font-weight: 500; text-align: left; cursor: pointer; }
.drawer-nav button::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: var(--border); }
.drawer-nav button.on { background: var(--red-soft); color: var(--red-text); }
.drawer-nav button.on::before { background: var(--red); }
.appearance { margin-top: auto; padding: 16px 20px 24px; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.seg button { height: 40px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
:root[data-theme="light"] .seg [data-v="light"], :root[data-theme="dark"] .seg [data-v="dark"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }

/* ---------- layout ---------- */
main.wrap { padding-top: 28px; padding-bottom: 64px; }
section { margin-bottom: 24px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.sec-head h2 .muted { font-weight: 400; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.cols { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card.pad0 { padding: 0; overflow: hidden; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 24px; font-weight: 700; margin-top: 4px; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.alert { background: var(--red); color: #fff; padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; }
.info { background: var(--surface-2); padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; }

/* hero (net worth) */
.hero { display: grid; gap: 20px 24px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; padding: 26px 28px; }
.hero .main { grid-column: span 2; min-width: 0; }
.hero .label { font-size: 14px; font-weight: 500; color: var(--muted); }
.hero .big { font-size: 56px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin-top: 6px; }
.hero .cap { font-size: 13px; color: var(--muted); margin-top: 6px; }
.hero .side { padding-left: 20px; border-left: 1px solid var(--border); }
.hero .side .v { font-size: 22px; font-weight: 700; margin-top: 4px; }

/* accounts: grid on wide screens, swipe row on phones */
.acct-strip { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.acct { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; text-align: left; font: inherit; color: inherit; box-shadow: var(--card-shadow); transition: box-shadow .15s, transform .15s; }
.acct:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-1px); }
.acct .head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.acct .name { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct .dot { width: 8px; height: 8px; border-radius: 99px; background: var(--red); flex: none; }
.acct.zero .dot { background: var(--border); }
.acct .bal { font-size: 20px; font-weight: 700; }
.acct.zero .bal { color: var(--muted); }
.acct .type { font-size: 12px; color: var(--muted); }
.acct.total { background: var(--text); color: var(--ink-inv); border-color: var(--text); cursor: default; }
.acct.total .type { color: inherit; opacity: .75; }
.strip-dots { display: none; }

/* recent transactions */
.tx-list { padding: 4px 20px; }
.tx-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); cursor: pointer; }
.tx-item:first-child { border-top: 0; }
.tx-ico { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--text); }
.tx-ico.out { background: var(--red-soft); color: var(--red-text); }
.tx-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tx-main b { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-main span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-amt { font-weight: 700; font-size: 14px; white-space: nowrap; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 16px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 500; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tr.row { cursor: pointer; }
tr.row:hover td, tr.row:focus-visible td { background: var(--surface-2); outline: none; }
tr.ro td { color: var(--muted); }
tfoot td { font-weight: 700; background: var(--surface-2); border-bottom: 0; }
td .desc { color: var(--muted); font-size: 12px; }
.empty { padding: 22px; text-align: center; color: var(--muted); }

/* pills + bars */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.pill.good { background: var(--surface-2); color: var(--text); }
.pill.warn { background: var(--red-soft); color: var(--red-text); }
.pill.bad { background: var(--red); color: #fff; }
.pill.blue { background: var(--text); color: var(--ink-inv); }
.bar { height: 8px; background: var(--track); border-radius: 99px; overflow: hidden; min-width: 70px; margin-top: 4px; }
.bar > span { display: block; height: 100%; background: var(--red); border-radius: 99px; }
.bar.good > span { background: var(--red); }
.bar.bad > span { background: var(--red); }
.bar.warn > span { background: var(--red); }

/* debts on summary */
.dlist { display: grid; gap: 18px; }
.ditem { display: grid; gap: 6px; }
.ditem + .ditem { border-top: 1px solid var(--border); padding-top: 18px; }
.ditem .top-line { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-size: 16px; }
.ditem .top-line b { font-weight: 700; }
.ditem .due { color: var(--text); font-weight: 500; }
.ditem .meta { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }

/* buttons + forms */
.btn { font: inherit; font-size: 14px; font-weight: 500; border-radius: 12px; min-height: 44px; padding: 0 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--red-text); border-color: var(--red-text); }
.btn.danger.armed { background: var(--red); border-color: var(--red); color: #fff; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--red-text); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; padding: 6px 0; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.monthbar { display: flex; gap: 6px; align-items: center; }
input, select, textarea { font: inherit; color: var(--text); background: var(--input); border: 1px solid var(--border); border-radius: 12px; min-height: 48px; padding: 0 14px; width: 100%; min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--red); outline-offset: -1px; border-color: transparent; }
.monthbar input { width: auto; min-height: 36px; }

dialog { border: 0; border-radius: 22px; padding: 0; width: min(480px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
dialog::backdrop { background: rgba(5, 8, 12, .55); }
#dlgForm { padding: 22px; display: grid; gap: 16px; max-height: calc(100vh - 40px); overflow-y: auto; }
#dlgForm h2 { font-size: 21px; font-weight: 700; }
.fields { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.field { display: grid; gap: 6px; align-content: start; }
.field.full { grid-column: 1 / -1; }
.field[hidden] { display: none; }
.field label { font-size: 13px; font-weight: 500; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--muted); }
.err { color: var(--red-text); margin: 0; font-size: 13px; }
.err:empty { display: none; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions .sp { flex: 1; }

#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100vw - 32px); z-index: 50; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- phone ---------- */
@media (max-width: 760px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .top-inner { min-height: 68px; gap: 10px; }
  .tabs, .brand-name { display: none; }
  .brand img { width: 36px; height: 36px; }
  .page-title { display: inline; }
  .burger { display: grid; }
  main.wrap { padding-top: 16px; }
  section { margin-bottom: 18px; }
  .card { padding: 16px; }
  .hero { padding: 18px; gap: 14px; grid-template-columns: 1fr 1fr; }
  .hero .main { grid-column: 1 / -1; }
  .hero .big { font-size: 36px; }
  .hero .side { padding-left: 0; border-left: 0; padding-top: 12px; border-top: 1px solid var(--border); min-width: 0; }
  .hero .side .v { font-size: 18px; }
  .acct-strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; margin: 0 -16px; padding: 4px 16px 18px; gap: 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .acct-strip::-webkit-scrollbar { display: none; }
  .acct { flex: 0 0 148px; scroll-snap-align: start; padding: 14px; }
  .acct .bal { font-size: 18px; }
  .strip-dots { display: flex; justify-content: center; gap: 5px; margin-top: 8px; }
  .strip-dots span { width: 5px; height: 5px; border-radius: 99px; background: var(--border); transition: .2s; }
  .strip-dots span.on { width: 18px; background: var(--red); }
  .tx-list { padding: 2px 16px; }
  .cols { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr; }
  .stat .value { font-size: 20px; }
  th, td { padding: 9px 10px; }
  .hide-sm { display: none; }
  .grid { grid-template-columns: 1fr 1fr; }
  .grid.one-sm { grid-template-columns: 1fr; }
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 22px 22px 0 0; }
}
@media (max-width: 340px) {
  .grid { grid-template-columns: 1fr; }
}

/* cloud sync */
.gbtn { background: var(--surface); }
.cloud-card { margin-bottom: 24px; }
.cloud-card .who { display: flex; align-items: center; gap: 12px; }
.cloud-card .who img, .cloud-card .avatar { width: 40px; height: 40px; border-radius: 99px; flex: none; }
.cloud-card .avatar { display: grid; place-items: center; background: var(--red); color: #fff; font-weight: 700; }
.cloud-hero { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; margin: 4px 0 16px; border-radius: 14px; background: var(--surface-2); }
.sync-dot { display: inline-block; width: 8px; height: 8px; border-radius: 99px; margin-right: 8px; background: var(--muted); vertical-align: middle; }
.sync-dot.synced { background: #1d9a52; }
.sync-dot.syncing { background: #e0a100; }
.sync-dot.error { background: var(--red); }

/* sign in / account menu */
.auth-slot { display: flex; align-items: center; }
.btn.wide { width: 100%; justify-content: center; }
.acct-menu { position: relative; }
.avatar-btn { position: relative; width: 44px; height: 44px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); padding: 3px; cursor: pointer; display: grid; place-items: center; }
.avatar-btn:hover { border-color: var(--muted); }
.avatar-img { border-radius: 99px; display: block; object-fit: cover; }
.avatar { display: grid; place-items: center; border-radius: 99px; background: var(--red); color: #fff; font-weight: 700; flex: none; }
.sync-dot.on-avatar { position: absolute; right: 1px; bottom: 1px; margin: 0; width: 11px; height: 11px; border: 2px solid var(--surface); }
.pop { position: absolute; right: 0; top: calc(100% + 8px); width: 280px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; box-shadow: 0 16px 40px rgba(0, 0, 0, .18); z-index: 20; }
.pop[hidden] { display: none; }
.who { display: flex; align-items: center; gap: 12px; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-auth { padding: 16px 20px; border-top: 1px solid var(--border); margin-top: auto; }
.drawer-auth:empty { display: none; }
.drawer-auth + .appearance { margin-top: 0; }
@media (max-width: 760px) {
  .auth-slot { display: none; }
}

/* hide amounts */
.eye-row { display: flex; align-items: center; gap: 6px; }
.eye-btn { width: 36px; height: 36px; margin: -8px 0; border: 0; border-radius: 10px; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.eye-btn:hover { background: var(--surface-2); color: var(--text); }
.masked { letter-spacing: .06em; }

/* brand name */
.brand b, .si-brand b, .si-kicker { font-weight: 700; letter-spacing: .03em; }
.brand i, .si-brand i, .si-kicker i, .si-copy h1 i { font-style: normal; color: var(--red); }

/* sign-in page */
body.gated .top { display: none; }
body.gated main.wrap { max-width: none; padding: 0; }
.si-loading { min-height: 100vh; display: grid; place-items: center; }
.si-loading img { border-radius: 16px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; transform: scale(.96); } }
.signin { min-height: 100vh; display: flex; flex-wrap: wrap; }
.si-hero { flex: 1 1 520px; min-width: 0; background: #0e1520; color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; position: relative; overflow: hidden; }
.si-hero::before, .si-hero::after { content: ""; position: absolute; border-radius: 999px; border: 2px solid var(--red); pointer-events: none; }
.si-hero::before { right: -120px; top: -120px; width: 420px; height: 420px; opacity: .35; }
.si-hero::after { right: -40px; top: -40px; width: 260px; height: 260px; opacity: .2; }
.si-brand { display: flex; align-items: center; gap: 12px; font-size: 18px; position: relative; }
.si-brand img { border-radius: 12px; display: block; }
.si-copy { position: relative; max-width: 520px; display: grid; gap: 18px; }
.si-copy h1 { margin: 0; font-size: 48px; line-height: 1.08; font-weight: 700; letter-spacing: -.02em; }
.si-copy p { margin: 0; font-size: 17px; line-height: 1.55; color: #b7c0cc; }
.si-preview { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 520px; }
.si-tile { background: #172131; border: 1px solid #243246; border-radius: 16px; padding: 14px 16px; display: grid; gap: 6px; }
.si-tile.wide { grid-column: 1 / -1; }
.si-tile span { font-size: 12px; color: #9aa6b6; }
.si-tile b { font-size: 16px; font-weight: 500; }
.si-tile.wide b { font-size: 30px; font-weight: 700; }
.si-bar { height: 6px; border-radius: 99px; background: #243246; overflow: hidden; margin-top: 8px; }
.si-bar span { display: block; width: 58%; height: 100%; background: var(--red); border-radius: 99px; }
.si-panel { flex: 1 1 440px; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 48px 24px; background: var(--bg); }
.si-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 36px 32px; box-shadow: var(--card-shadow); display: grid; gap: 14px; }
.si-logo { border-radius: 14px; display: block; margin-bottom: 6px; }
.si-kicker { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.si-card h2 { font-size: 28px; font-weight: 700; }
.si-card p { margin: 0 0 8px; }
.si-google, .si-local { width: 100%; justify-content: center; min-height: 52px; font-size: 16px; border-radius: 14px; }
.si-local { background: var(--surface-2); border-color: transparent; min-height: 48px; font-size: 15px; }
.si-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.si-or span { flex: 1; height: 1px; background: var(--border); }
.si-note { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: var(--muted); background: var(--red-soft); border-radius: 12px; padding: 12px 14px; margin-top: 6px; }
.si-note svg { color: var(--red-text); flex: none; margin-top: 2px; }
@media (max-width: 760px) {
  .signin { flex-direction: column; flex-wrap: nowrap; background: #0e1520; }
  .si-hero { flex: 1 0 auto; padding: 40px 24px 28px; gap: 24px; justify-content: flex-start; }
  .si-copy h1 { font-size: 34px; }
  .si-copy p { font-size: 15px; }
  .si-tile.wide b { font-size: 24px; }
  .si-panel { flex: 0 0 auto; padding: 0; background: transparent; }
  .si-card { max-width: none; border-radius: 28px 28px 0 0; border: 0; padding: 26px 24px 30px; }
  .si-logo, .si-kicker { display: none; }
  .si-card h2 { font-size: 22px; }
}
.signin > section { margin: 0; }

/* greeting */
.greet { margin-bottom: 18px; }
.greet h1 { font-size: 28px; font-weight: 700; letter-spacing: -.01em; }
.greet h1 i { font-style: normal; color: var(--red); }
.greet p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.greet p b { font-weight: 500; }
@media (max-width: 760px) { .greet h1 { font-size: 22px; } .greet p { font-size: 13px; } }

/* page-enter animations */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
#view.enter > * { animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; }
#view.enter > *:nth-child(2) { animation-delay: .06s; }
#view.enter > *:nth-child(3) { animation-delay: .12s; }
#view.enter > *:nth-child(4) { animation-delay: .18s; }
#view.enter > *:nth-child(5) { animation-delay: .24s; }
#view.enter > *:nth-child(n+6) { animation-delay: .3s; }
#view.enter .acct { animation: pop .45s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(.15s + var(--i, 0) * .05s); }
#view.enter .tx-item { animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(.25s + var(--i, 0) * .05s); }
#view.enter .bar > span { transform-origin: left center; animation: grow .9s cubic-bezier(.2, .7, .2, 1) both; animation-delay: .3s; }
#view.enter .si-card { animation: pop .55s cubic-bezier(.2, .7, .2, 1) .1s both; }
#view.enter .si-copy, #view.enter .si-preview { animation: rise .6s cubic-bezier(.2, .7, .2, 1) both; }
#view.enter .si-preview { animation-delay: .15s; }
dialog[open] { animation: pop .22s ease-out; }
.acct, .btn, .tab, .tx-item { transition: background-color .15s, border-color .15s, box-shadow .15s, transform .15s; }

/* loading screen */
#splash { position: fixed; inset: 0; z-index: 100; background: #0e1520; display: grid; place-items: center; transition: opacity .45s ease, visibility .45s; }
#splash.out { opacity: 0; visibility: hidden; }
.sp-in { display: grid; justify-items: center; gap: 18px; color: #fff; }
.sp-in img { border-radius: 22px; animation: splashpop .7s cubic-bezier(.2, .9, .3, 1.2) both; }
.sp-name { font-size: 18px; animation: rise .6s .2s both; }
.sp-name b { font-weight: 700; letter-spacing: .03em; }
.sp-name i { font-style: normal; color: #e11d2e; }
.sp-bar { width: 140px; height: 4px; border-radius: 99px; background: #243246; overflow: hidden; animation: rise .6s .3s both; }
.sp-bar span { display: block; width: 40%; height: 100%; border-radius: 99px; background: #e11d2e; animation: slidebar 1.1s ease-in-out infinite; }
@keyframes splashpop { from { opacity: 0; transform: scale(.6) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes slidebar { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* greeting + add button */
.greet { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.greet-text { min-width: 0; }
.add-btn { flex: none; white-space: nowrap; font-weight: 700; }
.add-btn:active { transform: scale(.97); }

/* ---------- checkbox fields ---------- */
.field .check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); font-weight: 500; cursor: pointer; min-height: 32px; }
.field .check input { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--red); flex: none; }

/* ---------- upcoming bills ---------- */
.bills { margin-bottom: 24px; }
.bills-sum { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.bills-sum b { color: var(--text); }
.bill-list { margin-top: 6px; }
.bill { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); cursor: pointer; }
.bill:first-child { border-top: 0; }
.bill:hover .bill-main b { color: var(--red-text); }
.bill-date { width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--surface-2); display: grid; place-content: center; text-align: center; line-height: 1.1; }
.bill-date b { font-size: 15px; }
.bill-date span { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.bill.soon .bill-date, .bill.late .bill-date { background: var(--red); color: #fff; }
.bill.soon .bill-date span, .bill.late .bill-date span { color: rgba(255, 255, 255, .85); }
.bill.paid { opacity: .6; }
.bill.paid .bill-main b { text-decoration: line-through; text-decoration-color: var(--muted); }
.bill-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.bill-main b { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bill-main span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bill-right { display: grid; justify-items: end; gap: 4px; }
.bill-right b { font-size: 14px; }
.chip { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip.soon { background: var(--red-soft); color: var(--red-text); }
.chip.late { background: var(--red); color: #fff; }
.chip.paid { background: var(--surface-2); color: var(--text); }
#view.enter .bill { animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(.15s + var(--i, 0) * .05s); }

/* ---------- notification bell ---------- */
.bell-wrap { position: relative; }
.bell { position: relative; }
.bell .badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); }
.bell .badge[hidden] { display: none; }
.note-panel { position: absolute; right: -60px; top: calc(100% + 10px); width: min(380px, calc(100vw - 24px)); max-height: min(520px, 75vh); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 20px 50px rgba(5, 8, 12, .28); z-index: 25; animation: pop .2s ease-out; }
.note-panel[hidden] { display: none; }
.np-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 8px; }
.np-head h2 { font-size: 18px; font-weight: 700; }
.np-list { padding: 0 10px 10px; display: grid; gap: 2px; }
.np-item { position: relative; display: flex; gap: 12px; padding: 12px 10px; border-radius: 14px; }
.np-item.new { background: var(--red-soft); }
.np-ico { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--text); }
.np-item.new .np-ico.k-bill, .np-item.late .np-ico { background: var(--red); color: #fff; }
.np-item.new .np-ico.k-debt { background: var(--text); color: var(--ink-inv); }
.np-body { flex: 1; min-width: 0; display: grid; gap: 3px; padding-right: 10px; }
.np-body b { font-size: 14px; font-weight: 500; }
.np-body > span { font-size: 13px; color: var(--muted); }
.np-actions { margin-top: 6px; }
.np-dot { position: absolute; top: 16px; right: 12px; width: 8px; height: 8px; border-radius: 99px; background: var(--red); }

/* ---------- settings: appearance ---------- */
.appear { display: grid; gap: 10px; max-width: 480px; }
.seg.seg3 { grid-template-columns: repeat(3, 1fr); }
.textsize button { height: 48px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.textsize button span { font-weight: 700; line-height: 1; }
.textsize button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.textsize button.on span { color: var(--red); }

/* ---------- phone: glass bottom tab bar ---------- */
.gear, .bottom-nav { display: none; }
@media (max-width: 760px) {
  .burger { display: none; }
  .gear { display: grid; }
  .top-actions { gap: 8px; }
  .note-panel { position: fixed; left: 12px; right: 12px; top: 76px; width: auto; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); height: 70px; padding: 6px; z-index: 15;
    border-radius: 26px; background: rgba(255, 255, 255, .62); -webkit-backdrop-filter: blur(18px) saturate(180%); backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, .85); box-shadow: 0 10px 30px rgba(14, 21, 32, .16), inset 0 1px 0 rgba(255, 255, 255, .9); }
  :root[data-theme="dark"] .bottom-nav { background: rgba(18, 26, 37, .62); border-color: rgba(255, 255, 255, .08); box-shadow: 0 10px 30px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .06); }
  .bottom-nav button { border: 0; background: none; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font: inherit; font-size: 11px; font-weight: 500; cursor: pointer; padding: 0; min-width: 0; }
  .bottom-nav button.on { color: var(--red-text); background: rgba(225, 29, 46, .12); font-weight: 700; }
  .bottom-nav button:active { transform: scale(.94); }
  main.wrap { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  #toast { bottom: calc(100px + env(safe-area-inset-bottom)); }
  body.gated .bottom-nav { display: none; }
  body.gated main.wrap { padding-bottom: 0; }
}

/* short month label over a native month picker */
.month-label { position: relative; display: inline-grid; place-items: center; min-width: 72px; height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-weight: 500; cursor: pointer; }
.month-label input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.month-label:focus-within { outline: 2px solid var(--red); }

/* phone: round + button to the right of the tab bar */
.fab { display: none; }
@media (max-width: 760px) {
  .add-btn { display: none; }
  .bottom-nav { right: 92px; height: 70px; border-radius: 35px; }
  .bottom-nav button { border-radius: 30px; }
  .bottom-nav button span { font-size: 10px; }
  .fab { display: grid; place-items: center; position: fixed; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); width: 70px; height: 70px; z-index: 15; border-radius: 999px; color: var(--red); cursor: pointer; padding: 0;
    background: rgba(255, 255, 255, .62); -webkit-backdrop-filter: blur(18px) saturate(180%); backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, .85); box-shadow: 0 10px 30px rgba(14, 21, 32, .16), inset 0 1px 0 rgba(255, 255, 255, .9); }
  :root[data-theme="dark"] .fab { background: rgba(18, 26, 37, .62); border-color: rgba(255, 255, 255, .08); box-shadow: 0 10px 30px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .06); color: #ff6b78; }
  .fab:active { transform: scale(.93); }
  body.gated .fab { display: none; }
}

/* phone: active tab highlight is a circle */
@media (max-width: 760px) {
  .bottom-nav button { justify-self: center; align-self: center; width: 100%; max-width: 60px; height: 58px; }
  .bottom-nav button.on { width: 58px; height: 58px; border-radius: 999px; }
}

/* keep date pickers inside the form on phones */
input[type="date"], input[type="month"] { -webkit-appearance: none; appearance: none; display: block; max-width: 100%; box-sizing: border-box; text-align: left; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }

/* ---------- interest ---------- */
.acct .type .rate { color: var(--red); font-weight: 500; }
.int-empty { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.int-card { display: flex; flex-direction: column; gap: 14px; }
.int-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.int-stats .v { font-size: 20px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.int-stats .v.good { color: var(--red); }
.int-list { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.int-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.int-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.int-main span { font-size: 12px; color: var(--muted); }
.int-main .auto { font-style: normal; color: var(--red); font-weight: 500; }
.int-num { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.int-num span { font-size: 11px; color: var(--muted); }
.int-num b.good { color: var(--red); }
@media (max-width: 640px) {
  .int-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .int-stats > div:last-child { grid-column: 1 / -1; }
  .int-stats .v { font-size: 18px; }
}

/* ---------- scan receipt ---------- */
.add-pair { display: inline-flex; gap: 8px; flex: none; }
.scan-btn { font-weight: 500; }
.fab svg { transition: transform .2s ease; }
.fab.open svg { transform: rotate(45deg); }
.add-menu { position: fixed; right: 12px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 16; width: 260px; padding: 8px; display: flex; flex-direction: column; gap: 4px;
  border-radius: 22px; background: rgba(255, 255, 255, .88); -webkit-backdrop-filter: blur(18px) saturate(180%); backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .9); box-shadow: 0 20px 50px rgba(5, 8, 12, .28); animation: pop .18s ease-out; transform-origin: bottom right; }
:root[data-theme="dark"] .add-menu { background: rgba(18, 26, 37, .9); border-color: rgba(255, 255, 255, .08); }
.am-item { display: flex; align-items: center; gap: 12px; padding: 10px; border: 0; border-radius: 16px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.am-item:hover, .am-item:focus-visible { background: var(--surface-2); }
.am-item.hot { background: rgba(225, 29, 46, .09); }
.am-ico { width: 42px; height: 42px; border-radius: 13px; flex: none; display: grid; place-items: center; background: var(--surface-2); color: var(--text); }
.am-item.hot .am-ico { background: var(--red); color: #fff; }
.am-txt { display: flex; flex-direction: column; gap: 2px; }
.am-txt b { font-size: 15px; font-weight: 500; }
.am-txt span { font-size: 12px; color: var(--muted); }
@media (min-width: 761px) { .add-menu { display: none; } }

.scan-wait { position: relative; width: 120px; height: 150px; margin: 4px auto 0; border-radius: 14px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.scan-wait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-wait .pdf, .scan-thumb .pdf { display: grid; place-items: center; width: 100%; height: 100%; font-weight: 700; color: var(--muted); }
.scan-line { position: absolute; left: 8px; right: 8px; height: 2px; background: var(--red); box-shadow: 0 0 12px 2px rgba(225, 29, 46, .7); animation: scanmove 1.6s ease-in-out infinite alternate; }
@keyframes scanmove { from { top: 8%; } to { top: 90%; } }
@media (prefers-reduced-motion: reduce) { .scan-line { animation: none; top: 50%; } }
.scan-head { display: flex; align-items: center; gap: 12px; }
.scan-thumb { width: 52px; height: 64px; flex: none; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.scan-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ai-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--red); background: rgba(225, 29, 46, .09); padding: 4px 10px; border-radius: 999px; }
.scan-items { background: var(--surface-2); border-radius: 14px; padding: 10px 14px; font-size: 13px; }
.scan-items summary { color: var(--muted); font-weight: 500; cursor: pointer; }
.scan-items > div { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.scan-items > div > div { display: flex; justify-content: space-between; gap: 12px; }
.scan-items .tot { border-top: 1px solid var(--border); padding-top: 6px; font-weight: 700; }

/* ---------- action log ---------- */
.log-list { overflow: hidden; }
.log-row { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.log-row:last-child { border-bottom: 0; }
.log-row.undone .log-lines { opacity: .5; text-decoration: line-through; text-decoration-color: var(--muted); }
.log-main { flex: 1; min-width: 0; }
.log-meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.log-meta .pill { font-size: 11px; padding: 1px 8px; }
.log-lines { font-size: 14px; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.log-lines b { font-weight: 500; }
.log-lines .chgs { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.log-lines .chg { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.log-lines .chg s { color: var(--muted); opacity: .8; }
.log-act { flex: none; padding-top: 14px; }
.log-filter { font: inherit; font-size: 14px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 0 10px; max-width: 55%; }

/* ---------- summary charts (donuts) ---------- */
/* categorical colors, checked for color-blind separation; --c6 is "Other" */
:root { --c1: #E11D2E; --c2: #2a78d6; --c3: #eda100; --c4: #1baf7a; --c5: #6250d6; --c6: #9AA3AF; }
:root[data-theme="dark"] { --c1: #F0404F; --c2: #3987e5; --c3: #c98500; --c4: #199e70; --c5: #9085e9; --c6: #5E6A7B; }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .charts { grid-template-columns: 1fr; } }
.chart-card { display: flex; flex-direction: column; gap: 14px; }
.ch-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ch-head h2 { margin: 0; font-size: 16px; font-weight: 500; }
.ch-chip { font-size: 12px; font-weight: 500; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 6px 10px; white-space: nowrap; }
.donut { position: relative; width: 196px; height: 196px; margin: 0 auto; }
.donut svg { display: block; overflow: visible; }
.dn-track { fill: none; stroke: var(--surface-2); stroke-width: 26; }
.dn-seg { fill: none; stroke-width: 26; cursor: pointer; transition: stroke-width .15s ease, opacity .15s ease; }
.dn-seg.on { stroke-width: 32; }
.dn-seg.dim { opacity: .3; }
.dn-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; padding: 0 40px; }
.dn-center .dn-l { font-size: 11px; font-weight: 500; color: var(--muted); max-width: 112px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dn-center b { font-size: 18px; font-weight: 700; margin-top: 2px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dn-center .masked { font-size: 14px; }
.dn-center .dn-s { font-size: 11px; color: var(--muted); margin-top: 1px; }
.legend { display: flex; flex-direction: column; gap: 2px; }
.lg-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 8px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font: inherit; cursor: pointer; text-align: left; transition: background .15s ease, opacity .15s ease; }
.lg-row:hover, .lg-row.on { background: var(--surface-2); }
.lg-row.dim { opacity: .55; }
.lg-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.lg-name { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-amt { font-size: 14px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lg-pct { width: 38px; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .dn-seg, .lg-row { transition: none; } }

/* ---------- account cards (real bank-card look) ---------- */
.c-midnight { --g1: #1B2433; --g2: #0B0F16; }
.c-red { --g1: #E11D2E; --g2: #7A0C17; }
.c-blue { --g1: #2563EB; --g2: #0B2A80; }
.c-emerald { --g1: #10A37F; --g2: #064734; }
.c-violet { --g1: #6D4BEA; --g2: #2A1A7A; }
.c-graphite { --g1: #5B6372; --g2: #1F242D; }
.c-gold { --g1: #D4A537; --g2: #7A5A12; }
.acct.cardv { position: relative; overflow: hidden; aspect-ratio: 1.586; height: auto; padding: 14px 16px; border: 0; border-radius: 16px; gap: 0; justify-content: space-between; color: #fff;
  background: linear-gradient(135deg, var(--g1, #1B2433) 0%, var(--g2, #0B0F16) 100%);
  box-shadow: 0 12px 22px -12px var(--g2, #0B0F16), 0 2px 6px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .18); }
.acct.cardv::before { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, 0) 42%); pointer-events: none; }
.acct.cardv::after { content: ''; position: absolute; right: -22%; bottom: -45%; width: 78%; aspect-ratio: 1; border-radius: 50%; border: 16px solid rgba(255, 255, 255, .06); pointer-events: none; }
.acct.cardv:hover { transform: translateY(-2px); box-shadow: 0 16px 26px -12px var(--g2, #0B0F16), 0 4px 10px rgba(0, 0, 0, .14), inset 0 1px 0 rgba(255, 255, 255, .18); }
.acct.cardv.zero { filter: saturate(.55); opacity: .8; }
.cardv > span { position: relative; z-index: 1; }
.cv-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.cv-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cv-name b { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-name small { font-size: 10px; opacity: .75; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-brand { font-size: 11px; font-weight: 700; letter-spacing: .02em; opacity: .9; flex: none; }
.cv-brand i { font-style: normal; color: #FF4D5E; }
.c-red .cv-brand i { color: #fff; }
.cv-mid { display: flex; align-items: center; gap: 8px; }
.cv-chip { width: 30px; height: 22px; border-radius: 5px; position: relative; overflow: hidden; background: linear-gradient(135deg, #F3D98B 0%, #C9A44A 45%, #E9CC7A 100%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }
.cv-chip::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0, 0, 0, .25); }
.cv-chip::after { content: ''; position: absolute; top: 0; bottom: 0; left: 35%; width: 30%; border-left: 1px solid rgba(0, 0, 0, .25); border-right: 1px solid rgba(0, 0, 0, .25); }
.cv-rate { margin-left: auto; font-size: 10px; font-weight: 500; padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, .18); white-space: nowrap; }
.cv-bot { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cv-bal { font-size: 19px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.cv-bal .masked { color: inherit; }
.cv-num { font-family: ui-monospace, 'Roboto Mono', Menlo, monospace; font-size: 11px; letter-spacing: .1em; opacity: .8; }
.acct.cardv.total { background: var(--surface); color: var(--text); border: 1.5px dashed var(--border); box-shadow: none; justify-content: space-between; }
.acct.cardv.total::before, .acct.cardv.total::after { display: none; }
.acct-strip:has(.cardv) { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
@media (max-width: 760px) {
  .acct.cardv { flex: 0 0 calc((100vw - 58px) / 2); padding: 11px 12px; border-radius: 13px; }
  .acct.cardv::after { border-width: 10px; }
  .cv-name b { font-size: 13px; }
  .cv-name small { font-size: 8.5px; }
  .cv-brand { font-size: 9px; }
  .cv-chip { width: 22px; height: 16px; border-radius: 4px; }
  .cv-rate { font-size: 8.5px; padding: 2px 6px; }
  .cv-bal { font-size: 15px; }
  .cv-num { font-size: 9.5px; }
}
/* card colour picker + live preview in the account form */
.card-preview { display: flex; justify-content: center; }
.card-preview .acct.cardv { width: min(300px, 100%); flex: none; cursor: default; padding: 16px 18px; border-radius: 16px; }
.card-preview .cv-name b { font-size: 16px; } .card-preview .cv-name small { font-size: 10.5px; } .card-preview .cv-brand { font-size: 12px; }
.card-preview .cv-chip { width: 34px; height: 25px; } .card-preview .cv-bal { font-size: 22px; } .card-preview .cv-num { font-size: 12px; } .card-preview .cv-rate { font-size: 10.5px; padding: 3px 8px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.sw { position: relative; cursor: pointer; }
.sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw span { display: block; width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); transition: box-shadow .15s; }
.sw input:checked + span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.sw input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 4px; }
.field .lbl { font-size: 13px; font-weight: 500; color: var(--muted); }

/* + menu: quick-add grid under the scan options */
.add-menu { width: min(300px, calc(100vw - 24px)); }
.am-sep { height: 1px; background: var(--border); margin: 4px 6px; }
.am-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.am-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border: 0; border-radius: 14px; background: transparent; color: var(--text); font: inherit; font-size: 12px; font-weight: 500; text-align: center; line-height: 1.2; cursor: pointer; }
.am-tile:hover, .am-tile:focus-visible { background: var(--surface-2); }
.am-tile .am-ico { width: 40px; height: 40px; }
