:root {
  /* Brand */
  --purple: #6C5CE7;
  --purple-light: #A29BFE;
  --purple-dark: #5A4BD1;
  --purple-faint: rgba(108, 92, 231, 0.08);
  --green: #00A878;
  --green-light: #55EFC4;
  --green-faint: rgba(0, 168, 120, 0.10);
  --red: #D63031;
  --red-light: #FAB1A0;
  --red-faint: rgba(214, 48, 49, 0.08);
  --yellow: #F39C12;
  --yellow-faint: rgba(243, 156, 18, 0.10);

  /* Surfaces */
  --bg: #F5F6FA;
  --bg-secondary: #ECEDF3;
  --card: #FFFFFF;

  /* Text */
  --text: #1A1D2E;
  --text-light: #6B7280;
  --text-muted: #9CA3AF;

  /* Borders */
  --border: #E5E7EB;
  --border-strong: #D1D5DB;

  /* Elevation */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:    0 2px 8px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.09), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg: 0 8px 28px rgba(108, 92, 231, 0.18), 0 3px 10px rgba(0,0,0,0.07);

  /* Shape */
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
}

#app {
  max-width: 500px;
  margin: 0 auto;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top, 0);
}

/* Page Content - clear space for bottom nav */
.page-content {
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0));
  animation: pageFade 0.18s ease;
}

@keyframes pageFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Header ──────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 12px;
}

.header h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.6px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 9px;
}

.header-logo-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1;
}

.header-logo-kid {
  color: var(--purple);
  font-weight: 600;
}

.header-logo-cash {
  color: var(--text);
  font-weight: 800;
}

.sync-error {
  font-size: 12px;
  color: var(--red);
  font-weight: 500;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ─── Bottom Navigation ───────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(60px + env(safe-area-inset-bottom, 0));
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  z-index: 50;
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.06);
}

.bottom-nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-light);
  transition: color 0.2s;
  padding: 8px 0;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.bottom-nav-tab.active {
  color: var(--purple);
}

.bottom-nav-tab.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: var(--purple);
  border-radius: 0 0 3px 3px;
}

.bottom-nav-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.nav-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: var(--red);
  color: white;
  border-radius: 10px;
  min-width: 16px;
  height: 16px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

.bottom-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.bottom-nav-icon svg {
  width: 22px;
  height: 22px;
}

.bottom-nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.bottom-nav-tab:active {
  transform: scale(0.92);
  transition: transform 0.1s;
}

@media (min-width: 500px) {
  .bottom-nav {
    left: 50%;
    transform: translateX(-50%);
    max-width: 500px;
    border-radius: var(--radius) var(--radius) 0 0;
  }
}

/* ─── Kid Tabs ────────────────────────────────────────────── */
.kid-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.kid-tab {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--card);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.kid-tab.active {
  border-color: var(--purple);
  background: var(--purple);
  color: white;
}

.kid-tab:active {
  transform: scale(0.97);
}

/* ─── Balance Card ────────────────────────────────────────── */
.balance-card {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
  border-radius: var(--radius);
  padding: 22px 20px 20px;
  color: white;
  margin-bottom: 20px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.balance-card::before {
  content: '';
  position: absolute;
  bottom: -50px;
  left: -30px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  pointer-events: none;
}

.balance-card::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  pointer-events: none;
}

.balance-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.balance-card-name {
  font-size: 15px;
  font-weight: 600;
  opacity: 0.9;
  letter-spacing: 0.3px;
  flex: 1;
  margin-left: 12px;
}

.kid-avatar-circle {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}

.balance-label {
  font-size: 12px;
  opacity: 0.75;
  margin-bottom: 2px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.balance-amount {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -2px;
  margin-bottom: 16px;
}

.balance-stats {
  display: flex;
  gap: 20px;
}

.balance-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  opacity: 0.9;
}

.stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.stat-dot.income { background: var(--green-light); }
.stat-dot.expense { background: var(--red-light); }

/* ─── Quick Actions & Page Actions ────────────────────────── */
.quick-actions,
.page-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.action-btn {
  flex: 1;
  padding: 13px 12px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.1px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

.action-btn:active {
  transform: scale(0.96);
  box-shadow: none;
}

.action-btn.add {
  background: var(--green);
  color: white;
}

.action-btn.spend {
  background: var(--red);
  color: white;
}

.action-btn.goal {
  background: var(--purple-faint);
  color: var(--purple);
  border: 1.5px solid rgba(108, 92, 231, 0.18);
}

.action-btn.wishlist-add {
  background: var(--purple);
  color: white;
}

/* ─── Kid Stats Card ─────────────────────────────────────── */
.kid-stats-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.kid-stats-month-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.kid-stats-bars { display: flex; flex-direction: column; gap: 10px; }

.kid-stats-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kid-stats-bar-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  width: 52px;
  flex-shrink: 0;
}

