/* ============================================================
   KidBank - Stylesheet
   1. Design tokens
   2. Reset & base
   3. Utilities
   4. Auth screen
   5. Paywall screen
   6. Topbar & trial banner
   7. Cards, buttons, forms, badges
   8. Kid view
   9. Parent view
   10. Modals
   11. PIN pads & onboarding
   12. Toast
   13. Responsive
   ============================================================ */

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  --bg: #f6f7f9;
  --bg-elevated: #ffffff;
  --surface-muted: #f1f3f6;
  --ink: #0f172a;
  --ink-muted: #475569;
  --ink-subtle: #94a3b8;
  --ink-faint: #cbd5e1;
  --border: #e4e7ec;
  --border-strong: #d1d5db;
  --brand: #1e40af;
  --brand-hover: #1e3a8a;
  --brand-soft: #eef2ff;
  --brand-ink: #312e81;
  --success: #047857;
  --success-soft: #ecfdf5;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --info: #0369a1;
  --info-soft: #f0f9ff;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --shadow-xs: 0 1px 2px rgba(15,23,42,.04);
  --shadow-sm: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow-md: 0 4px 12px rgba(15,23,42,.06), 0 2px 4px rgba(15,23,42,.04);
  --shadow-lg: 0 12px 32px rgba(15,23,42,.12), 0 4px 8px rgba(15,23,42,.04);
  --shadow-xl: 0 24px 64px rgba(15,23,42,.18);
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Bricolage Grotesque', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
ul, ol { list-style: none; }

.screen { display: none; }
.screen.is-active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn  { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@keyframes spin   { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }

/* ============================================================
   3. UTILITIES
   ============================================================ */
.shell { max-width: 1120px; margin: 0 auto; padding: 24px; }
.hstack { display: flex; align-items: center; gap: 8px; }
.spacer { flex: 1; }
.muted { color: var(--ink-muted); }
.hide { display: none !important; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.icon { width: 16px; height: 16px; stroke-width: 1.75; stroke: currentColor; fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-lg { width: 20px; height: 20px; }
.icon-xl { width: 28px; height: 28px; }

/* ============================================================
   4. AUTH SCREEN
   ============================================================ */
#screen-auth {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top, rgba(30,64,175,.15), transparent 50%),
    radial-gradient(ellipse at bottom, rgba(4,120,87,.08), transparent 50%),
    linear-gradient(180deg, #0b1220 0%, #111827 100%);
}
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; }
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--bg-elevated);
  border-radius: var(--r-xl);
  padding: 36px 32px;
  box-shadow: var(--shadow-xl);
  animation: popIn .25s ease;
}
.auth-brand {
  font-family: var(--font-display); font-weight: 700; font-size: 26px;
  color: var(--ink); letter-spacing: -0.02em; text-align: center; margin-bottom: 4px;
}
.auth-brand em { color: var(--brand); font-style: normal; }
.auth-tag { text-align: center; color: var(--ink-muted); font-size: 13px; margin-bottom: 28px; }
.auth-heading { font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 20px; text-align: center; }
.auth-footer {
  text-align: center; margin-top: 20px; padding-top: 20px;
  border-top: 1px solid var(--border); font-size: 13px; color: var(--ink-muted);
}
.auth-footer a { font-weight: 600; }
#auth-loader { display: none; text-align: center; padding: 8px; }
#auth-loader.is-on { display: block; }
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid var(--ink-faint); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .7s linear infinite;
}
.auth-notice {
  display: none; padding: 10px 12px;
  background: var(--success-soft); color: var(--success);
  border-radius: var(--r-sm); font-size: 13px; font-weight: 500; margin-top: 12px;
}
.auth-notice.is-on { display: block; }
.auth-forgot { display: block; text-align: center; margin-top: 12px; font-size: 13px; color: var(--ink-muted); }

/* ============================================================
   5. PAYWALL SCREEN
   ============================================================ */
