:root {
  /* Figma / Styles */
  --main: #3c2411;
  --second: #c28034;
  --gray: rgba(60, 36, 17, 0.64);
  --btn: linear-gradient(174.079deg, #e5c289 0%, #c28034 100%);
  --stroke: #eaddd2;

  /* Semantic aliases used by the interface */
  --paper: #f7f3ee;
  --page-background: var(--paper);
  --white: #fff;
  --ink: var(--main);
  --accent: var(--second);
  --gold: #e5c289;
  --muted: var(--gray);
  --premium: var(--btn);
  --shadow: 0 18px 60px rgba(60, 36, 17, 0.09);
  --motion-fast: 180ms;
  --motion-medium: 320ms;
  --motion-slow: 520ms;
  --motion-ease-out: cubic-bezier(.22, 1, .36, 1);
}

.ai-contract-error {
  width: 100%;
  margin: 10px 0 0;
  color: #9d463c;
  font-family: Inter, sans-serif;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--paper); }
html, body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  color: var(--ink);
  background: var(--page-background);
  font-family: Inter, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  caret-color: transparent;
}
input, textarea { user-select: text; caret-color: auto; }
body.is-fixed { height: 100dvh; overflow: hidden; }
body.is-scroll { min-height: 100dvh; overflow-x: visible; overflow-y: auto; }
button, input { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input, textarea, [contenteditable="true"] { user-select: text; caret-color: var(--ink); }
img { display: block; max-width: 100%; }
.back-chevron { display: block; width: 27px; height: 27px; overflow: visible; transform: translateY(-2px); }
.back-chevron path { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, p { margin: 0; }
button { border: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
#app { min-height: 100%; }
.visually-hidden { position: fixed !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.mobile-menu-backdrop { position: fixed; z-index: 150; inset: 0; display: flex; justify-content: flex-end; background: rgba(24,18,14,.72); backdrop-filter: blur(2px); animation: menuFadeIn 220ms ease both; }
.mobile-menu { display: flex; flex-direction: column; width: min(402px, 100vw); min-height: 100dvh; padding: 0 20px max(40px, env(safe-area-inset-bottom)); background: var(--paper); box-shadow: -18px 0 48px rgba(31,19,10,.16); animation: menuSlideIn 360ms cubic-bezier(.22,1,.36,1) both; }
.mobile-menu-head { position: relative; display: grid; place-items: center; height: 56px; color: var(--accent); font-size: 12px; font-weight: 700; }
.mobile-menu-head > button { position: absolute; top: 8px; right: -8px; display: grid; place-items: center; width: 40px; height: 40px; font-size: 28px; line-height: 1; font-weight: 300; }
.mobile-menu-head > button { color: var(--ink); }
.mobile-menu > nav { display: grid; gap: 32px; padding-top: 40px; text-align: center; }
.mobile-menu > nav button { font-family: Prata,serif; font-size: clamp(24px, 7.71vw, 31px); line-height: 1.23; font-weight: 400; white-space: nowrap; }
.mobile-menu > nav button:active { color: var(--accent); transform: scale(.985); }
.mobile-menu-bottom { display: flex; flex-direction: column; align-items: center; margin-top: auto; text-align: center; }
.mobile-menu-socials { display: flex; gap: 16px; margin-bottom: 24px; }
.mobile-menu-socials a, .mobile-menu-socials img { width: 40px; height: 40px; }
.mobile-menu-bottom > p { font-family: Prata,serif; font-size: 20px; line-height: 20px; }
.mobile-menu-legal { max-width: 362px; margin-top: 48px; color: var(--muted); font-size: 14px; line-height: 18px; }
@keyframes menuFadeIn { from { opacity: 0; } }
@keyframes menuSlideIn { from { transform: translate3d(100%,0,0); } to { transform: translate3d(0,0,0); } }

.site-header {
  position: relative;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 56px;
  padding: 0 64px;
  background: transparent;
}
.brand { justify-self: start; width: 120px; padding: 0; color: var(--accent); text-align: left; font-size: 24px; line-height: 32px; font-weight: 700; letter-spacing: -0.8px; }
.mobile-site-back, .mobile-site-menu { display: none; }
.main-nav { display: flex; gap: 32px; align-items: center; width: 558px; }
.main-nav button { flex: 0 0 auto; padding: 8px 0; text-align: left; font-family: Prata, serif; font-size: 16px; line-height: 24px; white-space: nowrap; }
.main-nav button:nth-child(1) { width: 65px; }
.main-nav button:nth-child(2) { width: 83px; }
.main-nav button:nth-child(3) { width: 140px; }
.main-nav button:nth-child(4) { width: 174px; }
.main-nav button:hover { color: var(--accent); }
.header-actions { justify-self: end; display: flex; align-items: center; gap: 40px; }
.header-socials { display: flex; align-items: center; gap: 12px; width: 76px; }
.social { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; }
.social img { width: 100%; height: 100%; }
.login-button { width: 120px; height: 40px; border: 2px solid var(--stroke); border-radius: 16px; color: var(--accent); font-weight: 600; }
.login-button:hover { color: #fff; border-color: var(--accent); background: var(--accent); }
.desktop-profile-chip { display: flex; align-items: center; justify-content: center; gap: 8px; width: 120px; height: 40px; border-radius: 16px; background: transparent; font-family: Prata,serif; font-size: 14px; line-height: 16px; }
.desktop-profile-chip img { width: 24px; height: 24px; flex: 0 0 24px; }
.desktop-profile-chip:hover { box-shadow: 0 4px 14px rgba(60,36,17,.08); }

.page {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: calc(100dvh - 56px);
  padding: 0 32px 76px;
  overflow: hidden;
}
body.is-scroll .page { min-height: calc(100dvh - 56px); overflow: visible; }
body.is-fixed .page { height: calc(100dvh - 56px); min-height: 0; }
.site-footer {
  position: fixed;
  z-index: 25;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  padding: 0 64px 12px;
  color: var(--muted);
  pointer-events: none;
}
.site-footer > * { pointer-events: auto; }
.site-footer > span { color: var(--ink) !important; font-family: Prata, serif; font-size: 16px !important; font-weight: 400; }
.site-footer button { padding: 7px 0; color: var(--muted); font-size: 14px; }
.site-footer button:hover { color: var(--ink); }
.result-footer {
  width: 100%;
  min-height: 80px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 64px 32px;
  color: var(--muted);
}
.result-footer > span { color: var(--ink) !important; font-family: Prata, serif; font-size: 16px !important; font-weight: 400; }
.result-footer button { padding: 7px 0; color: var(--muted); font-size: 14px; }
.result-footer button:hover { color: var(--ink); }
.legal-link { max-width: min(520px, 58vw); text-align: right; }

.page-heading { text-align: center; }
.page-heading h1 { font-family: Prata, serif; font-size: 32px; line-height: 1.28; font-weight: 400; letter-spacing: -0.35px; }
.page-heading h1 em { color: var(--accent); font-style: normal; font-weight: 400; }
.page-heading p { margin-top: 12px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.standard-content { position: relative; width: 540px; max-width: 100%; padding-top: 48px; }
.primary-button {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 56px;
  padding: 14px 24px;
  border-radius: 20px;
  color: #fff;
  background: var(--premium);
  box-shadow: 0 8px 22px rgba(194, 128, 52, 0.18);
  font-size: 15px;
  line-height: 20px;
  font-weight: 700;
  transform: translateZ(0);
  transition: transform 180ms cubic-bezier(.22,1,.36,1), filter 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}
.primary-button:hover:not(:disabled) { transform: translate3d(0,-1px,0); filter: saturate(1.05) brightness(1.03); }
.primary-button:active:not(:disabled) { transform: translate3d(0,1px,0) scale(.985); box-shadow: 0 4px 12px rgba(194,128,52,.14); }
.primary-button:disabled { opacity: 0.38; cursor: default; filter: grayscale(0.3); box-shadow: none; }
.secondary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border: 1.5px solid var(--stroke);
  border-radius: 16px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
}
.secondary-button:hover { border-color: var(--accent); }
.text-button { padding: 8px; color: var(--accent); font-size: 14px; font-weight: 600; }
.page-back { position: absolute; top: 49px; left: -57px; z-index: 4; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #fff; font-size: 28px; line-height: 1; font-weight: 300; }

/* Intro — hero */
.page[data-page="home"] { align-items: flex-start; background: var(--page-background); }
.hero-card {
  position: relative;
  width: 540px;
  height: 720px;
  margin-top: 0;
  overflow: hidden;
  border-radius: 32px;
  background: radial-gradient(circle at 48% 26%, #fffdf9 0%, #f8efe5 48%, #eee1d1 100%);
  box-shadow: 0 12px 38px rgba(60, 36, 17, 0.11);
  isolation: isolate;
}
.wow-card::after { display: none; content: ""; }
.hero-photo { max-width: none; object-fit: cover; object-position: center top; }
.hero-photo--base { position: absolute; top: 0; left: 0; width: 540px; height: 720px; object-fit: cover; }
.hero-photo--subject { position: absolute; z-index: 2; top: 0; left: 0; width: 540px; height: 1107px; }
.hero-photo-after { position: absolute; inset: 0 0 0 50%; overflow: hidden; }
.hero-photo-after .hero-photo { width: 540px; max-width: none; transform: translateX(-50%); object-position: center 40%; }
.hero-divider { position: absolute; z-index: 4; top: 0; bottom: 0; left: 50%; width: 1px; background: rgba(255,255,255,.88); }
.hero-divider span { position: absolute; top: 50%; left: 50%; width: 26px; height: 26px; border: 1px solid rgba(255,255,255,.8); border-radius: 50%; background: rgba(255,255,255,.22); transform: translate(-50%,-50%); backdrop-filter: blur(6px); }
.hero-title {
  position: absolute;
  z-index: 5;
  top: 24px;
  right: 20px;
  left: 20px;
  display: block;
  padding: 10px;
  border-radius: 20px;
  background-color: transparent;
  text-align: center;
  font-family: Prata, serif;
  font-weight: 400;
  backface-visibility: visible;
}
.hero-title span { display: block; font-size: 40px; line-height: 48px; }
.hero-title strong { display: block; color: var(--accent); background: var(--premium); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; font-size: 40px; line-height: 48px; font-weight: 400; }
.hero-bottom { position: absolute; z-index: 6; left: 0; right: 0; bottom: 0; height: 156px; display: flex; align-items: flex-end; padding: 0 20px 20px; background: linear-gradient(180deg, rgba(60,36,17,0) 0%, rgba(45,29,18,.78) 100%); }

/* What */
.what-content .page-heading { margin-bottom: 24px; }
.benefit-list { display: grid; gap: 12px; margin-bottom: 24px; }
.benefit-card { display: grid; grid-template-columns: 120px 1fr; height: 104px; overflow: hidden; border: 1px solid var(--stroke); border-radius: 16px; background: linear-gradient(100deg,#fff 0%,#fff 72%,rgba(247,238,229,.52) 100%); box-shadow: 0 8px 24px rgba(60,36,17,.055); transition: transform 220ms cubic-bezier(.22,1,.36,1), border-color 180ms ease, box-shadow 220ms ease; }
.benefit-media { position: relative; width: 120px; height: 104px; overflow: hidden; border-right: 1px solid var(--stroke); }
.benefit-media picture { display: block; width: 100%; height: 100%; }
.benefit-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 360ms cubic-bezier(.22,1,.36,1), filter 220ms ease; }
.benefit-card > div:last-child { display: flex; flex-direction: column; justify-content: center; padding: 12px 18px; }
.benefit-card h2 { font-family: Prata, serif; font-size: 24px; line-height: 26px; font-weight: 400; letter-spacing: -.24px; }
.benefit-card p { margin-top: 8px; color: var(--muted); font-size: 16px; line-height: 20px; }

/* How */
.how-content { padding-top: 48px; }
.how-content .page-heading { margin-bottom: 24px; }
.steps-list { position: relative; display: grid; gap: 32px; margin: 0 0 24px; }
.steps-list::before { content: ""; position: absolute; z-index: 0; top: var(--step-axis-top, 12px); bottom: var(--step-axis-bottom, 108px); left: 11px; width: 2px; border-radius: 99px; background: linear-gradient(var(--gold), var(--accent)); }
.step-card { position: relative; z-index: 1; display: grid; grid-template-columns: 24px 1fr 140px; align-items: start; gap: 16px; min-height: 120px; }
.step-number { display: grid; place-items: center; width: 24px; height: 24px; }
.step-number img { width: 24px; height: 24px; }
.step-copy h2 { font-family: Prata, serif; font-size: 24px; line-height: 32px; font-weight: 400; letter-spacing: -.24px; }
.step-copy p { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 18px; }
.step-media { position: relative; width: 140px; height: 120px; justify-self: end; isolation: isolate; }
.step-art { position: relative; z-index: 1; width: 140px; height: 120px; border-radius: 12px; object-fit: cover; }
.step-card:nth-child(2) .step-art { width: 120px; height: 120px; margin-left: 10px; border-radius: 50%; }
.step-glow { position: absolute; z-index: 0; top: 50%; max-width: none; transform: translate(-50%,-50%); pointer-events: none; animation: gentleGlow 3.8s ease-in-out infinite alternate; }
.step-card:first-child .step-glow { left: 50%; width: 196px; height: 199px; }
.step-card:nth-child(2) .step-glow { left: 53%; width: 216px; height: 219px; }

@media (min-width: 701px) {
  .step-card:first-child .step-glow { left: 54%; }
  .step-card:nth-child(2) .step-glow { left: 57%; }
}

/* Upload */
.upload-content { position: relative; padding-top: 38px; }
.upload-content .page-heading { margin-bottom: 20px; }
.upload-card { display: flex; flex-direction: column; justify-content: flex-start; min-height: 307px; padding: 17.5px; border: 1.5px solid var(--stroke); border-radius: 16px; background: #fff; }
.upload-examples { position: relative; width: 240px; height: 128px; margin: 0 auto; flex: 0 0 128px; }
.upload-examples img { position: absolute; width: 102px; height: 102px; max-width: none; border: 4px solid var(--paper); border-radius: 10px; object-fit: cover; box-shadow: 0 0 16px rgba(60,36,17,.24); }
.upload-examples img:first-child { z-index: 1; top: 26px; left: 11px; transform: rotate(-15deg); }
.upload-examples img:nth-child(2) { z-index: 3; top: 6px; left: 67px; }
.upload-examples img:nth-child(3) { z-index: 2; top: 3px; left: 126px; transform: rotate(15deg); }
.upload-example-title { margin-top: 16px; text-align: center; font-family: Prata, serif; font-size: 20px; line-height: 20px; font-weight: 400; }
.upload-intro { max-width: 420px; margin: 8px auto 16px; color: var(--muted); text-align: center; font-size: 14px; line-height: 18px; }
.upload-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.upload-actions .secondary-button { border-width: 2px; color: var(--accent); }
.upload-actions label, .upload-card > label.text-button { cursor: pointer; }
.file-trigger { position: relative; overflow: hidden; }
.file-trigger input[type="file"] { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-actions .secondary-button span { font-size: 22px; line-height: 1; font-weight: 400; }
.guidelines { display: grid; gap: 8px; padding: 24px 0 24px; }
.guidelines h2 { margin-bottom: 9px; font-family: Manrope, Inter, sans-serif; font-size: 16px; line-height: 22px; }
.guidelines > div { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 8px 16px; border: 1.5px solid var(--stroke); border-radius: 12px; }
.guidelines > div > span { display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 24px; }
.guidelines img { width: 24px; height: 24px; }
.guidelines p { min-width: 0; font-size: 14px; line-height: 18px; }
.guidelines .guideline-status { width: 24px; height: 24px; margin-left: auto; flex: 0 0 24px; }
.guideline-copy--mobile { display: none; }
.privacy-note, .secure-note { margin-top: 9px; color: var(--muted); text-align: center; font-size: 11px; line-height: 16px; }
.privacy-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.privacy-note a:hover { color: var(--accent); }
.upload-card.is-loaded { align-items: center; justify-content: center; gap: 16px; height: 306px; min-height: 306px; padding: 16px; overflow: hidden; }
.photo-check { position: relative; width: 208px; height: 208px; margin: 0 auto; flex: 0 0 208px; border-radius: 16px; overflow: hidden; }
.photo-check .photo-check-image { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.photo-preview-unavailable { position: absolute; inset: 0; display: none; place-content: center; gap: 4px; padding: 24px; color: var(--ink); background: #f5eee7; text-align: center; font-size: 13px; line-height: 18px; }
.photo-preview-unavailable b { font-size: 14px; }
.photo-preview-unavailable span { color: var(--muted); }
.photo-check.is-preview-unavailable .photo-preview-unavailable { display: grid; }
.photo-remove { position: absolute; z-index: 2; top: 8px; right: 8px; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; overflow: hidden; border: 1.5px solid #fff; border-radius: 50%; }
.photo-remove img { width: 9.5px; height: 9.5px; }
.photo-state-icon { position: absolute; z-index: 2; bottom: 8px; left: 8px; width: 24px; height: 24px; }
.is-spinning { transform-origin: center; will-change: transform; animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Analysis */
.analysis-content { position: relative; width: 540px; max-width: 100%; padding-top: 48px; }
.analysis-content .page-heading { margin-bottom: 24px; }
.analysis-content .page-heading h1 { font-size: 32px; line-height: 32px; }
.analysis-orb { position: relative; width: 160px; height: 160px; margin: 0 auto 24px; isolation: isolate; }
.analysis-orb-layer { position: absolute; pointer-events: none; }
.analysis-orb-layer img, .analysis-orb-body img { width: 100%; height: 100%; max-width: none; }
.analysis-orb-background, .analysis-orb-main, .analysis-orb-blur { top: 5px; left: 5px; width: 150px; height: 150px; }
.analysis-orb-background { inset: 0; width: 160px; height: 160px; filter: drop-shadow(0 0 13px rgba(229,194,137,.58)); }
.analysis-orb-blur--two { top: 2.5px; left: 2.5px; width: 155px; height: 155px; transform: rotate(180deg); }
.analysis-orb-blur--three { top: 3.5px; left: 3.5px; width: 153px; height: 153px; mix-blend-mode: overlay; }
.analysis-orb-animated { inset: 0; width: 160px; height: 160px; mix-blend-mode: overlay; animation: analysisGlow 4.8s linear infinite; }
.analysis-orb-animated--two { inset: 1.5px; width: 157px; height: 157px; animation-direction: reverse; animation-duration: 6.4s; }
.analysis-orb-animated--three { inset: 1.5px; width: 157px; height: 157px; mix-blend-mode: hard-light; animation-duration: 7.2s; }
.analysis-orb-body { position: absolute; z-index: 2; top: 8px; left: 8px; width: 144px; height: 144px; overflow: hidden; border-radius: 400px; filter: blur(.45px); }
.analysis-orb > strong { position: absolute; z-index: 3; inset: 16px; display: grid; place-items: center; font-family: Prata, serif; font-size: 44.8px; line-height: 1; font-weight: 400; }
@keyframes analysisGlow { to { transform: rotate(360deg); } }
.analysis-live-meta { display: flex; align-items: center; justify-content: center; gap: 8px; margin: -14px 0 18px; color: var(--muted); font-size: 12px; line-height: 16px; }
.analysis-live-meta time { min-width: 38px; color: var(--accent); font-variant-numeric: tabular-nums; font-weight: 700; }
.analysis-statuses { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 24px; }
.analysis-status { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px; min-height: 92px; padding: 8px 6px; border: 2px solid var(--stroke); border-radius: 12px; background: transparent; text-align: center; transition: border-color 240ms ease, background-color 240ms ease; }
.analysis-status > span { display: grid; place-items: center; width: 24px; height: 24px; opacity: .75; }
.analysis-status img { width: 24px; height: 24px; }
.analysis-status p { color: var(--ink); font-size: 10px; line-height: 12px; }
.analysis-status i { display: grid; place-items: center; width: 24px; height: 24px; font-style: normal; }
.analysis-status i img { width: 24px; height: 24px; object-fit: contain; }
.analysis-status.is-active { border-color: var(--stroke); background: transparent; }
.analysis-status.is-active > span, .analysis-status.is-done > span { opacity: 1; }
.analysis-status.is-done { border-color: var(--stroke); background: transparent; }
.analysis-helper { margin-bottom: 8px; text-align: center; }
.analysis-helper h2 { font-family: Prata, serif; font-size: 20px; line-height: 20px; font-weight: 400; letter-spacing: -.2px; }
.analysis-helper p { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 18px; }
.analysis-content--questions .page-heading p { max-width: 440px; margin-right: auto; margin-left: auto; }
.question-progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 16px; }
.question-progress i { height: 4px; border-radius: 999px; background: var(--stroke); transition: background-color 240ms ease; }
.question-progress i.is-complete { background: var(--accent); }
.question-card { padding: 12px; border-radius: 16px; background: #fff; box-shadow: none; }
.question-card h2 { margin-bottom: 10px; text-align: left; font-family: Inter, sans-serif; font-size: 16px; line-height: 20px; font-weight: 700; }
.analysis-survey { width: 100%; }
.analysis-survey[hidden] { display: none; }
.question-progress-summary { display: grid; gap: 7px; margin-bottom: 12px; }
.question-progress-summary > div { display: flex; align-items: center; justify-content: flex-end; font-size: 11px; line-height: 16px; }
.question-progress-summary b { color: var(--accent); font-weight: 700; }
.question-progress-track { width: 100%; height: 5px; overflow: hidden; border-radius: 999px; background: var(--stroke); }
.question-progress-track i { display: block; width: var(--question-progress, 0%); height: 100%; border-radius: inherit; background: var(--premium); transition: width 320ms cubic-bezier(.22,1,.36,1); }
.answer-list { display: grid; gap: 7px; }
.answer { display: grid; grid-template-columns: 24px 1fr; align-items: center; min-height: 34px; padding: 5px 6px; border: 2px solid var(--stroke); border-radius: 9px; background: var(--paper); text-align: left; font-size: 14px; line-height: 18px; }
.answer i { width: 20px; height: 20px; border: 2px solid rgba(60,36,17,.64); border-radius: 50%; }
.answer.selected { border-color: var(--stroke); background: var(--paper); }
.answer.selected i { border: 5px solid #fff; background: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.question-card .primary-button { min-height: 40px; margin-top: 10px; border-radius: 12px; }
.analysis-skip { display: block; width: 100%; min-height: 38px; margin-top: 4px; color: var(--muted); text-align: center; font-size: 13px; line-height: 18px; font-weight: 600; transition: color 180ms ease; }
.analysis-skip:hover, .analysis-skip:focus-visible { color: var(--ink); }
.analysis-answers-notice { display: grid; gap: 4px; padding: 16px; border: 1.5px solid var(--stroke); border-radius: 16px; background: #fff; text-align: center; }
.analysis-answers-notice b { font-size: 14px; line-height: 20px; }
.analysis-answers-notice span { color: var(--muted); font-size: 12px; line-height: 17px; }
.question-card--settled .answer:disabled { cursor: default; opacity: 1; }
.question-card--settled .analysis-answers-notice { margin: 10px 0 0; }
.analysis-survey-complete { display: grid; min-height: inherit; place-items: center; padding: 24px; border: 1.5px solid var(--stroke); border-radius: 16px; background: #fff; text-align: center; }
.analysis-survey-complete p { max-width: 360px; color: var(--main); font-size: 16px; line-height: 24px; font-weight: 600; text-wrap: balance; }
.question-card--complete { padding: 0; background: transparent; }
.question-card--complete .primary-button { margin-top: 0; }
.analysis-ready-card { max-width: 540px; margin: 72px auto 0; padding: 24px; border: 1.5px solid var(--stroke); border-radius: 20px; background: #fff; text-align: center; }
.analysis-ready-card p { margin-bottom: 20px; color: var(--muted); font-size: 14px; line-height: 20px; }
.analysis-ready-card .primary-button { width: 100%; }
.answer-list--visual { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.answer-list--visual .answer { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 0; border: 2px solid var(--stroke); border-radius: 12px; background: var(--paper); text-align: center; }
.answer-list--visual .answer.selected { border-color: var(--accent); background: var(--paper); }
.answer-list--visual img { width: 100%; height: auto; aspect-ratio: 1122 / 1402; border-radius: 10px 10px 0 0; object-fit: contain; object-position: center; }
.answer-caption { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 12px 8px 16px; }
.answer-label { font-weight: 600; }
.answer-description { color: var(--muted); font-size: 14px; line-height: 20px; }
.complete-card { text-align: center; }
.complete-card > img { width: 100%; height: 88px; margin-bottom: 12px; border-radius: 14px; object-fit: cover; object-position: center 35%; }
.complete-card > p { color: var(--muted); font-size: 13px; line-height: 18px; }

/* Long result pages */
.result-column { position: relative; width: 540px; max-width: 100%; padding-top: 42px; padding-bottom: 60px; }
.result-column > .page-heading { margin-bottom: 28px; }
.free-content > .page-heading { margin-bottom: 24px; }
.person-summary { display: grid; grid-template-columns: 124px 1fr; gap: 16px; align-items: stretch; width: 280px; margin: 0 auto; }
.person-summary > img { width: 124px; height: 164px; border-radius: 16px; object-fit: cover; }
.person-summary > div > span { display: block; margin: 3px 0 7px; color: var(--ink); font-size: 14px; }
.traits { display: grid; gap: 0; }
.traits b { display: flex; align-items: center; gap: 9px; min-height: 49px; border-bottom: 1px solid var(--stroke); font-family: Prata, serif; font-size: 17px; font-weight: 400; }
.traits b > img { width: 24px; height: 24px; flex: 0 0 24px; }
.traits b:last-child { border-bottom: 0; }
.palette-traits span { padding: 7px 10px; border-radius: 20px; background: rgba(229,194,137,.19); font-size: 16px; font-family: Prata,serif; }
.section-label { margin: 28px 0 14px; font-family: Prata, serif; font-size: 20px; line-height: 28px; font-weight: 400; }
.free-content > .section-label { font-size: 28px; line-height: 36px; }
.accordion { display: grid; gap: 8px; }
.strengths { gap: 0; overflow: hidden; border: 2px solid var(--stroke); border-radius: 16px; background: #fff; }
.strengths .accordion-item { border: 0; border-bottom: 1px solid var(--stroke); border-radius: 0; }
.strengths .accordion-item:last-child { border-bottom: 0; }
.strengths .accordion-item > button { font-family: Prata,serif; font-size: 22px; font-weight: 400; }
.accordion-item { overflow: hidden; border: 2px solid var(--stroke); border-radius: 16px; background: #fff; }
.accordion-item > button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 54px; padding: 14px 16px; text-align: left; font-size: 14px; font-weight: 600; }
.accordion-item > button { transition: background-color 180ms ease, color 180ms ease, transform 180ms cubic-bezier(.22,1,.36,1); }
.accordion-item > button:active { transform: scale(.992); }
.accordion-item > button i { font-style: normal; font-size: 21px; font-weight: 400; transition: transform 260ms cubic-bezier(.22,1,.36,1); }
.accordion-item > div { display: grid; grid-template-rows: 0fr; opacity: .45; transition: grid-template-rows 320ms cubic-bezier(.22,1,.36,1), opacity 220ms ease; }
.accordion-item > div > * { overflow: hidden; }
.accordion-item > div > p { padding: 0 16px; color: var(--muted); font-size: 13px; line-height: 19px; }
.accordion-item.open > div { grid-template-rows: 1fr; opacity: 1; }
.accordion-item.open > div > p { padding-bottom: 16px; }
.accordion-item.open > button i { transform: none; }
.locked-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-top: 12px; }
.locked-grid::before { content: "Что откроется дальше"; grid-column: 1/-1; margin: 0 0 2px; font-family: Prata,serif; font-size: 28px; line-height: 36px; }
.locked-grid article { position: relative; display: flex; grid-column: span 2; flex-direction: column; align-items: center; gap: 8px; height: 156px; padding: 12px; overflow: hidden; border-radius: 16px; background: #fff; }
.locked-grid article:nth-of-type(-n+2) { grid-column: span 3; }
.locked-grid article > img { position: static; width: min(100%, 184px); height: 91px; border-radius: 10px; object-fit: cover; filter: none; }
.locked-grid article > div { position: static; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; color: var(--ink); background: none; font-family: Inter,sans-serif; font-size: 18px; }
.locked-grid article > div img { box-sizing: border-box; width: 30px; height: 30px; padding: 6px; border-radius: 50%; background: linear-gradient(154.916deg, #e5c289 0%, #c28034 100%); filter: none; }
.free-content > .analysis-actions { margin-top: 24px; }
.analysis-actions { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.analysis-actions > .primary-button { min-height: 56px; font-size: 16px; }
.new-analysis-row { display: grid; grid-template-columns: 32px minmax(0,1fr) 24px; align-items: center; gap: 8px; width: 100%; min-height: 68px; padding: 8px 16px; border: 1px solid var(--stroke); border-radius: 16px; color: var(--ink); background: #fff; text-align: left; }
.new-analysis-row > .new-analysis-icon { width: 24px; height: 24px; margin: 4px; }
.new-analysis-row > span { display: grid; gap: 2px; min-width: 0; }
.new-analysis-row b { font-size: 16px; line-height: 20px; font-weight: 400; }
.new-analysis-row small { color: var(--muted); font-size: 12px; line-height: 16px; }
.new-analysis-row .new-analysis-chevron { width: 24px; height: 24px; transform: rotate(-90deg); }
.new-analysis-row:hover { background: #fcfaf7; }
.new-analysis-row:active { background: var(--paper); }
.result-cta { margin-top: 28px; padding: 28px; border-radius: 24px; text-align: center; background: #fff; }
.result-cta h2 { font-family: Prata, serif; font-size: 22px; font-weight: 400; }
.result-cta p { margin: 10px 0 20px; color: var(--muted); font-size: 13px; line-height: 19px; }

/* Payment */
body[data-route="payment"] .page { height: auto; min-height: calc(100dvh - 122px); align-items: center; padding: 0 32px; }
body[data-route="payment"] .site-footer { position: static; }
.payment-content { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 24px; width: 560px; max-width: 100%; min-height: 0; padding: 24px 0; }
.payment-top { display: grid; gap: 16px; width: 100%; }
.payment-content .page-heading { margin: 0; }
.payment-content .page-heading h1 { font-size: 32px; line-height: 38.4px; }
.payment-example { text-align: center; font-size: 16px; line-height: 20px; }
.payment-carousel { display: flex; flex-direction: column; align-items: center; gap: 16px; width: min(100%, clamp(300px, calc(100dvh - 560px), 560px)); }
.payment-viewport { position: relative; width: 100%; aspect-ratio: 362 / 360; overflow: hidden; border-radius: 16px; cursor: grab; touch-action: pan-y; }
.payment-viewport.is-dragging { cursor: grabbing; }
.payment-track { display: flex; width: 100%; height: 100%; transition: transform 460ms cubic-bezier(.22,1,.36,1); will-change: transform; }
.payment-slide { position: relative; flex: 0 0 100%; width: 100%; height: 100%; margin: 0; overflow: hidden; border-radius: 16px; background-color: #fff; contain: paint; }
.payment-slide > img { display: block; position: absolute; width: 100%; max-width: none; height: auto; left: 0; pointer-events: none; }
/* Crops from mobile payment frames 306:2193 / 2215 / 2237 / 2259,
   page «Для верстки». Crop the exported boards, never substitute result portraits. */
.payment-slide--hair > img { top: -24.6%; }
.payment-slide--palette > img { top: -17.8%; }
.payment-slide--accessories > img { top: -325.2%; }
.payment-slide--makeup > img { top: -22.2%; }
.carousel-arrow { position: absolute; z-index: 3; top: 50%; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: 0 4px 16px rgba(60,36,17,.16); transform: translateY(-50%); transition: opacity 180ms ease, transform 180ms ease; }
.carousel-arrow img { width: 32px; height: 32px; }
.carousel-arrow--prev { left: 12px; }
.carousel-arrow--prev img { transform: rotate(90deg); }
.carousel-arrow--next { right: 12px; }
.carousel-arrow--next img { transform: rotate(-90deg); }
.carousel-arrow:hover:not(:disabled) { transform: translateY(-50%) scale(1.04); }
.carousel-arrow:disabled { opacity: .28; cursor: default; }
.carousel-dots { display: flex; justify-content: center; gap: 4px; height: 8px; margin: 0; }
.carousel-dots button { width: 8px; height: 8px; padding: 0; border-radius: 50%; background: #d9d9d9; transition: background-color 180ms ease, transform 180ms ease; }
.carousel-dots button.active { background: var(--ink); transform: scale(1.08); }
.price { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; }
.price strong { font-family: Prata, serif; font-size: 40px; line-height: 48px; font-weight: 400; }
.price s { color: var(--muted); font-size: 14px; }.price span { padding: 4px; border-radius: 8px; color: #fff; background: linear-gradient(154.916deg, #e5c289 0%, #c28034 100%); font-size: 14px; font-weight: 400; }
.payment-offer { display: flex; flex-direction: column; gap: 16px; width: 100%; }
.promo-form { display: grid; gap: 8px; width: 100%; padding: 14px 16px 16px; border: 1px solid var(--stroke); border-radius: 16px; background: #fff; }
.promo-form > label { color: var(--ink); text-align: left; font-size: 14px; line-height: 20px; font-weight: 500; }
.promo-control { display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 8px; }
.promo-control input { width: 100%; min-width: 0; height: 48px; padding: 0 14px; border: 1px solid var(--stroke); border-radius: 14px; color: var(--ink); background: var(--page); font: inherit; font-size: 14px; outline: 0; text-transform: uppercase; }
.promo-control input::placeholder { color: var(--muted); text-transform: none; }
.promo-control input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(194,128,52,.1); }
.promo-control .secondary-button { min-height: 48px; border-width: 1.5px; border-radius: 14px; color: var(--accent); background: #fff; font-size: 14px; font-weight: 600; }
.promo-control .secondary-button:disabled { cursor: wait; opacity: .6; }
.promo-message { margin: 0; color: var(--error,#cc3a3c); text-align: left; font-size: 12px; line-height: 17px; }
.promo-message[hidden] { display: none; }
.payment-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 20px; margin: 0 0 16px; padding: 0; list-style: none; }
.payment-list li { position: relative; padding-left: 19px; color: var(--muted); font-size: 12px; line-height: 17px; }
.payment-list li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

/* Embedded YooKassa checkout */
.checkout-content { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 24px; width: min(620px, 100%); padding: 48px 0 28px; }
.checkout-back { top: 24px; left: -56px; }
.checkout-heading { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 0 4px; }
.checkout-heading--access { grid-template-columns: 48px minmax(0, 1fr); }
.checkout-heading h1 { font-family: Prata,serif; font-size: 32px; line-height: 40px; font-weight: 400; }
.checkout-heading p { margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 20px; }
.checkout-heading strong { font-family: Prata,serif; font-size: 28px; line-height: 36px; font-weight: 400; white-space: nowrap; }
.checkout-secure-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; color: #fff; background: var(--premium); box-shadow: 0 8px 22px rgba(194,128,52,.2); }
.checkout-secure-icon img { width: 22px; height: 22px; object-fit: contain; }
.checkout-widget-card { position: relative; min-height: 440px; overflow: hidden; border: 1.5px solid var(--stroke); border-radius: 24px; background: #fff; box-shadow: none; }
.checkout-widget { width: 100%; min-height: 440px; padding: 8px; }
.checkout-widget[hidden], .checkout-status[hidden] { display: none; }
.checkout-widget.is-loading { position: absolute; top: 0; left: 0; visibility: hidden; pointer-events: none; }
.checkout-progress[hidden], .checkout-wait[hidden] { display: none; }
.checkout-email[hidden] { display: none; }
.checkout-wait { color: var(--muted); font-size: 12px; line-height: 18px; }
.checkout-error-title { color: var(--ink); font-size: 18px; line-height: 24px; }
.checkout-status { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; min-height: 440px; padding: 48px; text-align: center; }
.checkout-status p { max-width: 420px; color: var(--muted); font-size: 15px; line-height: 22px; }
.checkout-status .wow-generation-message { display: flex; min-height: 24px; align-items: center; justify-content: center; gap: 8px; margin: 0; overflow: hidden; }
.wow-generation-message span { display: inline-block; will-change: transform, opacity; }
.wow-generation-message b { min-width: 38px; color: var(--accent); font-variant-numeric: tabular-nums; font-size: 15px; line-height: 22px; }
.wow-generation-stages { display: flex; align-items: center; justify-content: center; gap: 6px; height: 8px; margin-top: -8px; }
.wow-generation-stages i { width: 6px; height: 6px; border-radius: 50%; background: var(--stroke); transition: width 220ms cubic-bezier(.22,1,.36,1), background-color 220ms ease; }
.wow-generation-stages i.is-active { width: 18px; border-radius: 999px; background: var(--accent); }
.checkout-spinner { width: 36px; height: 36px; border: 3px solid var(--stroke); border-top-color: var(--accent); border-radius: 50%; animation: checkoutSpin 800ms linear infinite; }
.checkout-status--error .checkout-spinner, .checkout-status--success .checkout-spinner { animation: none; border: 0; }
.checkout-status--error .checkout-spinner::before, .checkout-status--success .checkout-spinner::before { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: #fff; font-size: 20px; font-weight: 700; }
.checkout-status--error .checkout-spinner::before { content: "!"; background: #a84f43; }
.checkout-status--success .checkout-spinner::before { content: "✓"; background: #588462; }
.checkout-retry, .checkout-result { width: min(300px, 100%); min-height: 48px; }
.checkout-retry { border: 2px solid var(--stroke); border-radius: 16px; color: var(--accent); background: #fff; font-weight: 600; }
.checkout-note { align-self: center; max-width: 520px; color: var(--muted); font-size: 12px; line-height: 18px; text-align: center; }
@keyframes checkoutSpin { to { transform: rotate(360deg); } }

/* Auth */
.auth-content { position: relative; display: flex; flex-direction: column; justify-content: space-between; width: 540px; max-width: 100%; min-height: calc(100dvh - 56px); padding-top: 44px; }
.auth-top { padding: 0 20px; }
.auth-content .page-heading { margin: 0; }
.auth-content .page-heading h1 { max-width: 540px; font-size: 36px; line-height: 43.2px; }
.auth-content .page-heading p { font-size: 14px; line-height: 18px; }
.auth-title-mobile, .auth-subtitle-mobile { display: none; }
.auth-card { display: flex; flex-direction: column; gap: 16px; width: 100%; min-height: 510px; padding: 24px 20px; border-radius: 24px 24px 0 0; background: #fff; box-shadow: none; }
.auth-card label, .forgot-modal label, .edit-form label { display: grid; gap: 4px; margin: 0; font-size: 12px; font-weight: 400; }
.auth-card input, .forgot-modal input, .edit-form input { width: 100%; height: 56px; padding: 0 16px; border: 2px solid var(--stroke); border-radius: 16px; color: var(--ink); background: #fff; font-size: 16px; outline: 0; }
.auth-card input:focus, .forgot-modal input:focus, .edit-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(194,128,52,.1); }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 56px; }
.password-wrap button { position: absolute; top: 0; right: 4px; display: grid; place-items: center; width: 48px; height: 56px; color: var(--muted); }
.password-wrap button img { width: 24px; height: 24px; }
.field-only { margin: 0 !important; }
.auth-fields { display: grid; gap: 12px; width: 100%; }
.auth-profile-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.auth-profile-fields input { padding-right: 10px; padding-left: 10px; font-size: 14px; }
.auth-profile-fields label { min-width: 0; }
.auth-card input[aria-invalid="true"] { border-color: var(--error, #cc3a3c); }
.auth-profile-validation { display: grid; gap: 6px; color: var(--error, #cc3a3c); font-size: 13px; line-height: 18px; text-align: left; }
.auth-profile-validation[hidden], .auth-profile-validation p[hidden] { display: none; }
.auth-field-hint, .auth-field-error { display: block; padding: 0 4px; font-size: 12px; line-height: 17px; text-align: left; }
.auth-field-hint { color: var(--muted); }
.auth-field-error { color: var(--error, #cc3a3c); }
.auth-field-error[hidden] { display: none; }
/* Registration can grow when validation messages appear. Keep its CTA and footer in flow. */
body[data-route="register"] .page { padding-bottom: 32px; }
body[data-route="register"] .site-footer { position: static; }
.page[data-page="register"] .auth-content { height: auto; min-height: 0; gap: 24px; }
.page[data-page="register"] .auth-card { flex: 0 0 auto; height: auto; margin-top: 0; }
.page[data-page="register"] .auth-top { flex-shrink: 0; }
.auth-card--register { min-height: 580px; }
.forgot-link { display: block; justify-self: start; margin: 0; color: var(--accent); font-size: 16px; line-height: 24px; }
.email-auth-title { margin: 0; text-align: center; font-size: 16px; line-height: 24px; font-weight: 400; }
.auth-divider { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; height: 16px; margin: 0; text-align: center; }
.auth-divider::before, .auth-divider::after { content: ""; height: 2px; flex: 1; background: #bdb4ac; }
.auth-divider span { position: static; padding: 0; color: var(--muted); background: transparent; font-size: 16px; line-height: 16px; }
.yandex-button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 48px; border-radius: 10px; color: #fff; background: #050505; font-size: 14px; font-weight: 500; }
.yandex-button img { width: 24px; height: 24px; }
.yandex-button:disabled, .yandex-code-panel button:disabled { cursor: wait; opacity: .64; }
.yandex-auth { display: grid; gap: 12px; }
.yandex-code-panel { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--stroke); border-radius: 16px; background: var(--page); }
.yandex-code-panel p { margin: 0; color: var(--muted); font-size: 12px; line-height: 16px; }
.yandex-code-panel > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.auth-card .yandex-code-panel input { height: 44px; padding: 0 12px; border-width: 1px; border-radius: 12px; font-size: 14px; }
.yandex-code-panel button { min-width: 112px; height: 44px; padding: 0 14px; border-radius: 12px; color: #fff; background: var(--accent); font-size: 13px; font-weight: 600; }
.auth-card-footer { display: grid; gap: 12px; width: 100%; margin-top: auto; }
.auth-error { margin: 0; padding: 10px 12px; border: 1px solid rgba(204,58,60,.28); border-radius: 12px; color: var(--error,#cc3a3c); background: rgba(204,58,60,.06); font-size: 13px; line-height: 18px; }
.auth-error[hidden] { display: none; }
.auth-switch { margin: 0; color: var(--ink); text-align: center; font-size: 16px; line-height: 24px; }
.auth-switch button { color: var(--accent); font-weight: 400; }
.auth-card .primary-button { min-height: 56px; font-size: 16px; }
.auth-card .auth-submit.is-form-incomplete { opacity: .38; filter: grayscale(.3); box-shadow: none; }
.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(27,18,12,.46); backdrop-filter: blur(4px); }
.forgot-backdrop { place-items: end center; padding: 0; background: rgba(0,0,0,.6); backdrop-filter: none; }
.forgot-modal { position: relative; display: flex; flex-direction: column; gap: 24px; width: min(402px,100vw); max-width: 100%; padding: 32px 20px 24px; border-radius: 24px 24px 0 0; background: #fff; box-shadow: none; animation: pickerRise 320ms cubic-bezier(.22,1,.36,1) both; }
.forgot-heading { display: grid; gap: 16px; text-align: center; }
.forgot-modal h2 { font-family: Prata, serif; font-size: 32px; line-height: 38px; font-weight: 400; }
.forgot-heading p { color: var(--muted); font-size: 14px; line-height: 18px; }
.forgot-actions { display: grid; gap: 8px; }
.forgot-actions .primary-button, .forgot-actions .secondary-button { min-height: 56px; font-size: 16px; }
.forgot-actions .secondary-button { border-width: 2px; color: var(--accent); }
.modal-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 50%; background: var(--paper); font-size: 22px; }
.legal-modal { width: min(680px, 100%); max-height: min(720px, calc(100dvh - 40px)); overflow-y: auto; padding: 28px; border-radius: 24px; background: #fff; box-shadow: 0 30px 80px rgba(28,17,10,.24); user-select: text; }
.legal-modal-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--stroke); }
.legal-modal-heading h2 { font-family: Prata, serif; font-size: 26px; line-height: 34px; font-weight: 400; }
.legal-modal-heading button { min-width: 84px; min-height: 40px; padding: 8px 14px; border: 1.5px solid var(--stroke); border-radius: 14px; color: var(--accent); font-weight: 600; }
.legal-modal section { padding-top: 22px; }
.legal-modal h3 { margin: 0 0 9px; font-family: Prata, serif; font-size: 20px; line-height: 28px; font-weight: 400; }
.legal-modal p { color: var(--muted); font-size: 14px; line-height: 21px; }
.legal-document-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 10px; padding: 10px 16px; border: 1.5px solid var(--stroke); border-radius: 14px; color: var(--accent); background: #fffaf5; font-size: 14px; line-height: 20px; font-weight: 600; text-decoration: none; transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease; }
.legal-document-link:hover { border-color: rgba(194,128,52,.45); background: #fff7ef; box-shadow: 0 8px 20px rgba(60,36,17,.08); }
.legal-document-link:focus-visible { outline: 2px solid rgba(194,128,52,.46); outline-offset: 2px; }

@keyframes routeEnter { from { opacity: 0; } to { opacity: 1; } }
@keyframes stateEnter { from { opacity: .75; transform: scale(.996); } to { opacity: 1; transform: scale(1); } }
@keyframes gentleGlow { from { opacity: .72; transform: translate(-50%,-50%) scale(.96); } to { opacity: 1; transform: translate(-50%,-50%) scale(1.05); } }
@keyframes softRise { from { opacity: 0; transform: translate3d(0,10px,0); } to { opacity: 1; transform: translate3d(0,0,0); } }
@keyframes portraitReveal { from { opacity: .78; transform: translate3d(0,14px,0) scale(1.015); } to { opacity: 1; transform: translate3d(0,0,0) scale(1); } }
@keyframes fanLeft { from { opacity: 0; transform: translate3d(12px,8px,0) rotate(-8deg); } to { opacity: 1; transform: rotate(-15deg); } }
@keyframes fanCenter { from { opacity: 0; transform: translate3d(0,10px,0) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes fanRight { from { opacity: 0; transform: translate3d(-12px,8px,0) rotate(8deg); } to { opacity: 1; transform: rotate(15deg); } }
#app.route-enter .page > section, #app.route-enter > .mobile-app { animation: routeEnter 300ms cubic-bezier(.22,1,.36,1) both; }
#app.route-enter .hero-photo--subject { animation: portraitReveal 680ms cubic-bezier(.22,1,.36,1) both; }
#app.route-enter .hero-title { animation: softRise 520ms 80ms cubic-bezier(.22,1,.36,1) both; }
#app.route-enter .hero-bottom { animation: softRise 500ms 150ms cubic-bezier(.22,1,.36,1) both; }
#app.route-enter .benefit-card, #app.route-enter .step-card { animation: softRise 420ms cubic-bezier(.22,1,.36,1) both; }
#app.route-enter .benefit-card:nth-child(2), #app.route-enter .step-card:nth-child(2) { animation-delay: 55ms; }
#app.route-enter .benefit-card:nth-child(3), #app.route-enter .step-card:nth-child(3) { animation-delay: 110ms; }
#app.route-enter .benefit-card:nth-child(4) { animation-delay: 165ms; }
#app.route-enter .upload-examples img:first-child { animation: fanLeft 480ms 60ms cubic-bezier(.22,1,.36,1) both; }
#app.route-enter .upload-examples img:nth-child(2) { animation: fanCenter 460ms 110ms cubic-bezier(.22,1,.36,1) both; }
#app.route-enter .upload-examples img:nth-child(3) { animation: fanRight 480ms 160ms cubic-bezier(.22,1,.36,1) both; }
#app.state-enter .photo-check, #app.state-enter .question-card, #app.state-enter .main-look { animation: stateEnter 240ms cubic-bezier(.22,1,.36,1) both; }
.profile-menu button, .secondary-button, .thumbnail-row button, .segmented button { transition: transform 180ms cubic-bezier(.22,1,.36,1), border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease; }
.profile-menu button:active, .secondary-button:active, .thumbnail-row button:active, .segmented button:active { transform: scale(.985); }

/* Results */
.wow-content { position: relative; width: 540px; max-width: 100%; padding-top: 0; overflow: visible; background: transparent; }
.wow-external-title { display: none; }
.wow-card { position: relative; z-index: 1; width: 540px; max-width: 100%; height: 720px; overflow: hidden; border-radius: 24px; background: #f7eee4; }
.wow-base { position: absolute; z-index: 0; top: 0; left: 0; display: block; width: 540px; height: 720px; max-width: none; overflow: hidden; }
.wow-base > img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.wow-subject-frame { position: absolute; z-index: 2; inset: 0; overflow: hidden; }
.wow-subject { position: absolute; top: 23px; left: -91px; width: 669px; height: 836px; max-width: none; object-fit: fill; }
.wow-after { position: absolute; inset: 0 0 0 50%; overflow: hidden; }
.wow-after img { width: 540px; max-width: none; transform: translateX(-50%); }
.wow-split { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: rgba(255,255,255,.9); }
.wow-card h1 { position: absolute; z-index: 3; top: 48px; left: 69px; right: 69px; text-align: center; font-family: Prata, serif; font-size: 32px; line-height: 32px; font-weight: 400; }
.wow-card h1 span, .wow-card h1 strong { display: block; font-weight: 400; }
.wow-card h1 strong { color: var(--accent); }
.zoom-button { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.78); backdrop-filter: blur(5px); }
.zoom-button img { width: 20px !important; height: 20px !important; object-fit: contain !important; transform: none !important; }
.wow-card .zoom-button { position: absolute; z-index: 4; top: 76px; right: 20px; width: 28px; height: 28px; background: transparent; backdrop-filter: none; }
.wow-card .zoom-button img { width: 28px !important; height: 28px !important; }
.wow-gradient { display: none; }
.wow-result-actions { position: relative; z-index: 4; display: grid; gap: 12px; width: 100%; margin-top: 16px; }
.wow-secondary-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.wow-secondary-actions > .secondary-button { width: 100%; min-height: 52px; margin: 0; border-width: 2px; color: var(--accent); background: #fff; }
.wow-result-actions > .primary-button { width: 100%; min-height: 56px; }
.result-portrait { width: 100%; height: 420px; border-radius: 26px; object-fit: cover; object-position: center 30%; }
.palette-content { padding-top: 20px; }
.palette-content > .page-heading { margin-bottom: 16px; }
.palette-traits { display: flex; justify-content: flex-start; gap: 8px; margin: 0 0 8px; }
.palette-traits .trait:nth-child(1) { background: #f5e4d3; }
.palette-traits .trait:nth-child(2) { background: #f3dab9; }
.palette-traits .trait:nth-child(3) { background: #e0d8c5; }
.palette-intro { color: var(--ink); font-size: 12px; line-height: 16px; }
.lead-copy { color: var(--muted); font-size: 14px; line-height: 21px; text-align: center; }
.palette-content .section-label { margin: 16px 0 6px; }
.palette-map-title { display: flex; align-items: center; justify-content: space-between; }
.palette-map-title::after { content: "⌃"; font-family: Inter,sans-serif; font-size: 18px; }
.base-colors { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.base-colors span { height: 36px; border-radius: 7px; background: var(--c); }
.color-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin-bottom: 16px; }
.color-grid span, .color-grid button { height: 36px; border-radius: 7px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(60,36,17,.04); }
.palette-accordion { gap: 0; }
.palette-accordion .accordion-item { border: 0; border-radius: 0; background: transparent; }
.palette-accordion .accordion-item > button { min-height: 42px; padding: 10px 0 4px; font-family: Prata,serif; font-size: 20px; font-weight: 400; }
.palette-accordion .accordion-item > div > p { padding: 0 0 7px; font-size: 10px; line-height: 14px; }
.palette-accordion .accordion-item.open > div > p { padding-bottom: 7px; }
.palette-accordion .accordion-item.open > button i { transform: none; }
.shade-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; padding-bottom: 9px; }
.shade-grid figure { margin: 0; }
.palette-atlas-slice { position: relative; width: 100%; aspect-ratio: 118 / 173; overflow: hidden; border-radius: 8px; }
.palette-atlas-slice img { position: absolute; top: calc(var(--atlas-y) * -1); left: calc(var(--atlas-x) * -1); width: 867.8%; height: 739.88%; max-width: none; }
.shade-grid figcaption { margin-top: 4px; color: var(--muted); text-align: center; font-size: 8px; line-height: 11px; }
.swatch-row { display: flex; gap: 5px; padding: 0 0 8px; }
.swatch-row span { flex: 1; height: 36px; border-radius: 7px; background: var(--c); }
.palette-final { margin: 14px 0 24px; }
.palette-final h2 { font-family: Prata,serif; font-size: 20px; font-weight: 400; }
.palette-final ul { margin: 8px 0 0; padding-left: 18px; font-size: 11px; line-height: 16px; }
.recommendation { margin: 24px 0; padding: 22px; border-radius: 20px; background: #fff; }
.recommendation h2 { font-family: Prata, serif; font-size: 18px; font-weight: 400; }
.recommendation p { margin-top: 9px; color: var(--muted); font-size: 13px; line-height: 19px; }
.main-look { position: relative; width: 362px; height: 362px; margin: 0 auto; overflow: hidden; border-radius: 24px; }
.main-look > img { width: 100%; height: 100%; object-fit: cover; object-position: center 24%; }
.hair-look > img { position: absolute; width: 1186px; height: 1482px; max-width: none; object-fit: fill; transform: translate(-402px,-361px); }
.hair-look[data-hair-main="1"] > img { transform: translate(-784px,-361px); }
.hair-look[data-hair-main="2"] > img { transform: translate(-25px,-361px); }
.hair-look[data-hair-main="3"] > img { transform: translate(-402px,-923px); }
.hair-look[data-hair-main="4"] > img { transform: translate(-25px,-923px); }
.hair-look[data-hair-main="5"] > img { transform: translate(-784px,-923px); }
.main-look .zoom-button { position: absolute; top: 8px; right: 8px; bottom: auto; }
.look-name { margin: 18px 0 8px; text-align: center; font-family: Prata, serif; font-size: 22px; font-weight: 400; }
.look-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; width: 320px; margin: 0 auto; font-size: 11px; line-height: 15px; }
.look-facts span { display: grid; }
.look-facts b { color: var(--accent); }
.thumbnail-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 22px 0; }
.thumbnail-row button { aspect-ratio: 1; overflow: hidden; padding: 3px; border: 1.5px solid transparent; border-radius: 13px; background: #fff; }
.thumbnail-row button.active { border-color: var(--accent); }
.thumbnail-row img { width: 100%; height: 100%; border-radius: 9px; object-fit: cover; object-position: var(--thumb) center; }
.atlas-thumbnails button { position: relative; }
.atlas-thumbnails img { position: absolute; width: 327.6%; height: 409.4%; max-width: none; border-radius: 0; object-fit: fill; }
.atlas-thumbnails [data-atlas-thumb="0"] img { left: -111%; top: -99.7%; }
.atlas-thumbnails [data-atlas-thumb="1"] img { left: -216.6%; top: -99.7%; }
.atlas-thumbnails [data-atlas-thumb="2"] img { left: -6.9%; top: -99.7%; }
.atlas-thumbnails [data-atlas-thumb="3"] img { left: -111%; top: -255%; }
.atlas-thumbnails [data-atlas-thumb="4"] img { left: -6.9%; top: -255%; }
.atlas-thumbnails [data-atlas-thumb="5"] img { left: -216.6%; top: -255%; }
.makeup-source-thumbnails img { position: static; width: 100%; height: 100%; max-width: 100%; border-radius: 12px; object-fit: cover; object-position: center 22%; transform: none; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; border-radius: 16px; background: #eee5dd; }
.segmented button { height: 40px; border-radius: 12px; color: var(--muted); font-size: 13px; font-weight: 600; }
.segmented button.active { color: var(--ink); background: #fff; box-shadow: 0 3px 10px rgba(60,36,17,.08); }
.hair-color-image { width: 100%; height: 200px; margin-top: 18px; overflow: hidden; border-radius: 10px; }
.hair-color-image img { width: 540px; height: 675px; max-width: none; object-fit: fill; transform: translateY(-128px); }
.makeup-product { width: 100%; height: 320px; margin-top: 18px; border-radius: 24px; object-fit: cover; object-position: center 30%; }
.result-note { width: 100%; margin: 20px 0 24px; text-align: center; font-size: 14px; line-height: 18px; }
.makeup-details { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; width: 360px; margin: 12px auto 18px; }
.makeup-details > div { display: grid; grid-template-columns: 24px 1fr; align-items: start; gap: 8px; }
.makeup-details img { width: 24px; height: 24px; }.eye-symbol { font-size: 21px; text-align: center; }
.makeup-details span { display: grid; gap: 3px; color: var(--muted); font-size: 12px; }.makeup-details span b { color: var(--ink); font-size: 13px; }
.makeup-details i { grid-column: 2; width: 100%; height: 32px; border-radius: 4px; background: var(--c); }
.compare-card { position: relative; width: 100%; height: 635px; overflow: hidden; border-radius: 0 0 24px 24px; background: #e9ded0; }
.compare-card img { width: 100%; height: 100%; object-fit: cover; object-position: center 32%; }
.compare-card > span { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: rgba(255,255,255,.92); }
.compare-card b { display: none; }
.before-label { left: 18px; }.after-label { right: 18px; }
.before-after-content > .primary-button { width: 500px; margin: 24px auto 0; }.before-after-content > .secondary-button { width: 100%; margin-top: 10px; }
.image-lightbox { position: fixed; z-index: 200; inset: 0; display: grid; place-items: center; padding: 32px; background: rgba(22,14,9,.86); backdrop-filter: blur(8px); }
.image-lightbox > img { width: min(680px, 90vw, 86vh); height: auto; border-radius: 28px; object-fit: cover; }
.image-lightbox > button { position: fixed; top: 24px; right: 30px; width: 44px; height: 44px; border-radius: 50%; color: #fff; background: rgba(255,255,255,.13); font-size: 30px; }
.photo-lightbox-control { position: fixed; z-index: 4; top: 24px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.16); text-decoration: none; }
.photo-lightbox-close { right: auto !important; left: 30px; }
.photo-lightbox-download { right: 30px; }
.photo-lightbox-control img { display: block; width: 24px; height: 24px; filter: brightness(0) invert(1); }
.hair-photo-lightbox { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.hair-photo-lightbox > p { color: #fff; font-family: Prata,serif; font-size: 20px; line-height: 28px; }
.hair-source-lightbox { width: min(90vw,600px,calc(80dvh * .8003)); aspect-ratio: 1122 / 1402; margin: 0; overflow: hidden; border-radius: 24px; background: var(--paper); }
.hair-source-lightbox img { width: 100%; height: 100%; object-fit: cover; }
.wow-photo-lightbox { z-index: 300; padding: 32px; background: rgba(22,14,9,.9); backdrop-filter: blur(10px); }
.wow-photo-lightbox > .wow-photo-close,
.wow-photo-lightbox > .wow-photo-download { position: fixed; z-index: 3; top: 24px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; background: rgba(255,255,255,.14); }
.wow-photo-lightbox > .wow-photo-close { right: auto; left: 30px; }
.wow-photo-lightbox > .wow-photo-download { right: 30px; }
.wow-photo-close img, .wow-photo-download img { width: 24px; height: 24px; filter: brightness(0) invert(1); }
.wow-photo-composite { position: relative; width: min(90vw, 720px, calc(86dvh * .75)); aspect-ratio: 3 / 4; margin: 0; overflow: hidden; border-radius: 28px; background: #f7eee4; box-shadow: 0 18px 60px rgba(0,0,0,.32); }
.wow-photo-background { position: absolute; inset: 0; display: block; }
.wow-photo-background img { width: 100%; height: 100%; object-fit: cover; }
.wow-photo-subject-frame { position: absolute; z-index: 1; inset: 0; overflow: hidden; }
.wow-photo-subject { position: absolute; top: 0; left: -16.852%; width: 123.889%; height: auto; max-width: none; }
body.is-wow-photo .site-header,
body.is-wow-photo .wow-content > .page-back,
body.is-wow-photo .wow-card h1,
body.is-wow-photo .wow-card .zoom-button,
body.is-wow-photo .wow-gradient,
body.is-wow-photo .wow-result-actions { visibility: hidden; opacity: 0; pointer-events: none; }

/* Mobile cabinet */
.mobile-app { width: 402px; max-width: 100%; min-height: 100dvh; margin: 0 auto; padding-bottom: 28px; background: var(--paper); }
.profile-page { padding: 26px 20px 44px; }
.profile-top { display: flex; justify-content: space-between; align-items: center; }
.round-icon { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--stroke); border-radius: 50%; background: #fff; font-size: 17px; }
.profile-intro { display: flex; flex-direction: column; align-items: center; padding: 28px 0 22px; }
.avatar { display: grid; place-items: center; width: 78px; height: 78px; border-radius: 50%; color: #fff; background: var(--premium); font-family: Prata, serif; font-size: 28px; }
.profile-intro h1 { margin-top: 13px; font-family: Prata, serif; font-size: 25px; font-weight: 400; }
.profile-intro p { margin-top: 5px; color: var(--muted); font-size: 12px; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 18px; padding: 15px 8px; border-radius: 18px; background: #fff; }
.profile-stats div { display: grid; gap: 4px; text-align: center; border-right: 1px solid var(--stroke); }.profile-stats div:last-child { border: 0; }
.profile-stats strong { font-family: Prata, serif; font-size: 18px; font-weight: 400; }.profile-stats span { color: var(--muted); font-size: 10px; }
.profile-menu { overflow: hidden; border: 1px solid var(--stroke); border-radius: 18px; background: #fff; }
.profile-menu button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 62px; padding: 11px 15px; border-bottom: 1px solid var(--stroke); text-align: left; }
.profile-menu button:last-child { border: 0; }.profile-menu span { display: grid; gap: 4px; }.profile-menu b { font-size: 13px; }.profile-menu small { color: var(--muted); font-size: 10px; }.profile-menu i { color: var(--muted); font-style: normal; font-size: 23px; }
.logout-button { display: block; margin: 22px auto 0; color: #aa5146; font-size: 13px; font-weight: 600; }
.mobile-header { position: relative; z-index: 20; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; height: 58px; padding: 0 8px; background: transparent; }
.mobile-header button { font-size: 32px; font-weight: 300; }.mobile-header h1 { text-align: center; font-family: Prata, serif; font-size: 17px; line-height: 22px; font-weight: 400; }
.mobile-section { padding: 12px 20px 40px; }
.generation-card, .purchase-card { display: grid; grid-template-columns: 92px 1fr auto; gap: 13px; align-items: center; padding: 12px; border-radius: 18px; background: #fff; }
.generation-card > img, .purchase-card > img { width: 92px; height: 112px; border-radius: 13px; object-fit: cover; }
.generation-card h2, .purchase-card h2 { font-family: Prata, serif; font-size: 15px; font-weight: 400; }.generation-card p, .purchase-card p { margin-top: 5px; color: var(--muted); font-size: 10px; }
.generation-card div button { margin-top: 12px; color: var(--accent); font-size: 11px; font-weight: 700; }.purchase-card div b { display: block; margin-top: 9px; font-size: 13px; }.purchase-card > span { align-self: start; padding: 5px 7px; border-radius: 12px; color: #397446; background: #e7f1e8; font-size: 9px; font-weight: 700; }
.empty-note { margin-top: 28px; text-align: center; }.empty-note h2 { font-family: Prata, serif; font-size: 18px; font-weight: 400; }.empty-note p { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 17px; }
.bottom-nav { position: fixed; z-index: 30; left: 50%; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); width: min(402px,100%); height: 68px; padding: 8px 8px 6px; border-top: 1px solid var(--stroke); background: rgba(255,255,255,.95); transform: translateX(-50%); backdrop-filter: blur(10px); }
.bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 9px; }.bottom-nav i { font-style: normal; font-size: 20px; }.bottom-nav button.active { color: var(--accent); }.bottom-nav .create-nav i { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: #fff; background: var(--premium); font-size: 24px; }
.balance-box { text-align: center; }.balance-box > span { display: block; margin-top: 24px; color: var(--muted); font-size: 12px; }.balance-box > strong { display: block; margin: 13px 0; font-family: Prata, serif; font-size: 44px; font-weight: 400; }.balance-box > p { margin-bottom: 28px; color: var(--muted); font-size: 12px; }
.edit-form { padding-top: 20px; }.avatar--large { position: relative; margin: 0 auto 28px; }.avatar--large button { position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 27px; height: 27px; border: 2px solid var(--paper); border-radius: 50%; color: #fff; background: var(--accent); font-size: 16px; }
.edit-profile-content { padding-top: 18px; }
.edit-profile-content > h2 { margin: 18px 0 10px; font-family: Prata,serif; font-size: 20px; line-height: 28px; font-weight: 400; }
.edit-profile-card { overflow: hidden; border: 1px solid var(--stroke); border-radius: 16px; background: #fff; }
.edit-profile-row { display: grid; grid-template-columns: 28px 1fr 34px; align-items: center; gap: 11px; min-height: 64px; padding: 9px 11px 9px 14px; border-bottom: 1px solid var(--stroke); }
.edit-profile-row:last-child { border-bottom: 0; }
.edit-profile-row > img { width: 24px; height: 24px; object-fit: contain; }
.edit-profile-row > span { display: grid; gap: 4px; text-align: left; }
.edit-profile-row b { font-size: 14px; line-height: 18px; font-weight: 600; }
.edit-profile-row small { color: var(--muted); font-size: 12px; line-height: 16px; }
.edit-profile-row > button { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; }
.edit-profile-row > button:hover { background: rgba(229,194,137,.14); }
.edit-profile-row > button img { width: 20px; height: 20px; object-fit: contain; }
.delete-account { width: 100%; min-height: 52px; margin-top: 24px; border: 1px solid rgba(170,81,70,.22); border-radius: 16px; color: #aa5146; background: #fff; font-size: 14px; font-weight: 600; }
.birth-picker-backdrop { position: fixed; z-index: 180; left: 50%; bottom: 0; display: flex; align-items: flex-end; justify-content: center; width: min(402px,100vw); height: calc(100dvh - 95px); padding: 0; background: rgba(0,0,0,.6); transform: translateX(-50%); }
.birth-picker-backdrop[hidden] { display: none; }
.birth-picker { width: 100%; padding: 32px 20px 24px; border-radius: 24px 24px 0 0; background: #fff; box-shadow: 0 -18px 60px rgba(28,17,10,.2); animation: pickerRise 320ms cubic-bezier(.22,1,.36,1) both; }
.birth-picker-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.birth-picker-heading h2 { font-family: Prata,serif; font-size: 24px; line-height: 32px; font-weight: 400; }
.birth-picker-heading button { width: 36px; height: 36px; border-radius: 50%; background: var(--paper); font-size: 24px; }
.birth-picker > label, .birth-picker-selects label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; }
.birth-picker input, .birth-picker select { width: 100%; height: 52px; padding: 0 12px; border: 1.5px solid var(--stroke); border-radius: 14px; color: var(--ink); background: #fff; font-size: 16px; outline: none; }
.birth-picker-selects { display: grid; grid-template-columns: 72px 1fr 92px; gap: 8px; margin: 14px 0 18px; }
@keyframes pickerRise { from { opacity: 0; transform: translate3d(0,28px,0); } }
.referral-box { text-align: center; }.referral-box > img { width: 220px; height: 220px; margin: 2px auto 14px; object-fit: contain; }.referral-box h2 { font-family: Prata, serif; font-size: 25px; font-weight: 400; }.referral-box > p { margin: 12px 0 23px; color: var(--muted); font-size: 13px; line-height: 19px; }
.referral-code { display: flex; align-items: center; justify-content: space-between; height: 54px; margin-bottom: 12px; padding: 0 8px 0 15px; border: 1px dashed var(--accent); border-radius: 15px; background: #fff; }.referral-code span { font-size: 13px; font-weight: 700; letter-spacing: .4px; }.referral-code button { padding: 9px 10px; border-radius: 10px; color: var(--accent); background: rgba(229,194,137,.18); font-size: 10px; font-weight: 700; }.referral-box small { display: block; margin-top: 12px; color: var(--muted); font-size: 10px; line-height: 15px; }
.faq-list { display: grid; gap: 8px; }.support-card { margin-top: 20px; padding: 22px; border-radius: 18px; text-align: center; background: #fff; }.support-card h2 { font-family: Prata, serif; font-size: 18px; font-weight: 400; }.support-card p { margin: 7px 0 14px; color: var(--muted); font-size: 11px; }.support-card a { display: grid; place-items: center; height: 44px; border-radius: 14px; color: #fff; background: var(--premium); font-size: 12px; font-weight: 700; }

/* Exact profile frames: Figma 306:2282 and 306:2455 */
.profile-page { height: 100dvh; min-height: 0; padding: 0; overflow: hidden; }
.profile-header { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; width: 100%; height: 48px; flex: 0 0 48px; }
.profile-header > button { display: grid; place-items: center; width: 64px; height: 48px; }
.profile-header > button img { width: 64px; height: 48px; max-width: none; }
.profile-header > strong { color: var(--accent); text-align: center; font-size: 12px; line-height: 16px; font-weight: 700; }
.profile-body { display: flex; flex-direction: column; gap: 24px; padding: 24px 20px 0; }
.profile-name { display: flex; align-items: center; justify-content: center; gap: 12px; height: 32px; }
.profile-name h1 { font-family: Prata,serif; font-size: 32px; line-height: 32px; font-weight: 400; }
.profile-name button { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; }
.profile-name img { width: 28px; height: 28px; max-width: none; object-fit: contain; }
.profile-page .profile-stats { display: flex; align-items: stretch; height: 78px; margin: 0; padding: 16px 24px; border: 1px solid var(--stroke); border-radius: 16px; background: #fff; }
.profile-page .profile-stats > div { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 8px; border-right: 1px solid var(--stroke); }
.profile-page .profile-stats > div:last-child { border-right: 0; }
.profile-page .profile-stats strong { font-family: Prata,serif; font-size: 20px; line-height: 20px; font-weight: 400; }
.profile-page .profile-stats span { color: var(--muted); font-size: 12px; line-height: 16px; }
.profile-overview { display: flex; flex-direction: column; overflow: hidden; padding: 8px 16px; border: 1px solid var(--stroke); border-radius: 16px; background: #fff; }
.profile-overview-row { display: grid; grid-template-columns: 32px minmax(0,1fr); align-items: center; gap: 8px; width: 100%; min-height: 64px; padding: 8px 0; border-bottom: 1px solid var(--stroke); text-align: left; }
.profile-overview-row:last-child { border-bottom: 0; }
.profile-overview-row > img:first-child { width: 24px; height: 24px; margin: 4px; object-fit: contain; }
.profile-overview-row > span { display: grid; gap: 2px; min-width: 0; }
.profile-overview-row b { font-size: 16px; line-height: 20px; font-weight: 400; }
.profile-overview-row small { overflow-wrap: anywhere; color: var(--muted); font-size: 12px; line-height: 16px; }
.profile-overview-row .profile-chevron { width: 24px; height: 24px; transform: rotate(-90deg); }
.profile-page .profile-menu { display: flex; flex-direction: column; overflow: hidden; padding: 8px 16px; border: 1px solid var(--stroke); border-radius: 16px; background: #fff; }
.profile-menu .profile-menu-row { display: grid; grid-template-columns: 32px minmax(0,1fr) 24px; align-items: center; gap: 8px; width: 100%; min-height: 57px; padding: 8px 0; border-bottom: 1px solid var(--stroke); text-align: left; }
.profile-menu .profile-menu-row:last-child { border-bottom: 0; }
.profile-menu-row > img:first-child { width: 24px; height: 24px; margin: 4px; }
.profile-menu-row > span { display: grid; gap: 0; }
.profile-menu-row b { font-size: 16px; line-height: 20px; font-weight: 400; }
.profile-menu-row small { color: var(--muted); font-size: 12px; line-height: 16px; }
.profile-menu-row .profile-chevron { width: 24px; height: 24px; transform: rotate(-90deg) !important; }
.profile-page .profile-menu--single .profile-menu-row { min-height: 46px; }
.profile-logout { display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 8px; width: 100%; min-height: 50px; padding: 8px 16px; border: 1px solid var(--stroke); border-radius: 16px; background: #fff; text-align: left; font-size: 16px; line-height: 20px; }
.profile-logout img { width: 24px; height: 24px; margin: 4px; }

.profile-subpage { height: 100dvh; min-height: 0; padding: 0; overflow: hidden; }
.profile-subpage-body { display: flex; flex-direction: column; gap: 24px; padding: 24px 20px 0; }
.profile-page-heading { display: grid; gap: 16px; text-align: center; }
.profile-page-heading h1 { font-family: Prata,serif; font-size: 32px; line-height: 32px; font-weight: 400; }
.profile-page-heading p { color: var(--muted); font-size: 14px; line-height: 18px; }
.generation-history-card { display: grid; grid-template-columns: 90px minmax(0,1fr) 24px; align-items: center; gap: 16px; width: 100%; height: 90px; padding: 0 16px 0 0; overflow: hidden; border-radius: 16px; background: #fff; text-align: left; }
.generation-history-card > img:first-child { width: 90px; height: 90px; object-fit: cover; }
.generation-history-card > span { display: grid; gap: 8px; }
.generation-history-card b { font-family: Prata,serif; font-size: 20px; line-height: 20px; font-weight: 400; letter-spacing: -.2px; }
.generation-history-card small { color: var(--muted); font-size: 14px; line-height: 18px; }
.generation-history-card > img:last-child { width: 24px; height: 24px; transform: rotate(-90deg); }
.purchase-history-list { display: grid; gap: 24px; }
.purchase-history-card { display: grid; grid-template-columns: 90px minmax(0,1fr) auto; align-items: center; gap: 16px; width: 100%; height: 90px; padding: 0 16px 0 0; overflow: hidden; border-radius: 16px; background: #fff; }
.purchase-history-card > img { width: 90px; height: 90px; object-fit: cover; }
.purchase-copy { display: grid; gap: 4px; min-width: 0; }
.purchase-copy > b, .purchase-history-card > strong { font-family: Prata,serif; font-size: 20px; line-height: 20px; font-weight: 400; letter-spacing: -.2px; white-space: nowrap; }
.purchase-copy > small { color: var(--muted); font-size: 14px; line-height: 18px; white-space: nowrap; }
.purchase-copy > em { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 18px; font-style: normal; }
.purchase-copy > em img { width: 16px; height: 16px; }
.purchase-copy > em.is-success { color: #7daf4a; }
.purchase-copy > em.is-error { color: #cb3a3c; }
.balance-summary { display: flex; align-items: center; gap: 16px; width: 100%; height: 90px; padding: 0 16px; border-radius: 16px; background: #fff; }
.balance-summary > span { display: grid; flex: 1; gap: 8px; }
.balance-summary small { color: var(--muted); font-size: 14px; line-height: 18px; }
.balance-summary b { font-family: Prata,serif; font-size: 20px; line-height: 20px; font-weight: 400; }
.balance-summary .primary-button { width: 128px; min-height: 48px; border-radius: 16px; font-size: 16px; }

.edit-profile-page { position: relative; height: 100dvh; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
.edit-profile-content { display: flex; flex-direction: column; gap: 24px; padding: 24px 20px 0; }
.edit-profile-content > h1 { text-align: center; font-family: Prata,serif; font-size: 32px; line-height: 32px; font-weight: 400; }
.edit-profile-content .edit-profile-card { display: flex; flex-direction: column; gap: 8px; overflow: hidden; padding: 16px; border: 1px solid var(--stroke); border-radius: 16px; background: #fff; }
.edit-profile-card > h2 { font-family: Prata,serif; font-size: 20px; line-height: 20px; font-weight: 400; letter-spacing: -.2px; }
.edit-profile-card .edit-profile-row { display: grid; grid-template-columns: 32px minmax(0,1fr) 24px; align-items: center; gap: 8px; width: 100%; min-height: 56px; padding: 8px 0; border-bottom: 1px solid var(--stroke); border-radius: 0; text-align: left; }
.edit-profile-card .edit-profile-row:last-child { border-bottom: 0; }
.edit-profile-row > img:first-child { width: 24px; height: 24px; margin: 4px; }
.edit-profile-row > span { display: grid; gap: 0; }
.edit-profile-row b { font-size: 16px; line-height: 20px; font-weight: 400; }
.edit-profile-row small { color: var(--muted); font-size: 12px; line-height: 16px; }
.edit-profile-row .edit-row-action { width: 24px; height: 24px; margin: 0; }
.edit-profile-row--status { cursor: default; }
.edit-profile-row--status .edit-profile-status { width: 8px; height: 8px; justify-self: center; border-radius: 50%; background: var(--stroke); }
.edit-profile-row--status.is-connected .edit-profile-status { background: var(--accent); }
.edit-profile-row--connect { cursor: pointer; }
.edit-profile-row--connect strong { justify-self: end; color: var(--accent); font-size: 13px; line-height: 18px; font-weight: 600; }
.edit-profile-card button.edit-profile-row {
  transition: background-color 180ms var(--motion-ease-out);
}
.edit-profile-card button.edit-profile-row:hover { background: rgba(60,36,17,.035); }
.edit-profile-card button.edit-profile-row:active { background: rgba(60,36,17,.07); }
.edit-profile-card button.edit-profile-row:focus-visible {
  outline: 2px solid rgba(194,128,52,.38);
  outline-offset: -2px;
}
.edit-profile-card button.edit-profile-row > img { transform: none; }
.edit-profile-group-label { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.edit-profile-page .delete-account { display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 8px; width: 100%; min-height: 50px; margin: 0; padding: 8px 16px; border: 1px solid var(--stroke); border-radius: 16px; color: var(--ink); background: #fff; text-align: left; font-size: 16px; font-weight: 400; }
.delete-account img { width: 24px; height: 24px; margin: 4px; }

.profile-editor-backdrop { position: fixed; z-index: 179; top: 48px; right: 0; bottom: 0; left: 50%; width: min(402px,100vw); height: auto; background: rgba(0,0,0,.6); transform: translateX(-50%); }
.profile-editor-sheet { position: absolute; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; gap: 24px; max-height: 100%; padding: 32px 20px 24px; overflow-x: hidden; overflow-y: auto; border-radius: 24px 24px 0 0; background: #fff; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; animation: pickerRise 320ms cubic-bezier(.22,1,.36,1) both; }
.profile-editor-heading { display: grid; gap: 16px; text-align: center; }
.profile-editor-heading h2 { font-family: Prata,serif; font-size: 32px; line-height: 32px; font-weight: 400; }
.profile-editor-heading p { color: var(--muted); font-size: 14px; line-height: 18px; }
.profile-editor-fields { display: grid; gap: 16px; }
.profile-editor-fields label { position: relative; display: block; }
.profile-editor-fields label span { position: absolute; z-index: 1; top: 8px; left: 16px; color: var(--muted); font-size: 12px; line-height: 16px; pointer-events: none; }
.profile-editor-sheet input { width: 100%; height: 56px; padding: 22px 16px 6px; border: 1px solid var(--stroke); border-radius: 16px; color: var(--ink); background: #fff; font-size: 16px; outline: 0; }
.profile-editor-fields .editor-placeholder span { display: none; }
.profile-editor-fields .editor-placeholder input { padding: 8px 16px; }
.profile-editor-save:disabled { opacity: .4; }
.profile-editor-sheet .secondary-button { height: 56px; border-width: 2px; color: var(--accent); font-size: 16px; }
.danger-button { display: grid; place-items: center; width: 100%; height: 56px; border-radius: 20px; color: #fff; background: #cb3a3c; font-size: 16px; font-weight: 700; }
.referral-body { display: flex; flex-direction: column; gap: 24px; padding: 24px 20px; }
.referral-panel { overflow: hidden; border: 1px solid var(--stroke); border-radius: 24px; background: #fff; }
.referral-reward { display: flex; align-items: center; gap: 16px; min-height: 92px; padding: 16px; }
.referral-reward h2 { flex: 1; font-family: Prata,serif; font-size: 20px; line-height: 20px; font-weight: 400; letter-spacing: -.2px; }
.referral-reward h2 em { color: var(--accent); font-style: normal; }
.referral-reward img { width: 75px; height: 60px; object-fit: cover; }
.referral-link { display: grid; gap: 8px; padding: 16px; border-top: 1px solid var(--stroke); border-bottom: 1px solid var(--stroke); }
.referral-link > small { color: var(--ink); font-size: 12px; line-height: 16px; }
.referral-link > div { display: grid; grid-template-columns: minmax(0,1fr) 128px; gap: 8px; }
.referral-link span { display: flex; align-items: center; min-width: 0; height: 48px; padding: 0 16px; overflow: hidden; border: 1px solid var(--stroke); border-radius: 16px; color: var(--muted); font-size: 16px; white-space: nowrap; text-overflow: ellipsis; }
.referral-link button { height: 48px; border-radius: 16px; color: #fff; background: var(--premium); font-size: 16px; font-weight: 700; }
.referral-stats { display: flex; align-items: stretch; height: 78px; padding: 16px 24px; }
.referral-stats > span { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-right: 1px solid var(--stroke); }
.referral-stats > span:last-child { border-right: 0; }
.referral-stats b { font-family: Prata,serif; font-size: 20px; line-height: 20px; font-weight: 400; }
.referral-stats small { color: var(--muted); font-size: 12px; line-height: 16px; }
.referral-history { display: grid; gap: 8px; }
.referral-history h2 { font-family: Manrope,Inter,sans-serif; font-size: 16px; line-height: 16px; }
.referral-person { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 1.5px solid var(--stroke); border-radius: 12px; }
.referral-person > span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: var(--accent); background: #fff; }
.referral-person b { font-size: 16px; line-height: 20px; font-weight: 400; }
.referral-person small { color: var(--muted); font-size: 12px; line-height: 16px; }
.faq-body { display: flex; flex-direction: column; gap: 24px; padding: 24px 20px; }
.faq-body > h1 { text-align: center; font-family: Prata,serif; font-size: 32px; line-height: 32px; font-weight: 400; }
.faq-support { display: grid; gap: 16px; padding: 16px; border: 1px solid var(--stroke); border-radius: 16px; background: #fff; }
.faq-support > div { display: flex; align-items: center; gap: 12px; }
.faq-support img { width: 56px; height: 56px; object-fit: contain; }
.faq-support span { display: grid; gap: 2px; }
.faq-support b { font-family: Inter,sans-serif; font-size: 16px; line-height: 20px; font-weight: 400; letter-spacing: 0; }
.faq-support small { font-size: 12px; line-height: 16px; }
.faq-support a { display: grid; place-items: center; width: 100%; height: 48px; border-radius: 16px; color: #fff; background: var(--premium); font-size: 16px; font-weight: 700; }
.faq-page .faq-list { display: block; overflow: hidden; border: 1px solid var(--stroke); border-radius: 16px; background: #fff; }
.faq-page .faq-list .accordion-item { position: relative; border: 0; border-radius: 0; }
.faq-page .faq-list .accordion-item:not(:last-child)::after { position: absolute; right: 16px; bottom: 0; left: 16px; height: 1px; background: var(--stroke); content: ""; pointer-events: none; }
.faq-page .faq-list .accordion-item > button { min-height: 62px; padding: 11px 16px; font-family: Inter,sans-serif; font-size: 16px; line-height: 20px; font-weight: 400; letter-spacing: 0; }
.faq-page .faq-list .accordion-item > button i { flex: 0 0 24px; font-family: Inter,sans-serif; font-size: 24px; line-height: 20px; }
.faq-page .faq-list .accordion-item > div > p { padding-right: 16px; padding-left: 16px; font-size: 12px; line-height: 16px; }
.faq-page .faq-list .accordion-item.open > div > p { padding-bottom: 16px; }
.faq-page .faq-list .accordion-item > button:hover { background: #fffaf5; }
.faq-page .faq-list .accordion-item > button:active { transform: none; background: rgba(229,194,137,.2); }
.faq-page { height: auto; min-height: 100dvh; overflow: visible; }
.faq-body { padding-bottom: 32px; }

/* Help and support has a dedicated desktop composition in Figma. */
.faq-mobile-view { display: none; }
.faq-desktop-view { display: block; min-height: 100dvh; }
.faq-desktop-content { display: flex; flex-direction: column; gap: 24px; padding-top: 48px; }
.faq-desktop-content > h1 { text-align: center; font-family: Prata,serif; font-size: 32px; line-height: 32px; font-weight: 400; }
.faq-desktop-content .faq-support { margin: 0; border-width: 1px; }
.faq-desktop-list { display: block; overflow: hidden; border: 1px solid var(--stroke); border-radius: 16px; background: #fff; }
.faq-desktop-list .accordion-item { position: relative; border: 0; border-radius: 0; }
.faq-desktop-list .accordion-item:not(:last-child)::after { position: absolute; right: 16px; bottom: 0; left: 16px; height: 1px; background: var(--stroke); content: ""; pointer-events: none; }
.faq-desktop-list .accordion-item > button { min-height: 62px; padding: 11px 16px; font-family: Inter,sans-serif; font-size: 16px; line-height: 20px; font-weight: 400; letter-spacing: 0; }
.faq-desktop-list .accordion-item > button i { flex: 0 0 24px; font-family: Inter,sans-serif; font-size: 24px; line-height: 20px; }
.faq-desktop-list .accordion-item > div > p { padding-right: 16px; padding-left: 16px; font-size: 12px; line-height: 16px; }
.faq-desktop-list .accordion-item.open > div > p { padding-bottom: 16px; }
.faq-desktop-list .accordion-item > button:hover { background: #fffaf5; }
.faq-desktop-list .accordion-item > button:active { transform: none; background: rgba(229,194,137,.2); }

/* Account screens have their own desktop frames in Figma; the mobile layouts stay intact below 700px. */
.account-mobile-view { display: none; }
.account-desktop-view { display: block; min-height: 100dvh; }
.standard-content.account-desktop-content { display: flex; flex-direction: column; gap: 24px; padding-top: 48px; }
.account-desktop-content .profile-page-heading { gap: 16px; }
.account-desktop-content .profile-page-heading h1 { font-size: 32px; line-height: 32px; }
.account-desktop-content .profile-page-heading p { font-size: 14px; line-height: 18px; }

.profile-desktop-content .profile-stats {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 78px;
  margin: 0;
  padding: 16px 24px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: #fff;
}
.profile-desktop-content .profile-stats > div { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 8px; border-right: 1px solid var(--stroke); text-align: center; }
.profile-desktop-content .profile-stats > div:last-child { border-right: 0; }
.profile-desktop-content .profile-stats strong { font-family: Prata,serif; font-size: 20px; line-height: 20px; font-weight: 400; }
.profile-desktop-content .profile-stats span { color: var(--muted); font-size: 12px; line-height: 16px; }
.profile-desktop-content .profile-menu { display: flex; flex-direction: column; width: 100%; height: auto; overflow: hidden; padding: 8px 16px; border: 1px solid var(--stroke); border-radius: 16px; background: #fff; }
.profile-desktop-content .profile-menu .profile-menu-row { flex: 0 0 auto; min-height: 57px; }
.profile-desktop-content .profile-menu--single { height: 54px; padding: 0 16px; }
.profile-desktop-content .profile-menu--single .profile-menu-row { min-height: 52px; }

.account-history-content .generation-history-card,
.account-history-content .purchase-history-card,
.account-history-content .balance-summary { flex: 0 0 90px; }

.edit-profile-desktop-content > h1 { height: 32px; text-align: center; font-family: Prata,serif; font-size: 32px; line-height: 32px; font-weight: 400; }
.edit-profile-desktop-content .edit-profile-card { display: flex; flex-direction: column; gap: 8px; width: 100%; overflow: hidden; padding: 16px; border: 1px solid var(--stroke); border-radius: 16px; background: #fff; }
.edit-profile-desktop-content .edit-profile-card:first-of-type { height: auto; }
.edit-profile-desktop-content .edit-profile-card:nth-of-type(2) { height: 289px; }
.edit-profile-desktop-content .edit-profile-row { height: 53px; min-height: 0; flex: 0 0 53px; }
.edit-profile-desktop-content .edit-profile-row:last-child { height: 44px; flex-basis: 44px; }
.edit-profile-desktop-content .delete-account { display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 8px; width: 100%; height: 50px; min-height: 50px; margin: 0; padding: 8px 16px; border: 1px solid var(--stroke); border-radius: 16px; color: var(--ink); background: #fff; text-align: left; font-size: 16px; font-weight: 400; }

.profile-editor-actions { display: grid; gap: 8px; }
.account-desktop-view .profile-editor-backdrop { inset: 0; width: 100vw; height: 100dvh; transform: none; }
.account-desktop-view .profile-editor-sheet { top: 50%; right: auto; bottom: auto; left: 50%; width: 402px; max-height: calc(100dvh - 32px); border-radius: 24px; transform: translate(-50%,-50%); animation: none; }

.referral-desktop-content .profile-page-heading { height: 84px; }
.referral-desktop-content .referral-panel { flex: 0 0 276px; }
.referral-desktop-content .referral-body { padding: 0; }
.referral-desktop-content .referral-history { flex: 0 0 160px; }

@media (min-width: 701px) {
  .bottom-nav, .mobile-menu-backdrop { display: none !important; }
  html { scrollbar-gutter: stable; }
  html:has(body[data-route="profile"]),
  html:has(body[data-route="login"]),
  html:has(body[data-route="register"]),
  html:has(body[data-route="generations"]),
  html:has(body[data-route="purchases"]),
  html:has(body[data-route="balance"]),
  html:has(body[data-route="edit-profile"]),
  html:has(body[data-route="referral"]),
  html:has(body[data-route="how"]),
  html:has(body[data-route="faq"]) { scrollbar-gutter: auto; }
}

@media (max-height: 820px) and (min-width: 701px) {
  .hero-card { height: calc(100dvh - 146px); min-height: 610px; }
  .standard-content { padding-top: 24px; }
  .benefit-card { height: 94px; }.benefit-media { height: 94px; }
  .what-content .page-heading { margin-bottom: 18px; }
  .how-content { padding-top: 48px; }
  .how-content .page-heading { margin-bottom: 24px; }
  .page[data-page="how"] .steps-list { gap: 32px; }
  .page[data-page="how"] .step-card { min-height: 120px; }
  .upload-content { padding-top: 24px; transform: scale(.84); transform-origin: top center; }
  .payment-content { padding-top: 16px; }.payment-content .page-heading { margin-bottom: 10px; }
  .auth-content { padding-top: 22px; }.auth-content .page-heading { margin-bottom: 14px; }.auth-card { padding: 18px 24px; }.auth-card label { margin-bottom: 10px; }
}

@media (max-width: 700px) {
  body[data-route="home"], body[data-route="result-wow"] { --page-background: #f7eee4; }
  .auth-title-desktop, .auth-subtitle-desktop { display: none; }
  .auth-title-mobile, .auth-subtitle-mobile { display: inline; }
  .account-desktop-view { display: none; }
  .account-mobile-view { display: block; }
  .faq-desktop-view { display: none; }
  .faq-mobile-view { display: block; }
  .site-header { grid-template-columns: 44px 1fr 44px; height: 48px; padding: 0 12px; }
  .site-header .brand { grid-column: 2; justify-self: center; width: auto; color: var(--accent); text-align: center; font-size: 14px; line-height: 20px; letter-spacing: -.2px; }
  .main-nav, .header-actions { display: none; }
  .mobile-site-back, .mobile-site-menu { display: grid; place-items: center; }
  .mobile-site-back { position: absolute; top: 0; left: 0; width: 64px; height: 48px; overflow: visible; }
  .mobile-site-back img { width: 48px; height: 64px; max-width: none; transform: translateY(-3px) rotate(90deg) scale(1.12); }
  .mobile-site-menu { position: absolute; top: 0; right: 0; width: 64px; height: 48px; font-size: 0; }
  .mobile-site-menu::before { content: ""; position: absolute; top: 50%; left: 50%; width: 20px; height: 2.5px; border-radius: 999px; background: var(--ink); box-shadow: 0 -6px 0 var(--ink), 0 6px 0 var(--ink); transform: translate(-50%,-50%); }
  .page { min-height: calc(100dvh - 48px); padding: 0 20px; }
  .site-footer, .result-footer { display: none; }
  .page-heading h1 { font-size: 26px; line-height: 34px; }.page-heading p { margin-top: 7px; font-size: 12px; line-height: 17px; }
  .standard-content { width: 100%; padding-top: 28px; }
  .primary-button { min-height: 52px; border-radius: 18px; font-size: 13px; }

  body:has(.page[data-page="home"]) { height: 100dvh; min-height: 100dvh; overflow: hidden; }
  .page[data-page="home"] { position: fixed; inset: 48px 0 0; width: 100%; height: auto !important; min-height: 0 !important; max-height: none !important; padding: 0; }
  .page[data-page="home"] .hero-card { position: absolute; inset: 0; width: 100%; height: 100% !important; min-height: 0 !important; max-height: none !important; margin: 0; border-radius: 0; }
  .hero-photo, .hero-photo-after .hero-photo { width: 100%; }
  .hero-photo--base { top: 0; bottom: -2px; left: -7.96%; width: 116.17%; height: calc(100% + 2px); object-fit: cover; object-position: center bottom; }
  .hero-photo--subject { top: auto; bottom: -36.57vw; left: 0; width: 100%; height: auto; min-height: 0; object-fit: fill; object-position: center bottom; }
  .hero-title { top: 24px; }.hero-title span, .hero-title strong { font-size: 48px; line-height: 58px; }
  .hero-bottom { height: 201px; padding: 0 20px 24px; }
  .hero-bottom .primary-button { height: 56px; min-height: 56px; border-radius: 20px; font-size: 16px; }
  body:has(.page[data-page="home"]) .site-footer { display: none; }

  .what-content { padding-top: 24px; }.what-content .page-heading { margin-bottom: 18px; }
  .what-content { display: flex; flex-direction: column; height: 100%; padding-top: 24px; }
  .what-content .page-heading { margin-bottom: 24px; }
  .what-content .page-heading h1 { font-size: 32px; line-height: 32px; }
  .benefit-list { gap: 12px; margin-bottom: 0; }
  .benefit-card { grid-template-columns: 110px 1fr; height: 96px; border-radius: 16px; }
  .benefit-media { width: 110px; height: 96px; }
  .benefit-card > div:last-child { padding: 16px 10px; }
  .benefit-card h2 { font-size: 20px; line-height: 20px; }
  .benefit-card p { margin-top: 8px; font-size: 14px; line-height: 18px; }
  .what-content > .primary-button { min-height: 56px; margin-top: auto; margin-bottom: 24px; border-radius: 20px; font-size: 16px; }

  .how-content { display: flex; flex-direction: column; height: 100%; padding-top: 24px; }
  .how-content .page-heading { margin-bottom: 40px; }
  .how-content .page-heading h1 { font-size: 32px; line-height: 32px; }
  .how-content .page-heading p { margin-top: 16px; font-size: 14px; line-height: 18px; }
  .steps-list { gap: 32px; margin-bottom: 0; }
  .step-card { grid-template-columns: 24px minmax(0, 1fr) 140px; gap: 12px; min-height: 120px; }
  .step-number, .step-number img { width: 24px; height: 24px; }
  .steps-list::before { top: var(--step-axis-top, 12px); bottom: var(--step-axis-bottom, 108px); left: 11px; width: 2px; }
  .step-media { width: 140px; height: 120px; }
  .step-art { width: 140px; height: 120px; border-radius: 12px; }
  .step-card:nth-child(2) .step-art { width: 120px; height: 120px; margin-left: 10px; border-radius: 50%; }
  .step-copy h2 { font-size: 20px; line-height: 24px; letter-spacing: -.2px; }
  .step-card:nth-child(3) .step-copy h2 span { display: block; }
  .step-copy p { margin-top: 8px; font-size: 12px; line-height: 16px; }
  .how-content > .primary-button { min-height: 56px; margin-top: auto; margin-bottom: 24px; border-radius: 20px; font-size: 16px; }

  .upload-content { padding-top: 24px; }
  .upload-content .page-heading { margin-bottom: 24px; }
  .upload-content .page-heading h1 { font-size: 32px; line-height: 32px; }
  .upload-content .page-back { display: none; }
  .upload-card { min-height: 307px; padding: 17.5px; border-radius: 16px; }
  .upload-examples { width: 240px; height: 128px; flex-basis: 128px; }
  .upload-examples img { width: 102px; height: 102px; }
  .upload-example-title { font-size: 20px; line-height: 20px; }
  .upload-intro { margin: 8px auto 16px; font-size: 14px; line-height: 18px; }
  .upload-actions { gap: 8px; }
  .upload-actions .secondary-button { min-height: 48px; font-size: 14px; }
  .guidelines { gap: 8px; padding: 24px 0; }
  .guidelines h2 { margin-bottom: 0; font-size: 16px; line-height: 16px; }
  .guidelines > div { min-height: 40px; gap: 12px; padding: 8px 16px; }
  .guidelines > div > span, .guidelines img { width: 24px; height: 24px; flex-basis: 24px; }
  .guidelines p { font-size: 14px; line-height: 18px; }
  .privacy-note { margin-top: 12px; font-size: 10px; line-height: 14px; }
  .photo-check { width: 208px; height: 208px; margin: 0 auto; }

  .analysis-content { width: 100%; min-width: 0; padding-top: 24px; }
  .analysis-content .page-heading { margin-bottom: 16px; }
  .analysis-content .page-heading h1 { font-size: 32px; line-height: 32px; }
  .analysis-orb { width: 160px; height: 160px; margin-bottom: 16px; }
  .analysis-statuses { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 32px; }
  .analysis-status { display: flex; min-width: 0; min-height: 104px; padding: 8px; gap: 8px; border-radius: 12px; }
  .analysis-status > span { width: 24px; height: 24px; flex-basis: 24px; border-radius: 0; }
  .analysis-status img { width: 24px; height: 24px; }
  .analysis-status p { font-size: 10px; line-height: 12px; }
  .analysis-helper { margin-bottom: 8px; }
  .analysis-helper h2 { font-size: 20px; line-height: 20px; }
  .question-card { padding: 16px 12px; border-radius: 16px; }
  .question-card h2 { margin-bottom: 12px; font-size: 16px; line-height: 20px; }
  .answer-list { gap: 8px; }
  .answer { min-height: 36px; padding: 8px 10px; font-size: 14px; line-height: 18px; }
  .question-card .primary-button { min-height: 40px; margin-top: 12px; border-radius: 12px; font-size: 16px; }
  .analysis-ready-card { margin-top: 48px; padding: 20px 16px; }
  .complete-card > img { height: 96px; margin-bottom: 12px; }

  .payment-content { width: 100%; padding-top: 24px; }.payment-content .page-heading { margin-bottom: 24px; }.payment-content .page-heading h1 { font-size: 32px; line-height: 38.4px; }.payment-example { margin-bottom: 24px; font-size: 16px; line-height: 20px; }.payment-preview { width: min(362px, 100%); height: 360px; border-radius: 16px; }.carousel-dots { margin: 12px 0 18px; }.price { margin-bottom: 22px; }.price strong { font-size: 32px; line-height: 38px; }

  .auth-content { width: 100%; padding-top: 24px; }.auth-content .page-heading { margin-bottom: 24px; }.auth-content .page-heading h1 { font-size: 32px; line-height: 38px; }.auth-card { padding: 18px; border-radius: 20px; }.auth-card label { gap: 6px; margin-bottom: 10px; font-size: 12px; }.auth-card input { height: 56px; font-size: 16px; }.password-wrap button { height: 56px; }.forgot-link { margin-bottom: 12px; font-size: 14px; }.auth-card .primary-button { min-height: 56px; }.yandex-button { height: 48px; font-size: 13px; }.auth-divider { height: 28px; }.auth-switch { margin-top: 11px; font-size: 14px; }

  .page[data-page="result-wow"] { min-height: calc(100dvh - 48px); padding: 0; overflow: hidden; background: #f7eee4; }
  .wow-content { width: 100%; height: calc(100dvh - 48px); display: flex; flex-direction: column; }
  .wow-content > .page-back { display: none; }
  .wow-card { width: 100%; height: 100%; min-height: 0; max-height: none; flex: 0 0 100%; border-radius: 0; background: #f7eee4; }
  .wow-base { top: 0; right: auto; bottom: 0; left: -8%; width: 116%; height: 100%; object-fit: cover; }
  .wow-subject-frame { inset: 0; }
  .wow-subject { top: auto; bottom: -6px; left: -31.5%; width: 158%; height: auto; object-fit: contain; }
  .wow-card h1 { z-index: 4; top: 24px; font-size: 32px; line-height: 32px; }
  .wow-card .zoom-button { z-index: 5; top: 76px; right: 20px; width: 28px; height: 28px; background: transparent; backdrop-filter: none; }
  .wow-card .zoom-button img { width: 28px !important; height: 28px !important; }
  .wow-gradient { display: block; position: absolute; z-index: 3; right: 0; bottom: 0; left: 0; height: 201px; background: linear-gradient(180deg, rgba(247,238,228,0) 0%, #f7eee4 100%); }
  .wow-result-actions { position: absolute; z-index: 6; right: 20px; bottom: 24px; left: 20px; width: auto; margin: 0; gap: 10px; }
  .wow-secondary-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .wow-secondary-actions > .secondary-button { min-height: 48px; padding: 8px; border-radius: 16px; font-size: 13px; }
  .wow-result-actions > .primary-button { height: 56px; min-height: 56px; border-radius: 20px; font-size: 16px; }

  body.is-scroll .site-header { position: relative; }
  body.is-scroll .site-footer { display: none; }
  body.is-scroll .page { padding-bottom: 0; }
  .result-column { width: 100%; padding-top: 26px; padding-bottom: 34px; }.result-column > .page-heading { margin-bottom: 20px; }
  .palette-content { padding-top: 24px; }
  .palette-content > .page-heading { margin-bottom: 24px; }
  .palette-content .page-heading h1 { font-size: 32px; line-height: 32px; }
  .palette-traits { gap: 4px; margin-bottom: 12px; }
  .palette-traits .trait { padding: 6px 10px; font-size: 20px; line-height: 20px; }
  .palette-intro { font-size: 14px; line-height: 18px; }
  .palette-content .section-label { margin: 24px 0 12px; font-size: 20px; line-height: 20px; }
  .free-content { padding-top: 24px; }.free-content > .page-heading { margin-bottom: 24px; }.person-summary { grid-template-columns: 123px 1fr; gap: 16px; width: 280px; padding: 0; border-radius: 0; }.person-summary > img { width: 123px; height: 164px; border-radius: 16px; }.person-summary > div > span { margin: 0 0 4px; font-size: 14px; }.traits { gap: 0; }.traits b { min-height: 49px; padding: 0; font-size: 17px; }.traits b > img { width: 24px; height: 24px; }.section-label { margin: 24px 0 12px; font-size: 20px; line-height: 28px; }.strengths .accordion-item > button { min-height: 48px; padding: 10px 14px; font-size: 18px; }.strengths .accordion-item > div > p { padding-right: 14px; padding-left: 14px; font-size: 12px; line-height: 16px; }.locked-grid { gap: 8px; margin-top: 16px; }.locked-grid::before { font-size: 24px; line-height: 30px; }.locked-grid article, .locked-grid article:first-child { height: 126px; border-radius: 12px; }.locked-grid article > img { left: 8px; right: 8px; bottom: 8px; width: calc(100% - 16px); height: 74px; border-radius: 8px; }.locked-grid article > div { top: 8px; left: 9px; gap: 5px; font-size: 14px; }.locked-grid article > div img { width: 24px; height: 24px; }.result-cta { margin-top: 20px; padding: 22px 16px; }.result-cta h2 { font-size: 19px; }
  .result-portrait { height: 330px; border-radius: 21px; }.lead-copy { font-size: 12px; line-height: 18px; }.color-grid { gap: 5px; grid-template-columns: repeat(6, 1fr); }.color-grid button { border-radius: 10px; }.accordion-item > button { min-height: 50px; font-size: 12px; }.recommendation { padding: 18px; }
  .main-look { width: min(330px, 100%); height: min(330px, calc(100vw - 32px)); }.look-name { font-size: 19px; }.thumbnail-row { gap: 5px; }.thumbnail-row button { border-radius: 10px; }.hair-color-image, .makeup-product { height: 260px; border-radius: 20px; }.compare-card { height: 520px; border-radius: 22px; }
  .before-after-content > .primary-button { width: 100%; }
}

@media (max-width: 700px) and (max-height: 700px), (max-width: 370px) {
    .site-footer { display: none; }
    .page { padding-bottom: 10px; }
    .page[data-page="home"] .hero-card { inset: 0; height: 100% !important; min-height: 0 !important; }
    .what-content { padding-top: 13px; }
    .what-content .page-heading { margin-bottom: 10px; }
    .benefit-card { grid-template-columns: 104px 1fr; height: 104px; }
    .benefit-media, .benefit-card img { width: 104px; height: 104px; }
    .benefit-card > div:last-child { padding: 8px 10px; }
    .benefit-card h2 { font-size: 18px; line-height: 20px; }
    .benefit-card p { margin-top: 6px; font-size: 12px; line-height: 14px; }
    .how-content, .upload-content { padding-top: 13px; }
    .how-content .page-heading { margin-bottom: 18px; }
    .steps-list { gap: 8px; }.step-card { min-height: 100px; grid-template-columns: 24px minmax(0,1fr) 112px; }.step-media, .step-art { width: 112px; height: 96px; }.step-card:nth-child(2) .step-art { width: 96px; height: 96px; margin-left: 8px; }
    .upload-content .page-heading { margin-bottom: 10px; }
    .upload-card { min-height: 255px; padding: 10px 17px; }.upload-examples { transform: scale(.78); margin-top: -14px; margin-bottom: -14px; }.upload-example-title { margin-top: 3px; }.guidelines { padding: 8px 0; gap: 4px; }.guidelines > div { min-height: 34px; padding-top: 4px; padding-bottom: 4px; }
    .analysis-content { padding-top: 12px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
    .analysis-content .page-heading { margin-bottom: 12px; }
    .analysis-statuses { margin-bottom: 20px; }
    .question-card { padding: 10px; }
}

@media (max-width: 360px) {
  .analysis-statuses { gap: 4px; }
  .analysis-status { padding-right: 5px; padding-left: 5px; }
  .analysis-status p { font-size: 9px; line-height: 11px; }
}

@media (max-width: 700px) {
  body.is-scroll { height: auto; min-height: 100dvh; overflow-y: auto; overscroll-behavior-y: contain; }
  body.is-scroll .site-header { position: relative; }
  body.is-scroll .page { min-height: calc(100dvh - 48px); height: auto; overflow-x: clip; overflow-y: visible; }
  body[data-route="login"].is-scroll .auth-content,
  body[data-route="register"].is-scroll .auth-content { height: auto; min-height: calc(100dvh - 48px); padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  body[data-route="login"].is-scroll .auth-card,
  body[data-route="register"].is-scroll .auth-card { flex: 0 0 auto; margin-top: 24px; }
  .page[data-page="analysis"] { align-items: flex-start; }
  .analysis-content { min-height: 892px; padding-bottom: max(32px, env(safe-area-inset-bottom)); }
}

/* User-approved stronger outlines across repeated interactive surfaces. */
.secondary-button,
.upload-card,
.guidelines > div,
.profile-page .profile-stats,
.edit-profile-card,
.edit-profile-page .delete-account,
.faq-support,
.faq-page .faq-list,
.referral-code,
.referral-stats { border-width: 2px; }

/* Mobile result flow — exact geometry from the Figma page "Для верстки". */
.analysis-status.is-active i img { animation: spin 900ms linear infinite; }
.palette-row > button { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.palette-row > button i { position: relative; width: 24px; height: 24px; flex: 0 0 24px; }
.palette-row > button i::before,
.palette-row > button i::after { content: ""; position: absolute; top: 11px; width: 9px; height: 2px; border-radius: 2px; background: var(--main); transition: transform 220ms cubic-bezier(.22,1,.36,1); }
.palette-row > button i::before { left: 4px; transform: rotate(45deg); }
.palette-row > button i::after { right: 4px; transform: rotate(-45deg); }
.palette-row.open > button i::before { transform: rotate(-45deg); }
.palette-row.open > button i::after { transform: rotate(45deg); }
.palette-row-body { display: grid; grid-template-rows: 0fr; opacity: 0; overflow: hidden; transition: grid-template-rows 420ms cubic-bezier(.22,1,.36,1), opacity 260ms ease; }
.palette-row-body > * { min-height: 0; overflow: hidden; }
.palette-row.open .palette-row-body { grid-template-rows: 1fr; opacity: 1; }

@media (max-width: 700px) {
  /* WOW image: Figma node 306:4309 */
  .page[data-page="result-wow"] { height: calc(100dvh - 48px); min-height: 0; }
  .wow-content { height: 100%; }
  .wow-card { height: 100%; flex-basis: 100%; }
  .wow-card::after { display: none; }
  .wow-base { top: 0; right: auto; bottom: 0; left: -8%; width: 116%; height: 100%; object-fit: cover; }
  .wow-subject-frame { inset: 0; }
  .wow-subject { top: auto; bottom: -6px; left: -31.5%; width: 158%; height: auto; object-fit: contain; }
  .wow-card h1 { top: 24px; left: -20px; right: -20px; font-size: 32px; line-height: 32px; }
  .wow-card .zoom-button { top: 76px; right: 20px; }
  .wow-gradient { z-index: 3; height: 265px; background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.6)); }
  .wow-result-actions { position: absolute; z-index: 6; right: 20px; bottom: 24px; left: 20px; width: auto; margin: 0; gap: 10px; }
  .wow-secondary-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .wow-secondary-actions > .secondary-button { min-height: 48px; padding: 8px; border-radius: 16px; font-size: 13px; }
  .wow-result-actions > .primary-button { height: 56px; min-height: 56px; border-radius: 20px; }

  /* Collapsed palette: Figma node 306:4672 */
  .page[data-page="palette"] { padding: 0 20px; }
  .palette-content { width: 362px; padding: 24px 0; }
  .palette-content > .page-heading { margin: 0; }
  .palette-content .page-heading h1 { font-size: 32px; line-height: 32px; }
  .palette-traits { gap: 4px; height: 32px; margin: 24px 0 0; }
  .palette-traits .trait { display: grid; place-items: center; height: 32px; padding: 0 10px; border-radius: 18px; font-family: Prata,serif; font-size: 20px; line-height: 20px; }
  .palette-intro { margin-top: 16px; font-size: 14px; line-height: 18px; }
  .palette-content .section-label { margin: 24px 0 8px; font-family: Prata,serif; font-size: 20px; line-height: 20px; font-weight: 400; }
  .base-colors { gap: 5px; }
  .base-colors span { height: 36px; border-radius: 7px; }
  .palette-accordion { display: grid; gap: 24px; margin-top: 24px; }
  .palette-row > button { min-height: 24px; padding: 0; text-align: left; font-family: Prata,serif; font-size: 20px; line-height: 24px; font-weight: 400; }
  .palette-row-body p { padding: 8px 0 4px; font-size: 12px; line-height: 16px; }
  .palette-row .color-grid { grid-template-columns: repeat(6,1fr); gap: 5px; margin: 8px 0 0; }
  .palette-row .color-grid span { height: 36px; border-radius: 7px; background: var(--c); }
  .palette-row .shade-grid { padding-top: 8px; }
  .palette-row .swatch-row { padding-top: 8px; }
  .palette-final { margin: 24px 0 0; }
  .palette-final h2 { font-size: 20px; line-height: 20px; }
  .palette-final ul { margin: 8px 0 0; padding-left: 20px; font-size: 14px; line-height: 18px; }
  .palette-content > .primary-button { height: 56px; margin-top: 24px; border-radius: 20px; font-size: 16px; }

  /* Hair results: Figma nodes 306:4621, 306:4638, 306:4655 */
  .page[data-page="haircuts"], .page[data-page="makeup"] { padding: 0 20px; overflow-x: clip !important; }
  .hairstyle-content, .makeup-content { width: 362px; padding: 24px 0; }
  .hairstyle-content > .page-heading, .makeup-content > .page-heading { margin: 0 0 24px; }
  .hairstyle-content .page-heading h1, .makeup-content .page-heading h1 { font-size: 32px; line-height: 32px; }
  .main-look { width: 362px; height: 362px; border-radius: 16px; }
  .hair-look > img { width: 1219px; height: 1524px; transform: translate(-418px,-378px); }
  .hair-look[data-hair-main="1"] > img { transform: translate(-824px,-378px); }
  .hair-look[data-hair-main="2"] > img { transform: translate(-9px,-378px); }
  .hair-look[data-hair-main="3"] > img { transform: translate(-418px,-943px); }
  .hair-look[data-hair-main="4"] > img { transform: translate(-9px,-943px); }
  .hair-look[data-hair-main="5"] > img { transform: translate(-824px,-943px); }
  .main-look .zoom-button { top: 8px; right: 8px; bottom: auto; width: 40px; height: 40px; }
  .look-name { margin: 16px 0 12px; font-size: 20px; line-height: 20px; }
  .look-facts { grid-template-columns: 1fr 1fr; gap: 12px 24px; width: 362px; }
  .look-facts > span { display: grid; grid-template-columns: 24px 1fr; gap: 8px; font-size: 12px; line-height: 16px; }
  .look-facts > span > img { width: 24px; height: 24px; }
  .look-facts > span > span { display: grid; }
  .thumbnail-row { display: flex; justify-content: center; gap: 8px; width: 362px; height: 80px; margin: 24px 0 0; overflow: hidden; }
  .thumbnail-row button { position: relative; width: 80px; height: 80px; flex: 0 0 80px; padding: 0; border: 0; border-radius: 12px; background: transparent; }
  .thumbnail-row button.active { border: 3px solid #e5c289; }
  .thumbnail-row button.active img { border-radius: 9px; }
  .hair-thumbnails--supplied { display: flex; gap: 8px; justify-content: flex-start; }
  .hair-thumbnails--supplied button { width: 80px; min-width: 80px; height: 80px; flex: 0 0 80px; }
  .hair-thumbnails--supplied button img { border-radius: 12px; object-fit: cover; }
  .atlas-thumbnails img { width: 269.5px; height: 336.8px; }
  .atlas-thumbnails [data-atlas-thumb="0"] img { left: -88.5px; top: -83.4px; }
  .atlas-thumbnails [data-atlas-thumb="1"] img { left: -179.4px; top: -83.4px; }
  .atlas-thumbnails [data-atlas-thumb="2"] img { left: -6.6px; top: -83.4px; }
  .atlas-thumbnails [data-atlas-thumb="3"] img { left: -88.5px; top: -210px; }
  .atlas-thumbnails [data-atlas-thumb="4"] img { left: -6.6px; top: -210px; }
  .atlas-thumbnails [data-atlas-thumb="5"] img { left: -179.4px; top: -210px; }
  .result-swipe-arrow { display: grid; place-items: center; height: 12px; margin: 6px 0 8px; }
  .result-swipe-arrow img { width: 20px; height: auto; }
  .hairstyle-content .section-label { margin: 24px 0 12px; font-size: 20px; line-height: 20px; }
  .segmented { display: flex; gap: 6px; height: 40px; padding: 6px; border-radius: 40px; background: #fff; }
  .segmented button { height: 28px; flex: 1; border-radius: 100px; color: var(--main); font-size: 14px; line-height: 20px; font-weight: 400; }
  .segmented button.active { color: #fff; background: var(--premium); box-shadow: none; font-weight: 700; }
  .hair-tone-strip { display: flex; gap: 8px; width: 362px; margin-top: 12px; overflow-x: auto; overflow-y: hidden; scroll-behavior: smooth; overscroll-behavior-x: contain; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .hair-tone-strip::-webkit-scrollbar { display: none; }
  .hair-tone-option { width: 140px; flex: 0 0 140px; padding: 0; border-radius: 10px; scroll-snap-align: start; user-select: none; }
  .hair-tone-option img { -webkit-user-drag: none; user-select: none; }
  .hair-tone-option figure { width: 140px; margin: 0; }
  .hair-tone-option.active .hair-tone-crop::after { content: ""; position: absolute; z-index: 2; inset: 0; border: 3px solid #e5c289; border-radius: inherit; pointer-events: none; }
  .hair-tone-crop { position: relative; width: 140px; height: 200px; overflow: hidden; border-radius: 8px; }
  .hair-tone-crop img { position: absolute; width: 807px; height: 1200px; max-width: none; top: -234px; left: -30px; }
  .hair-tone-crop[data-tone-index="1"] img { left: -179px; }
  .hair-tone-crop[data-tone-index="2"] img { left: -330px; }
  .hair-tone-crop[data-tone-index="3"] img { left: -484px; }
  .hair-tone-crop[data-tone-index="4"] img { left: -635px; }
  .hair-tone-strip[data-tone-row="1"] .hair-tone-crop img { top: -549px; }
  .hair-tone-strip[data-tone-row="2"] .hair-tone-crop img { width: 849px; height: 1263px; top: -906px; }
  .hair-tone-strip[data-tone-row="2"] .hair-tone-crop[data-tone-index="0"] img { left: -35px; }
  .hair-tone-strip[data-tone-row="2"] .hair-tone-crop[data-tone-index="1"] img { left: -194px; }
  .hair-tone-strip[data-tone-row="2"] .hair-tone-crop[data-tone-index="2"] img { left: -354px; }
  .hair-tone-strip[data-tone-row="2"] .hair-tone-crop[data-tone-index="3"] img { left: -513px; }
  .hair-tone-strip[data-tone-row="2"] .hair-tone-crop[data-tone-index="4"] img { left: -673px; }
  .hair-tone-strip figcaption { margin-top: 4px; overflow: hidden; color: var(--muted); text-align: center; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 20px; }
  .result-note { margin: 24px 0; font-size: 14px; line-height: 18px; }
  .hairstyle-content > .primary-button, .makeup-content > .primary-button { height: 56px; border-radius: 20px; font-size: 16px; }

  /* Makeup result: Figma node 306:4343 */
  .makeup-content .main-look > img { width: 100%; height: 100%; object-fit: cover; }
  .makeup-content .look-name { margin: 24px 0 12px; }
  .makeup-details { display: grid; grid-template-columns: 1fr; gap: 16px; width: 362px; margin: 0; }
  .makeup-details > div { display: grid; grid-template-columns: 24px 168px 138px; gap: 8px; align-items: start; }
  .makeup-details > div > img { width: 24px; height: 24px; }
  .makeup-details span { color: var(--main); font-size: 12px; line-height: 16px; }
  .makeup-details span b { color: var(--second); font-size: 12px; }
  .makeup-details label { display: grid; gap: 0; color: var(--main); font-size: 10px; line-height: 16px; }
  .makeup-details label > i { display: flex; grid-column: auto; gap: 4px; width: 138px; height: 32px; border-radius: 4px; background: var(--c); }
  .makeup-swatches { background: transparent !important; }
  .makeup-swatches em { flex: 1; border-radius: 4px; background: var(--c); }
  .makeup-content .thumbnail-row { margin-top: 24px; }
  .result-swipe-arrow--wide img { width: 44px; }
  .makeup-content .result-note { margin-top: 20px; }

  /* Before/after: Figma node 306:4596 */
  .page[data-page="before-after"] { height: calc(100dvh - 48px); min-height: 0; padding: 0; overflow: hidden; }
  .before-after-content { position: relative; width: 402px; height: 100%; padding: 0; }
  .before-after-content > .page-heading { position: absolute; z-index: 4; top: 24px; left: 24px; width: 354px; margin: 0; }
  .before-after-content .page-heading h1 { font-size: 32px; line-height: 32px; }
  .compare-card { position: absolute; inset: 0; width: 402px; height: 100%; border-radius: 0; background: #f7f3ee; }
  .compare-card .compare-bg { position: absolute; top: -4px; left: -32px; width: 467px; height: 830px; max-width: none; object-fit: cover; }
  .compare-card .compare-person { position: absolute; right: -15px; bottom: 0; left: -15px; width: 432px; height: 647px; max-width: none; object-fit: fill; }
  .compare-card > span { z-index: 3; top: -20px; bottom: 15px; left: 200px; width: 2px; background: #eaded2; }
  .compare-handle { position: absolute; z-index: 5; top: 85px; left: 187px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--main); background: #eaded2; font-size: 12px; font-style: normal; }
  .before-after-content > .primary-button { position: absolute; z-index: 6; top: auto; right: 20px; bottom: 24px; left: 20px; width: auto; height: 56px; margin: 0; border-radius: 20px; font-size: 16px; }
}

@media (max-width: 700px) {
  .page[data-page="payment"],
  .page[data-page="checkout"],
  .page[data-page="login"],
  .page[data-page="register"] { padding: 0; }

  body[data-route="payment"] .page { min-height: calc(100dvh - 48px); padding: 0; }
  .payment-content { width: 100%; height: auto; min-height: 0; padding: 20px 20px 16px; }
  .payment-top { gap: 12px; }
  .payment-content .page-heading { margin: 0; }
  .payment-content .page-heading h1 { font-size: 32px; line-height: 38.4px; }
  .payment-example { margin: 0; font-size: 16px; line-height: 20px; }
  .payment-carousel { width: min(362px,calc(100vw - 40px)); gap: 16px; }
  .carousel-dots { height: 8px; margin: 0; }
  .price { margin: 0; }
  .price strong { font-size: 32px; line-height: 38px; }
  .payment-offer .primary-button { width: 100%; margin: 0; }
  .promo-form { padding: 12px; border-radius: 16px; }
  .promo-control { grid-template-columns: minmax(0, 1fr) 116px; }
  .promo-control input, .promo-control .secondary-button { height: 48px; min-height: 48px; }

  .checkout-content { width: 100%; min-height: calc(100dvh - 48px); gap: 20px; padding: 24px 16px max(24px, env(safe-area-inset-bottom)); }
  .checkout-back { display: none; }
  .checkout-heading { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; padding: 0 4px; }
  .checkout-heading--access { grid-template-columns: 40px minmax(0, 1fr); }
  .checkout-heading h1 { font-size: 27px; line-height: 34px; }
  .checkout-heading p { max-width: 190px; font-size: 12px; line-height: 16px; }
  .checkout-heading strong { font-size: 22px; line-height: 28px; }
  .checkout-secure-icon { width: 40px; height: 40px; }
  .checkout-secure-icon img { width: 20px; height: 20px; }
  .checkout-widget-card, .checkout-widget, .checkout-status { min-height: 430px; }
  .checkout-widget-card { border-radius: 20px; }
  .checkout-widget { padding: 0; }
  .checkout-status { padding: 32px 22px; }
  .checkout-note { padding: 0 8px; font-size: 11px; line-height: 16px; }

  .auth-content { width: 100%; height: 100%; min-height: 0; padding: 0; }
  .auth-top { padding: 24px 20px 0; }
  .auth-content .page-heading { margin: 0; }
  .auth-content .page-heading h1 { font-size: 32px; line-height: 38.4px; }
  .auth-content .page-heading p { margin-top: 16px; font-size: 14px; line-height: 18px; }
  .auth-card { min-height: 510px; height: 510px; padding: 24px 20px; border-radius: 24px 24px 0 0; }
  .auth-card--register { min-height: 660px; height: auto; }
  .auth-card--yandex-open { min-height: 610px; height: auto; }
  .auth-card label { gap: 4px; margin: 0; font-size: 12px; }
  .auth-card input { height: 56px; font-size: 16px; }
  .password-wrap button { height: 56px; }
  .forgot-link { margin: 0; font-size: 16px; }
  .auth-card .primary-button { min-height: 56px; }
  .yandex-button { height: 48px; font-size: 14px; }
  .yandex-code-panel > div { grid-template-columns: 1fr; }
  .yandex-code-panel button { width: 100%; }
  .auth-divider { height: 16px; }
  .auth-switch { margin: 0; font-size: 16px; }

  .free-content > .section-label { margin: 16px 0 12px; font-size: 28px; line-height: 36px; }
  .strengths .accordion-item > button { min-height: 48px; padding: 10px 14px; font-size: 20px; line-height: 24px; }
  .locked-grid::before { font-size: 26px; line-height: 32px; }
  .free-content .analysis-actions > .primary-button { min-height: 56px; font-size: 16px; }
}

@media (max-width: 700px) and (max-height: 700px) {
  .compare-card .compare-person {
    right: auto;
    left: 50%;
    width: auto;
    height: calc(100% - 120px);
    transform: translateX(-50%);
  }
}

.unlocks-title { margin: 24px 0 16px; font-family: Prata,serif; font-size: 26px; line-height: 26px; font-weight: 400; }
.locked-grid::before { display: none; content: none; }
.palette-row-inner { min-height: 0; overflow: hidden; transform: translateY(-6px); transition: transform 420ms cubic-bezier(.22,1,.36,1); }
.palette-row.open .palette-row-inner { transform: translateY(0); }
.palette-person { position: relative; width: 100%; aspect-ratio: 118 / 173; overflow: hidden; border-radius: 8px; background: #eee6dc; }
.palette-person-photo { width: 100%; height: 100%; object-fit: cover; }
.palette-person-status { position: absolute; top: 5px; left: 5px; width: 20px; height: 20px; }
.accessory-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding-top: 8px; }
.accessory-grid img { width: 100%; aspect-ratio: 1; border-radius: 8px; object-fit: cover; }
.combination-list { display: grid; gap: 8px; padding-top: 8px; }
.combination-list > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.combination-pair { display: flex; width: 60px; height: 28px; flex: 0 0 60px; overflow: hidden; border-radius: 7px; }
.combination-pair i { flex: 1; background: var(--c); }
.combination-list p { min-width: 0; font-size: 12px; line-height: 16px; }
.hair-look { cursor: grab; touch-action: pan-y; }
.makeup-content [data-makeup-swipe] { cursor: grab; touch-action: pan-y; }
.hair-look.is-dragging,
.makeup-content [data-makeup-swipe].is-dragging { cursor: grabbing; }
.main-look.hair-look--source > img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-width: 100%; object-fit: cover !important; object-position: center 22%; transform: none !important; }

@media (max-width: 700px) {
  body.is-fixed .page { height: calc(100dvh - 48px); min-height: 0; }
  .result-column > .page-back { display: none; }
  .page[data-page="what"] { overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
  .what-content, .how-content { min-height: calc(100dvh - 48px); }
  .what-content > .primary-button { margin-top: auto; margin-bottom: 24px; }

  .auth-content { min-height: 100%; height: 100%; }
  .auth-card { flex: 0 0 510px; margin-top: auto; }

  .free-content > .unlocks-title { margin: 24px 0 16px; font-size: 26px; line-height: 26px; }
  .locked-grid { grid-template-columns: repeat(6,1fr); gap: 8px; margin: 0; }
  .locked-grid article,
  .locked-grid article:first-child { position: relative; display: flex; grid-column: span 2; flex-direction: column; align-items: center; gap: 8px; height: 104px; padding: 8px; border-radius: 12px; background: #fff; }
  .locked-grid article:nth-of-type(-n+2) { grid-column: span 3; }
  .locked-grid article > div { position: static; display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; color: var(--main); font-family: Inter,sans-serif; font-size: 14px; line-height: 16px; white-space: nowrap; }
  .locked-grid article > div img { width: 20px; height: 20px; padding: 4px; border-radius: 50%; background: linear-gradient(135deg,#e5c289,#c28034); }
  .locked-grid article > img { position: static; width: 100%; height: 60px; border-radius: 8px; object-fit: cover; filter: none; }
  .locked-grid article > img,
  .locked-grid article:nth-of-type(-n+2) > img { width: min(100%, 98px); }

  .palette-row-inner > p { padding: 8px 0 4px; font-size: 12px; line-height: 16px; }
  .palette-person-status { width: 20px; height: 20px; }
  .palette-row .shade-grid { gap: 7px; padding-top: 8px; padding-bottom: 0; }
  .palette-row .shade-grid figcaption { margin-top: 4px; font-size: 8px; line-height: 11px; }
  .palette-row .swatch-row { padding: 8px 0 0; }

  .thumbnail-row.hair-thumbnails { justify-content: flex-start; overflow-x: auto; overflow-y: hidden; padding: 0 1px 4px; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; overscroll-behavior-x: contain; touch-action: pan-x; }
  .thumbnail-row.hair-thumbnails::-webkit-scrollbar { display: none; }
  .hair-thumbnails button { scroll-snap-align: center; }
  .hair-thumbnails button.active { border: 3px solid #e5c289; box-shadow: none; }
  .hair-thumbnails button:active { transform: none; }
  .hair-thumbnails img { position: static; width: 100%; height: 100%; max-width: 100%; border-radius: 12px; object-fit: cover; transform: none; }

  .makeup-content .thumbnail-row.makeup-source-thumbnails { justify-content: flex-start; overflow-x: auto; overflow-y: hidden; padding: 0 1px 4px; scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain; touch-action: pan-x; }
  .makeup-content .thumbnail-row.makeup-source-thumbnails::-webkit-scrollbar { display: none; }
  .makeup-content .thumbnail-row.makeup-source-thumbnails button { scroll-snap-align: start; }

  .before-after-content { width: 100%; max-width: none; }
  .before-after-content > .page-heading { left: 20px; width: calc(100% - 40px); }
  .compare-card { width: 100%; }
  .compare-card .compare-bg { left: -7.96%; width: 116.17%; }
  .compare-card .compare-person { right: auto; left: 50%; width: 107.46%; height: auto; transform: translateX(-50%); }
  .compare-card > span { left: 50%; }
  .compare-handle { left: calc(50% - 14px); }
}

/* Real Android widths can be narrower than desktop emulation after browser scaling. */
@media (max-width: 480px) {
  html, body, #app { width: 100%; max-width: 100%; }
  body.is-scroll { overflow-x: clip; }
  .site-header { width: 100%; padding-right: max(12px, env(safe-area-inset-right)); padding-left: max(12px, env(safe-area-inset-left)); }
  .mobile-site-back { left: env(safe-area-inset-left); }
  .mobile-site-menu { right: env(safe-area-inset-right); }
  .page { min-width: 0; padding-right: max(16px, env(safe-area-inset-right)); padding-left: max(16px, env(safe-area-inset-left)); }
  .page[data-page="how"] { padding-right: max(20px, env(safe-area-inset-right)); padding-left: max(20px, env(safe-area-inset-left)); }

  .upload-content, .upload-card, .guidelines, .upload-actions { width: 100%; max-width: 100%; min-width: 0; }
  .upload-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upload-actions .secondary-button { min-width: 0; padding-right: 8px; padding-left: 8px; }
  .guidelines > div { width: 100%; min-height: 58px; }
  .guideline-copy--desktop { display: none; }
  .guideline-copy--mobile { display: inline; }

  .page[data-page="haircuts"], .page[data-page="makeup"] {
    padding-right: max(16px, env(safe-area-inset-right));
    padding-left: max(16px, env(safe-area-inset-left));
    overflow-x: clip !important;
  }
  .hairstyle-content, .makeup-content { width: 100%; max-width: 362px; min-width: 0; }
  .main-look { width: 100%; max-width: 362px; height: auto; aspect-ratio: 1; }
  .main-look .zoom-button { right: 8px; }
  .look-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .look-facts > span, .look-facts > span > span { min-width: 0; }
  .look-facts > span > span { overflow-wrap: anywhere; }
  .thumbnail-row, .hair-tone-strip, .makeup-details { width: 100%; max-width: 100%; min-width: 0; }
  .makeup-details > div {
    grid-template-columns: 24px minmax(0, 1fr) minmax(92px, 38%);
    width: 100%;
    min-width: 0;
  }
  .makeup-details span, .makeup-details label { min-width: 0; overflow-wrap: anywhere; }
  .makeup-details label > i { width: 100%; max-width: 100%; }
}

/* Keep the WOW portrait below its heading on short phone viewports. */
@media (max-width: 700px) {
  .wow-subject {
    left: 47.5%;
    width: clamp(100%, calc(89.92dvh - 102.5px), 158%);
    transform: translateX(-50%);
  }
}

@media (max-width: 700px) and (max-height: 700px) {
  .compare-card .compare-person { width: auto; height: calc(100% - 120px); }
}

/* Desktop result flow — Figma page "Для верстки", nodes 306:6458–306:6916. */
@media (min-width: 701px) {

  .page[data-page="result-wow"],
  .page[data-page="before-after"] { padding-bottom: 0; overflow: visible; }

  .page[data-page="result-wow"] { align-items: flex-start; overflow: hidden; }

  .page[data-page="result-wow"] .wow-content {
    --wow-card-height: min(720px, calc(100dvh - 228px));
    width: calc(var(--wow-card-height) * .75);
    height: auto;
    padding-top: clamp(8px, 2.5dvh, 24px);
    flex: 0 0 auto;
  }
  .page[data-page="result-wow"] .wow-card { width: 100%; height: var(--wow-card-height); border-radius: 24px; }
  .page[data-page="result-wow"] .wow-base { width: 100%; height: 100%; }
  .page[data-page="result-wow"] .wow-card .zoom-button { top: 46.5px; right: 20px; width: 35px; height: 35px; }
  .page[data-page="result-wow"] .wow-card .zoom-button img { width: 35px !important; height: 35px !important; }
  .page[data-page="result-wow"] .wow-secondary-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page[data-page="result-wow"] .wow-result-actions > .primary-button { width: 100%; height: 56px; min-height: 56px; border-radius: 20px; font-size: 16px; }

  .page[data-page="palette"],
  .page[data-page="haircuts"],
  .page[data-page="makeup"] { overflow: visible; }
  .palette-content,
  .hairstyle-content,
  .makeup-content { width: 540px; padding-top: 48px; }
  .palette-content > .page-heading,
  .hairstyle-content > .page-heading,
  .makeup-content > .page-heading { margin: 0 0 24px; }
  .palette-content .page-heading h1,
  .hairstyle-content .page-heading h1,
  .makeup-content .page-heading h1 { font-size: 32px; line-height: 32px; }

  .palette-traits { gap: 4px; margin: 0 0 8px; }
  .palette-traits .trait { display: grid; place-items: center; height: 32px; padding: 0 10px; border-radius: 48px; font-family: Prata,serif; font-size: 20px; line-height: 20px; }
  .palette-intro { font-size: 14px; line-height: 18px; }
  .palette-content .section-label { margin: 24px 0 8px; font-size: 20px; line-height: 20px; }
  .palette-content .base-colors { gap: 5px; }
  .palette-content .base-colors span { height: 36px; border-radius: 8px; }
  .palette-accordion { display: grid; gap: 24px; margin-top: 24px; }
  .palette-row > button { min-height: 24px; padding: 0; text-align: left; font-family: Prata,serif; font-size: 20px; line-height: 24px; font-weight: 400; }
  .palette-row-body p { padding: 8px 0 4px; font-size: 12px; line-height: 16px; }
  .palette-row .color-grid { grid-template-columns: repeat(6,1fr); gap: 5px; margin: 8px 0 0; }
  .palette-row .shade-grid,
  .palette-row .swatch-row { padding-top: 8px; }
  .palette-final { margin: 24px 0 0; }
  .palette-final h2 { font-size: 20px; line-height: 20px; }
  .palette-final ul { margin: 8px 0 0; padding-left: 20px; font-size: 14px; line-height: 18px; }
  .palette-content > .primary-button { height: 56px; margin-top: 24px; border-radius: 20px; font-size: 16px; }

  .hairstyle-content .main-look,
  .makeup-content .main-look { width: 362px; height: 362px; border-radius: 16px; }
  .hairstyle-content .main-look .zoom-button,
  .makeup-content .main-look .zoom-button { top: 8px; right: 8px; bottom: auto; width: 40px; height: 40px; background: transparent; backdrop-filter: none; }
  .hairstyle-content .main-look .zoom-button img,
  .makeup-content .main-look .zoom-button img { width: 40px !important; height: 40px !important; }
  .hairstyle-content .look-name { margin: 24px 0 12px; font-size: 20px; line-height: 20px; }
  .look-facts { grid-template-columns: 1fr 1fr; gap: 12px 24px; width: 362px; }
  .look-facts > span { display: grid; grid-template-columns: 24px 1fr; gap: 8px; font-size: 12px; line-height: 16px; }
  .look-facts > span > img { width: 24px; height: 24px; }
  .look-facts > span > span { display: flex; flex-direction: column; min-width: 0; }
  .look-facts [data-hair-fact] { display: block; overflow-wrap: anywhere; }
  .thumbnail-row { display: flex; justify-content: center; gap: 8px; width: 540px; height: 80px; margin: 24px 0 0; overflow: visible; }
  .thumbnail-row button { position: relative; width: 80px; height: 80px; flex: 0 0 80px; padding: 0; border: 0; border-radius: 12px; background: transparent; }
  .thumbnail-row button.active { border: 3px solid #e5c289; }
  .thumbnail-row button.active img { border-radius: 9px; }
  .hair-thumbnails img,
  .makeup-source-thumbnails img { position: static; width: 100%; height: 100%; max-width: 100%; border-radius: 12px; object-fit: cover; object-position: center 22%; transform: none; }
  .result-swipe-arrow { display: grid; place-items: center; width: 100%; height: 12px; margin: 6px 0 20px; }
  .result-swipe-arrow img { width: 20px; height: auto; }
  .result-swipe-arrow--wide { margin-bottom: 0; }
  .result-swipe-arrow--wide img { width: 44px; }
  .hairstyle-content .section-label { margin: 24px 0 16px; font-size: 20px; line-height: 20px; }
  .segmented { display: flex; gap: 6px; width: 540px; height: 40px; padding: 6px; border-radius: 40px; background: #fff; }
  .segmented button { height: 28px; flex: 1; border-radius: 100px; color: var(--main); font-size: 14px; line-height: 20px; font-weight: 400; }
  .segmented button.active { color: #fff; background: var(--premium); box-shadow: none; font-weight: 700; }
  .hair-tone-strip { display: flex; gap: 8px; width: 540px; margin-top: 16px; overflow-x: auto; overflow-y: hidden; cursor: grab; scroll-behavior: smooth; overscroll-behavior-x: contain; touch-action: pan-x pan-y; scrollbar-width: none; }
  .hair-tone-strip.is-dragging { cursor: grabbing; scroll-behavior: auto; }
  .hair-tone-strip::-webkit-scrollbar { display: none; }
  .hair-tone-option { width: 140px; flex: 0 0 140px; padding: 0; border-radius: 10px; scroll-snap-align: start; }
  .hair-tone-option figure { width: 140px; margin: 0; }
  .hair-tone-option.active .hair-tone-crop::after { content: ""; position: absolute; z-index: 2; inset: 0; border: 3px solid #e5c289; border-radius: inherit; pointer-events: none; }
  .hair-tone-crop { position: relative; width: 140px; height: 200px; overflow: hidden; border-radius: 8px; }
  .hair-tone-crop img { position: absolute; top: -234px; left: -30px; width: 807px; height: 1200px; max-width: none; }
  .hair-tone-crop[data-tone-index="1"] img { left: -179px; }
  .hair-tone-crop[data-tone-index="2"] img { left: -330px; }
  .hair-tone-crop[data-tone-index="3"] img { left: -484px; }
  .hair-tone-crop[data-tone-index="4"] img { left: -635px; }
  .hair-tone-strip[data-tone-row="1"] .hair-tone-crop img { top: -549px; }
  .hair-tone-strip[data-tone-row="2"] .hair-tone-crop img { top: -906px; width: 849px; height: 1263px; }
  .hair-tone-strip[data-tone-row="2"] .hair-tone-crop[data-tone-index="0"] img { left: -35px; }
  .hair-tone-strip[data-tone-row="2"] .hair-tone-crop[data-tone-index="1"] img { left: -194px; }
  .hair-tone-strip[data-tone-row="2"] .hair-tone-crop[data-tone-index="2"] img { left: -354px; }
  .hair-tone-strip[data-tone-row="2"] .hair-tone-crop[data-tone-index="3"] img { left: -513px; }
  .hair-tone-strip[data-tone-row="2"] .hair-tone-crop[data-tone-index="4"] img { left: -673px; }
  .hair-tone-strip figcaption { margin-top: 4px; overflow: hidden; color: var(--muted); text-align: center; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 20px; }
  .hairstyle-content .result-note { margin: 24px 0; }
  .hairstyle-content > .primary-button,
  .makeup-content > .primary-button { height: 56px; border-radius: 20px; font-size: 16px; }

  .makeup-content .main-look > img { width: 100%; height: 100%; object-fit: cover; }
  .makeup-content .look-name { margin: 24px 0 12px; font-size: 20px; line-height: 20px; }
  .makeup-details { display: grid; grid-template-columns: 1fr; gap: 16px; width: 362px; margin: 0 auto; }
  .makeup-details > div { display: grid; grid-template-columns: 24px 168px 138px; gap: 8px; align-items: start; }
  .makeup-details > div > img { width: 24px; height: 24px; }
  .makeup-details span { color: var(--main); font-size: 12px; line-height: 16px; }
  .makeup-details span b { color: var(--second); font-size: 12px; }
  .makeup-details label { display: grid; gap: 0; color: var(--main); font-size: 10px; line-height: 16px; }
  .makeup-details label > i { display: flex; grid-column: auto; gap: 4px; width: 138px; height: 32px; border-radius: 4px; background: var(--c); }
  .makeup-swatches { background: transparent !important; }
  .makeup-swatches em { flex: 1; border-radius: 4px; background: var(--c); }
  .makeup-content .result-note { margin: 20px 0 24px; }

  .free-content .locked-grid article > img,
  .free-content .locked-grid article:nth-of-type(-n+2) > img { right: auto; left: auto; width: 168px; margin-inline: auto; transform: none; }

  .before-after-content { position: relative; width: 540px; height: 800px; padding: 0; }
  .before-after-content > .page-heading { position: absolute; z-index: 4; top: 18px; left: 0; width: 540px; margin: 0; }
  .before-after-content .page-heading h1 { font-size: 32px; line-height: 32px; }
  .before-after-content .compare-card { position: absolute; top: 0; left: 0; width: 540px; height: 720px; border-radius: 32px; background: var(--paper); }
  .before-after-content .compare-bg,
  .before-after-content .compare-card > span,
  .before-after-content .compare-handle { display: none; }
  .before-after-content .compare-person { position: absolute; right: auto; bottom: -121px; left: 1px; width: 539px; height: 809px; max-width: none; object-fit: cover; object-position: center; }
  .before-after-content > .primary-button { position: absolute; z-index: 6; top: 744px; left: 20px; width: 500px; height: 56px; margin: 0; border-radius: 20px; font-size: 16px; }
}

@media (min-width: 701px) and (max-height: 900px) {
  .page[data-page="before-after"] .before-after-content { transform: scale(.9); transform-origin: top center; }
}

@media (min-width: 701px) and (max-height: 820px) {
  .page[data-page="before-after"] .before-after-content { transform: scale(.82); }
  .page[data-page="result-wow"] .wow-card h1 { top: 32px; right: 32px; left: 32px; font-size: 28px; line-height: 32px; }
  .page[data-page="result-wow"] .wow-card .zoom-button { top: 12px; right: 12px; }
}

/* Preserve the exact 1440 px Figma geometry, then let the central experience
   grow on large and ultrawide desktop displays. Header and footer stay stable. */
@media (min-width: 1600px) and (min-height: 900px) {
  .page[data-page="home"] .hero-card {
    width: clamp(540px, min(37.5vw, calc(75dvh - 120px)), 960px);
    height: auto;
    aspect-ratio: 3 / 4;
  }
  .page[data-page="home"] .hero-photo--base { width: 100%; height: 100%; }
  .page[data-page="home"] .hero-photo--subject { width: 100%; height: 100%; }
  .page[data-page="home"] .hero-title { top: clamp(24px, 1.67vw, 43px); right: 3.7%; left: 3.7%; }
  .page[data-page="home"] .hero-title span,
  .page[data-page="home"] .hero-title strong { font-size: clamp(40px, 2.78vw, 72px); line-height: 1.2; }
  .page[data-page="home"] .hero-bottom { height: 21.667%; padding: 0 3.7% clamp(20px, 1.39vw, 36px); }
  .page[data-page="home"] .hero-bottom .primary-button { min-height: clamp(56px, 3.89vw, 96px); border-radius: clamp(20px, 1.39vw, 32px); font-size: clamp(15px, 1.11vw, 24px); }

  .what-content,
  .how-content { width: clamp(540px, 33.6vw, 860px); padding-top: clamp(48px, 3vw, 72px); }
  .what-content .page-heading h1,
  .how-content .page-heading h1 { font-size: clamp(32px, 2.22vw, 48px); line-height: 1.2; }
  .what-content .page-heading,
  .how-content .page-heading { margin-bottom: clamp(24px, 1.5vw, 36px); }
  .what-content .page-back,
  .how-content .page-back { top: clamp(49px, 3vw, 73px); left: clamp(-76px, -3vw, -57px); width: clamp(32px, 2vw, 46px); height: clamp(32px, 2vw, 46px); font-size: clamp(28px, 1.75vw, 40px); }

  .benefit-list { gap: clamp(12px, .7vw, 18px); margin-bottom: clamp(24px, 1.5vw, 36px); }
  .benefit-card { grid-template-columns: clamp(120px, 7.4vw, 190px) 1fr; height: clamp(104px, 6.4vw, 164px); border-radius: clamp(16px, 1vw, 24px); }
  .benefit-media { width: clamp(120px, 7.4vw, 190px); height: clamp(104px, 6.4vw, 164px); }
  .benefit-card > div:last-child { padding: clamp(12px, .9vw, 22px) clamp(18px, 1.4vw, 34px); }
  .benefit-card h2 { font-size: clamp(24px, 1.45vw, 36px); line-height: 1.15; }
  .benefit-card p { margin-top: clamp(8px, .5vw, 12px); font-size: clamp(16px, .9vw, 22px); line-height: 1.3; }
  .what-content > .primary-button,
  .how-content > .primary-button { min-height: clamp(56px, 3.3vw, 84px); border-radius: clamp(20px, 1.25vw, 30px); font-size: clamp(15px, .95vw, 23px); }

  .how-content .page-heading p { margin-top: clamp(12px, .75vw, 18px); font-size: clamp(15px, .9vw, 22px); }
  .steps-list { gap: clamp(32px, 1.9vw, 48px); margin-bottom: clamp(24px, 1.5vw, 36px); }
  .steps-list::before { left: clamp(11px, .72vw, 18px); width: clamp(2px, .12vw, 3px); }
  .step-card { grid-template-columns: clamp(24px, 1.45vw, 37px) 1fr clamp(140px, 8.7vw, 222px); gap: clamp(16px, 1vw, 25px); min-height: clamp(120px, 7.35vw, 188px); }
  .step-number,
  .step-number img { width: clamp(24px, 1.45vw, 37px); height: clamp(24px, 1.45vw, 37px); }
  .step-copy h2 { font-size: clamp(24px, 1.45vw, 36px); line-height: 1.3; }
  .step-copy p { margin-top: clamp(8px, .5vw, 12px); font-size: clamp(14px, .85vw, 21px); line-height: 1.3; }
  .step-media { width: clamp(140px, 8.7vw, 222px); height: clamp(120px, 7.35vw, 188px); }
  .step-art { width: 100%; height: 100%; border-radius: clamp(12px, .75vw, 18px); }
  .step-card:nth-child(2) .step-art { width: clamp(120px, 7.35vw, 188px); height: clamp(120px, 7.35vw, 188px); margin-left: auto; margin-right: auto; }
  .step-card:first-child .step-glow { width: clamp(196px, 12.18vw, 312px); height: clamp(199px, 12.37vw, 317px); }
  .step-card:nth-child(2) .step-glow { width: clamp(216px, 13.45vw, 344px); height: clamp(219px, 13.65vw, 349px); }

}

/* Live backend integration */
.telegram-auth {
  display: flex;
  width: 100%;
  height: 48px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 10px;
  background: #54a9eb;
}
.telegram-auth-trigger {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: inherit;
  color: #fff;
  background: transparent;
  font: 500 14px/20px Inter, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.telegram-auth-trigger img { width: 20px; height: 20px; filter: brightness(0) invert(1); }
.telegram-auth-trigger:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }

@media (max-width: 350px) {
  .promo-control { grid-template-columns: 1fr; }
}
.telegram-auth iframe {
  display: block;
  flex: 0 0 238px;
  width: 238px;
  height: 40px;
  transform: none;
}
.telegram-auth.is-loading iframe { visibility: hidden; }
.telegram-auth[hidden] { display: none; }
.social-auth-status { color: var(--muted); font-size: 12px; line-height: 18px; text-align: center; }
.social-auth-status[hidden] { display: none; }
.telegram-register-note { margin: -4px 0 0; color: var(--muted); font-size: 12px; line-height: 18px; text-align: center; }
.telegram-auth-retry { width: 100%; min-height: 48px; border-width: 1px; }
.telegram-auth-retry[hidden] { display: none; }
.telegram-link-backdrop { inset: 0; z-index: 190; width: 100vw; height: 100dvh; transform: none; }
.telegram-link-sheet { gap: 20px; padding: 28px 24px 24px; }
.telegram-link-heading { gap: 12px; }
.telegram-link-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 2px;
  border-radius: 16px;
  background: var(--paper);
}
.telegram-link-mark img { width: 26px; height: 26px; }
.telegram-link-sheet .profile-editor-heading h2 { font-size: 28px; line-height: 34px; text-wrap: balance; }
.telegram-link-sheet .profile-editor-heading p { max-width: 340px; margin: 0 auto; line-height: 20px; text-wrap: pretty; }
.telegram-link-sheet .profile-editor-heading p b { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.telegram-link-widget { display: grid; gap: 8px; }
.telegram-link-widget .telegram-auth { height: 56px; min-height: 56px; border: 0; border-radius: 16px; background: var(--paper); }
.telegram-link-sheet .profile-editor-actions .secondary-button { border-color: var(--stroke); color: var(--ink); }
.telegram-link-sheet .profile-editor-actions .secondary-button:hover { border-color: var(--stroke); color: var(--ink); background: var(--paper); box-shadow: none; }
@media (min-width: 701px) {
  .telegram-link-sheet { top: 50%; right: auto; bottom: auto; left: 50%; width: 402px; max-height: calc(100dvh - 32px); border-radius: 24px; transform: translate(-50%,-50%); animation: centeredDialogEnter 360ms var(--motion-ease-out) both; }
}
.yandex-button:disabled { cursor: wait; opacity: .6; }
.generated-palette { position: relative; width: 100%; margin: 20px 0 0; overflow: hidden; border-radius: 24px; background: #fff; }
.generated-palette > img { display: block; width: 100%; height: auto; }
.generated-palette .zoom-button { position: absolute; z-index: 2; top: 16px; right: 16px; width: 38px; height: 38px; background: rgba(255,255,255,.92); box-shadow: 0 2px 10px rgba(60,36,17,.16); }
.generated-palette .zoom-button img { width: 22px !important; height: 22px !important; }
.palette-color-section { margin-top: 20px; }
.palette-color-section h2 { margin: 0 0 8px; font-family: Prata,serif; font-size: 20px; line-height: 24px; font-weight: 400; }
.palette-color-swatches { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 5px; }
.palette-color-swatches figure { min-width: 0; margin: 0; }
.palette-color-swatches i { display: block; width: 100%; height: 36px; border: 1px solid rgba(60,36,17,.08); border-radius: 7px; background: var(--c); }
.palette-color-swatches figcaption { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 8px; line-height: 11px; text-overflow: ellipsis; white-space: nowrap; }
.generated-palette--skeleton { display: grid; min-height: 260px; place-items: center; align-content: center; gap: 8px; padding: 28px; color: var(--main); text-align: center; border: 1px solid var(--stroke); background: #f7eee5; }
.generated-palette--skeleton span { width: 54px; height: 54px; border: 3px solid rgba(194,128,52,.18); border-top-color: var(--accent); border-radius: 50%; animation: checkoutSpin .9s linear infinite; }
.generated-palette--skeleton b { font-family: Prata,serif; font-size: 18px; font-weight: 400; }
.generated-palette--skeleton small { color: var(--muted); font-size: 12px; line-height: 16px; }
.result-download { display: flex; width: 100%; min-height: 52px; margin-top: 20px; align-items: center; justify-content: center; text-decoration: none; }
.result-empty, .account-empty { margin: 24px 0; padding: 24px; border-radius: 18px; color: var(--muted); background: #fff; text-align: center; line-height: 1.5; }
.hair-thumbnails--supplied { align-items: flex-start; justify-content: flex-start !important; gap: 8px; height: 80px; padding: 0 !important; overflow-x: auto !important; overflow-y: hidden; scrollbar-width: none; scroll-snap-type: x proximity; }
.hair-thumbnails--supplied::-webkit-scrollbar { display: none; }
.hair-thumbnails--supplied > button { position: relative; width: 80px; min-width: 80px; max-width: 80px; height: 80px; flex: 0 0 80px; aspect-ratio: 1; overflow: hidden; padding: 0; border: 0; border-radius: 12px; background: #e8e5e1; scroll-snap-align: center; user-select: none; -webkit-user-select: none; }
.hair-thumbnails--supplied > button::after { content: ""; position: absolute; z-index: 2; inset: 0; border: 3px solid transparent; border-radius: inherit; pointer-events: none; }
.hair-thumbnails--supplied > button.active { border: 0; }
.hair-thumbnails--supplied > button:active { transform: none; }
.hair-thumbnails--supplied > button.active::after { border-color: #e5c289; }
.thumbnail-row.hair-thumbnails--supplied > button > img,
.thumbnail-row.hair-thumbnails--supplied > button.active > img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; border-radius: 12px; object-fit: cover; object-position: center; transform: none; pointer-events: none; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.hair-why { width: min(100%,540px); margin: 16px auto 0; color: var(--muted); text-align: center; font-size: 13px; line-height: 19px; }
.checkout-email { display: grid; gap: 14px; padding: 20px; border-radius: 20px; background: #fff; box-shadow: 0 14px 42px rgba(60,36,17,.07); }
.checkout-email label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; }
.checkout-email input { width: 100%; height: 52px; padding: 0 16px; border: 2px solid var(--stroke); border-radius: 14px; color: var(--ink); background: #fff; font: inherit; outline: 0; }
.checkout-email input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(194,128,52,.1); }
.profile-stats--api > div { min-width: 0; padding-inline: 6px; }
.profile-stats--api strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: Inter,sans-serif; font-size: 13px; }
.restart-analysis-link { align-self: center; margin-top: 12px; padding: 8px 12px; color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.wow-cover-download { display: flex; width: 100%; min-height: 52px; margin-top: 16px; align-items: center; justify-content: center; text-decoration: none; }

@media (max-width: 700px) {
  .generated-palette { border-radius: 18px; }
  .generated-palette--skeleton { min-height: 220px; padding: 20px; }
  .checkout-email { margin: 0; }
  .profile-stats--api { grid-template-columns: 1fr; gap: 12px; }
  .profile-stats--api > div { padding: 4px 8px; }
}

/* The product flow uses the same large-screen scale as the desktop intro.
   Profile/account routes intentionally remain on their fixed Figma geometry. */
@media (min-width: 1600px) and (min-height: 900px) {
  body[data-route="upload"].is-fixed { height: auto; min-height: 100dvh; overflow-y: auto; }
  body[data-route="upload"] .page { height: auto; min-height: calc(100dvh - 56px); overflow: visible; }

  .upload-content,
  .analysis-content,
  .free-content { width: clamp(680px, 33.6vw, 860px); }

  .upload-content,
  .analysis-content,
  .free-content { padding-top: clamp(56px, 3vw, 76px); }

  .upload-content .page-heading h1,
  .analysis-content .page-heading h1,
  .free-content .page-heading h1 { font-size: clamp(38px, 2vw, 48px); line-height: 1.18; }

  .upload-content .page-heading,
  .analysis-content .page-heading,
  .free-content > .page-heading { margin-bottom: clamp(28px, 1.5vw, 38px); }

  .upload-content .page-back,
  .analysis-content .page-back,
  .free-content .page-back { top: clamp(57px, 3vw, 77px); left: clamp(-76px, -3vw, -57px); width: clamp(32px, 2vw, 46px); height: clamp(32px, 2vw, 46px); font-size: clamp(28px, 1.75vw, 40px); }

  .upload-card { min-height: 360px; padding: 24px; border-radius: 22px; }
  .upload-examples { height: 152px; margin-top: 8px; margin-bottom: 8px; transform: scale(1.14); transform-origin: center center; }
  .upload-example-title { font-size: 26px; line-height: 30px; }
  .upload-intro { max-width: 560px; margin-top: 10px; margin-bottom: 20px; font-size: 17px; line-height: 23px; }
  .upload-actions { gap: 12px; }
  .upload-actions .secondary-button { min-height: 60px; border-radius: 20px; font-size: 17px; }
  .guidelines { gap: 10px; padding: 30px 0; }
  .guidelines h2 { margin-bottom: 10px; font-size: 21px; line-height: 28px; }
  .guidelines > div { min-height: 54px; padding: 10px 20px; border-radius: 16px; }
  .guidelines p { font-size: 16px; line-height: 22px; }
  .upload-content > .primary-button { min-height: 64px; border-radius: 22px; font-size: 18px; }
  .upload-content .privacy-note { margin-top: 12px; font-size: 13px; line-height: 18px; }

  .analysis-orb { margin-top: 12px; margin-bottom: 42px; transform: scale(1.18); }
  .analysis-statuses { gap: 12px; margin-bottom: 32px; }
  .analysis-status { min-height: 116px; gap: 10px; padding: 12px 8px; border-radius: 16px; }
  .analysis-status > span,
  .analysis-status > span img,
  .analysis-status i,
  .analysis-status i img { width: 30px; height: 30px; }
  .analysis-status p { font-size: 12px; line-height: 16px; }
  .analysis-helper { margin-bottom: 14px; }
  .analysis-helper h2 { font-size: 26px; line-height: 30px; }
  .analysis-helper p { font-size: 16px; line-height: 22px; }
  .question-card { padding: 18px; border-radius: 20px; }
  .question-card h2 { font-size: 18px; line-height: 24px; }
  .answer-list { gap: 9px; }
  .answer { min-height: 44px; padding: 8px 10px; border-radius: 12px; font-size: 16px; line-height: 21px; }
  .question-card .primary-button { min-height: 54px; margin-top: 14px; border-radius: 16px; font-size: 17px; }

  .person-summary { grid-template-columns: 154px 1fr; gap: 22px; width: 356px; }
  .person-summary > img { width: 154px; height: 204px; border-radius: 20px; }
  .person-summary > div > span { margin: 4px 0 10px; font-size: 17px; }
  .traits b { gap: 12px; min-height: 61px; font-size: 21px; }
  .traits b > img { width: 30px; height: 30px; flex-basis: 30px; }
  .free-content > .section-label,
  .free-content > .unlocks-title { margin-top: 34px; margin-bottom: 18px; font-size: 34px; line-height: 42px; }
  .strengths { border-radius: 20px; }
  .strengths .accordion-item > button { min-height: 66px; padding: 16px 22px; font-size: 26px; }
  .strengths .accordion-item > div > p { padding-right: 22px; padding-left: 22px; font-size: 16px; line-height: 23px; }
  .strengths .accordion-item.open > div > p { padding-bottom: 20px; }
  .locked-grid { gap: 14px; }
  .locked-grid article { height: 180px; border-radius: 20px; }
  .free-content .locked-grid article > img,
  .free-content .locked-grid article:nth-of-type(-n+2) > img { width: 184px; height: 108px; border-radius: 12px; }
  .locked-grid article > div { top: 12px; left: 16px; font-size: 21px; }
  .free-content > .analysis-actions { margin-top: 32px; }
  .free-content .analysis-actions > button { min-height: 64px; border-radius: 22px; font-size: 18px; }
}

/* A bounded, centered offer instead of viewport-wide gaps on large monitors. */
@media (min-width: 1600px) {
  .payment-content { width: 640px; gap: 32px; padding-block: 32px; }
  .payment-content .page-heading h1 { font-size: 40px; line-height: 48px; }
  .payment-example { font-size: 18px; line-height: 24px; }
  .payment-carousel { width: min(100%, clamp(360px, calc(100dvh - 632px), 640px)); }
  .payment-offer .analysis-actions > button { min-height: 64px; font-size: 18px; }
  .payment-content > .page-back { top: 40px; width: 40px; height: 40px; }
}

@media (min-width: 1600px) and (min-height: 1000px) {
  .page[data-page="result-wow"] .wow-content {
    --wow-card-height: min(864px, calc(100dvh - 248px));
    width: calc(var(--wow-card-height) * .75);
    height: auto;
    padding-top: clamp(24px, 2vw, 36px);
    flex-basis: auto;
  }
  .page[data-page="result-wow"] .wow-card {
    width: 100%;
    height: var(--wow-card-height);
    aspect-ratio: 3 / 4;
    border-radius: clamp(24px, 1.5vw, 34px);
  }
  .page[data-page="result-wow"] .wow-base { width: 100%; height: 100%; }
  .page[data-page="result-wow"] .wow-subject { top: 3.194%; left: -16.852%; width: 123.889%; height: auto; }
  .page[data-page="result-wow"] .wow-card h1 { top: clamp(48px, 2.6vw, 68px); font-size: clamp(32px, 1.8vw, 44px); line-height: 1.1; }
  .page[data-page="result-wow"] .wow-card .zoom-button { top: calc(clamp(48px, 2.6vw, 68px) + clamp(17.6px, .99vw, 24.2px) - 21.5px); right: clamp(20px, 1.3vw, 30px); width: 43px; height: 43px; }
  .page[data-page="result-wow"] .wow-card .zoom-button img { width: 43px !important; height: 43px !important; }
  .page[data-page="result-wow"] .wow-result-actions > .primary-button { width: 100%; min-height: clamp(56px, 3.1vw, 70px); border-radius: clamp(20px, 1.2vw, 28px); font-size: clamp(16px, .95vw, 21px); }
}

@media (max-width: 700px) {
  .carousel-arrow { display: none; }
}

/* Interactive before/after comparison using the aligned backend portraits. */
.compare-card[data-compare-card] { --compare-position: 50%; isolation: isolate; user-select: none; }
.compare-card[data-compare-card] .compare-bg { position: absolute; z-index: 0; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center; pointer-events: none; }
.compare-card[data-compare-card] .compare-person { position: absolute; z-index: 1; inset: 0; display: block; width: 100%; height: 100%; max-width: none; overflow: hidden; transform: none; pointer-events: none; }
.compare-card[data-compare-card] .compare-photo { position: absolute; right: auto; bottom: 0; left: 50%; display: block; width: auto; height: calc(100% - 56px); max-width: none; object-fit: contain; object-position: center bottom; transform: translateX(-50%); pointer-events: none; }
.compare-card[data-compare-card] .compare-photo--before { z-index: 1; }
.compare-card[data-compare-card] .compare-photo--after { z-index: 2; clip-path: inset(0 0 0 var(--compare-position)); will-change: clip-path; }
.compare-card[data-compare-card] .compare-divider { position: absolute; z-index: 4; top: 56px; bottom: 80px; left: var(--compare-position); display: block; width: 2px; background: rgba(255,255,255,.95); box-shadow: 0 0 0 1px rgba(60,36,17,.08); transform: translateX(-1px); pointer-events: none; will-change: left; }
.compare-card[data-compare-card] .compare-handle { position: absolute; top: 50%; left: 50%; display: flex; align-items: center; justify-content: center; gap: 4px; width: 38px; height: 38px; border: 1px solid rgba(60,36,17,.14); border-radius: 50%; color: var(--main); background: rgba(255,255,255,.94); box-shadow: 0 4px 16px rgba(60,36,17,.18); font-family: Inter,sans-serif; font-size: 15px; font-style: normal; transform: translate(-50%,-50%); }
.compare-card[data-compare-card] .compare-handle span { display: block; line-height: 1; }
.compare-card[data-compare-card] .compare-range { position: absolute; z-index: 6; top: 56px; right: 0; bottom: 80px; left: 0; width: 100%; height: calc(100% - 136px); margin: 0; opacity: 0; cursor: ew-resize; touch-action: none; appearance: none; -webkit-appearance: none; }
.compare-card[data-compare-card]:focus-within .compare-handle { outline: 2px solid #e5c289; outline-offset: 3px; }
.compare-card--cover { margin: 0; }
.compare-card--cover > img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center; }

@media (max-width: 700px) {
  .compare-card[data-compare-card] .compare-photo { height: calc(100% - 48px); }
  .compare-card[data-compare-card] .compare-divider { top: 48px; bottom: 88px; }
  .compare-card[data-compare-card] .compare-range { top: 48px; bottom: 88px; height: calc(100% - 136px); }
}

/* Dedicated makeup API: Figma result structure 306:4343 / 306:6821. */
.makeup-content--api { display: flex; flex-direction: column; width: 540px; }
.makeup-content--api > .page-heading { margin-bottom: 16px; }
.makeup-traits { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 12px; }
.makeup-traits span { padding: 7px 12px; border: 1px solid var(--stroke); border-radius: 999px; color: var(--accent); background: rgba(255,255,255,.72); font-family: Prata,serif; font-size: 14px; line-height: 18px; }
.makeup-summary { max-width: 480px; margin: 0 auto 20px; color: var(--muted); text-align: center; font-size: 14px; line-height: 21px; }
.makeup-sheet { position: relative; width: min(100%, 500px); aspect-ratio: 4 / 5; margin: 0 auto 28px; overflow: hidden; border: 1px solid rgba(60,36,17,.08); border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.makeup-sheet > img { width: 100%; height: 100%; object-fit: contain; }
.makeup-sheet > .zoom-button { position: absolute; top: 12px; right: 12px; }
.makeup-generation { display: grid; grid-template-columns: 36px minmax(0,1fr); align-items: center; gap: 14px; width: 100%; min-height: 126px; margin-bottom: 28px; padding: 22px; border: 1px solid var(--stroke); border-radius: 20px; background: #fff; box-shadow: 0 8px 32px rgba(60,36,17,.06); }
.makeup-generation.has-message { align-items: start; }
.makeup-generation b { display: block; margin-bottom: 5px; font-family: Prata,serif; font-size: 18px; line-height: 24px; font-weight: 400; }
.makeup-generation p { color: var(--muted); font-size: 13px; line-height: 19px; }
.makeup-loader { width: 34px; height: 34px; border: 3px solid var(--stroke); border-top-color: var(--accent); border-radius: 50%; animation: checkoutSpin 900ms linear infinite; }
.makeup-refresh { grid-column: 2; width: fit-content; min-width: 170px; min-height: 42px; margin: 2px 0 0; border-radius: 14px; }
.makeup-looks, .makeup-guides, .makeup-routines, .makeup-avoid { width: 100%; margin-bottom: 28px; }
.makeup-looks > h2, .makeup-guides > h2, .makeup-routines > h2, .makeup-avoid > h2 { margin-bottom: 14px; font-family: Prata,serif; font-size: 22px; line-height: 28px; font-weight: 400; }
.makeup-card-rail { position: relative; width: 100%; overflow: hidden; }
.makeup-card-rail::before, .makeup-card-rail::after { position: absolute; z-index: 2; top: 0; bottom: 6px; width: 30px; content: ""; opacity: 0; pointer-events: none; transition: opacity 180ms ease; }
.makeup-card-rail::before { left: 0; background: linear-gradient(90deg, var(--paper) 8%, rgba(247,243,238,0)); }
.makeup-card-rail::after { right: 0; background: linear-gradient(270deg, var(--paper) 8%, rgba(247,243,238,0)); }
.makeup-card-rail.can-scroll-left::before, .makeup-card-rail.can-scroll-right::after { opacity: 1; }
.makeup-card-tabs { display: flex; gap: 8px; width: 100%; padding: 2px 46px 6px 2px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: 8px; scrollbar-width: none; }
.makeup-card-tabs::-webkit-scrollbar { display: none; }
.makeup-card-tabs button { display: flex; align-items: center; gap: 7px; width: 118px; min-width: 118px; min-height: 56px; padding: 7px 9px 7px 8px; overflow: hidden; border: 1px solid var(--stroke); border-radius: 14px; background: rgba(255,255,255,.72); scroll-snap-align: start; text-align: left; }
.makeup-card-tabs button span { display: grid; place-items: center; width: 28px; height: 28px; padding-top: 2px; flex: 0 0 28px; border-radius: 50%; color: #fff; background: #b39b81; font-family: Prata,serif; line-height: 1; }
.makeup-card-tabs button b { display: -webkit-box; min-width: 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 10px; line-height: 14px; font-weight: 600; text-transform: uppercase; }
.makeup-card-tabs button.active { border-color: #e5c289; background: #fff; box-shadow: 0 0 0 2px rgba(229,194,137,.36); }
.makeup-card-tabs button.active span { background: var(--premium); }
.makeup-card-panel { box-sizing: border-box; width: 100%; min-width: 0; min-height: 214px; padding: 20px; overflow: hidden; border: 1px solid var(--stroke); border-radius: 20px; background: #fff; touch-action: pan-y; }
.makeup-card-panel h3 { margin-bottom: 16px; color: var(--accent); font-family: Prata,serif; font-size: 18px; line-height: 24px; font-weight: 400; }
.makeup-card-products { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.makeup-card-products > div { display: grid; grid-template-columns: minmax(0,1fr) auto; align-content: start; gap: 4px 10px; min-width: 0; }
.makeup-card-products span { grid-column: 1; color: var(--muted); font-size: 11px; line-height: 15px; }
.makeup-card-products b { grid-column: 1; overflow-wrap: anywhere; font-size: 12px; line-height: 17px; }
.makeup-card-products > div > i { grid-column: 2; grid-row: 1 / span 2; width: 38px; height: 38px; border: 1px solid rgba(60,36,17,.08); border-radius: 10px; background: var(--c); }
.makeup-card-colors { grid-column: 1 / -1; display: flex; gap: 5px; margin-top: 6px; }
.makeup-card-colors i { height: 28px; flex: 1; border-radius: 7px; background: var(--c); }
.makeup-sculpting { display: grid; gap: 12px; }
.makeup-sculpting > div { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 10px; }
.makeup-sculpting > div > i { width: 38px; height: 38px; border: 1px solid rgba(60,36,17,.08); border-radius: 10px; background: var(--c); }
.makeup-sculpting span { display: grid; gap: 2px; }
.makeup-sculpting b { font-size: 13px; line-height: 17px; }
.makeup-sculpting small { color: var(--muted); font-size: 11px; line-height: 16px; }
.makeup-guides { display: grid; gap: 12px; }
.makeup-guides > h2 { margin-bottom: 2px; }
.makeup-guide { padding: 20px; border: 1px solid var(--stroke); border-radius: 20px; background: rgba(255,255,255,.78); }
.makeup-guide h3 { margin-bottom: 6px; font-family: Prata,serif; font-size: 18px; line-height: 24px; font-weight: 400; }
.makeup-guide > p { color: var(--muted); font-size: 12px; line-height: 18px; }
.makeup-guide-swatches { display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; }
.makeup-guide-swatches::-webkit-scrollbar { display: none; }
.makeup-guide-swatches figure { width: 74px; flex: 0 0 74px; margin: 0; }
.makeup-guide-swatches i { display: block; width: 74px; height: 42px; border: 1px solid rgba(60,36,17,.08); border-radius: 10px; background: var(--c); }
.makeup-guide-swatches figcaption { margin-top: 5px; overflow-wrap: anywhere; color: var(--muted); font-size: 9px; line-height: 12px; }
.makeup-guide ul, .makeup-avoid ul { margin: 14px 0 0; padding-left: 20px; color: var(--muted); font-size: 12px; line-height: 18px; }
.makeup-routines { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.makeup-routines > h2 { grid-column: 1 / -1; margin-bottom: 2px; }
.makeup-routines article, .makeup-avoid { padding: 20px; border: 1px solid var(--stroke); border-radius: 20px; background: #fff; }
.makeup-routines h3 { margin-bottom: 10px; color: var(--accent); font-family: Prata,serif; font-size: 17px; line-height: 22px; font-weight: 400; }
.makeup-routines ol { margin: 0; padding-left: 19px; color: var(--muted); font-size: 12px; line-height: 18px; }
.makeup-content--api > .result-download { width: 100%; min-height: 52px; margin: 0 0 12px; }
.makeup-content--api > .primary-button { width: 100%; min-height: 56px; }

@media (max-width: 700px) {
  .makeup-content--api { width: 362px; max-width: 100%; padding-top: 24px; }
  .makeup-content--api > .page-heading { margin-bottom: 14px; }
  .makeup-content--api .page-heading h1 { text-align: left; }
  .makeup-traits { justify-content: flex-start; }
  .makeup-summary { margin-bottom: 18px; text-align: left; font-size: 13px; line-height: 19px; }
  .makeup-sheet { width: 100%; margin-bottom: 24px; border-radius: 18px; }
  .makeup-generation { grid-template-columns: 30px minmax(0,1fr); gap: 12px; min-height: 116px; margin-bottom: 24px; padding: 18px; border-radius: 18px; }
  .makeup-loader { width: 30px; height: 30px; }
  .makeup-generation b { font-size: 16px; line-height: 21px; }
  .makeup-refresh { grid-column: 1 / -1; width: 100%; }
  .makeup-looks, .makeup-guides, .makeup-routines, .makeup-avoid { margin-bottom: 24px; }
  .makeup-looks > h2, .makeup-guides > h2, .makeup-routines > h2, .makeup-avoid > h2 { font-size: 20px; line-height: 25px; }
  .makeup-card-tabs { padding-right: 38px; }
  .makeup-card-tabs button { width: 106px; min-width: 106px; min-height: 56px; padding-right: 7px; }
  .makeup-card-tabs button b { font-size: 9px; line-height: 13px; }
  .makeup-card-panel, .makeup-guide, .makeup-routines article, .makeup-avoid { padding: 16px; border-radius: 16px; }
  .makeup-card-panel { min-height: 214px; }
  .makeup-card-products { grid-template-columns: 1fr; }
  .makeup-routines { grid-template-columns: 1fr; }
  .makeup-routines > h2 { grid-column: 1; }
  .makeup-content--api,
  .makeup-looks,
  .makeup-guides,
  .makeup-routines,
  .makeup-avoid,
  .makeup-guide { min-width: 0; }
  .makeup-guides > h2 {
    max-width: 100%;
    overflow-wrap: break-word;
    text-wrap: balance;
  }
  .makeup-guide-swatches { width: 100%; max-width: 100%; overscroll-behavior-x: contain; }
}

/* The hero uses the same aligned portrait pair as the Figma comparison. The
   shared custom property keeps the reveal edge and its divider pixel-locked. */
@property --hero-compare-position {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 50%;
}

@keyframes heroCompareSweep {
  0% { --hero-compare-position: 50%; animation-timing-function: cubic-bezier(.65,0,.35,1); }
  30% { --hero-compare-position: 94%; }
  40% { --hero-compare-position: 94%; animation-timing-function: cubic-bezier(.65,0,.35,1); }
  75% { --hero-compare-position: 6%; }
  85% { --hero-compare-position: 6%; animation-timing-function: cubic-bezier(.65,0,.35,1); }
  100% { --hero-compare-position: 50%; }
}

.hero-comparison {
  --hero-compare-position: 50%;
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  animation: heroCompareSweep 11s infinite;
}
.hero-comparison .hero-reveal {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  will-change: clip-path;
}
.hero-comparison .hero-reveal--before {
  z-index: 1;
  clip-path: inset(0 calc(100% - var(--hero-compare-position)) 0 0);
}
.hero-comparison .hero-reveal--after {
  z-index: 2;
  clip-path: inset(0 0 0 var(--hero-compare-position));
}
.hero-comparison .hero-photo--subject {
  top: 18%;
  right: auto;
  bottom: auto;
  left: 50%;
  width: 126%;
  height: auto;
  object-fit: contain;
  object-position: center top;
  transform: translateX(-50%);
  pointer-events: none;
}
#app.route-enter .hero-comparison .hero-photo--subject { animation: none; }
.hero-comparison .hero-photo--before { z-index: 1; }
.hero-comparison .hero-photo--after {
  z-index: 2;
  clip-path: none;
  transform: translateX(-50%);
}
.hero-auto-divider {
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0;
  left: var(--hero-compare-position);
  width: 2px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 0 0 1px rgba(60,36,17,.05);
  transform: translateX(-1px);
  will-change: left;
}
/* Figma-aligned before/after stage on the Image 34 wall. */
.page[data-page="before-after"] .compare-card[data-compare-card] {
  cursor: ew-resize;
  touch-action: none;
}
.page[data-page="before-after"] .compare-card[data-compare-card] .compare-bg {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.page[data-page="before-after"] .compare-card[data-compare-card] .compare-bg img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}
.page[data-page="before-after"] .compare-card[data-compare-card] .compare-person {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}
.page[data-page="before-after"] .compare-card[data-compare-card] .compare-photo {
  top: 28px;
  right: auto;
  bottom: auto;
  left: 50%;
  display: block;
  width: 76%;
  height: auto;
  max-width: none;
  object-fit: contain;
  object-position: center top;
  transform: translateX(-50%);
}
.page[data-page="before-after"] .compare-card[data-compare-card] .compare-divider {
  top: 40px;
  bottom: 0;
  left: var(--compare-position);
  display: block;
  transform: translateX(-1px);
}
.page[data-page="before-after"] .compare-card[data-compare-card] .compare-handle {
  display: flex;
  width: 32px;
  height: 32px;
  gap: 2px;
  box-shadow: 0 3px 12px rgba(60,36,17,.14);
  font-size: 13px;
}
.page[data-page="before-after"] .compare-card[data-compare-card] .compare-range {
  top: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@media (max-width: 700px) {
  .hero-comparison .hero-photo--subject {
    top: 18%;
    right: auto;
    bottom: auto;
    left: 50%;
    width: 126%;
    height: auto;
  }
  .hero-comparison .hero-photo--after { transform: translateX(-50%); }
  .hero-auto-divider { top: 0; }
  .hero-auto-divider i { top: 74%; }
  .page[data-page="home"] .hero-card { border: 0; outline: 0; box-shadow: none; }

  .page[data-page="before-after"] .compare-card[data-compare-card] .compare-photo {
    top: 190px;
    width: 100%;
    height: auto;
  }
  .page[data-page="before-after"] .compare-card[data-compare-card] .compare-divider {
    top: 0;
    bottom: 0;
  }
}

/* The interactive comparison follows the hero card scale on desktop. Its
   action stays inside the card so a 24px header gap remains at every size. */
@media (min-width: 701px) {
  .page[data-page="before-after"] { overflow: hidden; }
  .page[data-page="before-after"] .before-after-content {
    width: 540px;
    height: auto;
    min-height: 0;
    aspect-ratio: 3 / 4;
    align-self: flex-start;
    flex: 0 0 auto;
    margin-top: 24px;
    padding: 0;
    transform: none;
  }
  .page[data-page="before-after"] .before-after-content > .page-heading {
    top: 18px;
    left: 0;
    width: 100%;
  }
  .page[data-page="before-after"] .before-after-content .compare-card {
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 32px;
  }
  .page[data-page="before-after"] .compare-card[data-compare-card] .compare-photo {
    top: 3.89%;
    width: 100%;
  }
  .page[data-page="before-after"] .compare-card[data-compare-card] .compare-divider {
    top: 0;
    bottom: 0;
  }
  .page[data-page="before-after"] .before-after-content > .primary-button {
    top: auto;
    right: 20px;
    bottom: 20px;
    left: 20px;
    width: auto;
    height: 56px;
    margin: 0;
  }
}

@media (min-width: 1600px) and (min-height: 900px) {
  .page[data-page="before-after"] .before-after-content {
    width: clamp(540px, min(37.5vw, calc(75dvh - 120px)), 960px);
  }
  .page[data-page="before-after"] .before-after-content > .page-heading { top: clamp(18px, 1.25vw, 32px); }
  .page[data-page="before-after"] .before-after-content .page-heading h1 {
    font-size: clamp(32px, 1.8vw, 44px);
    line-height: 1;
  }
  .page[data-page="before-after"] .before-after-content .compare-card {
    border-radius: clamp(24px, 1.5vw, 34px);
  }
  .page[data-page="before-after"] .compare-card[data-compare-card] .compare-handle {
    width: clamp(32px, 2vw, 44px);
    height: clamp(32px, 2vw, 44px);
    font-size: clamp(13px, .85vw, 18px);
  }
  .page[data-page="before-after"] .before-after-content > .primary-button {
    right: 3.7%;
    bottom: clamp(20px, 1.39vw, 36px);
    left: 3.7%;
    height: clamp(56px, 3.89vw, 96px);
    border-radius: clamp(20px, 1.39vw, 32px);
    font-size: clamp(16px, 1.11vw, 24px);
  }
}

/* Desktop authentication — Figma page “Для верстки”, nodes 306:6326 and 306:6369 */
@media (min-width: 701px) {
  .page[data-page="login"],
  .page[data-page="register"] { align-items: flex-start; }
  .auth-content {
    justify-content: flex-start;
    gap: 24px;
    min-height: 0;
    padding-top: 48px;
  }
  .auth-top { padding: 0 20px; }
  .auth-content .page-heading { margin: 0; }
  .auth-content .page-heading h1 {
    max-width: 540px;
    font-size: 32px;
    line-height: 38.4px;
    letter-spacing: 0;
  }
  .auth-content .page-heading p {
    margin-top: 16px;
    font-size: 14px;
    line-height: 18px;
  }
  .auth-page-back {
    top: 48px;
    left: -57px;
    padding: 0;
    overflow: visible;
    background: transparent;
    font-size: 0;
  }
  .auth-page-back img {
    width: 32px;
    height: 32px;
    max-width: none;
    transform: rotate(90deg);
  }
  .auth-card,
  .auth-card--register,
  .auth-card--profile-step {
    min-height: 0;
    height: auto;
    padding: 24px 20px;
    border-radius: 24px;
    box-shadow: none;
  }
  .auth-card { gap: 16px; }
  .auth-card--register { gap: 24px; }
  .auth-card--profile-step { gap: 16px; }
  .auth-card input {
    height: 56px;
    padding: 0 16px;
    border-width: 1px;
    border-radius: 16px;
    font-size: 16px;
    line-height: 24px;
  }
  .auth-card .password-wrap input { padding-right: 16px; }
  .auth-card .password-wrap button { display: none; }
  .auth-fields { gap: 12px; }
  .auth-divider { height: 16px; }
  .auth-divider::before,
  .auth-divider::after {
    height: 1px;
    background: rgba(60,36,17,.32);
  }
  .yandex-button {
    gap: 14px;
    height: 48px;
    border-radius: 8px;
    background: #000;
    font-size: 14px;
    line-height: 21px;
    font-weight: 400;
  }
  .telegram-auth {
    height: 48px;
    min-height: 48px;
    border-radius: 8px;
  }
  .email-auth-title { font-size: 16px; line-height: 24px; }
  .forgot-link { margin: 0; font-size: 16px; line-height: 24px; }
  .auth-card-footer { gap: 12px; margin-top: 0; }
  .auth-switch { margin: 0; font-size: 16px; line-height: 24px; }
  .auth-card .primary-button {
    min-height: 56px;
    border-radius: 20px;
    box-shadow: none;
    font-size: 16px;
    line-height: 18px;
  }
  .auth-card--profile-step .auth-profile-fields { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .hero-comparison { --hero-compare-position: 50%; animation: none !important; }
  .step-glow { animation: none !important; }
}

/* Motion system — restrained micro-interactions for navigation and controls. */
@keyframes routeEnterForward {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes routeEnterBack {
  from { opacity: 0; transform: translate3d(-14px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes motionItemEnter {
  from { opacity: 0; transform: translate3d(0, 12px, 0) scale(.992); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes overlayEnter {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes dialogEnter {
  from { opacity: 0; transform: translate3d(0, 18px, 0) scale(.975); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes centeredDialogEnter {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 16px)) scale(.975); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

#app.route-enter .page > section,
#app.route-enter > .mobile-app {
  animation: routeEnterForward var(--motion-medium) var(--motion-ease-out) both;
}
#app.route-enter[data-motion-direction="back"] .page > section,
#app.route-enter[data-motion-direction="back"] > .mobile-app {
  animation-name: routeEnterBack;
}
#app.route-enter .motion-item {
  animation: motionItemEnter var(--motion-slow) var(--motion-ease-out) both;
  animation-delay: calc(var(--motion-index, 0) * 38ms);
}
#app.state-enter .photo-check,
#app.state-enter .question-card,
#app.state-enter .main-look,
#app.state-enter .checkout-status,
#app.state-enter .makeup-card-panel,
#app.state-enter .generation-history-card,
#app.state-enter .purchase-history-card {
  animation: motionItemEnter var(--motion-medium) var(--motion-ease-out) both;
}

.modal-backdrop,
.profile-editor-backdrop,
.birth-picker-backdrop,
.image-lightbox {
  animation: overlayEnter 220ms ease-out both;
}
.legal-modal,
.image-lightbox > img,
.hair-source-lightbox,
.wow-photo-composite {
  animation: dialogEnter 360ms var(--motion-ease-out) both;
}
.account-desktop-view .profile-editor-sheet {
  animation: centeredDialogEnter 360ms var(--motion-ease-out) both;
}

.primary-button,
.secondary-button,
.login-button,
.desktop-profile-chip,
.page-back,
.mobile-site-back,
.mobile-site-menu,
.mobile-header > button,
.profile-header > button,
.zoom-button,
.modal-close,
.photo-lightbox-control,
.bottom-nav button,
.carousel-dots button,
.makeup-card-tabs button,
.hair-tone-tabs button,
.result-download,
.support-card a {
  transform-origin: center;
  transition-duration: var(--motion-fast);
  transition-timing-function: var(--motion-ease-out);
}

.answer,
.generation-history-card,
.purchase-history-card,
.new-analysis-row,
.locked-grid article,
.makeup-card-tabs button,
.edit-profile-row > button,
.profile-menu-row {
  transition: transform var(--motion-fast) var(--motion-ease-out),
    border-color var(--motion-fast) ease,
    background-color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease,
    filter var(--motion-fast) ease;
}
.answer-list--visual .answer > img,
.generation-history-card > img:first-child,
.purchase-history-card > img:first-child,
.locked-grid article > img {
  transition: transform 360ms var(--motion-ease-out), filter 240ms ease;
}

.auth-card input,
.forgot-modal input,
.edit-form input,
.profile-editor-sheet input,
.promo-control input {
  transition: border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease, background-color var(--motion-fast) ease;
}

@media (hover: hover) and (pointer: fine) {
  .page-back:hover,
  .mobile-site-back:hover,
  .mobile-site-menu:hover,
  .mobile-header > button:hover,
  .profile-header > button:hover,
  .zoom-button:hover,
  .modal-close:hover,
  .photo-lightbox-control:hover {
    scale: 1.06;
  }
  .benefit-card:hover,
  .answer:hover,
  .generation-history-card:hover,
  .purchase-history-card:hover,
  .new-analysis-row:hover,
  .locked-grid article:hover,
  .makeup-card-tabs button:hover,
  .profile-menu-row:hover {
    transform: translate3d(0, -3px, 0);
    box-shadow: 0 10px 26px rgba(60, 36, 17, .09);
  }
  .answer-list--visual .answer:hover > img,
  .benefit-card:hover .benefit-media img,
  .generation-history-card:hover > img:first-child,
  .purchase-history-card:hover > img:first-child,
  .locked-grid article:hover > img {
    transform: scale(1.018);
  }
  .benefit-card:hover {
    border-color: rgba(194,128,52,.42);
    box-shadow: 0 14px 30px rgba(60,36,17,.1);
  }
  .bottom-nav button:hover,
  .carousel-dots button:hover {
    scale: 1.08;
  }
}

@media (max-width: 700px) {
  #app.route-enter .page > section,
  #app.route-enter > .mobile-app {
    animation-name: routeEnterForward;
  }
  #app.route-enter[data-motion-direction="back"] .page > section,
  #app.route-enter[data-motion-direction="back"] > .mobile-app {
    animation-name: routeEnterBack;
  }
}

@media (prefers-reduced-motion: reduce) {
  #app.route-enter .page > section,
  #app.route-enter > .mobile-app,
  #app.route-enter .motion-item,
  #app.state-enter .photo-check,
  #app.state-enter .question-card,
  #app.state-enter .main-look,
  #app.state-enter .checkout-status,
  #app.state-enter .makeup-card-panel,
  #app.state-enter .generation-history-card,
  #app.state-enter .purchase-history-card,
  .modal-backdrop,
  .profile-editor-backdrop,
  .birth-picker-backdrop,
  .image-lightbox,
  .legal-modal,
  .image-lightbox > img,
  .hair-source-lightbox,
  .wow-photo-composite,
  .account-desktop-view .profile-editor-sheet {
    animation: none !important;
  }
}

/* Client review fixes — upload, checkout and expanded profile */
.upload-error-first {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0 0 12px;
  padding: 12px 16px;
  border: 1px solid rgba(204,58,60,.28);
  border-radius: 12px;
  color: var(--looksi-error, #cc3a3c);
  background: #fff;
  font-size: 14px;
  line-height: 18px;
}
.upload-error-first img { width: 24px; height: 24px; flex: 0 0 24px; }
.upload-error-first > span { display: grid; min-width: 0; gap: 3px; }
.upload-error-first strong { color: var(--looksi-error, #cc3a3c); font-weight: 700; }
.upload-error-first small { color: var(--main); font-size: 12px; line-height: 16px; }
.upload-error-first button { margin-left: auto; padding: 6px 0 6px 10px; color: var(--accent); font-size: 12px; line-height: 16px; font-weight: 700; }
.analysis-answers-notice { display: grid; gap: 4px; margin: -4px 0 16px; padding: 14px 16px; border: 1px solid var(--stroke); border-radius: 14px; color: var(--muted); background: #fff; text-align: center; font-size: 12px; line-height: 16px; }
.analysis-answers-notice b { color: var(--main); font-size: 14px; line-height: 18px; }
.photo-check.error { overflow: visible; margin-bottom: 52px; }
.photo-check.error .photo-check-image { overflow: hidden; border-radius: 16px; }
.photo-replace {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  display: flex;
  width: 100%;
  min-height: 44px;
  transform: translateX(-50%);
  cursor: pointer;
}
.photo-replace input {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.checkout-widget-card { display: flex; flex-direction: column; min-height: 0; }
.checkout-widget { flex: 1 0 auto; min-height: 440px; }
.checkout-status { flex: 1 0 auto; min-height: 380px; }
.checkout-note {
  align-self: stretch;
  max-width: none;
  margin: 0;
  padding: 16px 20px 18px;
  border-top: 1px solid var(--stroke);
  background: #fffaf5;
  font-size: 12px;
  line-height: 18px;
}
.checkout-note b { color: var(--ink); font-size: 13px; }
.checkout-security-note { align-self: center; max-width: 520px; color: var(--muted); font-size: 12px; line-height: 18px; text-align: center; }
.checkout-progress { width: min(320px,100%); height: 8px; overflow: hidden; border-radius: 999px; background: #f0e3d8; }
.checkout-progress i { display: block; width: var(--checkout-progress,0%); height: 100%; border-radius: inherit; background: var(--premium); }
.checkout-progress.is-indeterminate i { width: 38%; animation: checkoutProgress 1.1s ease-in-out infinite; }
.checkout-status--generating .checkout-spinner { border-top-color: var(--accent); }
.checkout-support { color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: underline; }
@keyframes checkoutProgress { from { transform: translateX(-110%); } to { transform: translateX(270%); } }

.profile-page { height: auto; min-height: 100dvh; overflow-x: hidden; overflow-y: auto; }
.profile-body { padding-bottom: max(24px,env(safe-area-inset-bottom)); }
.profile-details { display: grid; gap: 12px; width: 100%; padding: 16px; border: 1px solid var(--stroke); border-radius: 16px; background: #fff; }
.profile-details h2 { font-family: Prata,serif; font-size: 20px; line-height: 24px; font-weight: 400; }
.profile-details-list { margin: 0; }
.profile-details-list > div { display: grid; grid-template-columns: 32px minmax(0,1fr); grid-template-rows: auto auto; align-items: center; column-gap: 8px; row-gap: 2px; min-height: 64px; padding: 8px 0; border-bottom: 1px solid var(--stroke); }
.profile-details-list > div:last-child { border-bottom: 0; }
.profile-details-list dt { display: contents; color: var(--ink); font-size: 16px; line-height: 20px; }
.profile-details-list dt img { grid-column: 1; grid-row: 1 / 3; width: 24px; height: 24px; margin: 4px; object-fit: contain; }
.profile-details-list dt span { grid-column: 2; grid-row: 1; min-width: 0; }
.profile-details-list dt img[src*="editprofile-clothing-size.png"],
.profile-details-list dt img[src*="editprofile-shoe-size.png"],
.profile-details-list dt img[src*="editprofile-chest.png"],
.profile-details-list dt img[src*="editprofile-waist.png"],
.profile-details-list dt img[src*="editprofile-hips.png"] { transform: scale(1.25); }
.profile-details-list dd { grid-column: 2; grid-row: 2; margin: 0; color: var(--muted); text-align: left; font-size: 12px; line-height: 16px; font-weight: 400; white-space: normal; overflow-wrap: anywhere; }
.profile-editor-error { margin: -8px 0 0; color: var(--looksi-error,#cc3a3c); font-size: 13px; line-height: 18px; text-align: center; }
.edit-profile-desktop-content .edit-profile-card:nth-of-type(2) { height: auto; }
.edit-profile-desktop-content .edit-profile-row { height: auto; min-height: 53px; flex: 0 0 auto; }
body[data-route="edit-profile"] .site-footer { display: none; }
body[data-route="profile"] .site-footer { position: static; }

@media (max-width:700px) {
  .upload-error-first { margin-top: -8px; }
  .checkout-widget-card { min-height: 0; }
  .checkout-widget { min-height: 430px; }
  .checkout-status { min-height: 350px; padding: 30px 22px; }
  .checkout-note { padding: 14px 16px 16px; }
  .checkout-security-note { padding: 0 8px; font-size: 11px; line-height: 16px; }
  .profile-body { gap: 20px; }
}

@media (min-width:1600px) and (min-height:900px) {
  .analysis-actions > .new-analysis-row { min-height: 72px; border-radius: 16px; }
  .new-analysis-row b { font-size: 18px; line-height: 24px; }
  .new-analysis-row small { font-size: 13px; line-height: 18px; }
}

/* Questionnaire: user-supplied full portraits with readable captions.
   Keep the processing/result layouts independent of these question screens. */
body[data-route="analysis"] .page:has(.analysis-content--questions) {
  align-items: center;
  min-height: calc(100dvh - 56px - 66px);
  padding-top: 32px;
  padding-bottom: 32px;
}
body[data-route="analysis"]:has(.analysis-content--questions) .site-footer { position: static; }
.analysis-content.analysis-content--questions { width: 760px; min-height: 0; padding: 0; align-self: center; }
.analysis-content--questions .page-back { top: 0; }
.analysis-content--questions .page-heading { margin-bottom: 32px; }
.analysis-content--questions .page-heading p { max-width: 540px; }
.analysis-content--questions .question-progress { margin-bottom: 24px; }
.analysis-content--questions .question-card { padding: 24px; border-radius: 16px; }
.analysis-content--questions .question-card h2 { margin-bottom: 24px; font-size: 24px; line-height: 32px; text-align: center; text-wrap: balance; }
.analysis-content--questions .answer-list { gap: 12px; }
.analysis-content--questions .answer-list:not(.answer-list--visual) .answer { min-height: 56px; padding: 12px 16px; gap: 12px; font-size: 16px; line-height: 24px; }
.analysis-content--questions .answer.selected { border-color: var(--accent); }
.analysis-content--questions .answer-list--visual { gap: 16px; }
.analysis-content--questions .answer-list--visual .answer { padding: 0; font-size: 16px; line-height: 24px; }
.analysis-content--questions .question-card--visual { padding: 0; background: transparent; }
.analysis-content--questions .question-card .primary-button { min-height: 56px; margin-top: 24px; border-radius: 20px; }

@media (hover: hover) {
  .analysis-content--questions .answer:hover { border-color: var(--accent); }
}
@media (min-width: 1600px) and (min-height: 900px) {
  .analysis-content.analysis-content--questions { width: 960px; }
  .analysis-content--questions .question-card { padding: 32px; }
  .analysis-content--questions .question-card--visual { padding: 0; }
  .analysis-content--questions .question-card h2 { font-size: 28px; line-height: 36px; }
  .analysis-content--questions .answer-list--visual { gap: 24px; }
  .analysis-content--questions .answer-list--visual .answer { font-size: 20px; line-height: 28px; }
  .analysis-content--questions .answer-description { font-size: 16px; line-height: 24px; }
  .analysis-content--questions .question-card .primary-button { min-height: 64px; }
}
@media (max-width: 700px) {
  body[data-route="analysis"] .page:has(.analysis-content--questions) { min-height: calc(100dvh - 48px); padding-top: 24px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .analysis-content.analysis-content--questions { width: 100%; }
  .analysis-content--questions .page-heading { margin-bottom: 24px; }
  .analysis-content--questions .question-progress { margin-bottom: 16px; }
  .analysis-content--questions .question-card { padding: 16px; }
  .analysis-content--questions .question-card--visual { padding: 0; }
  .analysis-content--questions .question-card h2 { margin-bottom: 16px; font-size: 20px; line-height: 28px; }
  .analysis-content--questions .answer-list:not(.answer-list--visual) .answer { padding: 12px; font-size: 14px; line-height: 20px; }
  .analysis-content--questions .answer-list--visual { gap: 8px; }
  .analysis-content--questions .answer-list--visual .answer { font-size: 14px; line-height: 20px; }
  .analysis-content--questions .answer-caption { padding: 12px 4px; }
  .analysis-content--questions .answer-description { font-size: 12px; line-height: 16px; }
  .analysis-content--questions .question-card .primary-button { margin-top: 24px; }
}

/* Preserve readable captions on very narrow phones instead of shrinking type. */
@media (max-width: 360px) {
  .analysis-content--questions .answer-list--visual { grid-template-columns: 1fr; }
  .analysis-content--questions .answer-list--visual .answer { display: grid; grid-template-columns: 104px minmax(0, 1fr); text-align: left; }
  .analysis-content--questions .answer-list--visual img { border-radius: 10px 0 0 10px; }
  .analysis-content--questions .answer-caption { padding: 12px; }
}

/* Backend portraits can have different source ratios. Fill the WOW card by
   width and crop the overflow vertically so no pale side bands remain. */
.page[data-page="result-wow"] .wow-subject {
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  object-position: center top;
  transform: none;
}

body.is-fixed .page[data-page="result-wow"] {
  overflow: hidden;
}
body[data-route="result-wow"] .site-footer { display: none; }

@media (max-width: 700px) {
  /* The final WOW composition is a single viewport, like the home hero. */
  body.is-fixed .page[data-page="result-wow"] {
    height: calc(100dvh - 48px);
    min-height: 0;
    overflow: hidden;
  }
  .wow-secondary-actions > :only-child { grid-column: 1 / -1; }
}

/* The transparent header stays in document flow, never over the reading area. */
@media (min-width: 701px) and (max-width: 1100px) {
  .site-header { padding-inline: 24px; gap: 16px; }
  .main-nav { width: auto; gap: 16px; }
  .main-nav button:nth-child(n) { width: auto; font-size: 14px; line-height: 20px; }
  .header-socials { display: none; }
  .header-actions { gap: 0; }
  .login-button, .desktop-profile-chip { width: 80px; }
}

/* Hair shade carousel: use backend HEX values when shade renders have not
   been generated. The clipped next card and Figma arrow expose horizontal
   navigation without adding a native scrollbar. */
.hair-tone-slider { width: 100%; margin-top: 16px; }
.hair-tone-rail { position: relative; width: 100%; overflow: hidden; }
.hair-tone-rail::before,
.hair-tone-rail::after { position: absolute; z-index: 3; top: 0; bottom: 24px; width: 28px; content: ""; opacity: 0; pointer-events: none; transition: opacity 180ms ease; }
.hair-tone-rail::before { left: 0; background: linear-gradient(90deg, var(--paper) 6%, rgba(247,243,238,0)); }
.hair-tone-rail::after { right: 0; background: linear-gradient(270deg, var(--paper) 6%, rgba(247,243,238,0)); }
.hair-tone-rail.can-scroll-left::before,
.hair-tone-rail.can-scroll-right::after { opacity: 1; }
.hair-tone-slider .hair-tone-strip { width: 100%; margin-top: 0; padding: 0 48px 0 0; scroll-snap-type: x proximity; scroll-padding-inline: 8px; }
.hair-tone-slider .hair-tone-strip.is-resetting { scroll-behavior: auto !important; }
.hair-tone-crop--portrait img { position: static !important; width: 100% !important; height: 100% !important; max-width: 100% !important; object-fit: contain; object-position: center; transform: none !important; }
.hair-tone-crop--personalized { background: #f8f3ee; }
.hair-tone-crop--personalized > img,
.hair-tone-crop--personalized > canvas { position: absolute; z-index: 1; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hair-tone-crop--personalized > canvas { z-index: 2; }
.hair-tone-crop--personalized > canvas[hidden] { display: none; }
.hair-tone-crop--personalized .hair-sheet-portrait { z-index: 1; }
.hair-tone-crop--swatch { border: 1px solid rgba(60,36,17,.08); background: var(--tone); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.hair-tone-slider-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 20px; margin-top: 8px; color: var(--muted); font-size: 10px; line-height: 12px; }
.hair-tone-slider-meta > span:last-child { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.hair-tone-slider-meta img { width: 21px; height: auto; }
.hair-tone-feedback { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 42px; margin-top: 10px; padding: 10px 14px; border: 1px solid var(--stroke); border-radius: 12px; color: var(--muted); background: rgba(255,255,255,.7); text-align: center; font-size: 12px; line-height: 16px; }
.hair-tone-feedback > i { width: 18px; height: 18px; flex: 0 0 18px; border: 2px solid var(--stroke); border-top-color: var(--accent); border-radius: 50%; animation: spin 800ms linear infinite; }
.hair-tone-feedback.is-error { flex-wrap: wrap; color: #9d463c; background: #fff9f7; }
.hair-tone-feedback button { padding: 4px 0; color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.hair-tone-default { display: grid; place-items: center; min-height: 252px; margin-top: 16px; padding: 18px 16px; border: 1px solid var(--stroke); border-radius: 12px; color: var(--muted); background: rgba(255,255,255,.7); text-align: center; font-size: 14px; line-height: 20px; }

@media (max-width: 700px) {
  .hair-tone-slider { margin-top: 12px; }
  .hair-tone-default { min-height: 250px; margin-top: 12px; }
  .hair-tone-slider .hair-tone-strip { padding-right: 42px; }
  .hair-tone-slider-meta { margin-top: 6px; }
}

/* Responsive visual audit — keep the Figma composition usable between the
   supplied 402px and 1440px reference frames. */
.hero-card { container-type: inline-size; }

/* Keep the desktop hero as one proportional composition. Its width may change
   with the available window height, but its height, background and action area
   must follow the same 3:4 scale instead of independently compressing. */
@media (min-width: 701px) {
  .page[data-page="home"] .hero-card {
    width: min(calc(75dvh - 133.5px), calc(100vw - 128px));
    height: auto;
    min-height: 0;
    aspect-ratio: 3 / 4;
  }
  .page[data-page="home"] .hero-photo--base {
    width: 100%;
    height: 100%;
  }
  .page[data-page="home"] .hero-title {
    top: clamp(24px, 4.444cqw, 43px);
    right: 3.704cqw;
    left: 3.704cqw;
  }
  .page[data-page="home"] .hero-title span,
  .page[data-page="home"] .hero-title strong {
    font-size: clamp(40px, 7.407cqw, 72px);
    line-height: 1.2;
  }
  .page[data-page="home"] .hero-bottom {
    height: 21.667%;
    padding: 0 3.704cqw clamp(20px, 3.704cqw, 36px);
  }
  .page[data-page="home"] .hero-bottom .primary-button {
    min-height: clamp(56px, 10.37cqw, 96px);
    border-radius: clamp(20px, 3.704cqw, 32px);
    font-size: clamp(15px, 2.778cqw, 24px);
  }
}

/* On 2K displays the hero remains centered but is intentionally about 1.25x
   smaller than the proportional ultrawide scale. The 3:4 composition stays intact. */
@media (min-width: 2000px) and (min-height: 1000px) {
  .page[data-page="home"] .hero-card {
    width: min(calc(60dvh - 106.8px), calc(80vw - 102.4px), 768px);
  }
}

@media (max-width: 700px) {
  .site-header .brand {
    display: grid;
    place-items: center;
    width: 112px;
    min-width: 112px;
    height: 48px;
    padding: 0;
  }
  .page .page-back { display: none; }
  .hero-title span,
  .hero-title strong {
    white-space: nowrap;
    font-size: clamp(36px, 11.94vw, 48px);
    line-height: 1.2;
  }
  .carousel-dots {
    align-items: center;
    gap: 0;
    height: 44px;
    overflow: visible;
  }
  .payment-carousel { gap: 0; }
  .carousel-dots button {
    position: relative;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 0;
    background: transparent;
    transform: none;
  }
  .carousel-dots button.active {
    background: transparent;
    transform: none;
  }
  .carousel-dots button::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d9d9d9;
    content: "";
    transform: translate(-50%, -50%);
  }
  .carousel-dots button.active::after { background: var(--ink); }
  .forgot-link,
  .auth-switch button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-block: -9px;
    padding-block: 9px;
  }
}

/* Telegram's in-app browser often exposes a roughly 730px-high content area.
   Keep all three steps in normal flow there instead of letting fixed-height
   cards collide with the CTA. Taller phones retain the reference composition. */
@media (max-width: 700px) and (max-height: 780px) {
  body[data-route="how"] .site-footer { display: none; }
  body[data-route="how"] .page { min-height: calc(100dvh - 48px); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .page[data-page="how"] .how-content { height: auto; min-height: calc(100dvh - 48px); padding-top: 13px; }
  .page[data-page="how"] .how-content .page-heading { margin-bottom: 18px; }
  .page[data-page="how"] .steps-list { gap: 10px; margin-bottom: 0; }
  .page[data-page="how"] .step-card { grid-template-columns: 24px minmax(0,1fr) 112px; gap: 10px; min-height: 100px; }
  .page[data-page="how"] .step-media,
  .page[data-page="how"] .step-art { width: 112px; height: 96px; }
  .page[data-page="how"] .step-card:nth-child(2) .step-art { width: 96px; height: 96px; margin-left: 8px; }
  .page[data-page="how"] .step-copy h2 { font-size: 18px; line-height: 22px; }
  .page[data-page="how"] .step-copy p { margin-top: 5px; font-size: 11px; line-height: 14px; }
  .page[data-page="how"] .how-content > .primary-button { margin-top: 18px; margin-bottom: 0; flex: 0 0 56px; }
}

/* The desktop hero must retain its 3:4 reference ratio on short windows.
   Changing only its height pulled the portrait into the heading. */
@media (min-width: 701px) and (max-height: 820px) {
  body[data-route="login"] .site-footer { display: none; }
  .page[data-page="home"] .hero-card {
    width: min(540px, calc(75dvh - 110px), calc(100vw - 128px));
    height: auto;
    min-height: 0;
    aspect-ratio: 3 / 4;
  }
  .page[data-page="home"] .hero-photo--base {
    width: 100%;
    height: 100%;
  }
  .page[data-page="home"] .hero-title span,
  .page[data-page="home"] .hero-title strong {
    font-size: clamp(34px, 7.407cqw, 40px);
    line-height: 1.2;
  }
  .page[data-page="home"] .hero-bottom {
    height: 21.667%;
    padding: 0 3.7cqw max(16px, 3.7cqw);
  }
}

@media (min-width: 701px) and (max-height: 700px) {
  body[data-route="checkout"] .site-footer { display: none; }
}

/* Fit the comparison and its action into low desktop viewports. */
@media (min-width: 701px) and (max-height: 899px) {
  body[data-route="before-after"] .site-footer { display: none; }
  .page[data-page="before-after"] .before-after-content:not(.before-after-content--empty) {
    width: min(540px, calc(75dvh - 60px), calc(100vw - 128px));
    height: auto;
    min-height: 0;
    aspect-ratio: 3 / 4;
    margin-top: clamp(12px, 3dvh, 24px);
  }
}

/* Empty comparison is normal document content, not an image-stage overlay. */
.page[data-page="before-after"] .before-after-content--empty {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: min(540px, 100%);
  height: auto;
  min-height: 0;
  aspect-ratio: auto;
  margin-top: 0;
  padding-top: 48px;
  overflow: visible;
}
.page[data-page="before-after"] .before-after-content--empty > .page-heading {
  position: static;
  width: auto;
  margin: 0 0 20px;
}
.page[data-page="before-after"] .before-after-content--empty > .result-empty {
  width: 100%;
  margin: 0 0 20px;
}
.page[data-page="before-after"] .before-after-content--empty > .primary-button {
  position: static;
  width: 100%;
  height: 56px;
  margin: 0;
}

@media (max-width: 700px) {
  .page[data-page="before-after"] .before-after-content--empty {
    min-height: calc(100dvh - 48px);
    padding: 24px max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  }
}

/* Tablet header: retain the desktop content layout but replace the cramped
   four-link navigation with the same touch-friendly navigation used on phone. */
@media (min-width: 701px) and (max-width: 900px) {
  .site-header {
    grid-template-columns: 64px 1fr 64px;
    height: 56px;
    padding: 0;
  }
  .site-header .brand {
    grid-column: 2;
    justify-self: center;
    width: 112px;
    height: 56px;
    text-align: center;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -.2px;
  }
  .main-nav,
  .header-actions { display: none; }
  .mobile-site-back,
  .mobile-site-menu { display: grid; place-items: center; }
  .mobile-site-back {
    position: absolute;
    top: 4px;
    left: 8px;
    width: 48px;
    height: 48px;
  }
  .mobile-site-menu {
    position: absolute;
    top: 4px;
    right: 8px;
    width: 48px;
    height: 48px;
    font-size: 0;
  }
  .mobile-site-menu::before {
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--ink);
    box-shadow: 0 -6px 0 var(--ink), 0 6px 0 var(--ink);
    content: "";
  }
  .mobile-menu-backdrop { display: flex !important; }
  .page .page-back { display: none; }
}

/* A landscape phone cannot fit a 720px portrait vertically. Keep a readable
   402px stage and allow ordinary vertical scrolling instead of clipping it. */
@media (min-width: 701px) and (max-width: 900px) and (max-height: 600px) {
  body[data-route="home"],
  body[data-route="before-after"] {
    height: auto;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
  }
  body[data-route="home"] .site-footer,
  body[data-route="before-after"] .site-footer { display: none; }
  .page[data-page="home"],
  .page[data-page="before-after"] {
    height: auto;
    min-height: calc(100dvh - 56px);
    padding-bottom: 24px;
    overflow: visible;
  }
  .page[data-page="home"] .hero-card,
  .page[data-page="before-after"] .before-after-content:not(.before-after-content--empty) {
    width: min(402px, calc(100vw - 48px));
    height: auto;
    min-height: 0;
    aspect-ratio: 3 / 4;
    margin-top: 16px;
  }
}

/* Keep every result in the same portrait frame and fill it edge to edge. */
.hairstyle-content .main-look.hair-look--source {
  width: min(100%, 362px);
  height: auto;
  aspect-ratio: var(--hair-main-ratio, 1122 / 1402);
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 16px;
  background: #e8e5e1;
  user-select: none;
  -webkit-user-select: none;
}
.hairstyle-content .main-look.hair-look--source.hair-look--sheet {
  background: #f8f3ee;
}
.hair-sheet-portrait {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #f8f3ee;
}
.hair-sheet-cell {
  position: relative;
  display: block;
  align-self: var(--hair-sheet-y-align, center);
  justify-self: center;
  width: var(--hair-sheet-cell-width, 100%);
  height: var(--hair-sheet-cell-height, 100%);
  overflow: hidden;
}
.hair-sheet-cell > img {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--hair-sheet-scale) !important;
  height: auto !important;
  max-width: none !important;
  object-fit: fill !important;
  object-position: initial !important;
  transform: translate(var(--hair-sheet-x),var(--hair-sheet-y)) !important;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}
.hair-look--sheet > .hair-look-fallback,
.hair-source-lightbox--sheet > .hair-look-fallback {
  z-index: 0;
}
.hair-look--sheet > .zoom-button { z-index: 4; }
.hair-color-preview {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.hair-color-preview[hidden] { display: none; }
.hair-color-status {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  color: var(--main);
  background: rgba(247,243,238,.78);
  text-align: center;
  font-size: 12px;
  line-height: 18px;
}
.hair-color-status[hidden] { display: none; }
.hair-color-status > i {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2px solid rgba(194,128,52,.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}
.hair-color-status.is-error { color: #9d463c; background: rgba(255,249,247,.9); }
.hair-color-status.is-error > i { display: none; }
.hairstyle-content .main-look.hair-look--source > img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  transform: scale(1.1) !important;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}
.hair-source-lightbox img {
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}
.hair-source-lightbox--sheet {
  position: relative;
  width: min(90vw,600px,calc(80dvh * var(--hair-main-width-factor)));
  aspect-ratio: var(--hair-main-ratio);
}

/* The API now supplies two opaque, face-aligned images with identical framing.
   Overlay them pixel-for-pixel so the comparison never drifts between sides. */
.page[data-page="before-after"] .compare-card.compare-card--api .compare-photo {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

/* Haircut result: use the same calm card rhythm as the makeup result while
   preserving the portrait proportions returned for generated hairstyles. */
.hairstyle-content--polished {
  display: flex;
  flex-direction: column;
  width: 540px;
}
.hairstyle-content--polished > .page-heading { margin-bottom: 16px; }
.hairstyle-content--polished .haircut-traits { margin-bottom: 12px; }
.hairstyle-content--polished .haircut-summary { margin-bottom: 20px; }
.hairstyle-content--polished .main-look.hair-look--source {
  margin-bottom: 24px;
  border: 1px solid rgba(60,36,17,.08);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.haircut-looks,
.haircut-tones { width: 100%; margin-bottom: 32px; }
.haircut-looks > h2,
.haircut-tones-heading > h2,
.haircut-recommendation > h2 {
  margin: 0 0 12px;
  font-family: Prata,serif;
  font-size: 22px;
  line-height: 28px;
  font-weight: 400;
}
.haircut-tones-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.haircut-tones-heading > h2 { margin: 0; }
.haircut-tones-heading > button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0 0 2px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  color: var(--main);
  background: #fff;
  font-size: 22px;
  line-height: 1;
  transition: border-color 160ms ease,background-color 160ms ease;
}
.haircut-tones-heading > button:hover,
.haircut-tones-heading > button:focus-visible { border-color: var(--accent); background: #fffaf5; }
.haircut-preview-rail { position: relative; width: 100%; overflow: hidden; }
.haircut-preview-rail::before,
.haircut-preview-rail::after { display: none; }
.hairstyle-content--polished .hair-thumbnails--supplied {
  width: 100%;
  height: 100px;
  margin: 0;
  padding: 0 !important;
  scroll-padding-inline: 0;
}
.hairstyle-content--polished .hair-thumbnails--supplied > button {
  width: 80px;
  min-width: 80px;
  max-width: 80px;
  height: 100px;
  flex: 0 0 80px;
  aspect-ratio: 4 / 5;
}
.hair-thumbnails--supplied button > .hair-preview-tone-canvas {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  pointer-events: none;
}
.hair-thumbnails--supplied button > .hair-preview-tone-canvas[hidden] { display: none; }
.hair-thumbnails--supplied button.active { position: relative; z-index: 3; }
.hair-thumbnails--supplied button.active::after {
  position: absolute;
  z-index: 4;
  inset: 0;
  border: 3px solid #e5c289;
  border-radius: inherit;
  content: "";
  pointer-events: none;
}
.hair-thumbnails--supplied button.active { border: 0 !important; }
.haircut-preview-meta {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 16px;
}
.haircut-preview-hint { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.haircut-preview-hint img { width: 21px; height: auto; }
.haircut-card-panel,
.haircut-tone-panel,
.haircut-recommendation {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: 20px;
  background: #fff;
}
.haircut-card-panel {
  height: auto;
  min-height: 0;
}
.haircut-card-panel .look-name {
  margin: 0 0 16px;
  color: var(--accent);
  text-align: left;
  font-family: Prata,serif;
  font-size: 18px;
  line-height: 24px;
  font-weight: 400;
}
.haircut-card-panel .look-facts {
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  margin: 0;
}
.haircut-card-panel .look-facts > span {
  grid-template-columns: 24px minmax(0,1fr);
  align-items: start;
  gap: 8px;
  min-width: 0;
}
.haircut-card-panel .look-facts > span > img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.haircut-card-panel .look-facts > span > span { gap: 4px; min-width: 0; }
.haircut-card-panel .look-facts b {
  color: var(--muted);
  font-size: 10px;
  line-height: 14px;
  font-weight: 400;
}
.haircut-card-panel .look-facts [data-hair-fact] {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 12px;
  line-height: 17px;
  font-weight: 600;
}
.haircut-card-panel .hair-fact-note {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 10px;
  line-height: 15px;
  font-weight: 400;
}
.haircut-card-panel .hair-fact-note[hidden] { display: none; }
.haircut-card-panel .hair-why {
  width: 100%;
  margin: 16px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--stroke);
  text-align: left;
  font-size: 12px;
  line-height: 18px;
}
.haircut-tone-panel .segmented { width: 100%; }
.haircut-tone-panel .hair-tone-rail::before {
  background: linear-gradient(90deg,#fff 6%,rgba(255,255,255,0));
}
.haircut-tone-panel .hair-tone-rail::after {
  background: linear-gradient(270deg,#fff 6%,rgba(255,255,255,0));
}
.haircut-tone-panel .hair-tone-feedback { margin-bottom: 0; }
.haircut-tone-workspace { position: relative; width: 100%; }
.haircut-recommendation { margin: 0 0 32px; background: rgba(255,255,255,.78); }
.haircut-recommendation > h2 { margin-bottom: 8px; font-size: 18px; line-height: 24px; }
.haircut-recommendation .result-note {
  margin: 0;
  color: var(--muted);
  text-align: left;
  font-size: 12px;
  line-height: 18px;
}
.hairstyle-content--polished > .primary-button { width: 100%; min-height: 56px; }

@media (max-width: 700px) {
  .hairstyle-content--polished {
    width: 362px;
    max-width: 100%;
    padding-top: 24px;
  }
  .hairstyle-content--polished > .page-heading { margin-bottom: 16px; }
  .hairstyle-content--polished .page-heading h1 { text-align: left; }
  .hairstyle-content--polished .haircut-traits { justify-content: flex-start; }
  .hairstyle-content--polished .haircut-summary {
    margin-bottom: 20px;
    text-align: left;
    font-size: 13px;
    line-height: 19px;
  }
  .hairstyle-content--polished .main-look.hair-look--source {
    width: min(70%, 254px);
    margin-bottom: 24px;
    border-radius: 18px;
  }
  .haircut-looks,
  .haircut-tones { margin-bottom: 24px; }
  .haircut-looks > h2,
  .haircut-tones > h2,
  .haircut-recommendation > h2 { font-size: 20px; line-height: 25px; }
  .haircut-card-panel,
  .haircut-tone-panel,
  .haircut-recommendation { padding: 16px; border-radius: 16px; }
  .haircut-card-panel .look-facts { gap: 16px 12px; }
  .haircut-card-panel .look-facts > span { grid-template-columns: 24px minmax(0,1fr); gap: 8px; }
  .haircut-card-panel .look-facts > span > img { width: 21px; height: 21px; }
  .haircut-recommendation { margin-bottom: 24px; }
  .haircut-recommendation > h2 { font-size: 18px; line-height: 24px; }
}

@media (prefers-reduced-motion: no-preference) {
  #app.route-enter .hairstyle-content--polished .haircut-looks,
  #app.route-enter .hairstyle-content--polished .haircut-tones,
  #app.route-enter .hairstyle-content--polished .haircut-recommendation {
    animation: softRise 420ms cubic-bezier(.22,1,.36,1) both;
  }
  #app.route-enter .hairstyle-content--polished .haircut-tones { animation-delay: 55ms; }
  #app.route-enter .hairstyle-content--polished .haircut-recommendation { animation-delay: 110ms; }
}

/* Profile hover polish: rows occupy the complete card, while elevation belongs
   to the outer surface so it cannot be clipped by the rounded container. */
.profile-page .profile-menu,
.profile-desktop-content .profile-menu,
.profile-desktop-content .profile-menu--single {
  padding: 0;
  transition: transform var(--motion-fast) var(--motion-ease-out),
    border-color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
}
.profile-menu .profile-menu-row,
.profile-desktop-content .profile-menu .profile-menu-row {
  position: relative;
  min-height: 62px;
  padding: 11px 16px;
  border-bottom: 0;
  background: transparent;
}
.profile-menu .profile-menu-row:not(:last-child)::after {
  position: absolute;
  right: 16px;
  bottom: 0;
  left: 16px;
  height: 1px;
  background: var(--stroke);
  content: "";
  pointer-events: none;
}
.profile-page .profile-menu--single .profile-menu-row,
.profile-desktop-content .profile-menu--single .profile-menu-row {
  min-height: 54px;
  padding-block: 8px;
}
.profile-menu .profile-menu-row:focus-visible {
  z-index: 1;
  outline: 2px solid rgba(194,128,52,.46);
  outline-offset: -3px;
  background: #fffaf5;
}
.profile-menu .profile-menu-row:active {
  transform: none;
  background: rgba(229,194,137,.2);
}
.profile-logout {
  transition: transform var(--motion-fast) var(--motion-ease-out),
    border-color var(--motion-fast) ease,
    background-color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
}
.profile-logout:focus-visible {
  outline: 2px solid rgba(194,128,52,.46);
  outline-offset: 2px;
  box-shadow: 0 10px 26px rgba(60,36,17,.09);
}

.profile-menu .profile-menu-row:hover {
  transform: none;
  background: #fffaf5;
  box-shadow: none;
}
.profile-menu:has(.profile-menu-row:hover),
.profile-menu:has(.profile-menu-row:focus-visible),
.profile-logout:hover {
  transform: none;
  border-color: rgba(194,128,52,.38);
  box-shadow: 0 10px 26px rgba(60,36,17,.11);
}
.profile-logout:hover { background: #fffaf5; }

/* Compact the body-parameter rhythm and give the height glyph equal visual
   weight to the five enlarged measurement icons. */
.profile-details-list > div {
  min-height: 48px;
  padding-block: 4px;
  row-gap: 0;
}
.profile-details-list dt img[src*="editprofile-frame7.svg"] { transform: scale(1.25); }

/* Desktop WOW result: the heading sits outside the portrait and the generated
   composition fills the whole card without a blank header strip. */
@media (min-width: 701px) {
  .page[data-page="result-wow"] .wow-content {
    --wow-card-height: clamp(420px, calc(100dvh - 300px), 650px);
    display: flex;
    flex-direction: column;
    width: min(520px, calc(var(--wow-card-height) * .8), calc(100vw - 128px));
    padding-top: clamp(8px, 2dvh, 20px);
  }
  .page[data-page="result-wow"] .wow-external-title {
    display: block;
    margin: 0 0 16px;
    color: var(--main);
    text-align: center;
    text-wrap: balance;
    font-family: Prata,serif;
    font-size: 32px;
    line-height: 38px;
    font-weight: 400;
  }
  .page[data-page="result-wow"] .wow-card {
    width: 100%;
    height: var(--wow-card-height);
    flex: 0 0 var(--wow-card-height);
    border-radius: 24px;
    background: #f7eee4;
    box-shadow: 0 0 16px rgba(60,36,17,.16);
  }
  .page[data-page="result-wow"] .wow-base {
    inset: 0;
    width: 100%;
    height: 100%;
  }
  .page[data-page="result-wow"] .wow-subject-frame {
    inset: 0;
  }
  .page[data-page="result-wow"] .wow-subject {
    top: 0;
    left: -16.852%;
    width: 123.889%;
    height: auto;
    max-width: none;
  }
  .page[data-page="result-wow"] .wow-card h1 {
    display: none;
  }
  .page[data-page="result-wow"] .wow-card .zoom-button {
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 2px 8px rgba(60,36,17,.14);
    backdrop-filter: blur(4px);
  }
  .page[data-page="result-wow"] .wow-card .zoom-button img {
    width: 24px !important;
    height: 24px !important;
  }
  .page[data-page="result-wow"] .wow-result-actions {
    gap: 12px;
    margin-top: 16px;
  }
  .page[data-page="result-wow"] .wow-secondary-actions { gap: 12px; }
  .page[data-page="result-wow"] .wow-secondary-actions > .secondary-button {
    min-height: 50px;
    border-width: 1px;
  }
  .page[data-page="result-wow"] .wow-result-actions > .primary-button {
    min-height: 56px;
    border-radius: 20px;
    font-size: 16px;
  }
}

/* Long hairstyle copy uses the full card width instead of being squeezed into
   the right column and is labelled honestly when it comes from description. */
.haircut-preview-rail { margin-bottom: 0; }
.haircut-card-panel .look-facts > [data-hair-styling-fallback="true"] {
  grid-column: 1 / -1;
  padding-top: 16px;
  border-top: 1px solid var(--stroke);
}

/* Removing the instructional carousel captions leaves one intentional gap
   between the tabs and the selected makeup details. */
.makeup-card-rail { margin-bottom: 12px; }

.analysis-ready-card .recovery-back-button {
  width: 100%;
  min-height: 52px;
  margin-top: 10px;
}

/* A compact, proportional desktop comparison: title and action no longer sit
   over the portrait, and ultrawide monitors cannot inflate it to 960px. */
@media (min-width: 701px) {
  .page[data-page="before-after"] { align-items: flex-start; overflow: hidden; }
  .page[data-page="before-after"] .before-after-content:not(.before-after-content--empty) {
    --compare-card-height: clamp(420px, calc(100dvh - 250px), 620px);
    display: flex;
    flex-direction: column;
    width: min(500px, calc(var(--compare-card-height) * .8), calc(100vw - 128px));
    height: auto;
    min-height: 0;
    aspect-ratio: auto;
    margin-top: clamp(8px, 2dvh, 20px);
    padding: 0;
    transform: none;
  }
  .page[data-page="before-after"] .before-after-content:not(.before-after-content--empty) > .page-heading {
    position: static;
    width: 100%;
    margin: 0 0 16px;
  }
  .page[data-page="before-after"] .before-after-content:not(.before-after-content--empty) .page-heading h1 {
    font-size: 32px;
    line-height: 38px;
  }
  .page[data-page="before-after"] .before-after-content:not(.before-after-content--empty) .compare-card {
    position: relative;
    inset: auto;
    width: 100%;
    height: var(--compare-card-height);
    flex: 0 0 var(--compare-card-height);
    border-radius: 24px;
  }
  .page[data-page="before-after"] .before-after-content:not(.before-after-content--empty) > .primary-button {
    position: static;
    width: 100%;
    height: 56px;
    margin: 16px 0 0;
    border-radius: 20px;
    font-size: 16px;
  }
}

@media (max-width: 700px) {
  .page[data-page="result-wow"] .wow-card .zoom-button {
    background: rgba(255,255,255,.92);
    box-shadow: 0 2px 8px rgba(60,36,17,.14);
    backdrop-filter: blur(4px);
  }
  .haircut-preview-rail { margin-bottom: 0; }
}

/* Client corrections: both final-result headings use the same quiet white
   surface, and the comparison keeps both final actions together. */
.page[data-page="result-wow"] .wow-external-heading h1,
.page[data-page="result-wow"] .wow-card > h1,
.page[data-page="before-after"] .page-heading h1 {
  padding: 10px;
  border-radius: 30px;
  background: #fff;
}
.before-after-actions {
  display: grid;
  gap: 10px;
  width: 500px;
  margin: 24px auto 0;
}
.before-after-actions > .primary-button,
.before-after-actions > .secondary-button { width: 100%; min-height: 56px; }

@media (min-width: 701px) {
  .page[data-page="before-after"] .before-after-content:not(.before-after-content--empty) {
    --compare-card-height: clamp(420px, calc(100dvh - 320px), 590px);
  }
  .page[data-page="before-after"] .before-after-content:not(.before-after-content--empty) > .before-after-actions {
    position: static;
    width: 100%;
    margin: 16px 0 0;
  }
}

@media (max-width: 700px) {
  .page[data-page="result-wow"] .wow-card > h1 {
    right: 20px;
    left: 20px;
  }
  .page[data-page="before-after"] .before-after-content:not(.before-after-content--empty) > .before-after-actions {
    position: absolute;
    z-index: 6;
    right: 20px;
    bottom: 24px;
    left: 20px;
    width: auto;
    margin: 0;
  }
}

/* Keep the accepted-photo state and its CTA in the first Telegram/iPhone
   viewport. The empty picker retains the roomier Figma composition. */
@media (max-width: 700px) {
  .upload-content--loaded { padding-top: 12px; }
  .upload-content--loaded .page-heading { margin-bottom: 12px; }
  .upload-content--loaded .upload-card.is-loaded {
    height: 220px;
    min-height: 220px;
    padding: 12px;
  }
  .upload-content--loaded .photo-check {
    width: 188px;
    height: 188px;
    flex-basis: 188px;
  }
  .upload-content--loaded .guidelines {
    gap: 4px;
    padding: 12px 0;
  }
  .upload-content--loaded .guidelines > div {
    min-height: 36px;
    gap: 8px;
    padding: 6px 12px;
  }
  .upload-content--loaded .privacy-note {
    margin-top: 6px;
    font-size: 9px;
    line-height: 12px;
  }
}

/* Before/after result: use the same measured content rhythm as the haircut
   and makeup result pages. The client-approved white title surface remains,
   while the comparison and actions participate in normal document flow. */
.page[data-page="before-after"] {
  align-items: flex-start;
  height: auto;
  min-height: calc(100dvh - 56px);
  overflow: visible;
}
.page[data-page="before-after"] .before-after-content--polished {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 540px;
  max-width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: auto;
  margin: 0;
  padding: 42px 0 48px;
  transform: none;
}
.page[data-page="before-after"] .before-after-content--polished > .page-heading {
  position: static;
  width: min(100%, 420px);
  margin: 0 0 16px;
}
.page[data-page="before-after"] .before-after-content--polished .page-heading h1 {
  box-sizing: border-box;
  width: 100%;
  font-size: 32px;
  line-height: 38px;
}
.page[data-page="before-after"] .before-after-content--polished > .compare-card.compare-card--api {
  position: relative;
  inset: auto;
  width: min(100%, 420px);
  height: auto;
  flex: 0 0 auto;
  aspect-ratio: 784 / 1203;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(60,36,17,.08);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}
.page[data-page="before-after"] .compare-card.compare-card--api .compare-photo {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transform: none;
}
.page[data-page="before-after"] .compare-card.compare-card--api .compare-divider {
  top: 0;
  bottom: 0;
}
.page[data-page="before-after"] .before-after-content.before-after-content--polished > .before-after-actions {
  position: static;
  display: grid;
  gap: 10px;
  width: min(100%, 420px);
  margin: 16px 0 0;
}
.page[data-page="before-after"] .before-after-content--polished .before-after-actions > .primary-button,
.page[data-page="before-after"] .before-after-content--polished .before-after-actions > .secondary-button {
  width: 100%;
  min-height: 56px;
  margin: 0;
  border-radius: 20px;
  font-size: 16px;
}

@media (max-width: 700px) {
  .page[data-page="before-after"] {
    min-height: calc(100dvh - 48px);
    padding-right: max(20px, env(safe-area-inset-right));
    padding-left: max(20px, env(safe-area-inset-left));
  }
  .page[data-page="before-after"] .before-after-content--polished {
    width: 362px;
    padding: 24px 0 max(24px, env(safe-area-inset-bottom));
  }
  .page[data-page="before-after"] .before-after-content--polished > .page-heading {
    width: 100%;
    margin-bottom: 14px;
  }
  .page[data-page="before-after"] .before-after-content--polished > .compare-card.compare-card--api {
    width: 100%;
    border-radius: 18px;
  }
  .page[data-page="before-after"] .before-after-content.before-after-content--polished > .before-after-actions {
    width: 100%;
    margin-top: 16px;
  }
}

/* Analysis questionnaire — Figma 306:3239 through 306:3513. */
.checkout-analysis-orb .analysis-orb { margin: 0; }
body[data-route="analysis"] .page:has(.analysis-content--guided) { align-items: flex-start; }
.analysis-content.analysis-content--guided { width: 540px; min-height: 0; padding-top: 48px; }
.analysis-content--guided .page-heading { margin-bottom: 24px; }
.analysis-content--guided .page-heading h1 { font-size: 32px; line-height: 32px; }
.analysis-content--guided .analysis-helper { margin: 0 0 8px; }
.analysis-content--guided .question-card { padding: 12px; border-radius: 16px; }
.analysis-content--guided .question-count { margin: 0 0 4px; color: var(--accent); font-size: 11px; line-height: 16px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.analysis-content--guided .question-card h2 { margin-bottom: 10px; font-size: 16px; line-height: 20px; text-align: left; }
.analysis-content--guided .answer-list { gap: 7px; }
.analysis-content--guided .answer-list:not(.answer-list--visual) .answer { min-height: 34px; padding: 5px 6px; gap: 0; font-size: 14px; line-height: 18px; }
.analysis-content--guided .answer-list--visual { gap: 8px; }
.analysis-content--guided .answer-list--visual .answer { font-size: 12px; line-height: 16px; }
.analysis-content--guided .answer-caption { padding: 8px 4px 10px; }
.analysis-content--guided .answer-description { font-size: 10px; line-height: 14px; }
.analysis-content--guided .question-card .primary-button { min-height: 40px; margin-top: 10px; border-radius: 12px; }
.analysis-content--guided .analysis-live-meta { margin-bottom: 12px; }

@media (max-width: 700px) {
  body[data-route="analysis"] .page:has(.analysis-content--guided) { min-height: calc(100dvh - 48px); padding-top: 0; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .analysis-content.analysis-content--guided { width: 100%; padding-top: 24px; }
  .analysis-content--guided .page-heading { margin-bottom: 16px; }
  .analysis-content--guided .analysis-orb { margin-bottom: 16px; }
  .analysis-content--guided .analysis-statuses { margin-bottom: 16px; }
}
