/* ══════════════════════════════════════════════════════════════
   MoneyFlow · Fintech Premium Design System
   Professional Finance App · Glassmorphism · IBM Plex Sans
   Sleek & Trustworthy · Navy & Gold Palette
   UI/UX Pro Max Optimized
══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap');


:root {
  /* ── Fintech Premium Backgrounds ── */
  --bg:           #F8FAFC;
  --bg-card:      rgba(255,255,255,0.88);
  --bg-elevated:  #FFFFFF;
  --bg-input:     rgba(15, 23, 42, 0.04);

  /* ── Advanced Glassmorphism ── */
  --glass:        rgba(255,255,255,0.75);
  --glass-blur:   saturate(190%) blur(24px);
  --glass-border: rgba(15, 23, 42, 0.06);
  --glass-stroke: rgba(255, 255, 255, 0.4);

  /* ── Premium Palette ── */
  --blue:         #0F172A; /* Navy-900 */
  --blue-vivid:   #2563EB;
  --blue-soft:    rgba(15, 23, 42, 0.08);
  --gold:         #B45309; /* Premium Amber/Gold */
  --gold-soft:    rgba(180, 83, 9, 0.12);
  --green:        #059669; /* Emerald-600 */
  --green-soft:   rgba(5, 150, 105, 0.1);
  --red:          #DC2626; /* Red-600 */
  --red-soft:     rgba(220, 38, 38, 0.08);
  --orange:       #EA580C;
  --purple:       #7C3AED;
  --teal:         #0891B2;
  --indigo:       #4F46E5;
  --pink:         #DB2777;

  /* ── Label Colors ── */
  --label:        #0F172A;
  --label-2:      #475569;
  --label-3:      #94A3B8;
  --label-4:      #E2E8F0;

  /* ── Fill ── */
  --fill:         rgba(15, 23, 42, 0.1);
  --fill-2:       rgba(15, 23, 42, 0.06);
  --fill-3:       rgba(15, 23, 42, 0.04);
  --fill-4:       rgba(15, 23, 42, 0.02);

  /* ── Separator ── */
  --sep:          rgba(15, 23, 42, 0.05);

  /* ── Premium Shadows (Layered) ── */
  --shadow-xs:    0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm:    0 2px 4px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-md:    0 12px 24px -6px rgba(15, 23, 42, 0.12), 0 8px 16px -4px rgba(15, 23, 42, 0.08);
  --shadow-lg:    0 25px 50px -12px rgba(15, 23, 42, 0.18);
  --shadow-blue:  0 12px 20px -5px rgba(15, 23, 42, 0.35);

  /* ── Typography ── */
  --font: 'IBM Plex Sans', -apple-system, system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;

  /* ── Layout Tokens ── */
  --r-2xl:  32px;
  --r-xl:   24px;
  --r-lg:   16px;
  --r-md:   12px;
  --r-sm:   8px;
  --nav-h:  82px;
  --safe-b: max(0px, env(safe-area-inset-bottom));
}

/* ══ Dark Mode ══ */
[data-theme="dark"] {
  --bg:           #020617;
  --bg-card:      rgba(15, 23, 42, 0.92);
  --bg-elevated:  #0F172A;
  --bg-input:     rgba(255, 255, 255, 0.06);
  --glass:        rgba(15, 23, 42, 0.88);
  --glass-dark:   rgba(30, 41, 59, 0.85);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-stroke: rgba(255, 255, 255, 0.05);
  --blue:         #38BDF8;
  --green:        #34D399;
  --green-soft:   rgba(52, 211, 153, 0.15);
  --red:          #FB7185;
  --red-soft:     rgba(251, 113, 133, 0.15);
  --label:        #F1F5F9;
  --label-2:      #94A3B8;
  --label-3:      #64748B;
  --label-4:      #1E293B;
  --fill:         rgba(255, 255, 255, 0.14);
  --fill-2:       rgba(255, 255, 255, 0.1);
  --sep:          rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .sheet         { background: #1C1C1E; }
[data-theme="dark"] .f-select option { background: #2C2C2E; color: #fff; }
[data-theme="dark"] .stats-seg-btn.active,
[data-theme="dark"] .seg-btn.ae,
[data-theme="dark"] .seg-btn.ai,
[data-theme="dark"] .seg-btn.at    { background: #3A3A3C; }

/* ── Theme Toggle Button ── */
.theme-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--fill-3); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: all 0.22s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: var(--shadow-xs);
}
.theme-btn:active { transform: scale(0.86); opacity: 0.7; }

/* ══ Reset ══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--label);
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
::-webkit-scrollbar { display: none; }
* { -webkit-tap-highlight-color: transparent; }

/* ══ Pages ══ */
.page { display: none; opacity: 0; }
.page.active { display: block; animation: pageIn 0.32s cubic-bezier(0.25,0.46,0.45,0.94) forwards; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════════
   NAV BAR — iOS Large Title + Frosted Glass
══════════════════════════════════════════════════════════════ */
.nav-bar {
  position: sticky; top: 0; z-index: 100;
  padding: env(safe-area-inset-top, 48px) 20px 0;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 0.5px solid var(--sep);
}
.nav-bar-inner {
  display: flex; align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 12px; min-height: 44px;
}
.nav-large-title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--label);
  line-height: 1.05;
}
.nav-actions { display: flex; gap: 8px; align-items: center; }
.nav-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--fill-3); border: none; cursor: pointer;
  color: var(--blue); display: flex; align-items: center; justify-content: center;
  transition: all 0.14s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: var(--shadow-xs);
}
.nav-btn:active { transform: scale(0.88); opacity: 0.7; }
.nav-btn svg { width: 17px; height: 17px; fill: none; stroke: var(--blue); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ══════════════════════════════════════════════════════════════
   TAB BAR — Premium Glass & Spring Icons
══════════════════════════════════════════════════════════════ */
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  height: calc(var(--nav-h) + var(--safe-b));
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--glass-border);
  display: flex;
  padding-top: 6px;
  padding-bottom: var(--safe-b);
  box-shadow: 0 -1px 12px rgba(0,0,0,0.03);
}
.tab-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  cursor: pointer; color: var(--label-3);
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  -webkit-user-select: none; user-select: none;
  position: relative;
}
.tab-item.active { color: var(--blue-vivid); }

