/* ============================================================
   CamPlan Web Funnel - brand tokens mirrored from design-system.css
   ============================================================ */
:root {
  --color-bg: #ffffff;
  --color-text: #000000;
  --color-text-muted: #6b6b6b;
  --color-text-subtle: #767676; /* 4.5:1 on white - WCAG AA for small text */
  --color-accent: #a55538;
  --color-accent-hover: #8d4a31;
  --color-accent-soft: #f1ede6;
  --color-surface-soft: #fafaf7;
  --color-green: #2e7d32;
  --color-line: rgba(0, 0, 0, 0.08);
  --color-line-strong: rgba(0, 0, 0, 0.14);
  --glass-bg: rgba(255, 255, 255, 0.78);
  --glass-blur: saturate(200%) blur(40px);
  --shadow-md: 0 10px 40px rgba(0, 0, 0, 0.04), 0 2px 4px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.03);
  --shadow-accent: 0 10px 30px rgba(165, 85, 56, 0.25);
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-full: 9999px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button { touch-action: manipulation; }
/* keyboard/switch-control users get a visible focus ring; taps don't */
:focus-visible { outline: 2.5px solid var(--color-accent); outline-offset: 2px; }

html, body { height: 100%; overscroll-behavior: none; }

body {
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.45;
  color: var(--color-text);
  background: var(--color-surface-soft);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  max-width: 520px;
  margin: 0 auto;
  background: var(--color-surface-soft);
  overflow: hidden;
}

/* ---------- Header ---------- */
header {
  position: relative;
  z-index: 10;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  height: calc(var(--header-h) + var(--safe-top));
  padding: var(--safe-top) 16px 0 8px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--color-line);
  transition: opacity 320ms var(--ease);
}
header.hidden { opacity: 0; pointer-events: none; }
/* On the hero and past the auth screen the header must not even reserve space */
body.on-hero header, body.no-chrome header { display: none; }

#backBtn {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border: none; background: none;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: opacity 180ms var(--ease), background 180ms var(--ease);
}
#backBtn:active { background: var(--color-accent-soft); }
#backBtn.hidden { opacity: 0; pointer-events: none; }
#backBtn svg { width: 22px; height: 22px; }


.progress-track {
  flex: 1 1 auto;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--color-accent-soft);
  overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  transition: width 480ms var(--ease);
}

/* ---------- Screens ---------- */
main { position: relative; flex: 1 1 auto; overflow: hidden; }

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 22px calc(120px + var(--safe-bottom));
}
.screen.active { display: flex; animation: screenIn 480ms var(--ease-out) both; }
.screen.active.back-nav { animation: screenInBack 480ms var(--ease-out) both; }
/* children never shrink to fit - short screens scroll instead */
.screen > * { flex-shrink: 0; }

