/* KaiOne-Life Tracker — "Calm fintech" design system (from the Claude Design canvas).
   White cards on a pale canvas, one ink-blue accent, Inter, 1 px lines. Colour carries meaning only:
   green = gained / on time, red = needs action, amber = due soon. Motion is short fades and slides. */
:root {
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --surface-2: #F1F3F6;
  --surface-3: #EDEFF3;
  --text: #0E1726;
  --muted: #5B6475;
  --faint: #8A93A6;
  --border: #E6E8EC;
  --border-strong: #D5D9E0;
  --line: #EDEFF3;
  --accent: #1E3A8A;
  --accent-2: #172E6E;
  --accent-soft: #EEF2FB;
  --mod: var(--accent);
  --mod-2: #3B5BAA;
  --mod-soft: var(--accent-soft);
  --primary: var(--accent);
  --primary-ink: #FFFFFF;
  --pos: #0F7A4F; --pos-soft: #EAF5EF;
  --neg: #B42318; --neg-soft: #FDF1EF;
  --warn: #A15C07; --warn-soft: #FDF6E9;
  --info: #6B3FC4; --info-soft: #F4EEFD;
  --shadow: none;
  --shadow-lg: 0 24px 60px -24px rgba(14, 23, 38, 0.35);
  --radius: 16px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --nav-h: 84px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0F17; --surface: #121826; --surface-2: #1A2131; --surface-3: #222A3B; --text: #E9EDF5; --muted: #A3ACBF; --faint: #737D93;
    --border: #232B3C; --border-strong: #2E3749; --line: #1E2535; --accent: #8FA8F0; --accent-2: #A9BDF5; --accent-soft: #1B2540; --mod-2: #6F8BDA;
    --primary-ink: #0B0F17; --pos: #4CC38A; --pos-soft: #12281F; --neg: #F0857A; --neg-soft: #2C1715; --warn: #E8B05A; --warn-soft: #2A2112; --info: #B79CF2; --info-soft: #221A33;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B0F17; --surface: #121826; --surface-2: #1A2131; --surface-3: #222A3B; --text: #E9EDF5; --muted: #A3ACBF; --faint: #737D93;
  --border: #232B3C; --border-strong: #2E3749; --line: #1E2535; --accent: #8FA8F0; --accent-2: #A9BDF5; --accent-soft: #1B2540; --mod-2: #6F8BDA;
  --primary-ink: #0B0F17; --pos: #4CC38A; --pos-soft: #12281F; --neg: #F0857A; --neg-soft: #2C1715; --warn: #E8B05A; --warn-soft: #2A2112; --info: #B79CF2; --info-soft: #221A33;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
html { overflow-x: clip; }
body { font: 17px/1.5 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; min-height: 100vh; font-variant-numeric: tabular-nums; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
h1 { font-size: 25px; margin: 0; letter-spacing: -0.01em; line-height: 1.25; font-weight: 600; }
h2 { font-size: 17px; margin: 0; font-weight: 600; }
h3 { font-size: 16px; margin: 0; font-weight: 600; }
small, .muted { color: var(--muted); }
.faint { color: var(--faint); }
.pos { color: var(--pos); } .neg { color: var(--neg); } .warn-t { color: var(--warn); }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.grad-text { color: var(--accent); }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 24px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; scrollbar-width: none; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; font-weight: 700; font-size: 18px; }
.brand .mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--primary-ink); display: grid; place-items: center; font-weight: 700; font-size: 17px; }
.brand small { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
.side .group { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 16px 10px 6px; font-weight: 600; }
.side .group i { display: none; }
.side a { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 10px; color: var(--text); font-size: 16px; font-weight: 500; transition: background 0.15s; }
.side a:hover { background: var(--surface-2); color: var(--text); }
.side a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side a .ic { width: 20px; height: 20px; display: grid; place-items: center; color: inherit; flex: none; }
.side a .ic .icon { width: 18px; height: 18px; }
.side a .count { margin-left: auto; background: var(--neg); color: #fff; border-radius: 999px; font-size: 13px; padding: 0 7px; font-weight: 600; line-height: 18px; }
.side .spacer { flex: 1; min-height: 12px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 10px 24px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); min-height: 60px; }
.topbar .title { font-weight: 600; font-size: 18px; margin-right: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar .title .crumb { color: var(--muted); font-weight: 500; font-size: 16px; }
.topbar .btn.icon { border-radius: 22px; }
#content { padding: 24px 32px 48px; max-width: 1180px; width: 100%; margin: 0 auto; }
.bottombar { display: none; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar { padding: 8px 12px 8px 20px; padding-top: max(8px, env(safe-area-inset-top)); }
  #content { padding: 16px 16px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
  .bottombar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: start; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--border); padding: 8px 0 env(safe-area-inset-bottom); height: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
  .bottombar a { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 500; }
  .bottombar a .i .icon { width: 24px; height: 24px; }
  .bottombar a.on { color: var(--accent); font-weight: 600; }
  .bottombar .mid { display: flex; justify-content: center; }
  .bottombar .mid button { width: 52px; height: 52px; margin-top: -4px; border-radius: 26px; border: 0; color: var(--primary-ink); background: var(--accent); display: grid; place-items: center; cursor: pointer; transition: transform 0.15s; }
  .bottombar .mid button:active { transform: scale(0.94); }
  .bottombar .mid .icon { width: 24px; height: 24px; stroke-width: 2; }
  .no-mobile { display: none !important; }
}

/* ---------- page pieces ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 16px; }
/* The lead figure of a page: a white card, the number first. */
.hero { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; color: var(--text); }
.hero h1 { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; }
.hero small { color: var(--muted); font-size: 15px; }
.hero p { color: var(--muted); margin: 4px 0 0; font-size: 16px; }
.hero .btn { background: var(--surface); }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
@media (max-width: 560px) { .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hero-stats div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 2px; min-width: 0; }
.hero-stats div b { font-size: 21px; font-weight: 600; }
.hero-stats div span { font-size: 14px; color: var(--muted); }
.hero .quick-entry input { background: var(--surface) !important; border: 1px solid var(--border-strong) !important; box-shadow: none !important; color: var(--text) !important; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.card + .card, .stack > * + * { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.dot-ic { display: none !important; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid > .card + .card, .grid > * + * { margin-top: 0; }
a.card { color: var(--text); transition: border-color 0.15s; }
a.card:hover { border-color: var(--border-strong); color: var(--text); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.kpi .label { font-size: 14px; color: var(--muted); font-weight: 500; }
.kpi .value { font-size: 25px; font-weight: 600; letter-spacing: -0.01em; margin-top: 2px; }
.kpi .note { font-size: 14px; color: var(--muted); margin-top: 2px; }
.kpi.good .value { color: var(--pos); } .kpi.bad .value { color: var(--neg); } .kpi.warn .value { color: var(--warn); }
.kpi .spark { position: absolute; right: 12px; bottom: 10px; width: 64px; height: 24px; }

.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 10px; padding: 0 16px; font: inherit; font-weight: 500; font-size: 16px; cursor: pointer; white-space: nowrap; transition: background 0.15s, border-color 0.15s, transform 0.1s; }
.btn:hover { border-color: var(--border-strong); color: var(--text); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--primary-ink); font-weight: 600; }
.btn.primary:hover { background: var(--accent-2); color: var(--primary-ink); }
.btn.soft { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }
.btn.danger { color: var(--neg); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { height: 32px; padding: 0 12px; font-size: 15px; border-radius: 8px; }
.btn.icon { width: 44px; height: 44px; padding: 0; }
.btn.small.icon { width: 32px; height: 32px; }
.btn.block { width: 100%; height: 52px; border-radius: 12px; font-size: 18px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn .ripple { display: none; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; font-size: 14px; font-weight: 600; padding: 0 8px; border-radius: 11px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.tag.sla, .tag.mod { background: var(--accent-soft); color: var(--accent); }
.tag.mgr { background: var(--info-soft); color: var(--info); }
.tag.bad, .tag.p1 { background: var(--neg-soft); color: var(--neg); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.good { background: var(--pos-soft); color: var(--pos); }

/* Tabs and filters are pill rows. */
.tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 16px; scrollbar-width: none; }
.tabs a, .tabs button { flex: none; height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 18px; font-weight: 500; font-size: 15px; color: var(--text); border: 1px solid var(--border); background: var(--surface); font-family: inherit; cursor: pointer; }
.tabs .on { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters select, .filters input { width: auto; min-width: 140px; height: 40px; }

/* lists */
.list { display: flex; flex-direction: column; }
.item { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); background: var(--surface); transition: transform 0.2s var(--ease); touch-action: pan-y; }
.list > .item:first-child, .list > .list-group + .item { border-top-color: transparent; }
.item.click { cursor: pointer; }
.item.click:hover .title { color: var(--accent); }
.item .body { flex: 1; min-width: 0; }
.item .title { font-weight: 500; font-size: 17px; overflow-wrap: anywhere; }
.item .subt { font-size: 14px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 3px; }
.item .end { display: flex; align-items: center; gap: 6px; flex: none; }
.item.done .title { text-decoration: line-through; color: var(--faint); }
.item .av { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex: none; background: var(--surface-2); color: var(--text); }
.swipe-hint { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 18px; font-weight: 600; color: #fff; z-index: -1; }
.list-group { font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; color: var(--muted); padding: 16px 0 4px; }
.check { width: 26px; height: 26px; border-radius: 13px; border: 2px solid var(--border-strong); background: var(--surface); cursor: pointer; flex: none; display: grid; place-items: center; color: transparent; font-size: 15px; padding: 0; transition: background 0.15s, border-color 0.15s; }
.check:hover { border-color: var(--pos); }
.check.on { background: var(--pos); border-color: var(--pos); color: #fff; }
.empty { text-align: center; color: var(--muted); padding: 24px 10px; display: flex; flex-direction: column; gap: 10px; align-items: center; font-size: 16px; }
.empty .em { display: none; }

.alert-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); font-size: 16px; font-weight: 500; color: var(--text); }
.card-head + .alert-row, .alert-row:first-child { border-top-color: transparent; }
.alert-row::before { content: ""; width: 8px; height: 8px; border-radius: 4px; flex: none; background: var(--faint); }
.alert-row.critical::before { background: var(--neg); }
.alert-row.warning::before { background: var(--warn); }
.alert-row.info::before { background: var(--accent); }
.alert-row span { flex: 1; }
.banner { padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 16px; }
.banner.error { background: var(--neg-soft); border-color: transparent; color: var(--neg); }
.banner.info { background: var(--accent-soft); border-color: transparent; }

/* timer */
.timer-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 4px 4px 4px 12px; font-weight: 600; font-size: 15px; max-width: 42vw; }
.timer-pill .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-pill.break { background: var(--warn-soft); color: var(--warn); }
.timer-pill button { border: 0; background: var(--accent); color: var(--primary-ink); border-radius: 999px; width: 28px; height: 28px; cursor: pointer; font-size: 12px; }
.timer-pill.break button { background: var(--warn); }
.timer-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.timer-card .clock { font-size: 32px; font-weight: 600; letter-spacing: -0.01em; }
.card.running { background: var(--accent); border-color: var(--accent); color: var(--primary-ink); }
.card.running .muted, .card.running .clock { color: var(--primary-ink); }
.card.running .btn.primary { background: var(--primary-ink); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pos); display: inline-block; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.bell { position: relative; }
.bell .badge { position: absolute; top: 6px; right: 6px; background: var(--neg); color: #fff; font-size: 12px; font-weight: 700; border-radius: 999px; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--surface); }

/* rings and bars */
.ring { position: relative; width: var(--size, 96px); height: var(--size, 96px); flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.ring .track { stroke: var(--surface-3); }
.ring .val { transition: stroke-dashoffset 0.9s var(--ease); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-weight: 600; font-size: 17px; line-height: 1.15; }
.ring .lbl small { display: block; font-size: 13px; font-weight: 500; }
.rings { display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-around; }
.rings .r { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; color: var(--muted); }
.bar { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; position: relative; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 3px; transform-origin: left; animation: grow 0.6s var(--ease) both; }
.bar > i.over { background: var(--neg); }
@keyframes grow { from { transform: scaleX(0); } }
.bar .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: 0.45; z-index: 1; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 1.4fr) 3fr auto; gap: 12px; align-items: center; padding: 7px 0; font-size: 15px; }
.bar-row .v { font-weight: 600; min-width: 64px; text-align: right; }
.cols { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 10px; }
.cols .c { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; font-size: 14px; color: var(--muted); min-width: 0; }
.cols .c i { width: 100%; max-width: 40px; background: var(--accent); border-radius: 6px 6px 2px 2px; display: block; min-height: 3px; transform-origin: bottom; animation: rise 0.6s var(--ease) both; }
.cols .c i.ot { background: var(--warn); }
.cols .c b { color: var(--text); font-size: 14px; }
@keyframes rise { from { transform: scaleY(0); } }
.chart-box { position: relative; height: 240px; }
.chart-box.short { height: 190px; }
.chart-box.tall { height: 300px; }

/* board */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.board .col { background: var(--surface-2); border-radius: var(--radius); padding: 10px; min-height: 160px; }
.board .col h3 { padding: 4px 6px 10px; display: flex; justify-content: space-between; }
.board .bcard { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.board .bcard:hover { border-color: var(--border-strong); }
.board .bcard .subt { font-size: 14px; color: var(--muted); margin-top: 4px; display: flex; gap: 4px; flex-wrap: wrap; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 16px; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
td.r, th.r { text-align: right; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--surface-2); }
@media (max-width: 640px) {
  table.rtable thead { display: none; }
  table.rtable tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.rtable td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 0; text-align: right; }
  table.rtable td::before { content: attr(data-label); color: var(--muted); font-weight: 500; text-align: left; font-size: 15px; }
}

/* forms */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 15px; font-weight: 600; color: var(--text); }
input, select, textarea { font: inherit; font-size: 18px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; padding: 0 14px; width: 100%; min-width: 0; height: 48px; transition: border-color 0.15s, box-shadow 0.15s; }
textarea { height: auto; padding: 12px 14px; resize: vertical; min-height: 80px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; padding: 0; accent-color: var(--accent); }
input[type="range"] { height: auto; padding: 0; accent-color: var(--accent); border: 0; background: none; }
input[type="file"] { height: auto; padding: 10px; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form, .form.three { grid-template-columns: 1fr; } }
.inline-check { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 16px; min-height: 44px; }
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg label { height: 40px; display: flex; align-items: center; justify-content: center; padding: 0 14px; border-radius: 9px; cursor: pointer; font-weight: 500; font-size: 16px; color: var(--muted); transition: background 0.15s, color 0.15s; }
.seg input { display: none; }
.seg label:has(input:checked) { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(14, 23, 38, 0.08); }
.seg.wide { display: grid; width: 100%; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips button { height: 40px; border: 1px solid var(--border); background: var(--surface); border-radius: 20px; padding: 0 14px; font: inherit; font-size: 16px; font-weight: 500; color: var(--text); cursor: pointer; }
.chips button:hover { border-color: var(--border-strong); }
.chips button.on { background: var(--accent-soft); border: 1.5px solid var(--accent); color: var(--accent); font-weight: 600; }
.chips.small button { height: 32px; font-size: 15px; padding: 0 12px; }
.legend { font-size: 15px; font-weight: 600; color: var(--muted); margin: 0 0 10px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { display: flex; align-items: center; gap: 6px; font-weight: 500; font-size: 16px; color: var(--text); }
.form-error { color: var(--neg); font-weight: 500; font-size: 16px; margin-top: 10px; }
.checklist-ed .row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.big-amount { height: auto !important; font-size: 51px !important; font-weight: 600; text-align: center; letter-spacing: -0.02em; border: 0 !important; box-shadow: none !important; background: transparent !important; padding: 8px 0 !important; }
.amount-label { text-align: center; font-size: 15px; color: var(--muted); }
.radio-list { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.radio-list label { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 16px; border-top: 1px solid var(--line); font-size: 17px; font-weight: 500; cursor: pointer; }
.radio-list label:first-child { border-top: 0; }
.radio-list label span { flex: 1; }
.radio-list label small { font-size: 15px; font-weight: 400; }
.radio-list .more { width: 100%; height: 48px; border: 0; border-top: 1px solid var(--line); background: none; font: inherit; font-size: 16px; font-weight: 500; color: var(--accent); cursor: pointer; }
.more-toggle { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.more-toggle span { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 16px; font-weight: 500; }
.more-toggle small { font-size: 15px; font-weight: 400; }
.more-toggle .icon { transition: transform 0.2s; }
.more-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 12px; padding: 4px; }
.stepper button { width: 40px; height: 40px; border-radius: 9px; border: 0; background: var(--surface); font: inherit; font-size: 23px; color: var(--text); cursor: pointer; }
.stepper input { width: 56px; height: 40px; border: 0; background: transparent; text-align: center; font-weight: 600; padding: 0; }
.keypad-amt { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; background: var(--surface-2); padding: 10px; border-radius: 16px; }
.keypad-amt button { height: 52px; border-radius: 12px; border: 0; background: var(--surface); font: inherit; font-size: 25px; font-weight: 500; color: var(--text); cursor: pointer; }
.keypad-amt button:active { background: var(--surface-3); }
.step-label { font-size: 15px; font-weight: 500; color: var(--muted); text-align: center; }
.summary-amt { font-size: 32px; font-weight: 600; letter-spacing: -0.02em; }

/* sheet (dialog) */
.sheet { border: 0; padding: 0; color: var(--text); border-radius: 20px; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: var(--shadow-lg); background: var(--surface); }
.sheet[open] { animation: sheet-in 0.22s var(--ease); }
.sheet::backdrop { background: rgba(14, 23, 38, 0.45); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(16px); } }
.sheet form, .sheet .sheet-body { padding: 8px 24px 24px; }
.sheet .sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 -12px 12px; padding-top: 8px; }
.sheet .sheet-head h2 { font-size: 18px; font-weight: 600; flex: 1; text-align: center; }
.sheet .sheet-head::before { content: ""; width: 44px; flex: none; }
.sheet .sheet-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.sheet .sheet-foot .left { margin-right: auto; }
.sheet .sheet-foot .btn.primary { min-width: 140px; height: 48px; }
.sheet .sheet-foot .btn { height: 48px; }
@media (max-width: 560px) {
  .sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 20px 20px 0 0; max-height: 94vh; }
  .sheet[open] { animation: sheet-up 0.25s var(--ease); }
  .sheet form, .sheet .sheet-body { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .sheet .sheet-foot .btn.primary { flex: 1; }
  .sheet .sheet-foot [data-close]:not(.icon) { display: none; }
}
@keyframes sheet-up { from { transform: translateY(100%); } }

#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 500; font-size: 16px; opacity: 0; pointer-events: none; transition: 0.2s var(--ease); z-index: 300; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 900px) { #toast { bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); } }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 400; }

/* tiles (quick add, accounts) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; text-align: left; font: inherit; color: var(--text); }
.tile:hover { border-color: var(--border-strong); color: var(--text); }
.tile .ti { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: var(--surface-2); color: var(--text); }
.tile b { font-size: 16px; font-weight: 600; } .tile small { font-size: 14px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.quick-grid button { display: flex; flex-direction: column; align-items: center; gap: 8px; border: 0; background: none; padding: 0; font: inherit; font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer; }
.quick-grid .qi { width: 56px; height: 56px; border-radius: 16px; background: var(--surface-2); display: grid; place-items: center; color: var(--text); }
.quick-grid button:first-child .qi { background: var(--accent-soft); color: var(--accent); }
.quick-grid .icon { width: 22px; height: 22px; }
.section-label { font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 18px 0 10px; }

/* auth + lock */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.auth .card { width: min(420px, 100%); padding: 32px; }
.auth .brand { padding: 0 0 20px; }
.auth form { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.auth .btn.primary { height: 52px; font-size: 18px; }
.lock { position: fixed; inset: 0; z-index: 250; background: var(--bg); display: grid; place-items: center; padding: 20px; }
.lock .box { width: min(320px, 100%); text-align: center; }
.lock .box img { display: none; }
.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 20px 0; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-strong); }
.pin-dots i.on { background: var(--accent); border-color: var(--accent); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.keypad button { height: 60px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); font: inherit; font-size: 25px; font-weight: 500; color: var(--text); cursor: pointer; }
.keypad button:active { background: var(--surface-2); }

.video { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #1A2232; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

body.privacy .amt { filter: blur(7px); }
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--muted); font-weight: 600; }
.boot img { display: none; }
pre.update { white-space: pre-wrap; background: var(--surface-2); padding: 14px; border-radius: 12px; font: 13px/1.55 ui-monospace, Consolas, monospace; margin: 0; }
.skel { border-radius: 14px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-page { display: grid; gap: 14px; } .skel-page .a { height: 120px; } .skel-page .b { height: 90px; } .skel-page .c { height: 240px; }

/* page entrance: a short fade */
.enter > * { animation: fade-up 0.25s var(--ease) both; animation-delay: calc(var(--i, 0) * 25ms); }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.18s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media print {
  .side, .topbar, .bottombar, .no-print, .tabs { display: none !important; }
  .layout { display: block; }
  #content { padding: 0; max-width: none; }
  body { background: #fff; }
}

.av:empty, .ti:empty { display: none; }
.av .icon { width: 18px; height: 18px; }
.ti .icon { width: 18px; height: 18px; }

.kit-block + .kit-block, .big-amount + .kit-block, textarea + .kit-block { margin-top: 20px; }
.kit-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sheet .kit-block:not(:first-child) { margin-top: 20px; }

/* ---------- full-width, larger layout ---------- */
/* Content uses the whole window (no centred column), with tighter outer margins. */
@media (min-width: 901px) { .layout { grid-template-columns: 264px minmax(0, 1fr); } }
#content { max-width: none; padding: 20px 28px 40px; }
.topbar { padding: 10px 28px; min-height: 64px; }
.card { padding: 20px 22px; }
.grid, .kpis { gap: 14px; }
.card + .card, .stack > * + * { margin-top: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.kpis { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.kpi { padding: 16px 18px; }
.side { padding: 24px 14px; }
.side a { height: 44px; }
.side a .ic .icon { width: 20px; height: 20px; }
/* Bigger controls to match the bigger type. */
.btn { height: 46px; padding: 0 18px; }
.btn.small { height: 38px; padding: 0 14px; }
.btn.icon { width: 48px; height: 48px; }
.btn.small.icon { width: 38px; height: 38px; }
.btn.block { height: 56px; }
input, select { height: 52px; }
.chips button { height: 44px; padding: 0 16px; border-radius: 22px; }
.chips.small button { height: 38px; }
.seg label { height: 46px; }
.tabs a, .tabs button { height: 40px; padding: 0 16px; border-radius: 20px; }
.check { width: 28px; height: 28px; border-radius: 14px; }
.item { padding: 14px 0; gap: 14px; }
.item .av { width: 42px; height: 42px; border-radius: 12px; }
.alert-row { padding: 14px 0; }
.chart-box { height: 290px; }
.chart-box.short { height: 230px; }
.chart-box.tall { height: 360px; }
.sheet { width: min(680px, calc(100vw - 24px)); }
.sheet form, .sheet .sheet-body { padding: 8px 28px 28px; }
.sheet .sheet-foot .btn { height: 52px; }
.keypad-amt button { height: 58px; }
.tile { padding: 16px; }
.tile .ti, .quick-grid .qi { width: 44px; height: 44px; }
.quick-grid .qi { width: 62px; height: 62px; }
@media (max-width: 900px) {
  #content { padding: 14px 12px calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); }
  .topbar { padding: 8px 10px 8px 16px; }
  .card { padding: 16px; }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .sheet form, .sheet .sheet-body { padding: 8px 18px 22px; }
}

/* ---------- money type colours: expense red, income green, self-transfer blue ---------- */
.amt-panel { border-radius: 16px; padding: 18px 18px 14px; text-align: center; transition: background 0.2s; }
.amt-panel .big-amount, .amt-panel .amount-label, .amt-panel .summary-amt { color: inherit !important; }
.amt-panel[data-type="expense"] { background: linear-gradient(135deg, #FBE3E0 0%, #FFF6F4 100%); color: #9F1F14; }
.amt-panel[data-type="income"] { background: linear-gradient(135deg, #DDF1E5 0%, #F3FBF6 100%); color: #0B6440; }
.amt-panel[data-type="transfer"] { background: linear-gradient(135deg, #DFE7FA 0%, #F4F7FE 100%); color: #1E3A8A; }
.seg label:has(input[value="expense"]:checked) { color: #9F1F14; }
.seg label:has(input[value="income"]:checked) { color: #0B6440; }
.seg label:has(input[value="transfer"]:checked) { color: #1E3A8A; }
.item.txn { padding-left: 12px; padding-right: 12px; border-radius: 12px; border-top-color: transparent; margin-top: 6px; }
.item.txn-expense { background: linear-gradient(90deg, #FDEDEB 0%, var(--surface) 70%); }
.item.txn-income { background: linear-gradient(90deg, #E5F4EB 0%, var(--surface) 70%); }
.item.txn-transfer { background: linear-gradient(90deg, #E6ECFA 0%, var(--surface) 70%); }
.item.txn-expense .av { background: #FBE0DC; color: #9F1F14; }
.item.txn-income .av { background: #D6EFE0; color: #0B6440; }
.item.txn-transfer .av { background: #DCE5F8; color: #1E3A8A; }
.item.txn-ledger { background: linear-gradient(90deg, #F6EEDF 0%, var(--surface) 70%); }
.item.txn-ledger .av { background: #F1E3C8; color: #8A5A00; }
:root[data-theme="dark"] .item.txn-ledger { background: linear-gradient(135deg, rgba(224, 162, 58, 0.16), transparent 80%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .item.txn-ledger { background: linear-gradient(135deg, rgba(224, 162, 58, 0.16), transparent 80%); } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .amt-panel[data-type="expense"], :root:not([data-theme="light"]) .item.txn-expense { background: linear-gradient(135deg, rgba(240, 133, 122, 0.18), transparent 80%); color: var(--neg); }
  :root:not([data-theme="light"]) .amt-panel[data-type="income"], :root:not([data-theme="light"]) .item.txn-income { background: linear-gradient(135deg, rgba(76, 195, 138, 0.18), transparent 80%); color: var(--pos); }
  :root:not([data-theme="light"]) .amt-panel[data-type="transfer"], :root:not([data-theme="light"]) .item.txn-transfer { background: linear-gradient(135deg, rgba(143, 168, 240, 0.18), transparent 80%); color: var(--accent); }
}

/* quick entry: input, mic and Add always on one row */
.quick-entry { display: flex; align-items: center; gap: 8px; margin-top: 12px; width: 100%; }
.quick-entry input { flex: 1 1 auto; min-width: 0; height: 52px; }
.quick-entry .btn { flex: 0 0 auto; height: 52px; border-radius: 12px; }
.quick-entry [data-mic] { width: 52px; padding: 0; color: var(--accent); }
.quick-entry [data-q-add] { padding: 0 20px; }
#sheet .section-label { margin: 22px 0 10px; }
#sheet .quick-grid { padding: 0; }

/* ---------- App setup ---------- */
.setup-progress { margin-bottom: 16px; }
.setup { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.setup-nav { display: grid; gap: 4px; position: sticky; top: 84px; }
.setup-nav a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; color: var(--text); text-decoration: none; border: 1px solid transparent; }
.setup-nav a:hover { background: var(--surface-2); }
.setup-nav a.on { background: var(--surface); border-color: var(--border-strong); box-shadow: var(--shadow-sm, 0 1px 2px rgba(15, 23, 42, .06)); }
.setup-nav .sn { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.setup-nav a.on .sn { background: var(--accent); color: #fff; }
.setup-nav a.done .sn { background: var(--good-soft, #DDF1E5); color: var(--good, #0B6440); }
.setup-nav .sn .icon { width: 16px; height: 16px; stroke-width: 2.5; }
.setup-nav .st { display: grid; min-width: 0; }
.setup-nav .st b { font-size: 15px; font-weight: 600; }
.setup-nav .st small { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.setup-pane .card-head h2 { display: flex; align-items: center; gap: 10px; }
.setup-table input { height: 44px; min-width: 0; }
.setup-table td.r input { width: 150px; margin-left: auto; }
.setup-table tr.faded td { opacity: .55; }
.setup-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 4px 0; font-weight: 500; }
.setup-total b { font-size: 20px; }
.setup-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }
.warn-text { color: var(--warn, #9A5B00); }
@media (max-width: 900px) {
  .setup { grid-template-columns: 1fr; }
  .setup-nav { position: static; display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; scroll-snap-type: x mandatory; }
  .setup-nav a { flex: 0 0 auto; scroll-snap-align: start; padding: 8px 12px; }
  .setup-nav .st small { display: none; }
  .setup-foot .btn { flex: 1 1 auto; }
}
.setup-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; color: var(--text); text-decoration: none; border-left: 4px solid var(--accent); }
.setup-banner > span:first-child { display: grid; gap: 2px; }

/* ---------- Landing: sign in / sign up ---------- */
.landing { position: relative; min-height: 100vh; background: var(--bg); overflow-x: hidden; padding: 0 clamp(16px, 4vw, 48px) 32px; }
.landing-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.landing-bg .blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .45; animation: drift 18s ease-in-out infinite alternate; }
.landing-bg .b1 { width: 520px; height: 520px; background: #C9D6F7; top: -160px; left: -120px; }
.landing-bg .b2 { width: 420px; height: 420px; background: #D9EFE3; top: 180px; right: -140px; animation-duration: 22s; }
.landing-bg .b3 { width: 360px; height: 360px; background: #F6E3D5; bottom: -120px; left: 30%; animation-duration: 26s; opacity: .35; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(40px, 30px) scale(1.08); } }
.landing > *:not(.landing-bg) { position: relative; z-index: 1; }
.landing-top { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; padding: 20px 0; }
.landing-top .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.landing-top .brand small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.landing-main { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, 440px); gap: clamp(24px, 5vw, 72px); align-items: center; max-width: 1200px; margin: 0 auto; padding: clamp(12px, 4vh, 48px) 0 48px; }
.landing-hero .eyebrow { margin: 0 0 12px; font-size: 14px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.landing-hero h1 { margin: 0; font-size: clamp(34px, 5vw, 56px); line-height: 1.08; letter-spacing: -.02em; }
.landing-hero .swap { display: inline-block; color: var(--accent); }
.landing-hero [data-swap] { display: inline-block; transition: opacity .3s ease, transform .3s ease; }
.landing-hero [data-swap].out { opacity: 0; transform: translateY(12px); }
.landing-hero .lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); max-width: 560px; margin: 18px 0 24px; line-height: 1.55; }
.rise { opacity: 0; transform: translateY(18px); animation: rise .7s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: calc(var(--d, 0) * 110ms + 80ms); }
@keyframes rise { to { opacity: 1; transform: none; } }

.typer { display: grid; gap: 8px; max-width: 520px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow-lg); }
.typer-in, .typer-out { display: flex; align-items: center; gap: 10px; min-height: 28px; }
.typer-label { flex: 0 0 104px; font-size: 13px; color: var(--muted); }
.typer code { font-size: 16px; background: var(--surface-2); padding: 3px 8px; border-radius: 8px; }
.caret { width: 2px; height: 20px; background: var(--accent); animation: blink 1s steps(1) infinite; margin-left: -6px; }
@keyframes blink { 50% { opacity: 0; } }
.typer-out b { font-weight: 600; color: #0B6440; opacity: 0; transform: translateX(-6px); transition: opacity .35s ease, transform .35s ease; }
.typer-out b.show { opacity: 1; transform: none; }

.mock { position: relative; height: 210px; margin-top: 28px; max-width: 560px; }
.mock-card { position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow-lg); display: grid; gap: 6px; animation: float 6s ease-in-out infinite; }
.mock-card small { color: var(--muted); font-size: 13px; }
.mock .m1 { left: 0; top: 0; width: 250px; }
.mock .m1 b { font-size: 26px; }
.mock .m2 { left: auto; right: 0; top: 34px; width: 210px; grid-template-columns: 56px 1fr; align-items: center; animation-delay: -2s; }
.mock .m2 small { grid-column: 1 / -1; }
.mock .m2 span { display: grid; }
.mock .m3 { left: 60px; top: 132px; width: 260px; animation-delay: -4s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.spark { display: flex; align-items: flex-end; gap: 6px; height: 46px; }
.spark i { flex: 1; height: var(--h); background: linear-gradient(180deg, var(--accent), #8FA8F0); border-radius: 4px 4px 2px 2px; transform-origin: bottom; transform: scaleY(0); animation: grow .8s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: calc(900ms + var(--i) * 90ms); }
@keyframes grow { to { transform: scaleY(1); } }
.mring { width: 56px; height: 56px; transform: rotate(-90deg); }
.mring circle { fill: none; stroke: var(--surface-2); stroke-width: 7; }
.mring .fill { stroke: #0F7A4F; stroke-linecap: round; stroke-dasharray: 163.4; stroke-dashoffset: 163.4; animation: ring 1.4s cubic-bezier(.2, .7, .2, 1) 1.1s forwards; }
@keyframes ring { to { stroke-dashoffset: 40.8; } }
.mbar { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.mbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #0F7A4F, #E0A23A); border-radius: 6px; animation: fillbar 1.4s cubic-bezier(.2, .7, .2, 1) 1.3s forwards; }
@keyframes fillbar { to { width: 65%; } }

.auth-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 22px; box-shadow: var(--shadow-lg); }
.auth-tabs { margin-bottom: 6px; display: flex; }
.auth-tabs button { flex: 1; border: 0; background: none; font: inherit; font-weight: 600; padding: 10px; border-radius: 10px; color: var(--muted); cursor: pointer; transition: background .2s, color .2s; }
.auth-tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(14, 23, 38, .12); }
.auth-slides { display: grid; overflow: hidden; }
.auth-form { grid-area: 1 / 1; display: flex; flex-direction: column; gap: 14px; padding: 14px 2px 4px; transition: opacity .35s ease, transform .35s cubic-bezier(.2, .7, .2, 1), visibility .35s; }
.auth-form h2 { margin: 0; font-size: 24px; }
.auth-form > p.muted { margin: -8px 0 0; }
.auth-slides[data-mode="login"] [data-form="signup"], .auth-slides[data-mode="signup"] [data-form="login"] { opacity: 0; visibility: hidden; pointer-events: none; }
.auth-slides[data-mode="login"] [data-form="signup"] { transform: translateX(40px); }
.auth-slides[data-mode="signup"] [data-form="login"] { transform: translateX(-40px); }
.auth-form .btn.primary { height: 52px; font-size: 18px; position: relative; }
.auth-form .btn.busy { color: transparent; }
.auth-form .btn.busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-form.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.pw { position: relative; display: block; }
.pw input { width: 100%; padding-right: 48px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: none; color: var(--muted); border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.pw-eye.on { color: var(--accent); }
.pw-meter { height: 6px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: -6px; }
.pw-meter i { display: block; height: 100%; width: 0; border-radius: 4px; background: #B42318; transition: width .3s ease, background .3s ease; }
.pw-meter i[data-level="ok"] { background: #E0A23A; }
.pw-meter i[data-level="strong"] { background: #0F7A4F; }
.small-print { font-size: 14px; text-align: center; margin: 0; }
.trust { display: grid; gap: 6px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.trust span { display: flex; align-items: center; gap: 8px; }
.trust .icon { width: 16px; height: 16px; color: #0F7A4F; }

.landing-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 1200px; margin: 0 auto; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 20px; transition: transform .25s ease, box-shadow .25s ease; }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature .fi { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.feature h3 { margin: 14px 0 6px; font-size: 18px; }
.feature p { margin: 0; color: var(--muted); line-height: 1.5; }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--d) * 80ms); }
.reveal.in { opacity: 1; transform: none; }
.landing-foot { text-align: center; margin: 32px 0 0; font-size: 14px; }

@media (max-width: 980px) {
  .landing-main { grid-template-columns: 1fr; }
  .mock { display: none; }
  .landing-features { grid-template-columns: 1fr 1fr; }
  .typer-label { flex-basis: 84px; }
}
@media (max-width: 560px) {
  .landing-features { grid-template-columns: 1fr; }
  .landing-top .btn.ghost { display: none; }
  .auth-panel { padding: 16px; }
  .typer-in, .typer-out { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .rise, .reveal, .mock-card, .landing-bg .blob, .caret { animation: none !important; transition: none !important; opacity: 1 !important; transform: none !important; }
  .spark i { animation: none; transform: none; }
  .mring .fill { animation: none; stroke-dashoffset: 40.8; }
  .mbar i { animation: none; width: 65%; }
}
:root[data-theme="dark"] .landing-bg .blob { opacity: .14; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .landing-bg .blob { opacity: .14; } }

/* ---------- Accounts as real cards ---------- */
.wallet-shelf { margin-bottom: 28px; }
.shelf-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 14px; }
.shelf-head h2 { margin: 0; font-size: 21px; }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px 24px; }
.pslot { display: grid; gap: 0; perspective: 1100px; animation: deal .6s cubic-bezier(.2, .7, .2, 1) both; }
.pcards .pslot:nth-child(2) { animation-delay: 70ms; } .pcards .pslot:nth-child(3) { animation-delay: 140ms; } .pcards .pslot:nth-child(4) { animation-delay: 210ms; } .pcards .pslot:nth-child(n+5) { animation-delay: 280ms; }
@keyframes deal { from { opacity: 0; transform: translateY(26px) rotate(-2deg); } to { opacity: 1; transform: none; } }

.pcard {
  --rx: 0deg; --ry: 0deg; --mx: 30%; --my: 20%;
  position: relative; aspect-ratio: 1.586; border-radius: 18px; padding: 18px 20px; color: #fff; cursor: pointer; overflow: hidden; isolation: isolate;
  display: grid; grid-template-rows: auto 1fr auto auto; gap: 6px;
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--c2) 85%, #fff 15%) 0%, transparent 55%),
    radial-gradient(90% 120% at 0% 100%, color-mix(in srgb, var(--c1) 80%, #000 20%) 0%, transparent 60%),
    linear-gradient(135deg, var(--c1) 0%, var(--c2) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 -1px 0 rgba(0, 0, 0, .25) inset, 0 2px 4px rgba(14, 23, 38, .12), 0 18px 34px -16px rgba(14, 23, 38, .55);
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d; transition: transform .25s ease, box-shadow .25s ease;
  font-family: inherit; z-index: 1;
}
.pcard:hover { box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 -1px 0 rgba(0, 0, 0, .25) inset, 0 4px 8px rgba(14, 23, 38, .14), 0 30px 46px -18px rgba(14, 23, 38, .6); }
.pcard:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
/* Fine guilloché lines and a soft grain, like printed card stock. */
.pcard::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .16; pointer-events: none;
  background: repeating-radial-gradient(circle at 115% -20%, rgba(255, 255, 255, .55) 0 1px, transparent 1px 9px),
              repeating-linear-gradient(115deg, rgba(255, 255, 255, .25) 0 1px, transparent 1px 7px); mix-blend-mode: overlay; }
/* Light that follows the pointer, plus a slow sweep on hover. */
.pc-shine { position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit;
  background: radial-gradient(60% 60% at var(--mx) var(--my), rgba(255, 255, 255, .28), transparent 60%); mix-blend-mode: soft-light; }
.pc-shine::after { content: ""; position: absolute; inset: -40% -60%; background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .22) 50%, transparent 60%); transform: translateX(-60%); transition: transform 1.1s ease; }
.pcard:hover .pc-shine::after { transform: translateX(60%); }

.pc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; position: relative; z-index: 3; }
.pc-bank { font-weight: 700; font-size: 17px; letter-spacing: .01em; text-shadow: 0 1px 1px rgba(0, 0, 0, .25); max-width: 70%; line-height: 1.2; }
.pc-kind { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; opacity: .8; padding: 3px 8px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; white-space: nowrap; }
.pc-mid { display: flex; align-items: center; gap: 12px; align-self: center; position: relative; z-index: 3; }
.chip { width: 46px; height: 35px; border-radius: 7px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #F7E3A1 0%, #D7B25A 35%, #F3DC8E 55%, #B8913F 100%); box-shadow: inset 0 0 0 1px rgba(110, 80, 20, .55), 0 1px 2px rgba(0, 0, 0, .35); }
.chip i { position: absolute; background: rgba(110, 80, 20, .45); }
.chip i:nth-child(1) { left: 0; right: 0; top: 33%; height: 1px; } .chip i:nth-child(2) { left: 0; right: 0; top: 66%; height: 1px; }
.chip i:nth-child(3) { top: 0; bottom: 0; left: 36%; width: 1px; } .chip i:nth-child(4) { top: 22%; bottom: 22%; left: 36%; right: 36%; width: auto; border: 1px solid rgba(110, 80, 20, .45); background: none; border-radius: 4px; }
.nfc { width: 26px; height: 26px; fill: none; stroke: rgba(255, 255, 255, .85); stroke-width: 1.8; stroke-linecap: round; }
.pc-num { display: flex; gap: 14px; font-family: "SF Mono", "Roboto Mono", ui-monospace, Menlo, Consolas, monospace; font-size: clamp(16px, 1.6vw, 20px); letter-spacing: .1em; text-shadow: 0 1px 1px rgba(0, 0, 0, .35), 0 -1px 0 rgba(255, 255, 255, .12); position: relative; z-index: 3; }
.pc-num .faint-num { font-family: inherit; font-size: 14px; letter-spacing: .04em; opacity: .7; }
.pc-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; position: relative; z-index: 3; }
.pc-bottom small { display: block; font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; opacity: .7; }
.pc-bottom b { font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 190px; }

/* Network marks */
.nw { flex: 0 0 auto; line-height: 1; }
.nw-visa { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 900; font-size: 26px; letter-spacing: .02em; text-shadow: 0 1px 1px rgba(0, 0, 0, .3); }
.nw-mc { display: inline-flex; }
.nw-mc i { width: 30px; height: 30px; border-radius: 50%; display: block; }
.nw-mc i:first-child { background: #EB001B; } .nw-mc i:last-child { background: #F79E1B; margin-left: -12px; mix-blend-mode: screen; opacity: .95; }
.nw-rupay { font-weight: 900; font-style: italic; font-size: 20px; position: relative; padding-right: 16px; }
.nw-rupay b { position: absolute; right: 0; top: 2px; width: 0; height: 0; border-left: 10px solid #F57C00; border-top: 8px solid transparent; border-bottom: 8px solid transparent; }
.nw-rupay b::after { content: ""; position: absolute; left: -6px; top: -2px; border-left: 7px solid #1B8E3E; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.nw-amex { font-weight: 900; font-size: 15px; letter-spacing: .08em; padding: 5px 7px; border: 2px solid rgba(255, 255, 255, .85); border-radius: 4px; }
.nw-diners { font-weight: 700; font-size: 13px; letter-spacing: .04em; }
.nw-upi { font-weight: 900; font-style: italic; font-size: 18px; letter-spacing: .04em; }

/* Kinds */
.pcard-wallet { background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--c2) 80%, #fff 20%) 0%, transparent 55%), linear-gradient(150deg, var(--c1), var(--c2)); }
.pc-walleticon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3); }
.pc-walleticon .icon { width: 24px; height: 24px; }
.pcard-cash::before { opacity: .22; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .35) 0 1px, transparent 1px 12px), radial-gradient(circle at 80% 50%, rgba(255, 255, 255, .35), transparent 35%); }
.pc-cash { align-self: center; justify-self: end; font-size: 64px; font-weight: 800; opacity: .28; line-height: 1; margin-right: 6px; position: relative; z-index: 3; }
.pcard.is-archived { filter: grayscale(.9) brightness(.92); opacity: .7; }

/* The strip under the card, like the card resting in a pocket. */
.pc-info { margin: -14px 10px 0; padding: 24px 16px 14px; background: var(--surface); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 16px 16px; box-shadow: 0 10px 24px -18px rgba(14, 23, 38, .35); }
.pc-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.pc-row small { display: block; color: var(--muted); font-size: 13px; }
.pc-row b { font-size: 21px; }
.pc-row .r { text-align: right; }

/* Colour swatches in the account form */
.swatches button { width: 38px; height: 26px; padding: 0; border-radius: 7px; background: linear-gradient(135deg, var(--c1), var(--c2)); border: 2px solid transparent; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.swatches button.on { border-color: var(--text); transform: scale(1.08); }

@media (max-width: 560px) {
  .pcards { grid-template-columns: 1fr; gap: 22px; }
  .pcard { padding: 16px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .pslot { animation: none; }
  .pcard { transition: none; }
  .pc-shine::after { display: none; }
}
:root[data-theme="dark"] .pcard { box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 18px 34px -14px rgba(0, 0, 0, .8); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pcard { box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 18px 34px -14px rgba(0, 0, 0, .8); } }
.pc-num.pc-num-text { font-family: inherit; letter-spacing: .02em; font-size: 18px; font-weight: 500; }

/* ---------- Budget cards ---------- */
.bcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.bcards-small { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.bcard { --tone: #0F7A4F; --tone-soft: #E3F3EA; position: relative; text-align: left; font: inherit; color: var(--text); cursor: pointer; display: grid; gap: 12px; padding: 18px; border-radius: 20px;
  border: 1px solid var(--border); overflow: hidden; isolation: isolate;
  background: radial-gradient(130% 90% at 100% 0%, var(--tone-soft) 0%, transparent 58%), var(--surface);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 2px 4px rgba(14, 23, 38, .05), 0 16px 32px -22px rgba(14, 23, 38, .45);
  transition: transform .25s ease, box-shadow .25s ease; animation: deal .55s cubic-bezier(.2, .7, .2, 1) both; }
.bcard:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(14, 23, 38, .06), 0 24px 40px -22px rgba(14, 23, 38, .5); }
.bcard::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tone); }
.bcard-near { --tone: #B7791F; --tone-soft: #FBF0DB; }
.bcard-over { --tone: #B42318; --tone-soft: #FBE4E1; }
.bcard-unc { --tone: #B7791F; --tone-soft: #FBF0DB; align-content: start; }
.bcard-none { --tone: var(--border-strong); --tone-soft: transparent; gap: 4px; padding: 14px 16px; }
.bcard-none .bc-ic { margin-bottom: 6px; }
.bcard-none b { font-size: 20px; }
.bc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bc-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--tone-soft); color: var(--tone); border: 1px solid color-mix(in srgb, var(--tone) 25%, transparent); }
.bcard-none .bc-ic { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.bc-ic .icon { width: 20px; height: 20px; }
.bc-name { font-weight: 650; font-size: 17px; flex: 1; min-width: 0; }
.bc-body { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 16px; position: relative; }
.bc-ring { width: 84px; height: 84px; transform: rotate(-90deg); }
.bc-ring circle { fill: none; stroke: var(--surface-2); stroke-width: 8; }
.bc-ring .fill { stroke: var(--tone); stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2, .7, .2, 1); animation: ringin 1.1s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes ringin { from { stroke-dashoffset: 188.5; } }
.bc-pct { position: absolute; left: 0; width: 84px; text-align: center; font-weight: 750; font-size: 20px; color: var(--tone); }
.bc-pct small { font-size: 12px; }
.bc-nums { display: grid; gap: 2px; }
.bc-nums b { font-size: 24px; }
.bc-left { font-weight: 600; font-size: 15px; color: var(--tone); margin-top: 4px; }
.bc-left.neg { color: #B42318; }
.bc-pace { color: var(--muted); font-size: 13px; padding-top: 10px; border-top: 1px dashed var(--border); }

/* ---------- Asset cards ---------- */
.acards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-bottom: 16px; }
.acard { position: relative; text-align: left; font: inherit; color: var(--text); cursor: pointer; padding: 0; border-radius: 22px; overflow: hidden; background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 2px 4px rgba(14, 23, 38, .05), 0 22px 40px -26px rgba(14, 23, 38, .55); transition: transform .3s ease, box-shadow .3s ease; animation: deal .6s cubic-bezier(.2, .7, .2, 1) both; display: flex; flex-direction: column; }
.acard:hover { transform: translateY(-4px); box-shadow: 0 4px 8px rgba(14, 23, 38, .06), 0 32px 50px -26px rgba(14, 23, 38, .55); }
.acard.is-sold { filter: grayscale(.85); opacity: .75; }
.ac-pic { position: relative; aspect-ratio: 16 / 8.5; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(90% 80% at 50% 115%, rgba(255, 255, 255, .55), transparent 60%), radial-gradient(120% 120% at 0% 0%, var(--t2), var(--t1)); }
.ac-pic::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 28%; background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .18)); }
.ac-pic .art { width: 78%; max-height: 82%; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .3)); transition: transform .5s cubic-bezier(.2, .7, .2, 1); position: relative; z-index: 1; }
.acard:hover .ac-pic .art { transform: translateX(6px) scale(1.04); }
.ac-pic.has-photo { background: var(--surface-2); }
.ac-pic.has-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.acard:hover .ac-pic.has-photo img { transform: scale(1.05); }
.ac-badge { position: absolute; top: 12px; right: 12px; z-index: 2; font-size: 13px; font-weight: 650; padding: 5px 10px; border-radius: 999px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.ac-badge.owes { background: rgba(255, 236, 233, .9); color: #9F1F14; }
.ac-badge.paid { background: rgba(225, 245, 234, .9); color: #0B6440; }
.ac-body { padding: 16px 18px 18px; display: grid; gap: 12px; }
.ac-title b { display: block; font-size: 18px; line-height: 1.25; }
.ac-title small { color: var(--muted); font-size: 14px; }
.ac-value { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ac-value small { width: 100%; color: var(--muted); font-size: 13px; }
.ac-value b { font-size: 28px; letter-spacing: -.01em; }
.ac-delta { font-size: 13px; color: var(--muted); background: var(--surface-2); padding: 3px 8px; border-radius: 999px; }
.ac-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.ac-stats small { display: block; color: var(--muted); font-size: 12px; }
.ac-stats b { font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.photo-pick { display: grid; grid-template-columns: 180px 1fr; gap: 14px; align-items: center; }
.photo-pick .ac-pic { border-radius: 14px; }
@media (max-width: 560px) {
  .acards, .bcards { grid-template-columns: 1fr; }
  .photo-pick { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .bcard, .acard { animation: none; transition: none; }
  .bc-ring .fill { animation: none; }
  .ac-pic .art, .ac-pic.has-photo img { transition: none; }
}
:root[data-theme="dark"] .bcard, :root[data-theme="dark"] .acard { box-shadow: 0 18px 34px -20px rgba(0, 0, 0, .8); }
:root[data-theme="dark"] .bcard { --tone-soft: rgba(76, 195, 138, .12); }
:root[data-theme="dark"] .bcard-near, :root[data-theme="dark"] .bcard-unc { --tone: #E0A23A; --tone-soft: rgba(224, 162, 58, .14); }
:root[data-theme="dark"] .bcard-over { --tone: #F0857A; --tone-soft: rgba(240, 133, 122, .14); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bcard, :root:not([data-theme="light"]) .acard { box-shadow: 0 18px 34px -20px rgba(0, 0, 0, .8); }
  :root:not([data-theme="light"]) .bcard { --tone-soft: rgba(76, 195, 138, .12); }
  :root:not([data-theme="light"]) .bcard-near, :root:not([data-theme="light"]) .bcard-unc { --tone: #E0A23A; --tone-soft: rgba(224, 162, 58, .14); }
  :root:not([data-theme="light"]) .bcard-over { --tone: #F0857A; --tone-soft: rgba(240, 133, 122, .14); }
}

/* =====================================================================
   Premium layer — refines the calm-fintech look: depth, ink-blue hero
   panels, glass chrome, sharper type. Loaded last; overrides earlier rules.
   ===================================================================== */
:root {
  --shadow-1: 0 1px 2px rgba(14, 23, 38, .04), 0 1px 1px rgba(14, 23, 38, .03);
  --shadow-2: 0 1px 2px rgba(14, 23, 38, .04), 0 8px 24px -12px rgba(14, 23, 38, .18);
  --shadow-3: 0 2px 6px rgba(14, 23, 38, .06), 0 24px 48px -24px rgba(14, 23, 38, .35);
  --ink-1: #0B1530; --ink-2: #13245A; --ink-3: #1E3A8A; --ink-4: #3557C2;
  --ring-focus: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
}
body { background: radial-gradient(1200px 600px at 100% -10%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%), var(--bg); background-attachment: fixed; font-feature-settings: "cv11", "ss01", "tnum"; }
h1, .page-head h1 { font-weight: 700; letter-spacing: -0.025em; }
.page-head h1 { font-size: 30px; }
.page-head p { font-size: 15.5px; }
.amt, .num { font-feature-settings: "tnum"; letter-spacing: -0.01em; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

/* Surfaces: a hairline border plus soft layered depth */
.card, .kpi, .tile { box-shadow: var(--shadow-2); border-color: color-mix(in srgb, var(--border) 85%, transparent); }
.card { border-radius: 18px; padding: 20px; }
.card-head h2 { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
.section-label { letter-spacing: .1em; font-weight: 650; }

/* KPI tiles: a lit top edge and bolder figures */
.kpi { border-radius: 16px; padding: 16px 18px; overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 35%, transparent)); opacity: .85; }
.kpi.good::before { background: linear-gradient(90deg, var(--pos), color-mix(in srgb, var(--pos) 30%, transparent)); }
.kpi.bad::before { background: linear-gradient(90deg, var(--neg), color-mix(in srgb, var(--neg) 30%, transparent)); }
.kpi.warn::before { background: linear-gradient(90deg, var(--warn), color-mix(in srgb, var(--warn) 30%, transparent)); }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-3); }
.kpi .label { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.kpi .value { font-size: 27px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }

/* Hero panels: deep ink blue with a fine light texture */
.hero { position: relative; overflow: hidden; isolation: isolate; color: #fff; border: 0; border-radius: 22px; padding: 24px;
  background: radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--ink-4) 70%, transparent) 0%, transparent 55%),
              radial-gradient(70% 90% at 0% 100%, rgba(0, 0, 0, .35) 0%, transparent 60%),
              linear-gradient(135deg, var(--ink-1) 0%, var(--ink-2) 45%, var(--ink-3) 100%);
  box-shadow: 0 2px 6px rgba(11, 21, 48, .2), 0 30px 60px -30px rgba(11, 21, 48, .65); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5; pointer-events: none;
  background: repeating-radial-gradient(circle at 110% -30%, rgba(255, 255, 255, .07) 0 1px, transparent 1px 14px); }
.hero::after { content: ""; position: absolute; width: 340px; height: 340px; right: -120px; top: -160px; z-index: -1; border-radius: 50%;
  background: radial-gradient(circle, rgba(143, 168, 240, .35), transparent 65%); filter: blur(10px); animation: hero-glow 12s ease-in-out infinite alternate; }
@keyframes hero-glow { to { transform: translate(-40px, 30px) scale(1.1); } }
.hero h1, .hero b, .hero .grad-text { color: #fff; -webkit-text-fill-color: #fff; background: none; }
.hero h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; }
.hero small, .hero p, .hero .muted, .hero-stats div span { color: rgba(226, 233, 250, .72); }
.hero a:not(.btn) { color: #C9D6FF; }
.hero-stats { border-top-color: rgba(255, 255, 255, .14); }
.hero-stats div b { font-size: 23px; font-weight: 700; }
.hero .pos { color: #7EE2B0; } .hero .neg { color: #FFB4AA; }
.hero .btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .18); color: #fff; backdrop-filter: blur(6px); }
.hero .btn:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .3); color: #fff; }
.hero .btn.primary { background: #fff; border-color: #fff; color: var(--ink-3); }
.hero .btn.primary:hover { background: #E9EEFF; color: var(--ink-2); }
.hero .quick-entry input { background: rgba(255, 255, 255, .96) !important; border-color: transparent !important; color: #0E1726 !important; }
.hero .quick-entry [data-mic] { color: #fff; }
.hero .tag { background: rgba(255, 255, 255, .14); color: #fff; border-color: transparent; }
.hero .bar { background: rgba(255, 255, 255, .16); }
.hero svg circle:not([class]) { stroke: rgba(255, 255, 255, .16); }

/* Buttons: depth on primary, crisp focus */
.btn { border-radius: 12px; transition: background .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease), transform .1s; }
.btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #fff 12%), var(--accent)); box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 1px 2px rgba(14, 23, 38, .2), 0 6px 14px -6px color-mix(in srgb, var(--accent) 60%, transparent); }
.btn.primary:hover { background: linear-gradient(180deg, var(--accent), var(--accent-2)); box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 2px 4px rgba(14, 23, 38, .2), 0 10px 20px -8px color-mix(in srgb, var(--accent) 65%, transparent); }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; box-shadow: var(--ring-focus); }
input:focus, select:focus, textarea:focus { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)) !important; box-shadow: var(--ring-focus) !important; }

/* Tabs and segmented controls */
.tabs a, .tabs button { transition: background .2s var(--ease), color .2s var(--ease); }
.tabs .on { background: linear-gradient(180deg, #1A2338, var(--text)); box-shadow: 0 4px 12px -6px rgba(14, 23, 38, .6); }

/* Lists: hover lift on clickable rows */
.item.click { transition: background .15s var(--ease), transform .15s var(--ease); border-radius: 12px; }
.item.click:hover { background: var(--surface-2); }

/* Sidebar: logo, sliding marker, profile card */
.side { background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.brand .mark-img { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 4px 12px -4px rgba(30, 58, 138, .55); }
.brand { font-size: 19px; letter-spacing: -0.01em; }
.side a { position: relative; transition: background .18s var(--ease), color .18s var(--ease); }
.side a.on { background: linear-gradient(90deg, var(--accent-soft), color-mix(in srgb, var(--accent-soft) 40%, transparent)); }
.side a.on::before { content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); animation: marker .25s var(--ease); }
@keyframes marker { from { transform: scaleY(.2); opacity: 0; } }
.side a .count { box-shadow: 0 2px 6px -2px color-mix(in srgb, var(--neg) 70%, transparent); }
.me-card { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-1); }
.me-card .avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; flex: none;
  background: linear-gradient(135deg, var(--ink-3), var(--ink-4)); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.me-card .who { min-width: 0; flex: 1; display: grid; line-height: 1.25; }
.me-card .who b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-card .who small { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .me-card a.logout { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 10px; color: var(--muted); flex: none; }
.side .me-card a.logout:hover { background: var(--neg-soft); color: var(--neg); }
.side .me-card a.logout .icon { width: 18px; height: 18px; }

/* Top bar: frosted glass */
.topbar { background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.topbar .title > span:last-child { font-weight: 700; letter-spacing: -0.01em; }

/* Sheets: softer backdrop, lifted panel */
.sheet { box-shadow: 0 40px 80px -30px rgba(11, 21, 48, .55), 0 0 0 1px color-mix(in srgb, var(--border) 80%, transparent); }
.sheet::backdrop { background: rgba(11, 18, 36, .5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.sheet .sheet-head h2 { font-weight: 700; letter-spacing: -0.01em; }

/* Toast: dark glass pill */
#toast { background: rgba(14, 23, 38, .92); color: #fff; border-radius: 14px; backdrop-filter: blur(10px); box-shadow: 0 16px 36px -16px rgba(11, 21, 48, .7); font-weight: 500; }

/* Skeletons shimmer instead of sitting still */
.skel { position: relative; overflow: hidden; }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* Phone: floating glass bottom bar, roomier hero */
@media (max-width: 900px) {
  .bottombar { left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); border-radius: 22px; border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
    background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
    box-shadow: 0 18px 40px -18px rgba(11, 21, 48, .45); }
  .bottombar a.on .i { position: relative; }
  .bottombar a.on .i::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--accent); }
  #fab { background: linear-gradient(135deg, var(--ink-3), var(--ink-4)) !important; box-shadow: 0 10px 22px -8px rgba(30, 58, 138, .7) !important; }
  .hero { padding: 20px 18px; border-radius: 20px; }
  .hero h1 { font-size: 27px; }
  .page-head h1 { font-size: 25px; }
  .hero .quick-entry { gap: 6px; }
  .hero .quick-entry [data-mic] { width: 46px; }
  .hero .quick-entry [data-q-add] { padding: 0 14px; }
}
@media (max-width: 420px) {
  .hero .quick-entry [data-q-add] { width: 46px; padding: 0; font-size: 0; }
  .hero .quick-entry [data-q-add]::before { content: "+"; font-size: 24px; font-weight: 500; line-height: 1; }
}

/* Dark theme tuning */
:root[data-theme="dark"] .card, :root[data-theme="dark"] .kpi, :root[data-theme="dark"] .tile { box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 16px 32px -20px rgba(0, 0, 0, .8); }
:root[data-theme="dark"] .hero { --ink-1: #070D1E; --ink-2: #0E1B44; --ink-3: #1A3176; }
:root[data-theme="dark"] .tabs .on { background: var(--accent); color: #0B0F17; }
:root[data-theme="dark"] .skel::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .card, :root:not([data-theme="light"]) .kpi, :root:not([data-theme="light"]) .tile { box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 16px 32px -20px rgba(0, 0, 0, .8); }
  :root:not([data-theme="light"]) .hero { --ink-1: #070D1E; --ink-2: #0E1B44; --ink-3: #1A3176; }
  :root:not([data-theme="light"]) .tabs .on { background: var(--accent); color: #0B0F17; }
  :root:not([data-theme="light"]) .skel::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .hero::after, .skel::after, .side a.on::before { animation: none; }
  .kpi, .item.click, .btn { transition: none; }
}

/* ---------- Moments ---------- */
.mchips { display: inline-flex; flex-wrap: wrap; gap: 6px; vertical-align: middle; }
.list-group .mchips { margin-left: 10px; }
.mchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 13px; font-weight: 600; line-height: 1.4;
  background: #FDF3E1; color: #8A5A00; border: 1px solid #F3DDB2; cursor: pointer; text-transform: none; letter-spacing: 0; }
.mchip .icon { width: 14px; height: 14px; flex: none; }
.mchip-travel { background: #E8EEFC; color: #1E3A8A; border-color: #CFDAF6; }
.mchip-health { background: #FDEDEB; color: #9F1F14; border-color: #F6D3CE; }
.mchip-family, .mchip-celebration { background: #F3ECFD; color: #5B2BB5; border-color: #E2D4FA; }
.mchip-work { background: #E6F4EC; color: #0B6440; border-color: #CBE8D7; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.link-btn .icon { width: 16px; height: 16px; }
.spike { align-items: center; }
.spike-date { display: grid; text-align: center; min-width: 54px; padding: 6px 8px; border-radius: 12px; background: var(--surface-2); line-height: 1.2; }
.spike-date b { font-size: 15px; } .spike-date small { font-size: 12px; }

.moments { display: grid; gap: 10px; max-width: 860px; }
.moment-card { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 14px; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  padding: 14px 16px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-2, none); transition: transform .2s ease, box-shadow .2s ease; animation: deal .5s cubic-bezier(.2, .7, .2, 1) both; }
.moment-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-3, none); }
.mc-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: #FDF3E1; color: #8A5A00; }
.mk-travel .mc-ic { background: linear-gradient(135deg, #1E3A8A, #3557C2); color: #fff; }
.mk-health .mc-ic { background: #FDEDEB; color: #9F1F14; } .mk-family .mc-ic, .mk-celebration .mc-ic { background: #F3ECFD; color: #5B2BB5; } .mk-work .mc-ic { background: #E6F4EC; color: #0B6440; }
.mc-ic .icon { width: 22px; height: 22px; }
.mc-body { display: grid; gap: 2px; min-width: 0; }
.mc-body b { font-size: 17px; line-height: 1.3; }
.mc-body small { color: var(--muted); font-size: 13px; }
.mc-spend { display: grid; text-align: right; }
.mc-spend b { font-size: 19px; } .mc-spend small { font-size: 12px; }
@media (max-width: 560px) {
  .moment-card { grid-template-columns: 40px minmax(0, 1fr); }
  .mc-ic { width: 40px; height: 40px; }
  .mc-spend { grid-column: 2; text-align: left; display: flex; gap: 8px; align-items: baseline; }
  .list-group .mchips { display: flex; margin: 6px 0 0; }
}
:root[data-theme="dark"] .mchip { background: rgba(224, 162, 58, .14); color: #E8B05A; border-color: transparent; }
:root[data-theme="dark"] .mchip-travel { background: rgba(143, 168, 240, .16); color: #A9BDF5; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mchip { background: rgba(224, 162, 58, .14); color: #E8B05A; border-color: transparent; }
  :root:not([data-theme="light"]) .mchip-travel { background: rgba(143, 168, 240, .16); color: #A9BDF5; }
}
.mc-times { display: inline-flex; align-items: center; gap: 6px; color: var(--accent) !important; font-weight: 600; }
.mc-times .icon { width: 14px; height: 14px; }