.tab-icon-bg {
  width: 52px; height: 32px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: transparent;
}
.tab-item.active .tab-icon-bg {
  background: var(--blue-soft);
  transform: translateY(-2px);
}
.tab-icon-bg svg { 
  width: 22px; height: 22px; 
  stroke: currentColor; 
  stroke-width: 1.8;
  transition: transform 0.3s ease;
}
.tab-item.active svg { transform: scale(1.1); }

.tab-label {
  font-size: 10px; font-weight: 600; 
  letter-spacing: 0.02em;
  transition: all 0.3s ease;
}
.tab-item:active .tab-icon-bg { transform: scale(0.9); }

/* ══════════════════════════════════════════════════════════════
   FAB — Floating Action Button, Spring Animation
══════════════════════════════════════════════════════════════ */
.fab {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-b) + 18px);
  right: 22px; z-index: 150;
  width: 56px; height: 56px; border-radius: 28px;
  background: linear-gradient(145deg, #1E40AF, #0F172A);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-blue);
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.22s;
}
.fab:active { transform: scale(0.90); box-shadow: 0 3px 12px rgba(0,122,255,0.28); }
.fab svg { width: 22px; height: 22px; fill: white; }

/* ══════════════════════════════════════════════════════════════
   HOME HERO CARD — Enhanced Premium Design
   Redesigned with Mesh Gradient & Depth
══════════════════════════════════════════════════════════════ */
.hero-section { padding: 18px 20px 8px; }
.hero-card {
  background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 50%, #1E40AF 100%);
  border: 1px solid var(--glass-stroke);
  border-radius: var(--r-2xl); 
  padding: 28px 24px 24px;
  box-shadow: var(--shadow-blue);
  position: relative; 
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.hero-card:active {
  transform: scale(0.97);
  opacity: 0.9;
}

/* Decorative Mesh/Orbs */
.hero-card::before {
  content: '';
  position: absolute; top: -50px; right: -50px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
  filter: blur(40px);
}
.hero-card::after {
  content: '';
  position: absolute; bottom: -80px; left: -40px;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, transparent 70%);
  filter: blur(50px);
}

.hero-eyebrow {
  font-size: 11px; font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.05em; margin-bottom: 2px;
  position: relative; z-index: 1;
  text-transform: uppercase;
}
.hero-amount {
  font-size: 18px; font-weight: 700;
  color: white; letter-spacing: -0.5px;
  line-height: 1.1; margin-bottom: 0;
  position: relative; z-index: 1;
  font-family: var(--font);
}
.hero-amount-currency {
  font-size: 11px; font-weight: 600;
  letter-spacing: -0.2px; margin-right: 2px; 
  color: rgba(255, 255, 255, 0.75);
  vertical-align: 0.1em;
}
.hero-stats { 
  display: flex; gap: 0; 
  position: relative; z-index: 1;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--r-xl);
  padding: 18px 16px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 20px;
}
.hero-stat { flex: 1; text-align: center; }
.hero-stat + .hero-stat {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}
.hero-stat-label { 
  font-size: 18px; font-weight: 600;
  color: rgba(255, 255, 255, 0.7); 
  margin-bottom: 6px; letter-spacing: 0.05em; 
  text-transform: uppercase;
}
.hero-stat-val { 
  font-size: 48px; font-weight: 700; 
  color: white; font-family: var(--mono); 
  letter-spacing: -1.5px; 
}
.hero-stat-val.inc { color: #4ADE80; } /* More vibrant Green */
.hero-stat-val.exp { color: #F87171; } /* More vibrant Red */
.hero-stat-val.neu { color: #F1F5F9; }

.hero-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}

/* Month Selector */
.month-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 22px 7px;
}
.month-title { font-size: 17px; font-weight: 600; color: var(--label); letter-spacing: -0.3px; }
.month-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--fill-3); border: none; cursor: pointer;
  color: var(--blue); font-size: 18px; font-weight: 400;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.14s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: var(--shadow-xs);
}
.month-btn:active { transform: scale(0.86); opacity: 0.6; }

/* ══════════════════════════════════════════════════════════════
   SECTION HEADER
══════════════════════════════════════════════════════════════ */
.section-hd {
  font-size: 20px; font-weight: 700; letter-spacing: -0.4px;
  color: var(--label); padding: 18px 20px 8px;
}

/* ══════════════════════════════════════════════════════════════
   TRANSACTION LIST
══════════════════════════════════════════════════════════════ */
.tx-section { padding: 0 20px; }
.tx-date-hd {
  font-size: 13px; font-weight: 600; color: var(--label-2);
  padding: 12px 4px 5px;
  display: flex; align-items: center; justify-content: space-between;
  letter-spacing: 0.1px;
}
.tx-date-sum { font-family: var(--mono); font-size: 12px; color: var(--label-3); }

