/* Lightweight mobile-first UI — no external font, library or image request */
:root {
  --bg: #f3f7f4;
  --surface: #ffffff;
  --surface-2: #f7faf8;
  --text: #10241c;
  --muted: #6e7c76;
  --line: #e5ece8;
  --green-950: #063e2c;
  --green-900: #07543a;
  --green-700: #0e8f4d;
  --green-600: #19a45a;
  --green-100: #e7f6ec;
  --red: #f04438;
  --red-soft: #fff0ee;
  --orange: #f59e0b;
  --blue: #2f80ed;
  --purple: #7b3ff2;
  --gold: #f2c94c;
  --shadow: 0 18px 48px rgba(8, 54, 38, .10);
  --soft-shadow: 0 8px 24px rgba(11, 43, 32, .07);
  --radius-lg: 26px;
  --radius-md: 20px;
  --nav-h: 78px;
}

* { box-sizing: border-box; }
html { background: #dbe7e1; }body {
  margin: 0;
  min-height: 100vh;
  height: auto;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 5%, rgba(39, 174, 96, .13), transparent 28rem),
    linear-gradient(135deg, #e6efe9, #f5f8f6);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Bengali", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(25, 164, 90, .22);
  outline-offset: 2px;
}
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.app-shell {
  position: relative;
  width: min(100%, 460px);
  min-height: 100svh;
  margin-inline: auto;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg);
  box-shadow: 0 0 80px rgba(13, 70, 50, .16);
}
.screen {
  display: none;
  min-height: 100svh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
.screen.active { display: block; animation: screenIn .22s ease both; }
@keyframes screenIn { from { opacity: .4; transform: translateY(4px); } }

.hero {
  position: relative;
  min-height: 360px;
  padding: max(20px, env(safe-area-inset-top)) 20px 34px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 84% 30%, rgba(86, 210, 139, .26), transparent 34%),
    linear-gradient(150deg, #073d2c 0%, #07543a 58%, #087249 100%);
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.08);
}
.hero::before { width: 230px; height: 230px; right: -105px; top: 115px; }
.hero::after { width: 150px; height: 150px; right: -65px; top: 156px; }

.top-row, .profile-top, .greeting-row, .balance-head, .section-heading,
.search-row, .budget-numbers, .budget-caption, .sheet-header, .period-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.icon-btn {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 0; border-radius: 14px;
  background: transparent;
  cursor: pointer;
}
.glass-btn { color: #fff; background: rgba(255,255,255,.08); backdrop-filter: blur(8px); }
.notification-dot {
  position: absolute;
  width: 7px; height: 7px;
  margin: -19px 0 0 19px;
  border: 2px solid var(--green-900);
  border-radius: 50%;
  background: #ffcc4d;
}
.greeting-row { margin-top: 22px; align-items: flex-start; gap: 14px; }
.eyebrow { margin: 0 0 4px; color: rgba(255,255,255,.72); font-size: 13px; }
.greeting-row h1, .simple-header h1, .profile-top h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -.4px;
}
.hero-subtitle { margin: 6px 0 0; color: rgba(255,255,255,.72); font-size: 13px; }
.premium-pill, .premium-mini {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  color: #ffe680;
}
.premium-pill {
  flex: 0 0 auto;
  padding: 8px 13px;
  border: 1px solid rgba(242,201,76,.55);
  border-radius: 999px;
  background: rgba(15, 54, 40, .65);
  font-size: 12px; font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}
.premium-pill svg, .premium-mini svg { width: 16px; height: 16px; flex-shrink: 0; }

