/* pondo. — "Emerald & Champagne Luxe" (stitch_pondo_financial_dashboard/DESIGN.md)
   Triple-black surfaces, mint/emerald primary, champagne jewelry accents.
   Inter for UI, JetBrains Mono for every number. */

/* self-hosted variable fonts (no Google Fonts round-trips through the tunnel) */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/static/fonts/Inter.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap; src: url(/static/fonts/JetBrainsMono.woff2) format('woff2'); }

:root {
  --bg: #0a0a0a;
  --bg-nav: rgba(20, 20, 20, .82);
  --surface: #1a1a1a;
  --surface-2: #201f1f;
  --control: #242424;
  --control-line: #343434;
  --hairline: rgba(255, 255, 255, .05);
  --inset-line: rgba(255, 255, 255, .08);
  --glass: rgba(26, 26, 26, .6);
  --champagne-line: rgba(247, 225, 173, .12);

  --text: #e5e2e1;
  --text-soft: #cfd6d2;
  --text-mid: #9fa8a3;
  --text-dim: #89938d;
  --text-faint: #4a4e4c;

  --ahead: #95d3ba;              /* mint — primary */
  --ahead-deep: #064e3b;         /* deep emerald — containers */
  --ahead-bg: rgba(149, 211, 186, .1);
  --ahead-line: rgba(149, 211, 186, .3);

  --behind: #ffb4ab;             /* muted crimson */
  --behind-bg: rgba(147, 0, 10, .22);
  --behind-line: rgba(255, 180, 171, .28);

  --warn: #d9c593;               /* champagne */
  --warn-text: #f7e1ad;
  --warn-bg: rgba(217, 197, 147, .1);
  --warn-line: rgba(217, 197, 147, .28);

  --emma: #b9a7f5;
  --emma-line: rgba(185, 167, 245, .22);

  --sans: 'Inter', sans-serif;
  --mono: 'JetBrains Mono', monospace;

  --r-frame: 24px;
  --r-card: 24px;
  --r-tile: 16px;
  --r-btn: 12px;
  --r-input: 8px;
  --r-pill: 99px;
  --shadow-card: 0 20px 40px rgba(0, 0, 0, .4);
  --shadow-tile: 0 14px 30px rgba(0, 0, 0, .38);

  --field: #121212;
  --hero-a: #232323;
  --hero-b: #161616;
  --overlay: rgba(6, 6, 6, .88);
  --knob: #e5e2e1;
  --bar-base: var(--control-line);

  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --t-feedback: 120ms;
  --t-state: 180ms;
}

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 110ms var(--ease-out-quint) both vt-out; }
::view-transition-new(root) { animation: 140ms var(--ease-out-quint) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(4px); } }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

html { overscroll-behavior-y: none; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { overscroll-behavior: none; }
/* lock the frame: nothing pans the page sideways — wide content must scroll
   inside its own container (.account-rail, .chip-rail) */
html, body { overflow-x: hidden; max-width: 100%; }
/* desktop: `overflow-x: hidden` on html/body turns body into the scroll
   container, which breaks position: sticky (sidebar) — clip instead */
@media (min-width: 1024px) {
  html, body { overflow-x: clip; }
}
.app-main > * { min-width: 0; }

/* Native shell (Capacitor iOS): safe areas, no web tells */
.app-header { padding-top: calc(24px + env(safe-area-inset-top)); }
html.native .pwa-only { display: none !important; }
html.native .navbar, html.native .btn, html.native .chip, html.native .account-card,
html.native .bucket-tile, html.native .step-card, html.native .collapsed-group,
html.native .seg-tabs, html.native .app-header { -webkit-user-select: none; user-select: none; }
html.native body { -webkit-touch-callout: none; }
html.native .list-row, html.native .inbox-row .desc, html.native .hero .amount { -webkit-user-select: text; user-select: text; }

::selection { background: rgba(149, 211, 186, .3); color: var(--text); }
input, textarea { caret-color: var(--ahead); }
* { scrollbar-width: thin; scrollbar-color: var(--control) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--control); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
a, .btn-quiet { text-underline-offset: 3px; text-decoration-thickness: 1px; }

:focus { outline: none; }
:focus-visible { outline: 2px solid rgba(247, 225, 173, .7); outline-offset: 2px; border-radius: 8px; }
.btn:focus-visible, .chip:focus-visible, .select-pill:focus-visible { border-radius: var(--r-btn); }

a, button, input, select, label { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* Press feedback */
.btn, .chip, .account-card, .bucket-tile, .step-card, .collapsed-group,
.add-btn, .navbar .tab, .tag-pill, .select-pill, .check-circle, .fab {
  transition: transform var(--t-feedback) var(--ease-out-quint),
              background-color var(--t-state) var(--ease-out-quint),
              color var(--t-state) var(--ease-out-quint),
              box-shadow var(--t-state) var(--ease-out-quint),
              opacity var(--t-state) var(--ease-out-quint);
}
.btn:active, .chip:active, .step-card:active, .collapsed-group:active,
.tag-pill:active, .check-circle:active { transform: scale(0.94); }
.account-card:active, .bucket-tile:active { transform: scale(0.985); }
.add-btn:active, .fab:active { transform: scale(0.9); }
.navbar .tab:active { transform: scale(0.94); }

#home-tab, #distribute-body, #banner-slot { transition: opacity var(--t-state) var(--ease-out-quint), transform var(--t-state) var(--ease-out-quint); }
.htmx-swapping { opacity: 0; transform: translateY(4px); }
.htmx-settling { opacity: 1; }

a { color: inherit; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .35 } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes pop { 0% { transform: scale(.6); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* staggered entrance for the main column */
.app-main > *, .dk-pane > * { animation: rise 260ms var(--ease-out-expo) backwards; }
.app-main > *:nth-child(2) { animation-delay: 20ms; }
.app-main > *:nth-child(3) { animation-delay: 40ms; }
.app-main > *:nth-child(4) { animation-delay: 60ms; }
.app-main > *:nth-child(5) { animation-delay: 80ms; }
.app-main > *:nth-child(n+6) { animation-delay: 100ms; }

/* ── App frame ─────────────────────────────────────────────── */
.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
}

.app-header {
  padding: 24px 22px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 700 22px var(--sans);
  letter-spacing: -.02em;
  color: var(--text);
}
.brand .logo-tile {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--ahead-deep);
  color: var(--ahead);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 16px var(--mono);
}
.brand .dot { color: var(--ahead); }
.bell { position: relative; display: inline-flex; width: 34px; height: 34px; border-radius: 10px; align-items: center; justify-content: center; color: var(--text-mid); background: var(--surface); box-shadow: inset 0 0 0 1px var(--hairline); text-decoration: none; }
.bell .badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--behind); color: #fff; font: 700 10px/18px var(--mono); text-align: center; }
.money { transition: filter var(--t-state) var(--ease-out-quint); border-radius: 4px; }
html.hide-money .money, html.hide-money .hero .amount, html.hide-money .glow-hero .amount { filter: blur(7px); -webkit-user-select: none; user-select: none; pointer-events: none; }
.eye-toggle { border: 0; cursor: pointer; font: inherit; color: var(--text-mid); padding: 0; }
.eye-toggle .eye-shut { display: none; }
html.hide-money .eye-toggle .eye-open { display: none; }
html.hide-money .eye-toggle .eye-shut { display: block; }
html.hide-money .eye-toggle { color: var(--warn); }
.notif-row.unread .primary { color: var(--text); font-weight: 700; }
.notif-row.unread::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ahead); flex: 0 0 auto; }
.app-header .today { font: 500 11px var(--mono); color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; }

