/* ============================================================
   Bo Funnel — brand + animation system
   Animation keyframes ported 1:1 from reference funnel timings,
   restyled in Bo brand (mango + pastel, Baloo2, cream).
   ============================================================ */

@font-face {
  font-family: "Baloo2";
  src: url("../assets/Baloo2-Variable.ttf") format("truetype");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  /* Bo brand — tokens verbatim from the admin dashboard / Theme.swift */
  --accent: #FFC72E;          /* mango yellow */
  --accent-dark: #E6A500;
  --accent-soft: #FFEE9E;
  --accent-ink: #121419;
  --accent-deep: #E6A500;
  --ink: #121419;
  --ink-mid: #33383D;
  --ink-soft: #666B75;
  --ink-faint: #9AA0AB;
  --bg: #F7F7F7;             /* near-white */
  --bg-soft: #F1F1F1;
  --card: #FFFFFF;
  --line: #ECECEC;
  --line-strong: #DEDEDE;
  --good: #2EA85B;
  --bad: #E25541;

  /* pastels — exact dashboard hexes */
  --lilac: #D8CCF5;
  --peach: #FDDBC7;
  --butter: #FFEEBD;
  --sky: #C7E8F8;
  --pink: #FDD4E0;
  --mint: #9FE5BD;

  --radius: 22px;
  --radius-lg: 22px;
  --radius-sm: 14px;
  --shadow-sm: 0 1px 2px rgba(18,20,25,.04);
  --shadow: 0 4px 12px rgba(18,20,25,.06);
  --shadow-lg: 0 12px 32px rgba(18,20,25,.08);
  --shadow-press: 0 1px 2px rgba(18,20,25,.06);

  /* animation tokens (1:1 from reference) */
  --animate-bounce-small: bounceSmall .5s ease-in-out;
  --animate-bubble-in: bubbleIn .3s cubic-bezier(.17,.67,.32,1.94);
  --animate-fade-in-rotate: fadeInWithRotate .6s ease-in-out forwards;
  --animate-fade-in-seq: fadeInSequential .6s ease-in-out forwards;
  --animate-opacity-in: opacityIn .5s ease-in-out both;
  --animate-popup-in: popupIn .2s cubic-bezier(.66,0,0,1);
  --animate-pulse-effect: pulseEffect 1.25s cubic-bezier(.66,0,0,1) infinite;
  --animate-pulse-opacity: pulseOpacity 2s ease-in-out infinite;
  --animate-pulse-scale: pulseScale .6s ease-in-out;
  --animate-pulse: pulse 2s cubic-bezier(.4,0,.6,1) infinite;
  --animate-slide-in-left: slideInLeft .5s ease-out both;
  --animate-slide-in-right: slideInRight .5s ease-out both;
  --animate-spin: spin 1s linear infinite;
  --ease-step: cubic-bezier(.4,0,.2,1);
}

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

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Baloo2", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  height: 100dvh;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

/* phone-width column, locked to one viewport height (no page scroll) */
#app {
  width: 100%;
  max-width: 460px;
  height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ---------- step container + slide transitions ---------- */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 14px 20px 20px;
  overflow: hidden;
}
.screen.enter-right { animation: slideInRight .45s var(--ease-step) both; }
.screen.enter-left  { animation: slideInLeft  .45s var(--ease-step) both; }
.screen.leave-left  { animation: slideOutLeft  .35s var(--ease-step) both; }
.screen.leave-right { animation: slideOutRight .35s var(--ease-step) both; }

/* zones: title + graphic up top, controls docked to the thumb — the whole
   step fits one viewport. The graphic flexes to fill leftover space and
   shrinks to nothing when the controls are tall, so nothing ever scrolls. */