.balance-card {
  position: relative;
  z-index: 1;
  margin-top: 23px;
  min-height: 150px;
  padding: 21px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255,255,255,.16), rgba(17,131,79,.35));
  box-shadow: 0 18px 42px rgba(0,0,0,.17);
  backdrop-filter: blur(12px);
}
.balance-card::after {
  content: "";
  position: absolute;
  width: 180px; height: 180px;
  right: -92px; bottom: -120px;
  border-radius: 50%;
  background: rgba(100, 222, 150, .18);
}
.balance-head { color: rgba(255,255,255,.72); font-size: 13px; }
.balance-head .icon-btn { width: 34px; height: 34px; color: #fff; background: rgba(255,255,255,.08); }
.balance-value { margin-top: 7px; font-size: 34px; font-weight: 850; letter-spacing: -.8px; }
.balance-value.hidden { letter-spacing: 3px; }
.balance-trend { margin-top: 12px; color: rgba(255,255,255,.75); font-size: 11px; }
.balance-trend span { color: #8af0b1; font-weight: 800; }
.sparkline {
  position: absolute; right: 19px; bottom: 18px;
  width: 132px; height: 52px;
  display: flex; align-items: end; gap: 5px;
  transform: skewX(-10deg);
  opacity: .75;
}
.sparkline i { width: 9px; border-radius: 8px 8px 2px 2px; background: linear-gradient(#72efad, #22a565); }

.page-body { padding: 0 17px 22px; }
.home-body { margin-top: -34px; position: relative; z-index: 2; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-card {
  min-height: 104px;
  display: flex; align-items: center; gap: 11px;
  padding: 17px 14px;
  border: 1px solid rgba(221,232,226,.9);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}
.stat-icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 13px;
  font-size: 20px; font-weight: 900;
}
.stat-icon.income { color: var(--green-700); background: var(--green-100); }
.stat-icon.expense { color: var(--red); background: var(--red-soft); }
.stat-card span, .stat-card small { display: block; color: var(--muted); font-size: 11px; }
.stat-card strong { display: block; margin: 4px 0; font-size: 17px; }
.positive { color: var(--green-700); }
.negative { color: var(--red); }

.section-card {
  margin-top: 15px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}
.section-heading { gap: 16px; }
.section-heading h2 { margin: 2px 0 0; font-size: 18px; }
.section-kicker { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .2px; }
.text-btn {
  border: 0; background: transparent;
  color: var(--green-700);
  font-size: 12px; font-weight: 800;
  cursor: pointer;
}
.overview-content {
  display: grid;
  grid-template-columns: 142px 1fr;
  align-items: center;
  gap: 15px;
  margin-top: 18px;
}
.donut {
  width: 138px; aspect-ratio: 1;
  display: grid; place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--red) 0 31%, var(--orange) 31% 47%, var(--blue) 47% 61%, #63b7d7 61% 72%, var(--purple) 72% 100%);
}
.donut::before {
  content: "";
  position: absolute;
  width: 91px; aspect-ratio: 1;
  border-radius: 50%;
  background: var(--surface);
}
.donut > div { position: relative; z-index: 1; text-align: center; }
.donut strong { display: block; font-size: 17px; }
.donut span { color: var(--muted); font-size: 10px; }
.legend { display: grid; gap: 9px; }
.legend-row {
  display: grid;
  grid-template-columns: 9px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}
.legend-row i { width: 8px; height: 8px; border-radius: 50%; }
.legend-row span { color: var(--muted); }
.legend-row strong { font-size: 11px; }

.premium-banner {
  position: relative;
  min-height: 180px;
  margin-top: 15px;
  padding: 22px;
  overflow: hidden;
  color: #fff;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 90% 10%, rgba(255,220,95,.22), transparent 28%),
    linear-gradient(145deg, #083e2e, #07623f);
  box-shadow: 0 18px 38px rgba(4, 72, 45, .22);
}
.premium-banner::after {
  content: "";
  position: absolute;
  width: 145px; height: 145px;
  right: -55px; bottom: -70px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
}
.premium-mini { font-size: 10px; font-weight: 900; letter-spacing: 1px; }
.premium-banner h2 { max-width: 250px; margin: 10px 0 7px; font-size: 20px; }
.premium-banner p { max-width: 285px; margin: 0; color: rgba(255,255,255,.72); font-size: 12px; line-height: 1.55; }
.secondary-btn {
  margin-top: 15px;
  padding: 10px 16px;
  border: 0; border-radius: 13px;
  color: var(--green-900);
  background: #fff;
  font-size: 12px; font-weight: 800;
  cursor: pointer;
}
.premium-art {
  position: absolute;
  right: 27px; bottom: 30px;
  color: #ffe15c;
  font-size: 62px; font-weight: 900;
  transform: rotate(-8deg);
  opacity: .92;
}

.transaction-list { margin-top: 12px; }
.transaction-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.transaction-item:last-child { border-bottom: 0; }
.category-icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 15px;
  font-size: 21px;
}
.transaction-main { min-width: 0; }
.transaction-main strong, .transaction-main span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.transaction-main strong { font-size: 14px; }
.transaction-main span, .transaction-side small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.transaction-side { text-align: right; }
.transaction-side strong { display: block; font-size: 14px; }
.day-label {
  margin: 18px 0 3px;
  color: var(--muted);
  font-size: 12px; font-weight: 800;
}

.simple-header {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: max(24px, env(safe-area-inset-top)) 17px 0;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.simple-header h1 { text-align: center; font-size: 23px; }
.search-row { gap: 10px; margin: 20px 0 12px; }
.search-box {
  min-width: 0; flex: 1;
  display: flex; align-items: center; gap: 10px;
  padding: 0 15px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}
.search-box svg { width: 20px; color: var(--muted); }
.search-box input {
  width: 100%;
  border: 0; outline: 0; color: var(--text); background: transparent;
}
.filter-btn { border: 1px solid var(--line); background: var(--surface); }
.filter-tabs, .period-tabs { display: grid; grid-template-columns: repeat(3, 1fr); }
.filter-tabs button, .period-tabs button {
  padding: 13px 10px;
  border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); background: transparent;
  cursor: pointer;
}
.filter-tabs button.active, .period-tabs button.active {
  color: var(--green-700);
  border-bottom-color: var(--green-700);
  font-weight: 800;
}
.transaction-page { padding-top: 2px; }
.full-list { margin-top: 0; }
.empty-state { padding: 70px 24px; text-align: center; color: var(--muted); }
.empty-state div { font-size: 48px; }
.empty-state h2 { margin: 12px 0 6px; color: var(--text); font-size: 17px; }
.empty-state p { margin: 0; font-size: 12px; }

.budget-header { padding-inline: 0; }
.budget-header h1 { padding-inline: 17px; }
.period-tabs { grid-template-columns: 1fr 1fr; margin-top: 14px; }
.budget-page { padding-top: 15px; }
.period-selector { margin-bottom: 13px; }
.period-selector .icon-btn { border: 1px solid var(--line); background: var(--surface); box-shadow: var(--soft-shadow); }
.period-selector strong { font-size: 15px; }
.budget-summary { margin-top: 0; }
.budget-numbers > div { display: grid; gap: 5px; }
.budget-numbers > div:last-child { text-align: right; }
.budget-numbers span, .budget-caption { color: var(--muted); font-size: 11px; }
.budget-numbers strong { font-size: 19px; }
.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ecea;
}
.progress-track span {
  display: block;
  width: 0; height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0e8f4d, #35bf72);
  transition: width .35s ease;
}
.progress-track.big { height: 10px; margin: 19px 0 10px; }
.budget-caption strong { color: var(--green-700); font-size: 11px; }
.budget-list-heading { margin: 22px 2px 8px; }
.budget-list { display: grid; gap: 10px; }
.budget-item {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}
.budget-item-top {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 11px;
  margin-bottom: 12px;
}
.budget-item-top .category-icon { width: 44px; height: 44px; border-radius: 14px; }
.budget-item-top strong, .budget-item-top span { display: block; }
.budget-item-top strong { font-size: 14px; }
.budget-item-top span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.budget-amount { text-align: right; font-size: 12px; }
.budget-amount b { color: var(--text); }
.budget-amount small { display: block; margin-top: 4px; color: var(--muted); }
.budget-daily-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 1px 0 10px;
  padding: 9px 10px;
  border-radius: 11px;
  color: var(--green-700);
  background: var(--green-100);
  font-size: 9px;
}
.budget-days-left { color: var(--muted); }
.budget-daily-amount { text-align: right; font-size: 10px; }
.budget-item.warning .budget-daily-guide { background: #fff7e4; }
.budget-item.warning .budget-daily-amount { color: #b56a00; }
.budget-item.danger .budget-daily-guide { background: var(--red-soft); }
.budget-item.danger .budget-daily-amount { color: var(--red); }
.budget-item.danger .progress-track span { background: linear-gradient(90deg, #ff5147, #ff7c70); }
.budget-item.warning .progress-track span { background: linear-gradient(90deg, #f59e0b, #ffbf47); }

.profile-hero {
  padding: max(22px, env(safe-area-inset-top)) 17px 28px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 8%, rgba(255,220,95,.16), transparent 24%),
    linear-gradient(145deg, #073d2c, #075d3d);
}
.membership-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 15px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 20px;
  background: rgba(255,255,255,.08);
}
.crown-box {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 15px;
  color: var(--gold);
  background: rgba(242,201,76,.12);
}
.membership-card span, .membership-card strong, .membership-card small { display: block; }
.membership-card span { color: rgba(255,255,255,.72); font-size: 10px; }
.membership-card strong { margin: 3px 0; font-size: 15px; }
.membership-card small { color: rgba(255,255,255,.62); font-size: 9px; }
.small-upgrade {
  padding: 8px 10px;
  border: 0; border-radius: 11px;
  color: var(--green-900); background: #ffe680;
  font-size: 10px; font-weight: 900;
  cursor: pointer;
}
.profile-page { padding-top: 15px; }
.user-card {
  display: grid;
  grid-template-columns: 56px 1fr 24px;
  align-items: center;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}
.avatar {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(145deg, #0e8f4d, #07543a);
  font-weight: 900;
}
.avatar.has-profile-photo,
.profile-avatar-preview.has-profile-photo,
.top-profile-button.app-brand-logo.has-profile-photo {
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.avatar.has-preset-avatar,
.profile-avatar-preview.has-preset-avatar,
.top-profile-button.app-brand-logo.has-preset-avatar {
  font-size: 27px;
  line-height: 1;
}
.top-profile-button.app-brand-logo.has-preset-avatar { font-size: 20px; }
.profile-avatar-editor {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface-2);
}
.profile-avatar-preview {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(14,143,77,.22);
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(145deg, #0e8f4d, #07543a);
  font-size: 17px;
  font-weight: 900;
  overflow: hidden;
}
.profile-avatar-editor-copy b,
.profile-avatar-editor-copy small { display: block; }
.profile-avatar-editor-copy b { font-size: 12px; }
.profile-avatar-editor-copy small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.profile-avatar-presets {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}
.profile-avatar-presets button {
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  font-size: 22px;
}
.profile-avatar-presets button.selected {
  border-color: var(--green-600);
  background: var(--green-100);
  box-shadow: 0 0 0 2px rgba(14,143,77,.12);
}
.profile-photo-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.profile-photo-upload,
.profile-photo-actions button {
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--green-700);
  background: var(--surface);
  font-size: 9px;
  font-weight: 850;
  text-align: center;
}
.profile-photo-actions button { color: var(--red); }
.profile-photo-actions button[hidden] { display: none !important; }
.user-card h2 { margin: 0 0 4px; font-size: 17px; }
.user-card p { margin: 0; color: var(--muted); font-size: 11px; }
.user-card > svg { width: 18px; color: var(--muted); }
.settings-card {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}
.settings-card button {
  width: 100%;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 13px 15px;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  background: transparent;
  cursor: pointer;
}
.settings-card button:last-child { border-bottom: 0; }
.setting-icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 13px;
  color: var(--green-700);
  background: var(--green-100);
}
.setting-icon svg, .settings-card button > svg { width: 19px; }
.settings-card button > svg { color: var(--muted); }
.switch {
  width: 43px; height: 24px;
  padding: 3px;
  border-radius: 999px;
  background: #d6ded9;
}
.switch::after {
  content: "";
  display: block;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,.18);
  transition: transform .2s ease;
}
body.dark .switch { background: var(--green-600); }
body.dark .switch::after { transform: translateX(19px); }
.version { margin: 20px 0 4px; text-align: center; color: var(--muted); font-size: 10px; }

.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 50%; bottom: 0;
  width: min(100%, 460px);
  min-height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr 1fr 70px 1fr 1fr;
  align-items: start;
  padding: 10px 8px env(safe-area-inset-bottom);
  border-top: 1px solid rgba(221,232,226,.95);
  background: rgba(255,255,255,.94);
  box-shadow: 0 -10px 30px rgba(10,56,40,.07);
  backdrop-filter: blur(16px);
}
.nav-item {
  display: grid; place-items: center; gap: 4px;
  padding: 4px 0;
  border: 0;
  color: #83908a; background: transparent;
  font-size: 9px;
  cursor: pointer;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--green-700); font-weight: 800; }
.fab {
  width: 58px; height: 58px;
  display: grid; place-items: center;
  margin: -28px auto 0;
  border: 5px solid var(--surface);
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #16a45b, #08713f);
  box-shadow: 0 9px 22px rgba(6, 111, 63, .34);
  cursor: pointer;
}
.fab svg { width: 28px; height: 28px; stroke-width: 2.2; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(4, 24, 17, .54);
  backdrop-filter: blur(4px);
}
.bottom-sheet {
  position: fixed;
  z-index: 45;
  left: 50%; bottom: 0;
  width: min(100%, 460px);
  max-height: 92svh;
  padding: 11px 19px calc(22px + env(safe-area-inset-bottom));
  overflow-y: auto;
  transform: translateX(-50%);
  border-radius: 28px 28px 0 0;
  background: var(--surface);
  box-shadow: 0 -22px 60px rgba(0,0,0,.22);
  animation: sheetUp .26s ease both;
}
@keyframes sheetUp { from { transform: translate(-50%, 100%); } }
.sheet-handle { width: 46px; height: 5px; margin: 0 auto 15px; border-radius: 99px; background: #d9e0dc; }
.sheet-header h2 { margin: 3px 0 0; font-size: 20px; }
.close-sheet, .close-premium {
  width: 36px; height: 36px;
  border: 0; border-radius: 50%;
  color: var(--muted); background: var(--surface-2);
  font-size: 25px; line-height: 1;
  cursor: pointer;
}
.type-switch {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin: 20px 0 15px;
  padding: 5px;
  border-radius: 15px;
  background: var(--surface-2);
}
.type-switch button {
  padding: 11px;
  border: 0; border-radius: 11px;
  color: var(--muted); background: transparent;
  font-weight: 800;
  cursor: pointer;
}
.type-switch .expense-type.active { color: var(--red); background: var(--surface); box-shadow: var(--soft-shadow); }
.type-switch .income-type.active { color: var(--green-700); background: var(--surface); box-shadow: var(--soft-shadow); }
.bottom-sheet form label { display: grid; gap: 7px; margin-bottom: 13px; }
.bottom-sheet form label > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.bottom-sheet input, .bottom-sheet select {
  width: 100%;
  height: 47px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: var(--surface-2);
}
.amount-field > div {
  display: flex; align-items: center;
  height: 75px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
}
.amount-field b { font-size: 28px; }
.amount-field input {
  height: auto !important;
  border: 0 !important;
  background: transparent !important;
  font-size: 32px;
  font-weight: 850;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.primary-btn {
  width: 100%;
  min-height: 50px;
  border: 0; border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, #13a356, #08703f);
  box-shadow: 0 10px 22px rgba(14, 143, 77, .25);
  font-weight: 850;
  cursor: pointer;
}

.center-modal {
  position: fixed;
  z-index: 45;
  left: 50%; top: 50%;
  width: min(calc(100% - 30px), 410px);
  max-height: 90svh;
  padding: 24px;
  overflow-y: auto;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 28px;
  color: #fff;
  background:
    radial-gradient(circle at 90% 5%, rgba(255,224,90,.20), transparent 25%),
    linear-gradient(145deg, #073d2c, #086341);
  box-shadow: 0 28px 90px rgba(0,0,0,.35);
  animation: modalIn .22s ease both;
}
@keyframes modalIn { from { opacity: 0; transform: translate(-50%, -47%) scale(.97); } }
.close-premium { position: absolute; right: 17px; top: 17px; color: #fff; background: rgba(255,255,255,.1); }
.premium-logo {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  margin-bottom: 15px;
  border-radius: 20px;
  color: #ffe15c;
  background: rgba(242,201,76,.14);
}
.premium-logo svg { width: 34px; height: 34px; }
.center-modal h2 { margin: 11px 0 9px; font-size: 25px; line-height: 1.25; }
.center-modal > p { margin: 0; color: rgba(255,255,255,.72); font-size: 12px; line-height: 1.55; }
.center-modal ul { display: grid; gap: 9px; margin: 18px 0; padding: 0; list-style: none; }
.center-modal li { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.center-modal li svg { width: 18px; color: #77e6a9; }
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.plan-grid button {
  position: relative;
  display: grid; gap: 4px;
  padding: 16px 11px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 17px;
  color: #fff; background: rgba(255,255,255,.07);
  text-align: left;
  cursor: pointer;
}
.plan-grid button.recommended { border-color: rgba(255,225,92,.6); background: rgba(242,201,76,.1); }
.plan-grid span, .plan-grid small { color: rgba(255,255,255,.68); font-size: 10px; }
.plan-grid strong { font-size: 22px; }
.plan-grid em {
  position: absolute; right: 8px; top: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  color: #103d2b; background: #ffe15c;
  font-size: 8px; font-style: normal; font-weight: 900;
}
.center-modal .primary-btn { color: #0b4b34; background: #ffe15c; box-shadow: none; }
.demo-note { display: block; margin-top: 9px; color: rgba(255,255,255,.5); text-align: center; font-size: 9px; }

.toast {
  position: fixed;
  z-index: 60;
  left: 50%; bottom: 96px;
  min-width: 220px;
  padding: 12px 16px;
  transform: translate(-50%, 20px);
  border-radius: 13px;
  color: #fff;
  background: #11271e;
  box-shadow: var(--shadow);
  text-align: center;
  font-size: 12px;
  opacity: 0; pointer-events: none;
  transition: .22s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

body.dark {
  --bg: #0d1713;
  --surface: #14231c;
  --surface-2: #192a22;
  --text: #edf8f2;
  --muted: #96a9a0;
  --line: #273a31;
  --shadow: 0 18px 48px rgba(0,0,0,.25);
  --soft-shadow: 0 8px 24px rgba(0,0,0,.18);
}
body.dark { background: #06100b; }
body.dark .simple-header, body.dark .bottom-nav { background: rgba(20,35,28,.95); }
body.dark .donut::before { background: var(--surface); }
body.dark input, body.dark select { color-scheme: dark; }

@media (min-width: 720px) {body { padding: 22px 0; }
  .app-shell { min-height: calc(100svh - 44px); border-radius: 34px; }
  .screen { min-height: calc(100svh - 44px); }
  .bottom-nav { bottom: 22px; border-radius: 0 0 34px 34px; }
  .bottom-sheet { bottom: 22px; border-radius: 28px; }
}
@media (max-width: 370px) {
  .hero { padding-inline: 14px; }
  .page-body { padding-inline: 12px; }
  .overview-content { grid-template-columns: 120px 1fr; gap: 10px; }
  .donut { width: 116px; }
  .donut::before { width: 78px; }
  .legend-row { gap: 5px; }
  .premium-pill { padding-inline: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}


/* Critical mobile layout fixes */
@media (max-width: 460px) {
  .bottom-nav {
    left: 0;
    width: 100%;
    transform: none;
  }
}

/* v1.1: backup tools and clean empty states */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.settings-card button > span:nth-child(2) b,
.settings-card button > span:nth-child(2) small {
  display: block;
}
.settings-card button > span:nth-child(2) b {
  font-size: 13px;
  font-weight: 700;
}
.settings-card button > span:nth-child(2) small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}
.inline-empty {
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 145px;
  padding: 24px 16px;
  color: var(--muted);
  text-align: center;
}
.inline-empty > div {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--green-700);
  background: var(--green-100);
  font-size: 24px;
}
.inline-empty strong {
  margin-top: 4px;
  color: var(--text);
  font-size: 14px;
}
.inline-empty span {
  max-width: 260px;
  font-size: 10px;
  line-height: 1.5;
}
.empty-mini {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}
.load-more-btn {
  width: 100%;
  margin: 16px 0 4px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--green-700);
  background: var(--surface);
  font-weight: 800;
  cursor: pointer;
}


/* v1.2 — monthly dashboard, carry over and custom transaction keypad */
.balance-meta {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: rgba(255,255,255,.72);
  font-size: 10px;
}
.carry-over-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 999px;
  background: rgba(0,0,0,.10);
}
.carry-over-chip strong { color: #a2f3c1; font-size: 11px; }
.balance-meta + .sparkline { bottom: 21px; opacity: .58; }

.transaction-step { display: none; }
.transaction-step.active { display: block; animation: stepIn .18s ease both; }
@keyframes stepIn { from { opacity: 0; transform: translateX(8px); } }
.step-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 13px;
}
.step-title-row h3 { margin: 3px 0 0; font-size: 18px; }
.step-number {
  color: var(--green-700);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.keyboard-lock {
  padding: 7px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 9px;
  font-weight: 800;
}
.custom-amount-display {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(14,143,77,.24);
  border-radius: 21px;
  background: linear-gradient(145deg, var(--surface-2), var(--surface));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.45), var(--soft-shadow);
}
.custom-amount-display b { color: var(--green-700); font-size: 28px; }
.custom-amount-display output {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(34px, 10vw, 46px);
  font-weight: 900;
  letter-spacing: -.8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quick-transaction-fields {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 9px;
  margin-top: 10px;
}
.quick-transaction-fields label { min-width: 0; }
.quick-transaction-fields label > span {
  display: block;
  margin: 0 0 5px 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.quick-transaction-fields label > span small { font-weight: 500; }
.quick-transaction-fields input {
  height: 42px;
  min-width: 0;
  padding: 0 11px;
  border-radius: 13px;
  font-size: 12px;
}
.quick-transaction-fields input:focus {
  border-color: var(--green-600);
  box-shadow: 0 0 0 2px rgba(25,164,90,.10);
}
#addTransactionSheet #transactionSheetKicker { display: none; }
#addTransactionSheet .sheet-handle { margin-bottom: 9px; }
#addTransactionSheet .sheet-header {
  margin-bottom: 2px;
  padding-bottom: 6px;
}
#addTransactionSheet .sheet-header h2 {
  margin-top: 0;
  font-size: 19px;
}
#addTransactionSheet #amountStep .step-title-row { margin: 8px 0 10px; }
#addTransactionSheet #amountStep .step-title-row h3 {
  margin-top: 1px;
  font-size: 16px;
}
#addTransactionSheet #amountStep .step-number { font-size: 9px; }
#addTransactionSheet #amountStep .keyboard-lock {
  padding: 6px 8px;
  font-size: 8px;
}
#addTransactionSheet #categoryGrid {
  max-height: none;
  overflow-y: visible;
  overscroll-behavior: auto;
}
.custom-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 13px 0;
}
.custom-keypad button {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 5px 14px rgba(10,56,40,.05);
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}
.custom-keypad button:active { transform: scale(.97); background: var(--green-100); }
.custom-keypad .key-delete { color: var(--red); background: var(--red-soft); }
.next-step-btn:disabled { opacity: .45; box-shadow: none; cursor: not-allowed; }
.selected-amount-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 17px;
  padding: 13px 15px;
  border: 1px solid rgba(14,143,77,.20);
  border-radius: 17px;
  background: var(--green-100);
}
.selected-amount-bar span, .selected-amount-bar strong { display: block; }
.selected-amount-bar span { color: var(--muted); font-size: 9px; }
.selected-amount-bar strong { margin-top: 2px; color: var(--green-700); font-size: 21px; }
.selected-amount-bar button {
  padding: 8px 10px;
  border: 0;
  border-radius: 11px;
  color: var(--green-700);
  background: var(--surface);
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}
.category-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 2px 2px 4px;
  overflow: visible;
}
.category-choice {
  min-width: 0;
  min-height: 96px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 12px 6px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  touch-action: manipulation;
}
.category-choice .choice-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-size: 28px;
}
.category-choice span:last-child {
  max-width: 100%;
  overflow: hidden;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.category-choice.active {
  border-color: var(--green-600);
  background: var(--green-100);
  box-shadow: 0 0 0 2px rgba(25,164,90,.12);
}
.detail-fields { margin-top: 15px; }
.detail-fields label { margin-bottom: 12px !important; }
.detail-fields label > span, .field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.detail-fields label > span small { font-weight: 500; }
.payment-section { margin-bottom: 15px; }
.payment-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.payment-choice {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.payment-choice.active {
  color: var(--green-700);
  border-color: var(--green-600);
  background: var(--green-100);
}
.save-transaction-btn { margin-top: 2px; }
body.dark .selected-amount-bar,
body.dark .category-choice.active,
body.dark .payment-choice.active { background: rgba(25,164,90,.12); }

@media (max-width: 370px) {
  .category-choice-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .category-choice { min-height: 76px; }
}

/* ===== v1.3: global monthly navigation, functional drawer and savings vault ===== */
.hero { min-height: 420px; }
.hero-month-nav { margin-top: 18px; }
.month-navigator {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 9px;
  width: 100%;
}
.month-navigator > button {
  min-height: 40px;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
}
.month-navigator .month-prev,
.month-navigator .month-next {
  display: grid;
  place-items: center;
}
.month-navigator .month-prev svg,
.month-navigator .month-next svg { width: 19px; height: 19px; }
.month-navigator .month-nav-label {
  overflow: hidden;
  padding: 0 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 850;
}
.month-navigator button:disabled { opacity: .35; cursor: not-allowed; }
.hero-month-nav > button,
.savings-month-nav > button {
  color: #fff;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.11);
}
.hero-month-nav .month-nav-label,
.savings-month-nav .month-nav-label { background: rgba(2,38,25,.26); }
.light-month-nav,
.profile-month-nav { margin-top: 15px; }
.light-month-nav > button,
.profile-month-nav > button {
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.light-month-nav .month-nav-label,
.profile-month-nav .month-nav-label { background: var(--surface); }

.balance-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  color: rgba(255,255,255,.72);
  font-size: 10px;
}
.carry-over-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.09);
}
.carry-over-chip strong { color: #a6f4c5; }

.savings-preview-card {
  margin-top: 15px;
  padding: 19px;
  border: 1px solid rgba(14,143,77,.15);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 95% 0, rgba(42,194,111,.12), transparent 32%),
    linear-gradient(145deg, var(--surface), var(--surface-2));
  box-shadow: var(--soft-shadow);
  cursor: pointer;
}
.savings-preview-card:focus-visible { outline: 3px solid rgba(25,164,90,.22); }
.savings-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.savings-preview-head h2 { margin: 3px 0 0; font-size: 17px; }
.vault-arrow { color: var(--green-700); font-size: 30px; }
.savings-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 15px;
}
.savings-preview-grid article {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
}
.vault-icon {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
  background: var(--green-100);
  font-size: 20px;
}
.vault-icon.emergency { background: #e7fbfb; }
.savings-preview-grid small,
.savings-preview-grid strong { display: block; }
.savings-preview-grid small { color: var(--muted); font-size: 9px; }
.savings-preview-grid strong {
  max-width: 105px;
  margin-top: 3px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
}
.savings-month-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.savings-month-foot strong { font-size: 13px; }

.budget-savings-adjustment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 12px;
  padding: 14px 15px;
  border: 1px solid #dcefe3;
  border-radius: 17px;
  background: var(--green-100);
}
.budget-savings-adjustment > div { display: grid; gap: 3px; }
.budget-savings-adjustment span { font-size: 12px; font-weight: 850; }
.budget-savings-adjustment small { color: var(--muted); font-size: 9px; }
.budget-savings-adjustment > strong { color: var(--red); font-size: 15px; }
.budget-savings-adjustment.has-withdrawal > strong { color: var(--green-700); }
.period-label-btn {
  border: 0;
  color: var(--text);
  background: transparent;
  font-weight: 850;
  cursor: pointer;
}
.budget-item.unbudgeted .budget-item-top { margin-bottom: 0; }

.profile-month-summary {
  margin-bottom: 14px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}
.profile-summary-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}
.profile-summary-title span { color: var(--muted); font-size: 11px; }
.profile-summary-title strong { font-size: 18px; }
.profile-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 13px;
}
.profile-summary-grid > div {
  min-width: 0;
  padding: 10px 8px;
  border-radius: 14px;
  background: var(--surface-2);
  text-align: center;
}
.profile-summary-grid span,
.profile-summary-grid strong { display: block; }
.profile-summary-grid span { color: var(--muted); font-size: 9px; }
.profile-summary-grid strong {
  margin-top: 5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
}

