/* ============================================================
   DESIGN TOKENS & THEMES
   ============================================================ */
:root {
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --radius-xs: 8px;
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --transition-fast: 0.15s ease;
  --transition-med: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* IVORY LIGHT (default) */
[data-theme="ivory-light"] {
  --bg: #FAF8F3;
  --bg-alt: #F2EDE5;
  --surface: #FFFFFF;
  --surface-2: #F5F0E8;
  --surface-3: #EDE7DC;
  --border: rgba(139, 111, 58, 0.15);
  --border-strong: rgba(139, 111, 58, 0.28);
  --text-1: #1C1410;
  --text-2: #4A3F35;
  --text-3: #7A6D62;
  --text-4: #A89D94;
  --accent: #E8B923;
  --accent-2: #FF6B35;
  --accent-light: rgba(139, 111, 58, 0.10);
  --accent-mid: rgba(139, 111, 58, 0.20);
  --success: #3D6B52;
  --success-bg: rgba(61, 107, 82, 0.10);
  --danger: #8B3A3A;
  --danger-bg: rgba(139, 58, 58, 0.10);
  --shadow-sm: 0 2px 8px rgba(28, 20, 16, 0.06);
  --shadow-md: 0 8px 32px rgba(28, 20, 16, 0.10);
  --shadow-lg: 0 20px 60px rgba(28, 20, 16, 0.14);
  --shadow-accent: 0 8px 32px rgba(139, 111, 58, 0.25);
  --nav-bg: rgba(250, 248, 243, 0.92);
  --overlay: rgba(28, 20, 16, 0.5);
  --card-highlight: inset 0 1px 0 rgba(255,255,255,0.8);
  --shimmer-1: rgba(139,111,58,0.0);
  --shimmer-2: rgba(139,111,58,0.18);
  --shimmer-3: rgba(196,146,58,0.12);
}

/* IVORY DARK — Candlelit Obsidian */
[data-theme="ivory-dark"] {
  --bg: #0E0B08;
  --bg-alt: #151009;
  --surface: #1E1710;
  --surface-2: #251C12;
  --surface-3: #2E2318;
  --border: rgba(196, 146, 58, 0.12);
  --border-strong: rgba(196, 146, 58, 0.25);
  --text-1: #F5EDD8;
  --text-2: #D4C5A9;
  --text-3: #9A8C78;
  --text-4: #6B5E4E;
  --accent: #E8B923;
  --accent-2: #FF6B35;
  --accent-light: rgba(196, 146, 58, 0.12);
  --accent-mid: rgba(196, 146, 58, 0.22);
  --success: #5A9472;
  --success-bg: rgba(90, 148, 114, 0.12);
  --danger: #C46060;
  --danger-bg: rgba(196, 96, 96, 0.12);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-accent: 0 8px 32px rgba(196, 146, 58, 0.20);
  --nav-bg: rgba(14, 11, 8, 0.92);
  --overlay: rgba(0, 0, 0, 0.7);
  --card-highlight: inset 0 1px 0 rgba(255,255,255,0.04);
  --shimmer-1: rgba(196,146,58,0.0);
  --shimmer-2: rgba(196,146,58,0.22);
  --shimmer-3: rgba(232,184,90,0.14);
}

/* SLATE LIGHT - Soft Minimal */
[data-theme="slate-light"] {
  --bg: #F4F4F6;
  --bg-alt: #ECEDF0;
  --surface: #FFFFFF;
  --surface-2: #F0F0F4;
  --surface-3: #E8E8EE;
  --border: rgba(180, 140, 160, 0.18);
  --border-strong: rgba(180, 140, 160, 0.32);
  --text-1: #1A1820;
  --text-2: #2A2838;
  --text-3: #5E5868;
  --text-4: #9E9AB0;
  --accent: #7B4DFF;
  --accent-2: #00D4FF;
  --accent-light: rgba(139, 96, 122, 0.10);
  --accent-mid: rgba(139, 96, 122, 0.20);
  --success: #4A7A5E;
  --success-bg: rgba(74, 122, 94, 0.10);
  --danger: #8B4040;
  --danger-bg: rgba(139, 64, 64, 0.10);
  --shadow-sm: 0 2px 8px rgba(26, 24, 32, 0.06);
  --shadow-md: 0 8px 32px rgba(26, 24, 32, 0.10);
  --shadow-lg: 0 20px 60px rgba(26, 24, 32, 0.14);
  --shadow-accent: 0 8px 32px rgba(139, 96, 122, 0.25);
  --nav-bg: rgba(244, 244, 246, 0.92);
  --overlay: rgba(26, 24, 32, 0.5);
  --card-highlight: inset 0 1px 0 rgba(255,255,255,0.9);
  --shimmer-1: rgba(139,96,122,0.0);
  --shimmer-2: rgba(139,96,122,0.18);
  --shimmer-3: rgba(184,128,152,0.12);
  --radius-modifier: 1.2;
}

/* SLATE DARK */
[data-theme="slate-dark"] {
  --bg: #0C0B10;
  --bg-alt: #12101A;
  --surface: #1A1824;
  --surface-2: #22202E;
  --surface-3: #2A2838;
  --border: rgba(184, 128, 152, 0.12);
  --border-strong: rgba(184, 128, 152, 0.25);
  --text-1: #EEE8F5;
  --text-2: #C8C0D8;
  --text-3: #907E9E;
  --text-4: #60546E;
  --accent: #7B4DFF;
  --accent-2: #00D4FF;
  --accent-light: rgba(184, 128, 152, 0.12);
  --accent-mid: rgba(184, 128, 152, 0.22);
  --success: #5A9470;
  --success-bg: rgba(90, 148, 112, 0.12);
  --danger: #C06060;
  --danger-bg: rgba(192, 96, 96, 0.12);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.35);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.45);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.55);
  --shadow-accent: 0 8px 32px rgba(184, 128, 152, 0.20);
  --nav-bg: rgba(12, 11, 16, 0.92);
  --overlay: rgba(0,0,0,0.7);
  --card-highlight: inset 0 1px 0 rgba(255,255,255,0.04);
  --shimmer-1: rgba(184,128,152,0.0);
  --shimmer-2: rgba(184,128,152,0.22);
  --shimmer-3: rgba(212,160,184,0.14);
}