.kid-stats-bar-track {
  flex: 1;
  height: 20px;
  background: var(--bg-secondary);
  border-radius: 10px;
  overflow: hidden;
}

.kid-stats-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.4s ease;
  min-width: 4px;
}

.kid-stats-bar-fill.earned { background: linear-gradient(90deg, #00A878, #00C9A7); }
.kid-stats-bar-fill.spent { background: linear-gradient(90deg, #D63031, #E17055); }

.kid-stats-bar-value {
  font-size: 13px;
  font-weight: 700;
  width: 60px;
  text-align: right;
  flex-shrink: 0;
}

.kid-stats-bar-value.earned { color: var(--green); }
.kid-stats-bar-value.spent { color: var(--red); }

.kid-stats-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* Weekly trend mini chart */
.kid-stats-weeks {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  padding: 0 8px;
  margin-bottom: 8px;
}

.kid-stats-week {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.kid-stats-week-bars {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 64px;
}

.kid-stats-week-bar {
  width: 14px;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.4s ease;
}

.kid-stats-week-bar.earned { background: var(--green); opacity: 0.85; }
.kid-stats-week-bar.spent { background: var(--red); opacity: 0.7; }

.kid-stats-week-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.kid-stats-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.kid-stats-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.kid-stats-legend-dot.earned { background: var(--green); }
.kid-stats-legend-dot.spent { background: var(--red); margin-left: 10px; }

/* Chore level in stats */
.kid-stats-chores {}

.kid-stats-chore-level {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.kid-stats-chore-emoji { font-size: 32px; }

.kid-stats-chore-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.kid-stats-chore-count {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.kid-stats-chore-progress {}

.kid-stats-chore-bar-track {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.kid-stats-chore-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--purple-light));
  border-radius: 4px;
  transition: width 0.4s ease;
}

.kid-stats-chore-next {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ─── Sections ────────────────────────────────────────────── */
.section {
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-header-stack {
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 400;
  line-height: 1.4;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}

.section-link {
  font-size: 13px;
  color: var(--purple);
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: none;
  padding: 4px 8px;
}

/* ─── Goals ───────────────────────────────────────────────── */
.goals-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.goal-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow-md);
  position: relative;
}

.goal-card.compact {
  cursor: pointer;
}

.goal-card-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.goal-card-text {
  flex: 1;
  min-width: 0;
}

.goal-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.goal-name {
  font-size: 15px;
  font-weight: 600;
}

.goal-amount {
  font-size: 13px;
  color: var(--text-light);
  font-weight: 500;
}

.goal-progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.goal-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple-light), var(--purple));
  border-radius: 4px;
  transition: width 0.4s ease;
}

.goal-progress-fill.complete {
  background: linear-gradient(90deg, var(--green-light), var(--green));
}

.goal-percent {
  font-size: 12px;
  color: var(--text-light);
  text-align: right;
}

.goal-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.goal-action-btn {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-light);
}

.goal-action-btn.wishlist {
  color: var(--purple);
  border-color: rgba(108, 92, 231, 0.25);
}

.goal-action-btn.delete {
  color: var(--red);
  border-color: var(--red-light);
}

.goal-action-btn:active {
  transform: scale(0.95);
}

/* ─── Transactions ────────────────────────────────────────── */
.transaction-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.transaction-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s;
}

.tx-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.tx-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.tx-icon.income { background: var(--green-faint); color: var(--green); }
.tx-icon.expense { background: var(--red-faint); color: var(--red); }

.tx-details {
  flex: 1;
  min-width: 0;
}