.savings-hero {
  padding: max(22px, env(safe-area-inset-top)) 17px 25px;
  color: #fff;
  background:
    radial-gradient(circle at 90% 15%, rgba(86,210,139,.24), transparent 34%),
    linear-gradient(145deg, #073d2c, #087249);
}
.savings-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.savings-header-row > div { text-align: left; }
.savings-header-row span { color: rgba(255,255,255,.68); font-size: 10px; display: block; }
.savings-header-row h1 { margin: 3px 0 0; font-size: 23px; }
.savings-month-nav { margin-top: 19px; }
.savings-page { padding-top: 15px; }
.vault-account-card {
  position: relative;
  margin-bottom: 13px;
  padding: 19px;
  overflow: hidden;
  border-radius: 24px;
  color: #fff;
  box-shadow: 0 18px 38px rgba(7,78,49,.20);
}
.primary-vault { background: linear-gradient(145deg, #087249, #0aa85c); }
.emergency-vault { background: linear-gradient(145deg, #0c6170, #11939b); }
.vault-account-card::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  right: -62px;
  top: -70px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
}
.vault-account-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 13px;
}
.big-vault-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: rgba(255,255,255,.14);
  font-size: 27px;
}
.vault-account-top small,
.vault-account-top strong { display: block; }
.vault-account-top small { color: rgba(255,255,255,.72); font-size: 10px; }
.vault-account-top strong { margin-top: 4px; font-size: 25px; }
.vault-month-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 17px;
}
.vault-month-stats span {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 13px;
  color: rgba(255,255,255,.70);
  background: rgba(255,255,255,.09);
  font-size: 9px;
}
.vault-month-stats b { color: #fff; font-size: 12px; }
.vault-actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 12px;
}
.vault-actions button {
  min-height: 41px;
  border: 1px solid rgba(255,255,255,.20);
  border-radius: 13px;
  color: #fff;
  background: rgba(255,255,255,.12);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}
.vault-actions button:first-child { color: #07543a; background: #fff; }
.savings-rule-card {
  margin: 4px 0 19px;
  padding: 14px 15px;
  border: 1px solid #dcefe3;
  border-radius: 18px;
  background: var(--green-100);
}
.savings-rule-card span { font-size: 11px; font-weight: 900; }
.savings-rule-card p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.savings-activity-heading { margin-bottom: 7px; }
.savings-activity-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}
.savings-activity-item {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}
.savings-activity-item:last-child { border-bottom: 0; }
.savings-activity-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--green-100);
  font-size: 21px;
}
.savings-activity-icon.emergency { background: #e7fbfb; }
.savings-activity-item div:nth-child(2) { min-width: 0; }
.savings-activity-item strong,
.savings-activity-item span,
.savings-activity-item small { display: block; }
.savings-activity-item strong { font-size: 13px; }
.savings-activity-item span,
.savings-activity-item small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 9px;
}
.savings-activity-item > b { font-size: 13px; text-align: right; }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(4,24,17,.52);
  backdrop-filter: blur(3px);
}
.side-drawer {
  position: fixed;
  z-index: 75;
  left: 50%;
  top: 0;
  width: min(88%, 390px);
  height: 100svh;
  padding: max(19px, env(safe-area-inset-top)) 17px 22px;
  overflow-y: auto;
  transform: translateX(calc(-50% - 110%));
  border-radius: 0 28px 28px 0;
  background: var(--surface);
  box-shadow: 24px 0 70px rgba(0,0,0,.25);
  transition: transform .28s ease;
}
.side-drawer.open { transform: translateX(-50%); }
@media (min-width: 460px) {
  .side-drawer { left: calc(50% - 230px); transform: translateX(-110%); }
  .side-drawer.open { transform: translateX(0); }
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.drawer-brand { display: flex; align-items: center; gap: 11px; }
.drawer-brand > span {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(145deg, #0e8f4d, #07543a);
  font-weight: 900;
}
.drawer-brand strong,
.drawer-brand small { display: block; }
.drawer-brand strong { font-size: 15px; }
.drawer-brand small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.close-drawer {
  width: 37px;
  height: 37px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 25px;
  cursor: pointer;
}
.drawer-month-card {
  display: grid;
  gap: 5px;
  margin: 20px 0 15px;
  padding: 17px;
  border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(circle at 90% 0, rgba(255,225,92,.20), transparent 30%),
    linear-gradient(145deg, #073d2c, #087249);
}
.drawer-month-card span { color: rgba(255,255,255,.70); font-size: 10px; }
.drawer-month-card strong { font-size: 25px; }
.drawer-month-card small { color: rgba(255,255,255,.60); font-size: 9px; }
.drawer-nav { display: grid; gap: 7px; }
.drawer-nav button {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.drawer-nav button:hover { background: var(--surface-2); border-color: var(--line); }
.drawer-nav button > span {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--green-700);
  background: var(--green-100);
  font-size: 19px;
}
.drawer-nav b,
.drawer-nav small { display: block; }
.drawer-nav b { font-size: 12px; }
.drawer-nav small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.drawer-nav .featured-menu {
  border-color: rgba(14,143,77,.18);
  background: linear-gradient(145deg, var(--green-100), var(--surface));
}
.drawer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}
.drawer-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: var(--surface-2);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.drawer-actions button:last-child { grid-column: 1 / -1; }
.drawer-actions svg { width: 17px; }
.drawer-version { display: block; margin-top: 15px; color: var(--muted); text-align: center; font-size: 8px; }

.month-picker-actions { margin: 16px 0 10px; }
.month-picker-actions button {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cfe8d8;
  border-radius: 13px;
  color: var(--green-700);
  background: var(--green-100);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}
.month-picker-list { display: grid; gap: 15px; }
.month-year-group h3 { margin: 0 0 8px; color: var(--muted); font-size: 11px; }
.month-year-group > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.month-year-group button {
  min-height: 43px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: var(--surface-2);
  font-size: 11px;
  cursor: pointer;
}
.month-year-group button.active {
  color: #fff;
  border-color: var(--green-700);
  background: var(--green-700);
  font-weight: 850;
}

.savings-option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 18px 0 10px;
}
.savings-option-grid button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  background: var(--surface-2);
  cursor: pointer;
}
.savings-option-grid button.active {
  color: var(--green-700);
  border-color: rgba(14,143,77,.35);
  background: var(--green-100);
}
.savings-option-grid span { font-size: 20px; }
.savings-option-grid b { font-size: 11px; }
.savings-action-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: 15px;
  background: var(--surface-2);
}
.savings-action-switch button {
  min-height: 40px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
  cursor: pointer;
}
.savings-action-switch button.active {
  color: var(--green-700);
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}
.savings-action-switch button[data-savings-action="withdraw"].active { color: var(--red); }
.savings-amount-display { margin-top: 12px; }
.compact-keypad { margin-top: 10px; }
.savings-entry-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 13px;
}
.savings-entry-fields label { display: grid; gap: 6px; }
.savings-entry-fields span { color: var(--muted); font-size: 10px; font-weight: 700; }
.savings-entry-fields input {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: var(--surface-2);
}
.available-balance-note {
  margin: 11px 0;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--green-700);
  background: var(--green-100);
  font-size: 10px;
  font-weight: 800;
}
.available-balance-note.withdraw-mode { color: var(--red); background: var(--red-soft); }

.legend-row.savings-deduction strong { color: var(--green-700); }
.settings-card button span b,
.settings-card button span small { display: block; }
.settings-card button span small { margin-top: 3px; color: var(--muted); font-size: 8px; }

body.dark .budget-savings-adjustment,
body.dark .savings-rule-card,
body.dark .savings-preview-card,
body.dark .drawer-nav .featured-menu,
body.dark .available-balance-note { border-color: var(--line); }
body.dark .side-drawer { background: var(--surface); }

@media (max-width: 370px) {
  .hero { min-height: 432px; }
  .savings-preview-grid { grid-template-columns: 1fr; }
  .profile-summary-grid { gap: 5px; }
  .profile-summary-grid > div { padding-inline: 5px; }
  .savings-entry-fields { grid-template-columns: 1fr; }
}

/* ===== v1.4: compact home, category-first transaction type and budget builder ===== */
.hero {
  min-height: 0;
  padding: max(12px, env(safe-area-inset-top)) 18px 22px;
}
.hero::before { top: 86px; }
.hero::after { top: 126px; }
.top-row .icon-btn { width: 40px; height: 40px; }
.greeting-row { margin-top: 12px; }
.eyebrow { margin-bottom: 2px; font-size: 10px; }
.greeting-row h1 { font-size: 23px; }
.hero-subtitle { margin-top: 3px; font-size: 11px; }
.premium-pill { margin-top: 0; padding: 7px 10px; font-size: 10px; }
.hero-month-nav { margin-top: 12px; }
.hero-month-nav > button { min-height: 38px; }
.balance-card {
  min-height: 124px;
  margin-top: 12px;
  padding: 16px 18px;
  border-radius: 21px;
}
.balance-head { font-size: 11px; }
.balance-value { margin-top: 3px; font-size: 31px; }
.balance-meta { margin-top: 8px; font-size: 10px; }
.sparkline { right: 16px; bottom: 13px; width: 120px; height: 43px; }
.home-body { margin-top: -17px; }
.stat-grid { gap: 10px; }
.stat-card { min-height: 88px; padding: 13px 12px; border-radius: 18px; }
.stat-icon { width: 34px; height: 34px; font-size: 17px; }
.stat-card strong { font-size: 15px; }

.transaction-kind-block { margin: 14px 0 15px; }
.details-type-switch { margin: 7px 0 0; }
.details-type-switch button { min-height: 44px; }

.budget-create-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 37px;
  padding: 0 12px;
  border: 1px solid rgba(14,143,77,.24);
  border-radius: 12px;
  color: var(--green-700);
  background: var(--green-100);
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}
.budget-create-btn span { font-size: 15px; line-height: 1; }
.budget-scope-note {
  margin: -1px 2px 10px;
  color: var(--muted);
  font-size: 9px;
}
.budget-item { cursor: pointer; transition: transform .16s ease, border-color .16s ease; }
.budget-item:active { transform: scale(.99); }
.budget-item:focus-visible { border-color: var(--green-600); }

.budget-builder-sheet { max-height: 94svh; }
.budget-period-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 13px;
  padding: 13px 14px;
  border: 1px solid rgba(14,143,77,.17);
  border-radius: 15px;
  background: var(--green-100);
}
.budget-period-preview span { color: var(--green-700); font-size: 10px; font-weight: 850; }
.budget-period-preview strong { font-size: 12px; }
.budget-category-title { margin-bottom: 9px; }
.budget-category-grid { max-height: 250px; overflow-y: auto; padding: 2px; }
.budget-amount-title { margin: 16px 0 9px; }
.budget-amount-display { min-height: 68px; }
.budget-builder-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  margin-top: 13px;
}
.budget-builder-actions .primary-btn { min-width: 0; }
.danger-outline-btn {
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid rgba(240,68,56,.26);
  border-radius: 15px;
  color: var(--red);
  background: var(--red-soft);
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}
.danger-outline-btn[hidden] + .primary-btn { grid-column: 1 / -1; }

body.dark .budget-create-btn,
body.dark .budget-period-preview { border-color: var(--line); background: rgba(25,164,90,.12); }
body.dark .danger-outline-btn { background: rgba(240,68,56,.10); }

