/* The Start funnel. Values come from src/theme.ts (colors, conversationMetrics, revealMetrics, type). */

:root {
  --background: #FFFFFF;
  --canvas: #F1F1F1;
  --fill: #F1F1F1;
  --picked: #1A1A1A;
  --picked-detail: #D6D6D6;
  --detail: #636363;
  --waiting: #636363;
  --surface-quiet: #E8E8E8;
  --surface-sunken: #F5F5F5;
  --text-muted: #6B6B6B;
  --text-title: #1A1A1A;
  --danger: #EA4726;
  --danger-text: #B3261E;
  --text-primary: #000000;
  --text-faint: #8B8B8B;
  --text-subtle: #6E6E6E;
  --text-inverse: #FFFFFF;
  --green: #34A853;
  --green-tint: rgba(52, 168, 83, 0.1);
  --carb: #34A853;
  --protein: #D648A7;
  --fat: #A555CF;
  --cta: #000000;
  --ink: #1D1D1F;

  --gutter: 20px;
  --bear: 80px;
  --bubble-pad-y: 20px;
  --bubble-pad-x: 30px;
  --bubble-radius: 16px;
  --answer-height: 60px;
  --answer-radius: 18px;
  --answer-gap: 16px;
  --answer-pad-x: 20px;
  --answer-icon: 24px;
  --action-height: 56px;
  --column: 100%;

  --font-latin: 'Inter', system-ui, -apple-system, sans-serif;
  --font-arabic: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --settle: cubic-bezier(0.22, 1, 0.36, 1);
  --pop: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--background);
  color: var(--text-primary);
  font-family: var(--font-latin);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