.tx-description {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-date {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

.tx-amount {
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.tx-amount.income { color: var(--green); }
.tx-amount.expense { color: var(--red); }

.tx-created-by {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  vertical-align: middle;
}
.tx-created-by--kid {
  background: rgba(108, 92, 231, 0.12);
  color: #6c5ce7;
}
.tx-created-by--parent {
  background: rgba(0, 184, 148, 0.12);
  color: var(--green);
}

.tx-delete {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.15s;
}

.tx-delete:hover, .tx-delete:active {
  opacity: 1;
  color: var(--red);
}

/* Tax badge in transaction */
.tx-tax {
  display: inline-block;
  margin-left: 4px;
  font-size: 11px;
  color: var(--purple);
  font-weight: 500;
}

/* ─── Wishlist ────────────────────────────────────────────── */
.wishlist-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wishlist-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow-md);
}

.wishlist-card--claimed {
  border: 2px solid var(--green);
  background: linear-gradient(to bottom, rgba(0,184,148,0.04) 0%, var(--card) 60px);
}

.wishlist-card--contributed {
  border: 2px solid var(--purple-light);
  background: linear-gradient(to bottom, rgba(108,92,231,0.04) 0%, var(--card) 60px);
}

.wishlist-contrib-section {
  margin-bottom: 12px;
}

.wishlist-contrib-bar-wrap {
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 6px;
}

.wishlist-contrib-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple) 0%, var(--purple-light) 100%);
  border-radius: 99px;
  transition: width 0.4s ease;
}

.wishlist-contrib-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.wishlist-contrib-total {
  font-size: 12px;
  font-weight: 600;
  color: var(--purple);
}

.wishlist-contrib-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.wishlist-contrib-chip {
  font-size: 11px;
  font-weight: 500;
  color: var(--purple-dark);
  background: rgba(108,92,231,0.10);
  border-radius: 99px;
  padding: 3px 9px;
}

.wishlist-contrib-note {
  font-size: 11px;
  color: var(--purple);
  font-weight: 500;
}

.goal-contrib-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.goal-contrib-chip {
  font-size: 11px;
  font-weight: 500;
  color: var(--purple-dark);
  background: rgba(108,92,231,0.10);
  border-radius: 99px;
  padding: 3px 9px;
}

/* ─── Family Chore Board ────────────────────────────────────── */
.chore-family-section {
  background: rgba(108, 92, 231, 0.04);
  border: 1.5px solid rgba(108, 92, 231, 0.15);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 16px;
}

.chore-family-card {
  border-left: 3px solid var(--purple-light);
}

.chore-family-note {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
}

/* ─── Contributor / Family View ─────────────────────────────── */
.contributor-header {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-light) 100%);
  padding: 52px 20px 24px;
  color: white;
}
.contributor-header-top {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.contributor-logo { font-size: 18px; font-weight: 800; opacity: 0.9; }
.contributor-family-badge {
  font-size: 11px; font-weight: 700; background: rgba(255,255,255,0.2);
  border-radius: 99px; padding: 3px 10px; letter-spacing: 0.04em;
}
.contributor-family-name { font-size: 24px; font-weight: 800; margin-bottom: 12px; }
.contributor-actions { display: flex; gap: 8px; }
.contributor-refresh-btn, .contributor-signout-btn {
  padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: none;
}
.contributor-refresh-btn { background: rgba(255,255,255,0.2); color: white; }
.contributor-signout-btn { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.85); }
.contributor-content { padding: 16px; max-width: 560px; margin: 0 auto; }
.contributor-kid-section {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-md); margin-bottom: 16px; overflow: hidden;
}
.contributor-kid-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.contributor-kid-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--purple-faint); color: var(--purple);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; flex-shrink: 0;
}
.contributor-kid-name { font-size: 17px; font-weight: 700; }
.contributor-block { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.contributor-block:last-child { border-bottom: none; }
.contributor-block-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 10px;
}
.contributor-empty { font-size: 13px; color: var(--text-muted); }
.contributor-wish-card {
  display: flex; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.contributor-wish-card:last-child { border-bottom: none; padding-bottom: 0; }
.contributor-wish-card.is-claimed { opacity: 0.65; }
.contributor-wish-img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.contributor-wish-info { flex: 1; min-width: 0; }
.contributor-wish-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.contributor-wish-price { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.contributor-claimed-badge { font-size: 12px; color: var(--green); font-weight: 600; }
.contributor-contrib-bar-wrap {
  height: 4px; background: var(--bg-secondary); border-radius: 99px; overflow: hidden; margin: 4px 0;
}
.contributor-contrib-bar {
  height: 100%; background: var(--purple); border-radius: 99px;
}
.contributor-contrib-label { font-size: 11px; color: var(--purple); font-weight: 600; }
.contributor-chore-card {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.contributor-chore-card:last-child { border-bottom: none; padding-bottom: 0; }
.contributor-chore-info { flex: 1; min-width: 0; }
.contributor-chore-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.contributor-chore-meta { font-size: 12px; color: var(--text-muted); }
.contributor-chore-note { font-size: 12px; color: var(--text-muted); font-style: italic; margin-top: 2px; }
.contributor-status-badge {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; flex-shrink: 0; white-space: nowrap;
}
.status-pending  { background: rgba(243,156,18,0.12); color: #b7760a; }
.status-approved { background: rgba(0,168,120,0.12);  color: #006b4d; }
.status-rejected { background: rgba(214,48,49,0.10);  color: #a82020; }
.contributor-suggest-btn {
  display: block; margin-top: 12px; text-align: center;
  padding: 9px 16px; border-radius: 8px;
  background: rgba(108,92,231,0.08); color: var(--purple);
  font-size: 13px; font-weight: 700; text-decoration: none;
  border: 1.5px solid rgba(108,92,231,0.2);
}

/* Family settings section */
.family-members-list { margin-top: 12px; }
.family-members-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 8px;
}
.family-member-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.family-member-row:last-child { border-bottom: none; }
.family-member-name { font-size: 14px; font-weight: 600; }
.family-member-email { font-size: 12px; color: var(--text-muted); }
.family-member-remove {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 10px; font-size: 12px; color: var(--text-muted); cursor: pointer;
}

.wishlist-gift-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 184, 148, 0.10);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 500;
  color: #007a5e;
  line-height: 1.3;
}

.wishlist-gift-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.claims-refresh-inline-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
}

.wishlist-card.compact {
  cursor: pointer;
  transition: transform 0.15s;
}

.wishlist-card.compact:active {
  transform: scale(0.98);
}

.wishlist-top {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
}

.wishlist-card.compact .wishlist-top {
  margin-bottom: 0;
}

.wishlist-image {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg);
  flex-shrink: 0;
}

.wishlist-info {
  flex: 1;
  min-width: 0;
}

.wishlist-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.wishlist-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: 2px;
}

