@font-face {
  font-family: Geist;
  src: url("../api/console/fonts/geist-sans/Geist-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --paper: #F7F7FB;
  --card: #FFFFFF;
  --ink: #13131A;
  --muted: #6B6B7B;
  --line: #ECEAF3;
  --brand: #B84A05;
  --brand-hover: #9A3E04;
  --peach: #FFD5BD;
  --peach-soft: #FFECE1;
  --danger: #B42318;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: Geist, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
button, input { font: inherit; color: inherit; }

.top {
  height: 64px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding: 0 16px;
  max-width: 560px;
  margin: 0 auto;
}
.brand {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.5px;
  color: var(--ink);
  text-decoration: none;
}
.brand img { border-radius: 7px; }
.back {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.back:hover { background: var(--line); }
.step-count { justify-self: end; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.progress { height: 3px; background: var(--line); }
.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brand);
  transition: width 0.35s ease;
}

.stage {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 16px 120px;
  animation: enter 0.3s ease;
}
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  .stage { animation: none; }
  .progress span { transition: none; }
}

.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); margin: 0 0 10px; }
h1 { font-size: clamp(26px, 6vw, 34px); line-height: 1.12; letter-spacing: -1px; margin: 0 0 10px; }
.lead { color: var(--muted); font-size: 16px; line-height: 1.5; margin: 0 0 28px; }

.options { display: grid; gap: 10px; }
.option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 14px 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.option:hover { border-color: var(--peach); }
.option[aria-pressed="true"] { border-color: var(--brand); background: var(--peach-soft); }
.option .emoji { font-size: 26px; width: 34px; text-align: center; flex: none; }
.option strong { display: block; font-size: 16px; font-weight: 600; }
.option small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.option .check {
  margin-left: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  flex: none;
}
.option[aria-pressed="true"] .check { background: var(--brand); border-color: var(--brand); box-shadow: inset 0 0 0 4px var(--peach-soft); }

.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day {
  aspect-ratio: 1;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.day[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

.units { display: inline-flex; background: var(--line); border-radius: 10px; padding: 3px; margin-bottom: 22px; }
.units button { border: 0; background: transparent; padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 550; cursor: pointer; color: var(--muted); }
.units button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgb(19 19 26 / 0.08); }

.fields { display: grid; gap: 12px; grid-template-columns: 1fr; }
.fields.two { grid-template-columns: 1fr 1fr; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 550; color: var(--muted); }
.input-wrap { position: relative; }
.field input {
  width: 100%;
  height: 58px;
  padding: 0 56px 0 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  font-size: 20px;
  font-weight: 600;
  outline: none;
}
.field input.text { font-size: 16px; font-weight: 500; padding-right: 16px; }
.field input:focus { border-color: var(--brand); }
.field .suffix { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }
.hint { color: var(--muted); font-size: 13px; margin: 12px 0 0; line-height: 1.45; }
.error { color: var(--danger); font-size: 14px; margin: 14px 0 0; min-height: 1em; }

.footer {
  position: fixed;
  inset: auto 0 0 0;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--paper) 70%, rgb(247 247 251 / 0));
}
.footer-inner { max-width: 528px; margin: 0 auto; }
.cta {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
}
.cta:hover { background: var(--brand-hover); }
.cta:disabled { opacity: 0.45; cursor: not-allowed; }
.cta.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.cta.ghost:hover { background: var(--card); }
.link-button { background: none; border: 0; color: var(--brand); font-weight: 550; cursor: pointer; padding: 0; text-decoration: underline; }