.s-top {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 6px 0 8px;
}
.s-top > .title { margin-top: 2px; flex: 0 0 auto; }
.s-top > .subtitle { flex: 0 0 auto; }
.s-bottom {
  flex: 0 0 auto;               /* keep every option + button visible (no shrink) */
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  overflow: visible;            /* don't clip the select-pop horizontally */
}
/* By default the list does NOT scroll, so the select-pop can grow freely into
   the screen's side padding without being clipped. Only when a list is too
   tall to fit does JS add `.needs-scroll`, which scrolls it vertically. */
.s-bottom > .option-list,
.s-bottom > .card-grid {
  flex: 0 1 auto;
  min-height: 0;
  overflow: visible;
  padding: 6px 0;
}
.s-bottom > .option-list.needs-scroll,
.s-bottom > .card-grid.needs-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 6px 8px;
  margin: 0 -8px;
}
.s-bottom > .btn,
.s-bottom > .skip-btn,
.s-bottom > .policy { flex: 0 0 auto; }
/* paywall scrolls as one long page */
.screen.paywall { overflow-y: auto; }

/* full-screen takeover components fill the top zone and push their CTA to the thumb */
.fullscreen { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }

/* ---------- nav bar + progress ---------- */
.navbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  flex: 0 0 auto;
}
.nav-back {
  width: 40px; height: 40px;
  border: none; background: transparent;
  font-size: 24px; color: var(--ink);
  cursor: pointer; border-radius: 50%;
  display: grid; place-items: center;
  transition: background .15s;
}
.nav-back:active { background: rgba(0,0,0,.06); }
.nav-back.hidden { visibility: hidden; }
/* progress bar — mirrors the app onboarding bar (capsule track, warming
   gradient fill, top gloss, glow, scale-pulse on each advance) */
.progress-track {
  flex: 1; height: 10px;
  background: rgba(255,199,46,.18); border-radius: 99px;
  overflow: visible;
}
.progress-fill {
  position: relative;
  height: 100%; border-radius: 99px;
  min-width: 12px; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  box-shadow: 0 2px 7px rgba(255,199,46,.45);
  transition: width .55s var(--ease-step), background .4s;
  transform-origin: center;
}
.progress-fill::after {
  content: ""; position: absolute; left: 1.5px; right: 1.5px; top: 1.5px; height: 42%;
  border-radius: 99px;
  background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,0));
}
.progress-fill.pulse { animation: progPulse .32s cubic-bezier(.34,1.4,.5,1) both; }
@keyframes progPulse { 0%,100% { transform: scaleY(1); } 45% { transform: scale(1.04, 1.18); } }
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 22px; letter-spacing: -.5px;
}
.nav-logo img { width: 30px; height: 30px; object-fit: contain; }

/* ---------- titles ---------- */
.title {
  font-size: 25px; line-height: 1.16; font-weight: 800;
  letter-spacing: -.6px; color: var(--ink);
  animation: var(--animate-fade-in-seq);
}
.title .block { display: block; }
.subtitle {
  margin-top: 10px; font-size: 15.5px; line-height: 1.45;
  font-weight: 500; color: var(--ink-soft);
  animation: var(--animate-fade-in-seq); animation-delay: .05s;
}
.small-text {
  font-size: 12.5px; color: var(--ink-faint);
  text-align: center; line-height: 1.4; font-weight: 500;
}
.big-title {
  font-size: 60px; font-weight: 800; letter-spacing: -2px; color: var(--ink);
  animation: var(--animate-pulse-scale);
}
.big-title .unit { color: var(--accent-dark); }

.flex-space { flex: 1 1 auto; min-height: 8px; }