.wishlist-price-withtax {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-light);
  margin-bottom: 2px;
}

.wishlist-link {
  font-size: 12px;
  color: var(--text-light);
  text-decoration: none;
}

.wishlist-link:hover {
  color: var(--purple);
}

.wishlist-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  background: var(--purple-faint);
  color: var(--purple);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(108, 92, 231, 0.15);
  transition: background 0.15s;
}

.wishlist-view-btn:hover, .wishlist-view-btn:active {
  background: rgba(108, 92, 231, 0.14);
}

.wishlist-actions {
  display: flex;
  gap: 6px;
}

.wishlist-action-btn {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.15s;
}

.wishlist-action-btn:active {
  transform: scale(0.95);
}

.wishlist-action-btn.goal {
  color: var(--purple);
  border-color: var(--purple-light);
}

.wishlist-action-btn.goal.primary {
  background: var(--purple);
  color: white;
  border-color: var(--purple);
  font-weight: 600;
}

.goal-action-btn.buy {
  background: var(--green);
  color: white;
  border-color: var(--green);
  font-weight: 600;
}

.wishlist-action-btn.buy {
  color: var(--green);
  border-color: var(--green-light);
}

.wishlist-action-btn.delete {
  color: var(--red);
  border-color: var(--red-light);
}

/* ─── Wishlist Modal ──────────────────────────────────────── */
.url-input-group {
  display: flex;
  gap: 8px;
}

.url-input-group input {
  flex: 1;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  font-size: 15px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  outline: none;
  min-width: 0;
}

.url-input-group input:focus {
  border-color: var(--purple);
}

.fetch-btn {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--purple);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.fetch-btn:active {
  transform: scale(0.95);
}

.fetch-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.label-optional {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: 4px;
}

/* ─── Wishlist Share ──────────────────────────────────────── */
.section-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.section-header-row .section-header-stack {
  margin-bottom: 0;
}

.wishlist-share-toggle-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.wishlist-share-toggle-btn.active {
  background: rgba(108, 92, 231, 0.08);
  border-color: rgba(108, 92, 231, 0.3);
  color: var(--purple);
}

.share-modal-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 16px;
  line-height: 1.5;
}

.share-url-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-all;
  margin-bottom: 12px;
  font-family: monospace;
}

.share-view-btn {
  display: block;
  text-align: center;
  margin-top: 10px;
  padding: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--purple);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.claims-section {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.claims-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.claims-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.claims-refresh-btn {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--purple);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.claims-loading, .claims-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 12px;
  text-align: center;
}