@media (max-width: 370px) {
  .hero { min-height: 0; padding-inline: 14px; }
  .greeting-row h1 { font-size: 21px; }
  .balance-card { min-height: 120px; }
  .budget-category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ===== v1.5: cleaner home, premium balance card, contained drawer and swipe motion ===== */
.hero {
  min-height: 0;
  padding: max(10px, env(safe-area-inset-top)) 16px 20px;
  background:
    radial-gradient(circle at 92% 26%, rgba(83, 224, 148, .22), transparent 30%),
    linear-gradient(155deg, #053e2d 0%, #07543a 52%, #08794c 100%);
}
.hero::before { top: 54px; right: -118px; opacity: .72; }
.hero::after { top: 92px; right: -76px; opacity: .64; }
.compact-topbar {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 10px;
}
.app-wordmark {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-align: left;
}
.app-mark {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  color: #d9ffe8;
  background: rgba(255,255,255,.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .5px;
}
.app-wordmark h1 {
  margin: 0;
  color: #fff;
  font-size: 14px;
  line-height: 1.05;
  letter-spacing: -.15px;
}
.app-wordmark small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: rgba(255,255,255,.58);
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 8px;
  letter-spacing: .15px;
}
.hero-month-nav { margin-top: 10px; }
.hero-month-nav > button { min-height: 36px; }
.hero-month-nav .month-nav-label {
  border-color: rgba(255,255,255,.10);
  background: rgba(2,38,25,.32);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.premium-balance-card {
  position: relative;
  min-height: 158px;
  margin-top: 10px;
  padding: 17px 18px 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 24px;
  background:
    linear-gradient(120deg, rgba(255,255,255,.13), rgba(255,255,255,.025) 55%),
    linear-gradient(145deg, #137d55 0%, #0c6848 43%, #074c38 100%);
  box-shadow:
    0 22px 48px rgba(1, 37, 24, .28),
    inset 0 1px 0 rgba(255,255,255,.18),
    inset 0 -1px 0 rgba(0,0,0,.14);
  backdrop-filter: blur(14px);
}
.premium-balance-card::before {
  content: "";
  position: absolute;
  width: 210px;
  height: 210px;
  right: -116px;
  top: -126px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255,255,255,.025), 0 0 0 58px rgba(255,255,255,.018);
}
.premium-balance-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(108deg, transparent 5%, rgba(255,255,255,.09) 33%, transparent 52%);
  transform: translateX(-58%);
  opacity: .75;
}
.balance-card-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.balance-card-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.balance-card-brand small,
.balance-card-brand strong { display: block; }
.balance-card-brand small {
  color: rgba(255,255,255,.56);
  font-size: 7px;
  font-weight: 850;
  letter-spacing: 1.35px;
}
.balance-card-brand strong {
  margin-top: 3px;
  color: rgba(255,255,255,.92);
  font-size: 10px;
  font-weight: 750;
}
.mini-chip {
  width: 34px;
  height: 27px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 6px 5px;
  border: 1px solid rgba(255,235,158,.48);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255,225,112,.78), rgba(206,158,36,.44));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.35);
}
.mini-chip i { border-right: 1px solid rgba(83,57,0,.26); }
.mini-chip i:last-child { border-right: 0; }
.premium-balance-card .balance-toggle {
  position: relative;
  z-index: 3;
  width: 37px;
  height: 37px;
  color: #eafff2;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(255,255,255,.09);
}
.balance-label {
  position: relative;
  z-index: 2;
  display: block;
  margin-top: 15px;
  color: rgba(255,255,255,.62);
  font-size: 10px;
}
.premium-balance-card .balance-value {
  position: relative;
  z-index: 2;
  margin-top: 2px;
  color: #fff;
  font-size: clamp(30px, 9vw, 39px);
  font-weight: 900;
  letter-spacing: -.8px;
  text-shadow: 0 5px 18px rgba(0,0,0,.20);
}
.balance-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}
.premium-balance-card .carry-over-chip {
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.66);
  background: rgba(0,0,0,.10);
  font-size: 9px;
}
.premium-balance-card .carry-over-chip strong { color: #b7f6d0; }
.balance-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255,255,255,.56);
  font-size: 8px;
  white-space: nowrap;
}
.balance-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7ff0ad;
  box-shadow: 0 0 0 4px rgba(127,240,173,.10);
}
.balance-orbit {
  position: absolute;
  right: -24px;
  bottom: -44px;
  width: 150px;
  height: 95px;
  border: 1px solid rgba(137,255,187,.18);
  border-radius: 50%;
  transform: rotate(-12deg);
}
.balance-orbit::before,
.balance-orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(137,255,187,.12);
}
.balance-orbit::before { inset: 13px 18px; }
.balance-orbit::after { inset: 28px 39px; background: rgba(92,230,150,.10); }
.home-body { margin-top: -12px; }
.stat-grid { gap: 10px; }
.stat-card {
  min-width: 0;
  min-height: 85px;
  padding: 12px;
  border-color: rgba(222,233,227,.88);
  box-shadow: 0 10px 25px rgba(7, 55, 38, .08);
}
.stat-card > div:last-child { min-width: 0; }
.stat-card strong,
.stat-card small,
.stat-card span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Drawer stays inside the same mobile app canvas instead of centering itself on the viewport. */
.side-drawer {
  left: max(0px, calc(50% - 230px));
  top: 0;
  bottom: 0;
  width: min(88vw, 360px);
  height: 100dvh;
  max-height: 100dvh;
  padding: max(17px, env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
  transform: translateX(calc(-100% - 24px));
  border-radius: 0 26px 26px 0;
  overscroll-behavior: contain;
}
.side-drawer.open { transform: translateX(0); }
.drawer-nav .featured-menu {
  border-color: transparent;
  background: transparent;
}
.drawer-nav button.active {
  border-color: rgba(14,143,77,.25);
  background: linear-gradient(145deg, var(--green-100), var(--surface));
  box-shadow: inset 3px 0 0 var(--green-600);
}
.drawer-nav button.active > span {
  color: #fff;
  background: linear-gradient(145deg, #16a45b, #08713f);
}
body.dark .drawer-nav button.active {
  border-color: rgba(61,202,123,.22);
  background: rgba(25,164,90,.12);
}
.drawer-actions { margin-top: 15px; }

.screen.active.swipe-next { animation: swipeNextIn .22s ease both; }
.screen.active.swipe-prev { animation: swipePrevIn .22s ease both; }
@keyframes swipeNextIn {
  from { opacity: .35; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes swipePrevIn {
  from { opacity: .35; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 459px) {
  .side-drawer { left: 0; width: min(90vw, 360px); }
}
@media (max-width: 370px) {
  .hero { padding-inline: 13px; }
  .app-wordmark small { display: none; }
  .premium-balance-card { min-height: 151px; padding-inline: 15px; }
  .balance-footer { gap: 6px; }
  .balance-status { font-size: 7px; }
}


/* ===== v1.6: menu + premium-only header and simplified budget canvas ===== */
.clean-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.clean-topbar .top-unlock {
  justify-self: auto;
  margin: 0;
  min-height: 40px;
  padding: 0 14px;
  color: #ffe680;
  border-color: rgba(242,201,76,.52);
  background: rgba(2,38,25,.38);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 8px 22px rgba(0,0,0,.10);
  backdrop-filter: blur(10px);
}
.clean-topbar .top-unlock span { white-space: nowrap; }
.premium-balance-card { margin-top: 12px; }

#budgetPeriodSelector[hidden],
#budgetSummaryCard[hidden],
#budgetSavingsAdjustment[hidden] { display: none !important; }
.budget-page { padding-top: 18px; }
.budget-list-heading { margin-top: 2px; }
.budget-scope-note { margin-top: 4px; }

.drawer-month-card {
  display: grid;
  gap: 10px;
  padding: 13px;
}
.drawer-period-kicker {
  color: rgba(255,255,255,.62);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .4px;
}
.drawer-month-navigator {
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.drawer-month-navigator > button {
  min-height: 40px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.08);
}
.drawer-month-navigator .month-nav-label {
  color: #fff;
  background: rgba(0,0,0,.12);
  font-size: 12px;
  font-weight: 900;
}
.drawer-balance-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.11);
}
.drawer-balance-row div { display: grid; gap: 3px; }
.drawer-balance-row small { color: rgba(255,255,255,.58); font-size: 8px; }
.drawer-balance-row strong { color: #fff; font-size: 22px; }
.drawer-balance-dot {
  width: 9px;
  height: 9px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: #7ff0ad;
  box-shadow: 0 0 0 5px rgba(127,240,173,.10);
}

@media (max-width: 370px) {
  .clean-topbar .top-unlock { padding-inline: 11px; font-size: 9px; }
}


/* =========================================================
   Transaction history — grouped accordion view
   ========================================================= */
.history-header {
  position: sticky;
  top: 0;
  z-index: 8;
  padding: max(22px, env(safe-area-inset-top)) 17px 14px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(18px);
}
.history-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}
.history-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}
.history-title-row h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.16;
  letter-spacing: -.45px;
}
.history-month-button {
  max-width: 145px;
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--green-700);
  background: var(--surface-2);
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}
.history-month-button svg {
  width: 16px;
  height: 16px;
}
.history-month-button span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.history-view-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 18px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .025);
}
.history-view-tabs button {
  min-height: 47px;
  padding: 10px;
  border: 0;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.history-view-tabs button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--green-700), var(--green-900));
  box-shadow: 0 9px 18px rgba(8, 120, 68, .2);
}
.transaction-history-page {
  min-height: calc(100svh - 180px);
  padding-top: 15px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--green-100) 35%, transparent), transparent 200px);
}
.history-month-meta {
  margin: 0 3px 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}
.history-groups {
  display: grid;
  gap: 11px;
}
.history-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}
.history-group-header {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 24px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.history-group-header:not(:has(.history-group-icon)) {
  grid-template-columns: 24px minmax(0, 1fr) auto;
}
.history-chevron {
  color: var(--green-700);
  font-size: 31px;
  font-weight: 500;
  line-height: 1;
  transform: rotate(0);
  transition: transform .18s ease;
}
.history-group.open .history-chevron {
  transform: rotate(90deg);
}
.history-group-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 20px;
}
.history-group-title {
  min-width: 0;
}
.history-group-title strong,
.history-group-title small {
  display: block;
}
.history-group-title strong {
  overflow: hidden;
  font-size: 15px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.history-group-title small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
}
.history-group-total {
  white-space: nowrap;
  font-size: 14px;
}
.history-group-body {
  padding: 0 15px 5px 49px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
}
.history-group-body[hidden] {
  display: none;
}
.history-transaction-item {
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 76px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.history-transaction-item:last-child {
  border-bottom: 0;
}
.history-transaction-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 21px;
}
.history-transaction-main {
  min-width: 0;
}
.history-transaction-main strong,
.history-transaction-main span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.history-transaction-main strong {
  font-size: 14px;
}
.history-transaction-main span,
.history-transaction-side small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}
.history-transaction-side {
  text-align: right;
}
.history-transaction-side strong {
  display: block;
  white-space: nowrap;
  font-size: 13px;
}
.history-empty {
  padding-top: 52px;
}
body.dark .history-header {
  background: color-mix(in srgb, var(--surface) 95%, transparent);
}
body.dark .history-view-tabs button.active {
  color: #fff;
}
@media (max-width: 370px) {
  .history-title-row {
    align-items: flex-start;
  }
  .history-title-row h1 {
    font-size: 22px;
  }
  .history-month-button {
    max-width: 118px;
  }
  .history-group-header {
    padding-inline: 12px;
  }
  .history-group-body {
    padding-left: 39px;
    padding-right: 12px;
  }
}


/* =========================================================
   Performance layer — tuned for low-end Android WebView
   ========================================================= */