/* OBSIDIAN LIGHT - Forest Fresh */
[data-theme="obsidian-light"] {
  --bg: #F2F4F0;
  --bg-alt: #E8EDE6;
  --surface: #FFFFFF;
  --surface-2: #EEF2EC;
  --surface-3: #E4EAE2;
  --border: rgba(60, 100, 70, 0.15);
  --border-strong: rgba(60, 100, 70, 0.28);
  --text-1: #0C1408;
  --text-2: #2A3E28;
  --text-3: #5A6E58;
  --text-4: #8AAE88;
  --accent: #00C48C;
  --accent-2: #FF2D95;
  --accent-light: rgba(61, 107, 82, 0.10);
  --accent-mid: rgba(61, 107, 82, 0.20);
  --success: #3D6B52;
  --success-bg: rgba(61, 107, 82, 0.10);
  --danger: #8B3A3A;
  --danger-bg: rgba(139, 58, 58, 0.10);
  --shadow-sm: 0 2px 8px rgba(20, 28, 18, 0.06);
  --shadow-md: 0 8px 32px rgba(20, 28, 18, 0.10);
  --shadow-lg: 0 20px 60px rgba(20, 28, 18, 0.14);
  --shadow-accent: 0 8px 32px rgba(61, 107, 82, 0.25);
  --radius-modifier: 0.9;
  --nav-bg: rgba(242, 244, 240, 0.92);
  --overlay: rgba(20, 28, 18, 0.5);
  --card-highlight: inset 0 1px 0 rgba(255,255,255,0.85);
  --shimmer-1: rgba(61,107,82,0.0);
  --shimmer-2: rgba(61,107,82,0.18);
  --shimmer-3: rgba(90,148,112,0.12);
}

/* OBSIDIAN DARK */
[data-theme="obsidian-dark"] {
  --bg: #090C08;
  --bg-alt: #0E1209;
  --surface: #151A12;
  --surface-2: #1C231A;
  --surface-3: #232C20;
  --border: rgba(90, 148, 112, 0.12);
  --border-strong: rgba(90, 148, 112, 0.25);
  --text-1: #E8F0E5;
  --text-2: #B8C8B4;
  --text-3: #809880;
  --text-4: #506050;
  --accent: #00C48C;
  --accent-2: #FF2D95;
  --accent-light: rgba(90, 148, 112, 0.12);
  --accent-mid: rgba(90, 148, 112, 0.22);
  --success: #5A9470;
  --success-bg: rgba(90, 148, 112, 0.12);
  --danger: #C06060;
  --danger-bg: rgba(192, 96, 96, 0.12);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.6);
  --shadow-accent: 0 8px 32px rgba(90, 148, 112, 0.20);
  --nav-bg: rgba(9, 12, 8, 0.92);
  --overlay: rgba(0,0,0,0.72);
  --card-highlight: inset 0 1px 0 rgba(255,255,255,0.03);
  --shimmer-1: rgba(90,148,112,0.0);
  --shimmer-2: rgba(90,148,112,0.22);
  --shimmer-3: rgba(122,184,144,0.14);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; height: 100dvh; font-size: 16px; }
body {
  height: 100%;
  height: 100dvh;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-1);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.4s ease, color 0.4s ease;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 1;
}
button { font-family: var(--font-body); cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: var(--font-body); }
::-webkit-scrollbar { width: 0; height: 0; }
* { scrollbar-width: none; }

/* ============================================================
   APP SHELL
   ============================================================ */
#app {
  position: relative;
  height: 100vh;
  display: flex;
  z-index: 1;
}

/* ============================================================
   SPLASH SCREEN
   ============================================================ */
#splash {
  position: fixed;
  inset: 0;
  z-index: 9000;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--bg);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
#splash.out { opacity: 0; transform: scale(1.04); pointer-events: none; }

.splash-orbit {
  animation: floatOrbit 4s ease-in-out infinite;
  margin-bottom: 28px;
}
@keyframes floatOrbit {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}
.splash-wordmark {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 500;
  color: var(--text-1);
  letter-spacing: -0.5px;
  opacity: 0;
  animation: fadeRise 0.8s ease 0.4s forwards;
}
.splash-wordmark span { color: var(--accent); }
.splash-tagline {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-top: 8px;
  opacity: 0;
  animation: fadeRise 0.8s ease 0.7s forwards;
}
@keyframes fadeRise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   AUTH SCREENS
   ============================================================ */
#auth-screen {
  position: fixed;
  inset: 0;
  min-height: 100dvh;
  z-index: 800;
  display: none;
  overflow-y: auto;
  background: var(--bg);
  -webkit-overflow-scrolling: touch;
}
#auth-screen.active { display: block; }

.auth-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(40px, env(safe-area-inset-top)) 24px max(32px, env(safe-area-inset-bottom));
  max-width: 440px;
  margin: 0 auto;
}

.auth-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 36px;
}
.auth-brand {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 500;
  color: var(--text-1);
  margin-top: 14px;
  letter-spacing: -0.3px;
}
.auth-brand em { color: var(--accent); font-style: normal; }

/* Step indicator */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
}
.step-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: all 0.3s ease;
}
.step-dot.active {
  width: 24px;
  border-radius: 3px;
  background: var(--accent);
}
.step-dot.done { background: var(--accent); opacity: 0.4; }

.auth-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-md);
  box-shadow: var(--card-highlight);
}
.auth-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 4px;
}
.auth-subtitle { font-size: 13px; color: var(--text-3); margin-bottom: 28px; line-height: 1.5; }

.auth-tabs-row {
  display: flex;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 3px;
  margin-bottom: 24px;
  gap: 0;
}
.auth-tab-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: 46px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
  transition: all 0.25s ease;
  text-align: center;
}
.auth-tab-btn.active {
  background: var(--surface);
  color: var(--text-1);
  box-shadow: var(--shadow-sm);
}

/* Form elements */
.field-group { margin-bottom: 16px; }
.field-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}
.field-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text-1);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  appearance: none;
}
.field-input::-webkit-outer-spin-button,
.field-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.field-input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.field-input::placeholder { color: var(--text-4); }
.field-input:disabled { opacity: 0.5; cursor: not-allowed; }

