@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700;800;900&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #6C63FF;
  --primary-light: #EEF0FF;
  --give-color: #E8634A;
  --give-bg: #FFEDE8;
  --save-color: #27AE7A;
  --save-bg: #E3F5EE;
  --spend-color: #3B82F6;
  --spend-bg: #E8F1FD;
  --bg: #F8F9FC;
  --card-bg: #FFFFFF;
  --text: #1A202C;
  --text-muted: #718096;
  --border: #E2E8F0;
  --radius: 16px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  -webkit-font-smoothing: antialiased;
}

/* ── Screens ── */
.screen {
  display: none;
  min-height: 100vh;
  padding: 24px 20px 130px;
  flex-direction: column;
}

.screen.active {
  display: flex;
  animation: screenFadeIn 200ms ease both;
}

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

/* ── Utility ── */
.hidden {
  display: none !important;
}

/* ── Buttons ── */
.btn {
  display: block;
  width: 100%;
  padding: 15px 20px;
  min-height: 48px;
  border: none;
  border-radius: 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  text-align: center;
  line-height: 1;
}

.btn:active {
  opacity: 0.85;
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-secondary {
  background: var(--primary-light);
  color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  padding: 10px;
}

/* ── Forms ── */
.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select {
  width: 100%;
  padding: 13px 16px;
  min-height: 48px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

input:focus,
select:focus {
  border-color: var(--primary);
}

.error-msg {
  color: #E53E3E;
  font-size: 13px;
  font-weight: 700;
  margin-top: 10px;
  min-height: 18px;
}

/* ── Screen A: Auth ── */
.auth-logo {
  text-align: center;
  margin: 32px 0 36px;
}

.auth-logo h1 {
  font-size: 40px;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -1px;
}

.auth-logo p {
  color: var(--text-muted);
  font-size: 15px;
  margin-top: 6px;
  font-weight: 400;
}

.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 28px;
}

.auth-tab {
  flex: 1;
  padding: 14px;
  min-height: 48px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.auth-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ── Screen B: Child Setup ── */
.screen-header {
  margin-bottom: 28px;
}

.screen-title {
  font-size: 26px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.5px;
}

.screen-subtitle {
  color: var(--text-muted);
  font-size: 15px;
  margin-top: 6px;
  font-weight: 400;
}

.add-child-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.add-child-row input {
  flex: 1;
}

.add-child-row .btn {
  width: auto;
  flex-shrink: 0;
  padding: 13px 22px;
}

.child-setup-list {
  flex: 1;
  margin-bottom: 24px;
}

.child-setup-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  font-weight: 700;
  font-size: 15px;
  box-shadow: var(--shadow);
}

.child-setup-item .item-avatar {
  font-size: 28px;
}

/* ── Screen C: Child Selector ── */
.selector-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
}

.child-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.child-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px 16px 22px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
  border: 2px solid transparent;
  min-height: 48px;
}

.child-card:active {
  transform: scale(0.96);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.child-card:hover {
  border-color: var(--primary-light);
}

.child-avatar-placeholder {
  font-size: 44px;
  margin-bottom: 10px;
  line-height: 1;
}

/* Child card avatar circle */
.child-card-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  font-size: 34px;
  position: relative;
  flex-shrink: 0;
}

.child-card-avatar .child-acc {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 18px;
  line-height: 1;
}

.child-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

/* ── Screen D: Dashboard ── */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.greeting {
  font-size: 28px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.5px;
}

.greeting-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 400;
}

/* Avatar in header */
.avatar-circle {
  width: 56px;
  height: 56px;
  min-height: 56px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  position: relative;
  border: none;
  cursor: pointer;
  transition: transform 0.15s;
  padding: 0;
}

.avatar-circle:active {
  transform: scale(0.92);
}

.avatar-creature {
  font-size: 28px;
  line-height: 1;
}

.avatar-accessory {
  position: absolute;
  top: -2px;
  right: -2px;
  font-size: 16px;
  line-height: 1;
}

/* Empty state banner */
.empty-state-banner {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  border: 2px dashed var(--border);
}

.empty-state-emoji {
  font-size: 40px;
  margin-bottom: 10px;
}

.empty-state-msg {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1.5;
}

.empty-state-msg strong {
  color: var(--primary);
}