/* ---------- option list ---------- */
.option-list { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 13px;
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 15px;
  cursor: pointer; box-shadow: var(--shadow-sm);
  text-align: left; width: 100%; font-family: inherit;
  transition: transform .12s var(--ease-step), border-color .15s, background .15s;
  animation: var(--animate-fade-in-seq); animation-fill-mode: both;
}
.option:hover { border-color: var(--line-strong); }
.option:active { transform: scale(.98); }
.option.selected {
  border-color: var(--accent);
  background: #FFFBEC;
  animation: pulseScale .4s ease-in-out;
}
.option .opt-icon {
  width: 38px; height: 38px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: var(--radius-xs, 10px);
  background: var(--butter); color: var(--accent-dark);
}
/* line-icon rendering (Lucide) */
i[data-lucide] { display: inline-flex; line-height: 0; }
.opt-icon svg { width: 20px; height: 20px; stroke-width: 2.2; }
.b-ic svg { width: 19px; height: 19px; stroke-width: 2.2; }
.b-ic { color: var(--good); display: inline-flex; }
.il-media svg { width: 60px; height: 60px; stroke-width: 1.8; color: var(--ink); }
.option .opt-icon img { width: 44px; height: 44px; object-fit: contain; border-radius: 12px; }
.option .opt-title { font-size: 16.5px; font-weight: 700; flex: 1; }
.option .opt-sub { font-size: 13px; font-weight: 500; color: var(--ink-soft); display: block; margin-top: 2px; }
.option .opt-check {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--line); flex: 0 0 auto;
  display: grid; place-items: center; color: #fff; font-size: 14px;
  transition: all .15s;
}
.option.selected .opt-check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* image option cards (age / body) */
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.img-card {
  background: var(--card); border: 2px solid transparent;
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow); font-family: inherit; padding: 0;
  transition: transform .12s, border-color .15s;
  animation: var(--animate-fade-in-seq); animation-fill-mode: both;
}
.img-card:active { transform: scale(.97); }
.img-card.selected { border-color: var(--accent); }
.img-card .ic-media {
  aspect-ratio: 1/1; display: grid; place-items: center; font-size: 56px;
  background: linear-gradient(160deg, var(--butter), var(--peach));
}
.img-card .ic-media img { width: 100%; height: 100%; object-fit: cover; }
.img-card .ic-label { padding: 12px; font-weight: 700; font-size: 15px; text-align: center; }