.gender-row { display: flex; gap: 8px; }
.gender-opt {
  flex: 1;
  padding: 12px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  text-align: center;
  transition: all 0.2s ease;
}
.gender-opt.sel {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

/* PIN setup */
.pin-setup-display {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 24px 0;
}
.pin-setup-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: transparent;
  transition: all 0.2s var(--transition-spring);
}
.pin-setup-dot.filled {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.15);
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 300px;
  margin: 0 auto;
}
.pin-key {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  color: var(--text-1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.pin-key:active, .pin-key.pressed {
  background: var(--accent-light);
  border-color: var(--accent);
  transform: scale(0.88);
}
.pin-key.invisible { visibility: hidden; pointer-events: none; }

/* Primary button */
.btn-primary {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #FAF8F3;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: var(--shadow-accent);
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
  transform: skewX(-20deg);
  animation: shimmerBtn 3s ease-in-out infinite;
}
@keyframes shimmerBtn {
  0% { left: -100%; }
  40%, 100% { left: 150%; }
}
.btn-primary:hover { box-shadow: var(--shadow-accent), 0 0 0 3px var(--accent-light); transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.97) translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
  width: 100%;
  padding: 15px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: transparent;
  color: var(--text-1);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}
.btn-secondary:hover { background: var(--accent-light); border-color: var(--accent); }

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-3);
}
.auth-switch a { color: var(--accent); font-weight: 500; cursor: pointer; text-decoration: none; }

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
#main-app {
  display: none;
  width: 100%;
  height: 100dvh;
  position: relative;
}
#main-app.active { display: flex; }

/* SIDEBAR NAV (desktop/tablet) */
.side-nav {
  display: none;
  flex-direction: column;
  width: 72px;
  height: 100vh;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 50;
  padding: 24px 0;
  transition: width 0.35s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}
.side-nav:hover { width: 220px; }
.side-nav-logo {
  padding: 0 16px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  white-space: nowrap;
}
.side-nav-logo-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-1);
  opacity: 0;
  transition: opacity 0.2s ease 0.1s;
}
.side-nav-logo-text em { color: var(--accent); font-style: normal; }
.side-nav:hover .side-nav-logo-text { opacity: 1; }
.side-nav-items { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 0 10px; }
.side-nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  white-space: nowrap;
  transition: all 0.2s ease;
  cursor: pointer;
  overflow: hidden;
}
.side-nav-item:hover { color: var(--text-1); background: var(--accent-light); }
.side-nav-item.active { color: var(--accent); background: var(--accent-light); }
.side-nav-item svg { width: 22px; height: 22px; flex-shrink: 0; }
.side-nav-label {
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s ease 0.08s;
}
.side-nav:hover .side-nav-label { opacity: 1; }
.side-nav-bottom {
  padding: 10px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.side-nav-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent-light);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  user-select: none;
}
.side-nav-avatar:hover { box-shadow: 0 0 0 3px var(--accent-light); }