.app-main {
  flex: 1;
  padding: 8px 16px 118px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.page-title-row { padding: 12px 4px; display: flex; justify-content: space-between; align-items: center; }
.page-title { font: 700 26px var(--sans); letter-spacing: -.02em; color: var(--text); margin: 0; }
.page-title .count { font: 600 16px var(--mono); color: var(--text-dim); }
.back-link { font: 600 13px var(--sans); color: var(--text-mid); text-decoration: none; }
.kicker { font: 600 11px var(--sans); color: var(--text-dim); letter-spacing: .1em; text-transform: uppercase; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 4px 0; }
.section-head .title { font: 700 20px var(--sans); letter-spacing: -.02em; color: var(--text); }
.section-head .aside { font: 600 11px var(--sans); color: var(--ahead); letter-spacing: .08em; text-decoration: none; }

/* ── Floating pill dock ────────────────────────────────────── */
.navbar {
  position: fixed;
  bottom: calc(10px + env(safe-area-inset-bottom));
  left: 12px; right: 12px;
  max-width: 456px;
  margin: 0 auto;
  padding: 8px;
  background: var(--bg-nav);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--hairline);
  border-radius: 28px;
  display: flex;
  align-items: center;
  gap: 2px;
  z-index: 20;
  box-shadow: var(--shadow-card);
}
.navbar .tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-dim);
  text-decoration: none;
  padding: 9px 0 7px;
  border-radius: 20px;
}
.navbar .tab svg { width: 21px; height: 21px; display: block; }
.navbar .tab .lbl { font: 600 9.5px var(--sans); letter-spacing: .02em; }
.navbar .tab.active { color: var(--ahead); background: var(--ahead-deep); }
.navbar .tab:hover { color: var(--text-mid); }
.navbar .tab.active:hover { color: var(--ahead); }
.navbar .add-slot { flex: 0 0 auto; display: flex; justify-content: center; padding: 0 4px; }
.navbar .add-btn {
  width: 52px; height: 52px;
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, #f7e1ad, #d9c593);
  color: #3b2f0a;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .45);
  text-decoration: none;
  border: none;
  cursor: pointer;
}
.add-btn svg { width: 22px; height: 22px; display: block; }
.navbar.offline { opacity: .45; pointer-events: none; }

.add-sheet { display: flex; flex-direction: column; gap: 8px; padding: 4px; }

/* ── Banners ───────────────────────────────────────────────── */
.banner-slot { padding: 4px 16px 0; display: flex; flex-direction: column; gap: 8px; }
.banner { border-radius: var(--r-tile); padding: 13px 16px; display: flex; gap: 12px; align-items: flex-start; }
.banner.warn { background: var(--warn-bg); box-shadow: inset 0 0 0 1px var(--warn-line); }
.banner.warn .mark { font: 700 13px var(--mono); color: var(--warn); }
.banner.warn .text { flex: 1; font: 500 13px/1.5 var(--sans); color: var(--warn-text); }
.banner.warn a { color: var(--warn); }
.banner.offline { background: var(--surface-2); align-items: center; font: 500 13px var(--sans); color: var(--text-soft); }
.banner.offline .pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-mid); animation: pulse 2.4s ease-in-out infinite; }
.banner.emma { background: var(--surface); align-items: center; box-shadow: inset 0 0 0 1px var(--emma-line); font: 500 12.5px var(--sans); color: var(--text-soft); }
.banner.emma .mark { font: 600 14px var(--mono); color: var(--emma); }
.banner.emma a { font: 600 12px var(--mono); color: var(--emma); text-decoration: none; }

.emma-mark { color: var(--emma); }