/* ---------- statement card (agree/disagree) ---------- */
.statement {
  background: var(--lilac); border: 1px solid var(--line);
  color: var(--ink); border-radius: var(--radius);
  padding: 26px 22px; font-size: 21px; font-weight: 800; line-height: 1.3; letter-spacing: -.3px;
  box-shadow: var(--shadow-sm); animation: var(--animate-popup-in);
}
.statement .quote-mark { font-size: 56px; line-height: .4; opacity: .35; display: block; }
.statement-actions { display: flex; gap: 12px; margin-top: 4px; }
.choice {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 10px; border-radius: var(--radius); border: 1.5px solid var(--line);
  background: var(--card); box-shadow: var(--shadow-sm); cursor: pointer; font-family: inherit;
  transition: transform .12s var(--ease-step), border-color .15s;
}
.choice:hover { border-color: var(--line-strong); }
.choice:active { transform: scale(.97); }
.choice-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.choice-ic svg { width: 21px; height: 21px; stroke-width: 2.4; }
.choice-agree .choice-ic { background: #E7F7EC; color: var(--good); }
.choice-disagree .choice-ic { background: #FDECEC; color: var(--bad); }
.choice-tx { font-size: 15px; font-weight: 800; color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  width: 100%; border: none; cursor: pointer; font-family: inherit;
  background: var(--accent); color: var(--accent-ink);
  font-size: 17px; font-weight: 800; letter-spacing: -.2px;
  border-radius: 99px; padding: 16px;
  line-height: 1.15;
  box-shadow: 0 5px 14px rgba(242,165,12,.26);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .16s var(--ease-step), box-shadow .16s, filter .16s;
}
.btn:hover { transform: scale(1.025); box-shadow: 0 8px 18px rgba(242,165,12,.34); filter: brightness(1.02); }
.btn:active { transform: scale(1.05); box-shadow: 0 10px 22px rgba(242,165,12,.38); }
.btn[disabled] { opacity: .4; pointer-events: none; box-shadow: none; transform: none; }
.btn.secondary { background: transparent; color: var(--ink-soft); box-shadow: none; font-weight: 700; }
.btn.secondary:hover { transform: none; filter: none; }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(3px); }
/* sticky-btn just adds a little gap above the docked button (no padding override) */
.sticky-btn { margin-top: 2px; }

.skip-btn { background: none; border: none; color: var(--ink-faint);
  font-weight: 600; font-size: 15px; text-align: center; padding: 14px; cursor: pointer; font-family: inherit; }

.policy { font-size: 11.5px; color: var(--ink-faint); text-align: center; line-height: 1.4; }
.policy a { color: var(--ink-soft); }

/* ---------- inputs ---------- */
.input-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.input-center { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }
/* centered "personalizing your plan" screen */
.personalizing { text-align: center; align-items: center; }
.personalizing .pz-title { text-align: center; }
.personalizing .plan-checklist { width: max-content; max-width: 100%; margin: 18px auto 0; text-align: left; }
.personalizing .reviews { width: 100%; }
.unit-toggle { display: inline-flex; background: #EDE7D8; border-radius: 99px; padding: 4px; }
.unit-toggle button {
  border: none; background: transparent; font-family: inherit; font-weight: 700;
  padding: 8px 20px; border-radius: 99px; cursor: pointer; color: var(--ink-soft); font-size: 15px;
}
.unit-toggle button.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-press); }
.big-input {
  font-family: inherit; font-size: 56px; font-weight: 800; text-align: center;
  border: none; background: transparent; width: 100%; color: var(--ink);
  letter-spacing: -2px; outline: none;
}
.big-input::placeholder { color: var(--ink-faint); }
.input-unit { font-size: 22px; font-weight: 700; color: var(--ink-soft); }
.dual-input { display: flex; gap: 12px; align-items: baseline; justify-content: center; }
.text-input {
  font-family: inherit; font-size: 20px; font-weight: 600; width: 100%;
  border: 2px solid var(--line); background: var(--card); border-radius: 14px;
  padding: 16px 18px; outline: none; transition: border-color .15s;
}
.text-input:focus { border-color: var(--accent); }

/* ---------- scrollable interstitial ---------- */
.interstitial { text-align: center; gap: 18px; display: flex; flex-direction: column; }
.interstitial .il-media {
  width: 100%; aspect-ratio: 1/1; max-height: 300px; border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--mint), var(--sky));
  display: grid; place-items: center; font-size: 90px;
  animation: var(--animate-opacity-in); overflow: hidden;
}
.interstitial .il-media img { width: 100%; height: 100%; object-fit: contain; }
.interstitial .il-media.has-img { background: transparent; box-shadow: none; }
.interstitial .il-media.has-img img { object-fit: contain; }
.interstitial-card {
  background: var(--card); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); text-align: left; animation: var(--animate-fade-in-seq); animation-fill-mode: both;
}
.bullet-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; }
.bullet-row .b-ic { font-size: 22px; }
.bullet-row .b-tx { font-size: 15px; font-weight: 500; color: var(--ink); line-height: 1.4; }
.bullet-row .b-tx b { font-weight: 800; }