/* MAIN CONTENT AREA */
.main-content {
  flex: 1;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* BOTTOM NAV (mobile) */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  padding: 10px 16px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  pointer-events: none;
}
.bottom-nav > * { pointer-events: all; }
.bottom-nav-inner {
  display: flex;
  background: var(--nav-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 8px 8px;
  box-shadow: var(--shadow-lg);
  gap: 4px;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 6px;
  border-radius: 16px;
  color: var(--text-4);
  transition: all 0.25s ease;
  position: relative;
}
.nav-item:hover { color: var(--text-2); background: var(--accent-light); }
.nav-item.active {
  color: var(--accent);
  background: var(--accent-light);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 5px;
  width: 18px; height: 3px;
  background: var(--accent);
  border-radius: 2px;
}
.nav-item svg { width: 22px; height: 22px; transition: transform 0.2s var(--transition-spring); }
.nav-item.active svg { transform: scale(1.1); }
.nav-label { font-size: 10px; font-weight: 600; letter-spacing: 0.3px; }

/* ============================================================
   PAGE SYSTEM
   ============================================================ */
.pages-wrap {
  position: absolute;
  inset: 0;
  bottom: 0;
  overflow: hidden;
}
.page {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.page.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
  padding-bottom: calc(88px + max(14px, env(safe-area-inset-bottom)));
}
.page-inner { padding-bottom: 0; }

/* ============================================================
   SHARED COMPONENTS
   ============================================================ */

/* Section titles */
.sec-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--text-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  margin-bottom: 14px;
}
.sec-link {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.3px;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-elevated {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  box-shadow: var(--card-highlight);
}

/* Skeleton loaders */
.skeleton {
  background: linear-gradient(90deg,
    var(--surface-2) 0%,
    var(--surface-3) 40%,
    var(--surface-2) 80%
  );
  background-size: 300% 100%;
  animation: skelAnim 1.6s ease infinite;
  border-radius: 8px;
}
@keyframes skelAnim {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(82px + max(14px, env(safe-area-inset-bottom)));
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 50px;
  padding: 12px 22px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  z-index: 5000;
  opacity: 0;
  transition: all 0.35s var(--transition-spring);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 48px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.toast.success .toast-dot { background: var(--success); }
.toast.error .toast-dot { background: var(--danger); }
.toast.info .toast-dot { background: var(--accent); }

/* Modals */
.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: var(--overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal-bg.open { opacity: 1; pointer-events: all; }

.modal-sheet {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  border-bottom: none;
  padding: 0 0 max(32px, env(safe-area-inset-bottom));
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
  box-shadow: var(--shadow-lg);
}
.modal-bg.open .modal-sheet { transform: translateY(0); }

.modal-handle-wrap {
  position: sticky;
  top: 0;
  background: var(--surface);
  padding: 14px 24px 0;
  z-index: 2;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.modal-handle {
  width: 40px; height: 4px;
  background: var(--border-strong);
  border-radius: 2px;
  margin: 0 auto 16px;
}
.modal-close {
  position: absolute;
  top: 14px; right: 20px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  transition: all 0.2s;
}
.modal-close:hover { color: var(--text-1); background: var(--surface-2); }
.modal-close svg { width: 15px; height: 15px; }
.modal-header { padding: 0 24px 20px; }
.modal-title { font-family: var(--font-display); font-size: 28px; font-weight: 500; color: var(--text-1); }
.modal-subtitle { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.modal-body { padding: 0 24px; }

/* Page header */
.page-header {
  padding: max(52px, calc(env(safe-area-inset-top) + 24px)) 24px 20px;
}
.page-h-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 500;
  color: var(--text-1);
  line-height: 1.1;
}
.page-h-sub { font-size: 13px; color: var(--text-3); margin-top: 6px; }

/* Pull to refresh */
.ptr-zone {
  height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: height 0.3s ease;
}
.ptr-zone.pulling { height: 52px; }
.ptr-spinner {
  width: 32px; height: 32px;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   HOME PAGE
   ============================================================ */
.home-header {
  padding: max(52px, calc(env(safe-area-inset-top) + 24px)) 24px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.home-greet-line { font-size: 13px; color: var(--text-3); }
.home-name-line {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  color: var(--text-1);
  margin-top: 2px;
}

.notif-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: all 0.2s;
  flex-shrink: 0;
}
.notif-btn:hover { border-color: var(--accent); color: var(--accent); }
.notif-btn svg { width: 20px; height: 20px; }
.notif-badge {
  position: absolute;
  top: 9px; right: 9px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

/* Balance card */
.balance-card {
  margin: 0 24px 20px;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.balance-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, var(--shimmer-3) 0%, transparent 70%);
  pointer-events: none;
}
.balance-card::after {
  content: '';
  position: absolute;
  bottom: -40px; left: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, var(--shimmer-2) 0%, transparent 70%);
  pointer-events: none;
}
.balance-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg,
    transparent 30%,
    var(--shimmer-2) 50%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: balanceShimmer 1.2s ease forwards;
  pointer-events: none;
}
@keyframes balanceShimmer {
  0% { background-position: 200% 0; opacity: 0.7; }
  100% { background-position: -50% 0; opacity: 0; }
}
.balance-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
  position: relative;
}
.balance-main {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 4px;
}
.balance-currency {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--accent);
  margin-top: 6px;
}
.balance-amount {
  font-family: var(--font-display);
  font-size: clamp(36px, 10vw, 52px);
  font-weight: 300;
  color: var(--text-1);
  line-height: 1;
  letter-spacing: -1px;
  flex: 1;
  min-width: 0;
}
.balance-eye {
  position: absolute;
  top: 0; right: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  transition: all 0.2s;
}
.balance-eye:hover { border-color: var(--accent); color: var(--accent); }
.balance-eye svg { width: 16px; height: 16px; }
.balance-pills {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  position: relative;
}
.balance-pill-label { font-size: 10px; color: var(--text-4); text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 3px; }
.balance-pill-val { font-size: 15px; font-weight: 600; color: var(--accent); }

/* Sparkline */
.sparkline-wrap {
  position: absolute;
  right: 0; bottom: 0;
  width: 100px; height: 36px;
  opacity: 0.6;
}

/* Cashback banner */
.cashback-banner {
  margin: 0 24px 20px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  gap: 14px;
}
.cashback-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--accent-mid);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}
.cashback-icon svg { width: 20px; height: 20px; }
.cashback-text-title { font-size: 14px; font-weight: 600; color: var(--text-1); }
.cashback-text-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* Quick actions */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 0 24px;
  margin-bottom: 28px;
}
.quick-act {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s var(--transition-spring);
}
.quick-act:active { transform: scale(0.88); }
.quick-act-icon {
  width: 56px; height: 56px;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
}
.quick-act:hover .quick-act-icon {
  border-color: var(--accent);
  box-shadow: 0 4px 16px var(--shimmer-2);
}
.quick-act-icon svg { width: 22px; height: 22px; }
.quick-act-label { font-size: 11px; font-weight: 500; color: var(--text-3); text-align: center; line-height: 1.3; }