/* Plan reveal */
.plan-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 14px;
}
.kcal { display: flex; align-items: baseline; gap: 8px; }
.kcal b { font-size: 48px; letter-spacing: -2px; line-height: 1; font-variant-numeric: tabular-nums; }
.kcal span { color: var(--muted); }
.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.macro { background: var(--paper); border-radius: 12px; padding: 12px; }
.macro small { display: block; color: var(--muted); font-size: 12px; }
.macro b { font-size: 20px; font-variant-numeric: tabular-nums; }
.macro i { display: block; height: 4px; border-radius: 2px; margin-top: 8px; background: var(--peach); }
.macro i::after { content: ""; display: block; height: 100%; border-radius: 2px; background: var(--brand); width: var(--w); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.stat b { font-size: 18px; }
.chart { width: 100%; height: auto; display: block; margin-top: 10px; }




/* Done */
.done-hero { text-align: center; }
.done-hero .icon-unused { width: 84px; height: 84px; border-radius: 20px; margin: 8px auto 20px; display: block; box-shadow: 0 10px 30px rgb(184 74 5 / 0.18); }
.steps { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 12px; text-align: left; }
.steps li { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; line-height: 1.45; }
.steps .n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--peach-soft); color: var(--brand); font-weight: 700; display: grid; place-items: center; font-size: 13px; }
.email-pill { display: inline-block; background: var(--peach-soft); border-radius: 8px; padding: 2px 8px; font-weight: 600; word-break: break-all; }
.store-row { display: grid; gap: 10px; }
.legal { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 14px; text-align: center; }

@media (max-width: 380px) {
  .days { gap: 5px; }
  .macros { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .kcal b { font-size: 40px; }
}
[hidden] { display: none !important; }

/* ── v3: photo cards, wheels, insight screens ───────────────────────── */
.stage h1 { margin-bottom: 8px; }
.center { display: flex; justify-content: center; }
.progress { max-width: 528px; margin: 0 auto; border-radius: 2px; overflow: hidden; }
.step-count { grid-column: 3; white-space: nowrap; }
.top { grid-template-columns: 44px 1fr 90px; }

.photo-options { display: grid; gap: 12px; margin-top: 22px; }
.photo-option {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 132px;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.photo-option:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgb(19 19 26 / 0.06); }
.photo-option[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px var(--peach-soft); }
.po-text { position: relative; z-index: 1; padding: 0 20px; max-width: 58%; }
.po-text strong { display: block; font-size: 19px; font-weight: 650; letter-spacing: -0.3px; }
.po-text small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; line-height: 1.35; }
.po-img { position: absolute; inset: 0 0 0 auto; width: 48%; }
.po-img img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }
.po-img::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 45%;
  background: linear-gradient(to right, var(--card), rgb(255 255 255 / 0));
  z-index: 1;
}

.insight-hero { border-radius: 20px; overflow: hidden; aspect-ratio: 16 / 10; margin-bottom: 22px; background: var(--peach-soft); }
.insight-hero.short { aspect-ratio: 16 / 7; }
.insight-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.points { list-style: none; padding: 0; margin: -8px 0 0; display: grid; gap: 10px; }
.points li { position: relative; padding: 12px 14px 12px 44px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; font-size: 15px; }
.points li::before { content: "✓"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; border-radius: 50%; background: var(--peach-soft); color: var(--brand); font-size: 12px; font-weight: 700; display: grid; place-items: center; }