html {
  scroll-behavior: auto !important;
}body,
.app-shell {
  overscroll-behavior: none;
}
button,
[role="button"],
.custom-keypad,
.category-grid,
.payment-grid {
  touch-action: manipulation;
}
.screen,
.swipe-next,
.swipe-prev {
  animation-duration: .12s !important;
}
.simple-header,
.history-header,
.bottom-nav,
.glass-btn,
.balance-card,
.modal-backdrop,
.drawer-backdrop {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.simple-header,
.history-header,
.bottom-nav {
  background: var(--surface) !important;
}
.side-drawer {
  will-change: transform;
}
.section-card,
.premium-banner,
.history-group,
.budget-item,
.settings-card,
.user-card,
.savings-account-card,
.savings-activity-item {
  content-visibility: auto;
  contain-intrinsic-size: 1px 180px;
}
.history-group,
.transaction-item,
.history-transaction-item,
.budget-item {
  contain: layout paint style;
}
.donut,
.sparkline,
.progress-track {
  contain: strict;
}
@media (max-width: 719px) {
  :root {
    --shadow: 0 10px 28px rgba(8, 54, 38, .09);
    --soft-shadow: 0 3px 12px rgba(11, 43, 32, .055);
  }
  .section-card,
  .premium-banner,
  .history-group,
  .budget-item,
  .settings-card,
  .user-card {
    box-shadow: var(--soft-shadow) !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  .screen,
  .swipe-next,
  .swipe-prev,
  .side-drawer,
  .bottom-sheet,
  .center-modal {
    animation: none !important;
    transition: none !important;
  }
}


/* =========================================================
   Native interaction + reliable drawer state
   ========================================================= */
.drawer-backdrop {
  left: max(0px, calc(50% - 230px));
  right: auto;
  width: min(100vw, 460px);
}
.drawer-backdrop[hidden] {
  display: none !important;
}
.side-drawer {
  transform: translate3d(calc(-100% - 28px), 0, 0) !important;
  visibility: hidden;
  pointer-events: none;
  transition:
    transform .16s cubic-bezier(.2, .8, .2, 1),
    visibility 0s linear .16s;
  scrollbar-width: none;
}
.side-drawer::-webkit-scrollbar {
  display: none;
}
.side-drawer.open {
  transform: translate3d(0, 0, 0) !important;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}
button,
[role="button"],
[tabindex="0"] {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
button:not(:disabled),
[role="button"]:not([aria-disabled="true"]) {
  cursor: pointer;
  touch-action: manipulation;
}
button:not(:disabled):active,
[role="button"]:not([aria-disabled="true"]):active {
  transform: scale(.975);
  transition: transform 55ms ease-out !important;
}
.fab:not(:disabled):active {
  transform: scale(.93);
}
.custom-keypad button:not(:disabled):active,
.budget-keypad button:not(:disabled):active,
.savings-keypad button:not(:disabled):active {
  transform: scale(.95);
}
@media (max-width: 460px) {
  .drawer-backdrop {
    left: 0;
    width: 100vw;
  }
}


/* =========================================================
   Modal / bottom-sheet positioning and native scrolling fix
   ========================================================= */
:root {
  --visual-viewport-height: 100dvh;
}

.modal-backdrop[hidden],
.bottom-sheet[hidden],
.center-modal[hidden] {
  display: none !important;
}

.bottom-sheet {
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  bottom: 0 !important;
  width: min(100vw, 460px) !important;
  height: auto !important;
  max-height: min(92dvh, calc(var(--visual-viewport-height) - 8px)) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  transform: translate3d(-50%, 0, 0) !important;
  animation: nativeSheetUp .16s cubic-bezier(.2, .8, .2, 1) both !important;
  will-change: transform;
  scrollbar-gutter: stable;
}

@keyframes nativeSheetUp {
  from {
    opacity: .7;
    transform: translate3d(-50%, 100%, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(-50%, 0, 0);
  }
}

.center-modal {
  left: 50% !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  max-height: min(90dvh, calc(var(--visual-viewport-height) - 24px)) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  transform: translate3d(-50%, -50%, 0) !important;
}

.bottom-sheet .sheet-header {
  position: sticky;
  top: -11px;
  z-index: 4;
  margin: -1px -2px 8px;
  padding: 1px 2px 8px;
  background: var(--surface);
}

.bottom-sheet .sheet-handle {
  position: sticky;
  top: 0;
  z-index: 5;
}

.bottom-sheet button,
.bottom-sheet [role="button"] {
  touch-action: manipulation;
}

.bottom-sheet input,
.bottom-sheet textarea,
.bottom-sheet select {
  touch-action: manipulation;
}

@media (min-width: 720px) {
  .bottom-sheet {
    bottom: 22px !important;
    max-height: min(calc(100dvh - 44px), calc(var(--visual-viewport-height) - 44px)) !important;
    border-radius: 28px !important;
  }
}

html,
body {
  width: 100%;
  min-height: 100%;
  height: auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  position: relative !important;
  touch-action: pan-y !important;
  -webkit-overflow-scrolling: touch;
}

/* =========================================================
   v1.17 — full-surface native scrolling + transaction editor
   ========================================================= */
html,
body {
  overscroll-behavior-y: auto !important;
}

.app-shell {
  height: 100dvh !important;
  min-height: 100dvh !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-y: contain !important;
  touch-action: pan-y !important;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: auto !important;
}

.screen,
.screen.active,
.hero,
.page-body,
.home-body,
.section-card,
.overview-content,
.premium-banner,
.transaction-history-page,
.budget-page,
.profile-page,
.savings-page {
  touch-action: pan-y !important;
}

.hero::before,
.hero::after,
.balance-card::before,
.balance-card::after,
.premium-banner::before,
.premium-banner::after,
.sparkline {
  pointer-events: none;
}

.transaction-form-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  margin-top: 4px;
}

.transaction-form-actions .danger-outline-btn[hidden] {
  display: none !important;
}

.history-transaction-item,
.transaction-item[data-transaction-id] {
  width: 100%;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.history-transaction-item:active,
.transaction-item[data-transaction-id]:active {
  background: color-mix(in srgb, var(--green-100) 45%, transparent);
}

.history-transaction-item::after,
.transaction-item[data-transaction-id]::after {
  content: "›";
  align-self: center;
  margin-left: 3px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.history-transaction-item {
  grid-template-columns: 45px minmax(0, 1fr) auto 13px;
}

.transaction-item[data-transaction-id] {
  grid-template-columns: 48px minmax(0, 1fr) auto 13px;
}

@media (max-width: 370px) {
  .transaction-form-actions {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   v1.18 — functional profile, security, support and premium
   ========================================================= */
.user-card {
  width: 100%;
  border: 1px solid var(--line);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.membership-card.premium-active {
  border-color: rgba(255, 225, 92, .55);
  background: linear-gradient(135deg, rgba(255,225,92,.13), rgba(255,255,255,.08));
}
.membership-card.premium-active .small-upgrade {
  color: #ffe680;
  background: rgba(255,255,255,.1);
}
.premium-hidden {
  display: none !important;
}
.settings-dialog {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
}
.settings-dialog > p {
  color: var(--muted);
}
.dialog-close {
  position: absolute;
  top: 17px;
  right: 17px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 24px;
  cursor: pointer;
}
.dialog-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 18px;
  color: var(--green-700);
  background: var(--green-100);
}
.dialog-icon svg {
  width: 28px;
  height: 28px;
}
.dialog-kicker {
  color: var(--green-700);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .7px;
}
.settings-dialog h2 {
  margin: 6px 0 18px;
  font-size: 24px;
}
.settings-form {
  display: grid;
  gap: 13px;
}
.settings-form > label:not(.toggle-setting) {
  display: grid;
  gap: 7px;
}
.settings-form label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}
.settings-form input[type="text"],
.settings-form input[type="email"],
.settings-form input[type="tel"],
.settings-form input[type="password"] {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: var(--surface-2);
}
.toggle-setting {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}
.toggle-setting span b,
.toggle-setting span small {
  display: block;
}
.toggle-setting span b {
  color: var(--text);
  font-size: 13px;
}
.toggle-setting span small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}
.toggle-setting input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toggle-setting i {
  width: 46px;
  height: 26px;
  padding: 3px;
  border-radius: 999px;
  background: #d6ded9;
  transition: .18s ease;
}
.toggle-setting i::after {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  transition: transform .18s ease;
}
.toggle-setting input:checked + i {
  background: var(--green-600);
}
.toggle-setting input:checked + i::after {
  transform: translateX(20px);
}
.toggle-setting.is-unavailable {
  opacity: .58;
}
.biometric-unlock-btn {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 9px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 14px;
  color: #fff;
  background: rgba(255,255,255,.08);
  font: inherit;
  font-size: 11px;
  font-weight: 850;
}
.biometric-unlock-btn span { font-size: 20px; }
.biometric-unlock-btn[hidden] { display: none !important; }
.secondary-settings-btn,
.premium-manage-btn {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: var(--surface-2);
  font-weight: 800;
  cursor: pointer;
}
.premium-manage-btn {
  margin-top: 9px;
  color: #ffd3cf;
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.07);
}
.premium-checkout-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  background: rgba(255,255,255,.06);
}
.premium-checkout-summary span {
  color: rgba(255,255,255,.65);
  font-size: 10px;
}
.premium-checkout-summary strong {
  font-size: 13px;
}
.plan-grid button.selected {
  border-color: #ffe15c;
  box-shadow: 0 0 0 2px rgba(255,225,92,.16);
}
.faq-list {
  display: grid;
  gap: 9px;
}
.tutorial-intro {
  margin: -2px 0 14px;
  padding: 11px 12px;
  border: 1px solid rgba(14,143,77,.16);
  border-radius: 14px;
  color: var(--muted);
  background: var(--green-100);
  font-size: 10px;
  line-height: 1.6;
}
.faq-list button {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--text);
  background: var(--surface-2);
  text-align: left;
  cursor: pointer;
}
.faq-list button > span {
  font-size: 13px;
  font-weight: 800;
}
.faq-list button > b {
  color: var(--green-700);
}
.faq-list button > small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}
.help-actions {
  display: grid;
  gap: 9px;
  margin-top: 15px;
}
.app-lock-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 85% 10%, rgba(46,201,112,.2), transparent 30%),
    linear-gradient(145deg, #052d20, #08623f);
}
.app-lock-screen[hidden] {
  display: none !important;
}
.lock-card {
  width: min(100%, 360px);
  padding: 27px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 26px;
  color: #fff;
  background: rgba(5,35,24,.76);
  box-shadow: 0 25px 80px rgba(0,0,0,.35);
  text-align: center;
}
.lock-logo {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 21px;
  background: linear-gradient(145deg, #19a45a, #08703f);
  font-size: 21px;
  font-weight: 950;
}
.lock-card > span {
  color: rgba(255,255,255,.7);
  font-size: 11px;
}
.lock-card h2 {
  margin: 9px 0 5px;
  font-size: 24px;
}
.lock-card p {
  margin: 0 0 16px;
  color: rgba(255,255,255,.7);
  font-size: 11px;
}
.lock-card input {
  width: 100%;
  height: 58px;
  padding: 0 16px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 16px;
  color: #fff;
  background: rgba(255,255,255,.08);
  text-align: center;
  font-size: 26px;
  letter-spacing: 12px;
}
.lock-card .primary-btn {
  margin-top: 12px;
}
.lock-card small {
  display: block;
  min-height: 18px;
  margin-top: 9px;
  color: #ffaba4;
}
body.app-locked .app-shell,
body.app-locked .bottom-nav {
  visibility: hidden;
}
body.dark .settings-dialog {
  background: var(--surface);
}

/* =========================================================
   v1.19 Premium Suite
   ========================================================= */
.premium-setting-icon {
  color: #9a6b00 !important;
  background: #fff5c7 !important;
}
.premium-transaction-tools {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(242,201,76,.45);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255,249,220,.96), var(--surface));
  box-shadow: var(--soft-shadow);
}
.premium-tool-title,
.premium-panel-heading,
.premium-suite-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.premium-tool-title div span,
.premium-panel-heading div span {
  display: block;
  color: #9a6b00;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .9px;
}
.premium-tool-title div strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
}
.premium-tool-title > button {
  border: 0;
  color: var(--green-700);
  background: transparent;
  font-size: 10px;
  font-weight: 850;
}
.premium-search-field {
  height: 45px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.premium-search-field svg { width: 18px; color: var(--muted); }
.premium-search-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}
.premium-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 7px;
  margin-top: 8px;
}
.premium-filter-grid select,
.premium-panel-heading select {
  min-width: 0;
  height: 39px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: var(--surface);
  font-size: 10px;
}
.premium-suite-screen {
  background: var(--bg);
}
.premium-suite-hero {
  padding: max(20px, env(safe-area-inset-top)) 18px 30px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 12%, rgba(255,225,92,.22), transparent 28%),
    linear-gradient(145deg, #042d20, #07643f);
}
.premium-suite-top { margin-bottom: 23px; }
.premium-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border: 1px solid rgba(255,225,92,.45);
  border-radius: 999px;
  color: #ffe15c;
  background: rgba(0,0,0,.12);
  font-size: 10px;
  font-weight: 900;
}
.premium-live-badge svg { width: 14px; }
.premium-suite-hero > span {
  color: rgba(255,255,255,.62);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.2px;
}
.premium-suite-hero h1 { margin: 7px 0 5px; font-size: 31px; }
.premium-suite-hero p { margin: 0; color: rgba(255,255,255,.7); font-size: 11px; }
.premium-suite-page { padding-top: 15px; }
.premium-locked-panel {
  padding: 31px 22px;
  border: 1px solid var(--line);
  border-radius: 27px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}