/* Insight strip */
.insight-strip {
  display: flex;
  gap: 12px;
  padding: 0 24px;
  overflow-x: auto;
  margin-bottom: 24px;
}
.insight-card {
  flex-shrink: 0;
  width: 190px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.insight-val {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 4px;
}
.insight-label { font-size: 12px; color: var(--text-3); line-height: 1.5; }

/* Transaction rows */
.tx-list { padding: 0 24px; display: flex; flex-direction: column; gap: 8px; }
.tx-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.tx-row:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.tx-icon-wrap {
  width: 44px; height: 44px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tx-icon-wrap svg { width: 20px; height: 20px; }
.tx-icon-wrap.credit { background: var(--success-bg); color: var(--success); }
.tx-icon-wrap.debit { background: var(--accent-light); color: var(--accent); }
.tx-row-info { flex: 1; min-width: 0; }
.tx-row-name { font-size: 14px; font-weight: 500; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-row-meta { font-size: 11px; color: var(--text-4); margin-top: 2px; }
.tx-row-amount { font-size: 15px; font-weight: 600; white-space: nowrap; }
.tx-row-amount.credit { color: var(--success); }
.tx-row-amount.debit { color: var(--text-1); }

/* Spend chart */
.spend-chart-wrap {
  margin: 0 24px 24px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.spend-chart-title { font-size: 12px; font-weight: 500; color: var(--text-3); text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 16px; }
.spend-bars { display: flex; align-items: flex-end; gap: 8px; height: 60px; }
.spend-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.spend-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: var(--accent-light);
  transition: height 1s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}
.spend-bar.highest { background: var(--accent); }
.spend-bar-shine {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 40%;
  background: linear-gradient(180deg, rgba(255,255,255,0.15), transparent);
  border-radius: inherit;
}
.spend-bar-label { font-size: 10px; color: var(--text-4); }

/* FAB */
.fab-btn {
  position: fixed;
  bottom: calc(82px + max(14px, env(safe-area-inset-bottom)));
  right: 20px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  border: none;
  display: flex; align-items: center; justify-content: center;
  color: #FAF8F3;
  box-shadow: var(--shadow-accent);
  z-index: 150;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.fab-btn:hover { transform: scale(1.08); }
.fab-btn:active { transform: scale(0.94); }
.fab-btn svg { width: 24px; height: 24px; }

/* Streak bar */
.streak-bar {
  margin: 0 24px 20px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
.streak-dots { display: flex; gap: 6px; }
.streak-dot {
  width: clamp(26px, 9vw, 32px);
  height: clamp(26px, 9vw, 32px);
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600;
  color: var(--text-4);
  background: var(--bg-alt);
  transition: all 0.3s ease;
}
.streak-dot.lit {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}
.streak-count-wrap { text-align: right; }
.streak-number { font-family: var(--font-display); font-size: 28px; font-weight: 500; color: var(--accent); }
.streak-lbl { font-size: 10px; color: var(--text-4); text-transform: uppercase; letter-spacing: 1px; }

/* ============================================================
   TRANSFER PAGE
   ============================================================ */
.transfer-tabs {
  display: flex;
  margin: 0 24px 24px;
  gap: 0;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 3px;
}
.transfer-tab-btn {
  flex: 1;
  padding: 10px;
  border-radius: 46px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-4);
  text-align: center;
  transition: all 0.25s ease;
}
.transfer-tab-btn.active {
  background: var(--surface);
  color: var(--text-1);
  box-shadow: var(--shadow-sm);
}

/* Recent recipients */
.recip-row {
  display: flex;
  gap: 14px;
  padding: 0 24px;
  overflow-x: auto;
  margin-bottom: 24px;
}
.recip-card-btn {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s var(--transition-spring);
}
.recip-card-btn:active { transform: scale(0.9); }
.recip-avi {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent-light);
  border: 2px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--accent);
  transition: border-color 0.2s;
}
.recip-card-btn:hover .recip-avi { border-color: var(--accent); }
.recip-card-name { font-size: 11px; font-weight: 500; color: var(--text-3); text-align: center; max-width: 60px; }

/* Bank selector */
.bank-select-btn {
  margin: 0 24px 16px;
  padding: 16px 18px;
  width: calc(100% - 48px);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s;
}
.bank-select-btn:hover { border-color: var(--accent); }
.bank-select-left { display: flex; align-items: center; gap: 12px; }
.bank-select-logo {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}
.bank-select-name { font-size: 15px; font-weight: 500; color: var(--text-1); }
.bank-select-placeholder { font-size: 14px; color: var(--text-4); }
.bank-select-chevron { color: var(--text-4); }
.bank-select-chevron svg { width: 18px; height: 18px; }

/* Recipient resolve */
.resolve-box {
  margin: 8px 24px 0;
  padding: 16px;
  background: var(--success-bg);
  border: 1px solid var(--success);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  animation: slideUp 0.4s var(--transition-spring) forwards;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.resolve-avi {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--accent-light);
  border: 2px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}
.resolve-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  cursor: text;
  border-bottom: 1.5px dashed var(--border-strong);
  outline: none;
  min-width: 80px;
}
.resolve-name:focus { border-bottom-color: var(--accent); }
.resolve-bank { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.resolving-state {
  margin: 8px 24px 0;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-3);
  font-size: 13px;
}
.resolve-spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.transfer-form { padding: 0 24px; }

/* ============================================================
   PAY PAGE
   ============================================================ */
.pay-search-wrap {
  margin: 0 24px 20px;
  position: relative;
}
.pay-search-icon {
  position: absolute;
  left: 16px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-4);
}
.pay-search-icon svg { width: 18px; height: 18px; }
.pay-search-input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-size: 14px;
  color: var(--text-1);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pay-search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.pay-search-input::placeholder { color: var(--text-4); }

.pay-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 0 24px;
  margin-bottom: 28px;
}
.pay-cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s var(--transition-spring);
}
.pay-cat-item:active { transform: scale(0.88); }
.pay-cat-icon {
  width: 60px; height: 60px;
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.pay-cat-item:hover .pay-cat-icon { border-color: var(--accent); box-shadow: 0 4px 16px var(--shimmer-2); }
.pay-cat-icon svg { width: 26px; height: 26px; }
.pay-cat-name { font-size: 11px; font-weight: 500; color: var(--text-3); text-align: center; }

.smart-suggestions {
  margin: 0 24px 24px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.smart-title { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.smart-title svg { width: 14px; height: 14px; color: var(--accent); }
.smart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.smart-item:last-child { border-bottom: none; padding-bottom: 0; }
.smart-item-left { font-size: 13px; color: var(--text-2); }
.smart-item-right { font-size: 12px; color: var(--accent); font-weight: 500; }

/* ============================================================
   WEALTH PAGE
   ============================================================ */
.wealth-hero {
  margin: 0 24px 24px;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  text-align: center;
}
.wealth-hero::before {
  content: '';
  position: absolute;
  top: -80px; left: 50%;
  transform: translateX(-50%);
  width: 240px; height: 240px;
  background: radial-gradient(circle, var(--shimmer-3) 0%, transparent 70%);
  pointer-events: none;
}
.wealth-hero-label { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.wealth-hero-amount { font-family: var(--font-display); font-size: 52px; font-weight: 300; color: var(--text-1); letter-spacing: -1px; position: relative; }
.wealth-hero-currency { font-size: 26px; color: var(--accent); vertical-align: super; }
.wealth-hero-actions { display: flex; gap: 10px; margin-top: 20px; }
.wealth-action-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-1);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}
.wealth-action-btn:hover { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }
.wealth-action-btn.primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #FAF8F3;
  border: none;
  box-shadow: var(--shadow-accent);
  position: relative;
  overflow: hidden;
}
.wealth-action-btn.primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: skewX(-20deg);
  animation: shimmerBtn 3s ease-in-out infinite;
}

/* Goals */
.goals-row {
  display: flex;
  gap: 14px;
  padding: 0 24px;
  overflow-x: auto;
  margin-bottom: 28px;
}
.goal-card {
  flex-shrink: 0;
  width: 160px;
  padding: 20px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  cursor: pointer;
}
.goal-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }

.goal-ring-svg { transform: rotate(-90deg); }
.goal-ring-track { fill: none; stroke: var(--border-strong); stroke-width: 6; }
.goal-ring-fill { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; transition: stroke-dasharray 1.2s cubic-bezier(0.34, 1.2, 0.64, 1); }
.goal-ring-wrap { position: relative; width: 72px; height: 72px; }
.goal-ring-pct {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600; color: var(--accent);
}
.goal-name { font-size: 13px; font-weight: 600; color: var(--text-1); text-align: center; }
.goal-amount { font-size: 11px; color: var(--text-3); text-align: center; }
.goal-projected { font-size: 10px; color: var(--accent); font-weight: 500; text-align: center; }