.big-value { text-align: center; font-size: 56px; font-weight: 700; letter-spacing: -2px; margin: 14px 0 6px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.big-value small { font-size: 20px; font-weight: 550; color: var(--muted); letter-spacing: 0; margin-left: 6px; }
.tip { min-height: 78px; }
.tip-card { display: grid; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.tip-card strong { color: var(--ink); font-size: 14px; }
.tip-card.good { border-color: #CDE9D6; background: #F3FBF5; }
.tip-card.warn { border-color: var(--peach); background: var(--peach-soft); }
.tip-card.info { border-color: #D6E4F5; background: #F4F8FD; }

.wheel-host { position: relative; margin-top: 18px; height: 220px; }
.wheel {
  height: 220px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  outline: none;
  mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
}
.wheel::-webkit-scrollbar { display: none; }
.wheel-pad { height: 88px; }
.wheel-row { height: 44px; display: grid; place-items: center; scroll-snap-align: center; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; will-change: transform, opacity; }
.wheel-lens { position: absolute; left: 0; right: 0; top: 88px; height: 44px; border-radius: 12px; background: var(--peach-soft); z-index: -1; pointer-events: none; }
.wheel-host { isolation: isolate; }
.wheel:focus-visible + .wheel-lens { box-shadow: 0 0 0 2px var(--brand); }

.field input.text { height: 56px; width: 100%; padding: 0 16px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--card); font-size: 16px; outline: none; }

.loading { display: grid; justify-items: center; text-align: center; padding-top: 28px; position: relative; }
.ring { width: 150px; height: 150px; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--line); stroke-width: 8; }
.ring-fill { fill: none; stroke: var(--brand); stroke-width: 8; stroke-linecap: round; }
.ring-pct { position: absolute; top: 28px; height: 150px; display: grid; place-items: center; margin: 0; font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; }
.loading h1 { margin-top: 22px; font-size: 24px; }
.checklist { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; text-align: left; width: min(320px, 100%); }
.checklist li { display: flex; gap: 12px; align-items: center; color: var(--muted); transition: color 0.3s; }
.checklist .tick { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; transition: background 0.3s, border-color 0.3s; flex: none; }
.checklist li.done { color: var(--ink); }
.checklist li.done .tick { background: var(--brand); border-color: var(--brand); }
.checklist li.done .tick::after { content: "✓"; color: #fff; font-size: 12px; font-weight: 700; }

.chart-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.2s 0.2s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.mail-icon { font-size: 44px; margin: 10px 0 12px; }
@media (prefers-reduced-motion: reduce) {
  .chart-line { animation: none; stroke-dashoffset: 0; }
  .photo-option, .checklist li, .checklist .tick { transition: none; }
}
@media (max-width: 380px) {
  .photo-option { height: 118px; }
  .po-text strong { font-size: 17px; }
  .big-value { font-size: 48px; }
}
/* Keep the header grid stable: a hidden back button still holds its column. */
.back[hidden] { display: grid !important; visibility: hidden; }
.brand { grid-column: 2; }
.po-img::before { width: 60%; background: linear-gradient(to right, var(--card) 10%, rgb(255 255 255 / 0)); }
.photo-option { height: 148px; }
.po-img img[src$="/male.webp"] { object-position: center 6%; }
.po-img img[src$="lose.webp"] { object-position: center 30%; }
.po-img img[src$="tone.webp"] { object-position: center 55%; }
/* A transform on .stage would make it the containing block for the fixed
   footer, so the CTA jumps mid-screen while a step animates in. Fade only. */
@keyframes enter { from { opacity: 0; } }
/* Fade the photo into the card with a mask instead of a white overlay, which
   left a hairline where the photo's grey studio backdrop began. */
.po-img::before { display: none; }
.po-img img { -webkit-mask-image: linear-gradient(to right, transparent, #000 55%); mask-image: linear-gradient(to right, transparent, #000 55%); }
.insight-hero img[src$="/done.webp"] { object-position: center 18%; }

/* v5: smoother step changes */
.spinner { width: 56px; height: 56px; border-radius: 50%; border: 5px solid var(--peach); border-top-color: var(--brand); animation: spin 0.9s linear infinite; margin-bottom: 18px; }
@keyframes spin { to { transform: rotate(360deg); } }
::view-transition-old(root) { animation: 180ms ease both vt-out; }
::view-transition-new(root) { animation: 260ms 60ms ease both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }
.photo-option:active, .option:active, .day:active, .cta:active { transform: scale(0.98); }
button { -webkit-tap-highlight-color: transparent; }
html { overscroll-behavior-y: none; }
.insight-hero img[src$="/pace.webp"] { object-position: center 5%; }
