/* ==========================================================================
   ₦5K Quest — Design System
   Dark navy premium fintech · vibrant gradients · mobile-first · WCAG-conscious
   ========================================================================== */

:root {
  --bg: #060a1a;
  --bg-2: #0a1029;
  --card: #0f1736;
  --card-2: #142046;
  --card-3: #1a2856;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #eef2ff;
  --muted: #a3aed0;
  --dim: #7380a8;
  --violet: #7c5cff;
  --violet-2: #9b83ff;
  --sky: #4cc9f0;
  --mint: #19e3b1;
  --amber: #ffb547;
  --coral: #ff6b6b;
  --pink: #ff5ca8;
  --grad: linear-gradient(135deg, #7c5cff 0%, #4cc9f0 55%, #19e3b1 100%);
  --grad-warm: linear-gradient(135deg, #ff8a3d 0%, #ff3d6e 100%);
  --grad-gold: linear-gradient(135deg, #ffd166 0%, #ff9f43 100%);
  --grad-soft: linear-gradient(160deg, rgba(124, 92, 255, .22), rgba(25, 227, 177, .08));
  --radius: 22px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --shadow: 0 10px 40px -12px rgba(0, 0, 0, .55);
  --shadow-glow: 0 10px 50px -10px rgba(124, 92, 255, .55);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --nav-h: 72px;
  --top-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 400 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  background-image: radial-gradient(1200px 600px at 85% -10%, rgba(124, 92, 255, .18), transparent 60%),
                    radial-gradient(900px 500px at -10% 10%, rgba(25, 227, 177, .10), transparent 60%);
  background-attachment: fixed;
}
img, svg { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.ic { width: 20px; height: 20px; flex: none; }
.next-step > .ic { width: 22px; height: 22px; }
a { color: var(--sky); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.12; letter-spacing: -.025em; font-weight: 800; }
h1 { font-size: clamp(2rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.3rem); }
h3 { font-size: 1.2rem; letter-spacing: -.015em; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
small, .small { font-size: .84rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--violet); color: #fff; padding: 8px 14px; border-radius: 10px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* ---------- utilities ---------- */
.muted { color: var(--muted); } .dim { color: var(--dim); }
.mint { color: var(--mint); } .amber { color: var(--amber); } .coral { color: var(--coral); } .violet { color: var(--violet-2); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.warm-text { background: var(--grad-warm); -webkit-background-clip: text; background-clip: text; color: transparent; }
.center { text-align: center; } .right { text-align: right; }
.mono { font-family: var(--mono); font-size: .9em; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: .5rem } .mt-2 { margin-top: 1rem } .mt-3 { margin-top: 1.5rem } .mt-4 { margin-top: 2.5rem }
.mb-0 { margin-bottom: 0 } .mb-1 { margin-bottom: .5rem } .mb-2 { margin-bottom: 1rem } .mb-3 { margin-bottom: 1.5rem }
.stack > * + * { margin-top: var(--gap, 1rem); }
.row { display: flex; align-items: center; gap: .75rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: 1rem; }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.grid-4 { display: grid; gap: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hide-mobile { display: none; }
@media (min-width: 900px) { .hide-mobile { display: initial; } .hide-desktop { display: none !important; } }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------- containers ---------- */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.container-sm { max-width: 560px; }
.container-md { max-width: 820px; }
.section { padding: 64px 0; }
@media (min-width: 900px) { .section { padding: 96px 0; } }

/* ---------- buttons ---------- */
.btn {
  --b: var(--card-2);
  appearance: none; border: 1px solid var(--line-2); background: var(--b); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: 0 20px; border-radius: 999px; font: 700 1rem/1 var(--font); letter-spacing: -.01em;
  cursor: pointer; text-decoration: none !important; transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s;
  -webkit-tap-highlight-color: transparent; user-select: none; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); background: var(--card-3); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--grad); border: 0; color: #050816; box-shadow: var(--shadow-glow); }
.btn-primary:hover { background: var(--grad); filter: brightness(1.07); }
.btn-warm { background: var(--grad-warm); border: 0; color: #fff; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: rgba(255, 255, 255, .06); }
.btn-danger { background: rgba(255, 107, 107, .12); border-color: rgba(255, 107, 107, .4); color: #ffb3b3; }
.btn-lg { min-height: 58px; padding: 0 28px; font-size: 1.08rem; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: .9rem; }
.btn-xs { min-height: 30px; padding: 0 10px; font-size: .8rem; }
.btn-block { width: 100%; }
.btn .ic { width: 18px; height: 18px; }
.link-btn { background: none; border: 0; color: var(--sky); font: inherit; cursor: pointer; padding: 0; }
.inline-form { display: inline; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); position: relative; }
.card-tight { padding: 14px 16px; }
.card-glow { background: linear-gradient(var(--card), var(--card)) padding-box, var(--grad) border-box; border: 1px solid transparent; }
.card-hero { background: var(--grad-soft), var(--card); border: 1px solid rgba(124, 92, 255, .35); overflow: hidden; }
.card-link { display: block; color: inherit; text-decoration: none !important; transition: transform .18s var(--ease), border-color .2s; }
.card-link:hover { transform: translateY(-2px); border-color: var(--line-2); }
.card h3 { margin-bottom: .25rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.card-head h3, .card-head h4 { margin: 0; }
.eyebrow { text-transform: uppercase; font-size: .72rem; letter-spacing: .14em; font-weight: 800; color: var(--muted); }
.glass { background: rgba(15, 23, 54, .62); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); }

/* ---------- badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 800; letter-spacing: .02em; border: 1px solid transparent; white-space: nowrap; }
.badge-ok { background: rgba(25, 227, 177, .12); color: var(--mint); border-color: rgba(25, 227, 177, .3); }
.badge-warn { background: rgba(255, 181, 71, .12); color: var(--amber); border-color: rgba(255, 181, 71, .3); }
.badge-bad { background: rgba(255, 107, 107, .12); color: #ff9c9c; border-color: rgba(255, 107, 107, .3); }
.badge-muted { background: rgba(255, 255, 255, .06); color: var(--muted); border-color: var(--line); }
.badge-pro { background: var(--grad-gold); color: #2b1600; }
.badge-demo { background: rgba(76, 201, 240, .14); color: var(--sky); border-color: rgba(76, 201, 240, .35); }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: 7px 12px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); font-size: .85rem; font-weight: 600; color: var(--text); }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 1rem; }
.label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: .4rem; }
.hint { color: var(--dim); font-size: .82rem; margin-top: .35rem; }
.error-text { color: #ff9c9c; font-size: .84rem; margin-top: .35rem; font-weight: 600; }
.input, .select, .textarea {
  width: 100%; min-height: 52px; padding: 0 16px; background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); font: 500 1rem var(--font); transition: border-color .2s, box-shadow .2s;
}
.textarea { padding: 14px 16px; min-height: 110px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(124, 92, 255, .25); }
.input.is-invalid { border-color: var(--coral); }
.input-money { position: relative; }
.input-money::before { content: "₦"; position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 800; font-size: 1.2rem; }
.input-money .input { padding-left: 38px; font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; min-height: 64px; }
.check { display: flex; gap: .65rem; align-items: flex-start; font-size: .92rem; color: var(--muted); }
.check input { width: 20px; height: 20px; accent-color: var(--violet); margin-top: 2px; flex: none; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }

/* option cards (radio/checkbox) */
.options { display: grid; gap: .65rem; grid-template-columns: 1fr; }
.options-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.options-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .options-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.option { position: relative; display: block; cursor: pointer; }
.option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.option-body { display: flex; align-items: center; gap: .75rem; min-height: 60px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--card-2); border: 1.5px solid var(--line); font-weight: 700; transition: border-color .15s, background .15s, transform .15s; }
.option-body .emoji { font-size: 1.4rem; line-height: 1; }
.option-body small { display: block; font-weight: 500; color: var(--muted); }
.option:hover .option-body { border-color: var(--line-2); }
.option input:checked + .option-body { border-color: var(--violet); background: rgba(124, 92, 255, .14); box-shadow: 0 0 0 3px rgba(124, 92, 255, .2) inset; }
.option input:focus-visible + .option-body { outline: 3px solid var(--sky); outline-offset: 2px; }
.preset-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.preset { border: 1px solid var(--line-2); background: var(--card-2); color: var(--text); border-radius: 999px; padding: 10px 16px; font-weight: 800; cursor: pointer; font-size: .95rem; }
.preset.is-active, .preset:hover { border-color: var(--violet); background: rgba(124, 92, 255, .16); }

/* ---------- alerts / toasts ---------- */
.alert { display: flex; gap: .75rem; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card-2); font-size: .94rem; }
.alert-info { border-color: rgba(76, 201, 240, .35); background: rgba(76, 201, 240, .08); }
.alert-success { border-color: rgba(25, 227, 177, .35); background: rgba(25, 227, 177, .08); }
.alert-error { border-color: rgba(255, 107, 107, .4); background: rgba(255, 107, 107, .08); }
.alert-warn { border-color: rgba(255, 181, 71, .4); background: rgba(255, 181, 71, .08); }
.alert .ic { flex: none; width: 20px; height: 20px; margin-top: 2px; }
.toasts { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); top: calc(var(--top-h, 64px) + 12px); width: min(560px, calc(100% - 24px)); display: grid; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; animation: toastIn .35s var(--ease) both; box-shadow: var(--shadow); background-color: #101a3c; background-image: none; }
.toast.is-leaving { animation: toastOut .3s var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(.98); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px); } }

/* ---------- progress ---------- */
.bar { height: 12px; background: rgba(255, 255, 255, .07); border-radius: 999px; overflow: hidden; position: relative; }
.bar > span { display: block; height: 100%; width: 0; background: var(--grad); border-radius: inherit; transition: width 1.1s var(--ease); position: relative; }
.bar > span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); animation: shimmer 2.4s infinite; transform: translateX(-100%); }
.bar-sm { height: 8px; } .bar-lg { height: 16px; }
.bar-warm > span { background: var(--grad-warm); }
@keyframes shimmer { to { transform: translateX(100%); } }
.ring { position: relative; width: var(--size, 140px); height: var(--size, 140px); flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 12; stroke-linecap: round; }
.ring .track { stroke: rgba(255, 255, 255, .08); }
.ring .value { stroke: url(#ringGrad); transition: stroke-dashoffset 1.3s var(--ease); }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring-label strong { font-size: calc(var(--size, 140px) * .22); letter-spacing: -.03em; display: block; line-height: 1; }
.ring-label small { color: var(--muted); font-size: .75rem; }

/* ---------- stats ---------- */
.stat { padding: 16px; border-radius: var(--radius-sm); background: var(--card-2); border: 1px solid var(--line); }
.stat .k { color: var(--muted); font-size: .8rem; font-weight: 700; }
.stat .v { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .d { font-size: .78rem; color: var(--dim); margin-top: 2px; }
.big-number { font-size: clamp(2.2rem, 9vw, 3.4rem); font-weight: 900; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }

/* ---------- lists & tables ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: .85rem; padding: 14px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .meta { color: var(--dim); font-size: .82rem; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: #050816; flex: none; font-size: .95rem; }
.icon-tile { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: rgba(124, 92, 255, .15); color: var(--violet-2); flex: none; font-size: 1.25rem; }
.icon-tile .ic { width: 22px; height: 22px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 640px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; background: rgba(255, 255, 255, .02); position: sticky; top: 0; }
.table tr:hover td { background: rgba(255, 255, 255, .02); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-compact { min-width: 0; }

/* transaction rows (mobile-friendly) */
.tx { display: grid; grid-template-columns: auto 1fr auto; gap: .85rem; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.tx:last-child { border-bottom: 0; }
.tx .amt { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.tx .amt.in { color: var(--mint); }
.tx .sub { color: var(--dim); font-size: .8rem; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-weight: 700; font-size: .9rem; background: transparent; text-decoration: none !important; }
.tab.is-active, .tab[aria-current="page"] { background: var(--text); color: #050816; border-color: var(--text); }

/* ---------- empty / skeleton ---------- */
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .emoji { font-size: 2.6rem; margin-bottom: .5rem; }
.empty h3 { color: var(--text); }
.skeleton { background: linear-gradient(90deg, rgba(255, 255, 255, .05) 25%, rgba(255, 255, 255, .1) 37%, rgba(255, 255, 255, .05) 63%); background-size: 400% 100%; animation: skel 1.4s ease infinite; border-radius: 10px; min-height: 16px; }
@keyframes skel { from { background-position: 100% 50%; } to { background-position: 0 50%; } }

/* ==========================================================================
   App shell
   ========================================================================== */
.app-shell { min-height: 100vh; padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
.topbar { position: sticky; top: 0; z-index: 40; height: var(--top-h); display: flex; align-items: center; border-bottom: 1px solid var(--line); background: rgba(6, 10, 26, .95); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); font-weight: 900; letter-spacing: -.03em; font-size: 1.12rem; text-decoration: none !important; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; background: var(--grad); display: grid; place-items: center; color: #050816; font-weight: 900; font-size: .95rem; letter-spacing: -.04em; box-shadow: 0 6px 20px -6px rgba(124, 92, 255, .8); }
.top-actions { display: flex; align-items: center; gap: .5rem; }
.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--text); background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.icon-btn .ic { width: 20px; height: 20px; }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--coral); color: #fff; font-size: .68rem; font-weight: 900; display: grid; place-items: center; border: 2px solid var(--bg); }
.main { padding-top: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); margin: 0; }
.page-head p { margin: .25rem 0 0; color: var(--muted); }
.back-link { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-weight: 700; font-size: .9rem; margin-bottom: .5rem; }

/* bottom navigation (one-handed) */
.bottom-nav { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(8, 12, 30, .92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--dim); font-size: .7rem; font-weight: 800; text-decoration: none !important; letter-spacing: .01em; position: relative; }
.bottom-nav a .ic { width: 24px; height: 24px; }
.bottom-nav a[aria-current="page"] { color: var(--text); }
.bottom-nav a[aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 34px; height: 3px; border-radius: 0 0 4px 4px; background: var(--grad); }
.bottom-nav .nav-fm .ic { color: var(--mint); }

/* desktop side nav */
.side-nav { display: none; }
@media (min-width: 1024px) {
  .app-shell { padding-bottom: 40px; display: grid; grid-template-columns: 248px 1fr; }
  .app-shell > .topbar { grid-column: 1 / -1; }
  .bottom-nav { display: none; }
  .side-nav { display: block; position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); padding: 20px 14px; border-right: 1px solid var(--line); overflow-y: auto; }
  .side-nav a { display: flex; align-items: center; gap: .75rem; padding: 11px 14px; border-radius: 12px; color: var(--muted); font-weight: 700; text-decoration: none !important; margin-bottom: 2px; }
  .side-nav a .ic { width: 20px; height: 20px; }
  .side-nav a:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
  .side-nav a[aria-current="page"] { background: rgba(124, 92, 255, .14); color: var(--text); }
  .side-nav .nav-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; color: var(--dim); font-weight: 800; padding: 16px 14px 6px; }
  .app-main { min-width: 0; }
}

/* ==========================================================================
   Dashboard widgets
   ========================================================================== */
.hello { font-size: clamp(1.45rem, 5vw, 2rem); font-weight: 900; letter-spacing: -.03em; margin: 0; }
.hero-quest { display: grid; gap: 18px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 640px) { .hero-quest { grid-template-columns: auto 1fr; } }
.quest-amount { font-size: clamp(1.8rem, 7vw, 2.6rem); font-weight: 900; letter-spacing: -.035em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.quest-amount .of { color: var(--dim); font-weight: 700; font-size: .55em; }
.streak-pill { display: inline-flex; align-items: center; gap: .45rem; padding: 8px 14px; border-radius: 999px; background: rgba(255, 106, 61, .14); border: 1px solid rgba(255, 106, 61, .35); font-weight: 900; color: #ffb38a; }
.flame { display: inline-block; animation: flicker 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.12) rotate(3deg); } }
.week-dots { display: flex; gap: 6px; }
.week-dots span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 800; background: rgba(255, 255, 255, .06); color: var(--dim); border: 1px solid var(--line); }
.week-dots span.on { background: var(--grad-warm); color: #fff; border: 0; }
.week-dots span.shield { background: rgba(76, 201, 240, .18); color: var(--sky); border-color: rgba(76, 201, 240, .4); }
.week-dots span.today { outline: 2px solid var(--text); outline-offset: 2px; }
.next-step { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); background: var(--grad); color: #050816; text-decoration: none !important; box-shadow: var(--shadow-glow); }
.next-step .icon-tile { background: rgba(5, 8, 22, .18); color: #050816; }
.next-step strong { display: block; font-size: 1.05rem; letter-spacing: -.01em; }
.next-step span { font-size: .88rem; opacity: .8; font-weight: 600; }
.challenge { display: grid; gap: .6rem; padding: 16px; border-radius: var(--radius-sm); background: var(--card-2); border: 1px solid var(--line); }
.challenge.is-done { border-color: rgba(25, 227, 177, .35); background: rgba(25, 227, 177, .06); }
.challenge .xp { color: var(--amber); font-weight: 900; font-size: .85rem; }
.challenge-title { font-weight: 900; letter-spacing: -.01em; font-size: 1.04rem; }
.challenge-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.xp-bar-label { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); font-weight: 700; margin-top: .4rem; }
.level-badge { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--grad); color: #050816; font-weight: 900; font-size: 1.3rem; box-shadow: var(--shadow-glow); }

/* Money Elevator */
.elevator { position: relative; display: grid; gap: 8px; padding-left: 74px; }
.elevator::before { content: ""; position: absolute; left: 30px; top: 8px; bottom: 8px; width: 4px; border-radius: 4px; background: rgba(255, 255, 255, .08); }
.elevator .shaft-fill { position: absolute; left: 30px; bottom: 8px; width: 4px; border-radius: 4px; background: var(--grad); transition: height 1.6s var(--ease); }
.floor { position: relative; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--card-2); border: 1px solid var(--line); }
.floor .fl { position: absolute; left: -62px; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 900; font-size: .82rem; background: var(--card); border: 1px solid var(--line-2); color: var(--muted); }
.floor.reached { border-color: rgba(25, 227, 177, .3); }
.floor.reached .fl { background: var(--grad); color: #050816; border: 0; }
.floor.current { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124, 92, 255, .2), var(--shadow-glow); }
.floor.current .fl { animation: pulse 1.8s infinite; }
.floor .amt { font-weight: 900; font-size: 1.1rem; letter-spacing: -.02em; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(124, 92, 255, .6); } 50% { box-shadow: 0 0 0 10px rgba(124, 92, 255, 0); } }
.cab { position: absolute; left: 16px; width: 32px; height: 32px; border-radius: 10px; background: var(--text); color: #050816; display: grid; place-items: center; font-size: 1rem; transition: bottom 1.6s var(--ease); box-shadow: 0 6px 18px rgba(0, 0, 0, .5); z-index: 2; }

/* Future Me */
.fm-compare { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 760px) { .fm-compare { grid-template-columns: 1fr auto 1fr; align-items: stretch; } }
.fm-side { border-radius: var(--radius); padding: 22px; border: 1px solid var(--line); background: var(--card); }
.fm-side.future { background: var(--grad-soft), var(--card); border-color: rgba(25, 227, 177, .35); }
.fm-arrow { display: grid; place-items: center; color: var(--muted); font-size: 1.6rem; }
.scenario-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--bg-2); padding: 5px; border-radius: 16px; border: 1px solid var(--line); }
.scenario-tabs button { border: 0; background: transparent; color: var(--muted); font: 800 .88rem var(--font); padding: 11px 6px; border-radius: 12px; cursor: pointer; }
.scenario-tabs button[aria-pressed="true"] { background: var(--card-3); color: var(--text); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.horizon-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.horizon-row::-webkit-scrollbar { display: none; }
.horizon-row button { flex: none; border: 1px solid var(--line-2); background: var(--card-2); color: var(--text); border-radius: 999px; padding: 9px 14px; font: 800 .86rem var(--font); cursor: pointer; }
.horizon-row button[aria-pressed="true"] { background: var(--text); color: #050816; border-color: var(--text); }
.breakdown { display: grid; gap: 8px; }
.breakdown .line { display: flex; justify-content: space-between; gap: 1rem; font-variant-numeric: tabular-nums; }
.breakdown .line.total { border-top: 1px solid var(--line-2); padding-top: 10px; font-weight: 900; font-size: 1.1rem; }
.chart { width: 100%; height: 220px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .axis { stroke: rgba(255, 255, 255, .08); }
.chart text { fill: var(--dim); font-size: 11px; font-family: var(--font); }
.disclosure { font-size: .8rem; color: var(--dim); border-left: 3px solid var(--amber); padding: 8px 12px; background: rgba(255, 181, 71, .05); border-radius: 0 10px 10px 0; }
.range { width: 100%; accent-color: var(--violet); height: 32px; }

/* Coach chat */
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 320px; }
.msg { max-width: 88%; padding: 12px 15px; border-radius: 18px; font-size: .95rem; white-space: pre-line; line-height: 1.5; }
.msg.user { align-self: flex-end; background: var(--violet); color: #fff; border-bottom-right-radius: 6px; }
.msg.ai { align-self: flex-start; background: var(--card-2); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.ai strong { color: var(--mint); }
.typing span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); margin: 0 2px; animation: typing 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.chat-input { position: sticky; bottom: calc(var(--nav-h) + 8px); display: flex; gap: 8px; padding: 8px; background: var(--card); border: 1px solid var(--line-2); border-radius: 999px; }
.chat-input .input { border: 0; background: transparent; min-height: 46px; }
.chat-input .input:focus { box-shadow: none; }
@media (min-width: 1024px) { .chat-input { bottom: 16px; } }
.suggestions { display: flex; gap: 6px; flex-wrap: wrap; }
.suggestions button { border: 1px solid var(--line-2); background: transparent; color: var(--text); border-radius: 999px; padding: 8px 12px; font: 600 .85rem var(--font); cursor: pointer; }

/* Leaderboard */
.lb-row { display: grid; grid-template-columns: 34px 40px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius-sm); }
.lb-row + .lb-row { margin-top: 4px; }
.lb-row.me { background: rgba(124, 92, 255, .14); border: 1px solid rgba(124, 92, 255, .4); }
.lb-rank { font-weight: 900; color: var(--muted); text-align: center; font-size: 1.05rem; }
.lb-score { font-weight: 900; font-variant-numeric: tabular-nums; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 10px; align-items: end; }
.podium > div { text-align: center; padding: 16px 8px; border-radius: var(--radius) var(--radius) 12px 12px; background: var(--card-2); border: 1px solid var(--line); }
.podium .p1 { padding-top: 26px; background: var(--grad-soft), var(--card-2); border-color: rgba(255, 209, 102, .4); }
.podium .medal { font-size: 1.8rem; }
.podium .name { font-weight: 800; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Badges grid */
.badges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .badges { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.badge-tile { text-align: center; padding: 14px 8px; border-radius: var(--radius-sm); background: var(--card-2); border: 1px solid var(--line); }
.badge-tile .em { font-size: 2rem; line-height: 1; filter: grayscale(1) opacity(.35); }
.badge-tile.earned .em { filter: none; }
.badge-tile.earned { border-color: rgba(255, 209, 102, .35); }
.badge-tile .nm { font-weight: 800; font-size: .78rem; margin-top: 6px; line-height: 1.2; }
.badge-tile .ds { font-size: .7rem; color: var(--dim); margin-top: 3px; line-height: 1.25; }

/* Reward cards */
.reward { display: flex; flex-direction: column; gap: .5rem; }
.reward .cost { font-weight: 900; color: var(--amber); }
.points-hero { display: flex; align-items: center; gap: 14px; }
.points-hero .coin { width: 56px; height: 56px; border-radius: 50%; background: var(--grad-gold); display: grid; place-items: center; font-size: 1.6rem; box-shadow: 0 10px 30px -10px rgba(255, 159, 67, .7); }

/* XP pop / confetti */
.xp-pop { position: fixed; z-index: 95; left: 50%; top: 40%; transform: translate(-50%, -50%); font-size: 2.4rem; font-weight: 900; color: var(--amber); text-shadow: 0 6px 30px rgba(255, 181, 71, .6); pointer-events: none; animation: xpPop 1.6s var(--ease) forwards; letter-spacing: -.03em; }
@keyframes xpPop { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 70% { opacity: 1; transform: translate(-50%, -70%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -110%) scale(.95); } }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 94; width: 100vw; height: 100vh; }

/* dialog */
dialog.modal { border: 1px solid var(--line-2); background: var(--card); color: var(--text); border-radius: var(--radius); padding: 0; width: min(520px, calc(100% - 24px)); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
dialog.modal::backdrop { background: rgba(3, 5, 15, .72); backdrop-filter: blur(4px); }
.modal-body { padding: 22px; }
@media (max-width: 640px) { dialog.modal { margin: auto auto 0; width: 100%; max-width: 100%; border-radius: var(--radius) var(--radius) 0 0; } }

/* review / receipt */
.receipt { display: grid; gap: 0; }
.receipt .ln { display: flex; justify-content: space-between; gap: 1rem; padding: 13px 0; border-bottom: 1px dashed var(--line-2); font-variant-numeric: tabular-nums; }
.receipt .ln:last-child { border-bottom: 0; }
.receipt .ln span:first-child { color: var(--muted); }
.receipt .ln strong { text-align: right; }
.receipt .ln.total { font-size: 1.15rem; font-weight: 900; border-bottom: 0; border-top: 1px solid var(--line-2); margin-top: 4px; }

/* ==========================================================================
   Marketing
   ========================================================================== */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(6, 10, 26, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.site-header .container { height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-nav { display: none; gap: 1.6rem; }
.site-nav a { color: var(--muted); font-weight: 700; font-size: .94rem; }
.site-nav a:hover { color: var(--text); text-decoration: none; }
@media (min-width: 960px) { .site-nav { display: flex; } }
.hero { padding: 48px 0 40px; position: relative; overflow: hidden; }
@media (min-width: 900px) { .hero { padding: 92px 0 72px; } }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.08fr .92fr; } }
.hero h1 { font-size: clamp(2.5rem, 9vw, 4.8rem); line-height: .98; letter-spacing: -.045em; margin-bottom: .35em; }
.hero .lead { font-size: clamp(1.08rem, 2.6vw, 1.32rem); color: var(--muted); max-width: 34em; }
.hero-cta { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1.6rem 0 1rem; }
.trust-row { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; color: var(--dim); font-size: .85rem; font-weight: 600; }
.trust-row span { display: inline-flex; gap: .35rem; align-items: center; }
.trust-row .ic { width: 16px; height: 16px; color: var(--mint); }
.phone { position: relative; margin: 0 auto; width: min(360px, 100%); border-radius: 44px; padding: 14px; background: linear-gradient(160deg, #1b2556, #0b1129); border: 1px solid var(--line-2); box-shadow: 0 40px 100px -30px rgba(124, 92, 255, .65), inset 0 0 0 1px rgba(255, 255, 255, .04); }
.phone-screen { border-radius: 32px; background: var(--bg); padding: 18px 16px; display: grid; gap: 12px; overflow: hidden; }
.float { animation: float 6s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.journey { display: grid; gap: 10px; grid-template-columns: 1fr; counter-reset: step; }
@media (min-width: 760px) { .journey { grid-template-columns: repeat(6, 1fr); } }
.journey .step { text-align: center; padding: 18px 10px; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line); position: relative; }
.journey .step .em { font-size: 1.8rem; }
.journey .step strong { display: block; margin-top: .3rem; letter-spacing: -.01em; }
.journey .step small { color: var(--dim); }
@media (min-width: 760px) { .journey .step:not(:last-child)::after { content: "→"; position: absolute; right: -11px; top: 50%; transform: translateY(-50%); color: var(--dim); font-weight: 900; z-index: 2; } }
@media (max-width: 759px) { .journey .step:not(:last-child)::after { content: "↓"; display: block; color: var(--dim); font-weight: 900; margin-top: 6px; } }
.feature { padding: 26px; }
.feature .icon-tile { margin-bottom: 14px; }
.section-head { max-width: 680px; margin: 0 auto 2.5rem; text-align: center; }
.section-head p { color: var(--muted); font-size: 1.08rem; }
.price-card { display: flex; flex-direction: column; gap: 1rem; }
.price { font-size: 2.6rem; font-weight: 900; letter-spacing: -.04em; }
.price small { font-size: 1rem; color: var(--muted); font-weight: 700; letter-spacing: 0; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.check-list li { display: flex; gap: .55rem; align-items: flex-start; }
.check-list li::before { content: "✓"; color: var(--mint); font-weight: 900; }
.faq details { border-bottom: 1px solid var(--line); padding: 16px 4px; }
.faq summary { cursor: pointer; font-weight: 800; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); margin: .75rem 0 0; }
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 calc(48px + env(safe-area-inset-bottom)); color: var(--muted); font-size: .9rem; margin-top: 40px; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-grid h4 { color: var(--text); font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; }
.footer-grid a { display: block; color: var(--muted); padding: 4px 0; }
.legal-note { font-size: .78rem; color: var(--dim); margin-top: 28px; line-height: 1.6; }
.prose { max-width: 760px; }
.prose h2 { font-size: 1.4rem; margin-top: 2rem; }
.prose h3 { margin-top: 1.4rem; }
.prose p, .prose li { color: #cdd5ee; }
.prose ul { padding-left: 1.2rem; }

/* auth */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 460px; }
.auth-card .brand { justify-content: center; margin-bottom: 1.5rem; }
.divider { display: flex; align-items: center; gap: .75rem; color: var(--dim); font-size: .82rem; margin: 1.2rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.step-dots { display: flex; gap: 6px; justify-content: center; }
.step-dots span { width: 26px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .1); transition: background .3s, width .3s; }
.step-dots span.on { background: var(--grad); width: 40px; }
.wizard-step { margin-bottom: 1.5rem; }
.js-wizard .wizard-step { display: none; margin: 0; animation: stepIn .35s var(--ease) both; }
.js-wizard .wizard-step.is-active { display: block; }
.js-wizard .no-js-submit { display: none; }
.wizard-nav { display: none; }
.js-wizard .wizard-nav { display: flex; }
@keyframes stepIn { from { opacity: 0; transform: translateX(18px); } }

/* score reveal */
.score-hero { text-align: center; }
.score-hero .ring { margin: 0 auto 1rem; --size: 190px; }

/* ==========================================================================
   Admin
   ========================================================================== */
.admin-shell { min-height: 100vh; }
@media (min-width: 1100px) { .admin-shell { display: grid; grid-template-columns: 250px 1fr; } }
.admin-side { background: var(--bg-2); border-right: 1px solid var(--line); padding: 14px; }
@media (min-width: 1100px) { .admin-side { position: sticky; top: 0; height: 100vh; overflow-y: auto; } }
.admin-side details > summary { list-style: none; cursor: pointer; }
.admin-side details > summary::-webkit-details-marker { display: none; }
@media (min-width: 1100px) { .admin-side .menu-toggle { display: none; } }
.admin-side nav a { display: flex; align-items: center; gap: .6rem; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: .9rem; text-decoration: none !important; }
.admin-side nav a:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.admin-side nav a[aria-current="page"] { background: rgba(124, 92, 255, .16); color: var(--text); }
.admin-side .grp { font-size: .66rem; text-transform: uppercase; letter-spacing: .14em; color: var(--dim); font-weight: 800; padding: 14px 12px 4px; }
.admin-main { padding: 20px 16px 60px; min-width: 0; }
@media (min-width: 1100px) { .admin-main { padding: 28px 32px 60px; } }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin-bottom: 1rem; }
.filters .input, .filters .select { min-height: 42px; width: auto; font-size: .9rem; }
.filters .field { margin: 0; }
.kpi { padding: 16px; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line); }
.kpi .k { font-size: .74rem; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.kpi .v { font-size: 1.5rem; font-weight: 900; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: .76rem; color: var(--dim); }
.funnel-row { display: grid; grid-template-columns: 170px 1fr 70px 60px; gap: 10px; align-items: center; font-size: .86rem; padding: 6px 0; }
.funnel-row .bar { height: 14px; }
@media (max-width: 640px) { .funnel-row { grid-template-columns: 1fr 60px; } .funnel-row .bar { grid-column: 1 / -1; order: 3; } .funnel-row .pct { display: none; } }
.pagination { display: flex; gap: .4rem; align-items: center; justify-content: flex-end; margin-top: 1rem; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 8px 14px; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
pre.json { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: .78rem; overflow-x: auto; color: #cdd5ee; }

/* Cookie consent banner (Meta Pixel) */
.cookie-banner { position: fixed; z-index: 95; left: 50%; transform: translateX(-50%); bottom: calc(16px + var(--nav-h, 0px)); width: min(720px, calc(100% - 24px)); display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: var(--radius-sm, 14px); background: #101a3c; border: 1px solid var(--line); box-shadow: var(--shadow); }
.cookie-banner p { margin: .25rem 0 0; font-size: .88rem; color: var(--muted, #a3aed0); }
.cookie-banner-actions { display: flex; gap: .5rem; flex: none; }
@media (max-width: 560px) { .cookie-banner { flex-direction: column; align-items: stretch; } .cookie-banner-actions { justify-content: flex-end; } }
@media (min-width: 900px) { .cookie-banner { bottom: 16px; } }