/* Loan card */
.loan-card {
  margin: 0 24px 20px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.loan-card-label { font-size: 11px; color: var(--text-4); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 6px; }
.loan-card-limit { font-family: var(--font-display); font-size: 36px; font-weight: 400; color: var(--text-1); margin-bottom: 16px; }
.loan-card-limit span { font-size: 20px; color: var(--accent); }
.loan-meta-row { display: flex; gap: 20px; margin-bottom: 20px; }
.loan-meta-item label { font-size: 10px; color: var(--text-4); text-transform: uppercase; letter-spacing: 1px; display: block; margin-bottom: 3px; }
.loan-meta-item span { font-size: 14px; font-weight: 500; color: var(--text-1); }

/* Loan slider */
.loan-slider-wrap { margin-bottom: 16px; }
.loan-slider {
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--border-strong);
  outline: none;
  margin: 8px 0;
}
.loan-slider::-webkit-slider-thumb {
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 8px var(--shimmer-2);
  transition: transform 0.15s ease;
}
.loan-slider::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 8px var(--shimmer-2);
  transition: transform 0.15s ease;
  border: none;
}
.loan-slider::-webkit-slider-thumb:active { transform: scale(1.2); }
.loan-slider-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-4); }
.loan-repay-preview {
  padding: 12px 14px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-2);
}
.loan-repay-preview strong { color: var(--accent); }

/* Virtual Card */
.vcard-wrap {
  margin: 0 24px 20px;
  perspective: 1000px;
}
.vcard {
  width: 100%;
  aspect-ratio: 1.586;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border-radius: 20px;
}
.vcard.flipped { transform: rotateY(180deg); }
.vcard-face {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 28px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}
.vcard-front {
  background: linear-gradient(135deg, var(--accent) 0%, color-mix(in srgb, var(--accent), #000 20%) 50%, var(--accent) 100%);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.vcard-front::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: var(--accent-light);
}
.vcard-front::after {
  content: '';
  position: absolute;
  bottom: -40px; left: -20px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: var(--accent-mid);
  opacity: 0.5;
}
.vcard-back {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent), #000 30%) 0%, color-mix(in srgb, var(--accent), #000 10%) 100%);
  transform: rotateY(180deg);
}
.vcard-chip {
  width: 44px; height: 32px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  margin-bottom: 24px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.vcard-chip::after {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 3px;
}
.vcard-number {
  font-size: 18px;
  letter-spacing: 3px;
  color: var(--surface);
  margin-bottom: auto;
  font-weight: 300;
  position: relative;
  z-index: 1;
}
.vcard-bottom { display: flex; justify-content: space-between; align-items: flex-end; position:relative;z-index:1; }
.vcard-holder-label { font-size: 9px; color: var(--surface); opacity: 0.5; text-transform: uppercase; letter-spacing: 1.5px; }
.vcard-holder-name { font-size: 14px; font-weight: 500; color: var(--surface); letter-spacing: 0.5px; margin-top: 2px; }
.vcard-expiry { text-align: right; }
.vcard-expiry-label { font-size: 9px; color: var(--surface); opacity: 0.5; text-transform: uppercase; letter-spacing: 1px; }
.vcard-expiry-val { font-size: 14px; font-weight: 400; color: var(--surface); }
.vcard-brand {
  position: absolute;
  bottom: 24px; right: 28px;
  z-index: 1;
}
.vcard-stripe {
  position: absolute;
  top: 44px; left: 0; right: 0;
  height: 44px;
  background: rgba(0,0,0,0.45);
}
.vcard-cvv-section { padding-top: 100px; position:relative;z-index:1; }
.vcard-cvv-box {
  background: var(--surface);
  border-radius: 4px;
  padding: 8px 16px;
  display: inline-block;
  margin-top: 8px;
}
.vcard-cvv-label { font-size: 10px; color: var(--surface); opacity: 0.5; text-transform: uppercase; letter-spacing: 1px; }
.vcard-cvv-val { font-family: monospace; font-size: 16px; font-weight: 700; color: var(--text-1); }
.vcard-tap-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-4);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

/* Card actions */
.vcard-actions {
  display: flex;
  gap: 10px;
  padding: 0 24px;
  margin-bottom: 24px;
}
.vcard-action-btn {
  flex: 1;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  transition: all 0.2s;
}
.vcard-action-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   ACCOUNT PAGE
   ============================================================ */
.account-hero {
  padding: max(52px, calc(env(safe-area-inset-top) + 24px)) 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.account-avatar-wrap { position: relative; }
.account-avatar {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--accent-light);
  border: 2.5px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
  box-shadow: 0 0 0 6px var(--accent-light);
}
.account-avatar:hover { box-shadow: 0 0 0 8px var(--accent-mid); }
.account-tier-badge {
  position: absolute;
  bottom: -2px; right: -4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #FAF8F3;
  box-shadow: var(--shadow-sm);
}
.account-name-display {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  color: var(--text-1);
}
.account-id-display { font-size: 12px; color: var(--text-4); letter-spacing: 1.5px; }
.account-tag {
  padding: 6px 16px;
  background: var(--accent-light);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
}
.account-stats {
  display: flex;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.account-stat {
  flex: 1;
  padding: 18px 12px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.account-stat:last-child { border-right: none; }
.account-stat-val { font-family: var(--font-display); font-size: 22px; font-weight: 500; color: var(--accent); }
.account-stat-label { font-size: 10px; color: var(--text-4); margin-top: 3px; text-transform: uppercase; letter-spacing: 0.8px; }

/* Tier progress */
.tier-progress-wrap {
  margin: 0 24px 24px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.tier-progress-header { display: flex; justify-content: space-between; margin-bottom: 10px; }
.tier-current { font-size: 13px; font-weight: 600; color: var(--accent); }
.tier-next { font-size: 12px; color: var(--text-3); }
.tier-bar {
  height: 5px;
  background: var(--border-strong);
  border-radius: 3px;
  overflow: hidden;
}
.tier-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  transition: width 1s ease;
}
.tier-bar-hint { font-size: 11px; color: var(--text-4); margin-top: 8px; }

/* VIP field */
#vip-field {
  display: none;
  margin: 0 24px 20px;
  padding: 18px;
  background: var(--accent-light);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-md);
}
#vip-field.visible { display: block; animation: fadeRise 0.3s ease forwards; }
.vip-label { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; font-weight: 600; }
.vip-row { display: flex; gap: 10px; }
.vip-input {
  flex: 1;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-size: 14px;
  outline: none;
}
.vip-input:focus { border-color: var(--accent); }
.vip-submit {
  padding: 12px 18px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  color: #FAF8F3;
  font-size: 13px;
  font-weight: 600;
}

/* Theme gallery */
.theme-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 24px;
  margin-bottom: 28px;
}
.theme-card {
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.theme-card.active-theme { border-color: var(--accent); }
.theme-swatch { height: 36px; border-radius: 8px; margin-bottom: 8px; border: 1px solid var(--border); }
.theme-card-name { font-size: 11px; font-weight: 600; color: var(--text-1); }
.theme-card-mode { font-size: 10px; color: var(--text-3); margin-top: 1px; }
.theme-active-dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: none;
}
.theme-card.active-theme .theme-active-dot { display: block; }