.claim-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

.claim-row:last-child { border-bottom: none; }

.claim-row-name {
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 8px;
}

.claim-row-by {
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  flex-shrink: 0;
}

.claim-row-status {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.share-stop-btn {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: none;
  border: 1px solid var(--red-light, #ffcdd2);
  border-radius: 10px;
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.fetch-status {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.fetch-status.loading {
  background: rgba(108, 92, 231, 0.08);
  color: var(--purple);
}

.fetch-status.error {
  background: rgba(225, 112, 85, 0.08);
  color: var(--red);
}

.fetch-status.success {
  background: rgba(0, 184, 148, 0.08);
  color: var(--green);
}

.fetch-image-preview {
  width: 100%;
  max-height: 120px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  background: var(--bg);
}

/* ─── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--card);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px 20px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
  width: 100%;
  max-width: 500px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.modal h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  font-size: 16px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-faint);
  outline: none;
}

.form-group input[type="number"] {
  font-weight: 600;
}

.type-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.type-toggle button {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--card);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.15s;
}

.type-toggle button.active-income {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.type-toggle button.active-expense {
  border-color: var(--red);
  background: var(--red);
  color: white;
}

.submit-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--purple);
  color: white;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.1px;
  cursor: pointer;
  transition: transform 0.15s;
  margin-top: 8px;
}

.submit-btn:active {
  transform: scale(0.98);
}

.submit-btn.green {
  background: var(--green);
}

/* ─── Tax Preview ─────────────────────────────────────────── */
.tax-preview {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 2px solid var(--border);
}

.tax-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-light);
  padding: 3px 0;
}

.tax-row.tax-total {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.balance-after-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(108, 92, 231, 0.08);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-light);
  margin-top: 8px;
}
.balance-after-amount {
  font-weight: 700;
  color: var(--green);
}
.balance-after-amount.negative {
  color: var(--red);
}

.goal-balance-after {
  font-size: 12px;
  color: var(--green);
  font-weight: 500;
  margin-top: 2px;
}
.goal-balance-after.negative {
  color: var(--red);
}
.goal-tax-note {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.goal-tax-badge {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 400;
}

.wishlist-balance-after {
  font-size: 12px;
  font-weight: 500;
  color: var(--green);
  margin-top: 2px;
}
.wishlist-balance-after.negative {
  color: var(--red);
}

/* ─── Settings Page ───────────────────────────────────────── */
.settings-section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.settings-section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 12px;
}

.settings-kid {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.settings-kid input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  font-size: 15px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  outline: none;
}

.settings-kid input:focus {
  border-color: var(--purple);
}

.settings-kid .settings-pin-btn {
  flex-shrink: 0;
  min-width: 72px;
  height: 36px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 2px;
  transition: border-color 0.15s;
}

.settings-kid .settings-pin-btn.has-pin {
  color: var(--text);
  border-color: var(--purple-light);
  background: var(--purple-faint);
}

.pin-setup-box {
  max-width: 320px !important;
  padding: 24px 20px !important;
}

.settings-kid .kid-link-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: var(--purple-faint);
  color: var(--purple);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-kid .remove-kid {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: var(--red-light);
  color: var(--red);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-kid-btn {
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 2px dashed var(--border);
  background: transparent;
  color: var(--text-light);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.settings-about {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.6;
}

/* ─── Empty State ─────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  text-align: center;
  gap: 12px;
}

.empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-icon svg {
  border-radius: 18px;
}

.empty-state p {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.5;
  max-width: 260px;
}

.empty-state p:first-of-type {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* ─── Tutorial Overlay ───────────────────────────────────── */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.tutorial-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 36px 28px 28px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  position: relative;
  animation: tutorialSlide 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tutorialSlide {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.tutorial-skip {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
}

.tutorial-skip:hover { color: var(--text-secondary); }

.tutorial-emoji {
  font-size: 56px;
  margin-bottom: 16px;
  line-height: 1;
}

.tutorial-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.tutorial-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.tutorial-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.tutorial-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.25s ease;
}

.tutorial-dot.active {
  background: var(--purple);
  transform: scale(1.3);
}

.tutorial-dot.done {
  background: var(--purple-light);
}

.tutorial-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.tutorial-btn {
  padding: 12px 24px;
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: transform 0.1s, background 0.15s;
}

.tutorial-btn:active { transform: scale(0.96); }

.tutorial-btn.primary {
  background: var(--purple);
  color: white;
  flex: 1;
}

.tutorial-btn.primary:hover { background: var(--purple-dark); }

.tutorial-btn.secondary {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.tutorial-btn.secondary:hover { background: var(--border); }

/* ─── Confirm Dialog ──────────────────────────────────────── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.confirm-box {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 320px;
  width: 100%;
  text-align: center;
}

.confirm-box p {
  font-size: 15px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  gap: 10px;
}

.confirm-actions button {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.confirm-cancel {
  background: var(--bg);
  color: var(--text);
}

.confirm-delete {
  background: var(--red);
  color: white;
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (min-width: 600px) {
  #app {
    padding: 0 24px;
  }
}

/* ─── Animations ──────────────────────────────────────────── */
@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.transaction-item, .goal-card, .wishlist-card, .settings-section {
  animation: slideIn 0.25s ease;
}

/* ─── Auth / Login Screen ────────────────────────────────────── */
.auth-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
}

.auth-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
}

.login-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 40px 28px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(108, 92, 231, 0.12);
  animation: slideIn 0.3s ease;
}

.login-logo {
  text-align: center;
  margin-bottom: 8px;
}

.login-logo h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--purple);
  letter-spacing: -0.5px;
}