#screen-paywall.is-active {
  display: grid; place-items: center; padding: 32px 20px;
  min-height: 100vh;
  background: linear-gradient(180deg, #0b1220 0%, #111827 100%);
}
.paywall-card {
  width: 100%; max-width: 460px;
  background: var(--bg-elevated);
  border-radius: var(--r-xl);
  padding: 40px 36px;
  box-shadow: var(--shadow-xl);
  text-align: center;
}
.paywall-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--warn-soft); color: var(--warn);
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 16px;
}
.paywall-title {
  font-family: var(--font-display); font-size: 26px; font-weight: 700;
  color: var(--ink); letter-spacing: -0.02em; margin-bottom: 8px;
}
.paywall-sub { color: var(--ink-muted); font-size: 14px; margin-bottom: 28px; }
.paywall-price-wrap {
  padding: 20px 0; margin-bottom: 24px;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.paywall-price {
  font-family: var(--font-display); font-size: 44px; font-weight: 700;
  color: var(--ink); letter-spacing: -0.03em;
}
.paywall-price-period { color: var(--ink-muted); font-size: 13px; margin-top: 2px; }
.paywall-list { text-align: left; margin-bottom: 24px; display: flex; flex-direction: column; gap: 10px; }
.paywall-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); }
.paywall-list .icon { color: var(--success); }

/* ============================================================
   6. TOPBAR & TRIAL BANNER
   ============================================================ */
.trial-banner {
  display: none; padding: 10px 20px;
  background: var(--warn-soft); border-bottom: 1px solid #fde68a;
  color: var(--warn); font-size: 13px; font-weight: 600; text-align: center;
}
.trial-banner.is-on { display: flex; align-items: center; justify-content: center; gap: 12px; }
.trial-banner button { padding: 4px 10px; background: var(--warn); color: white; border-radius: var(--r-sm); font-size: 12px; font-weight: 600; }

.topbar { background: var(--bg-elevated); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 0 24px; height: 56px; display: flex; align-items: center; gap: 20px; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--ink); letter-spacing: -0.02em; }
.brand em { color: var(--brand); font-style: normal; }

.kid-switcher { display: flex; gap: 2px; padding: 3px; background: var(--surface-muted); border-radius: var(--r-sm); }
.kid-tab { padding: 6px 12px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--ink-muted); display: flex; align-items: center; gap: 6px; transition: all .15s; }
.kid-tab:hover:not(.is-active) { color: var(--ink); }
.kid-tab.is-active { background: var(--bg-elevated); color: var(--ink); box-shadow: var(--shadow-xs); }
.kid-add-btn { padding: 6px 10px; color: var(--ink-muted); font-size: 13px; font-weight: 600; border-radius: 6px; display: flex; align-items: center; gap: 4px; }
.kid-add-btn:hover { color: var(--ink); background: var(--bg-elevated); }

.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.parent-toggle { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; color: var(--ink-muted); border: 1px solid var(--border); transition: all .15s; }
.parent-toggle:hover { color: var(--ink); border-color: var(--border-strong); }
.parent-toggle.is-active { background: var(--brand); color: white; border-color: var(--brand); }

.acct-wrap { position: relative; }
.acct-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; transition: background .15s; }
.acct-pill:hover { background: var(--surface-muted); }
.acct-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: white; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.acct-caret { color: var(--ink-subtle); transition: transform .15s; }
.acct-wrap.is-open .acct-caret { transform: rotate(180deg); }
.acct-dropdown { display: none; position: absolute; top: calc(100% + 6px); right: 0; min-width: 220px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); z-index: 100; overflow: hidden; animation: popIn .12s ease; }
.acct-wrap.is-open .acct-dropdown { display: block; }
.acct-dd-header { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--ink-muted); font-weight: 500; }
.acct-dd-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; font-size: 13px; font-weight: 500; color: var(--ink); text-align: left; transition: background .1s; }
.acct-dd-item:hover { background: var(--surface-muted); }
.acct-dd-item.is-danger { color: var(--danger); }
.acct-dd-item.is-danger:hover { background: var(--danger-soft); }

.acct-trial-row { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 12px; }
.acct-trial-row .days { font-size: 16px; font-weight: 700; color: var(--ink); }
.acct-trial-row .label { color: var(--ink-muted); margin-bottom: 8px; }
.acct-subscribed { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--success); }
.acct-upgrade-btn { width: 100%; padding: 7px 10px; background: var(--brand); color: white; border-radius: var(--r-sm); font-size: 12px; font-weight: 600; transition: background .15s; }
.acct-upgrade-btn:hover { background: var(--brand-hover); }

/* ============================================================
   7. CARDS, BUTTONS, FORMS, BADGES
   ============================================================ */