/* Settings accordion */
.settings-group { padding: 0 24px; }
.settings-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}
.settings-row:last-child { border-bottom: none; }
.settings-row:hover { padding-left: 4px; }
.settings-row-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  transition: all 0.2s;
}
.settings-row:hover .settings-row-icon { background: var(--accent-light); border-color: var(--accent); }
.settings-row-icon svg { width: 18px; height: 18px; }
.settings-row-content { flex: 1; }
.settings-row-name { font-size: 14px; font-weight: 500; color: var(--text-1); }
.settings-row-desc { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.settings-row-right { color: var(--text-4); }
.settings-row-right svg { width: 16px; height: 16px; }
.toggle-switch {
  width: 44px; height: 24px;
  border-radius: 12px;
  background: var(--border-strong);
  position: relative;
  transition: background 0.25s ease;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch.on { background: var(--accent); }
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--surface);
  transition: transform 0.25s ease;
  box-shadow: var(--shadow-sm);
}
.toggle-switch.on::after { transform: translateX(20px); }

/* Feedback */
.feedback-wrap { padding: 0 24px 24px; }
.star-row { display: flex; gap: 8px; margin-bottom: 16px; }
.star-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-4);
  font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s var(--transition-spring);
}
.star-btn.lit { color: var(--accent-2); background: var(--accent-light); border-color: var(--accent); transform: scale(1.1); }

/* How it works */
.how-list { padding: 0 24px 28px; display: flex; flex-direction: column; gap: 12px; }
.how-item {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.how-item-title { font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 6px; }
.how-item-text { font-size: 13px; color: var(--text-3); line-height: 1.7; }

/* Legal link */
.legal-link-wrap { padding: 8px 24px 24px; text-align: center; }
.legal-link-btn { font-size: 12px; color: var(--text-4); border-bottom: 1px solid var(--border-strong); padding-bottom: 1px; background: none; transition: color 0.2s; }
.legal-link-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ============================================================
   RECEIPTS
   ============================================================ */
.receipt-header-block { text-align: center; padding: 24px 0 20px; border-bottom: 1px dashed var(--border-strong); margin-bottom: 20px; }
.receipt-stamp {
  width: 70px; height: 70px;
  border: 2.5px solid var(--accent);
  border-radius: 50%;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  animation: stampPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes stampPop {
  from { transform: scale(0) rotate(-30deg); opacity: 0; }
  to { transform: scale(1) rotate(0deg); opacity: 1; }
}
.receipt-stamp svg { width: 32px; height: 32px; }
.receipt-amount { font-family: var(--font-display); font-size: 46px; font-weight: 300; color: var(--text-1); }
.receipt-amount span { font-size: 24px; color: var(--accent); }
.receipt-status { font-size: 13px; font-weight: 500; color: var(--success); margin-top: 4px; }
.receipt-row { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--border); }
.receipt-row:last-of-type { border-bottom: none; }
.receipt-row-label { font-size: 12px; color: var(--text-4); }
.receipt-row-val { font-size: 13px; font-weight: 500; color: var(--text-1); text-align: right; max-width: 60%; }
.receipt-actions-row { display: flex; gap: 10px; margin-top: 20px; padding: 0 0 4px; }
.receipt-action-btn {
  flex: 1;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-alt);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  transition: all 0.2s;
}
.receipt-action-btn:hover { border-color: var(--accent); }
.receipt-action-btn.primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #FAF8F3;
  border: none;
  box-shadow: var(--shadow-accent);
}

/* Notif panel */
.notif-panel {
  position: fixed;
  inset: 0;
  z-index: 650;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}
.notif-panel.open { transform: translateX(0); }
.notif-panel-header {
  padding: 52px 24px 20px;
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.notif-panel-title { font-family: var(--font-display); font-size: 28px; font-weight: 500; color: var(--text-1); }
.notif-close-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.notif-close-btn svg { width: 18px; height: 18px; }
.notif-list { padding: 16px 24px; display: flex; flex-direction: column; gap: 10px; }
.notif-item { padding: 16px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius-md); }
.notif-item-title { font-size: 14px; font-weight: 600; color: var(--text-1); margin-bottom: 4px; }
.notif-item-body { font-size: 13px; color: var(--text-3); line-height: 1.5; }
.notif-item-time { font-size: 11px; color: var(--text-4); margin-top: 8px; }

/* ============================================================
   BILL MODAL
   ============================================================ */
.bill-input-row { display: flex; gap: 10px; margin-bottom: 16px; }
.bill-input-row .field-input { flex: 1; }
.bill-plans-list { display: flex; flex-direction: column; gap: 8px; }
.bill-plan {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.bill-plan:hover, .bill-plan.selected { border-color: var(--accent); background: var(--accent-light); }
.bill-plan-name { font-size: 14px; font-weight: 500; color: var(--text-1); }
.bill-plan-desc { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.bill-plan-price { font-size: 15px; font-weight: 600; color: var(--accent); }

/* Bank modal */
.bank-search-wrap { position: relative; margin-bottom: 16px; }
.bank-search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-4); }
.bank-search-icon svg { width: 16px; height: 16px; }
.bank-search-input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-size: 14px;
  outline: none;
}
.bank-search-input:focus { border-color: var(--accent); }
.bank-list { display: flex; flex-direction: column; gap: 6px; }
.bank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.bank-item:hover { border-color: var(--accent); background: var(--accent-light); }
.bank-item-logo {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.bank-item-name { font-size: 14px; font-weight: 500; color: var(--text-1); }
.bank-item-code { font-size: 11px; color: var(--text-4); margin-top: 2px; }

/* Add money amounts */
.amount-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.amount-chip {
  padding: 12px 8px;
  text-align: center;
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s;
}
.amount-chip.sel { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }

/* Request */
.req-link-display {
  padding: 16px;
  background: var(--bg-alt);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--accent);
  word-break: break-all;
  margin-bottom: 16px;
}