@keyframes screenIn {
  from { opacity: 0; transform: translateX(46px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes screenInBack {
  from { opacity: 0; transform: translateX(-46px); }
  to   { opacity: 1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .screen.active, .screen.active.back-nav { animation: none; }
}

.screen.active > * { animation: rise 560ms var(--ease-out) both; }
.screen.active > *:nth-child(2) { animation-delay: 60ms; }
.screen.active > *:nth-child(3) { animation-delay: 120ms; }
.screen.active > *:nth-child(4) { animation-delay: 180ms; }
.screen.active > *:nth-child(5) { animation-delay: 240ms; }
.screen.active > *:nth-child(6) { animation-delay: 300ms; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) { .screen.active > * { animation: none; } }

/* ---------- Typography ---------- */
.eyebrow {
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 10px;
}
h1 {
  font-size: 30px; line-height: 1.14; letter-spacing: -0.02em; font-weight: 800;
  margin-bottom: 12px;
}
h2 {
  font-size: 25px; line-height: 1.18; letter-spacing: -0.02em; font-weight: 800;
  margin-bottom: 8px;
}
.sub { font-size: 16px; color: var(--color-text-muted); margin-bottom: 20px; }

/* ---------- Answer options ---------- */
.options { display: flex; flex-direction: column; gap: 10px; }
/* question screens without a subheadline: give the options some air */
h2 + .options { margin-top: 12px; }

.opt {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  padding: 15px 18px;
  background: var(--color-bg);
  border: 1.5px solid var(--color-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-family: var(--font-text);
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms var(--ease), border-color 160ms var(--ease), background 160ms var(--ease);
}
.opt:active { transform: scale(0.975); }
.opt.selected { border-color: var(--color-accent); background: var(--color-accent-soft); }
.opt .ico {
  flex: 0 0 44px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: var(--color-accent-soft);
  border-radius: 14px;
  color: var(--color-accent);
}
.opt .ico svg { width: 22px; height: 22px; }
.opt.selected .ico { background: #fff; }
.opt .lbl { flex: 1 1 auto; }
.opt .lbl small {
  display: block; font-size: 13.5px; font-weight: 500;
  color: var(--color-text-muted); margin-top: 1px;
}
.opt .check {
  flex: 0 0 24px; width: 24px; height: 24px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-line-strong);
  display: flex; align-items: center; justify-content: center;
  transition: all 160ms var(--ease);
}
.options[data-multi] .opt .check { border-radius: 8px; }
.opt.selected .check { border-color: var(--color-accent); background: var(--color-accent); }
.opt.selected .check::after {
  content: ""; width: 10px; height: 6px;
  border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

/* 2-column grid for long lists (job, company size, volume) */
/* equal-height rows: every card matches the tallest (wrapped labels) */
.options.grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 10px; }
.options.grid .opt {
  flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 16px 10px 14px;
  text-align: center;
  font-size: 14.5px; line-height: 1.22;
}
.options.grid .opt .ico { flex: 0 0 auto; width: 40px; height: 40px; font-size: 20px; border-radius: 12px; }
.options.grid .opt .ico svg { width: 20px; height: 20px; }
.options.grid .opt .check { display: none; }
/* In-app browsers (Instagram/Facebook) stack their own toolbars above and
   below the page, leaving a short viewport: compact the question screens so
   a full option list (h2 + sub + ~6 options) fits without hunting - the
   screen still scrolls if it must, but scrolling shouldn't be the default
   way to see the answers. */
@media (max-height: 700px) {
  h2 { font-size: 22px; }
  .sub { font-size: 15px; margin-bottom: 12px; }
  .options { gap: 8px; }
  .opt { padding: 11px 14px; font-size: 16px; gap: 12px; }
}

/* ---------- Media / video cards ---------- */
.media-card {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 6px auto 18px;
  aspect-ratio: 9 / 16;
  max-height: 46dvh;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-accent-soft);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-line);
}
.media-card video, .media-card img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
/* Benefit/value screens: the video card grows to fill everything between
   the title and the bottom CTA (the screen's bottom padding reserves the
   CTA area). The max-height mirrors the max-width through the 9:16 ratio,
   so the box can never grow out of proportion and crop the video. */
.value-screen .media-card {
  flex: 1 1 auto;
  min-height: 200px;
  width: auto;
  height: auto;
  max-width: min(100%, 340px);
  max-height: min(604px, calc((min(100vw, 520px) - 44px) * 16 / 9));
  aspect-ratio: 9 / 16;
  align-self: center;
  margin: 6px 0 0;
}
/* The goal-cards lander sits on pure white (app shell behind the hidden
   header; on-hero is toggled by render() for that screen) */
body.on-hero #app { background: #fff; }
body.on-hero footer { background: linear-gradient(to top, #ffffff 62%, rgba(255,255,255,0)); }

.rating-row {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 6px;
}
/* wreath.svg is the left-side branch - the right copy is mirrored */
.rating-row .wreath { height: 68px; width: auto; opacity: 0.85; }
.rating-row .wreath.flip { transform: scaleX(-1); }
.rating-stack {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.rating-stack .rating-big { font-size: 29px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.rating-stack .stars { font-size: 16px; letter-spacing: 2px; }
.rating-stack .note { font-size: 12.5px; font-weight: 600; color: var(--color-text-muted); letter-spacing: -0.01em; }
.stars { color: #e8a33d; font-size: 15px; letter-spacing: 1.5px; }

/* ---------- Goal photo cards (variant D's lander) ---------- */
#s-goal-cards { text-align: center; padding-top: 14px; background: #fff; }
/* balance the lander vertically (no footer here); the flex spacers shrink
   to nothing on short viewports so content scrolls normally instead of
   clipping at the top */
#s-goal-cards::before { content: ""; flex: 0.6 1 0; }
#s-goal-cards::after { content: ""; flex: 1 1 0; }
#s-goal-cards .hero-logo {
  width: 58px; height: 58px; border-radius: 15px;
  margin: 0 auto 14px;
  box-shadow: var(--shadow-md);
}
#s-goal-cards h1 { font-size: 28px; }
#s-goal-cards .sub { margin-bottom: 10px; }
/* the explicit question right above the cards - the tap prompt */
.gc-q { font-size: 17.5px; font-weight: 700; letter-spacing: -0.01em; }
.options.goal-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.options.goal-cards .opt {
  flex-direction: column; align-items: stretch; gap: 0;
  padding: 0; overflow: hidden;
}
/* cutout photos sit on the soft accent tint, flush against the label bar */
.gc-img { display: block; background: var(--color-accent-soft); padding: 14px 8px 0; }
.gc-img img { display: block; width: 100%; height: auto; }
.gc-bar {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 11px 8px 12px;
  background: var(--color-accent); color: #fff;
  font-size: 17px; font-weight: 700; letter-spacing: -0.01em;
}
.gc-main { display: flex; align-items: center; justify-content: center; gap: 8px; }
.gc-bar small { font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, 0.88); }
.opt:active .gc-bar { background: var(--color-accent-hover); }
.gc-arr {
  width: 8px; height: 8px;
  border-top: 2.5px solid #fff; border-right: 2.5px solid #fff;
  transform: rotate(45deg);
}
.gc-terms { font-size: 12.5px; color: var(--color-text-subtle); margin-top: 16px; }
.gc-terms a { color: inherit; text-decoration: underline; }
@media (max-height: 700px) {
  #s-goal-cards .hero-logo { width: 46px; height: 46px; }
  #s-goal-cards h1 { font-size: 24px; }
  #s-goal-cards .sub { margin-bottom: 6px; }
  .gc-q { font-size: 16px; }
  .gc-img { padding-top: 10px; }
  .gc-bar { font-size: 16px; padding: 9px 8px 10px; }
  .gc-bar small { font-size: 12.5px; }
  .gc-terms { margin-top: 8px; }
}

/* ---------- Social proof interstitial ---------- */
.proof-num {
  font-size: 33px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1;
  color: var(--color-accent);
  margin-top: 10px;
}
.proof-sub { font-size: 17px; color: var(--color-text-muted); margin: 6px 0 16px; }

/* ---------- Value / interstitial screens ---------- */
.value-screen { text-align: center; }
.stat-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-size: 14px; font-weight: 700;
  border-radius: var(--radius-full);
  margin: 0 auto 14px;
}

/* ---------- Vertical comparison chart (mirrors the app's final view) ---------- */
.vchart {
  display: flex; justify-content: center; align-items: flex-end; gap: 34px;
  margin: 20px 0 4px;
}
.vbar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 110px; }
.vbar-track {
  width: 102px; height: min(34dvh, 300px);
  background: rgba(0,0,0,0.07);
  border-radius: 14px;
  overflow: hidden;
  display: flex; align-items: flex-end;
}
/* Inside the results card keep the chart compact */
.chart-card .vbar-track { width: 72px; height: 130px; }
.vbar-emoji { font-size: 20px; line-height: 1; height: 24px; }
.chart-card .vchart { margin: 12px 0 2px; gap: 26px; }
.sv-chart { width: 100%; height: auto; display: block; margin-top: 8px; }
.sv-line { stroke-dasharray: 620; stroke-dashoffset: 620; animation: drawLine 1.4s var(--ease-out) 0.3s forwards; }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .sv-line { animation: none; stroke-dashoffset: 0; } }
.vbar-fill { width: 100%; height: var(--h, 100%); border-radius: 14px; animation: growV 1.5s var(--ease-out) both; }
.vbar-fill.old { background: linear-gradient(to bottom, #b3ada2, #8f8a80); animation-delay: 350ms; }
.vbar-fill.new { background: linear-gradient(to bottom, #c2704e, var(--color-accent)); animation-delay: 750ms; }
@keyframes growV { from { height: 0; } }
@media (prefers-reduced-motion: reduce) { .vbar-fill { animation: none; } }
.vbar-time { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; margin-top: 2px; }
.vbar-name { font-size: 13px; font-weight: 600; color: var(--color-text-muted); line-height: 1.2; }
.improve {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--color-green); font-weight: 700; font-size: 16px;
  margin-top: 16px;
  animation: rise 600ms var(--ease-out) 1500ms both;
}
.improve .up {
  width: 22px; height: 22px; border-radius: var(--radius-full);
  background: var(--color-green); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px;
}

/* ---------- Solution rows (pain → fix) ---------- */
.feature-list { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.fl-item {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-md);
  font-size: 15px;
}
.fl-item .fi {
  font-size: 19px; flex: 0 0 38px;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-accent-soft); border-radius: 11px;
}
.fl-item b { display: block; font-size: 15.5px; letter-spacing: -0.01em; }
.fl-item span { color: var(--color-text-muted); font-size: 14px; }

/* ---------- Social proof ---------- */
.rating-hero { text-align: center; margin: 8px 0 18px; }
.rating-num { font-size: 54px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.rating-hero .stars { font-size: 20px; letter-spacing: 3px; display: block; margin: 8px 0 6px; }
.rating-sub { font-size: 14px; color: var(--color-text-muted); }
.review-card {
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 18px;
  margin-bottom: 12px;
  text-align: left;
}
.review-card .stars { font-size: 13px; letter-spacing: 2px; margin-bottom: 8px; display: block; }
.review-card .rv-title { display: block; font-size: 16px; letter-spacing: -0.01em; margin-bottom: 4px; }
.review-card .quote { font-size: 15.5px; line-height: 1.45; font-weight: 500; letter-spacing: -0.01em; color: var(--color-text-muted); }
.review-card .rv-date { font-size: 12.5px; color: var(--color-text-subtle); margin-top: 10px; }
.review-card .author { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.author b { display: block; font-size: 14px; }
.author span { font-size: 12.5px; color: var(--color-text-muted); }

/* ---------- Before/After comparison ---------- */
.compare {
  position: relative;
  width: 100%;
  max-width: 340px;
  margin: 8px auto 4px;
  aspect-ratio: 3 / 4;
  max-height: 48dvh;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-line);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.compare img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; pointer-events: none;
}
.compare .before-img { clip-path: inset(0 calc(100% - var(--split, 50%)) 0 0); }
.compare .divider {
  position: absolute; top: 0; bottom: 0;
  left: var(--split, 50%);
  width: 3px; margin-left: -1.5px;
  background: #fff;
  box-shadow: 0 0 12px rgba(0,0,0,0.35);
  pointer-events: none;
}
.compare .knob {
  position: absolute; top: 50%; left: var(--split, 50%);
  transform: translate(-50%, -50%);
  width: 46px; height: 46px;
  border-radius: var(--radius-full);
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.28);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  color: var(--color-accent);
  font-weight: 800; font-size: 15px;
}
.compare .tag {
  position: absolute; top: 12px;
  padding: 5px 12px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  border-radius: var(--radius-full);
  background: rgba(0,0,0,0.55);
  color: #fff;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  pointer-events: none;
}
.compare .tag.before { left: 12px; }
.compare .tag.after { right: 12px; background: var(--color-accent); }
/* AI designer showcase: the composite carries its own shadows/tilt, so no
   card frame - just a sized image with a soft entrance, and a chips row
   showing the feature's breadth without another paragraph. */
/* The composite webp carries its own whitespace around the baked-in arrow,
   so the screen supplies almost none: tightened sub margin + zero top
   margin pull the image/prompt/chips block up toward the copy. */
#s-ai .sub { margin-bottom: 6px; }
.ai-hero { margin: 0 auto; max-width: 380px; width: 100%; position: relative; z-index: 1; }
.ai-hero img {
  display: block; width: auto; max-width: 100%; height: auto;
  /* The composite is taller than wide (760x895): without a height cap it
     fills the full row width and pushes the prompt bar + chips - the
     screen's "how it works" payoff - under the footer CTA on phones.
     Same viewport-relative treatment as .compare's 48dvh. */
  max-height: min(38dvh, 400px);
  margin: 0 auto;
  animation: aiIn 600ms var(--ease-out) both 150ms;
}
/* Short phones (SE/mini height class): tighten the vertical rhythm so
   pill -> title -> composite -> prompt -> chips fits as one composition. */
@media (max-height: 720px) {
  #s-ai .stat-pill { margin-bottom: 10px; }
  .ai-hero img { max-height: 32dvh; }
  .ai-prompt { padding: 7px 7px 7px 16px; }
  .ai-prompt-text { font-size: 15px; }
}
@keyframes aiIn { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
/* Faux prompt bar - tucks slightly behind the composite's bottom edge */
.ai-prompt {
  display: flex; align-items: center; gap: 10px;
  /* Track the height-capped composite's width (h x 760/895) so the bar
     stays visually attached to it instead of jutting out on phones. */
  max-width: min(360px, 42dvh); width: calc(100% - 16px);
  margin: -10px auto 0; position: relative; z-index: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  padding: 9px 9px 9px 18px;
  animation: aiIn 500ms var(--ease-out) both 450ms;
}
.ai-prompt-text { flex: 1; min-width: 0; text-align: left; font-size: 16px; font-weight: 600; color: var(--color-text); white-space: nowrap; overflow: hidden; }
.ai-caret { display: inline-block; width: 2px; height: 1.05em; background: var(--color-accent); margin-left: 2px; vertical-align: -2px; animation: aiCaret 1s steps(1) infinite; }
@keyframes aiCaret { 50% { opacity: 0; } }
.ai-mic { width: 20px; height: 20px; color: var(--color-text-subtle); flex: 0 0 auto; }
.ai-send {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  background: var(--color-accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-accent);
}
.ai-send svg { width: 17px; height: 17px; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.ai-chip {
  font-size: 12.5px; font-weight: 600; color: var(--color-accent);
  background: var(--color-accent-soft);
  border: 1px solid var(--color-accent);
  border-radius: 999px; padding: 5px 12px;
  opacity: 0; animation: checkIn 420ms var(--ease-out) forwards;
}
.ai-chip:nth-child(1) { animation-delay: 500ms; }
.ai-chip:nth-child(2) { animation-delay: 620ms; }
.ai-chip:nth-child(3) { animation-delay: 740ms; }
.ai-chip:nth-child(4) { animation-delay: 860ms; }
@media (prefers-reduced-motion: reduce) { .ai-hero img, .ai-chip, .ai-prompt, .ai-caret { animation: none; opacity: 1; } }
.drag-hint {
  text-align: center; font-size: 13.5px; font-weight: 600;
  color: var(--color-text-muted); margin-top: 12px;
  animation: hintPulse 2s ease-in-out infinite;
}
@keyframes hintPulse { 0%,100% { opacity: 0.55; } 50% { opacity: 1; } }

/* ---------- Loading ---------- */
#s-loading { justify-content: center; text-align: center; }
.ring-wrap { position: relative; width: 132px; height: 132px; margin: 0 auto 28px; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--color-accent-soft); stroke-width: 9; }
.ring-fg {
  fill: none; stroke: var(--color-accent); stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: 364.4;
  stroke-dashoffset: 364.4;
  transition: stroke-dashoffset 300ms linear;
}
.ring-pct {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; letter-spacing: -0.02em;
}
.load-steps { display: flex; flex-direction: column; gap: 12px; margin-top: 26px; text-align: left; max-width: 330px; margin-left: auto; margin-right: auto; }
.load-step {
  display: flex; align-items: center; gap: 12px;
  font-size: 15px; font-weight: 600;
  color: var(--color-text-subtle);
  transition: color 300ms var(--ease);
}
.load-step .ls-check {
  width: 24px; height: 24px; flex: 0 0 auto;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-line-strong);
  display: flex; align-items: center; justify-content: center;
  transition: all 300ms var(--ease);
}
.load-step.done { color: var(--color-text); }
.load-step.done .ls-check { background: var(--color-accent); border-color: var(--color-accent); }
.load-step.done .ls-check::after {
  content: ""; width: 9px; height: 5px;
  border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

/* ---------- Results ---------- */
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 6px; }
.result-card {
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 14px;
}
.result-card .rc-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--color-text-subtle);
  margin-bottom: 4px;
}
.result-card .rc-value { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.result-card.wide { grid-column: 1 / -1; background: var(--color-accent-soft); border-color: transparent; }
.result-card.wide .rc-value { color: var(--color-accent); font-size: 17px; }
.chart-card {
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 20px 16px 18px;
  margin: 14px 0 4px;
  text-align: center;
}
.chart-card .chart-heading { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }

/* ---------- Footer CTA ---------- */
footer {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 10;
  padding: 14px 22px calc(16px + var(--safe-bottom));
  background: linear-gradient(to top, var(--color-surface-soft) 62%, rgba(250,250,247,0));
  display: flex; flex-direction: column; gap: 8px;
  transition: transform 320ms var(--ease), opacity 320ms var(--ease);
}
footer.hidden { transform: translateY(110%); opacity: 0; pointer-events: none; }

.cta {
  width: 100%;
  padding: 17px 24px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-text);
  font-size: 17.5px; font-weight: 700; letter-spacing: -0.01em;
  box-shadow: var(--shadow-accent);
  cursor: pointer;
  transition: transform 160ms var(--ease), background 160ms var(--ease), opacity 160ms var(--ease);
}
.cta:active { transform: scale(0.97); background: var(--color-accent-hover); }
.cta:disabled { opacity: 0.4; pointer-events: none; box-shadow: none; }
.cta-note { text-align: center; font-size: 12.5px; color: var(--color-text-subtle); }

/* ---------- Echo screens (fit + late + diag) ---------- */
/* BetterMe-style prose interstitial: small icon chip, left headline, short
   paragraphs with the key phrases accent-bolded (.insight). */
.echo-chip {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: var(--color-accent-soft);
  border-radius: var(--radius-full);
  margin-bottom: 14px;
  color: var(--color-accent);
}
.echo-chip svg { width: 22px; height: 22px; }
/* Insight prose (late screen + diag verdict): editorial paragraphs, left
   aligned, with the key number or phrase carried by an accent-colored bold
   instead of a separate stat block. */
.insight { font-size: 17px; line-height: 1.6; color: var(--color-text); text-align: left; margin: 0 0 14px; }
.insight b { color: var(--color-accent); }
.insight-block { margin-top: 14px; display: flex; flex-direction: column; text-align: left; width: 100%; }
.stat-src { font-size: 12px; color: var(--color-text-subtle); text-align: left; margin: -6px 0 0; }

/* ---------- Profile card (setup-so-far rows) ---------- */
.profile-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--color-line);
  font-size: 15px;
}
.profile-row:last-child { border-bottom: none; }
.profile-row .pl { color: var(--color-text-muted); font-weight: 600; }
.profile-row .pv { font-weight: 800; letter-spacing: -0.01em; text-align: right; }
.profile-row.dim .pv { color: var(--color-text-subtle); font-weight: 600; }
.profile-row.derived .pv { color: var(--color-accent); }

/* ---------- Marketing opt-in ---------- */
.optin-wrap { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 24px; }

/* ---------- Results prediction hero ---------- */
.predict { text-align: left; margin: 4px 0 16px; }
.predict-kicker { font-size: 14px; font-weight: 600; color: var(--color-text-muted); }
.predict-date {
  font-size: 34px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15;
  color: var(--color-accent);
  margin: 2px 0 6px;
}
.predict-line { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.4; }
.predict-note { font-size: 12px; color: var(--color-text-subtle); margin-top: 6px; }

/* ---------- Diagnosis screen ---------- */
.diag-analyzing {
  flex: 1 1 auto;
  min-height: 46dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
  font-size: 15px; font-weight: 600; color: var(--color-text-muted);
}
.diag-analyzing .co-spinner { margin: 0; }
#diagResult h2 { margin-bottom: 10px; }
.diag-sound { display: block; font-size: 16.5px; letter-spacing: -0.01em; margin: 16px 0 8px; }
.diag-recog-row {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 5px 0;
  font-size: 15.5px; line-height: 1.4; text-align: left;
}
.diag-recog-row .dot {
  flex: 0 0 7px; width: 7px; height: 7px; margin-top: 7px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
}
#s-name .auth-input { margin-top: 6px; }
.fix-item { opacity: 0; animation: checkIn 420ms var(--ease-out) forwards; }
@keyframes checkIn { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .fix-item { animation: none; opacity: 1; }
}

/* ---------- Auth ---------- */
/* No footer CTA on this screen - the buttons themselves sit at the bottom
   (same optical position as the quiz CTAs), with the logo animation
   filling the space between the copy and the buttons. */

/* 1:2 spacers park the logo block at the upper third of the screen */
.auth-space-1 { flex: 1 1 0; }
.auth-space-2 { flex: 2 1 0; }
.auth-lottie {
  min-height: 120px;
  display: flex; align-items: center; justify-content: center;
}
.auth-lottie > div, .auth-lottie svg { width: min(52vw, 230px) !important; height: auto !important; }
.auth-brand-name {
  text-align: center;
  font-size: 26px; font-weight: 800; letter-spacing: -0.02em;
  margin-top: 10px;
}
.auth-wrap { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
/* Quiz-style auth screen: normal flow under the h2/sub, footer CTA below. */
.auth-block { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.auth-block .auth-note { text-align: left; margin-top: 6px; }
#authSignedIn { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.auth-title { font-size: 20px; text-align: center; letter-spacing: -0.01em; margin-bottom: 4px; }
.btn-auth {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 15px 18px;
  border-radius: var(--radius-full);
  font-family: var(--font-text); font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer;
  border: 1.5px solid var(--color-line-strong);
  background: var(--color-bg); color: var(--color-text);
  box-shadow: var(--shadow-md);
  transition: transform 160ms var(--ease), opacity 160ms var(--ease);
}
.btn-auth:active { transform: scale(0.975); }
.btn-auth:disabled { opacity: 0.5; pointer-events: none; }
/* Winback return visit: outline the provider they originally used - the
   wrong provider on a new browser can mint a different Firebase account. */
.btn-auth.auth-preferred { border: 2px solid #B95E3C; }
.btn-auth svg { width: 20px; height: 20px; flex: 0 0 auto; }
.btn-auth.apple { background: #000; color: #fff; border-color: #000; }
.auth-form { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.auth-input {
  width: 100%; padding: 14px 16px;
  border: 1.5px solid var(--color-line-strong);
  border-radius: var(--radius-md);
  font-family: var(--font-text); font-size: 16px; /* 16px prevents iOS focus zoom */
  background: var(--color-bg); color: var(--color-text);
}
.auth-input:focus { outline: none; border-color: var(--color-accent); }
.auth-hint { font-size: 13px; color: var(--color-text-subtle); text-align: center; }
.auth-error {
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: #fdecea; color: #b3261e;
  font-size: 14px; font-weight: 600;
}
.auth-note { font-size: 12.5px; color: var(--color-text-subtle); text-align: center; margin-top: 8px; }
.auth-pw-step { display: flex; flex-direction: column; gap: 10px; }
.auth-domains { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -2px; }
.auth-domain {
  background: #fff; border: 1.5px solid var(--color-line-strong);
  border-radius: 999px; padding: 6px 12px; font-family: inherit; font-size: 13.5px;
  font-weight: 600; color: var(--color-text); cursor: pointer;
}
.auth-domain:active { transform: scale(0.97); }
.auth-link {
  background: none; border: none; padding: 2px 0; align-self: flex-end;
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--color-text-muted);
  text-decoration: underline; cursor: pointer;
}
/* Secure-account screen (post-purchase): reuses the auth buttons/inputs. */
.secure-h { text-align: center; margin-top: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em; color: var(--color-text-muted); }
.pw-wrap { position: relative; display: block; }
.pw-wrap .auth-input { padding-right: 70px; width: 100%; }
.pw-toggle {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: none; border: none; padding: 6px 2px; font-family: inherit;
  font-size: 12.5px; font-weight: 800; letter-spacing: 0.05em; color: var(--color-accent); cursor: pointer;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
#s-secure .sub { text-align: center; }
#s-secure .echo-chip { margin: 18px auto 0; }
.secure-wrap { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.auth-or {
  display: flex; align-items: center; gap: 10px; margin: 6px 0 2px;
  font-size: 12.5px; font-weight: 600; color: var(--color-text-subtle);
}
.auth-or::before, .auth-or::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--color-line-strong); }
.auth-note a { color: var(--color-text-muted); }
#authSignedIn .btn-ghost { align-self: flex-start; margin-top: 0; padding: 6px 0; text-decoration: underline; }
.auth-user { font-size: 15.5px; }

/* ---------- Paywall ---------- */
#s-paywall { padding: 0 0 calc(46px + var(--safe-bottom)); }
.pw-topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + var(--safe-top)) 18px 10px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--color-line);
}
.pw-timer small { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; color: var(--color-text-muted); }
.pw-timer b { font-size: 26px; font-weight: 800; letter-spacing: 0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.pw-timer.expired b { color: var(--color-text-subtle); }
.pw-top-cta { width: auto; flex: 0 0 auto; padding: 12px 22px; font-size: 16px; }
.pw-body { padding: 18px 22px 0; display: flex; flex-direction: column; }
/* Winback offer banner - same visual language as the email's offer block
   (dashed accent border, soft fill, big accent percentage). */
/* Compact BetterMe-style discount band above the plans. Deliberately much
   smaller than BetterMe's ticket - one row, badge + label, no promo code. */
.pw-offband {
  display: flex; align-items: center; gap: 14px;
  background: var(--color-accent);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-top: 10px;
}
.ob-badge {
  flex: 0 0 auto; background: #fff; border-radius: 12px;
  padding: 7px 13px; text-align: center; line-height: 1.1;
}
.ob-badge s { display: block; font-size: 11px; font-weight: 700; color: var(--color-text-subtle); }
.ob-badge b { display: block; font-size: 18px; font-weight: 800; color: var(--color-accent); letter-spacing: -0.2px; white-space: nowrap; }
.ob-text { color: #fff; font-size: 16px; font-weight: 700; line-height: 1.3; }
/* Countdown ran out: the band goes quiet grey until the discount is restored. */
.pw-offband.expired { background: var(--color-text-subtle); }
.pw-offband.expired .ob-badge b { color: var(--color-text-subtle); }
.pw-h { font-size: 24px; text-align: center; margin: 34px 0 14px; }
.pw-h:first-of-type { margin-top: 24px; }

/* Plans */
.pw-plans { display: flex; flex-direction: column; gap: 10px; }
.pw-plan {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  color: var(--color-text); /* iOS Safari paints <button> text blue by default */
  padding: 14px 14px 14px 16px;
  background: var(--color-bg);
  border: 2px solid var(--color-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-family: var(--font-text);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms var(--ease), background 160ms var(--ease), transform 160ms var(--ease);
}
.pw-plan:active { transform: scale(0.98); }
.pw-plan.selected { border-color: var(--color-accent); background: var(--color-accent-soft); }
/* "Most popular" anchor card: a full-width accent bar sits across the top
   edge (over the border, so it reads as part of the frame) and the border
   stays accent even when unselected, Headway-style. */
.pw-plan.ribbon { position: relative; border-color: var(--color-accent); padding-top: calc(14px + 30px); overflow: hidden; }
.pw-plan .pp-ribbon {
  position: absolute; top: 0; left: 0; right: 0; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-accent); color: #fff;
  font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
}
.pw-plan .pp-radio {
  flex: 0 0 26px; width: 26px; height: 26px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-line-strong);
  display: flex; align-items: center; justify-content: center;
  transition: all 160ms var(--ease);
  background: #fff;
}
.pw-plan.selected .pp-radio { border-color: var(--color-accent); background: var(--color-accent); }
.pw-plan.selected .pp-radio::after {
  content: ""; width: 10px; height: 6px;
  border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}
.pw-plan .pp-info { flex: 1 1 auto; }
.pw-plan .pp-name { display: block; font-size: 15.5px; font-weight: 800; letter-spacing: 0.01em; }
/* Belt-and-braces vs iOS data detectors: if a webview still injects a
   detector link around "1-WEEK"/"1-MONTH", render it as plain text. */
.pw-plan a, .pw-plan a[href^="x-apple-data-detectors"] { color: inherit !important; text-decoration: none !important; pointer-events: none; }
.pw-plan .pp-price { display: block; font-size: 14px; color: var(--color-text-muted); font-weight: 600; margin-top: 2px; }
.pw-plan .pp-price s { color: var(--color-text-subtle); margin-right: 6px; }
.pw-plan .pp-badge {
  display: inline-block; margin-left: 8px; padding: 2px 8px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.03em;
  color: #fff; background: var(--color-accent); border-radius: var(--radius-full);
  vertical-align: 1px;
}
.pw-day {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: flex-end;
  padding: 6px 4px;
  color: #000;
}
.pw-plan.selected .pw-day { color: #000; }
/* "$0.50" on one line, one size (the decimal point is CSS so a currency
   without minor units - the cents slot left empty - shows no stray dot). */
.pw-day .pd-amount { display: flex; align-items: baseline; gap: 2px; line-height: 1; }
.pw-day .pd-cur { font-size: 13px; font-weight: 700; }
.pw-day .pd-big, .pw-day .pd-cents { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.pw-day .pd-cents:not(:empty)::before { content: "."; }
.pw-day .pd-unit { font-size: 9px; font-weight: 700; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.03em; margin-top: 2px; }
.pw-cta { margin-top: 14px; }
/* Trust row under the CTA: accepted payment methods as small "cards" (all
   inline SVG / CSS - no image assets) and a green secure-payment pill. */
.pw-pay { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.pw-pay .pm {
  display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  height: 28px; min-width: 44px; padding: 0 7px;
  background: #fff; border: 1px solid var(--color-line); border-radius: 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 12px; font-weight: 700; color: #111; letter-spacing: 0; line-height: 1;
}
.pw-pay .pm svg { width: 14px; height: 14px; display: block; }
.pw-pay .pm-apple svg { margin-right: 1px; margin-top: -2px; }
.pw-pay .pm-visa { color: #1a1f71; font-style: italic; font-weight: 900; font-size: 13px; letter-spacing: -0.02em; }
.pw-pay .pm-mc { gap: 0; }
.pw-pay .pm-mc i { display: block; width: 15px; height: 15px; border-radius: 50%; }
.pw-pay .pm-mc .c1 { background: #eb001b; }
.pw-pay .pm-mc .c2 { background: #f79e1b; margin-left: -6px; mix-blend-mode: multiply; }
.pw-pay .pm-amex { background: #006fcf; border-color: #006fcf; color: #fff; font-size: 10.5px; letter-spacing: 0.04em; }
.pw-pay .pm-disc { font-size: 9.5px; font-weight: 800; color: #231f20; letter-spacing: 0.02em; }
.pw-pay .pm-disc b { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #f58220; text-indent: -999px; overflow: hidden; margin: 0 1px; vertical-align: -1px; }
.pw-secure {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 10px auto 0; width: max-content; padding: 6px 12px;
  background: #e8f7ee; color: #1f8a4c; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 700;
}
.pw-secure svg { width: 16px; height: 16px; }
/* Legal footnote at the very bottom of the paywall. */
.pw-disclaimer { margin-top: 22px; font-size: 11px; line-height: 1.5; color: var(--color-text-subtle); text-align: center; }
.pw-disclaimer a { color: inherit; text-decoration: underline; }
/* Paywall-only nudge: the main Continue button gently pulses (scale + soft
   accent ring) to invite the tap - mirrors the iOS paywall CTA's nudge.
   Suppressed for reduced-motion users. */
@keyframes pwCtaPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
  50% { transform: scale(1.025); box-shadow: 0 0 0 7px var(--color-accent-soft, rgba(255, 120, 70, 0.18)); }
}
.pw-cta { animation: pwCtaPulse 2.2s ease-in-out infinite; }
.pw-cta:active { animation: none; }
@media (prefers-reduced-motion: reduce) { .pw-cta { animation: none; } }
.pw-fine { font-size: 12px; color: var(--color-text-subtle); text-align: center; margin-top: 10px; line-height: 1.5; }
.pw-fine a { color: var(--color-text-muted); }
/* Checkout-abandonment offer popup: personalized without/with comparison,
   then the upgraded 80% first-period discount. */
#abandonPop { display: none; position: fixed; inset: 0; z-index: 60; }
#abandonPop.open { display: flex; align-items: center; justify-content: center; }
.ab-backdrop { position: absolute; inset: 0; background: rgba(10, 10, 12, 0.62); }
.ab-card {
  position: relative; width: min(430px, calc(100vw - 28px)); max-height: calc(100dvh - 48px);
  overflow-y: auto; background: var(--color-bg, #fff); border-radius: 22px;
  padding: 22px 20px calc(18px + var(--safe-bottom)); box-shadow: 0 24px 70px rgba(0,0,0,0.35);
}
.ab-h { font-size: 22px; font-weight: 800; text-align: center; margin: 2px 0 4px; }
.ab-sub { font-size: 13.5px; color: var(--color-text-muted); text-align: center; margin: 0 0 14px; }
.ab-table { border: 1px solid var(--color-border, #e5e5ea); border-radius: 14px; overflow: hidden; }
.ab-row { display: grid; grid-template-columns: 1fr 1fr; }
.ab-row + .ab-row { border-top: 1px solid var(--color-border, #e5e5ea); }
.ab-cell { padding: 10px 12px; font-size: 12.5px; line-height: 1.35; }
.ab-cell.no { color: var(--color-text-muted); background: rgba(120,120,128,0.06); }
.ab-cell.yes { font-weight: 600; }
.ab-cell .m { display: block; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; margin-bottom: 3px; }
.ab-cell.no .m { color: var(--color-text-subtle); }
.ab-cell.yes .m { color: var(--color-accent); }
.ab-offer {
  margin-top: 14px; border: 2px solid var(--color-accent); border-radius: 16px;
  background: var(--color-accent-soft, rgba(255,120,70,0.08)); padding: 14px 14px 12px; text-align: center;
}
.ab-offer b { display: block; color: var(--color-accent); font-size: 27px; font-weight: 800; letter-spacing: -0.5px; }
.ab-offer .ao-sub { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--color-text-muted); margin-top: 2px; }
.ab-offer .ao-plan { margin-top: 8px; font-size: 14px; font-weight: 600; }
.ab-offer .ao-plan s { color: var(--color-text-subtle); margin-right: 6px; }
.ab-cta { margin-top: 14px; width: 100%; }
.ab-later {
  display: block; width: 100%; margin-top: 10px; background: none; border: none;
  color: var(--color-text-muted); font-size: 13px; text-decoration: underline; cursor: pointer; padding: 6px;
}

/* Guarantee */
.pw-guarantee {
  display: flex; gap: 16px; align-items: center;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  margin-top: 30px;
}
.pw-guarantee .pg-badge {
  flex: 0 0 92px; width: 92px; height: 92px;
  border-radius: var(--radius-full);
  background: var(--color-green); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; text-align: center;
  box-shadow: 0 8px 22px rgba(46,125,50,0.3);
}
.pw-guarantee .pg-badge .n { font-size: 25px; line-height: 1; }
.pw-guarantee .pg-badge .l { font-size: 8.5px; letter-spacing: 0.05em; line-height: 1.3; }
.pw-guarantee h3 { font-size: 19px; letter-spacing: -0.01em; margin-bottom: 6px; }
.pw-guarantee p { font-size: 13.5px; color: var(--color-text-muted); line-height: 1.45; }

/* Big number blocks */
.pw-helped { text-align: center; margin-top: 34px; }
.pw-helped .ph-top { font-size: 19px; font-weight: 800; }
.pw-helped .ph-big { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; color: var(--color-accent); margin: 2px 0; }
.pw-helped .ph-sub { font-size: 15px; color: var(--color-text-muted); }

/* Personal summary gauges */
.pw-card {
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 18px;
  margin-bottom: 12px;
  text-align: left;
}
.pw-card > b { font-size: 16.5px; letter-spacing: -0.01em; }
.pw-gauge {
  height: 12px; border-radius: var(--radius-full);
  background: rgba(0,0,0,0.07);
  overflow: hidden;
  margin: 14px 0 6px;
}
.pw-gauge-fill {
  height: 100%; width: var(--w, 60%);
  border-radius: var(--radius-full);
  background: linear-gradient(to right, #e8a33d, #d9534f);
  animation: growH 1.2s var(--ease-out) both;
}
@keyframes growH { from { width: 0; } }
@media (prefers-reduced-motion: reduce) { .pw-gauge-fill { animation: none; } }
.pw-gauge-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--color-text-subtle); }
.pw-level { font-size: 15px; font-weight: 800; color: #d9534f; margin-top: 10px; }
.pw-card p { font-size: 14px; color: var(--color-text-muted); margin-top: 4px; line-height: 1.45; }

/* Profile fit + projection */
.pw-fit {
  display: flex; gap: 12px; align-items: center;
  font-size: 15px; font-weight: 600;
}
.pw-fit .pf-emoji { font-size: 24px; flex: 0 0 auto; }
.pw-fit p { font-size: 15px; color: var(--color-text); margin: 0; font-weight: 600; }
.pw-chart-wrap { margin-top: 6px; }
.pw-chart-wrap svg { width: 100%; height: auto; display: block; }
.pw-weeks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.pw-week { text-align: center; background: var(--color-surface-soft); border: 1px solid var(--color-line); border-radius: var(--radius-sm); padding: 8px 4px; }
.pw-week small { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-subtle); }
.pw-week b { font-size: 15px; font-weight: 800; color: var(--color-green); }
.pw-week .wk { display: block; font-size: 12px; font-weight: 700; margin-bottom: 2px; }

/* Ratings block */
.pw-downloads { text-align: center; margin-top: 34px; }
.pw-downloads h3 { font-size: 26px; letter-spacing: -0.02em; margin: 2px 0 6px; }

/* Checklist */
.pw-checks { display: flex; flex-direction: column; gap: 10px; }
.pw-check {
  display: flex; align-items: center; gap: 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 14px 16px;
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  text-align: left;
}
.pw-check .ck {
  flex: 0 0 24px; width: 24px; height: 24px;
  border-radius: var(--radius-full);
  background: var(--color-green);
  display: flex; align-items: center; justify-content: center;
}
.pw-check .ck::after {
  content: ""; width: 10px; height: 6px;
  border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

/* Now vs with CamPlan */
.pw-vs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pw-vs-card {
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 16px 14px;
  text-align: left;
}
.pw-vs-card.after { border-color: var(--color-accent); background: var(--color-accent-soft); }
.pw-vs-card h4 { font-size: 15px; font-weight: 800; margin-bottom: 10px; }
.pw-vs-card .vr { margin-bottom: 10px; }
.pw-vs-card .vr small { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-subtle); }
.pw-vs-card .vr b { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.pw-vs-card.after .vr b { color: var(--color-accent); }

/* What you get - 3-up grid so the animations get room to breathe */
.pw-get { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pw-get-card {
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 12px 10px 14px;
  text-align: center;
}
.pw-get-card .gl {
  width: 100%; aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.pw-get-card .gl svg { width: 100% !important; height: 100% !important; }
.pw-get-card b { display: block; font-size: 13.5px; letter-spacing: -0.01em; margin-top: 8px; }
.pw-get-card span { display: block; font-size: 11.5px; color: var(--color-text-muted); line-height: 1.3; margin-top: 2px; }

/* Paywall before/after: wider + shorter than the aha screen's, and pan-y so
   it doesn't trap vertical scrolling on the long page */
.pw-compare {
  max-width: none;
  aspect-ratio: 5 / 4;
  max-height: none;
  margin-top: 26px;
  touch-action: pan-y;
}

/* ---------- Handoff ---------- */
/* BetterMe-style handoff: centered title, left-aligned numbered prose list,
   app card, download CTA pinned to the bottom of the scroll area. */
#s-handoff { padding-bottom: 0; }
.ho-title { font-size: 27px; font-weight: 800; text-align: center; letter-spacing: -0.02em; margin: 14px 0 18px; }
.ho-lead { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 16px; }
.ho-list { display: flex; flex-direction: column; gap: 18px; }
.ho-item { display: flex; gap: 14px; align-items: flex-start; }
.ho-n {
  flex: 0 0 28px; width: 28px; height: 28px; margin-top: 1px;
  border-radius: var(--radius-full);
  background: var(--color-accent-soft); color: var(--color-text);
  font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.ho-text { flex: 1 1 auto; min-width: 0; font-size: 16.5px; line-height: 1.45; }
.ho-openlink {
  display: inline-block; margin-top: 8px;
  color: var(--color-accent); font-weight: 800; text-decoration: underline;
}
.ho-applink { color: var(--color-accent); font-weight: 800; text-decoration: underline; }
.ho-appcard { margin: 16px 0 0; text-align: center; }
.handoff-logo {
  width: 72px; height: 72px; border-radius: 17px;
  margin: 0 auto 8px; display: block;
  box-shadow: var(--shadow-md);
}
.ho-appname { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.ho-footer {
  /* Pinned to the screen bottom in BOTH cases: margin-top:auto pushes it
     down when the content is shorter than the viewport (tall screens),
     position:sticky keeps it pinned while scrolling when the content
     overflows (small screens). The section is a flex column. */
  position: sticky; bottom: 0; z-index: 5;
  margin: 20px -22px 0; margin-top: auto;
  padding: 20px 22px calc(14px + var(--safe-bottom));
  background: linear-gradient(to top, var(--color-bg) 72%, rgba(255, 255, 255, 0));
}
.ho-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none;
  font-size: 16px;
}
.ho-btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.ho-btn.appstore { background: #000; box-shadow: none; }

/* ---------- Post-purchase progress bar (upsell + handoff) ---------- */
.fx-steps { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 14px 0 4px; }
.fx-step {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 7px;
  white-space: nowrap; font-size: 12px; font-weight: 700; color: var(--color-text-muted);
}
.fx-step .dot {
  width: 26px; height: 26px; border-radius: var(--radius-full); margin: 0;
  background: var(--color-accent-soft); color: var(--color-text-muted);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800;
}
.fx-step.done .dot, .fx-step.active .dot { background: var(--color-accent); color: #fff; }
.fx-step.active { color: var(--color-text); }
.fx-line { flex: 0 0 28px; height: 1.5px; background: var(--color-line-strong); margin-bottom: 12px; }

/* ---------- Post-purchase upsell (BetterMe-style, CamPlan branding) ---------- */
#s-upsell { padding-bottom: 0; }
.up-top { display: flex; justify-content: flex-end; }
.up-skip { background: none; border: none; font-size: 14px; font-weight: 700; color: var(--color-text-muted); padding: 10px 0 0; cursor: pointer; }
.up-h { font-size: 26px; font-weight: 800; text-align: center; letter-spacing: -0.02em; margin: 14px 0 16px; }
.up-cards { display: flex; flex-direction: column; gap: 10px; }
.up-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--color-bg); border: 1.5px solid var(--color-line-strong);
  border-radius: 16px; padding: 14px; cursor: pointer; font-family: inherit;
}
.up-card.selected { border-color: var(--color-accent); background: var(--color-accent-soft); }
.up-card .ico { flex: 0 0 auto; font-size: 30px; line-height: 1; color: var(--color-accent); }
.up-card .ico svg { width: 30px; height: 30px; }
.up-card .info { flex: 1 1 auto; min-width: 0; }
.up-card .name { display: block; font-weight: 800; font-size: 15.5px; line-height: 1.3; color: var(--color-text); }
.up-card .price { display: block; margin-top: 4px; font-size: 14px; font-weight: 600; }
.up-card .price s { color: var(--color-text-subtle); margin-right: 6px; }
.up-card .price .now { color: var(--color-accent); font-weight: 800; }
.up-card .off {
  display: inline-block; margin-left: 8px; padding: 2px 8px;
  border: 1.5px solid var(--color-accent); color: var(--color-accent);
  border-radius: var(--radius-full); font-size: 10.5px; font-weight: 800; white-space: nowrap;
}
.up-card .sel {
  flex: 0 0 26px; width: 26px; height: 26px; border-radius: var(--radius-full);
  border: 2px solid var(--color-line-strong);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 800;
}
.up-card.selected .sel { background: var(--color-accent); border-color: var(--color-accent); }
.up-points { margin: 18px 2px 6px; display: flex; flex-direction: column; gap: 10px; }
.up-point { display: flex; gap: 11px; align-items: flex-start; font-size: 14.5px; line-height: 1.4; }
.up-point .pt {
  flex: 0 0 21px; width: 21px; height: 21px; margin-top: -1px;
  border-radius: var(--radius-full);
  background: var(--color-accent); color: #fff;
  font-size: 11.5px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.up-cta { width: 100%; }
.up-skip-btn {
  display: block; width: 100%; margin-top: 10px; padding: 15px;
  background: none; border: 1.5px solid var(--color-line-strong); border-radius: var(--radius-full);
  font-family: inherit; font-size: 16px; font-weight: 700; color: var(--color-text); cursor: pointer;
}
.up-footer {
  /* Bottom-anchored like the handoff's download CTA: margin-top:auto pins
     it to the viewport bottom on tall screens, sticky keeps it visible
     when the content overflows on small ones. */
  position: sticky; bottom: 0; z-index: 5;
  margin: 20px -22px 0; margin-top: auto;
  padding: 20px 22px calc(14px + var(--safe-bottom));
  background: linear-gradient(to top, var(--color-bg) 72%, rgba(255, 255, 255, 0));
}

/* Handoff provider mock-button: replicates the APP's sign-in buttons
   (white rounded pill, provider logo, black medium text - see AuthView's
   RoundedWhiteRectangleButtonStyle) at a smaller size, so the user
   recognizes exactly which button to tap in the app. */
.ho-provider {
  /* Inline with the sentence ("...used here: [pill]"), compact enough not
     to inflate the line box. Mirrors the app's white sign-in pill. */
  display: inline-flex; align-items: center; gap: 7px;
  vertical-align: middle; margin: 2px 0;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  background: #fff; border: 1px solid var(--color-line);
  box-shadow: var(--shadow-md);
  font-size: 13px; font-weight: 600; color: #000;
}
.ho-provider svg { width: 14px; height: 14px; flex: 0 0 auto; }
/* Inline SVG isn't covered by the UA's [hidden]{display:none} rule (that
   targets the HTML namespace) - enforce it explicitly. */
.ho-provider svg[hidden] { display: none; }

/* Handoff email-copy box (email/password sign-ins only) - BetterMe-style:
   small label, value, COPY action in one bordered field. */
.ho-email {
  display: flex; align-items: center; gap: 10px; margin-top: 10px;
  border: 1.5px solid var(--color-line-strong); border-radius: 14px;
  padding: 9px 14px; background: #fff;
}
.ho-email .he-box { flex: 1 1 auto; min-width: 0; }
.ho-email .he-label { display: block; font-size: 11.5px; font-weight: 600; color: var(--color-text-muted); }
.ho-email .he-val { display: block; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ho-email .he-copy {
  flex: 0 0 auto; background: none; border: none; color: var(--color-accent);
  font-family: inherit; font-size: 13px; font-weight: 800; letter-spacing: 0.05em; cursor: pointer; padding: 4px 2px;
}

/* ---------- Checkout sheet (embedded Stripe) ---------- */
/* background matches the Stripe Checkout branding background (#fafaf7,
   set in Stripe Dashboard -> Settings -> Branding) so the embedded form
   blends seamlessly into the sheet */
.sheet-card.checkout-card { max-height: 92dvh; overflow-y: auto; text-align: left; background: var(--color-surface-soft); }
.co-head { display: flex; align-items: center; justify-content: flex-end; margin-bottom: 8px; }
.co-close {
  flex: 0 0 34px; width: 34px; height: 34px;
  border: none; border-radius: var(--radius-full);
  background: var(--color-surface-soft); color: var(--color-text-muted);
  font-size: 15px; font-weight: 700; cursor: pointer;
}
.co-container { min-height: 360px; }
.co-load {
  display: flex; flex-direction: column;
  gap: 10px;
  min-height: 360px;
  padding-top: 8px;
}
.co-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.co-row span { font-weight: 600; }
.co-row b { font-weight: 700; }
.co-row.disc b { color: #d9534f; }
.co-row.total { font-size: 17px; }
.co-row.total span, .co-row.total b { font-weight: 800; }
.co-sep { border-top: 1px solid var(--color-line-strong); margin: 2px 0; }
.co-spinner {
  width: 22px; height: 22px;
  margin: 16px auto 0;
  border: 2.5px solid var(--color-line);
  border-top-color: var(--color-accent);
  border-radius: var(--radius-full);
  animation: coSpin 900ms linear infinite;
}
@keyframes coSpin { to { transform: rotate(360deg); } }
/* Post-payment cover: shown from the Stripe return_url reload until the
   server confirms the session paid, then the handoff renders beneath it. */
.pw-finalizing {
  position: fixed; inset: 0; z-index: 200;
  background: var(--color-surface-soft);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600; color: var(--color-text-muted);
}
.pw-finalizing .co-spinner { margin: 0 0 12px; }
.co-load-note {
  margin-top: 0;
  text-align: center;
  color: var(--color-text-subtle); font-size: 13px; font-weight: 600;
  animation: hintPulse 1.6s ease-in-out infinite;
}
.co-note { text-align: center; font-size: 12px; color: var(--color-text-subtle); margin: 0 0 12px; }

/* Micro-yes popup: centered modal with a No/Yes button row */
#quizSheet { align-items: center; padding: 0 26px; }
#quizSheet .sheet-card {
  border-radius: var(--radius-lg);
  animation: popIn 340ms var(--ease-out) both;
}
@keyframes popIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.quiz-btns { display: flex; gap: 10px; margin-top: 4px; }
.quiz-btns .cta { flex: 1 1 0; }
.quiz-btns .cta.secondary {
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-text);
  box-shadow: none;
}

/* ---------- Cookie consent sheet (EU only) ---------- */
#cookieBar { position: fixed; inset: 0; z-index: 80; }
#cookieBar[hidden] { display: none; }
.cb-backdrop { position: absolute; inset: 0; background: rgba(10, 10, 12, 0.45); }
.cb-card {
  /* margin-centered, not transform-centered: the sheetUp animation owns the
     transform property and would override a translateX. */
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto;
  width: min(520px, 100vw);
  background: var(--color-bg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px 22px calc(18px + var(--safe-bottom));
  animation: sheetUp 420ms var(--ease-out) both;
}
.cb-card h3 { font-size: 20px; letter-spacing: -0.01em; margin-bottom: 8px; }
.cb-text { font-size: 14px; line-height: 1.5; color: var(--color-text-muted); margin-bottom: 18px; }
.cb-text a { color: var(--color-text-muted); }
.cb-ghost {
  display: block; width: 100%;
  border: none; background: none;
  font-family: var(--font-text); font-size: 13px; font-weight: 600;
  color: var(--color-text-subtle); text-decoration: underline;
  cursor: pointer; padding: 12px 4px 2px;
  text-align: center;
}

/* ---------- Sheets (loading quiz popups + demo end) ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 50;
  display: none;
  align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,0.4);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.sheet.open { display: flex; }
.sheet-card {
  width: 100%; max-width: 520px;
  background: var(--color-bg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 30px 26px calc(30px + var(--safe-bottom));
  text-align: center;
  animation: sheetUp 420ms var(--ease-out) both;
}
@keyframes sheetUp { from { transform: translateY(60%); } to { transform: translateY(0); } }
.sheet-card .big { font-size: 42px; margin-bottom: 10px; }
.sheet-card .big svg {
  width: 52px; height: 52px;
  color: var(--color-accent);
  background: var(--color-accent-soft);
  border-radius: var(--radius-full);
  padding: 13px;
}
.sheet-card h3 { font-size: 22px; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 8px; }
.sheet-card p { font-size: 15px; color: var(--color-text-muted); margin-bottom: 22px; }
.btn-ghost {
  margin-top: 12px;
  background: none; border: none;
  font-family: var(--font-text);
  font-size: 15px; font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 8px;
}