.login-logo p {
  font-size: 14px;
  color: var(--text-light);
  margin-top: 4px;
}

.login-form {
  margin-top: 28px;
}

.login-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  font-size: 16px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 12px;
  -webkit-appearance: none;
}

.login-input:focus {
  border-color: var(--purple);
}

.login-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--purple);
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 4px;
}

.login-btn:active {
  transform: scale(0.98);
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-light);
  font-size: 13px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.google-btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.google-btn:active {
  transform: scale(0.98);
}

.google-btn:hover {
  border-color: var(--text-light);
}

.google-btn svg {
  width: 20px;
  height: 20px;
}

.login-toggle {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-light);
}

.login-toggle button {
  background: none;
  border: none;
  color: var(--purple);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
}

.auth-error {
  background: rgba(225, 112, 85, 0.1);
  color: var(--red);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
  text-align: center;
  animation: slideIn 0.2s ease;
}

.auth-message {
  background: rgba(0, 184, 148, 0.1);
  color: var(--green);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
  text-align: center;
  animation: slideIn 0.2s ease;
}

.forgot-password {
  text-align: right;
  margin: -4px 0 4px;
}
.forgot-password button {
  background: none;
  border: none;
  color: var(--purple);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

.email-verify-warning {
  background: rgba(253, 203, 110, 0.15);
  color: #b8860b;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 12px;
  text-align: center;
}
.email-verify-warning button {
  background: none;
  border: none;
  color: var(--purple);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

/* ─── Settings Sign Out ──────────────────────────────────────── */
.signout-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--red-light);
  background: transparent;
  color: var(--red);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.signout-btn:active {
  transform: scale(0.98);
  background: rgba(225, 112, 85, 0.08);
}

.settings-tutorial-btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.15s;
}

.settings-tutorial-btn:active {
  transform: scale(0.98);
  background: var(--bg-secondary);
}

.settings-user-email {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 16px;
  word-break: break-all;
}

/* ─── PIN Lock Screen ────────────────────────────────────────── */
.pin-lock-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
}

.pin-lock-card {
  width: 100%;
  max-width: 360px;
  text-align: center;
  animation: slideIn 0.3s ease;
}

.pin-lock-logo {
  margin-bottom: 32px;
}

.pin-lock-logo h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--purple);
  margin: 0;
}

.pin-logo {
  font-size: 28px;
  font-weight: 800;
  color: var(--purple);
  letter-spacing: -0.8px;
}

.pin-lock-logo p {
  font-size: 16px;
  color: var(--text-light);
  margin-top: 4px;
}

.pin-kid-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.pin-kid-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow);
}

.pin-kid-btn:active {
  transform: scale(0.98);
  border-color: var(--purple);
}

.pin-kid-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}

.pin-kid-avatar.large {
  width: 64px;
  height: 64px;
  font-size: 28px;
  margin: 0 auto 8px;
}

.pin-kid-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.pin-dots {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 24px 0;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  transition: all 0.15s;
}

.pin-dot.filled {
  background: var(--purple);
  border-color: var(--purple);
}