/* ── Buttons, chips, pills ─────────────────────────────────── */
.btn {
  border: none;
  border-radius: var(--r-btn);
  cursor: pointer;
  font: 600 14px var(--sans);
  padding: 15px;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary {
  background: linear-gradient(180deg, #a9dcc7, #95d3ba);
  color: #003829;
  letter-spacing: .02em;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:disabled, .btn-primary.inert { opacity: .4; cursor: default; }
.btn-emerald { background: linear-gradient(180deg, #0a5f48, #064e3b); color: var(--ahead); }
.btn-ghost { background: var(--control); color: var(--warn-text); font-size: 13px; padding: 10px 18px; }
.btn-ghost:hover { background: #2b2b2b; }
.collapsed-group:hover, .step-card.locked:hover { background: #1f1f1f; }
.chip.neutral:hover { background: #202020; }
.btn-quiet { background: none; color: var(--text-mid); text-decoration: underline; font: 600 12px var(--sans); padding: 0; }
.btn-small { padding: 9px 16px; font-size: 13px; border-radius: 10px; }
.htmx-request.btn, .btn.htmx-request { opacity: .6; }

.chip {
  text-decoration: none;
  border-radius: var(--r-pill);
  padding: 9px 15px;
  font: 600 12px var(--sans);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 2.2s ease-in-out infinite; }
.chip.behind { background: var(--behind-bg); color: var(--behind); box-shadow: inset 0 0 0 1px var(--behind-line); }
.chip.gold { background: var(--warn-bg); color: var(--warn-text); box-shadow: inset 0 0 0 1px var(--warn-line); }
.chip.mint { background: var(--ahead-bg); color: var(--ahead); box-shadow: inset 0 0 0 1px var(--ahead-line); }
.chip.neutral { background: var(--surface); color: var(--text-soft); border: 1px solid var(--hairline); }
.chip.filter-on { background: var(--ahead-bg); color: var(--ahead); box-shadow: inset 0 0 0 1px var(--ahead-line); }

.tag-pill { font: 600 11.5px var(--mono); border-radius: var(--r-pill); padding: 6px 12px; }
.tag-pill.suggested { color: var(--ahead); background: var(--ahead-bg); }

.status-pill {
  font: 600 10px var(--mono);
  border-radius: var(--r-pill);
  padding: 5px 10px;
  letter-spacing: .08em;
}
.status-pill.landed { color: var(--ahead); background: var(--ahead-bg); }
.status-pill.missing { color: var(--behind); background: var(--behind-bg); }
.status-pill.partial { color: var(--warn); background: var(--warn-bg); }

/* ── Inputs ────────────────────────────────────────────────── */
.input {
  border: 1px solid var(--control-line);
  border-radius: var(--r-input);
  padding: 12px 14px;
  font: 500 14px var(--sans);
  background: var(--field);
  color: var(--text);
  outline: none;
  width: 100%;
  transition: border-color var(--t-state) var(--ease-out-quint), box-shadow var(--t-state) var(--ease-out-quint);
}
.input.num-input { font: 500 14px var(--mono); text-align: right; }
.input:focus { border-color: var(--warn); box-shadow: 0 0 0 4px rgba(217, 197, 147, .12); }
.input.invalid { border-color: var(--behind); box-shadow: 0 0 0 4px rgba(255, 180, 171, .12); }
.field-error { font: 500 12px var(--sans); color: var(--behind); }
.field-label { font: 600 10px var(--sans); color: var(--text-dim); letter-spacing: .1em; text-transform: uppercase; }

.select-pill {
  background: var(--field);
  border: 1px solid var(--control-line);
  border-radius: var(--r-input);
  padding: 11px 14px;
  font: 600 13px var(--sans);
  color: var(--text);
  width: 100%;
  cursor: pointer;
  appearance: none;
}

/* toggle switch */
.switch { position: relative; display: inline-block; width: 46px; height: 27px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .knob {
  position: absolute; inset: 0;
  background: var(--control);
  border-radius: var(--r-pill);
  transition: background var(--t-state) var(--ease-out-quint);
  cursor: pointer;
}
.switch .knob::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: var(--knob);
  transition: transform var(--t-state) var(--ease-out-quint), background var(--t-state) var(--ease-out-quint);
}
.switch input:checked + .knob { background: var(--ahead); }
.switch input:checked + .knob::after { transform: translateX(19px); background: #064e3b; }

/* ── Cards & lists ─────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-card); box-shadow: var(--shadow-card); }
.card.flat { box-shadow: none; }
.card.glass { background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-color: var(--champagne-line); }
.card.behind-card { background: var(--behind-bg); box-shadow: inset 0 0 0 1px var(--behind-line); }
.card.warn-card { background: var(--warn-bg); box-shadow: inset 0 0 0 1px var(--warn-line); }
.card.emma-card { box-shadow: inset 0 0 0 1px var(--emma-line); }
.card.outline { background: none; box-shadow: inset 0 0 0 1px var(--inset-line); }

.list { padding: 6px 18px; }
.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
}
.list-row:last-child { border-bottom: none; }
.list-row .value { flex-shrink: 0; white-space: nowrap; font: 600 16px var(--mono); }
.list-row .primary { font: 500 14px var(--sans); color: var(--text-soft); }
.card .secondary, .dk-pane .secondary { font: 400 12.5px/1.5 var(--sans); color: var(--text-dim); }
.list-row .secondary { font: 500 10.5px var(--mono); color: var(--text-dim); margin-top: 2px; }
.value.ahead, .value.inflow { color: var(--ahead); }
.value.behind { color: var(--behind); }

.icon-circle {
  flex: none;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--control);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: var(--text-soft);
}
.icon-circle.mint { background: var(--ahead-bg); color: var(--ahead); }
.icon-circle.gold { background: var(--warn-bg); color: var(--warn-text); }

/* ── Hero (Home) ───────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, var(--hero-a), var(--hero-b) 70%);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 22px 22px 20px;
}
.hero .label { font: 600 11px var(--sans); color: var(--text-dim); letter-spacing: .14em; text-transform: uppercase; }
.hero .amount { font: 700 44px var(--mono); color: var(--text); letter-spacing: -.03em; margin-top: 8px; }
.hero .amount .peso { color: var(--ahead); font-size: 30px; vertical-align: 6px; margin-right: 2px; }
.hero .amount .cents { font-size: 22px; color: var(--text-dim); }
.hero .meta { display: flex; gap: 14px; margin-top: 10px; font: 500 12.5px var(--mono); color: var(--text-mid); }
.hero .meta .mint { color: var(--ahead); }
.hero .chips { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

.seg-tabs { padding: 12px 8px 0; display: flex; gap: 18px; font: 600 13px var(--sans); }
.seg-tabs a, .seg-tabs button { background: none; border: 0; border-radius: 0; font: inherit; cursor: pointer; padding: 0; text-decoration: none; color: var(--text-dim); padding-bottom: 6px; border-bottom: 2px solid transparent; transition: color var(--t-state) var(--ease-out-quint), border-bottom-color var(--t-state) var(--ease-out-quint); }
.seg-tabs a.active, .seg-tabs button.active { color: var(--text); border-bottom-color: var(--ahead); }

/* ── Account carousel ──────────────────────────────────────── */
.account-rail-wrap { padding-top: 8px; perspective: 1100px; }
.account-rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 8px 4px 14px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.account-rail::-webkit-scrollbar { display: none; }
.account-rail .account-card {
  flex: 0 0 80%;
  scroll-snap-align: center;
  transform-style: preserve-3d;
  will-change: transform;
}
.rail-dots { display: flex; justify-content: center; gap: 6px; padding-bottom: 4px; }
.rail-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--control-line); transition: background var(--t-state), transform var(--t-state); }
.rail-dots span.on { background: var(--ahead); transform: scale(1.25); }

/* bank-card face, luxe-toned */
.account-card {
  position: relative;
  overflow: hidden;
  text-decoration: none;
  border-radius: var(--r-card);
  padding: 16px 18px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-tile), inset 0 1px 0 rgba(255, 255, 255, .07);
}
.account-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(130% 90% at 88% -12%, rgba(255, 255, 255, .1), transparent 55%),
    radial-gradient(90% 70% at -10% 110%, rgba(0, 0, 0, .3), transparent 60%);
  pointer-events: none;
}
.account-card > * { position: relative; }
.account-card .top { display: flex; justify-content: space-between; align-items: center; }
.account-card .bank { font: 800 13px var(--sans); letter-spacing: .08em; }
.account-card .meta { font: 500 10px var(--mono); }
.account-card .ctl { opacity: .55; }
.account-card .entry-btn {
  font: 700 11px var(--mono);
  color: #064e3b;
  text-decoration: none;
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ahead);
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .35);
}
.account-card .card-body { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.account-card .chip-row { display: flex; align-items: center; gap: 12px; }
.account-card .chip {
  flex: none;
  width: 36px;
  height: 27px;
  border-radius: 6px;
  background: linear-gradient(135deg, #e6cd88, #b8913c 55%, #97722c);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .45), 0 1px 2px rgba(0, 0, 0, .35);
  position: relative;
  padding: 0;
}
.account-card .chip::after { content: ""; position: absolute; inset: 5px 4px; border: 1px solid rgba(80, 55, 10, .45); border-radius: 4px; }
.account-card .chip::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: rgba(80, 55, 10, .45); }
.account-card .state-line { font: 700 22px var(--mono); letter-spacing: -.01em; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.account-card.state-sent { box-shadow: var(--shadow-tile), inset 0 0 0 1.5px rgba(149, 211, 186, .5); }
.account-card .mask { font: 500 10.5px var(--mono); }
.account-card .card-lines { display: flex; flex-direction: column; gap: 3px; }
.account-card .card-line { display: flex; justify-content: space-between; gap: 8px; font: 500 11px var(--sans); color: rgba(255, 255, 255, .92); }
.account-card .card-line .num { font: 600 11px var(--mono); }
.account-card .card-line.sent { opacity: .5; text-decoration: line-through; }
.account-card .card-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: auto; }
.account-card .holder { font: 700 10.5px var(--mono); letter-spacing: .24em; color: rgba(255, 255, 255, .8); text-shadow: 0 1px 1px rgba(0, 0, 0, .45); }
.account-card .card-role { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
/* brand faces, desaturated toward the luxe palette */
.acct-bdo   { background: linear-gradient(130deg, #0d2547 0%, #113364 55%, #0c2242 100%); }
.acct-bdo .bank { color: #cddcf5; } .acct-bdo .meta, .acct-bdo .mask { color: #8299bd; }
.acct-bdo .holder { color: #d9c593; }
.acct-mother { background: linear-gradient(130deg, #401224 0%, #6b2140 55%, #4a142a 100%); }
.acct-mother .bank { color: #f2cdd9; } .acct-mother .meta, .acct-mother .mask { color: #bc8fa0; }
.acct-bpi   { background: linear-gradient(130deg, #3a0f16 0%, #75141f 55%, #4c1018 100%); }
.acct-bpi .bank { color: #f2ccd1; } .acct-bpi .meta, .acct-bpi .mask { color: #bb8d95; }
.acct-tonik { background: linear-gradient(130deg, #241040 0%, #4c2683 60%, #2d1450 100%); }
.acct-tonik .bank { color: #ddcdf5; } .acct-tonik .meta, .acct-tonik .mask { color: #a08cc4; }
.acct-gcash { background: linear-gradient(130deg, #06306e 0%, #0d54b3 55%, #093c85 100%); }
.acct-gcash .bank { color: #d8e8fb; } .acct-gcash .meta, .acct-gcash .mask { color: #86abd6; }
.acct-maya  { background: linear-gradient(130deg, #0a0d0c 0%, #12211a 60%, #0a110e 100%); }
.acct-maya .bank { color: #95d3ba; } .acct-maya .meta, .acct-maya .mask { color: #6f9484; }
.acct-maya .holder { color: rgba(255, 255, 255, .7); }

/* Bucket tiles */
.bucket-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 10px; }
.bucket-tile { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-tile); padding: 14px 16px; text-decoration: none; display: block; }
.bucket-tile .name { font: 500 12px var(--sans); color: var(--text-mid); }
.bucket-tile .balance { font: 600 18px var(--mono); color: var(--text); margin-top: 3px; }

/* Getting started */
.step-card {
  text-decoration: none;
  border-radius: var(--r-tile);
  padding: 17px 20px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.step-card.primary { background: linear-gradient(180deg, #a9dcc7, #95d3ba); box-shadow: var(--shadow-tile); }
.step-card.primary .step-title, .step-card.primary .n { color: #003829; }
.step-card.locked { background: var(--surface); border: 1px solid var(--hairline); opacity: .65; }
.step-card .n {
  width: 26px; height: 26px;
  border-radius: var(--r-pill);
  display: flex; align-items: center; justify-content: center;
  font: 700 12px var(--mono);
}
.step-card.primary .n { background: rgba(0, 56, 41, .16); }
.step-card.locked .n { background: var(--control); color: var(--text-mid); }
.step-card .step-title { font: 600 14px var(--sans); color: var(--text); }

/* ── Distribute ────────────────────────────────────────────── */
.glow-hero { text-align: center; padding: 18px 8px 6px; }
.glow-hero .label { font: 600 11px var(--sans); color: var(--warn); letter-spacing: .18em; text-transform: uppercase; }
.glow-hero .amount {
  font: 700 46px var(--mono);
  color: var(--ahead);
  letter-spacing: -.03em;
  margin-top: 8px;
  text-shadow: 0 0 34px rgba(149, 211, 186, .35);
}
.glow-hero .amount .cents { font-size: 24px; opacity: .7; }
.glow-hero .chiprow { display: flex; justify-content: center; margin-top: 14px; }

.check-circle {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid var(--control-line);
  background: none;
  cursor: pointer;
  color: transparent;
  font: 700 14px var(--mono);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.check-circle.on { border-color: var(--ahead); background: var(--ahead); color: #064e3b; animation: pop 260ms var(--ease-out-quint); }

.sticky-cta {
  position: fixed;
  bottom: calc(84px + env(safe-area-inset-bottom));
  left: 20px; right: 20px;
  max-width: 440px;
  margin: 0 auto;
  z-index: 19;
  border-radius: var(--r-pill);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
}
.sticky-cta .btn { width: 100%; border-radius: var(--r-pill); padding: 16px; }
.sticky-cta .count-pill { background: rgba(0, 56, 41, .16); font: 600 12px var(--mono); border-radius: var(--r-pill); padding: 5px 12px; }

.inbox-group { border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--hairline); overflow: hidden; box-shadow: var(--shadow-card); }
.inbox-group .group-head { display: flex; justify-content: space-between; align-items: center; padding: 15px 18px 11px; }
.inbox-group .group-title { font: 700 14px var(--sans); letter-spacing: -.01em; color: var(--text); display: inline-flex; align-items: center; gap: 10px; }
.inbox-group .group-title .cnt { font: 500 11px var(--mono); color: var(--text-dim); }
.inbox-row { padding: 13px 18px; border-top: 1px solid var(--hairline); }
.inbox-row.delivered { background: rgba(149, 211, 186, .05); }
.inbox-row .line1 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.inbox-row .when { font: 500 11px var(--mono); color: var(--text-dim); }
.inbox-row .desc { font: 500 14px var(--sans); color: var(--text); margin-top: 2px; }
.inbox-row .amt { font: 600 15px var(--mono); color: var(--ahead); }
.inbox-row .line2 { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.inbox-row .line2.end { justify-content: flex-end; gap: 10px; }
.collapsed-group {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-tile);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  text-decoration: none;
  gap: 12px;
}
.collapsed-group .hint { font: 600 11px var(--sans); color: var(--text-dim); }

/* ── Expenses ──────────────────────────────────────────────── */
.month-nav { display: flex; justify-content: space-between; align-items: center; padding: 4px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-pill); }
.month-nav .title { font: 600 15px var(--sans); color: var(--text); }
.month-nav button, .month-nav a {
  background: none;
  border: none;
  border-radius: var(--r-pill);
  width: 40px; height: 40px;
  font: 600 15px var(--mono);
  color: var(--text-soft);
  cursor: pointer;
  text-decoration: none;
  display: flex; align-items: center; justify-content: center;
}
.month-nav .disabled { color: var(--text-faint); pointer-events: none; }

.chart { display: flex; align-items: flex-end; gap: 5px; height: 64px; margin-top: 16px; }
.chart .bar {
  flex: 1;
  min-width: 5px;
  background: var(--bar-base);
  border-radius: 4px 4px 2px 2px;
  transform-origin: bottom;
  animation: grow 500ms var(--ease-out-expo) backwards;
}
.chart .bar.peak { background: var(--ahead); box-shadow: 0 0 16px rgba(149, 211, 186, .35); }
.chart .bar:nth-child(2) { animation-delay: 40ms; } .chart .bar:nth-child(3) { animation-delay: 80ms; }
.chart .bar:nth-child(4) { animation-delay: 120ms; } .chart .bar:nth-child(5) { animation-delay: 160ms; }
.chart .bar:nth-child(n+6) { animation-delay: 200ms; }

.chip-rail { display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.chip-rail::-webkit-scrollbar { display: none; }
.chip-rail .chip { white-space: nowrap; flex: none; }

.fab {
  position: fixed;
  right: 20px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  width: 58px; height: 58px;
  border-radius: 50%;
  background: linear-gradient(180deg, #a9dcc7, #95d3ba);
  color: #064e3b;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 500 28px var(--sans);
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .5), 0 0 30px rgba(149, 211, 186, .18);
  z-index: 19;
  border: none;
  cursor: pointer;
}

/* ── Income (strategy cards) ───────────────────────────────── */
.strategy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.strategy-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-tile);
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  transition: border-color var(--t-state) var(--ease-out-quint), box-shadow var(--t-state) var(--ease-out-quint);
}
.strategy-card input { position: absolute; opacity: 0; }
.strategy-card .t { font: 600 14px var(--sans); color: var(--text); }
.strategy-card .d { font: 400 11.5px/1.45 var(--sans); color: var(--text-mid); }
.strategy-card:has(input:checked) { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn), 0 0 20px rgba(217, 197, 147, .12); }
.toggle-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-tile); }
.toggle-row .t { font: 600 13.5px var(--sans); color: var(--text); }
.toggle-row .d { font: 500 11.5px var(--mono); color: var(--text-dim); margin-top: 2px; }
.toggle-row .d.crimson { color: var(--behind); }
.toggle-row .grow { flex: 1; }

/* ── Settings ──────────────────────────────────────────────── */
.kv-row { display: flex; justify-content: space-between; font: 500 12.5px var(--sans); color: var(--text-soft); padding: 4px 0; gap: 12px; }
.kv-row .k { color: var(--text-mid); }
.alloc-row { display: flex; flex-direction: column; gap: 6px; padding: 7px 0; }
.alloc-row .line { display: flex; justify-content: space-between; align-items: center; font: 500 13px var(--sans); color: var(--text-soft); }
.alloc-row .line .pct { font: 600 13px var(--mono); color: var(--warn-text); }
.alloc-row .track { height: 7px; border-radius: 4px; background: var(--control); overflow: hidden; }
.alloc-row .fill { height: 100%; border-radius: 4px; background: var(--ahead); transform-origin: left; animation: growx 600ms var(--ease-out-expo) backwards; }
.alloc-row .fill.gold { background: var(--warn); }
@keyframes growx { from { transform: scaleX(0); } }
.sum-bar { height: 6px; border-radius: 3px; background: var(--control); overflow: hidden; display: flex; }
.sum-bar .ok { background: var(--ahead); }
.sum-bar .over { background: var(--behind); }
.pct-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--field);
  border: 1px solid var(--control-line);
  border-radius: var(--r-input);
  padding: 6px 8px 6px 14px;
  color: var(--text-soft);
  font: 500 12.5px var(--sans);
}
.dot-live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ahead); margin-right: 6px; animation: pulse 2.4s ease-in-out infinite; }

.wiz-pill { position: relative; overflow: hidden; cursor: pointer; }
[hidden] { display: none !important; }

/* ── First-run setup modal ─────────────────────────────────── */
.setup-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(6, 78, 59, .5), transparent 60%),
    var(--overlay);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow: hidden;
}
.setup-modal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: calc(100dvh - 36px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  background: var(--surface);
  border: 1px solid var(--champagne-line);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-pop 520ms var(--ease-out-expo) both;
}
@keyframes modal-pop { from { transform: translateY(24px) scale(.94); opacity: 0; } }
/* quirky floaters drifting around the wizard */
.setup-float {
  position: absolute;
  font-size: 26px;
  opacity: .28;
  pointer-events: none;
  animation: drift 7s ease-in-out infinite alternate;
  filter: saturate(.85);
}
@keyframes drift {
  from { transform: translateY(-14px) rotate(-8deg); }
  to   { transform: translateY(16px) rotate(10deg); }
}
.setup-modal .modal-head {
  padding: 20px 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.setup-modal .modal-head .t { font: 800 20px var(--sans); letter-spacing: -.02em; color: var(--text); }
.setup-modal .progress {
  height: 5px;
  border-radius: 3px;
  background: var(--control);
  margin: 14px 22px 0;
  overflow: hidden;
}
.setup-modal .progress .fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--ahead-deep), var(--ahead));
  transition: width 360ms var(--ease-out-expo);
}
.setup-modal .modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 8px;
  -webkit-overflow-scrolling: touch;
}
.setup-modal .modal-foot {
  padding: 12px 22px calc(16px + env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--hairline);
  background: var(--surface);
}
.wiz-step { animation: rise 340ms var(--ease-out-expo) both; }
.wiz-emoji {
  width: 62px; height: 62px;
  border-radius: 20px;
  background: var(--ahead-bg);
  box-shadow: inset 0 0 0 1px var(--ahead-line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin-bottom: 14px;
  animation: pop 420ms var(--ease-out-quint) both;
}
.wiz-title { font: 800 22px/1.2 var(--sans); letter-spacing: -.02em; color: var(--text); }
.wiz-sub { font: 400 13px/1.5 var(--sans); color: var(--text-mid); margin-top: 6px; }
.wiz-back {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-mid);
  font: 600 14px var(--sans);
  padding: 8px 10px;
  border-radius: 10px;
}

/* ── Login ─────────────────────────────────────────────────── */
.login {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  background: var(--bg);
}
.login .logo { font: 700 28px var(--sans); letter-spacing: -.02em; color: var(--text); }
.login .tagline { font: 500 11px var(--mono); color: var(--text-dim); letter-spacing: .14em; }
.login form { display: flex; flex-direction: column; gap: 12px; width: 262px; }
.login .input { padding: 16px 18px; font: 500 16px var(--mono); background: var(--surface); }
.login .btn { padding: 16px; font-size: 15px; }

/* ── Misc ──────────────────────────────────────────────────── */
.note-card {
  border-radius: var(--r-tile);
  padding: 14px 16px;
  box-shadow: inset 0 0 0 1px var(--inset-line);
  font: 400 12.5px/1.55 var(--sans);
  color: var(--text-dim);
}
.footnote { font: 400 11.5px var(--mono); color: var(--text-dim); padding: 0 6px; }
.pulse { animation: pulse 1.2s ease-in-out infinite; }
.section-error { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.section-error .msg { font: 500 13px var(--sans); color: var(--text-mid); }

/* ── Reduced motion ────────────────────────────────────────── */
@keyframes wiggle { 0%,100% { transform: rotate(0); } 30% { transform: rotate(-6deg) scale(1.05); } 60% { transform: rotate(5deg); } }
.wiz-emoji:hover { animation: wiggle 500ms var(--ease-out-quint); }

@media (prefers-reduced-motion: reduce) {
  .setup-float { animation: none !important; }
  *, ::view-transition-old(root), ::view-transition-new(root) {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .account-rail .account-card { transform: none !important; }
}

/* ── Sidebar + desktop layout (≥1024px; the dock owns mobile) ── */
.sidebar { display: none; }
.app-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
/* panes: plain stacks on the phone, grid cells on desktop */
.dk-pane, .dk-grid { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dk-pane > *, .dk-grid > * { min-width: 0; }
.dk-only { display: none !important; }
.dk-greeting { display: none; }
@media (max-width: 1023px) {
  .dk-grid > .dk-pane { display: contents; }
  .tab-off { display: none !important; }
  .mb-order-2 { order: 2; }
}

@media (min-width: 900px) and (max-width: 1023px) {
  .app, .navbar { max-width: 760px; }
  .account-rail .account-card { flex-basis: 46%; }
  .bucket-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .app { max-width: none; margin: 0; display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100dvh; }
  .navbar, .bell, .mb-only, .sticky-cta, .fab, .rail-dots, .seg-tabs { display: none !important; }
  .side-out.eye-toggle svg { width: 18px; height: 18px; }
  .dk-only { display: block !important; }
  .dk-only.dk-row { display: flex !important; }

  /* sidebar */
  .sidebar {
    position: sticky; top: 0; height: 100dvh;
    display: flex; flex-direction: column; gap: 6px;
    padding: 28px 16px 18px;
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
    border-right: 1px solid var(--hairline);
  }
  .sidebar .brand { padding: 0 10px 18px; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; }
  .side-item {
    display: flex; align-items: center; gap: 12px;
    height: 42px; padding: 0 12px;
    border-radius: 14px;
    color: var(--text-mid);
    text-decoration: none;
    font: 600 13.5px var(--sans);
    letter-spacing: -.005em;
    transition: background-color var(--t-state) var(--ease-out-quint), color var(--t-state) var(--ease-out-quint), transform var(--t-feedback) var(--ease-out-quint);
  }
  .side-item svg { width: 19px; height: 19px; flex: none; opacity: .85; }
  .side-item span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-item:hover { background: var(--control); color: var(--text); }
  .side-item:active { transform: scale(.985); }
  .side-item.active { background: var(--ahead-deep); color: var(--ahead); }
  .side-item.active svg { opacity: 1; }
  .side-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--behind); color: #fff; font: 700 10.5px/20px var(--mono); text-align: center; }
  .side-group { font: 700 10px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); padding: 18px 12px 6px; }
  .side-add {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    height: 42px; margin: 8px 0 2px;
    border-radius: 14px;
    background: linear-gradient(180deg, #f7e1ad, #d9c593);
    color: #3b2f0a;
    font: 700 13.5px var(--sans);
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
    transition: transform var(--t-feedback) var(--ease-out-quint), box-shadow var(--t-state) var(--ease-out-quint);
  }
  .side-add svg { width: 18px; height: 18px; }
  .side-add:hover { box-shadow: 0 12px 26px rgba(0, 0, 0, .45); transform: translateY(-1px); }
  .side-add:active { transform: scale(.97); }
  .side-foot { display: flex; align-items: center; gap: 10px; padding: 14px 6px 0; border-top: 1px solid var(--hairline); }
  .side-avatar { width: 32px; height: 32px; border-radius: 10px; background: var(--ahead-deep); color: var(--ahead); display: inline-flex; align-items: center; justify-content: center; font: 700 13px var(--mono); }
  .side-user { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 13px var(--sans); color: var(--text-soft); }
  .side-out { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-dim); text-decoration: none; transition: background-color var(--t-state) var(--ease-out-quint), color var(--t-state) var(--ease-out-quint); }
  .side-out svg { width: 18px; height: 18px; }
  .side-out:hover { background: var(--control); color: var(--text); }

  /* content column — wide, left-anchored, 12-col grid */
  .app-body { width: 100%; max-width: none; margin: 0; padding: 0 44px; }
  .app-header { padding: 36px 0 14px; align-items: flex-end; }
  .app-header .brand { display: none; }
  .app-header > span:last-child { margin-left: auto; }
  .app-header > span[style], .app-header .page-title { font-size: 30px !important; font-weight: 800 !important; letter-spacing: -.03em !important; }
  .app-header .kicker { font-size: 12px; }
  .back-link { font-size: 13px; color: var(--text-dim); padding: 6px 10px; border-radius: 10px; }
  .back-link:hover { background: var(--control); color: var(--text); }
  .banner-slot { padding: 0; }
  .app-main {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 20px 24px;
    padding: 6px 0 72px;
    align-content: start;
  }
  .app-main > * { grid-column: 1 / -1; }
  .app-main > .dk-span-4 { grid-column: span 4; }
  .app-main > .dk-span-5 { grid-column: span 5; }
  .app-main > .dk-span-6 { grid-column: span 6; }
  .app-main > .dk-span-7 { grid-column: span 7; }
  .app-main > .dk-span-8 { grid-column: span 8; }
  .dk-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px 24px; }
  .dk-grid > .dk-span-4 { grid-column: span 4; }
  .dk-grid > .dk-span-5 { grid-column: span 5; }
  .dk-grid > .dk-span-6 { grid-column: span 6; }
  .dk-grid > .dk-span-7 { grid-column: span 7; }
  .dk-grid > .dk-span-8 { grid-column: span 8; }
  .dk-grid > .dk-full { grid-column: 1 / -1; }
  .dk-pane { gap: 14px; }
  .dk-sticky { position: sticky; top: 28px; align-self: start; }
  .dk-form { grid-column: 3 / span 8; max-width: 600px; width: 100%; justify-self: center; }
  .dk-form-wide { grid-column: 2 / span 10; }
  .dk-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

  /* greeting row (Home) */
  .dk-greeting { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 4px 0 6px; }
  .dk-greeting h1 { margin: 0; font: 800 34px/1.1 var(--sans); letter-spacing: -.035em; color: var(--text); }
  .dk-greeting .sub { margin-top: 6px; font: 500 12px var(--mono); color: var(--text-dim); letter-spacing: .08em; text-transform: uppercase; }
  .dk-greeting .actions { display: flex; gap: 8px; }

  /* flat lists: rows on the canvas, no outer card (Wise transactions) */
  .dk-flat { background: none; border: 0; box-shadow: none; padding: 0; }
  .dk-flat .list-row { padding: 14px 6px; border-radius: 12px; transition: background-color var(--t-state) var(--ease-out-quint); }
  .dk-flat .list-row:hover { background: var(--surface); }
  .dk-flat .list-row .primary { font-size: 14.5px; }

  /* section titles */
  .section-head { padding: 4px 2px 0; }
  .section-head .title { font-size: 19px; }

  /* accounts: grid of bank cards, no rail / tilt */
  .account-rail-wrap { perspective: none; padding-top: 4px; }
  .account-rail { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; overflow: visible; scroll-snap-type: none; padding: 4px 0 8px; }
  .account-rail .account-card { flex: none; transform: none !important; opacity: 1 !important; will-change: auto; }
  .bucket-grid { grid-template-columns: repeat(3, 1fr); }

  /* chips wrap instead of scrolling */
  .chip-rail { flex-wrap: wrap; overflow: visible; }

  /* month panel on Home */
  .month-panel { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
  .month-panel .head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
  .month-panel .headline { font: 700 17px var(--sans); letter-spacing: -.02em; color: var(--text); }
  .month-panel .rows { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; }
  .month-panel .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--hairline); font: 500 13px var(--sans); color: var(--text-soft); }
  .month-panel .row .num { font-size: 12.5px; }
  .month-panel .foot { display: flex; gap: 14px; margin-top: 4px; font: 500 12px var(--mono); color: var(--text-mid); }

  /* distribute: in-pane all-sent */
  .dk-allsent .btn { width: 100%; border-radius: var(--r-pill); padding: 15px; }
  .dk-allsent .count-pill { background: rgba(0, 56, 41, .16); font: 600 12px var(--mono); border-radius: var(--r-pill); padding: 5px 12px; }
  .glow-hero { text-align: left; padding: 4px 4px 6px; }
  .glow-hero .chiprow { justify-content: flex-start; }

  /* expenses: inline form always open, under the summary in the left column */
  #add-form { display: flex !important; }
  #add-pane { grid-column: 1 / span 5; }
}
@media (min-width: 1280px) {
  .app-body { padding: 0 56px; }
  .account-rail { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .dk-form { max-width: 640px; }
}
@media (min-width: 1800px) {
  .app-body { padding: 0 72px; }
  .app-main { gap: 24px 32px; }
}
html.light .sidebar { background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%); }
html.light .side-add { background: linear-gradient(180deg, #1d8a67, #14795a); color: #eafff6; box-shadow: 0 8px 20px rgba(60, 55, 40, .2); }
html.light .side-item.active { color: #0b5c43; }

/* ── Light mode (Settings toggle → html.light) ─────────────── */
html.light {
  --bg: #f4f2ee;
  --bg-nav: rgba(255, 255, 255, .82);
  --surface: #ffffff;
  --surface-2: #f7f5f1;
  --control: #ece9e3;
  --control-line: #d9d5cd;
  --hairline: rgba(20, 20, 15, .07);
  --inset-line: rgba(20, 20, 15, .1);
  --glass: rgba(255, 255, 255, .65);
  --champagne-line: rgba(150, 118, 45, .25);

  --text: #1d1c1a;
  --text-soft: #37403b;
  --text-mid: #5a635d;
  --text-dim: #66706a;
  --text-faint: #b3aea6;

  --ahead: #14795a;
  --ahead-deep: #d6efe4;
  --ahead-bg: rgba(20, 121, 90, .1);
  --ahead-line: rgba(20, 121, 90, .3);

  --behind: #b3261e;
  --behind-bg: rgba(179, 38, 30, .08);
  --behind-line: rgba(179, 38, 30, .28);

  --warn: #8a6d1f;
  --warn-text: #6d5615;
  --warn-bg: rgba(160, 130, 60, .13);
  --warn-line: rgba(140, 110, 40, .3);

  --emma: #6a51c7;
  --emma-line: rgba(106, 81, 199, .25);

  --field: #ffffff;
  --hero-a: #ffffff;
  --hero-b: #f3f0ea;
  --overlay: rgba(240, 238, 233, .9);
  --knob: #ffffff;
  --bar-base: #ddd9d1;

  --shadow-card: 0 14px 34px rgba(60, 55, 40, .12);
  --shadow-tile: 0 10px 24px rgba(60, 55, 40, .1);
}
html.light ::selection { background: rgba(20, 121, 90, .2); }
html.light .navbar { box-shadow: var(--shadow-card); }
html.light .navbar .tab.active { background: var(--ahead-deep); color: #0b5c43; }
html.light .btn-primary { background: linear-gradient(180deg, #1d8a67, #14795a); color: #eafff6; }
html.light .step-card.primary { background: linear-gradient(180deg, #1d8a67, #14795a); }
html.light .step-card.primary .step-title, html.light .step-card.primary .n { color: #eafff6; }
html.light .step-card.primary .n { background: rgba(255, 255, 255, .2); }
html.light .sticky-cta .count-pill { background: rgba(255, 255, 255, .22); }
html.light .fab { background: linear-gradient(180deg, #1d8a67, #14795a); color: #eafff6; box-shadow: 0 10px 26px rgba(60, 55, 40, .25); }
html.light .glow-hero .amount { text-shadow: 0 0 30px rgba(20, 121, 90, .22); }
html.light .chart .bar.peak { box-shadow: 0 0 14px rgba(20, 121, 90, .3); }
html.light .setup-overlay { background: radial-gradient(120% 60% at 50% -10%, rgba(20, 121, 90, .18), transparent 60%), var(--overlay); }
html.light .setup-modal { box-shadow: 0 30px 80px rgba(60, 55, 40, .3); }
html.light .switch input:checked + .knob::after { background: #eafff6; }
html.light .account-card { border-color: rgba(20, 20, 15, .12); }
html.light .brand .logo-tile { background: var(--ahead-deep); color: #0b5c43; }
html.light .hero .amount .peso { color: #14795a; }

/* ── Wizard: employment status cards ────────────────────────── */
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.status-card {
  position: relative; display: flex; flex-direction: column; gap: 3px;
  padding: 12px 12px 11px; border-radius: var(--r-tile); cursor: pointer;
  background: var(--control); border: 1px solid var(--control-line);
  transition: background-color var(--t-state) var(--ease-out-quint), border-color var(--t-state) var(--ease-out-quint), transform var(--t-feedback) var(--ease-out-quint);
}
.status-card:active { transform: scale(.97); }
.status-card .e { font-size: 20px; line-height: 1; }
.status-card .t { font: 700 13px var(--sans); color: var(--text); letter-spacing: -.01em; margin-top: 4px; }
.status-card .d { font: 400 11px/1.4 var(--sans); color: var(--text-dim); }
.status-card.on { background: var(--ahead-deep); border-color: var(--ahead-line); }
.status-card.on .t { color: var(--ahead); }
.status-card.on .d { color: var(--text-soft); }
.status-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.status-card.shake { animation: shake 360ms var(--ease-out-quint); }
@keyframes shake { 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }

/* ── Themed confirm dialog (ui.js pondoConfirm) ────────────── */
.cdialog-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: var(--overlay);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade-in 140ms var(--ease-out-quint) both;
}
.cdialog-overlay.out { animation: fade-out 160ms var(--ease-out-quint) both; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.cdialog {
  width: 100%; max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--champagne-line);
  border-radius: 24px;
  padding: 24px 22px 18px;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  animation: modal-pop 320ms var(--ease-out-expo) both;
}
.cdialog-emoji { font-size: 34px; line-height: 1; }
.cdialog-title { font: 800 19px var(--sans); letter-spacing: -.02em; color: var(--text); }
.cdialog-msg { font: 400 13.5px/1.55 var(--sans); color: var(--text-mid); white-space: pre-line; }
.cdialog-actions { display: flex; gap: 8px; width: 100%; margin-top: 8px; }
.cdialog-actions .btn { flex: 1; }
.cdialog-yes.danger { background: linear-gradient(180deg, #c4423a, #a8322b); color: #fff; }

/* ── Themed pickers (ui.js) ────────────────────────────────── */
.cselect-btn, .cdate-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--field);
  border: 1px solid var(--control-line);
  border-radius: var(--r-input);
  padding: 12px 14px;          /* matches .input exactly so rows align */
  font: 500 14px var(--sans);
  line-height: 1.2;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--t-state) var(--ease-out-quint), box-shadow var(--t-state) var(--ease-out-quint);
}
.cselect-btn:focus-visible, .cdate-btn:focus-visible { border-color: var(--warn); box-shadow: 0 0 0 4px rgba(217, 197, 147, .12); outline: none; }
.cselect-btn .chev, .cdate-btn .chev { color: var(--text-dim); font-size: 12px; flex: none; }
.cdate-btn .num { font-size: 13px; }
.input, .cselect-btn, .cdate-btn { min-height: 45px; }
.cselect-btn:disabled { opacity: .45; cursor: default; }
.cpanel {
  position: fixed;
  z-index: 90;
  background: var(--surface);
  border: 1px solid var(--champagne-line);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  max-height: 260px;
  overflow-y: auto;
  animation: rise 200ms var(--ease-out-expo) both;
}
.cpanel-opt {
  display: block;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 12px 15px;
  font: 500 13.5px var(--sans);
  color: var(--text-soft);
  cursor: pointer;
  border-bottom: 1px solid var(--hairline);
}
.cpanel-opt:last-child { border-bottom: none; }
.cpanel-opt:hover { background: var(--ahead-bg); }
.cpanel-opt.on { color: var(--ahead); background: var(--ahead-bg); font-weight: 600; }
.cpanel.cal { padding: 12px; max-height: none; }
.cal-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 10px; }
.cal-title { font: 700 14px var(--sans); color: var(--text); }
.cal-nav {
  width: 32px; height: 32px;
  border: none;
  border-radius: 10px;
  background: var(--control);
  color: var(--text-soft);
  font: 600 16px var(--mono);
  cursor: pointer;
}
.cal-nav:hover { background: var(--ahead-bg); color: var(--ahead); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-dow { text-align: center; font: 700 9.5px var(--sans); color: var(--text-dim); padding: 4px 0; letter-spacing: .08em; }
.cal-day {
  aspect-ratio: 1;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--text-soft);
  font: 500 12.5px var(--mono);
  cursor: pointer;
}
.cal-day:hover { background: var(--control); }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--ahead-line); }
.cal-day.on { background: var(--ahead); color: #064e3b; font-weight: 700; }
html.light .cal-day.on { color: #eafff6; background: #14795a; }