.tx-list-group {
  background: var(--bg-elevated);
  border-radius: var(--r-xl); 
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--sep);
}
.tx-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--sep);
  cursor: pointer; 
  transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
  -webkit-user-select: none;
}
.tx-row:last-child { border-bottom: none; }
.tx-row:active { 
  background: var(--fill-4); 
  transform: scale(0.995);
}
.tx-ic {
  width: 44px; height: 44px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
  background: var(--fill-3);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tx-row:active .tx-ic { transform: scale(0.9); }
.tx-body { flex: 1; min-width: 0; }
.tx-name {
  font-size: 16px; font-weight: 500; color: var(--label);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.tx-meta { font-size: 12px; color: var(--label-3); margin-top: 2px; font-weight: 400; }
.tx-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.tx-amt { 
  font-size: 17px; font-weight: 700; 
  font-family: var(--mono); letter-spacing: -0.5px; 
}
.tx-amt.exp { color: var(--label); }
.tx-amt.inc { color: var(--green); }
.tx-amt.trf { color: var(--blue-vivid); }
.tx-chev { color: var(--label-4); font-size: 14px; }

/* Empty State */
.empty {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 64px 32px; gap: 8px;
}
.empty-ic { font-size: 54px; opacity: 0.18; margin-bottom: 4px; }
.empty-title { font-size: 17px; font-weight: 600; color: var(--label-2); }
.empty-sub { font-size: 15px; color: var(--label-3); }

/* ══════════════════════════════════════════════════════════════
   STATS PAGE
══════════════════════════════════════════════════════════════ */
.stats-hero-card {
  margin: 18px 20px 0;
  background: linear-gradient(148deg, #065F46 0%, #10B981 60%, #34D399 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-2xl); padding: 22px 22px 20px;
  box-shadow: var(--shadow-md);
  position: relative; overflow: hidden;
}
.stats-hero-card::before {
  content: ''; position: absolute;
  width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.14) 0%, transparent 70%);
  top: -42px; right: -28px;
}
.stats-hero-card::after {
  content: ''; position: absolute;
  width: 100px; height: 100px; border-radius: 50%;
  background: rgba(255,255,255,0.07);
  bottom: -30px; left: 10px;
}
.stats-eyebrow { font-size: 13px; color: rgba(255,255,255,0.65); margin-bottom: 3px; position: relative; z-index: 1; }
.stats-amount {
  font-size: 40px; font-weight: 700; letter-spacing: -2px;
  color: white; position: relative; z-index: 1;
}
.stats-amount span { font-size: 20px; font-weight: 600; opacity: 0.78; margin-right: 2px; vertical-align: 0.18em; }

/* Stats segmented filter */
.stats-seg-wrap { padding: 14px 20px 4px; }
.stats-seg {
  display: flex; background: var(--fill-3);
  border-radius: 11px; padding: 3px; gap: 2px;
}
.stats-seg-btn {
  flex: 1; padding: 8px 4px; border-radius: 9px; border: none; cursor: pointer;
  font-family: var(--font); font-size: 13px; font-weight: 500;
  color: var(--label-2); background: transparent; transition: all 0.18s;
}
.stats-seg-btn.active {
  background: var(--bg-elevated); color: var(--label);
  box-shadow: 0 1px 4px rgba(0,0,0,0.10), 0 0 0 0.5px rgba(0,0,0,0.04);
}

.stats-cat-card {
  margin: 0 20px;
  background: var(--bg-elevated);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.stat-row {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 16px;
  border-bottom: 0.5px solid rgba(60,60,67,0.09);
}
.stat-row:last-child { border-bottom: none; }
.stat-emoji { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }
.stat-label { font-size: 14px; font-weight: 400; color: var(--label); flex: 1; min-width: 44px; }
.stat-track {
  width: 80px; height: 5px;
  background: var(--fill-3); border-radius: 3px; overflow: hidden;
}
.stat-fill { height: 100%; border-radius: 3px; transition: width 0.9s cubic-bezier(.25,.46,.45,.94); }
.stat-val { font-size: 12px; font-weight: 500; color: var(--label-3); min-width: 32px; text-align: right; }
.stat-amt { font-size: 14px; font-weight: 600; font-family: var(--mono); color: var(--label-2); min-width: 64px; text-align: right; letter-spacing: -0.2px; }

/* Trend chart */
.trend-wrap { padding: 4px 20px 22px; }
.trend-bars { display: flex; gap: 7px; align-items: flex-end; height: 100px; }
.trend-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; }
.trend-amt {
  font-size: 8px; font-weight: 500; color: var(--label-3);
  font-family: var(--mono); white-space: nowrap; min-height: 12px; margin-bottom: 4px;
}
.trend-bar {
  width: 100%; border-radius: 6px 6px 0 0; min-height: 3px;
  transition: height 0.8s cubic-bezier(.25,.46,.45,.94);
}
.trend-bar.current { background: linear-gradient(180deg, #0A84FF, #007AFF); box-shadow: 0 2px 10px rgba(0,122,255,0.32); }
.trend-bar.past { background: var(--fill); }
.trend-month { font-size: 11px; color: var(--label-3); margin-top: 5px; font-weight: 400; }
.trend-month.current { color: var(--blue); font-weight: 600; }

/* ══════════════════════════════════════════════════════════════
   ACCOUNTS PAGE
══════════════════════════════════════════════════════════════ */
.accounts-list { padding: 10px 20px 0; }

/* Total balance widget */
.acc-total-card {
  background: var(--bg-elevated);
  border-radius: var(--r-xl);
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: space-between;
}
.acc-total-label { font-size: 13px; color: var(--label-2); margin-bottom: 4px; }
.acc-total-amount { font-size: 28px; font-weight: 700; letter-spacing: -1.2px; color: var(--label); font-family: var(--mono); }

.acc-card {
  background: var(--bg-elevated);
  border-radius: var(--r-xl); padding: 16px 18px;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.14s cubic-bezier(0.34,1.56,0.64,1);
}
.acc-card:active { transform: scale(0.98); opacity: 0.75; }
.acc-card-ic {
  width: 48px; height: 48px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  flex-shrink: 0;
}
.acc-card-body { flex: 1; }
.acc-card-name { font-size: 16px; font-weight: 600; color: var(--label); letter-spacing: -0.2px; }
.acc-card-sub { font-size: 12px; color: var(--label-3); margin-top: 2px; }
.acc-card-right { display: flex; align-items: center; gap: 6px; }
.acc-card-bal { font-size: 17px; font-weight: 600; font-family: var(--mono); color: var(--label); letter-spacing: -0.5px; }
.acc-card-chev { color: var(--label-4); font-size: 13px; }

.add-row-btn {
  display: flex; align-items: center; gap: 13px;
  background: var(--bg-elevated); border-radius: var(--r-xl);
  padding: 14px 18px; cursor: pointer; width: 100%;
  border: none; font-family: var(--font); box-shadow: var(--shadow-sm);
  transition: opacity 0.14s;
}
.add-row-btn:active { opacity: 0.6; }
.add-row-btn .add-icon {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--blue); display: flex; align-items: center; justify-content: center;
}
.add-row-btn .add-icon svg { width: 15px; height: 15px; fill: white; }
.add-row-btn span { font-size: 15px; font-weight: 400; color: var(--blue); }

/* ══════════════════════════════════════════════════════════════
   SETTINGS PAGE
══════════════════════════════════════════════════════════════ */
.settings-section { padding: 16px 20px 0; }
.settings-group-label {
  font-size: 12px; font-weight: 500; color: var(--label-2);
  padding: 0 6px 7px; text-transform: uppercase;
  letter-spacing: 0.06em;
}
.settings-group {
  background: var(--bg-elevated); border-radius: var(--r-xl);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.settings-row {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 16px;
  border-bottom: 0.5px solid rgba(60,60,67,0.10);
  cursor: pointer; transition: background 0.10s;
}
.settings-row:last-child { border-bottom: none; }
.settings-row:active { background: var(--fill-4); }
.settings-row-icon {
  width: 32px; height: 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.settings-row-text { flex: 1; }
.settings-row-title { font-size: 15px; font-weight: 400; color: var(--label); }
.settings-row-sub { font-size: 12px; color: var(--label-3); margin-top: 1px; }
.settings-row-right { display: flex; align-items: center; gap: 4px; color: var(--label-3); }
.ios-chevron { color: var(--label-4); font-size: 14px; }
.ios-grp-row {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 16px;
  border-bottom: 0.5px solid rgba(60,60,67,0.10);
  cursor: pointer; transition: background 0.10s;
}
.ios-grp-row:last-child { border-bottom: none; }
.ios-grp-row:active { background: var(--fill-4); }
.ios-row-ic {
  width: 32px; height: 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.ios-row-body { flex: 1; }
.ios-row-title { font-size: 15px; color: var(--label); }
.ios-row-sub { font-size: 12px; color: var(--label-3); margin-top: 1px; }
.ios-row-trailing { color: var(--label-4); font-size: 14px; }
.ios-chev { color: var(--label-4); }

.drive-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 20px;
  font-size: 13px; font-weight: 500; margin: 10px 20px 0;
}
.drive-pill.ok { background: var(--green-soft); color: var(--green); }
.drive-pill.no { background: var(--red-soft); color: var(--red); }

.settings-footer { text-align: center; padding: 28px 16px; color: var(--label-3); font-size: 12px; }

/* ══════════════════════════════════════════════════════════════
   BOTTOM SHEET — iOS Modal Sheet
══════════════════════════════════════════════════════════════ */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.36);
  opacity: 0; pointer-events: none;
  transition: opacity 0.30s cubic-bezier(0.25,0.46,0.45,0.94);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.sheet-overlay.open { opacity: 1; pointer-events: all; }
.sheet {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: var(--bg);
  border-radius: 16px 16px 0 0;
  max-height: 96dvh; overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.36s cubic-bezier(0.52,0,0.16,1);
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}
.sheet-overlay.open .sheet { transform: translateY(0); }
.sheet-grabber {
  width: 38px; height: 5px; border-radius: 2.5px;
  background: var(--label-4); margin: 10px auto 0;
}
.sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 12px;
}
.sheet-title { font-size: 17px; font-weight: 600; color: var(--label); }
.sheet-done-btn {
  font-size: 17px; font-weight: 600; color: var(--blue);
  background: none; border: none; cursor: pointer;
  padding: 4px 0; transition: opacity 0.12s;
}
.sheet-done-btn:active { opacity: 0.5; }
.sheet-close {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--fill-3); border: none; cursor: pointer;
  color: var(--label-2); font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.14s;
}
.sheet-close:active { transform: scale(0.86); }
.sheet-sep { height: 0.5px; background: var(--sep); }

/* ══════════════════════════════════════════════════════════════
   FORM ELEMENTS
══════════════════════════════════════════════════════════════ */
.f-group { padding: 0 18px 11px; }
.f-label {
  font-size: 12px; font-weight: 500; color: var(--label-2);
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0 4px 6px; display: block;
}
.f-input, .f-select {
  width: 100%; background: var(--bg-input);
  border: none; border-radius: var(--r-md);
  color: var(--label); font-family: var(--font);
  font-size: 16px; padding: 13px 14px; outline: none;
  -webkit-appearance: none; transition: background 0.15s;
}
.f-input::placeholder { color: var(--label-3); }
.f-input:focus { background: rgba(120,120,128,0.16); }
.f-select option { background: white; }

/* Segmented Control */
.seg-ctrl {
  display: flex; background: var(--fill-3);
  border-radius: 11px; padding: 3px; gap: 2px;
}
.seg-btn {
  flex: 1; padding: 8px 4px; border-radius: 9px; border: none; cursor: pointer;
  font-family: var(--font); font-size: 13px; font-weight: 500;
  color: var(--label-2); background: transparent; transition: all 0.18s;
}
.seg-btn.ae, .seg-btn.ai, .seg-btn.at {
  background: var(--bg-elevated); color: var(--label);
  box-shadow: 0 1px 4px rgba(0,0,0,0.10), 0 0 0 0.5px rgba(0,0,0,0.04);
}

/* Amount Field */
.amt-wrap {
  background: var(--bg-input); border-radius: var(--r-md);
  display: flex; align-items: stretch; min-height: 76px;
  overflow: hidden;
}
.amt-currency-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 0 16px; min-height: 76px; cursor: pointer;
  color: var(--blue); font-size: 15px; font-weight: 600;
  border-right: 0.5px solid rgba(60,60,67,0.16);
  background: rgba(0,122,255,0.06);
}
.amt-currency-btn svg { width: 12px; height: 12px; fill: var(--blue); }
.amt-input {
  flex: 1; background: transparent; border: none; color: var(--label);
  font-family: var(--mono); font-size: 40px; font-weight: 600;
  padding: 14px 16px; outline: none; letter-spacing: -1px;
  min-width: 0;
}
.amt-input.is-expr { color: var(--blue); font-size: 28px; letter-spacing: 0; }
.amt-calc-eq {
  background: var(--blue); color: #fff; border: none;
  font-size: 20px; font-weight: 700; padding: 0 20px;
  cursor: pointer; transition: background 0.15s;
  display: flex; align-items: center; justify-content: center; min-width: 56px;
  flex-shrink: 0;
}
.amt-calc-eq:active { background: #005ec7; }

/* ══════════════════════════════════════════════════════════════
   FULL-SCREEN TRANSACTION PAGE  — UX redesign
══════════════════════════════════════════════════════════════ */
.tx-page {
  position: fixed; inset: 0; z-index: 300;
  background: var(--bg);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}
.tx-page.open { transform: translateX(0); }

/* ── Top bar ── */
.txp-topbar {
  display: flex; align-items: center;
  padding: 0 4px 0 2px;
  padding-top: max(env(safe-area-inset-top,0px), 0px);
  background: var(--bg);
  flex-shrink: 0;
  min-height: 52px;
  border-bottom: 0.5px solid var(--sep);
}
.txp-back {
  width: 48px; height: 48px; background: none; border: none;
  font-size: 22px; color: var(--blue); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
}
.txp-back:active { background: var(--fill); }

/* Segmented control — iOS-native feel */
.txp-seg {
  flex: 1; display: flex;
  background: var(--fill-3);
  border-radius: 10px; padding: 3px; gap: 2px;
  margin: 0 8px;
}
.txp-seg-btn {
  flex: 1; border: none; border-radius: 8px; cursor: pointer;
  font-family: var(--font); font-size: 14px; font-weight: 500;
  padding: 7px 4px; color: var(--label-2);
  background: transparent;
  transition: all 0.18s cubic-bezier(0.34,1.56,0.64,1);
  -webkit-tap-highlight-color: transparent;
}
.txp-seg-btn.active-exp {
  background: var(--bg-elevated); color: var(--red); font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,0.13), 0 0 0 0.5px rgba(0,0,0,0.06);
}
.txp-seg-btn.active-inc {
  background: var(--bg-elevated); color: var(--green); font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,0.13), 0 0 0 0.5px rgba(0,0,0,0.06);
}
.txp-spacer { width: 48px; flex-shrink: 0; }