.pin-error {
  color: var(--red);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  animation: shake 0.4s ease;
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 280px;
  margin: 0 auto 24px;
}

.pin-key {
  height: 56px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--card);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.1s;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pin-key:active {
  transform: scale(0.93);
  background: var(--bg);
}

.pin-key-spacer {
  visibility: hidden;
}

.pin-back-btn {
  background: none;
  border: none;
  color: var(--purple);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  margin-bottom: 8px;
}

.pin-parent-btn {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 14px;
  cursor: pointer;
  padding: 12px;
  font-weight: 500;
}

.pin-parent-btn:active {
  color: var(--purple);
}

/* ─── Settings PIN Input ─────────────────────────────────────── */
.settings-pin-input {
  width: 80px !important;
  flex: 0 0 80px !important;
  text-align: center;
  letter-spacing: 4px;
  font-size: 16px;
  font-weight: 600;
  padding: 10px 8px !important;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  outline: none;
}

.settings-pin-input:focus {
  border-color: var(--purple);
}

.settings-pin-input::placeholder {
  letter-spacing: 1px;
  font-size: 12px;
  font-weight: 400;
}

.settings-pin-input.parent-pin {
  width: 120px !important;
  flex: 0 0 120px !important;
  letter-spacing: 8px;
  font-size: 18px;
}

.pin-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pin-toggle-vis {
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.15s;
  flex-shrink: 0;
  padding: 0;
}

.pin-toggle-vis:active {
  background: var(--bg);
  color: var(--purple);
}

/* ─── Toggle Switch ──────────────────────────────────────────── */
.payment-handle-row {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: var(--card);
}

.payment-handle-prefix {
  padding: 9px 10px;
  background: var(--bg-secondary);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-right: 1.5px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
}

.payment-handle-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  background: transparent;
  color: var(--text);
}

.payment-handle-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 15px;
  font-weight: 500;
}

.toggle-switch {
  width: 52px;
  height: 30px;
  border-radius: 15px;
  border: none;
  background: var(--border);
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  padding: 0;
  flex-shrink: 0;
}

.toggle-switch.active {
  background: var(--green);
}

.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch.active .toggle-knob {
  transform: translateX(22px);
}

/* ─── Activity Sub-tabs ──────────────────────────────────────── */
.activity-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.activity-tab {
  flex: 1;
  padding: 9px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.activity-tab.active {
  border-color: var(--purple);
  color: var(--purple);
  background: rgba(108, 92, 231, 0.07);
}

/* ─── Recurring Cards (Activity tab) ────────────────────────── */
.recurring-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recurring-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-secondary);
  border-radius: 14px;
  padding: 14px;
}

.recurring-card.inactive {
  opacity: 0.5;
}