.card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-xs); }
.card + .card { margin-top: 16px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.card-title { font-size: 13px; font-weight: 600; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.card-title-lg { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }

.section-header { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; margin-bottom: 20px; display: flex; align-items: center; gap: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; transition: all .15s; border: 1px solid transparent; white-space: nowrap; }
.btn-primary { background: var(--brand); color: white; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #065f46; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #991b1b; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-muted); border-color: var(--border-strong); }
.btn-subtle { background: var(--surface-muted); color: var(--ink); }
.btn-subtle:hover { background: #e4e7ec; }
.btn-link { background: transparent; color: var(--brand); padding: 4px 6px; }
.btn-link:hover { background: var(--brand-soft); }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-lg { padding: 12px 20px; font-size: 14px; }
.btn-full { width: 100%; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-muted); margin-bottom: 6px; }
.field input, .field select { width: 100%; padding: 10px 12px; background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: var(--r-sm); font-size: 14px; color: var(--ink); transition: border-color .15s, box-shadow .15s; outline: none; }
.field input:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field .hint { font-size: 12px; color: var(--ink-muted); margin-top: 4px; }
.field-prefix { display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--bg-elevated); transition: border-color .15s, box-shadow .15s; }
.field-prefix:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field-prefix span { padding: 10px 4px 10px 12px; color: var(--ink-muted); font-size: 14px; }
.field-prefix input { border: none; flex: 1; background: transparent; outline: none; font-size: 14px; padding: 10px 12px 10px 4px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-neutral { background: var(--surface-muted); color: var(--ink-muted); }

.explain { display: flex; gap: 10px; padding: 12px 14px; background: var(--info-soft); border: 1px solid #bae6fd; border-radius: var(--r-md); font-size: 13px; line-height: 1.55; color: var(--ink); }
.explain .icon { color: var(--info); margin-top: 2px; }
.explain strong { display: block; font-weight: 600; margin-bottom: 2px; color: var(--info); }
.explain-warn { background: var(--warn-soft); border-color: #fde68a; }
.explain-warn .icon, .explain-warn strong { color: var(--warn); }
.explain-success { background: var(--success-soft); border-color: #a7f3d0; }
.explain-success .icon, .explain-success strong { color: var(--success); }

.progress { height: 6px; background: var(--surface-muted); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--brand); border-radius: 999px; transition: width .4s ease; }
.progress-fill.is-success { background: var(--success); }
.progress-fill.is-danger { background: var(--danger); }

.empty-state { padding: 32px 16px; text-align: center; color: var(--ink-muted); }
.empty-state .icon { color: var(--ink-faint); margin: 0 auto 8px; width: 32px; height: 32px; }
.empty-state p { font-size: 13px; }

/* ============================================================
   8. KID VIEW
   ============================================================ */
.hero { background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%); color: white; border-radius: var(--r-xl); padding: 28px; margin-bottom: 20px; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -60px; right: -60px; width: 220px; height: 220px; background: radial-gradient(circle, rgba(255,255,255,.1), transparent 70%); pointer-events: none; }
.hero-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: #bfdbfe; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.hero-amount { font-family: var(--font-display); font-size: 48px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.hero-amount .cents { font-size: 28px; opacity: 0.75; font-weight: 500; }
.hero-sub { font-size: 13px; color: #bfdbfe; margin-top: 8px; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; box-shadow: var(--shadow-xs); }
.stat-label { font-size: 11px; font-weight: 600; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; display: flex; align-items: center; gap: 4px; }
.stat-value { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-delta { font-size: 11px; color: var(--success); font-weight: 600; margin-top: 2px; }

.action-bar { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }

.tx-list { display: flex; flex-direction: column; }
.tx { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.tx:last-child { border-bottom: none; }
.tx-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-muted); color: var(--ink-muted); display: grid; place-items: center; flex-shrink: 0; }
.tx-icon.is-in { background: var(--success-soft); color: var(--success); }
.tx-icon.is-out { background: var(--danger-soft); color: var(--danger); }
.tx-body { flex: 1; min-width: 0; }
.tx-note { font-size: 13px; font-weight: 500; color: var(--ink); }
.tx-meta { font-size: 11px; color: var(--ink-muted); margin-top: 2px; }
.tx-amount { font-family: var(--font-mono); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.tx-amount.is-in { color: var(--success); }
.tx-amount.is-out { color: var(--ink); }
.tx-action { padding: 4px; border-radius: 4px; color: var(--ink-subtle); opacity: 0; transition: opacity .15s, color .15s, background .15s; }
.tx:hover .tx-action { opacity: 1; }
.tx-action:hover { color: var(--danger); background: var(--danger-soft); }

.inv-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.inv-row:last-child { border-bottom: none; }
.inv-icon { width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.inv-body { flex: 1; }
.inv-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.inv-meta { font-size: 11px; color: var(--ink-muted); margin-top: 2px; margin-bottom: 6px; }
.inv-right { text-align: right; }
.inv-value { font-family: var(--font-mono); font-size: 15px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.inv-delta { font-size: 11px; font-weight: 600; margin-top: 2px; }
.inv-delta.is-up { color: var(--success); }
.inv-delta.is-down { color: var(--danger); }

.loan-summary { font-size: 13px; line-height: 1.6; margin-bottom: 12px; }
.loan-summary strong { color: var(--ink); }
.loan-split { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-muted); margin-bottom: 6px; }
.loan-split .paid { color: var(--success); font-weight: 600; }
.loan-split .owe { color: var(--danger); font-weight: 600; }
.loan-foot { font-size: 12px; color: var(--ink-muted); margin-top: 8px; }

.lessons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

/* ============================================================
   9. PARENT VIEW
   ============================================================ */
.parent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.parent-grid .full-width { grid-column: 1 / -1; }

.setting-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); gap: 16px; }
.setting-row:last-child { border-bottom: none; }
.setting-info { flex: 1; min-width: 0; }
.setting-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.setting-desc { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.setting-row input { width: 120px; padding: 8px 10px; text-align: right; border: 1px solid var(--border-strong); border-radius: var(--r-sm); font-family: var(--font-mono); font-size: 13px; font-weight: 500; background: var(--bg-elevated); outline: none; transition: border-color .15s, box-shadow .15s; }
.setting-row input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.setting-row input[type="text"] { font-family: var(--font-sans); text-align: left; }

.quick-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.preset-btn { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--ink-muted); transition: all .15s; }
.preset-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

.loan-req { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-muted); }
.loan-req + .loan-req { margin-top: 8px; }
.loan-req-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex-shrink: 0; }
.loan-req-body { flex: 1; min-width: 0; }
.loan-req-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.loan-req-meta { font-size: 11px; color: var(--ink-muted); margin-top: 2px; }
.loan-req-actions { display: flex; gap: 6px; }

.since-card { background: linear-gradient(135deg, var(--brand-soft), #f8fafc); border: 1px solid #c7d2fe; }
.since-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 16px; margin-top: 10px; }
.since-stat-val { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--brand-ink); letter-spacing: -0.02em; }
.since-stat-lbl { font-size: 11px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }

.kid-list-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.kid-list-item:last-child { border-bottom: none; }
.kid-list-item .acct-avatar { width: 32px; height: 32px; font-size: 13px; }
.kid-list-body { flex: 1; }
.kid-list-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.kid-list-meta { font-size: 11px; color: var(--ink-muted); margin-top: 2px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.kid-list-remove { padding: 4px 8px; color: var(--ink-subtle); font-size: 12px; border-radius: 4px; }
.kid-list-remove:hover { color: var(--danger); background: var(--danger-soft); }
.kid-list-action { padding: 4px 8px; color: var(--ink-subtle); border-radius: 4px; transition: all .15s; }
.kid-list-action:hover { color: var(--brand); background: var(--brand-soft); }

/* Security card */
.security-card { background: linear-gradient(180deg, #fafbff, var(--bg-elevated)); }
.security-block { padding: 4px 0; }
.security-label { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.security-desc { font-size: 12px; color: var(--ink-muted); margin-bottom: 12px; line-height: 1.5; }
.security-desc strong { color: var(--ink); font-weight: 600; }
.security-row { display: flex; gap: 8px; align-items: center; }
.security-input { flex: 1; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); font-family: var(--font-mono); font-size: 14px; letter-spacing: 2px; background: var(--bg-elevated); outline: none; transition: border-color .15s, box-shadow .15s; }
.security-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.security-divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ============================================================
   10. MODALS
   ============================================================ */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55); z-index: 200; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(4px); }
.modal-overlay.is-open { display: flex; animation: fadeIn .15s ease; }
.modal { background: var(--bg-elevated); border-radius: var(--r-xl); width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-xl); animation: popIn .18s ease; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.modal-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.modal-close { padding: 6px; border-radius: 6px; color: var(--ink-subtle); transition: all .15s; }
.modal-close:hover { color: var(--ink); background: var(--surface-muted); }
.modal-body { padding: 16px 24px 20px; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; padding: 16px 24px 20px; border-top: 1px solid var(--border); margin-top: 8px; }

.preview-box { background: var(--surface-muted); border-radius: var(--r-md); padding: 14px 16px; margin-top: 12px; margin-bottom: 12px; }
.preview-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; color: var(--ink-muted); }
.preview-row strong { font-family: var(--font-mono); font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.preview-row.is-total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; font-weight: 600; color: var(--ink); }

.invest-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.invest-card { padding: 14px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-md); cursor: pointer; transition: all .15s; }
.invest-card:hover { border-color: var(--border-strong); background: var(--surface-muted); }
.invest-card.is-selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand-soft); }
.invest-card .iv-icon { width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--surface-muted); display: grid; place-items: center; margin-bottom: 8px; color: var(--brand); }
.invest-card.is-selected .iv-icon { background: white; }
.invest-card .iv-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.invest-card .iv-return { font-size: 11px; color: var(--success); font-weight: 600; margin-top: 2px; }
.invest-card .iv-risk { font-size: 11px; color: var(--ink-muted); margin-top: 1px; }