.premium-lock-orb {
  width: 72px; height: 72px;
  display: grid; place-items: center;
  margin: 0 auto 15px;
  border-radius: 23px;
  color: #8b6500;
  background: linear-gradient(145deg,#fff7c9,#f5ce4f);
  font-size: 34px;
}
.premium-locked-panel > span { color: #9a6b00; font-size: 9px; font-weight: 950; letter-spacing: 1px; }
.premium-locked-panel h2 { margin: 8px 0; font-size: 22px; }
.premium-locked-panel p { margin: 0 0 17px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.premium-panel {
  margin-top: 14px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}
.premium-panel-heading h2 { margin:3px 0 0; font-size:18px; }
.premium-add-btn {
  flex:0 0 auto;
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:11px;
  color:var(--green-700);
  background:var(--surface-2);
  font-size:10px;
  font-weight:900;
}
.premium-goal-list,.premium-recurring-list,.premium-reminder-list,.custom-category-list {
  display:grid; gap:8px; margin-top:13px;
}
.premium-list-card {
  display:grid;
  grid-template-columns:40px minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--surface-2);
}
.premium-list-card strong,.premium-list-card small { display:block; }
.premium-list-card strong { font-size:12px; }
.premium-list-card small { margin-top:3px;color:var(--muted);font-size:9px;line-height:1.4; }
.premium-list-card .list-icon { width:40px;height:40px;display:grid;place-items:center;border-radius:13px;background:var(--green-100);font-size:19px; }
.premium-list-actions { display:flex;gap:5px; }
.premium-list-actions button { width:31px;height:31px;border:0;border-radius:10px;background:var(--surface);color:var(--green-700); }
.goal-progress { grid-column:2 / -1; height:7px;overflow:hidden;border-radius:99px;background:var(--line); }
.goal-progress span { display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#0e8f4d,#45d887); }
.premium-account-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:9px;
  margin-top:13px;
}
.premium-account-card {
  position:relative;
  padding:14px;
  border:1px solid var(--line);
  border-radius:17px;
  background:var(--surface-2);
}
.premium-account-card > span { font-size:22px; }
.premium-account-card small,.premium-account-card strong { display:block; }
.premium-account-card small { margin-top:7px;color:var(--muted);font-size:9px; }
.premium-account-card strong { margin-top:4px;font-size:16px; }
.premium-account-card button { position:absolute;right:7px;top:7px;border:0;background:transparent;color:var(--muted); }
.premium-theme-grid {
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:7px;
  margin-top:14px;
}
.premium-theme-grid button {
  padding:7px 3px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface-2);
  font-size:8px;
}
.premium-theme-grid button.active { border-color:var(--green-700);box-shadow:0 0 0 2px rgba(14,143,77,.12); }
.premium-theme-grid i { width:30px;height:30px;display:block;margin:0 auto 5px;border-radius:10px; }
.theme-default{background:linear-gradient(145deg,#07543a,#16a45b)}
.theme-ocean{background:linear-gradient(145deg,#075985,#0ea5a4)}
.theme-royal{background:linear-gradient(145deg,#43206d,#7c3aed)}
.theme-rose{background:linear-gradient(145deg,#8a294f,#e34982)}
.theme-midnight{background:linear-gradient(145deg,#111827,#334155)}
.premium-tool-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:9px;
  margin-top:13px;
}
.premium-tool-grid button {
  min-height:105px;
  display:grid;
  align-content:center;
  gap:3px;
  padding:13px;
  border:1px solid var(--line);
  border-radius:17px;
  color:var(--text);
  background:var(--surface-2);
  text-align:left;
}
.premium-tool-grid button > span { font-size:25px; }
.premium-tool-grid button b { font-size:12px; }
.premium-tool-grid button small { color:var(--muted);font-size:8px; }
.premium-feature-modal .dialog-icon { font-size:27px; }
.premium-inline-fields { display:grid;grid-template-columns:1fr 1fr;gap:9px; }
.settings-form select,.settings-form input[type="number"],.settings-form input[type="date"],.settings-form input[type="color"] {
  width:100%;min-height:48px;padding:0 12px;border:1px solid var(--line);border-radius:14px;color:var(--text);background:var(--surface-2);
}
.settings-form input[type="color"] { padding:6px; }
body[data-premium-theme="ocean"] {
  --green-950:#063b4d;--green-900:#075985;--green-700:#0e8f8d;--green-600:#14a8a4;--green-100:#e4f8f8;
}
body[data-premium-theme="royal"] {
  --green-950:#2d164b;--green-900:#43206d;--green-700:#6d35bb;--green-600:#7c3aed;--green-100:#f1eafe;
}
body[data-premium-theme="rose"] {
  --green-950:#58162f;--green-900:#7a2347;--green-700:#bd376e;--green-600:#e34982;--green-100:#ffe9f2;
}
body[data-premium-theme="midnight"] {
  --bg:#0b111b;--surface:#121b29;--surface-2:#172234;--text:#eef4ff;--muted:#91a0b5;--line:#29364a;
  --green-950:#0c1421;--green-900:#17243a;--green-700:#42b883;--green-600:#51cf91;--green-100:#183a31;
  --shadow:0 18px 48px rgba(0,0,0,.34);--soft-shadow:0 8px 24px rgba(0,0,0,.22);
}
@media(max-width:370px){
  .premium-filter-grid{grid-template-columns:1fr}
  .premium-theme-grid{grid-template-columns:repeat(3,1fr)}
  .premium-inline-fields{grid-template-columns:1fr}
}

/* v1.20 — responsive Premium button (side-by-side when free, icon-only when paid) */
.top-unlock {
  width: auto !important;
  height: 40px !important;
  min-width: 40px !important;
  padding: 0 12px !important;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  border-radius: 999px !important;
  background: rgba(2, 38, 25, 0.45) !important;
  border: 1px solid rgba(242, 201, 76, 0.6) !important;
}
.top-unlock:not(:has(span)) {
  width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 14px !important;
}
.top-unlock svg {
  width: 17px !important;
  height: 17px !important;
  flex-shrink: 0 !important;
  color: #ffe680 !important;
}
.top-unlock span {
  color: #ffe680 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

/* =========================================================
   v1.21 — reconciled income and vault-safe accounting
   ========================================================= */
.stat-card > div:last-child {
  min-width: 0;
}
.stat-card > div:last-child > span,
.stat-card > div:last-child > small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.stat-card > div:last-child > small {
  max-width: 150px;
}

.history-reconciliation {
  margin: 0 0 12px;
  padding: 15px;
  border: 1px solid rgba(14, 143, 77, .22);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0, rgba(53, 191, 114, .12), transparent 38%),
    var(--surface);
  box-shadow: var(--soft-shadow);
}
.reconciliation-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.reconciliation-heading > div span,
.reconciliation-heading > div strong {
  display: block;
}
.reconciliation-heading > div span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}
.reconciliation-heading > div strong {
  margin-top: 4px;
  font-size: 20px;
}
.reconciliation-status {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--green-700);
  background: var(--green-100);
  font-size: 9px;
  font-weight: 900;
}
.reconciliation-formula {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
}
.reconciliation-formula > div {
  min-width: 0;
  padding: 9px 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  text-align: center;
}
.reconciliation-formula small,
.reconciliation-formula b {
  display: block;
}
.reconciliation-formula small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.reconciliation-formula b {
  margin-top: 4px;
  font-size: 11px;
}
.reconciliation-formula > i {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}
.reconciliation-formula .formula-total {
  color: var(--green-700);
  border-color: rgba(14, 143, 77, .2);
  background: var(--green-100);
}
.history-reconciliation > p {
  margin: 11px 1px 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}
@media (max-width: 370px) {
  .reconciliation-formula {
    grid-template-columns: 1fr;
  }
  .reconciliation-formula > i {
    display: none;
  }
}

/* =========================================================
   v1.22 — fixed-nav overlap and accordion corrections
   ========================================================= */
:root {
  --fixed-nav-clearance: calc(var(--nav-h) + 72px + env(safe-area-inset-bottom));
}

/* Every screen can scroll its final control completely above the fixed nav. */
.screen {
  padding-bottom: var(--fixed-nav-clearance) !important;
  scroll-padding-bottom: var(--fixed-nav-clearance);
}

/* Transaction history needs its own internal clearance because its page body
   is long and grouped cards can expand near the bottom. */
.transaction-history-page {
  padding-bottom: var(--fixed-nav-clearance) !important;
  scroll-padding-bottom: var(--fixed-nav-clearance);
}

.history-groups {
  padding-bottom: 18px;
}

/* Keep the last card fully visible after expanding it. */
.history-group:last-child {
  margin-bottom: 12px;
}

/* Ensure the nav remains visually separate instead of covering card borders. */
.bottom-nav {
  isolation: isolate;
  box-shadow:
    0 -1px 0 rgba(221, 232, 226, .95),
    0 -14px 34px rgba(10, 56, 40, .11) !important;
}

body.dark .bottom-nav {
  box-shadow:
    0 -1px 0 var(--line),
    0 -14px 34px rgba(0, 0, 0, .32) !important;
}

/* =========================================================
   v1.23 — conversion-focused Premium checkout
   ========================================================= */
.premium-checkout-modal {
  width: min(calc(100% - 20px), 430px) !important;
  max-height: min(94dvh, calc(var(--visual-viewport-height) - 12px)) !important;
  padding: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  border-color: rgba(255, 225, 92, .28) !important;
  background: #063d2b !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.28) transparent;
}
.premium-checkout-modal::-webkit-scrollbar {
  width: 5px;
}
.premium-checkout-modal::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(255,255,255,.26);
}
.premium-checkout-modal {
  width: min(calc(100% - 28px), 410px) !important;
  padding: 24px 22px 20px !important;
  max-height: 90svh !important;
  border-radius: 24px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: #111d17 !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
}

.premium-checkout-modal .close-premium {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s ease;
}
.premium-checkout-modal .close-premium:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.premium-checkout-head {
  margin-bottom: 18px;
  padding-right: 28px;
}
.premium-badge-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 10px;
}
.premium-badge-row .crown-icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}
.premium-checkout-head h2 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  letter-spacing: -0.2px;
}
.premium-checkout-head p {
  margin: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.45;
}

/* Plan selector */
.premium-checkout-modal .plan-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.premium-checkout-modal .plan-grid button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}
.premium-checkout-modal .plan-grid button:hover {
  background: rgba(255, 255, 255, 0.07);
}
.premium-checkout-modal .plan-grid button.selected {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}
.plan-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s ease;
}
.premium-checkout-modal .plan-grid button.selected .plan-radio {
  border-color: #10b981;
}
.premium-checkout-modal .plan-grid button.selected .plan-radio::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #10b981;
}
.plan-info {
  flex-grow: 1;
}
.plan-info span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}
.plan-info small {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 1px;
}
.plan-price {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
}
.save-tag {
  position: absolute;
  top: -8px;
  right: 14px;
  padding: 2px 8px;
  border-radius: 99px;
  background: #10b981;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
}

/* CTA Button */
.premium-checkout-modal .premium-activate-button {
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  border: 0;
  border-radius: 14px;
  background: #10b981;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.premium-checkout-modal .premium-activate-button:hover {
  background: #059669;
}
.premium-checkout-modal .premium-activate-button:active {
  transform: scale(0.98);
}

.premium-footer-note {
  text-align: center;
  margin-top: 12px;
}
.premium-footer-note span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

.view-all-features-link {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 4px 0 0;
  border: 0;
  background: transparent;
  color: #10b981;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}
.view-all-features-link:hover {
  text-decoration: underline;
}
.premium-benefit-content {
  padding: 22px 18px 28px;
  color: #fff;
  background: linear-gradient(180deg, #052a1e 0%, #031c14 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.premium-value-hero {
  padding: 20px;
  border: 1px solid rgba(253, 224, 71, 0.3);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(253, 224, 71, 0.15), transparent 50%),
    rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
}
.premium-value-hero > span {
  display: block;
  color: #fde047;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.8px;
}
.premium-value-hero h3 {
  margin: 8px 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
  color: #ffffff;
}
.premium-value-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  line-height: 1.6;
}
.premium-benefit-section,
.premium-comparison-card {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
}
.premium-section-title > span {
  display: block;
  color: #34d399;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
}
.premium-section-title h3 {
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.35;
}
.premium-feature-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.premium-feature-list article {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.2s ease;
}
.premium-feature-list article:hover {
  background: rgba(255, 255, 255, 0.07);
}
.premium-feature-list article > i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(52, 211, 153, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.24);
  font-size: 20px;
  font-style: normal;
}
.premium-feature-list strong {
  display: block;
  font-size: 13px;
  font-weight: 750;
  color: #ffffff;
}
.premium-feature-list small {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 10px;
  line-height: 1.5;
}
.premium-comparison-table {
  display: grid;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
}
.premium-comparison-table > div {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 1fr;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  align-items: center;
}
.premium-comparison-table > div:last-child {
  border-bottom: 0;
}
.premium-comparison-table .comparison-head {
  color: #fde047;
  background: rgba(255, 255, 255, 0.1);
  font-size: 10px;
  font-weight: 800;
}
.premium-comparison-table span {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.9);
}
.premium-comparison-table b {
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  font-weight: 600;
}
.premium-comparison-table strong {
  color: #34d399;
  font-size: 10px;
  font-weight: 800;
}
.premium-final-message {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 14px;
  margin-top: 6px;
  padding: 18px;
  border: 1px solid rgba(253, 224, 71, 0.3);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(253, 224, 71, 0.12), rgba(255, 255, 255, 0.04));
}
.premium-final-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #042419;
  background: linear-gradient(135deg, #fde047, #f59e0b);
  font-size: 26px;
  box-shadow: 0 4px 12px rgba(253, 224, 71, 0.3);
}
.premium-final-message span {
  color: #fde047;
  font-size: 10px;
  font-weight: 900;
}
.premium-final-message h3 {
  margin: 4px 0 6px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  color: #ffffff;
}
.premium-final-message p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  line-height: 1.5;
}
.premium-benefit-content .demo-note {
  margin: 8px 3px 2px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
}
@media (max-width: 370px) {
  .premium-purchase-zone {
    padding-inline: 14px;
  }
  .premium-benefit-content {
    padding-inline: 14px;
  }
  .premium-trust-row span {
    gap: 4px;
    font-size: 9px;
  }
  .premium-comparison-table > div {
    grid-template-columns: 1.3fr 0.7fr 1fr;
    padding-inline: 8px;
  }
}

/* Custom Confirm & Alert Modal Popup */
.custom-confirm-modal {
  width: min(calc(100% - 32px), 360px) !important;
  padding: 24px 20px 20px !important;
  border-radius: 24px !important;
  border: 1px solid var(--line) !important;
  background: var(--surface) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4) !important;
  text-align: center;
}
.custom-confirm-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 18px;
  background: var(--green-100);
  color: var(--green-700);
  font-size: 26px;
  display: grid;
  place-items: center;
}
.custom-confirm-body h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.custom-confirm-body p {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  white-space: pre-line;
}
.custom-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.custom-confirm-actions button {
  min-height: 44px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
}


.home-body .recent-card {
  margin-bottom: 8px;
}
.home-body .recent-card .transaction-list {
  max-height: none;
}
/* v1.26 — grouped home transactions */
.home-history-tabs {
  margin-top: 14px;
}
.home-history-groups {
  display: grid;
  gap: 11px;
  margin-top: 12px;
}
.home-history-group {
  box-shadow: none;
}
.home-history-group .history-group-header {
  min-height: 68px;
  cursor: pointer;
}
.home-history-group .history-group-body {
  padding-left: 15px;
}
@media (max-width: 370px) {
  .home-history-group .history-group-header {
    padding-inline: 11px;
  }
  .home-history-group .history-group-body {
    padding-inline: 10px;
  }
}
/* v1.27 — cleaner home information hierarchy */
.premium-balance-card .balance-value {
  margin-top: 16px;
}
.balance-footer {
  justify-content: flex-start;
}
.home-transaction-heading {
  align-items: center;
  justify-content: space-between;
}
.home-transaction-heading h2 {
  margin: 0;
}
.home-transaction-count {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--green-700);
  background: var(--green-100);
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}
.home-history-tabs {
  margin-top: 12px;
}
.home-history-tabs button {
  min-height: 42px;
}
.stat-card > div:last-child > small {
  max-width: none;
  font-size: 9px;
}
/* v1.28 — organized category library */
.category-choice-grid {
  display: block;
  max-height: 390px;
  padding: 2px 4px 10px 2px;
  overflow-y: auto;
  scroll-padding-top: 42px;
}
.category-choice-section + .category-choice-section {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}
.category-section-title {
  position: sticky;
  z-index: 2;
  top: -2px;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  margin: 0 0 9px;
  padding: 6px 8px;
  border-radius: 10px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(8px);
}
.category-section-title span {
  font-size: 15px;
}
.category-section-title strong {
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .15px;
}
.category-choice-section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.category-choice {
  min-height: 98px;
  padding: 10px 6px;
  gap: 8px;
}
.category-choice .choice-icon {
  width: 42px;
  height: 42px;
  font-size: 21px;
}
.category-choice span:last-child {
  display: -webkit-box;
  min-height: 28px;
  overflow: hidden;
  font-size: 9.5px;
  line-height: 1.45;
  white-space: normal;
  text-overflow: clip;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
body.dark .category-section-title {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}
@media (max-width: 370px) {
  .category-choice-section-grid {
    gap: 7px;
  }
  .category-choice {
    min-height: 92px;
    padding-inline: 4px;
  }
  .category-choice span:last-child {
    font-size: 9px;
  }
}
/* v1.29 — usage-ranked flat categories */
.category-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  max-height: 390px;
  padding: 2px 4px 10px 2px;
  overflow-y: auto;
}
@media (max-width: 370px) {
  .category-choice-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }
}
/* v1.30 — editable payment account balances */
.account-card-actions {
  position: absolute;
  top: 7px;
  right: 7px;
  display: inline-flex;
  gap: 4px;
}
.premium-account-card .account-card-actions button {
  position: static;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: var(--surface);
  font-size: 13px;
}
.premium-account-card .account-card-actions button:active {
  color: var(--green-700);
  border-color: var(--green-600);
}
.account-edit-hint {
  margin: 11px 2px 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}
#paymentAccountForm label > small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

/* =========================================================
   v1.31 — actionable Advanced Report
   ========================================================= */