.recurring-card-icon {
  font-size: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.recurring-card-icon.income { background: rgba(0, 184, 148, 0.15); }
.recurring-card-icon.expense { background: rgba(225, 112, 85, 0.15); }

.recurring-card-body {
  flex: 1;
  min-width: 0;
}

.recurring-card-name {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recurring-card-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.recurring-card-next {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

.recurring-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ─── Recurring Activities ───────────────────────────────────── */
.recurring-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.recurring-item.inactive {
  opacity: 0.5;
}

.recurring-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.recurring-icon.income {
  background: rgba(76, 175, 80, 0.15);
}

.recurring-icon.expense {
  background: rgba(244, 67, 54, 0.15);
}

.recurring-details {
  flex: 1;
  min-width: 0;
}

.recurring-desc {
  font-weight: 500;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recurring-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.recurring-next {
  font-size: 12px;
  color: var(--text-tertiary, var(--text-secondary));
  margin-top: 2px;
}

.recurring-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ─── Settings Nav Button ────────────────────────────────────── */
.settings-nav-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border: none;
  border-radius: 12px;
  font-size: 15px;
  cursor: pointer;
  color: var(--text-primary);
}

.settings-nav-count {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ─── Back Button Row ─────────────────────────────────────────── */
.page-back-btn-row {
  padding: 4px 0 8px;
}

.page-back-btn {
  background: none;
  border: none;
  font-size: 15px;
  color: var(--purple);
  cursor: pointer;
  padding: 4px 0;
}

/* ─── Chore Template List ────────────────────────────────────── */
.chore-template-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chore-template-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-secondary);
  gap: 8px;
}

.chore-template-row:not(:last-child) {
  margin-bottom: 4px;
}

.chore-template-info {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.chore-template-info > span {
  display: inline;
}

.chore-template-flags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.chore-flag-btn {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.chore-flag-btn.active {
  background: var(--purple);
  color: white;
  border-color: var(--purple);
}

.chore-template-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chore-template-amount {
  font-size: 13px;
  color: var(--green);
  font-weight: 600;
  flex-shrink: 0;
}

.chore-template-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.chore-template-add-btn {
  background: var(--purple);
  color: white;
  border: none;
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.chip-amount {
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
}

/* ─── Chore Progress Banner ──────────────────────────────────── */
.chore-progress-banner {
  background: linear-gradient(135deg, var(--purple) 0%, #a29bfe 100%);
  border-radius: 16px;
  padding: 16px;
  color: white;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

.chore-level-badge {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.chore-level-name {
  font-size: 14px;
  opacity: 0.9;
  margin-top: -4px;
}

.chore-progress-bar-wrap {
  background: rgba(255,255,255,0.25);
  border-radius: 99px;
  height: 10px;
  overflow: hidden;
  margin-top: 2px;
}

.chore-progress-bar-fill {
  height: 100%;
  background: white;
  border-radius: 99px;
  transition: width 0.4s ease;
}

.chore-progress-label {
  font-size: 12px;
  opacity: 0.85;
}

/* ─── Chore Balance Row ───────────────────────────────────────── */
.chore-balance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.chore-balance-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.chore-balance-amount {
  font-size: 20px;
  font-weight: 700;
}

/* ─── Chore Cards (Kid View) ─────────────────────────────────── */
.chore-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.chore-card {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.chore-card.available {
  border: 2px solid var(--green);
}

.chore-card.pending {
  border: 2px solid var(--yellow);
  opacity: 0.8;
}

.chore-card.do-again {
  border: 2px solid var(--purple);
  opacity: 0.9;
}

.chore-card.add-from-template {
  border: 2px dashed var(--text-muted);
  opacity: 0.9;
}

.chore-auto-badge {
  font-size: 11px;
  color: var(--yellow);
  font-weight: 600;
}

.chore-done-btn.secondary {
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
}

.toggle-row {
  margin-bottom: 10px;
}

.toggle-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.toggle-label input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--purple);
}

.toggle-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-text strong {
  font-size: 14px;
}

.toggle-text small {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.chore-card-icon {
  font-size: 28px;
}

.chore-card-name {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
}

.chore-card-amount {
  font-size: 18px;
  font-weight: 700;
  color: var(--green);
}

.chore-card-status {
  font-size: 11px;
  color: var(--text-secondary);
}

.chore-card-after {
  font-size: 12px;
  color: var(--green);
  font-weight: 600;
}

/* ─── Chore Approval Cards (Parent View) ─────────────────────── */
.chore-approvals-section {
  background: rgba(253, 203, 110, 0.12);
  border-radius: 16px;
  padding: 12px;
  border: 1px solid rgba(253, 203, 110, 0.4);
}

.chore-approval-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chore-approval-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border-radius: 12px;
  padding: 12px 14px;
  gap: 12px;
}

.chore-approval-info {
  flex: 1;
  min-width: 0;
}

.chore-approval-name {
  font-weight: 600;
  font-size: 15px;
}

.chore-approval-kid {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.chore-approval-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.chore-approve-btn {
  background: var(--green);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.chore-reject-btn {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ─── Chore Items ────────────────────────────────────────────── */
.chore-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chore-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  gap: 12px;
}

.chore-item.pending {
  opacity: 0.7;
}

.chore-item.approval {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.chore-pending-item {
  background: rgba(255, 193, 7, 0.08) !important;
  border: 1px solid rgba(255, 193, 7, 0.25) !important;
}

.chore-info {
  flex: 1;
  min-width: 0;
}

.chore-name {
  font-weight: 500;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chore-amount {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.chore-done-btn {
  background: var(--green);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.chore-skip-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 8px;
  margin-top: 2px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chore-edit-btn {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  opacity: 0.6;
}

.chore-pending-badge {
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
  text-align: right;
  max-width: 110px;
}

.chore-approval-btns {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.chore-approve-btn {
  background: var(--green);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chore-reject-btn {
  background: var(--red);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.approval-badge {
  background: var(--red);
  color: white;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 12px;
  font-weight: 700;
}

/* ─── Parent Unlock Modal ────────────────────────────────────── */
.parent-unlock-box {
  text-align: left;
  max-width: 320px;
}