/* ---------- processing ---------- */
.processing { display: flex; flex-direction: column; align-items: center; gap: 24px; padding-top: 8px; }
.proc-ring {
  width: 150px; height: 150px; border-radius: 50%;
  background: conic-gradient(var(--accent) var(--p,0%), #EAE3D4 0);
  display: grid; place-items: center; position: relative;
}
.proc-ring::after {
  content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--bg);
}
.proc-pct { position: relative; font-size: 34px; font-weight: 800; }
.proc-msgs { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.proc-msg {
  display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600;
  color: var(--ink-faint); transition: color .3s;
}
.proc-msg.active { color: var(--ink); }
.proc-msg.done { color: var(--ink); }
.proc-msg .pm-ic { width: 22px; height: 22px; display: grid; place-items: center; }
.proc-msg.done .pm-ic { color: var(--good); }
.spinner { width: 18px; height: 18px; border: 2.5px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: var(--animate-spin); }

/* checklist (personalizing plan) */
.plan-checklist { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.plan-checklist .pc-item { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 15px;
  opacity: .4; transition: opacity .4s; }
.plan-checklist .pc-item.on { opacity: 1; }
.pc-check { width: 26px; height: 26px; border-radius: 50%; background: var(--mint); color: #137a3f;
  display: grid; place-items: center; font-size: 15px; flex: 0 0 auto; }

/* ---------- reviews ---------- */
.reviews { display: flex; flex-direction: column; gap: 12px; }
.review {
  background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  animation: var(--animate-fade-in-seq); animation-fill-mode: both;
}
.review .rv-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.review .rv-av { width: 38px; height: 38px; border-radius: 50%; background: var(--peach);
  display: grid; place-items: center; font-weight: 800; }
.review .rv-name { font-weight: 700; font-size: 14.5px; }
.review .rv-stars { color: var(--accent); font-size: 13px; }
.review .rv-text { font-size: 14px; line-height: 1.45; color: var(--ink-soft); font-weight: 500; }

/* ---------- summary card / BMI ---------- */
.summary-card { background: var(--card); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow);
  animation: var(--animate-popup-in); }
.summary-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.summary-row:last-child { border-bottom: none; }
.summary-row .sr-k { color: var(--ink-soft); font-weight: 600; }
.summary-row .sr-v { font-weight: 800; }
.bmi-bar { height: 10px; border-radius: 99px; margin: 8px 0;
  background: linear-gradient(90deg, var(--sky), var(--mint), var(--butter), var(--peach), var(--bad)); position: relative; }
.bmi-dot { position: absolute; top: -4px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  border: 3px solid var(--ink); transform: translateX(-50%); }

/* ---------- graph (Chart.js, dashboard-matched) ---------- */
.graph-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 16px 12px; box-shadow: var(--shadow-sm); animation: var(--animate-popup-in); position: relative; }
.chart-wrap { position: relative; width: 100%; height: 220px; }
.chart-wrap canvas { width: 100% !important; height: 100% !important; }
.graph-callout { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 8px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; }
.graph-callout .gc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--ink); box-sizing: content-box; }
.graph-callout .gc-label { font-size: 12px; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .5px; }
.graph-callout .gc-val { font-size: 15px; font-weight: 800; color: var(--ink); }
.graph-callout .gc-date { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.graph-svg { width: 100%; height: auto; display: block; }
.graph-legend { display: flex; gap: 20px; justify-content: center; margin-top: 12px; }
.graph-legend .lg { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--ink-mid); }
.graph-legend .lg-dot { width: 11px; height: 11px; border-radius: 50%; }
.pc-cap.pop { animation: popBadge .4s cubic-bezier(.17,.67,.32,1.94) both; transform-box: fill-box; transform-origin: center; }
.pc-tag { transition: opacity .3s; }

/* ---------- goal hero graphic ---------- */
.graphic-img {
  flex: 1 1 auto; min-height: 0; max-height: 30vh; width: 100%;
  display: flex; align-items: center; justify-content: center;
  margin: auto 0;
  animation: var(--animate-fade-in-rotate);
}
.graphic-img img { max-height: 100%; max-width: 88%; object-fit: contain; }
/* realistic photo, framed in a soft rounded card */
.graphic-photo {
  flex: 1 1 auto; min-height: 0; max-height: 30vh; width: 100%;
  margin: auto 0; display: flex; align-items: center; justify-content: center;
  animation: var(--animate-opacity-in);
}
.graphic-photo img {
  max-height: 100%; width: 100%; object-fit: cover;
  border-radius: var(--radius); box-shadow: var(--shadow);
  aspect-ratio: 4/3;
}