/* Confirm transfer */
.confirm-rows { display: flex; flex-direction: column; margin: 8px 0; }
.confirm-row { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--border); }
.confirm-row:last-child { border-bottom: none; }
.confirm-label { font-size: 12px; color: var(--text-4); }
.confirm-val { font-size: 14px; font-weight: 500; color: var(--text-1); }
.confirm-val.large { font-family: var(--font-display); font-size: 28px; font-weight: 400; color: var(--accent); }

/* Modals for support, privacy */
.support-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.support-item:hover { border-color: var(--accent); }
.support-item-icon { width: 44px; height: 44px; border-radius: 14px; background: var(--accent-light); border: 1px solid var(--border-strong); display: flex; align-items: center; justify-content: center; color: var(--accent); flex-shrink: 0; }
.support-item-icon svg { width: 20px; height: 20px; }
.support-item-name { font-size: 14px; font-weight: 500; color: var(--text-1); }
.support-item-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* Install banner */
.install-banner {
  position: fixed;
  bottom: calc(80px + max(14px, env(safe-area-inset-bottom)));
  left: 16px; right: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 300;
  box-shadow: var(--shadow-lg);
  transform: translateY(200px);
  transition: transform 0.4s var(--transition-spring);
}
.install-banner.show { transform: translateY(0); }
@media (min-width: 768px) {
  .install-banner { display: none !important; }
}
.install-text { flex: 1; font-size: 13px; color: var(--text-2); line-height: 1.4; }
.install-cta {
  padding: 10px 16px;
  background: var(--accent);
  color: #FAF8F3;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.install-dismiss { color: var(--text-4); font-size: 22px; line-height: 1; flex-shrink: 0; }

/* ============================================================
   RESPONSIVE: TABLET & DESKTOP
   ============================================================ */
@media (min-width: 768px) {
  .side-nav { display: flex; }
  .bottom-nav { display: none !important; }
  .fab-btn { right: 32px; bottom: 32px; position: fixed; }
  .toast { bottom: 32px; }
  .page.active { padding-bottom: 32px; }
  
  .page-inner {
    max-width: 640px;
    margin: 0 auto;
  }
  
  .modal-bg { align-items: center; }
  .modal-sheet {
    border-radius: var(--radius-xl);
    max-width: 480px;
    max-height: 88vh;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
  }
  
  .notif-panel {
    left: auto;
    width: 380px;
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }
}

@media (min-width: 1200px) {
  .side-nav { width: 80px; }
  .side-nav:hover { width: 240px; }
}

/* ============================================================
   MOBILE — FINAL POLISH
   ============================================================ */

/* iOS momentum scroll on all scrollable areas */
.page, .modal-sheet, .notif-panel, .bank-list, .goals-row,
.recip-row, .insight-strip, .invest-scroll, .pay-grid {
  -webkit-overflow-scrolling: touch;
}

/* Prevent tap delay everywhere */
* { touch-action: manipulation; }
.page, .modal-sheet { touch-action: pan-y pinch-zoom; }

/* Scrollbars hidden */
::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }

/* Better active states on mobile */
.tx-row:active { transform: scale(0.98); opacity: 0.85; }
.btn-primary:active { transform: scale(0.96); }
.quick-act:active .quick-act-icon { transform: scale(0.86); }

/* Prevent layout shift when modal opens */
body.modal-open { overflow: hidden; }

/* Fix balance-currency vertical alignment */
.balance-currency { flex-shrink: 0; }
.balance-main { overflow: hidden; }

/* Wealth total clamp */
.wealth-hero-amount { font-size: clamp(36px, 11vw, 52px) !important; }

/* Fix bank modal scroll on mobile */
.bank-list { max-height: 60vh; overflow-y: auto; }

/* Bottom nav items equal width, no overflow */
.bottom-nav-inner { overflow: hidden; }
.nav-item { overflow: hidden; min-width: 0; }
.nav-label { overflow: hidden; white-space: nowrap; }

/* Small phone specific */
@media (max-width: 375px) {
  .balance-card { margin: 0 16px 16px; padding: 20px 18px; }
  .cashback-banner, .streak-bar, .spend-chart-wrap { margin-left: 16px; margin-right: 16px; }
  .quick-grid { padding: 0 16px; gap: 8px; }
  .quick-act-icon { width: 50px; height: 50px; border-radius: 15px; }
  .quick-act-label { font-size: 10px; }
  .sec-title { padding: 0 16px; font-size: 19px; }
  .tx-list, .how-list, .settings-group, .feedback-wrap { padding-left: 16px; padding-right: 16px; }
  .recip-row, .goals-row, .insight-strip { padding-left: 16px; }
  .balance-pills { gap: 12px; }
  .streak-dots { gap: 4px; }
}

/* Very small phones */
@media (max-width: 320px) {
  .quick-act-icon { width: 44px; height: 44px; border-radius: 12px; }
  .streak-dot { width: 24px !important; height: 24px !important; font-size: 9px; }
  .home-name-line { font-size: 24px; }
}

/* Fix pin pad sizing on narrow screens */
@media (max-width: 380px) {
  .pin-pad { max-width: min(280px, 82vw); gap: 8px; }
}

/* Fix auth card on short phones (landscape / small) */
@media (max-height: 650px) {
  .auth-logo-wrap { margin-bottom: 12px; }
  .auth-logo-wrap svg { width: 40px !important; height: 40px !important; }
  .auth-brand { font-size: 24px; }
  .auth-card { padding: 18px 18px; }
  .field-group { margin-bottom: 10px; }
  .auth-subtitle { display: none; }
}

/* Notif panel: full width on mobile */
@media (max-width: 767px) {
  .notif-panel { width: 100% !important; }
}