/* Bucket Cards */
.bucket-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.bucket-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 18px;
  border-left: 4px solid transparent;
  transition: transform 0.15s, box-shadow 0.3s;
}

.bucket-card.give  {
  background: var(--give-bg);
  border-left-color: var(--give-color);
}
.bucket-card.save  {
  background: var(--save-bg);
  border-left-color: var(--save-color);
}
.bucket-card.spend {
  background: var(--spend-bg);
  border-left-color: var(--spend-color);
}

/* Card glow animation after deposit */
@keyframes cardGlow {
  0%   { box-shadow: var(--shadow); }
  40%  { box-shadow: 0 0 0 4px var(--glow-color), 0 4px 20px var(--glow-color); transform: scale(1.015); }
  100% { box-shadow: var(--shadow); transform: scale(1); }
}

@keyframes savePulse {
  0%, 100% { transform: scale(1); }
  30%       { transform: scale(1.025); }
  60%       { transform: scale(1.01); }
}

.bucket-card.glow-give  {
  --glow-color: rgba(232, 99, 74, 0.35);
  animation: cardGlow 0.8s ease forwards;
}
.bucket-card.glow-save  {
  --glow-color: rgba(39, 174, 122, 0.35);
  animation: cardGlow 0.8s ease forwards, savePulse 0.9s ease forwards;
}
.bucket-card.glow-spend {
  --glow-color: rgba(59, 130, 246, 0.35);
  animation: cardGlow 0.8s ease forwards;
}

.bucket-icon {
  font-size: 34px;
  line-height: 1;
  flex-shrink: 0;
}

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

.bucket-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 2px;
}

.bucket-balance-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.bucket-balance {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1.1;
}

.bucket-apy {
  font-size: 12px;
  color: var(--save-color);
  font-weight: 700;
  margin-top: 3px;
}

.bucket-interest {
  font-size: 12px;
  color: var(--save-color);
  font-weight: 600;
  margin-top: 2px;
  opacity: 0.8;
}

/* ── Add Money FAB ── */
.add-money-fab {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 56px;
  padding: 18px 32px;
  min-height: 56px;
  font-family: 'Nunito', sans-serif;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(108, 99, 255, 0.35);
  width: 100%;
  margin-bottom: 20px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.add-money-fab:active {
  transform: scale(0.97);
  box-shadow: 0 4px 12px rgba(108, 99, 255, 0.25);
}

.fab-plus {
  font-size: 22px;
  line-height: 1;
}

/* ── Bottom Nav ── */
.bottom-nav {
  display: flex;
  background: #fff;
  border-top: 1px solid var(--border);
  border-radius: 0;
  padding: 4px 4px max(8px, env(safe-area-inset-bottom));
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
  gap: 2px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px;
  min-height: 56px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.15s;
  gap: 3px;
}

.nav-item.active {
  background: var(--primary-light);
}

.nav-icon {
  font-size: 20px;
  line-height: 1;
}

.nav-label {
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

.nav-item.active .nav-label {
  color: var(--primary);
}

/* ── Switch Child ── */
.switch-child-row {
  text-align: center;
  margin-top: auto;
  padding-bottom: 12px;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  padding: 0;
}

.modal-overlay.hidden {
  display: none;
}

.modal-sheet {
  background: var(--card-bg);
  border-radius: 24px 24px 0 0;
  padding: 28px 20px 40px;
  width: 100%;
  max-width: 480px;
  max-height: 94vh;
  overflow-y: auto;
  animation: sheetSlideUp 220ms ease both;
}

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

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

.modal-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
}

.modal-close {
  background: var(--bg);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background 0.15s;
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--border);
}

/* ── Pie Chart ── */
.pie-chart-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.deposit-pie {
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}

#pie-give, #pie-save, #pie-spend {
  transition: stroke-dasharray 0.25s ease, stroke-dashoffset 0.25s ease;
}

.pie-labels {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pie-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pie-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pie-label-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  flex: 1;
}

.pie-label-amt {
  font-size: 14px;
  font-weight: 800;
}
.pie-label-amt.give  { color: var(--give-color); }
.pie-label-amt.save  { color: var(--save-color); }
.pie-label-amt.spend { color: var(--spend-color); }