.tax-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.tax-row:last-child { border-bottom: none; font-weight: 600; padding-top: 14px; border-top: 2px solid var(--border); margin-top: 4px; }

/* ============================================================
   11. PIN PADS & ONBOARDING
   ============================================================ */
.pin-display { font-family: var(--font-mono); font-size: 24px; text-align: center; letter-spacing: 12px; padding: 16px; background: var(--surface-muted); border-radius: var(--r-md); margin-bottom: 12px; min-height: 60px; color: var(--ink); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pin-btn { padding: 14px; background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: var(--r-md); font-size: 18px; font-weight: 600; color: var(--ink); transition: all .1s; }
.pin-btn:hover { background: var(--surface-muted); }
.pin-btn:active { transform: scale(0.96); }
.pin-btn.is-primary { background: var(--brand); color: white; border-color: var(--brand); }
.pin-btn.is-primary:hover { background: var(--brand-hover); }
.pin-btn.is-success { background: var(--success); color: white; border-color: var(--success); }
.pin-btn.is-success:hover { background: #065f46; }

.ob-progress { display: flex; gap: 6px; justify-content: center; margin-bottom: 24px; }
.ob-dot { width: 24px; height: 4px; border-radius: 2px; background: var(--border); transition: all .2s; }
.ob-dot.is-active { background: var(--brand); width: 32px; }
.ob-dot.is-done { background: var(--success); }
.ob-step { animation: fadeIn .2s ease; }
.ob-icon { width: 52px; height: 52px; margin: 0 auto 14px; background: var(--brand-soft); color: var(--brand); border-radius: 50%; display: grid; place-items: center; }
.ob-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--ink); text-align: center; letter-spacing: -0.02em; margin-bottom: 6px; }
.ob-sub { text-align: center; font-size: 14px; color: var(--ink-muted); line-height: 1.55; margin-bottom: 24px; }

/* ============================================================
   12. TOAST
   ============================================================ */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: white; padding: 12px 18px; border-radius: var(--r-md); font-size: 13px; font-weight: 500; transform: translateY(100px); opacity: 0; transition: all .25s ease; z-index: 1000; max-width: 360px; box-shadow: var(--shadow-xl); }
.toast.is-on { transform: translateY(0); opacity: 1; }
.toast.is-success { background: var(--success); }
.toast.is-danger { background: var(--danger); }

/* ============================================================
   13. RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .parent-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .lessons { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .shell { padding: 16px; }
  .topbar-inner { padding: 0 16px; gap: 12px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid .stat:nth-child(3) { grid-column: 1 / -1; }
  .hero { padding: 22px; }
  .hero-amount { font-size: 36px; }
  .hero-amount .cents { font-size: 22px; }
  .invest-grid { grid-template-columns: 1fr; }
  .action-bar .btn { flex: 1; }
  .kid-switcher { overflow-x: auto; max-width: 180px; }
}