:lang(ar) body, html[lang="ar"] body { font-family: var(--font-arabic); }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; }
h1, h2, p { margin: 0; font-weight: inherit; }
img { display: block; }
[tabindex="-1"]:focus { outline: none; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
[dir="rtl"] .flip-rtl, [dir="ltr"] .flip-ltr { transform: scaleX(-1); }

/* ── Type scale (theme.ts typography; Arabic lines per toArabic) ── */
.t-bubble { font-size: 20px; line-height: 24px; font-weight: 700; }
.t-answer-label { font-size: 16px; line-height: 20px; font-weight: 600; }
.t-answer-detail { font-size: 14px; line-height: 18px; font-weight: 500; }
.t-note-title { font-size: 16px; line-height: 24px; font-weight: 600; }
.t-note-body { font-size: 14px; line-height: 20px; font-weight: 400; }
.t-wheel-figure { font-size: 60px; line-height: 73px; font-weight: 700; font-family: var(--font-latin); }
.t-wheel-unit { font-size: 30px; line-height: 36px; font-weight: 700; }
.t-weight-gap { font-size: 20px; line-height: 24px; font-weight: 700; }
.t-body-strong { font-size: 16px; line-height: 24px; font-weight: 500; }
.t-button { font-size: 16px; line-height: 20px; font-weight: 500; letter-spacing: -0.16px; }
.t-reveal-lead { font-size: 20px; line-height: 24px; font-weight: 500; }
.t-reveal-title { font-size: 36px; line-height: 43px; font-weight: 700; }
.t-card-heading { font-size: 16px; line-height: 19px; font-weight: 600; }
.t-figure-large { font-size: 28px; line-height: 34px; font-weight: 700; }
.t-figure-large-unit { font-size: 24px; line-height: 34px; font-weight: 500; }
.t-macro-figure { font-size: 16px; line-height: 19px; font-weight: 700; }
.t-label-natural { font-size: 14px; line-height: 17px; font-weight: 500; }
.t-caption { font-size: 13px; line-height: 18px; font-weight: 400; }
.t-figure-medium { font-size: 24px; line-height: 29px; font-weight: 700; }
.t-figure-medium-unit { font-size: 20px; line-height: 29px; font-weight: 500; }
.t-body-solid { font-size: 16px; line-height: 16px; font-weight: 500; }
.t-subtitle { font-size: 14px; line-height: 14px; font-weight: 400; }
.t-subtext { font-size: 14px; line-height: 18px; font-weight: 400; }
.t-label { font-size: 14px; line-height: 20px; font-weight: 500; }

[lang="ar"] .t-bubble { line-height: 30px; }
[lang="ar"] .t-answer-label { line-height: 24px; }
[lang="ar"] .t-answer-detail { line-height: 22px; }
[lang="ar"] .t-note-title { line-height: 28px; }
[lang="ar"] .t-note-body { line-height: 24px; }
[lang="ar"] .t-wheel-unit { line-height: 46px; }
[lang="ar"] .t-body-strong { line-height: 28px; }
[lang="ar"] .t-button { line-height: 24px; letter-spacing: 0; }
[lang="ar"] .t-reveal-lead { line-height: 30px; }
[lang="ar"] .t-reveal-title { line-height: 54px; }
[lang="ar"] .t-card-heading { line-height: 24px; }
[lang="ar"] .t-figure-large { line-height: 42px; }
[lang="ar"] .t-figure-large-unit { line-height: 42px; }
[lang="ar"] .t-macro-figure { line-height: 24px; }
[lang="ar"] .t-label-natural { line-height: 22px; }
[lang="ar"] .t-caption { line-height: 20px; }
[lang="ar"] .t-figure-medium { line-height: 36px; }
[lang="ar"] .t-figure-medium-unit { line-height: 34px; }
[lang="ar"] .t-body-solid { line-height: 24px; }
[lang="ar"] .t-subtitle { line-height: 22px; }
[lang="ar"] .t-subtext { line-height: 22px; }
[lang="ar"] .t-label { line-height: 24px; }

/* ── Page frame ── */
.page {
  position: relative;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  transition: background-color 300ms var(--settle);
}
body[data-screen="plan"] .page { background: var(--canvas); }

.sky {
  position: fixed;
  inset: 0;
  background: #2F7DE1 url("assets/sky.webp") 50% 0 / cover no-repeat;
  opacity: 0;
  transition: opacity 320ms var(--settle);
  pointer-events: none;
}
body[data-screen="welcome"] .sky { opacity: 1; }

.site-header {
  position: relative;
  z-index: 2;
  display: none;
  align-items: center;
  justify-content: space-between;
  direction: ltr;
  padding: max(16px, env(safe-area-inset-top)) var(--gutter) 0;
}
body[data-screen="welcome"] .site-header { display: flex; }
.logo img { height: 24px; width: auto; }
body[data-screen="welcome"] .logo img { filter: brightness(0) invert(1); }
.lang-pill {
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  background: var(--fill);
  color: var(--ink);
  transition: transform 120ms var(--settle);
}
.lang-pill:active { transform: scale(0.95); }
.lang-pill[lang="ar"] { font-family: var(--font-arabic); }
.lang-pill[lang="en"] { font-family: var(--font-latin); }
body[data-screen="welcome"] .lang-pill { background: rgba(255, 255, 255, 0.18); color: #FFFFFF; }
body[data-screen="plan"] .lang-pill { background: var(--background); }

.column {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: var(--column);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* ── Web top bar over the app's question screens ── */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: max(12px, env(safe-area-inset-top)) var(--gutter) 4px;
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition: opacity 200ms var(--settle);
}
.topbar.shown { height: auto; opacity: 1; overflow: visible; }
.top-back {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 20px;
  background: var(--fill);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 120ms var(--settle);
}
.top-back:active { transform: scale(0.92); }
.progress-track { flex: 1; height: 8px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--green);
  transition: width 420ms var(--settle);
}
.progress-label { min-width: 34px; text-align: center; font: 600 13px/16px var(--font-latin); color: var(--text-faint); }

.stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: transparent; will-change: transform, opacity; }

/* ── Conversation (ConversationLayout + AnswerList) ── */
.conv-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 0 var(--gutter);
  scrollbar-width: none;
}
.conv-scroll::-webkit-scrollbar { display: none; }
.ask { display: flex; flex-direction: column; align-items: center; padding-top: 12px; }
.ask-bear { width: var(--bear); height: var(--bear); border-radius: 50%; overflow: hidden; background: var(--fill); flex: none; }
.ask-bear img { width: 100%; height: 100%; }
.tail-row { height: 0; margin-top: 18px; align-self: stretch; display: flex; justify-content: center; position: relative; z-index: 1; }
.tail { margin-top: -10px; color: var(--fill); transform: translateX(1px) rotate(15deg) scaleY(-1); }
.bubble { max-width: 100%; padding: var(--bubble-pad-y) var(--bubble-pad-x); border-radius: var(--bubble-radius); background: var(--fill); }
.question { text-align: center; text-wrap: balance; }
.typing-near { color: rgba(0, 0, 0, 0.6); }
.typing-far { color: rgba(0, 0, 0, 0.25); }
.untyped { color: transparent; }