/* ── Deposit Streams Animation ── */
.deposit-streams {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.stream {
  position: absolute;
  top: 50%;
  left: 55px; /* center of pie */
  width: 6px;
  border-radius: 3px;
  transform-origin: top center;
  opacity: 0;
}

.give-stream  { background: var(--give-color); }
.save-stream  { background: var(--save-color); }
.spend-stream { background: var(--spend-color); }

/* Particle dots */
.stream-dot {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
}

@keyframes dotBurst {
  0%   { transform: translate(0, 0) scale(0.5); opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Split row flash animation */
@keyframes rowFlash {
  0%   { background: transparent; border-radius: 10px; }
  30%  { background: var(--flash-bg); border-radius: 10px; }
  100% { background: transparent; border-radius: 10px; }
}

.split-row-flash-give  {
  --flash-bg: var(--give-bg);
  animation: rowFlash 0.7s ease forwards;
}
.split-row-flash-save  {
  --flash-bg: var(--save-bg);
  animation: rowFlash 0.7s ease forwards;
}
.split-row-flash-spend {
  --flash-bg: var(--spend-bg);
  animation: rowFlash 0.7s ease forwards;
}

/* ── Split Section with Sliders ── */
.split-section {
  background: var(--bg);
  border-radius: 14px;
  padding: 16px 16px 12px;
  margin-bottom: 20px;
}

.split-bucket-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding: 4px 6px;
  border-radius: 10px;
  transition: background 0.2s;
}

.split-b-emoji {
  font-size: 16px;
  flex-shrink: 0;
}

.split-b-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  flex: 1;
}

.split-b-amount {
  font-size: 15px;
  font-weight: 800;
}

.split-b-amount.give  { color: var(--give-color);  }
.split-b-amount.save  { color: var(--save-color);  }
.split-b-amount.spend { color: var(--spend-color); }

.split-b-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 32px;
  text-align: right;
}

/* ── Range Sliders ── */
.split-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  margin-bottom: 14px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.split-slider:last-of-type {
  margin-bottom: 0;
}

.split-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.split-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.give-slider::-webkit-slider-thumb  { background: var(--give-color);  }
.give-slider::-moz-range-thumb      { background: var(--give-color);  }
.save-slider::-webkit-slider-thumb  { background: var(--save-color);  }
.save-slider::-moz-range-thumb      { background: var(--save-color);  }
.spend-slider::-webkit-slider-thumb { background: var(--spend-color); }
.spend-slider::-moz-range-thumb     { background: var(--spend-color); }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #1A202C;
  color: #fff;
  padding: 12px 22px;
  border-radius: 24px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 300;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Loading spinner ── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

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

/* ══════════════════════════════════════════════
   Screen E — Transaction History
══════════════════════════════════════════════ */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 10px 14px;
  min-height: 40px;
  border: 2px solid var(--border);
  border-radius: 24px;
  background: var(--card-bg);
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.tx-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.tx-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 700;
  padding: 40px 20px;
  line-height: 1.5;
}

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

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

.tx-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-interest-label {
  color: var(--save-color);
}

.tx-give-label {
  color: var(--give-color);
}

.tx-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.tx-bucket-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg);
}

.tx-bucket-tag.give  { color: var(--give-color);  }
.tx-bucket-tag.save  { color: var(--save-color);  }
.tx-bucket-tag.spend { color: var(--spend-color); }

.tx-date {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

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

.tx-positive { color: var(--save-color); }
.tx-negative { color: var(--give-color); }

/* ══════════════════════════════════════════════
   Screen F — Move Money
══════════════════════════════════════════════ */
#move-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.move-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 2px solid transparent;
  min-height: 72px;
}

.move-card:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.move-card:hover {
  border-color: var(--primary-light);
}

.move-card-icon {
  font-size: 30px;
  flex-shrink: 0;
}

.move-card-body {
  flex: 1;
}

.move-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.move-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 400;
}

.move-card-chevron {
  font-size: 22px;
  color: var(--text-muted);
  font-weight: 300;
  flex-shrink: 0;
}

/* Sub-forms */
.sub-form {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.sub-form.hidden {
  display: none !important;
}

.back-btn {
  background: none;
  border: none;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
  min-height: 48px;
  margin-bottom: 8px;
  align-self: flex-start;
}

.sub-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 16px;
}

.balance-hint {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 8px;
  margin-bottom: 4px;
}

/* Bucket picker */
.bucket-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bucket-pick-btn {
  flex: 1;
  padding: 12px 8px;
  min-height: 48px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  white-space: nowrap;
}