/* ── Amount hero ── */
.txp-hero {
  flex-shrink: 0;
  background: var(--bg-card);
  cursor: pointer; user-select: none; -webkit-user-select: none;
}
.txp-hero-inner {
  display: flex; align-items: center;
  padding: 18px 20px 16px;
}
.txp-currency {
  font-size: 18px; font-weight: 700; color: var(--gold);
  margin-right: 10px; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; gap: 3px;
  background: var(--gold-soft); border-radius: 8px;
  padding: 4px 8px;
}
[data-theme="dark"] .txp-currency { color: var(--gold); background: var(--gold-soft); }
.txp-amount-input {
  flex: 1; background: transparent; border: none; outline: none;
  font-family: var(--mono); font-size: 56px; font-weight: 700;
  color: var(--red); letter-spacing: -2px;
  padding: 0; min-width: 0; cursor: pointer; line-height: 1;
}
.txp-amount-input.inc { color: var(--green); }
.txp-amount-input::placeholder { color: var(--red-soft); }
.txp-amount-input.inc::placeholder { color: var(--green-soft); }
.txp-amount-input.is-expr { font-size: 34px; color: var(--blue); letter-spacing: 0; }
.txp-hero-bar { height: 4px; background: linear-gradient(90deg, var(--gold), #e8a015); }
.txp-expr-hint {
  padding: 3px 20px 8px; font-size: 13px;
  color: var(--label-3); font-family: var(--mono);
}

/* ── Scrollable form body ── */
.txp-body {
  flex: 1; overflow-y: auto; background: var(--bg);
  -webkit-overflow-scrolling: touch;
  padding-bottom: max(env(safe-area-inset-bottom,0px), 12px);
}

/* Section card grouping */
.txp-card {
  background: var(--bg-card);
  border-radius: 16px;
  margin: 12px 16px 0;
  overflow: hidden;
}

/* Row inside a card */
.txp-row {
  display: flex; align-items: center;
  min-height: 52px; padding: 12px 16px;
  gap: 10px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
}
.txp-row:active { background: var(--fill); }
.txp-row + .txp-row {
  border-top: 0.5px solid var(--sep);
}
/* label on left — small, muted, fixed width */
.txp-row-label {
  font-size: 15px; font-weight: 500;
  color: var(--label); flex-shrink: 0;
  width: 62px;
}
/* value on right — prominent, colored */
.txp-row-value {
  flex: 1; font-size: 15px; font-weight: 600;
  color: var(--label-2); text-align: right;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.txp-row-value.set { color: var(--green); }
[data-theme="dark"] .txp-row-value.set { color: var(--green); }
.txp-row-chev {
  font-size: 18px; color: var(--label-3);
  flex-shrink: 0; margin-left: 2px;
}

/* Date row — centered with arrows */
.txp-date-row {
  justify-content: space-between; padding: 0 4px; min-height: 50px;
}
.txp-arrow {
  width: 44px; height: 44px; background: none; border: none;
  font-size: 28px; line-height: 1; color: var(--blue); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.txp-arrow:active { background: var(--blue-soft); }
.txp-date-display {
  flex: 1; text-align: center;
  font-size: 16px; font-weight: 600; color: var(--label);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer;
}
.txp-date-cal { font-size: 16px; opacity: 0.5; }

/* Expandable sub-section */
.txp-expand {
  background: var(--bg-input);
  padding: 10px 14px 12px;
  border-top: 0.5px solid var(--sep);
}
.txp-expand .f-select, .txp-expand select {
  width: 100%; background: var(--bg-elevated);
  border: none; border-radius: 10px;
  color: var(--label); font-family: var(--font);
  font-size: 15px; padding: 12px 14px; outline: none;
  -webkit-appearance: none; margin-bottom: 8px;
}
.txp-expand .f-select:last-child,
.txp-expand select:last-child { margin-bottom: 0; }

/* ══════════════════════════════════════════════════════════════
   CATEGORY PICKER MODAL — 左主類別 右次類別
══════════════════════════════════════════════════════════════ */
.cat-modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: var(--bg);
  display: flex; align-items: stretch; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.25,0.46,0.45,0.94);
}
.cat-modal-overlay.open {
  opacity: 1; pointer-events: all;
}
.cat-modal {
  width: 100%; height: 100%;
  background: var(--bg);
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.52,0,0.16,1);
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}
.cat-modal-overlay.open .cat-modal {
  transform: translateY(0);
}
.cat-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  padding-top: max(18px, env(safe-area-inset-top));
  border-bottom: 0.5px solid var(--sep);
  flex-shrink: 0;
}
.cat-modal-title {
  font-size: 20px; font-weight: 700; color: var(--label);
}
.cat-modal-close {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--fill-3); border: none; cursor: pointer;
  color: var(--label-2); font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.14s;
}
.cat-modal-close:active { transform: scale(0.86); background: var(--fill); }
.cat-modal-body {
  display: flex; flex: 1; overflow: hidden;
  min-height: 0;
}
/* Left column — main categories */
.cat-col-left {
  width: 36%; border-right: 0.5px solid var(--sep);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--bg-card);
}
/* Right column — sub categories */
.cat-col-right {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--bg);
  display: flex; flex-direction: column;
}
.cat-sub-placeholder {
  flex: 1; display: flex; align-items: center; justify-content: center;
  color: var(--label-3); font-size: 17px; padding: 20px;
  text-align: center;
}
/* Main category item */
.cat-main-item {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 14px;
  border-bottom: 0.5px solid var(--sep);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
  position: relative;
  min-height: 64px;
}
.cat-main-item:last-child { border-bottom: none; }
.cat-main-item:active { background: var(--fill); }
.cat-main-item.active {
  background: var(--blue-soft);
}
[data-theme="dark"] .cat-main-item.active {
  background: rgba(10,132,255,0.16);
}
.cat-main-item.active::after {
  content: '';
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 4px; background: var(--blue); border-radius: 2px 0 0 2px;
}
.cat-main-icon {
  font-size: 28px; flex-shrink: 0;
  width: 34px; text-align: center;
}
.cat-main-name {
  font-size: 16px; font-weight: 500; color: var(--label);
  line-height: 1.2; flex: 1; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.cat-main-item.active .cat-main-name { color: var(--blue); font-weight: 600; }
/* Sub category item */
.cat-sub-section-label {
  font-size: 13px; font-weight: 600; color: var(--label-3);
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 16px 18px 10px;
}
.cat-sub-item {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 18px;
  border-bottom: 0.5px solid var(--sep);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
  min-height: 64px;
}
.cat-sub-item:last-child { border-bottom: none; }
.cat-sub-item:active { background: var(--fill); }
.cat-sub-item.active { background: var(--green-soft); }
[data-theme="dark"] .cat-sub-item.active { background: rgba(48,209,88,0.12); }
.cat-sub-icon { font-size: 26px; flex-shrink: 0; width: 30px; text-align: center; }
.cat-sub-name {
  flex: 1; font-size: 17px; font-weight: 400; color: var(--label);
}
.cat-sub-item.active .cat-sub-name { color: var(--green); font-weight: 600; }
[data-theme="dark"] .cat-sub-item.active .cat-sub-name { color: var(--green); }
.cat-sub-check {
  font-size: 20px; color: var(--green); display: none;
}
.cat-sub-item.active .cat-sub-check { display: block; }
/* "Use main category directly" option at top of sub list */
.cat-use-parent {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 18px;
  border-bottom: 0.5px solid var(--sep);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
  background: var(--fill-3);
  min-height: 64px;
}
.cat-use-parent:active { background: var(--fill); }
.cat-use-parent.active { background: var(--green-soft); }
[data-theme="dark"] .cat-use-parent.active { background: rgba(48,209,88,0.12); }
.cat-use-parent-text {
  flex: 1; font-size: 16px; font-weight: 500; color: var(--label-2);
  font-style: italic;
}
.cat-use-parent.active .cat-use-parent-text { color: var(--green); font-weight: 600; font-style: normal; }

/* Note input inline */
.txp-note-input {
  flex: 1; background: transparent; border: none; outline: none;
  font-family: var(--font); font-size: 15px; font-weight: 400;
  color: var(--label); text-align: right; min-width: 0;
}
.txp-note-input::placeholder { color: var(--label-3); }

/* Buttons — sticky so they anchor to visible bottom when calc is hidden */
.txp-actions {
  display: flex; gap: 10px;
  padding: 20px 16px 8px;
  position: sticky;
  bottom: 0;
  background: var(--bg);
  z-index: 2;
}

/* ── Expanded layout when calc is hidden ── */
.txp-body.calc-hidden .txp-card {
  margin: 16px 16px 0;
  transition: margin 0.3s ease;
}
.txp-body.calc-hidden .txp-row {
  min-height: 72px;
  padding: 16px 20px;
  transition: min-height 0.3s ease, padding 0.3s ease;
}
.txp-body.calc-hidden .txp-row-label {
  font-size: 18px;
  width: 72px;
  transition: font-size 0.3s ease, width 0.3s ease;
}
.txp-body.calc-hidden .txp-row-value {
  font-size: 18px;
  transition: font-size 0.3s ease;
}
.txp-body.calc-hidden .txp-row-chev {
  font-size: 22px;
  transition: font-size 0.3s ease;
}
.txp-body.calc-hidden .txp-note-input {
  font-size: 18px;
  transition: font-size 0.3s ease;
}
.txp-body.calc-hidden .txp-date-display {
  font-size: 20px;
  transition: font-size 0.3s ease;
}
.txp-body.calc-hidden .txp-arrow {
  width: 52px; height: 52px; font-size: 34px;
  transition: width 0.3s ease, height 0.3s ease, font-size 0.3s ease;
}
.txp-body.calc-hidden .txp-actions {
  padding: 24px 16px 12px;
}
.txp-body.calc-hidden .txp-btn-save,
.txp-body.calc-hidden .txp-btn-cont {
  height: 62px;
  font-size: 19px;
  transition: height 0.3s ease, font-size 0.3s ease;
}
/* Smooth transition on normal rows too */
.txp-row, .txp-row-label, .txp-row-value, .txp-row-chev,
.txp-note-input, .txp-date-display, .txp-arrow,
.txp-btn-save, .txp-btn-cont {
  transition: all 0.3s ease;
}
.txp-btn-save {
  flex: 2; height: 52px; border: none; border-radius: 14px;
  background: var(--blue); color: #fff;
  font-family: var(--font); font-size: 17px; font-weight: 700;
  cursor: pointer; letter-spacing: 0.02em;
  box-shadow: var(--shadow-blue);
  transition: all 0.15s; -webkit-tap-highlight-color: transparent;
}
.txp-btn-save:active { transform: scale(0.97); opacity: 0.88; }
.txp-btn-cont {
  flex: 1; height: 52px; border: none; border-radius: 14px;
  background: var(--blue-soft); color: var(--blue);
  font-family: var(--font); font-size: 15px; font-weight: 700;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: all 0.15s;
}
.txp-btn-cont:active { transform: scale(0.97); opacity: 0.80; }
#calc-numpad {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 500;
  background: #111;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.52,0,0.16,1);
  padding-bottom: max(env(safe-area-inset-bottom), 0px);
  user-select: none; -webkit-user-select: none;
}
#calc-numpad.open { transform: translateY(0); }
.cnp-display {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px 10px;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
}
.cnp-display-val {
  font-size: 30px; font-weight: 600; color: #fff;
  letter-spacing: -0.4px; flex: 1; text-align: right;
  font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cnp-display-val.is-expr { color: #64b5f6; font-size: 22px; }
.cnp-preview {
  font-size: 14px; color: #888; margin-left: 10px;
  font-family: var(--mono); flex-shrink: 0;
}

/* Grid: 4 equal columns, 2px gap between cells */
.cnp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: #222;
}
/* Base button */
.cnp-btn {
  border: none; cursor: pointer; padding: 0;
  height: 64px;
  font-size: 26px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  transition: filter 0.08s;
  -webkit-tap-highlight-color: transparent;
  border-radius: 0;
}
.cnp-btn:active { filter: brightness(0.78); }

/* Number buttons — navy dark/blue variant */
.cnp-btn       { background: #1e3a8a; color: #fff; }

/* Operator buttons — gold */
.cnp-btn.op    { background: var(--gold); color: #fff; font-size: 26px; }

/* AC — red variant */
.cnp-btn.clr   { background: #be123c; color: #fff; font-size: 22px; font-weight: 800; }

/* DEL — gray variant */
.cnp-btn.del   { background: #334155; color: #fff; font-size: 22px; font-weight: 700; }

/* OK — green variant, spans 2 columns */
.cnp-btn.eq    {
  background: #059669; color: #fff;
  font-size: 26px; font-weight: 800;
  grid-column: span 2;
}

/* 0 spans 2 columns */
.cnp-btn.zero  { grid-column: span 2; }

.amt-expr-hint {
  font-size: 13px; color: var(--label-3); padding: 4px 16px 2px;
  font-family: var(--mono);
}
.amt-input::placeholder { color: var(--label-3); font-size: 24px; font-weight: 400; letter-spacing: 0; }

/* Category Grid */
.cat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 9px; padding: 0 18px 12px;
}
.cat-chip {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 11px 4px 9px; border-radius: 14px;
  background: var(--bg-input); border: 1.5px solid transparent;
  cursor: pointer; transition: all 0.16s cubic-bezier(0.34,1.56,0.64,1);
  color: var(--label-2); font-size: 11px; font-weight: 400;
}
.cat-chip span:first-child { font-size: 24px; }
.cat-chip.sel {
  background: var(--blue-soft);
  border-color: var(--blue);
  color: var(--blue);
  transform: scale(1.04);
}

/* Primary Button */
.ios-btn {
  display: block; width: calc(100% - 36px); margin: 4px 18px;
  padding: 16px; border: none; border-radius: var(--r-lg);
  font-family: var(--font); font-size: 17px; font-weight: 600;
  cursor: pointer; text-align: center; transition: all 0.18s cubic-bezier(0.34,1.56,0.64,1);
}
.ios-btn:active { transform: scale(0.97); opacity: 0.80; }
.ios-btn.primary { background: var(--blue); color: white; box-shadow: var(--shadow-blue); }
.ios-btn.danger { background: var(--red-soft); color: var(--red); }

/* Hold Delete */
.hold-btn-wrap { position: relative; margin: 4px 18px; overflow: hidden; border-radius: var(--r-lg); }
.hold-btn {
  width: 100%; padding: 16px; border: none;
  background: var(--red-soft); color: var(--red);
  font-family: var(--font); font-size: 17px; font-weight: 600;
  cursor: pointer; border-radius: var(--r-lg); position: relative; z-index: 1; display: block;
}
.hold-progress {
  position: absolute; top: 0; left: 0; bottom: 0; width: 0%;
  background: var(--red); opacity: 0.18; z-index: 0; border-radius: var(--r-lg);
}

/* Color picker */
.color-row { display: flex; gap: 10px; flex-wrap: wrap; padding: 0 18px 12px; }
.c-dot {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  border: 3px solid transparent; transition: transform 0.16s cubic-bezier(0.34,1.56,0.64,1);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.c-dot.sel { border-color: var(--blue); transform: scale(1.18); }
.c-dot.sel::after { content: '✓'; font-size: 12px; color: white; font-weight: 700; }

/* Currency list */
.curr-row {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 18px; border-bottom: 0.5px solid rgba(60,60,67,0.10);
  cursor: pointer; transition: background 0.08s;
}
.curr-row:last-child { border-bottom: none; }
.curr-row:active { background: var(--fill-4); }
.curr-code { font-size: 15px; font-weight: 600; color: var(--blue); min-width: 46px; font-family: var(--mono); }
.curr-name { flex: 1; font-size: 14px; color: var(--label-2); }
.curr-sym { font-size: 16px; color: var(--label-3); }

/* ══════════════════════════════════════════════════════════════
   CONFIRM SHEET
══════════════════════════════════════════════════════════════ */
#confirm-modal .sheet { border-radius: 16px 16px 0 0; }
#confirm-modal .sheet-header { justify-content: center; padding-bottom: 2px; }
#confirm-modal .sheet-title { text-align: center; }
.confirm-msg-text { font-size: 13px; color: var(--label-2); text-align: center; padding: 0 22px 16px; line-height: 1.55; }
.confirm-actions { display: flex; gap: 10px; padding: 0 18px 4px; }
.confirm-actions button {
  flex: 1; padding: 14px; border-radius: var(--r-md);
  border: none; font-family: var(--font); font-size: 16px; font-weight: 600; cursor: pointer;
}
.confirm-cancel-btn { background: var(--fill-3); color: var(--label-2); }
.confirm-ok-btn { background: var(--red-soft); color: var(--red); }

/* ══════════════════════════════════════════════════════════════
   TOAST — Dynamic Island inspired pill
══════════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  top: calc(env(safe-area-inset-top, 48px) + 8px);
  left: 50%; transform: translateX(-50%) translateY(-8px) scale(0.92);
  background: rgba(30,30,32,0.94);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-radius: 22px; padding: 11px 22px;
  font-size: 14px; font-weight: 500; color: white;
  z-index: 600; opacity: 0; pointer-events: none;
  transition: all 0.28s cubic-bezier(0.34,1.56,0.64,1);
  white-space: nowrap;
  box-shadow: 0 4px 24px rgba(0,0,0,0.28), 0 1px 8px rgba(0,0,0,0.16);
  border: 0.5px solid rgba(255,255,255,0.12);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }

/* ══════════════════════════════════════════════════════════════
   ANIMATIONS — Premium Ease Out Quint
══════════════════════════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
.page.active { animation: pageIn 0.4s cubic-bezier(0.23, 1, 0.32, 1) forwards; }
.tx-row { animation: fadeUp 0.4s cubic-bezier(0.23, 1, 0.32, 1) both; }
.stat-row { animation: fadeUp 0.4s cubic-bezier(0.23, 1, 0.32, 1) both; }
.acc-card { animation: scaleIn 0.35s cubic-bezier(0.23, 1, 0.32, 1) both; }

/* Account Grouping */
.acc-group { margin-bottom: 12px; }
.acc-group-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 22px 8px; cursor: pointer; user-select: none;
}
.acc-group-title { font-size: 14px; font-weight: 600; color: var(--label-2); text-transform: uppercase; letter-spacing: 0.05em; }
.acc-group-arrow { font-size: 12px; color: var(--label-3); transition: transform 0.3s; }
.acc-group.collapsed .acc-group-arrow { transform: rotate(-90deg); }
.acc-group-content { overflow: hidden; transition: max-height 0.3s ease-out; }
.acc-group.collapsed .acc-group-content { max-height: 0 !important; }

/* Custom Checkbox */
.acc-checkbox-wrap { padding: 8px; margin-right: -8px; }
.acc-checkbox {
  width: 22px; height: 22px; border-radius: 6px;
  border: 2px solid var(--label-4);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; cursor: pointer;
}
.acc-checkbox.checked { background: var(--blue-vivid); border-color: var(--blue-vivid); }
.acc-checkbox::after {
  content: '✓'; color: white; font-size: 14px; font-weight: 800;
  display: none;
}
.acc-checkbox.checked::after { display: block; }