.bottom-nav {
  grid-template-columns: 1fr 1fr 66px 1fr 1fr 1fr;
  padding-inline: 5px;
}
.nav-item {
  min-width: 0;
  font-size: 8.5px;
}
.nav-item span {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.report-screen {
  background: #f2f6f3;
}
.report-hero {
  position: relative;
  padding: max(22px, env(safe-area-inset-top)) 17px 30px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 92% 8%, rgba(68, 221, 143, .26), transparent 31%),
    radial-gradient(circle at 5% 100%, rgba(72, 128, 255, .16), transparent 35%),
    linear-gradient(150deg, #071d17 0%, #073d2c 56%, #075b3a 100%);
}
.report-hero::after {
  content: "";
  position: absolute;
  width: 185px;
  height: 185px;
  right: -108px;
  bottom: 34px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
}
.report-title-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.report-title-row > div > span {
  color: #73dfa3;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.2px;
}
.report-title-row h1 {
  margin: 4px 0 0;
  font-size: 25px;
  letter-spacing: -.35px;
}
.report-info-btn {
  flex: 0 0 auto;
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.07);
}
.report-month-nav {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.08);
  box-shadow: none;
}
.report-month-nav button {
  color: #fff;
}
.report-month-nav .month-prev,
.report-month-nav .month-next {
  border-color: rgba(255,255,255,.11);
  background: rgba(255,255,255,.06);
}
.report-month-nav .month-nav-label {
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,35,24,.34);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  appearance: none;
  -webkit-appearance: none;
}
.report-month-nav button:disabled {
  color: rgba(255,255,255,.3);
}
.report-range-tabs {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 10px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(0,0,0,.18);
}
.report-range-tabs button {
  min-height: 34px;
  padding: 7px;
  border: 0;
  border-radius: 10px;
  color: rgba(255,255,255,.62);
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.report-range-tabs button.active {
  color: #073d2c;
  background: #dff8e9;
  box-shadow: 0 5px 14px rgba(0,0,0,.14);
}
.report-score-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin-top: 15px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 23px;
  background: rgba(255,255,255,.075);
  box-shadow: 0 16px 38px rgba(0,0,0,.14);
}
.report-score-ring {
  --score-color: #55dda0;
  width: 100px;
  height: 100px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--score-color) calc(var(--score) * 1%), rgba(255,255,255,.12) 0);
}
.report-score-ring::before {
  content: "";
  position: absolute;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: #0b3427;
  box-shadow: inset 0 0 18px rgba(0,0,0,.22);
}
.report-score-ring > div {
  position: relative;
  z-index: 1;
  text-align: center;
}
.report-score-ring strong,
.report-score-ring small {
  display: block;
}
.report-score-ring strong {
  font-size: 28px;
  line-height: 1;
}
.report-score-ring small {
  margin-top: 4px;
  color: rgba(255,255,255,.55);
  font-size: 8px;
}
.report-score-copy > span {
  color: #73dfa3;
  font-size: 9px;
  font-weight: 850;
}
.report-score-copy h2 {
  margin: 4px 0 6px;
  font-size: 18px;
  line-height: 1.25;
}
.report-score-copy p {
  margin: 0;
  color: rgba(255,255,255,.65);
  font-size: 10px;
  line-height: 1.55;
}

.report-page {
  position: relative;
  z-index: 2;
  margin-top: -1px;
  padding-top: 16px;
}
.report-metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.report-metric-grid article {
  position: relative;
  min-width: 0;
  min-height: 126px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}
.report-metric-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 11px;
  font-size: 16px;
  font-weight: 900;
}
.report-metric-icon.income { color: var(--green-700); background: var(--green-100); }
.report-metric-icon.expense { color: var(--red); background: var(--red-soft); }
.report-metric-icon.vault { color: #0e8790; background: #e4f8f8; }
.report-metric-icon.net { color: #6c43d8; background: #f0ebff; }
.report-metric-grid small,
.report-metric-grid strong,
.report-metric-grid em {
  display: block;
}
.report-metric-grid article > small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}
.report-metric-grid article > strong {
  margin-top: 4px;
  overflow: hidden;
  font-size: 17px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.report-metric-grid em {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
  line-height: 1.35;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.report-section {
  margin-top: 13px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 23px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}
.report-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.report-section-heading > div:first-child > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .35px;
}
.report-section-heading h2 {
  margin: 3px 0 0;
  font-size: 17px;
}
.report-section-heading > strong {
  color: var(--green-700);
  font-size: 11px;
}
.report-chart-key {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
}
.report-chart-key i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #18a45b;
}
.report-chart-key i:nth-of-type(2) { background: #f2a23a; }
.report-trend-chart {
  height: 180px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  margin-top: 20px;
  padding-top: 12px;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to top, transparent 0 42px, var(--line) 42px 43px);
}
.report-trend-month {
  height: 148px;
  display: grid;
  grid-template-rows: 1fr 18px;
  align-items: end;
  gap: 5px;
}
.report-trend-bars {
  height: 125px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
}
.report-trend-bars i {
  width: min(10px, 42%);
  min-height: 0;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(#3ac879, #0d8d4b);
}
.report-trend-bars i.expense {
  background: linear-gradient(#ffc165, #e98e22);
}
.report-trend-month small {
  color: var(--muted);
  text-align: center;
  font-size: 8px;
}
.report-category-list {
  display: grid;
  gap: 14px;
  margin-top: 17px;
}
.report-category-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.report-category-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-size: 16px;
}
.report-category-main {
  min-width: 0;
}
.report-category-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.report-category-title strong {
  overflow: hidden;
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.report-category-title small {
  color: var(--muted);
  font-size: 8px;
}
.report-category-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-2);
}
.report-category-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
}
.report-category-row > strong {
  font-size: 10px;
}
.report-inline-empty {
  padding: 20px 10px 8px;
  color: var(--muted);
  text-align: center;
  font-size: 10px;
  line-height: 1.55;
}

.report-inaction-card {
  position: relative;
  margin-top: 13px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid #efc684;
  border-radius: 23px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255,190,85,.24), transparent 34%),
    linear-gradient(145deg, #fff9ec, #fff4dc);
  box-shadow: 0 10px 28px rgba(126,76,5,.08);
}
.report-inaction-card > span {
  color: #a05b08;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .45px;
}
.report-inaction-card h2 {
  max-width: 315px;
  margin: 7px 0;
  color: #3d2a10;
  font-size: 18px;
  line-height: 1.35;
}
.report-inaction-card > p {
  margin: 0;
  color: #765b36;
  font-size: 10px;
  line-height: 1.6;
}
.report-opportunity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 15px;
  padding: 12px;
  border: 1px solid rgba(160,91,8,.13);
  border-radius: 14px;
  background: rgba(255,255,255,.58);
}
.report-opportunity small {
  color: #765b36;
  font-size: 9px;
  line-height: 1.35;
}
.report-opportunity strong {
  color: #08713f;
  font-size: 16px;
  white-space: nowrap;
}
.report-inaction-card > button {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 11px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: #102f24;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}
.report-inaction-card > button svg { width: 15px; }
.report-estimate-note {
  display: block;
  margin-top: 9px;
  color: #92734a;
  text-align: center;
  font-size: 7.5px;
}
.report-action-list {
  display: grid;
  gap: 10px;
  margin-top: 15px;
}
.report-action-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}
.report-action-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--green-700);
  background: var(--green-100);
  font-size: 12px;
  font-weight: 900;
}
.report-action-copy strong,
.report-action-copy small {
  display: block;
}
.report-action-copy strong {
  font-size: 11px;
  line-height: 1.35;
}
.report-action-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.45;
}
.report-action-item button {
  min-width: 45px;
  padding: 7px 8px;
  border: 1px solid rgba(14,143,77,.2);
  border-radius: 10px;
  color: var(--green-700);
  background: var(--green-100);
  font-size: 8px;
  font-weight: 900;
  cursor: pointer;
}
.report-runway-track {
  position: relative;
  height: 10px;
  margin-top: 20px;
  overflow: hidden;
  border-radius: 99px;
  background: #e7ede9;
}
.report-runway-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f2a23a, #18a45b);
  transition: width .35s ease;
}
.report-runway-track i {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(25,45,36,.35);
}
.report-runway-track i:nth-of-type(1) { left: 33.33%; }
.report-runway-track i:nth-of-type(2) { right: 1px; }
.report-runway-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--muted);
  font-size: 8px;
}
.report-safety-section > p {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}
.report-budget-list {
  display: grid;
  gap: 11px;
  margin-top: 15px;
}
.report-budget-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-2);
}
.report-budget-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.report-budget-top strong { font-size: 10px; }
.report-budget-top span { color: var(--muted); font-size: 8px; }
.report-budget-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: #e5ebe7;
}
.report-budget-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #18a45b;
}
.report-budget-row.warning .report-budget-bar i { background: #f2a23a; }
.report-budget-row.danger .report-budget-bar i { background: #ef544b; }
.report-budget-empty {
  padding: 8px 2px 2px;
  color: var(--muted);
  text-align: center;
  font-size: 9px;
  line-height: 1.55;
}
.report-budget-empty button {
  display: block;
  margin: 10px auto 0;
  padding: 9px 13px;
  border: 0;
  border-radius: 11px;
  color: var(--green-700);
  background: var(--green-100);
  font-size: 9px;
  font-weight: 900;
}
.report-privacy-note {
  margin: 15px 8px 0;
  color: var(--muted);
  text-align: center;
  font-size: 8px;
  line-height: 1.55;
}
.report-empty-card {
  padding: 28px 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
  text-align: center;
}
.report-empty-card > div {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 13px;
  border-radius: 18px;
  color: var(--green-700);
  background: var(--green-100);
  font-size: 32px;
}
.report-empty-card > span {
  color: var(--orange);
  font-size: 9px;
  font-weight: 900;
}
.report-empty-card h2 {
  margin: 6px 0 8px;
  font-size: 18px;
}
.report-empty-card p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}
.report-empty-card .primary-btn { font-size: 11px; }

body.dark .report-screen { background: var(--bg); }
body.dark .report-metric-icon.vault { background: rgba(14,135,144,.18); }
body.dark .report-metric-icon.net { background: rgba(108,67,216,.18); }
body.dark .report-inaction-card {
  border-color: rgba(242,162,58,.32);
  background:
    radial-gradient(circle at 100% 0%, rgba(242,162,58,.12), transparent 38%),
    #201b13;
}
body.dark .report-inaction-card h2 { color: #fff4dc; }
body.dark .report-inaction-card > p,
body.dark .report-opportunity small,
body.dark .report-estimate-note { color: #bca57f; }
body.dark .report-opportunity { background: rgba(255,255,255,.04); }
body.dark .report-runway-track,
body.dark .report-budget-bar { background: #26382f; }

@media (max-width: 370px) {
  .bottom-nav { grid-template-columns: 1fr 1fr 60px 1fr 1fr 1fr; padding-inline: 2px; }
  .nav-item { font-size: 7.5px; }
  .nav-item svg { width: 20px; height: 20px; }
  .report-score-card { grid-template-columns: 88px minmax(0, 1fr); gap: 12px; padding: 14px; }
  .report-score-ring { width: 86px; height: 86px; }
  .report-score-ring::before { width: 66px; height: 66px; }
  .report-score-ring strong { font-size: 24px; }
  .report-score-copy h2 { font-size: 16px; }
  .report-metric-grid article { padding: 13px; }
  .report-trend-chart { gap: 5px; }
  .report-action-item { grid-template-columns: 31px minmax(0, 1fr) auto; padding: 10px; }
}

/* Compact the first-run report so its primary action stays above fixed navigation. */
.report-screen:not(.report-has-data) .report-hero {
  padding-bottom: 18px;
}
.report-screen:not(.report-has-data) .report-score-card {
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  margin-top: 11px;
  padding: 12px;
}
.report-screen:not(.report-has-data) .report-score-ring {
  width: 74px;
  height: 74px;
}
.report-screen:not(.report-has-data) .report-score-ring::before {
  width: 56px;
  height: 56px;
}
.report-screen:not(.report-has-data) .report-score-ring strong {
  font-size: 21px;
}
.report-screen:not(.report-has-data) .report-score-copy h2 {
  font-size: 16px;
}
.report-screen:not(.report-has-data) .report-empty-card {
  padding: 20px 18px;
}
.report-screen:not(.report-has-data) .report-empty-card > div {
  width: 48px;
  height: 48px;
  margin-bottom: 9px;
  border-radius: 15px;
  font-size: 26px;
}
.report-screen:not(.report-has-data) .report-empty-card h2 {
  margin-block: 5px 6px;
  font-size: 16px;
  border-radius: 99px;
  background: #e7ede9;
}
.report-runway-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f2a23a, #18a45b);
  transition: width .35s ease;
}
.report-runway-track i {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(25,45,36,.35);
}
.report-runway-track i:nth-of-type(1) { left: 33.33%; }
.report-runway-track i:nth-of-type(2) { right: 1px; }
.report-runway-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--muted);
  font-size: 8px;
}
.report-safety-section > p {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}
.report-budget-list {
  display: grid;
  gap: 11px;
  margin-top: 15px;
}
.report-budget-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-2);
}
.report-budget-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.report-budget-top strong { font-size: 10px; }
.report-budget-top span { color: var(--muted); font-size: 8px; }
.report-budget-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: #e5ebe7;
}
.report-budget-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #18a45b;
}
.report-budget-row.warning .report-budget-bar i { background: #f2a23a; }
.report-budget-row.danger .report-budget-bar i { background: #ef544b; }
.report-budget-empty {
  padding: 8px 2px 2px;
  color: var(--muted);
  text-align: center;
  font-size: 9px;
  line-height: 1.55;
}
.report-budget-empty button {
  display: block;
  margin: 10px auto 0;
  padding: 9px 13px;
  border: 0;
  border-radius: 11px;
  color: var(--green-700);
  background: var(--green-100);
  font-size: 9px;
  font-weight: 900;
}
.report-privacy-note {
  margin: 15px 8px 0;
  color: var(--muted);
  text-align: center;
  font-size: 8px;
  line-height: 1.55;
}
.report-empty-card {
  padding: 28px 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
  text-align: center;
}
.report-empty-card > div {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 13px;
  border-radius: 18px;
  color: var(--green-700);
  background: var(--green-100);
  font-size: 32px;
}
.report-empty-card > span {
  color: var(--orange);
  font-size: 9px;
  font-weight: 900;
}
.report-empty-card h2 {
  margin: 6px 0 8px;
  font-size: 18px;
}
.report-empty-card p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}
.report-empty-card .primary-btn { font-size: 11px; }

body.dark .report-screen { background: var(--bg); }
body.dark .report-metric-icon.vault { background: rgba(14,135,144,.18); }
body.dark .report-metric-icon.net { background: rgba(108,67,216,.18); }
body.dark .report-inaction-card {
  border-color: rgba(242,162,58,.32);
  background:
    radial-gradient(circle at 100% 0%, rgba(242,162,58,.12), transparent 38%),
    #201b13;
}
body.dark .report-inaction-card h2 { color: #fff4dc; }
body.dark .report-inaction-card > p,
body.dark .report-opportunity small,
body.dark .report-estimate-note { color: #bca57f; }
body.dark .report-opportunity { background: rgba(255,255,255,.04); }
body.dark .report-runway-track,
body.dark .report-budget-bar { background: #26382f; }

@media (max-width: 370px) {
  .bottom-nav { grid-template-columns: 1fr 1fr 60px 1fr 1fr 1fr; padding-inline: 2px; }
  .nav-item { font-size: 7.5px; }
  .nav-item svg { width: 20px; height: 20px; }
  .report-score-card { grid-template-columns: 88px minmax(0, 1fr); gap: 12px; padding: 14px; }
  .report-score-ring { width: 86px; height: 86px; }
  .report-score-ring::before { width: 66px; height: 66px; }
  .report-score-ring strong { font-size: 24px; }
  .report-score-copy h2 { font-size: 16px; }
  .report-metric-grid article { padding: 13px; }
  .report-trend-chart { gap: 5px; }
  .report-action-item { grid-template-columns: 31px minmax(0, 1fr) auto; padding: 10px; }
}

/* Compact the first-run report so its primary action stays above fixed navigation. */
.report-screen:not(.report-has-data) .report-hero {
  padding-bottom: 18px;
}
.report-screen:not(.report-has-data) .report-score-card {
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  margin-top: 11px;
  padding: 12px;
}
.report-screen:not(.report-has-data) .report-score-ring {
  width: 74px;
  height: 74px;
}
.report-screen:not(.report-has-data) .report-score-ring::before {
  width: 56px;
  height: 56px;
}
.report-screen:not(.report-has-data) .report-score-ring strong {
  font-size: 21px;
}
.report-screen:not(.report-has-data) .report-score-copy h2 {
  font-size: 16px;
}
.report-screen:not(.report-has-data) .report-empty-card {
  padding: 20px 18px;
}
.report-screen:not(.report-has-data) .report-empty-card > div {
  width: 48px;
  height: 48px;
  margin-bottom: 9px;
  border-radius: 15px;
  font-size: 26px;
}
.report-screen:not(.report-has-data) .report-empty-card h2 {
  margin-block: 5px 6px;
  font-size: 16px;
}
.report-screen:not(.report-has-data) .report-empty-card p {
  margin-bottom: 12px;
  line-height: 1.5;
}
.drawer-backdrop, .side-drawer { display: none !important; }

.app-brand strong {
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.3px;
  color: #ffffff;
}


/* Minimal Bottom Navigation Bar */
:root {
  --nav-h: 64px;
  --fixed-nav-clearance: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom));
}

.screen,
.transaction-history-page {
  padding-bottom: var(--fixed-nav-clearance) !important;
  scroll-padding-bottom: var(--fixed-nav-clearance);
}

.bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: min(100%, 460px) !important;
  height: calc(64px + env(safe-area-inset-bottom)) !important;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)) !important;
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  align-items: center !important;
  justify-content: space-around !important;
  z-index: 25 !important;
  background: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-top: 1px solid rgba(16, 36, 28, 0.08) !important;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04) !important;
  user-select: none;
  -webkit-user-select: none;
}