.bucket-pick-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* ══════════════════════════════════════════════
   Avatar Picker Modal
══════════════════════════════════════════════ */
.avatar-preview-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.avatar-preview-circle {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  position: relative;
  border: 3px solid rgba(0,0,0,0.06);
  transition: background-color 0.2s;
}

.avatar-preview-creature {
  font-size: 44px;
  line-height: 1;
}

.avatar-preview-accessory {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 26px;
  line-height: 1;
}

.avatar-section-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  margin-top: 16px;
}

/* Creature grid */
.creature-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}

.creature-btn {
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 12px;
  background: var(--bg);
  font-size: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
  padding: 0;
}

.creature-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.creature-btn:active {
  transform: scale(0.9);
}

/* Color grid */
.color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}

.color-swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  outline: none;
  padding: 0;
}

.color-swatch.selected {
  border-color: var(--primary);
  transform: scale(1.15);
}

.color-swatch:active {
  transform: scale(0.9);
}

/* Accessory grid */
.accessory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}

.accessory-btn {
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 12px;
  background: var(--bg);
  font-size: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
  padding: 0;
}

.accessory-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.accessory-btn:active {
  transform: scale(0.9);
}

/* "None" accessory option */
.accessory-btn.none-btn {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════
   Phase 3.5 — PIN System & Approval Flow
══════════════════════════════════════════════ */

/* ── Dashboard header actions ── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg);
  border: none;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.15s;
  flex-shrink: 0;
}

.settings-btn:active {
  transform: scale(0.9);
  background: var(--border);
}

/* ── Pending amount on bucket cards ── */
.pending-amount {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── PIN Setup Screen ── */
.pin-setup-screen {
  justify-content: space-between;
  align-items: center;
  text-align: center;
  padding-bottom: 40px;
}

.pin-setup-top {
  padding-top: 32px;
}

.pin-lock-icon {
  font-size: 52px;
  margin-bottom: 16px;
}

/* ── PIN dots ── */
.pin-dots-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.pin-dots {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.pin-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  background: transparent;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.pin-dot.filled {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.1);
}

.pin-dot.error {
  background: #E53E3E;
  border-color: #E53E3E;
}

.pin-step-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

.pin-error {
  font-size: 13px;
  font-weight: 800;
  color: #E53E3E;
  text-align: center;
}

.pin-lockout {
  font-size: 13px;
  font-weight: 700;
  color: #E53E3E;
  text-align: center;
  padding: 8px 16px;
  background: #FFF5F5;
  border-radius: 10px;
}

/* ── PIN Keypad ── */
.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

.pin-key {
  aspect-ratio: 1;
  border: none;
  border-radius: 50%;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  font-family: 'Nunito', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: background 0.1s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pin-key:active {
  background: var(--primary-light);
  transform: scale(0.92);
}

.pin-key-back {
  background: transparent;
  box-shadow: none;
  font-size: 20px;
  color: var(--text-muted);
}

.pin-key-back:active {
  background: var(--bg);
}

.pin-key-empty {
  /* placeholder for the empty bottom-left cell */
}

.pin-key[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ── PIN modal sheet ── */
.pin-modal-sheet {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding-bottom: 36px;
}

.pin-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 4px;
}

.forgot-pin-link {
  background: none;
  border: none;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Approval Modal ── */
.approval-summary {
  background: var(--bg);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
  text-align: center;
}

.approval-amount {
  font-size: 32px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -1px;
}

.approval-desc {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

.approval-splits {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 8px;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.approval-split-chip {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
}
.approval-split-chip.give  { background: var(--give-bg);  color: var(--give-color); }
.approval-split-chip.save  { background: var(--save-bg);  color: var(--save-color); }
.approval-split-chip.spend { background: var(--spend-bg); color: var(--spend-color); }

.approval-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.approval-option-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  min-height: 72px;
}

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

.approve-now-btn {
  border-color: var(--primary);
  background: var(--primary-light);
}

.approve-now-btn:active {
  background: #dddcff;
}

.send-parent-btn:active {
  background: var(--bg);
}

.approval-option-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.approval-option-body {
  flex: 1;
}

.approval-option-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.approval-option-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 400;
}

/* ── Transaction status badges ── */
.tx-status-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.tx-status-badge.pending {
  background: #FFF3CD;
  color: #856404;
}

.tx-status-badge.denied {
  background: #FFF5F5;
  color: #C53030;
}

.tx-parent-note {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
}

/* ── Settings Screen ── */
.back-icon-btn {
  background: none;
  border: none;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  cursor: pointer;
  padding: 8px;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  transition: background 0.15s;
}

.back-icon-btn:active {
  background: var(--primary-light);
}

.settings-section-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.settings-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.15s;
  min-height: 64px;
  margin-bottom: 10px;
}

.settings-card:active {
  background: var(--bg);
}

.settings-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.settings-card-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.settings-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.settings-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 400;
}

.settings-card-chevron {
  font-size: 22px;
  color: var(--text-muted);
  font-weight: 300;
}

/* ── PIN change sub-steps in settings ── */
.pin-change-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
}

/* ══════════════════════════════════════════════════════════════════
   PHASE 4 — Parent Dashboard, Family Settings, Charts, Ledger, Coins
   ══════════════════════════════════════════════════════════════════ */

/* ── Nav badge ── */
.nav-badge {
  position: absolute;
  top: 2px;
  right: 4px;
  background: #E8634A;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}
.nav-item { position: relative; }

/* ── Save stats on bucket card ── */
.save-stat {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
  line-height: 1.4;
}

/* ── History controls row ── */
.history-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}
.view-toggle {
  display: flex;
  gap: 6px;
  padding: 0 2px;
}
.view-toggle-btn {
  flex: 1;
  padding: 7px 0;
  border: 1.5px solid #A0AEC0;
  background: #fff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #4A5568;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.view-toggle-btn.active {
  background: #3730A3;
  border-color: #3730A3;
  color: #fff;
  box-shadow: 0 2px 6px rgba(55, 48, 163, 0.35);
}

/* ── Ledger view ── */
.tx-ledger { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.ledger-scroll-wrap { overflow-x: auto; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.ledger-table { width: 100%; border-collapse: collapse; min-width: 340px; font-size: 13px; }
.ledger-head-row th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
  padding: 10px 8px;
  text-align: right;
  font-weight: 800;
  font-size: 12px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.ledger-head-row th.ledger-col-label { text-align: left; min-width: 120px; }
.ledger-head-row th.ledger-col-bucket.give  { color: #E8634A; }
.ledger-head-row th.ledger-col-bucket.save  { color: #27AE7A; }
.ledger-head-row th.ledger-col-bucket.spend { color: #3B82F6; }
.ledger-col-bucket { width: 72px; }

.ledger-body-row td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.ledger-body-row:last-child td { border-bottom: none; }
.ledger-tx-label { font-weight: 700; font-size: 13px; color: var(--text-main); }
.ledger-tx-date  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.ledger-tx-badge { display: inline-block; font-size: 10px; margin-top: 2px; }
.ledger-amt { text-align: right; font-weight: 700; white-space: nowrap; }
.ledger-amt.pos-give   { color: #E8634A; }
.ledger-amt.pos-save   { color: #27AE7A; }
.ledger-amt.pos-spend  { color: #3B82F6; }
.ledger-amt.neg        { color: #E05252; }
.ledger-amt.dash       { color: var(--border); font-weight: 400; }
.ledger-amt.muted      { color: var(--text-muted); }

.ledger-foot-row td {
  position: sticky;
  bottom: 0;
  background: #F8F9FC;
  padding: 10px 8px;
  border-top: 2px solid var(--border);
  font-weight: 800;
  font-size: 13px;
}
.ledger-foot-label { color: var(--text-muted); text-align: left; }
.ledger-foot-amt   { text-align: right; }
.ledger-foot-amt.give  { color: #E8634A; }
.ledger-foot-amt.save  { color: #27AE7A; }
.ledger-foot-amt.spend { color: #3B82F6; }

/* ── Family Hub ── */
.family-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.family-section-label {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.family-pending-count {
  background: #E8634A;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
}
.family-empty-state {
  text-align: center;
  padding: 24px 16px;
  color: #27AE7A;
  font-weight: 700;
  font-size: 15px;
  background: #E3F5EE;
  border-radius: 14px;
  border: 1.5px solid #27AE7A30;
}
.family-empty-state.loading { color: var(--text-muted); background: transparent; border: none; }

/* Pending approval card */
.approval-card {
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.approval-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.approval-card-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.approval-card-meta { flex: 1; min-width: 0; }
.approval-card-child { font-size: 14px; font-weight: 800; color: var(--text-main); }
.approval-card-type  { font-size: 12px; color: var(--text-muted); }
.approval-card-time  { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.approval-card-amount {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 6px;
}
.approval-card-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.approval-card-splits {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.approval-card-actions {
  display: flex;
  gap: 8px;
}
.approve-action-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}
.approve-action-btn:active { opacity: 0.75; }
.approve-action-btn.approve {
  background: var(--save-bg);
  color: #27AE7A;
  border: 1.5px solid #27AE7A40;
}
.approve-action-btn.deny {
  background: #FFF0EE;
  color: #E8634A;
  border: 1.5px solid #E8634A30;
}

/* Family overview */
.family-overview-child {
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  padding: 12px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.family-overview-info { flex: 1; }
.family-overview-name { font-size: 15px; font-weight: 800; color: var(--text-main); margin-bottom: 4px; }
.family-overview-buckets { display: flex; gap: 10px; flex-wrap: wrap; }
.family-overview-bucket { font-size: 12px; font-weight: 700; }
.family-overview-bucket.give  { color: #E8634A; }
.family-overview-bucket.save  { color: #27AE7A; }
.family-overview-bucket.spend { color: #3B82F6; }

/* ── Family Settings ── */
.fam-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.fam-setting-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}
.fam-setting-input {
  width: 90px;
  text-align: right;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  color: var(--text-main);
  background: #F8F9FC;
}
.fam-setting-input:focus { outline: none; border-color: var(--purple); }
.fam-split-hint {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  color: var(--text-muted);
}
.fam-split-hint.error { color: #E8634A; }

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #CBD5E0;
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider:before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--purple); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }

/* Invite code */
.invite-code-display {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--purple);
  flex: 1;
}
.copy-btn {
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

/* Manage children list */
.manage-child-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  padding: 10px 14px;
  margin-bottom: 8px;
}
.manage-child-name-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  color: var(--text-main);
  padding: 0;
}
.manage-child-name-input:focus { outline: none; border-bottom: 1.5px solid var(--purple); }
.manage-child-delete-btn {
  background: #FFF0EE;
  color: #E8634A;
  border: 1.5px solid #E8634A30;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

/* Deny modal */
.deny-summary {
  background: #FFF5F3;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}
.btn-danger {
  background: #E8634A;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 800;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
  margin-top: 8px;
}
.btn-danger:active { opacity: 0.85; }

/* ── Portfolio / Charts ── */
#screen-portfolio { overflow-y: auto; }
.chart-section {
  background: #fff;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  padding: 16px;
  margin-bottom: 16px;
}
.chart-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.chart-wrap {
  position: relative;
  height: 160px;
}
.chart-empty {
  text-align: center;
  padding: 32px 0;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

/* ── Coin animation overlay ── */
#coin-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 998;
  overflow: hidden;
}
.coin {
  position: absolute;
  font-size: 20px;
  opacity: 0;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
  will-change: transform, opacity;
  line-height: 1;
}

/* ══════════════════════════════════════════════════════
   PARENT MODE
══════════════════════════════════════════════════════ */

/* Family tab: hidden in Kid Mode, visible in Parent Mode */
.family-nav-item {
  display: none !important;
}
body.parent-mode .family-nav-item {
  display: flex !important;
}

/* Lock button: subtle in kid mode */
#parent-mode-btn {
  opacity: 0.45;
  font-size: 15px;
  transition: opacity 0.2s;
}
#parent-mode-btn:hover,
#parent-mode-btn:active {
  opacity: 1;
}
body.parent-mode #parent-mode-btn {
  opacity: 0;
  pointer-events: none;
}

/* Parent mode bar */
.parent-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #6C63FF22 0%, #A78BFA22 100%);
  border: 1.5px solid #6C63FF44;
  border-radius: 10px;
  padding: 7px 14px;
  margin: 0 0 14px 0;
  animation: parentBarIn 0.25s ease;
}
@keyframes parentBarIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.parent-mode-label {
  font-size: 13px;
  font-weight: 700;
  color: #6C63FF;
  letter-spacing: 0.01em;
}
.parent-mode-exit-btn {
  background: none;
  border: 1.5px solid #6C63FF;
  color: #6C63FF;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.parent-mode-exit-btn:hover {
  background: #6C63FF;
  color: #fff;
}

/* ══════════════════════════════════════════════════════
   ODOMETER DIGIT ANIMATION
══════════════════════════════════════════════════════ */

@keyframes od-roll-up {
  from { transform: translateY(0.75em); opacity: 0; }
  to   { transform: translateY(0);      opacity: 1; }
}
@keyframes od-roll-down {
  from { transform: translateY(-0.75em); opacity: 0; }
  to   { transform: translateY(0);       opacity: 1; }
}

/* Wraps each character in the balance display */
.od-char {
  display: inline-block;
}
.od-char.od-up {
  animation: od-roll-up 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.od-char.od-down {
  animation: od-roll-down 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Pending amount line slide animations (whole-line, muted) */
@keyframes pending-slide-up-anim {
  from { transform: translateY(0.5em); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
@keyframes pending-slide-down-anim {
  from { transform: translateY(-0.5em); opacity: 0; }
  to   { transform: translateY(0);      opacity: 1; }
}
.pending-slide-up {
  animation: pending-slide-up-anim 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.pending-slide-down {
  animation: pending-slide-down-anim 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Bucket balance direction arrow */
.bucket-delta-arrow {
  display: inline-block;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  margin-left: 6px;
  vertical-align: middle;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.bucket-delta-arrow.arrow-visible {
  opacity: 1;
  animation: arrow-flash 0.4s ease-in-out infinite alternate;
}
.bucket-delta-arrow.arrow-fade {
  opacity: 0;
  transition: opacity 0.6s ease;
}
.bucket-delta-arrow.up   { color: #27AE7A; }
.bucket-delta-arrow.down { color: #E05252; }
@keyframes arrow-flash {
  from { opacity: 0.55; transform: translateY(0); }
  to   { opacity: 1;    transform: translateY(-3px); }
}

/* ══════════════════════════════════════════════════════════
   Goals System
══════════════════════════════════════════════════════════ */

/* Section labels */
.goals-section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ── Active Goal Cards ── */
.goal-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  position: relative;
}
.goal-card.give  { border-color: #FFCBBC; }
.goal-card.save  { border-color: #A8E6C8; }
.goal-card.spend { border-color: #BFDBFE; }

.goal-card.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  background: transparent;
  border-style: dashed;
  border-width: 2px;
  cursor: pointer;
}
.goal-card.empty.give  { border-color: #E8634A; }
.goal-card.empty.save  { border-color: #27AE7A; }
.goal-card.empty.spend { border-color: #3B82F6; }

.goal-card-bucket-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.goal-add-btn {
  font-size: 40px;
  line-height: 1;
  padding: 4px;
  margin-bottom: 4px;
  pointer-events: none; /* card handles the click */
}
.goal-card.empty:active .goal-add-btn { transform: scale(0.9); }

.goal-add-label {
  font-size: 13px;
  font-weight: 700;
}

.goal-card-emoji {
  font-size: 36px;
  text-align: center;
  margin: 4px 0 6px;
  line-height: 1;
}
.goal-card-name {
  font-size: 17px;
  font-weight: 800;
  text-align: center;
  color: var(--text);
  margin-bottom: 12px;
}

/* Progress thermometer */
.goal-thermo-wrap {
  background: var(--border);
  border-radius: 99px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 6px;
}
.goal-thermo-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.22,1,0.36,1);
}
.goal-thermo-fill.give  { background: #E8634A; }
.goal-thermo-fill.save  { background: #27AE7A; }
.goal-thermo-fill.spend { background: #3B82F6; }

.goal-thermo-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

/* Completed banner on card */
.goal-complete-banner {
  text-align: center;
  font-size: 14px;
  font-weight: 900;
  padding: 6px 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #fff;
  letter-spacing: 0.3px;
}

/* Pulsing glow on completed cards */
@keyframes goal-complete-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,215,0,0.5); }
  70%  { box-shadow: 0 0 0 10px rgba(255,215,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,215,0,0); }
}
.goal-completed-glow {
  animation: goal-complete-pulse 1.8s ease-in-out infinite;
}

/* Redeem button */
.goal-redeem-btn {
  background: linear-gradient(135deg, #6C63FF, #A855F7);
  color: #fff;
  font-size: 14px;
  padding: 11px 0;
  margin-top: 6px;
}

/* ── Completed Goals List ── */
.goal-history-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.goal-history-emoji { font-size: 24px; flex-shrink: 0; }
.goal-history-info  { flex: 1; min-width: 0; }
.goal-history-name  { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal-history-date  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.goal-history-amount { font-size: 14px; font-weight: 800; flex-shrink: 0; }

/* ── Goal Creation Modal Steps ── */
.goal-step-hint {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.4;
}
.goal-emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.goal-emoji-btn {
  font-size: 26px;
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 8px 4px;
  cursor: pointer;
  transition: border-color 0.1s, transform 0.1s;
  line-height: 1;
}
.goal-emoji-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.12);
}
.goal-emoji-btn:active { transform: scale(0.9); }

/* Confirm step */
.goal-confirm-display {
  text-align: center;
  padding: 20px 0 8px;
}
.goal-confirm-emoji  { font-size: 60px; margin-bottom: 10px; line-height: 1; }
.goal-confirm-name   { font-size: 22px; font-weight: 900; color: var(--text); margin-bottom: 6px; }
.goal-confirm-amount { font-size: 28px; font-weight: 800; color: var(--primary); margin-bottom: 6px; }
.goal-confirm-bucket { font-size: 14px; color: var(--text-muted); font-weight: 700; }

/* ── Confetti Overlay ── */
#confetti-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -16px;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg) scale(0.6); opacity: 0; }
}

/* ── Mini Goal Progress on Bucket Cards ── */
.bucket-goal-mini {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.bucket-goal-mini-empty {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}
.bucket-goal-mini-header {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}
.bucket-goal-mini-emoji { font-size: 13px; flex-shrink: 0; }
.bucket-goal-mini-name  { font-size: 11px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bucket-goal-mini-bar-wrap {
  background: var(--border);
  border-radius: 99px;
  height: 5px;
  overflow: hidden;
  margin-bottom: 3px;
}
.bucket-goal-mini-bar {
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s ease;
}
.bucket-goal-mini-bar.give  { background: #E8634A; }
.bucket-goal-mini-bar.save  { background: #27AE7A; }
.bucket-goal-mini-bar.spend { background: #3B82F6; }
.bucket-goal-mini-pct {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
}

/* ── 6-tab parent mode nav tightening ── */
body.parent-mode .nav-item {
  padding: 8px 2px;
}
body.parent-mode .nav-icon { font-size: 18px; }
body.parent-mode .nav-label { font-size: 9px; }

/* Save Goal Destination Picker */
.goal-dest-cards {
  display: flex;
  gap: 12px;
}
.goal-dest-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  font-family: inherit;
}
.goal-dest-card:active { transform: scale(0.96); }
#goal-dest-spend:hover, #goal-dest-spend:focus { border-color: #3B82F6; background: #E8F1FD; }
#goal-dest-give:hover,  #goal-dest-give:focus  { border-color: #E8634A; background: #FFEDE8; }
.goal-dest-icon  { font-size: 36px; margin-bottom: 8px; line-height: 1; }
.goal-dest-label { font-size: 14px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.goal-dest-sub   { font-size: 12px; color: var(--text-muted); font-weight: 600; text-align: center; }

/* Dashboard mini-goal: "Set a goal" link style */
.bucket-goal-mini-link {
  color: var(--primary);
  font-weight: 700;
  font-size: 11px;
  transition: opacity 0.15s;
}
.bucket-goal-mini-link:hover { opacity: 0.75; }

/* Dashboard mini-goal: "Goal reached!" banner */
.bucket-goal-mini-reached {
  font-size: 11px;
  font-weight: 900;
  color: #B45309;
  background: #FEF3C7;
  border-radius: 6px;
  padding: 3px 7px;
  display: inline-block;
  margin-bottom: 5px;
  animation: mini-reached-pulse 2s ease-in-out infinite;
}
@keyframes mini-reached-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

/* Dashboard mini-goal: "Redeem Now" button */
.bucket-goal-redeem-btn {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 7px 0;
  border: none;
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.bucket-goal-redeem-btn:active { transform: scale(0.97); opacity: 0.85; }
.bucket-goal-redeem-btn.give  { background: #FFEDE8; color: #E8634A; }
.bucket-goal-redeem-btn.save  { background: #E3F5EE; color: #27AE7A; }
.bucket-goal-redeem-btn.spend { background: #E8F1FD; color: #3B82F6; }