.answers { margin-top: 40px; padding-top: 16px; display: flex; flex-direction: column; }
.conv-fill .answers { flex: 1; padding-top: 16px; }
.rise { opacity: 0; transform: translateY(8px); transition: opacity 240ms ease-out, transform 240ms ease-out; }
.rise.shown { opacity: 1; transform: none; }

.answer-list { display: flex; flex-direction: column; gap: var(--answer-gap); }
.answer {
  min-height: var(--answer-height);
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--answer-gap);
  padding: 18px var(--answer-pad-x);
  border-radius: var(--answer-radius);
  background: var(--fill);
  color: var(--text-primary);
  text-align: start;
  transition: transform 140ms var(--settle), background-color 200ms var(--settle), color 200ms var(--settle);
}
.answer:active { transform: scale(0.97); }
.answer svg:first-child { flex: none; width: var(--answer-icon); height: var(--answer-icon); }
.answer.picked { background: var(--picked); color: var(--text-inverse); }
.answer-labels { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.answer-detail { color: var(--detail); transition: color 200ms var(--settle); }
.answer.picked .answer-detail { color: var(--picked-detail); }
.answer-check { width: 20px; height: 20px; flex: none; display: flex; align-items: center; justify-content: center; }
.check.pop { animation: pop 320ms var(--pop); }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.note-slot { margin-top: auto; padding-top: 16px; }
.note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
  padding: 18px var(--answer-pad-x);
  border-radius: var(--answer-radius);
  background: var(--fill);
}
.note > svg { flex: none; }
.note-labels { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.note-body { color: var(--detail); }
.note-link { align-self: flex-start; color: var(--detail); text-decoration: underline; }

.action { padding: 16px 18px max(16px, env(safe-area-inset-bottom)); }
.cta {
  width: 100%;
  height: var(--action-height);
  border-radius: 999px;
  background: var(--cta);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 140ms var(--settle), background-color 200ms, color 200ms;
}
.cta:active:not(:disabled) { transform: scale(0.97); }
.cta.waiting { background: var(--surface-quiet); color: var(--waiting); cursor: default; }

/* ── Wheel (NumberWheel) ── */
/* Five rows of 64px; the middle one is the answer. */
.wheel-room { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; min-height: 320px; }
.wheel {
  width: 100%;
  height: 320px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  padding-block: 128px;
  scrollbar-width: none;
  overscroll-behavior: contain;
  cursor: grab;
  user-select: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
}
.wheel::-webkit-scrollbar { display: none; }
.wheel:focus-visible { outline-offset: -2px; border-radius: 18px; }
.wheel-row {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  cursor: pointer;
  user-select: none;
  color: rgb(190, 190, 190);
  transform: scale(0.2);
  transition: transform 160ms var(--settle), color 160ms var(--settle);
}
.wheel-row[data-away="0"] { color: var(--text-primary); transform: none; }
.wheel-row[data-away="1"] { transform: scale(0.667); }
.wheel-row[data-away="2"] { transform: scale(0.333); }
.wheel-unit { position: absolute; inset-inline-start: calc(50% + 80px); top: 50%; transform: translateY(-50%); color: var(--text-primary); white-space: nowrap; pointer-events: none; }

.target-footer { display: flex; flex-direction: column; align-items: center; gap: 18px; padding-bottom: 32px; }
.change-pill { display: inline-flex; align-items: center; gap: 10px; padding: 8px 11px; border-radius: 999px; background: var(--green-tint); color: var(--green); }
.change-pill[hidden] { display: none; }
.target-now { text-align: center; }

/* ── Welcome ── */
.welcome { color: #FFFFFF; overflow: hidden; }
.welcome-content { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 72px var(--gutter) 0; }
.welcome-pill {
  height: 30px;
  padding: 0 12px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
}
.welcome-title { margin-top: 14px; font-size: 34px; line-height: 40px; font-weight: 700; letter-spacing: -1px; text-wrap: balance; max-width: 360px; }
[lang="ar"] .welcome-title { line-height: 48px; letter-spacing: 0; }
.welcome-cta {
  margin-top: 24px;
  height: 56px;
  padding: 0 32px;
  border-radius: 28px;
  background: #000000;
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 14px 30px rgba(17, 24, 39, 0.28);
  transition: transform 140ms var(--settle);
}
.welcome-cta:active { transform: scale(0.96); }
.welcome-actions { margin-top: 24px; display: inline-grid; gap: 16px; }
.welcome-actions .welcome-cta { margin-top: 0; justify-content: center; }
.welcome-store {
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 20px;
  border-radius: 14px;
  background: #000000;
  color: #FFFFFF;
  text-decoration: none;
}
.welcome-store-lines { display: grid; line-height: 1.15; text-align: start; }
.welcome-store-pre { font-size: 11px; opacity: 0.8; }
.welcome-store-name { font-size: 18px; font-weight: 600; }
.welcome-scene { position: relative; flex: 1; min-height: 240px; margin-top: clamp(24px, 9vh, 100px); }
.welcome-bear { position: absolute; left: 50%; top: 0; width: 330px; transform: translateX(-47%); }
.food { position: absolute; filter: drop-shadow(0 12px 18px rgba(17, 24, 39, 0.18)); animation: drift 6s ease-in-out infinite alternate; }
.food-1 { left: 22px; top: 28px; width: 62px; --tilt: -24deg; }
.food-2 { right: 26px; top: 20px; width: 70px; --tilt: 14deg; animation-delay: -1.5s; }
.food-3 { left: 14px; top: 208px; width: 76px; --tilt: 12deg; animation-delay: -3s; }
.food-4 { right: 16px; top: 188px; width: 70px; --tilt: 26deg; animation-delay: -4.5s; }
@keyframes drift { from { transform: rotate(var(--tilt)) translateY(0); } to { transform: rotate(var(--tilt)) translateY(-8px); } }
.welcome-bear, .food { pointer-events: none; }
.screen.welcome .welcome-bear { animation: rise-in 700ms var(--settle) both 80ms; }
@keyframes rise-in { from { transform: translateX(-47%) translateY(40px); opacity: 0; } to { transform: translateX(-47%); opacity: 1; } }

/* ── Plan reveal (PlanPreviewScreen) ── */
.reveal-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px 112px; scrollbar-width: none; }
.reveal-scroll::-webkit-scrollbar { display: none; }
.reveal-column { position: relative; padding-top: max(0px, env(safe-area-inset-top)); }
.plain-back {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: transform 120ms var(--settle);
}
.plain-back:active { transform: scale(0.9); }
.reveal .plain-back { position: absolute; top: 8px; inset-inline-start: -8px; z-index: 1; }
.reveal-bear { width: 180px; height: 217px; margin: 19px auto 0; object-fit: contain; animation: bear-pop 620ms var(--pop) both 120ms; }
@keyframes bear-pop { from { transform: scale(0.55) translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.reveal-headline { margin-top: 26px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.reveal-lead { color: var(--text-faint); }
.reveal-title { text-wrap: balance; }
.reveal-title .goal { color: var(--green); }
.reveal-cards { margin-top: 32px; display: flex; flex-direction: column; gap: 16px; }
.reveal-headline, .reveal-cards { animation: fade-up 480ms var(--settle) both 260ms; }
.reveal-cards { animation-delay: 360ms; }
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.titled-card { padding: 16px; border-radius: 20px; background: var(--background); display: flex; flex-direction: column; gap: 18px; }
.card-heading { display: flex; flex-direction: column; gap: 6px; }
.card-subtitle { color: var(--detail); }
.figure.t-figure-medium { white-space: nowrap; }

/* PlanPreviewHabits */
.activity { display: flex; flex-wrap: wrap; align-items: center; gap: 13px; min-height: 32px; }
.activity-steps { display: flex; align-items: center; gap: 4px; flex-shrink: 1; }
.activity-burn { display: flex; align-items: center; justify-content: center; gap: 2px; flex-grow: 1; }
.plan-icon { width: 32px; height: 32px; flex: none; display: flex; align-items: center; justify-content: center; }
.water { display: flex; align-items: center; gap: 4px; min-height: 32px; }
.bottle { width: 21px; height: 36px; margin-block: -2px; }

/* PlanPreviewDay and SegmentedControl size card */
.meal-choice { display: flex; flex-direction: column; gap: 24px; }
.segmented { display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--canvas); }
.segment {
  flex: 1;
  min-height: 40px;
  padding-inline: 4px;
  border-radius: 999px;
  color: var(--detail);
  text-align: center;
  transition: background-color 200ms var(--settle), color 200ms var(--settle);
}
.segment.selected { background: var(--background); color: var(--text-primary); box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05); }
.segment:active { opacity: 0.85; }
.meals { display: flex; flex-direction: column; gap: 20px; }
.meal { display: flex; }
.meal-half { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 8px; }
.meal-icon { width: 32px; flex: none; object-fit: contain; }
.meal-icon.breakfast { height: 26.33px; }
.meal-icon.lunch { height: 24px; }
.meal-icon.snack { height: 29px; }
.meal-icon.dinner { height: 23px; }
.meal-icon.added-meal { height: 26.67px; }
.meal-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.meal-title { color: var(--text-title); text-align: start; }
.meal-macros { color: var(--text-subtle); text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meal-end { flex: 1; display: flex; align-items: center; justify-content: flex-end; }
.calories { display: flex; align-items: center; gap: 6px; margin-bottom: -4px; }
.bolt { width: 21px; height: 32px; }
.figure { font-variant-numeric: tabular-nums; }
.figure > span:first-child { font-family: var(--font-latin); }
.figure-unit { color: var(--text-faint); }
.macro-split { display: flex; gap: 3px; }
.macro-part { flex-basis: 0; min-width: 64px; }
.macro-bar { height: 12px; border-radius: 4px; }
.macro-value { margin-top: 18px; font-variant-numeric: tabular-nums; }
.macro-label { margin-top: 3px; margin-bottom: -3px; color: var(--text-subtle); }
.goal-graph { position: relative; height: 204px; }
.goal-graph svg { position: absolute; inset: 0; }
.graph-pill { position: absolute; height: 30px; padding: 0 8px; border-radius: 8px; display: flex; align-items: center; white-space: nowrap; }
.graph-pill.start { background: var(--surface-quiet); }
.graph-pill.goal { background: var(--green); color: var(--text-inverse); }
.graph-maintain { position: absolute; text-align: center; color: var(--green); }
.graph-today { position: absolute; color: var(--text-subtle); }
.graph-date { position: absolute; text-align: center; color: #1A1A1A; }
.disclaimer { color: var(--detail); text-align: start; }
.reveal-footer {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 16px 18px max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(241, 241, 241, 0), var(--canvas) 40%);
}

/* ── Sign up (canvas StartEN11SignUp) ── */
.signup { padding: max(12px, env(safe-area-inset-top)) var(--gutter) max(24px, env(safe-area-inset-bottom)); overflow-y: auto; color: var(--ink); }
.signup .plain-back { align-self: flex-start; margin-inline-start: -10px; color: var(--ink); }
.signup-head { margin-top: auto; display: flex; flex-direction: column; align-items: center; text-align: center; }
.signup-avatar { width: 96px; height: 96px; border-radius: 50%; overflow: hidden; background: var(--fill); animation: bear-pop 560ms var(--pop) both 80ms; }
.signup-avatar img { width: 100%; height: 100%; }
.signup-eyebrow { margin-top: 18px; font-size: 15px; line-height: 20px; font-weight: 600; color: var(--green); }
.signup-title { margin-top: 6px; font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -0.5px; text-wrap: balance; }
[lang="ar"] .signup-title { line-height: 42px; letter-spacing: 0; }
.stats { margin-top: 28px; padding: 6px; border-radius: 24px; background: var(--fill); display: flex; gap: 6px; }
.stat { flex: 1; min-width: 0; padding: 14px 16px; border-radius: 18px; background: var(--background); }
.stat-head { display: flex; align-items: center; gap: 8px; }
.stat-icon { height: 32px; width: auto; }
.stat-label { font-size: 13px; line-height: 16px; font-weight: 600; color: var(--text-faint); }
.stat-value { margin-top: 8px; font: 700 22px/28px var(--font-latin); text-align: start; white-space: nowrap; }
.stat-unit { font-size: 15px; font-weight: 600; color: var(--text-faint); }
[lang="ar"] .stat-unit { font-family: var(--font-arabic); }
[dir="rtl"] .stat-value { text-align: right; }
.stat-goal { color: var(--green); }
.store-buttons { margin-top: auto; padding-top: 28px; display: flex; flex-direction: column; gap: 12px; }
.store-button {
  height: 58px;
  border-radius: 29px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 140ms var(--settle);
}
.store-button:active { transform: scale(0.97); }
.store-button.apple { background: #000000; color: #FFFFFF; }
.store-button.email { background: var(--fill); color: var(--ink); }
.legal { margin-top: 16px; text-align: center; text-wrap: pretty; font-size: 13px; line-height: 19px; color: var(--text-faint); }
.legal a { color: var(--ink); }

.noscript { padding: 24px; text-align: center; }

/* ── Desktop: a white page, one centred 560px column (canvas StartEN99Desktop) ── */
@media (min-width: 900px) {
  :root {
    --column: 560px;
    --bear: 104px;
    --bubble-pad-x: 32px;
    --bubble-radius: 26px;
    --answer-height: 72px;
    --answer-radius: 22px;
    --answer-gap: 14px;
    --answer-pad-x: 24px;
    --answer-icon: 26px;
    --action-height: 64px;
  }
  .site-header { display: flex; padding: 32px 64px 0; }
  .logo img { height: 26px; }
  .lang-pill { height: 36px; padding: 0 14px; border-radius: 18px; }
  .column { padding-top: 32px; }
  body[data-screen="welcome"] .column, body[data-screen="plan"] .column { padding-top: 0; }
  .topbar { gap: 16px; padding: 0; }
  .top-back { width: 44px; height: 44px; border-radius: 22px; }
  /* Questions: the progress row sits on the header's line, centred between the logo and the language pill. */
  body[data-screen="question"] .site-header { position: absolute; inset: 0 0 auto; pointer-events: none; }
  body[data-screen="question"] .site-header > * { pointer-events: auto; }
  body[data-screen="question"] .column { padding-top: 28px; }
  .progress-label { font-size: 14px; }
  .conv-scroll { padding: 0; overflow: visible; flex: none; }
  .conv { overflow-y: auto; scrollbar-width: none; }
  .ask { padding-top: 48px; }
  .tail-row { margin-top: 16px; }
  .t-bubble { font-size: 32px; line-height: 38px; letter-spacing: -0.5px; }
  [lang="ar"] .t-bubble { line-height: 46px; letter-spacing: 0; }
  .answers { margin-top: 48px; padding-top: 0; }
  .answer { padding-block: 0; gap: 18px; }
  .answer .t-answer-label { font-size: 19px; line-height: 24px; }
  [lang="ar"] .answer .t-answer-label { line-height: 30px; }
  .answer-check svg { width: 22px; height: 22px; }
  .conv-fill .ask { padding-top: 24px; }
  .conv-fill .answers { margin-top: 32px; }
  .wheel-room { min-height: 256px; }
  .wheel { height: 256px; padding-block: 96px; }
  .target-footer { padding-bottom: 0; }
  .note-slot { margin-top: 24px; }
  .note { margin-bottom: 0; }
  .action { padding: 40px 0 32px; }
  .conv-fill .action { padding-top: 24px; }
  .cta .t-button, .cta { font-size: 19px; font-weight: 600; }
  .reveal-scroll { padding-inline: 0; }
  .reveal .plain-back { top: 0; }
  .signup { padding: 0 0 48px; }
  .signup-head { margin-top: 24px; }
  .store-buttons { margin-top: 0; padding-top: 40px; }

  .welcome-content { padding-top: 96px; }
  .welcome-title { font-size: 52px; line-height: 60px; max-width: 640px; letter-spacing: -1.5px; }
  [lang="ar"] .welcome-title { line-height: 76px; }
  .welcome-pill { height: 34px; padding: 0 14px; border-radius: 17px; font-size: 15px; }
  .welcome-cta { height: 60px; padding: 0 36px; border-radius: 30px; }
  body[data-screen="welcome"] .column { max-width: none; }
  .welcome-scene { margin-top: 48px; }
  .welcome-bear { width: 420px; }
  .food-1 { left: calc(50% - 360px); top: 40px; width: 92px; }
  .food-2 { right: calc(50% - 370px); top: 24px; width: 104px; }
  .food-3 { left: calc(50% - 420px); top: 250px; width: 112px; }
  .food-4 { right: calc(50% - 410px); top: 230px; width: 104px; }
}

/* Desktop windows that are short: keep Continue on screen and tighten the question. */
@media (min-width: 900px) {
  .conv > .action { position: sticky; bottom: 0; z-index: 2; margin-top: auto; padding: 24px 0 24px; background: #FFFFFF; }
}
@media (min-width: 900px) and (max-height: 860px) {
  .ask { padding-top: 16px; }
  .conv-fill .ask { padding-top: 8px; }
  .ask-bear { --bear: 72px; }
  .t-bubble { font-size: 26px; line-height: 32px; }
  .answers, .conv-fill .answers { margin-top: 24px; }
  .wheel-room { min-height: 200px; }
  .wheel { height: 200px; padding-block: 68px; }
  .note-slot { margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
  .food { animation: none; transform: rotate(var(--tilt)); }
}

/* ── Web offer and account ── */
.offer, .account { padding: max(12px, env(safe-area-inset-top)) var(--gutter) max(24px, env(safe-area-inset-bottom)); overflow-y: auto; color: var(--ink); gap: var(--answer-gap); }
.offer .plain-back, .account .plain-back { align-self: flex-start; margin-inline-start: -10px; color: var(--ink); }
.offer .action { padding-inline: 0; margin-top: auto; }
.plan-option { height: auto; min-height: var(--answer-height); padding-block: 16px; }
.plan-option s { margin-inline-end: 4px; }
.account-form { display: flex; flex-direction: column; gap: var(--answer-gap); }
/* TextField size lg (components/TextField.tsx): 56 high, radius 16, sunken fill, a ring only on error. */
.field + .field { margin-top: calc(12px - var(--answer-gap)); }
.field-box {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-inline: 16px 12px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: var(--surface-sunken);
}
.field-box.invalid { border-color: var(--danger); }
.field-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  text-align: start;
}
.field-input:focus, .field-input:focus-visible { outline: none; }
.field-input::placeholder { color: var(--text-muted); opacity: 1; }
.field-reveal { flex: none; display: flex; color: var(--detail); }
.field-message { margin-top: 4px; color: var(--detail); text-align: start; }
.field-message.error { color: var(--danger-text); }
.field-message[hidden] { display: none; }
.account-status { min-height: 19px; color: var(--detail); }
.account .cta:disabled { background: var(--surface-quiet); color: var(--waiting); }
.account-or { text-align: center; color: var(--text-faint); }
.store-button.google { background: var(--background); color: var(--ink); border: 1px solid var(--surface-quiet); }
.account .store-buttons { margin-top: 0; padding-top: 8px; }

/* ── Get the app (payments off): the landing page's App Store badge ── */
.getapp-body { margin-top: 12px; color: var(--detail); text-align: center; text-wrap: pretty; }
.getapp-badge { align-items: center; }
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--ink);
  color: #FFFFFF;
  text-decoration: none;
  border-radius: 18px;
  padding: 12px 28px;
  min-height: 68px;
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.22);
}
.store-badge svg { width: 32px; height: 32px; flex: none; }
.store-badge .lines { display: grid; line-height: 1.2; text-align: start; }
.store-badge .pre { font-size: 13px; opacity: 0.75; }
.store-badge .name { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }

.captcha-box { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; }

.wheel.dragging { scroll-snap-type: none; cursor: grabbing; }