body.dark .bottom-nav {
  background: rgba(14, 26, 20, 0.94) !important;
  border-top-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25) !important;
}

.nav-item {
  position: relative;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  height: 100% !important;
  padding: 4px 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--muted) !important;
  font: inherit !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
  transition: color 0.15s ease, transform 0.12s ease !important;
}

.nav-item svg {
  width: 22px !important;
  height: 22px !important;
  stroke-width: 1.8 !important;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), stroke-width 0.15s ease !important;
}

.nav-item span {
  font-size: 10px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  letter-spacing: -0.1px !important;
  transition: font-weight 0.15s ease !important;
}

.nav-item:active {
  transform: scale(0.92) !important;
}

.nav-item.active {
  color: var(--green-700) !important;
}

body.dark .nav-item.active {
  color: #2cd882 !important;
}

.nav-item.active svg {
  transform: translateY(-2px) scale(1.08) !important;
  stroke-width: 2.3 !important;
}

.nav-item.active span {
  font-weight: 800 !important;
}

.nav-item.active::after {
  content: "";
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom) + 2px);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.screen-menu-title-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  padding: 0 0 14px;
}
.screen-menu-title-row h1 { text-align: center; }
.screen-menu-spacer { width: 42px; height: 42px; }
.screen-menu-btn {
  color: var(--green-700);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.profile-top {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
}
.profile-top h1 { text-align: center; }
.report-title-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 12px;
}
.report-title-row > div { text-align: center; }
.drawer-nav .drawer-add-entry {
  border-color: rgba(14, 143, 77, .28);
  background: linear-gradient(145deg, var(--green-100), var(--surface));
}
.drawer-nav .drawer-add-entry > span {
  color: #fff;
  background: linear-gradient(145deg, #16a45b, #08713f);
  box-shadow: 0 7px 16px rgba(14, 143, 77, .22);
}
.drawer-nav .drawer-add-entry svg { width: 22px; height: 22px; }
body.dark .drawer-nav .drawer-add-entry {
  border-color: rgba(61, 202, 123, .25);
  background: rgba(25, 164, 90, .12);
}


/* v1.34 — one-tap transaction action on Home only */
.screen[data-screen="home"] {
  padding-bottom: calc(130px + env(safe-area-inset-bottom)) !important;
}
.home-quick-add {
  position: fixed;
  z-index: 18;
  right: calc(max(0px, (100vw - 460px) / 2) + 18px);
  bottom: calc(76px + env(safe-area-inset-bottom));
  left: auto;
  margin: 0;
  transform: none;
  box-shadow:
    0 0 0 7px rgba(255,255,255,.92),
    0 12px 28px rgba(6,111,63,.38);
}
.home-quick-add:not(:disabled):active {
  transform: scale(.93);
}
body.dark .home-quick-add {
  box-shadow:
    0 0 0 7px rgba(16,29,22,.94),
    0 12px 28px rgba(0,0,0,.42);
}


/* v1.35 — WebView-safe bottom-right quick action */
.screen[data-screen="home"] .home-quick-add {
  position: fixed !important;
  z-index: 30 !important;
  right: 18px !important;
  bottom: calc(76px + env(safe-area-inset-bottom)) !important;
  left: auto !important;
  top: auto !important;
  width: 62px !important;
  height: 62px !important;
  display: grid !important;
  place-items: center !important;
  margin: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}
.screen[data-screen="home"] .home-quick-add:not(:disabled):active {
  transform: scale(.93) !important;
}
@media (min-width: 461px) {
  .screen[data-screen="home"] .home-quick-add {
    right: calc(50% - 212px) !important;
  }
}


/* v1.36 — app-level overlay; unaffected by the scrolling screen transform */
.app-shell > .home-quick-add {
  position: fixed !important;
  z-index: 30 !important;
  right: 18px !important;
  bottom: calc(76px + env(safe-area-inset-bottom)) !important;
  left: auto !important;
  top: auto !important;
  width: 62px !important;
  height: 62px !important;
  display: none !important;
  place-items: center !important;
  margin: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}
.app-shell > .home-quick-add.is-visible {
  display: grid !important;
}
.app-shell > .home-quick-add.is-visible:not(:disabled):active {
  transform: scale(.93) !important;
}
@media (min-width: 461px) {
  .app-shell > .home-quick-add {
    right: calc(50% - 212px) !important;
  }
}


/* v1.37 — clean quick action without the white halo layer */
.app-shell > .home-quick-add,
body.dark .app-shell > .home-quick-add {
  border: 0 !important;
  box-shadow: 0 12px 28px rgba(6, 111, 63, .34) !important;
}
body.dark .app-shell > .home-quick-add {
  box-shadow: 0 12px 28px rgba(0, 0, 0, .38) !important;
}


/* v1.38 — edge-to-edge Home transaction section */
.home-body .recent-card {
  width: calc(100% + 34px);
  margin-right: -17px;
  margin-left: -17px;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  box-shadow: none;
}
@media (max-width: 370px) {
  .home-body .recent-card {
    width: calc(100% + 24px);
    margin-right: -12px;
    margin-left: -12px;
  }
}


/* v1.39 — lazy paint for long, below-the-fold sections */
.report-section,
.report-opportunity,
.report-action-item,
.vault-account-card,
.savings-rule-card,
.home-history-group {
  content-visibility: auto;
  contain-intrinsic-size: 1px 150px;
}


/* v1.40 — blurred privacy values and account-aware payment choices */
.privacy-blurred { filter: blur(7px); user-select: none; -webkit-user-select: none; }
.balance-value.privacy-blurred { letter-spacing: -.8px; }
.carry-over-chip .privacy-blurred,
.drawer-balance-row .privacy-blurred { display: inline-block; }
.payment-choice { min-height: 62px; justify-content: flex-start; padding: 8px 10px; text-align: left; }
.payment-choice-icon { flex: 0 0 auto; font-size: 16px; }
.payment-choice-copy { min-width: 0; display: grid; gap: 3px; }
.payment-choice-copy b,
.payment-choice-copy small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.payment-choice-copy b { color: var(--text); font-size: 9px; }
.payment-choice-copy small { font-size: 10px; font-weight: 900; }
.payment-choice.active .payment-choice-copy b { color: var(--green-700); }
.premium-account-card .account-card-actions .account-delete-btn { color: var(--red); background: var(--red-soft); }

/* v1.38 — account-to-account transfers */
.premium-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.account-transfer-entry-btn { width: 100%; margin-top: 10px; padding: 11px 12px; border: 1px solid color-mix(in srgb, var(--green-600) 24%, var(--line)); border-radius: 14px; color: var(--green-700); background: color-mix(in srgb, var(--green-100) 68%, var(--surface)); font: inherit; font-size: 11px; font-weight: 800; }
.account-transfer-entry-btn span { margin-right: 5px; font-size: 16px; }
.transfer-modal-note { margin: -2px 0 14px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.transfer-account-flow { display: grid; grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1fr); align-items: center; gap: 6px; }
.transfer-account-flow label { min-width: 0; }
.transfer-account-flow select { width: 100%; }
.transfer-account-flow small { display: block; min-height: 29px; margin-top: 5px; color: var(--muted); font-size: 8.5px; line-height: 1.45; }
.transfer-flow-arrow { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--green-600); font-weight: 900; }
.account-transfer-history { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.account-transfer-history-heading span { color: var(--green-700); font-size: 8px; font-weight: 900; letter-spacing: .08em; }
.account-transfer-history-heading h3 { margin: 3px 0 10px; font-size: 15px; }
#accountTransferList { display: grid; gap: 8px; }
.account-transfer-history-item { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--surface) 94%, var(--green-100)); }
.transfer-history-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: var(--green-700); background: var(--green-100); font-size: 17px; font-weight: 900; }
.account-transfer-history-item div > strong { display: block; font-size: 11px; }
.account-transfer-history-item div > small { display: block; margin-top: 3px; color: var(--muted); font-size: 8.5px; }
.transfer-history-amount { text-align: right; }
.transfer-history-amount > strong { color: var(--green-700); font-size: 11px; }
.transfer-history-amount button { width: 25px; height: 25px; margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; color: var(--danger, #ef4444); background: var(--surface); }
@media (max-width: 370px) {
  .premium-heading-actions { width: 100%; justify-content: flex-start; }
  .transfer-account-flow { grid-template-columns: 1fr; }
  .transfer-flow-arrow { margin: -3px auto; transform: rotate(90deg); }
}
/* v1.39 — sensitive page swipe navigation */
.screen.active { touch-action: pan-y; }
.screen.active.swipe-tracking {
  transform: translate3d(var(--swipe-offset, 0), 0, 0);
  transition: none !important;
  will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
  .screen.active.swipe-tracking { transform: none; }
}

/* v1.41 — reusable custom emoji picker */
.emoji-picker-field {
  position: relative;
  min-width: 0;
}
.emoji-native-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.emoji-picker-trigger {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 10px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--text);
  background: var(--surface-2);
  text-align: left;
  cursor: pointer;
}
.emoji-picker-trigger[aria-expanded="true"] {
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green-600) 15%, transparent);
}
.emoji-picker-current {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--green-100);
  font-size: 23px;
}
.emoji-picker-trigger-copy { min-width: 0; display: grid; gap: 3px; }
.emoji-picker-trigger-copy b,
.emoji-picker-trigger-copy small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.emoji-picker-trigger-copy b { color: var(--text); font-size: 11px; }
.emoji-picker-trigger-copy small { color: var(--muted); font-size: 8px; }
.emoji-picker-chevron { color: var(--muted); font-size: 17px; text-align: center; }
.emoji-picker-field.emoji-picker-open { z-index: 20; }
.emoji-picker-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 7px);
  right: 0;
  width: min(310px, calc(100vw - 70px));
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 20px 48px rgba(9, 38, 27, .24);
}
.emoji-picker-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}
.emoji-picker-panel-head strong { color: var(--text); font-size: 11px; }
.emoji-picker-panel-head button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 18px;
}
.emoji-picker-grid {
  max-height: 190px;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 5px;
  padding: 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.emoji-picker-grid button {
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 19px;
  cursor: pointer;
}
.emoji-picker-grid button.selected {
  border-color: var(--green-600);
  background: var(--green-100);
  box-shadow: inset 0 0 0 1px var(--green-600);
}
.emoji-custom-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.emoji-custom-row input {
  width: 100%;
  min-width: 0;
  min-height: 40px !important;
  padding: 0 10px !important;
  border: 1px solid var(--line) !important;
  border-radius: 11px !important;
  color: var(--text) !important;
  background: var(--surface-2) !important;
  font-size: 10px;
}
.emoji-custom-row button {
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: var(--green-600);
  font-size: 9px;
  font-weight: 850;
}
body.dark .emoji-picker-panel { box-shadow: 0 22px 50px rgba(0, 0, 0, .48); }
@media (max-width: 370px) {
  .emoji-picker-panel { width: min(286px, calc(100vw - 54px)); padding: 9px; }
  .emoji-picker-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .emoji-picker-grid button { font-size: 18px; }
}
/* Brand badge header styling */
.app-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.app-brand-logo {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, rgba(255,255,255,0.22), rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.28);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -0.5px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  backdrop-filter: blur(8px);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.app-brand-logo svg {
  width: 20px;
  height: 20px;
}
.app-brand-name {
  color: #fff;
  font-size: 17px;
  font-weight: 850;
  letter-spacing: -0.4px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.top-profile-button {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-tap-highlight-color: transparent;
}
.top-profile-button svg {
  width: 21px;
  height: 21px;
}
.top-profile-button:active { transform: scale(.94); }
.top-profile-button.active {
  color: #d8ffe8;
  background: rgba(255, 255, 255, 0.18);
}
.top-profile-button.app-brand-logo {
  position: relative;
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  border-radius: 50%;
  border-color: rgba(216,255,232,.58);
  color: #f3fff8;
  background:
    radial-gradient(circle at 35% 28%, rgba(255,255,255,.28), transparent 36%),
    linear-gradient(145deg, rgba(56,189,122,.5), rgba(4,76,50,.74));
  box-shadow:
    0 5px 14px rgba(0,28,18,.24),
    inset 0 0 0 3px rgba(255,255,255,.06);
  transition: transform .14s ease, background .14s ease, box-shadow .14s ease;
}
.top-profile-button.app-brand-logo::after {
  content: none;
}
.top-profile-button.app-brand-logo svg {
  width: 19px;
  height: 19px;
  stroke-width: 2;
}
.top-profile-button.app-brand-logo:hover {
  background: linear-gradient(145deg, rgba(72,207,142,.62), rgba(5,91,59,.82));
  box-shadow: 0 7px 17px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.3);
}
.top-profile-button.app-brand-logo:focus-visible {
  outline: 3px solid rgba(115,223,163,.55);
  outline-offset: 3px;
}
.top-profile-button.app-brand-logo:active {
  transform: translateY(1px) scale(.92);
  box-shadow: 0 2px 7px rgba(0,0,0,.18), inset 0 1px 3px rgba(0,0,0,.12);
}
.bottom-nav { grid-template-columns: repeat(4, 1fr) !important; }
.side-drawer, .drawer-backdrop { display: none !important; }
.temporarily-hidden-feature { display: none !important; }