/* ---------- reusable graphic placeholder (fallback) ---------- */
.graphic-ph {
  flex: 1 1 auto; min-height: 0; width: 100%; max-height: 230px;
  border-radius: var(--radius);
  border: 2px dashed var(--line-strong);
  background:
    linear-gradient(0deg, rgba(255,238,189,.5), rgba(255,238,189,.5)),
    repeating-linear-gradient(45deg, transparent 0 12px, rgba(0,0,0,.02) 12px 24px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  overflow: hidden;
  animation: var(--animate-opacity-in);
}
/* mascot scales with available height so a squeezed placeholder still looks right */
.gph-mascot { width: auto; height: 46%; max-height: 80px; min-height: 30px; object-fit: contain; opacity: .55; }
.gph-tag {
  font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  color: var(--ink-faint); padding: 3px 10px; background: rgba(255,255,255,.7); border-radius: 99px;
}
.graph-path { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: drawLine 1.6s ease-out forwards .2s; }
.graph-dot-end { opacity: 0; animation: opacityIn .4s ease-out forwards 1.6s; }
.graph-badge { fill: var(--accent); }
.gp-dot { filter: drop-shadow(0 1px 3px rgba(0,0,0,.25)); transition: opacity .2s; }
.gp-cal.pop { animation: popCal .35s cubic-bezier(.17,.67,.32,1.94) both; }
.gp-badge.pop-badge { animation: popBadge .5s cubic-bezier(.17,.67,.32,1.94) both; transform-box: fill-box; transform-origin: center; }
@keyframes popCal { 0%{opacity:0;transform:translateY(6px) scale(.6)} to{opacity:1;transform:translateY(0) scale(1)} }
@keyframes popBadge { 0%{opacity:0;transform:scale(.4)} 60%{transform:scale(1.15)} to{opacity:1;transform:scale(1)} }

/* ---------- reflect (mirror user's words) ---------- */
.reflect-block { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 6px; gap: 6px; }
.reflect-quote {
  background: var(--accent-soft); color: var(--ink);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 8px;
  font-size: 18px; font-weight: 700; line-height: 1.35; font-style: italic;
  box-shadow: var(--shadow-sm); animation: var(--animate-popup-in);
}
.reflect-title { text-align: center; }

/* ---------- welcome chat texts ---------- */
.welcome-wrap { display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.welcome-bubble {
  background: var(--card); border-radius: 20px 20px 20px 6px; padding: 14px 16px; box-shadow: var(--shadow);
  font-size: 15.5px; font-weight: 500; line-height: 1.45; max-width: 90%;
  opacity: 0; animation: var(--animate-fade-in-seq); animation-fill-mode: both;
}
.welcome-mascot { width: 64px; height: 64px; animation: var(--animate-bounce-small); }

/* ---------- mascot bubble (generic) ---------- */
.mascot-hero { width: auto; height: clamp(84px, 16vh, 140px); object-fit: contain; margin: 0 auto;
  flex: 0 1 auto; min-height: 0;
  animation: var(--animate-fade-in-rotate); }
.mascot-sm { width: 56px; height: 56px; object-fit: contain; }

/* ---------- scratch card ---------- */
.scratch-stage { position: relative; width: 100%; aspect-ratio: 1.6/1; border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow); }
.scratch-prize { position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  background: radial-gradient(circle at 50% 40%, #FFF6DD, #FFE9A8); }
.scratch-prize .sp-off { font-size: 60px; font-weight: 800; color: var(--accent-deep); letter-spacing: -2px; }
.scratch-prize .sp-cap { font-size: 18px; font-weight: 700; }
.scratch-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }

/* ---------- paywall ---------- */
.paywall { padding: 0; }
.pw-section { padding: 22px 20px; }
.pw-hero { text-align: center; }
.before-after { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ba-col { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.ba-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.ba-col.now h4 { color: var(--bad); }
.ba-col.goal h4 { color: var(--good); }
.ba-li { display: flex; gap: 8px; font-size: 13.5px; font-weight: 500; padding: 5px 0; }

.plan-options { display: flex; flex-direction: column; gap: 12px; }
.plan {
  display: flex; align-items: center; gap: 14px; background: var(--card);
  border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer;
  position: relative; transition: border-color .15s, background .15s;
}
.plan.selected { border-color: var(--accent); background: #FFFBF0; }
.plan .pl-radio { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); flex: 0 0 auto;
  display: grid; place-items: center; }
.plan.selected .pl-radio { border-color: var(--accent); }
.plan.selected .pl-radio::after { content:""; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.plan .pl-body { flex: 1; }
.plan .pl-name { font-weight: 800; font-size: 16px; }
.plan .pl-sub { font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.plan .pl-price { text-align: right; }
.plan .pl-per { font-weight: 800; font-size: 17px; }
.plan .pl-perunit { font-size: 12px; color: var(--ink-soft); }
.plan .pl-badge { position: absolute; top: -10px; right: 14px; background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 99px; }

.guarantee { background: #F0FAF2; border: 1px solid #CDEBD6; border-radius: var(--radius); padding: 18px;
  text-align: center; font-size: 14px; font-weight: 600; color: #1f7a44; }
.trust-logos { display: flex; justify-content: center; gap: 18px; align-items: center; flex-wrap: wrap;
  filter: grayscale(1); opacity: .6; font-weight: 700; font-size: 13px; }
.countdown { background: var(--ink); color: #fff; text-align: center; padding: 10px; font-weight: 700;
  position: sticky; top: 0; z-index: 5; font-size: 14px; }
.countdown b { color: var(--accent); }

#whop-checkout-mount { min-height: 60px; }

/* ============================================================
   KEYFRAMES (ported 1:1)
   ============================================================ */
@keyframes fadeInSequential { 0%{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
@keyframes fadeInWithRotate { 0%{opacity:0;transform:translateY(20px) rotate(0)} to{opacity:1;transform:translateY(0) rotate(-2deg)} }
@keyframes fadeInOutWithBounce { 0%,5%{opacity:0;transform:translateY(30px)} 30%,90%{opacity:1;transform:translateY(0)} 90%{transform:translateY(-5px)} to{opacity:0;transform:translateY(30px)} }
@keyframes bounceSmall { 0%,to{transform:translateY(0)} 50%{transform:translateY(-10px)} }
@keyframes pulseEffect { 0%{box-shadow:0 0 0 0 rgba(255,199,46,.5)} to{box-shadow:0 0 0 12px rgba(255,199,46,0)} }
@keyframes pulseOpacity { 0%,to{opacity:1} 50%{opacity:0} }
@keyframes popupIn { 0%{opacity:0;transform:translateY(80px)} to{opacity:1;transform:translate(0)} }
@keyframes wordIn { 0%{opacity:0;transform:translateY(-10px)} to{opacity:1;transform:translateY(0)} }
@keyframes bubbleIn { 0%{opacity:0;transform:translateY(-60px)} to{opacity:1;transform:translateY(0)} }
@keyframes opacityIn { 0%{opacity:0} to{opacity:1} }
@keyframes slideInLeft { 0%{opacity:0;transform:translateX(-100%)} to{opacity:1;transform:translateX(0)} }
@keyframes slideInRight { 0%{opacity:0;transform:translateX(100%)} to{opacity:1;transform:translateX(0)} }
@keyframes slideOutLeft { 0%{opacity:1;transform:translateX(0)} to{opacity:0;transform:translateX(-40%)} }
@keyframes slideOutRight { 0%{opacity:1;transform:translateX(0)} to{opacity:0;transform:translateX(40%)} }
@keyframes pulseScale { 0%{transform:scale(1)} 50%{transform:scale(1.035)} to{transform:scale(1)} }
@keyframes spin { to{transform:rotate(360deg)} }
@keyframes pulse { 50%{opacity:.5} }
@keyframes drawLine { to{stroke-dashoffset:0} }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
