@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400;1,700&family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300;1,400&family=Montserrat:wght@300;400;500;600&family=Outfit:wght@500;600;700&display=swap');

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

html, body {
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
}

#lux-root {
  font-family: 'Montserrat', sans-serif;
  background: #fff;
  overflow: hidden;
  width: 100%;
  min-height: 100dvh;
  position: relative;
}

#lux-root:has(.page.active) {
  min-height: 100dvh;
  height: auto;
}

/* Results / soap match: allow scroll so content isn't clipped */
#lux-root:has(#page3.active),
#lux-root:has(#page4.active) {
  overflow-x: hidden;
  overflow-y: auto;
}

.page { display: none; width: 100%; min-height: 100dvh; position: relative; }
.page.active { display: flex; flex-direction: column; }

/* ===== PAGE 1 ===== */
#page1 {
  background: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 20%, #e8d5f5 50%, #b3d4f7 80%, #e1f0ff 100%);
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
}

.p1-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.p1-stars span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 4px 1px rgba(255, 255, 255, 0.9),
    0 0 10px 3px rgba(255, 182, 201, 0.55),
    0 0 18px 6px rgba(206, 147, 216, 0.28);
  animation: p1StarTwinkle var(--t) ease-in-out var(--d) infinite;
  opacity: 0.55;
}

.p1-stars span:nth-child(3n) {
  background: #fff8fb;
  box-shadow:
    0 0 5px 1px rgba(255, 255, 255, 0.95),
    0 0 12px 4px rgba(244, 143, 177, 0.5),
    0 0 20px 7px rgba(179, 212, 247, 0.25);
}

.p1-stars span:nth-child(4n) {
  width: calc(var(--s) + 1px);
  height: calc(var(--s) + 1px);
}

@keyframes p1StarTwinkle {
  0%, 100% {
    opacity: 0.25;
    transform: scale(0.85);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.15);
  }
}

@media (prefers-reduced-motion: reduce) {
  .p1-stars span {
    animation: none;
    opacity: 0.45;
  }
}

#page1 .p1-top-bar,
#page1 .p1-hero {
  position: relative;
  z-index: 1;
}

#page1 .floral-tl,
#page1 .floral-br {
  z-index: 1;
}

.p1-top-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px 8px;
}

.lux-logo {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: #9c6d2e;
  letter-spacing: 4px;
}

/* Home: LUX logo soft fade in / fade out */
#page1 .lux-logo {
  animation: luxLogoFade 2.8s ease-in-out infinite;
}

@keyframes luxLogoFade {
  0%, 100% {
    opacity: 0.28;
  }
  50% {
    opacity: 1;
  }
}

.p1-tagline-top {
  font-size: 9px;
  letter-spacing: 3px;
  color: #a87aad;
  text-transform: uppercase;
  font-weight: 500;
}

.p1-hero {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px 8px;
  flex: 1 1 auto;
}

.p1-headline {
  text-align: center;
  margin-bottom: 18px;
}

.p1-headline .introducing {
  font-size: 13px;
  letter-spacing: 3.5px;
  color: #a87aad;
  text-transform: uppercase;
  margin-bottom: 10px;
  font-weight: 500;
}

.p1-headline h1 {
  font-family: 'Playfair Display', serif;
  font-size: 40px;
  font-weight: 700;
  color: #3d1c5e;
  line-height: 1.12;
}

.p1-headline h1 em,
.p1-headline .p1-word-lux {
  font-style: italic;
  color: #c2185b;
  display: inline-block;
}

.p1-headline .p1-word {
  display: inline-block;
  margin-right: 0.28em;
}

.p1-headline .p1-word:last-child {
  margin-right: 0;
}

.p1-headline .sub {
  font-size: 13px;
  color: #7b5e7b;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-top: 10px;
}

@keyframes p1WordIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes p1LuxFocus {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Landing: word-by-word headline, then content, tagline, button last */
#page1.is-revealing .p1-top-bar .lux-logo {
  animation:
    p4RiseIn 0.38s ease-out both,
    luxLogoFade 2.8s ease-in-out 0.4s infinite;
}

#page1.is-revealing .p1-headline .introducing {
  animation: p4RiseIn 0.38s ease-out 0.06s both;
}

#page1.is-revealing .p1-title-words .p1-word:nth-child(1) {
  animation: p1WordIn 0.4s ease-out 0.14s both;
}

#page1.is-revealing .p1-title-words .p1-word:nth-child(2) {
  animation: p1LuxFocus 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.28s both;
}

#page1.is-revealing .p1-title-words .p1-word:nth-child(4) {
  animation: p1WordIn 0.4s ease-out 0.42s both;
}

#page1.is-revealing .p1-title-words .p1-word:nth-child(5) {
  animation: p1WordIn 0.4s ease-out 0.56s both;
}

#page1.is-revealing .p1-title-words .p1-word:nth-child(6) {
  animation: p1WordIn 0.4s ease-out 0.7s both;
}

#page1.is-revealing .p1-headline .sub {
  animation: p4RiseIn 0.4s ease-out 0.84s both;
}

#page1.is-revealing .benefit-pill:nth-child(1) {
  animation: p4RiseIn 0.4s ease-out 0.96s both;
}

#page1.is-revealing .benefit-pill:nth-child(2) {
  animation: p4RiseIn 0.4s ease-out 1.08s both;
}

#page1.is-revealing .benefit-pill:nth-child(3) {
  animation: p4RiseIn 0.4s ease-out 1.2s both;
}

#page1.is-revealing .p1-quote {
  animation: p4RiseIn 0.4s ease-out 1.32s both;
}

#page1.is-revealing .p1-bottom-tagline {
  animation: p4RiseIn 0.4s ease-out 1.44s both;
}

#page1.is-revealing .p1-cta-wrap {
  animation: p4RiseIn 0.42s ease-out 1.58s both;
}

@media (prefers-reduced-motion: reduce) {
  #page1 .lux-logo,
  #page1.is-revealing .p1-top-bar .lux-logo,
  #page1.is-revealing .p1-headline .introducing,
  #page1.is-revealing .p1-title-words .p1-word,
  #page1.is-revealing .p1-headline .sub,
  #page1.is-revealing .benefit-pill,
  #page1.is-revealing .p1-quote,
  #page1.is-revealing .p1-bottom-tagline,
  #page1.is-revealing .p1-cta-wrap {
    animation: none !important;
  }

  #page1 .lux-logo {
    opacity: 1;
  }
}

.soaps-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  margin: 8px 0;
  justify-content: center;
}

.soap-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 150px;
  position: relative;
}

.soap-box {
  width: 120px;
  height: 82px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  position: relative;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  overflow: hidden;
}

.soap-box::before {
  content: '';
  position: absolute;
  top: -10px; right: -10px;
  width: 60px; height: 60px;
  border-radius: 50%;
  opacity: 0.25;
}

.soap-box.pink { background: linear-gradient(135deg, #f8bbd0, #f48fb1); }
.soap-box.pink::before { background: #e91e63; }
.soap-box.blue { background: linear-gradient(135deg, #bbdefb, #90caf9); }
.soap-box.blue::before { background: #1976d2; }

.soap-label-top {
  font-size: 6.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
  color: #7b3f6e;
  margin-bottom: 1px;
}

.soap-lux {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  color: #9c6d2e;
  letter-spacing: 2px;
  line-height: 1;
}

.soap-variant {
  font-size: 7px;
  font-weight: 600;
  color: #4a1628;
  text-align: center;
  line-height: 1.3;
  margin-top: 2px;
}

.soap-variant.blue-text { color: #0d2d5e; }

.soap-ingredients {
  font-size: 6px;
  color: rgba(74,22,40,0.7);
  text-align: center;
  margin-top: 2px;
}

.soap-ingredients.blue-text { color: rgba(13,45,94,0.7); }

.soap-name {
  font-size: 12px;
  font-weight: 600;
  color: #3d1c5e;
  letter-spacing: 0.5px;
  margin-top: 6px;
  text-align: center;
  text-transform: uppercase;
}

.soap-desc {
  font-size: 8px;
  color: #7b5e7b;
  text-align: center;
  margin-top: 2px;
  line-height: 1.4;
}

.new-badge {
  position: absolute;
  top: -6px;
  left: -6px;
  background: #f9a825;
  color: #fff;
  font-size: 7px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 10px;
  letter-spacing: 1px;
  box-shadow: 0 2px 6px rgba(249,168,37,0.4);
}

.glutathione-tag {
  background: rgba(255,255,255,0.85);
  border-radius: 20px;
  padding: 4px 8px;
  font-size: 8px;
  font-weight: 600;
  color: #9c6d2e;
  letter-spacing: 0.5px;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.p1-benefits {
  display: flex;
  gap: 14px;
  margin: 18px 0 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.benefit-pill {
  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(194,24,91,0.2);
  border-radius: 24px;
  padding: 12px 18px;
  font-size: 13px;
  color: #6a1b4d;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.p1-quote {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-style: italic;
  color: #5d2868;
  text-align: center;
  margin: 12px 0 18px;
  opacity: 0.85;
  min-height: 2.4em;
  max-width: 34em;
  padding: 0 12px;
  box-sizing: border-box;
}

.p1-quote-text {
  white-space: pre-wrap;
}

.p1-quote-cursor {
  display: inline-block;
  width: 0.55ch;
  margin-left: 1px;
  color: #c2185b;
  animation: p1QuoteCursorBlink 0.85s step-end infinite;
}

.p1-quote-cursor::before {
  content: '|';
}

.p1-quote.is-holding .p1-quote-cursor {
  opacity: 0.55;
}

@keyframes p1QuoteCursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .p1-quote-cursor {
    animation: none;
    opacity: 0.7;
  }

  .btn-start::after,
  .shiny-cta::after {
    animation: none !important;
    opacity: 0;
  }
}

@property --gradient-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@property --gradient-angle-offset {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@property --gradient-percent {
  syntax: "<percentage>";
  initial-value: 18%;
  inherits: false;
}

@property --gradient-shine {
  syntax: "<color>";
  initial-value: #ffffff;
  inherits: false;
}

.btn-start,
.shiny-cta {
  --shiny-cta-fg: #ffffff;

  position: relative;
  overflow: hidden;
  cursor: pointer;
  outline-offset: 4px;
  padding: 16px 48px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-radius: 360px;
  color: var(--shiny-cta-fg);
  background: linear-gradient(145deg, #e91e63 0%, #c2185b 55%, #ad1457 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.22),
    0 8px 24px rgba(233, 30, 99, 0.38);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 18px;
  appearance: none;
  -webkit-appearance: none;
}

.btn-start:active,
.shiny-cta:active {
  transform: translateY(1px);
}

/* Soft static edge highlight (no continuous conic repaint) */
.btn-start::before,
.shiny-cta::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  z-index: 0;
}

/* Diagonal white shine in button background — GPU transform only */
.btn-start::after,
.shiny-cta::after {
  content: "";
  pointer-events: none;
  position: absolute;
  top: -40%;
  bottom: -40%;
  left: 0;
  width: 42%;
  z-index: 0;
  background: linear-gradient(
    115deg,
    transparent 0%,
    rgba(255, 255, 255, 0) 30%,
    rgba(255, 255, 255, 0.5) 50%,
    rgba(255, 255, 255, 0) 70%,
    transparent 100%
  );
  transform: translate3d(280%, 0, 0) skewX(-20deg);
  animation: btnBgShine 2.2s linear infinite;
  will-change: transform;
}

@keyframes btnBgShine {
  from {
    transform: translate3d(280%, 0, 0) skewX(-20deg);
  }
  to {
    transform: translate3d(-280%, 0, 0) skewX(-20deg);
  }
}

.p1-cta-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}

.btn-start span,
.shiny-cta span {
  position: relative;
  z-index: 1;
}

.btn-start span::before,
.shiny-cta span::before {
  content: none;
  display: none;
}

.btn-start:is(:hover, :focus-visible),
.shiny-cta:is(:hover, :focus-visible) {
  transform: translateY(-3px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 209, 224, 0.45),
    0 12px 28px rgba(233, 30, 99, 0.45);
}

@keyframes gradient-angle {
  to {
    --gradient-angle: 360deg;
  }
}

@keyframes btnShinePulse {
  0%, 100% {
    --gradient-percent: 10%;
    --gradient-angle-offset: 0deg;
  }
  50% {
    --gradient-percent: 16%;
    --gradient-angle-offset: 40deg;
  }
}

.p1-bottom-tagline {
  font-size: 13px;
  letter-spacing: 4px;
  color: #c15acc;
  text-transform: uppercase;
  margin-top: 4px;
  margin-bottom: 12px;
}

/* floral decoration */
.floral-tl, .floral-br {
  position: absolute;
  pointer-events: none;
  opacity: 0.55;
}
.floral-tl { top: 0; left: 0; width: 90px; }
.floral-br { bottom: 0; right: 0; width: 100px; transform: rotate(180deg); }

/* ===== PAGE 2 ===== */
#page2 {
  background: linear-gradient(160deg, #fce4ec 0%, #f3e5f5 40%, #e8eaf6 80%, #e3f2fd 100%);
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

.p2-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px 10px;
}

.p2-lux { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 700; color: #9c6d2e; letter-spacing: 3px; }

.p2-step-label { font-size: 9px; letter-spacing: 2px; color: #a87aad; text-transform: uppercase; }

.p2-body {
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px 16px;
}

.p2-title {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 700;
  color: #3d1c5e;
  text-align: center;
  line-height: 1.2;
  margin-bottom: 6px;
}

.p2-title em { font-style: italic; color: #c2185b; }

.p2-subtitle {
  font-size: 13px;
  color: #7b5e7b;
  letter-spacing: 2px;
  margin-top: 10px;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 20px;
}

.upload-zone {
  width: 240px;
  height: 240px;
  border: 2px dashed rgba(194,24,91,0.35);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  overflow: hidden;
}

.upload-zone:hover { border-color: #c2185b; background: rgba(255,255,255,0.8); }

.upload-zone img#preview {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: none;
}

.upload-icon { font-size: 40px; color: #c2185b; margin-bottom: 10px; }

.upload-text { font-size: 15px; color: #3d1c5e; text-align: center; font-weight: 600; line-height: 1.4; }

.upload-hint { font-size: 12px; color: #a899a8; margin-top: 6px; text-align: center; }

input#fileInput { display: none; }

.p2-looks-section {
  width: 100%;
  margin-top: 28px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(248,187,208,0.15) 100%);
  border-radius: 20px;
  border: 1px solid rgba(194,24,91,0.15);
  backdrop-filter: blur(10px);
}

.p2-looks-title {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 700;
  color: #3d1c5e;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.p2-looks-title::before,
.p2-looks-title::after {
  content: '✦';
  color: #c2185b;
  font-size: 12px;
}

.p2-looks-grid {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}

.look-card {
  position: relative;
  width: 100px;
  height: 140px;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  border: 2.5px solid rgba(194,24,91,0.3);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 24px rgba(194,24,91,0.15);
  background: linear-gradient(135deg, #fce4ec, #f8bbd0);
}

.look-card:hover {
  border-color: #c2185b;
  box-shadow: 0 12px 32px rgba(194,24,91,0.28);
  transform: translateY(-8px) scale(1.05);
}

.look-card:active {
  transform: translateY(-4px) scale(1.02);
}

.look-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.look-card:hover img {
  transform: scale(1.1);
}

.look-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(61,28,94,0.95) 0%, rgba(61,28,94,0.7) 50%, transparent 100%);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 8px 6px 6px;
  text-align: center;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.look-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #c2185b, #e91e63);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: scale(0.7);
  box-shadow: 0 4px 12px rgba(194,24,91,0.4);
}

.look-card.selected {
  border-color: #c2185b;
  box-shadow: 0 0 0 4px rgba(194,24,91,0.25), 0 12px 32px rgba(194,24,91,0.32);
  background: linear-gradient(135deg, #f8bbd0, #f48fb1);
}

.look-card.selected::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(194,24,91,0.1) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

.look-card.selected .look-check {
  opacity: 1;
  transform: scale(1);
  animation: checkPulse 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes checkPulse {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.steps-row {
  display: flex;
  gap: 0;
  align-items: center;
  margin: 14px 0;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.step-circle {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  border: 1.5px solid rgba(194,24,91,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #c2185b;
}

.step-circle.active { background: #c2185b; color: #fff; border-color: #c2185b; }
.step-circle.done { background: #9c6d2e; color: #fff; border-color: #9c6d2e; }

.step-line { width: 32px; height: 1.5px; background: rgba(194,24,91,0.2); margin-bottom: 14px; }
.step-line.done { background: #9c6d2e; }

.step-name { font-size: 7.5px; color: #7b5e7b; letter-spacing: 0.5px; font-weight: 500; }

.btn-transform {
  background: linear-gradient(135deg, #9c6d2e, #c2185b);
  color: #fff;
  border: none;
  padding: 16px 42px;
  border-radius: 30px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(156,109,46,0.35);
  transition: transform 0.15s, box-shadow 0.15s;
  margin-top: 16px;
  opacity: 0.4;
  pointer-events: none;
}

.btn-transform.enabled { opacity: 1; pointer-events: auto; }
.btn-transform.enabled:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(156,109,46,0.45); }

.p2-promise {
  font-size: 12px;
  color: #a899a8;
  margin-top: 12px;
  letter-spacing: 0.5px;
  text-align: center;
}

/* ===== PAGE 3 ===== */
#page3 {
  background: linear-gradient(155deg, #fce4ec 0%, #f3e5f5 30%, #e8eaf6 65%, #e3f2fd 100%);
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  flex-direction: column;
  height: auto;
  min-height: 100dvh;
}

#page3.has-results {
  height: auto;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: visible;
}

#page3.has-results .p3-header {
  flex: 0 0 auto;
}

#page3.has-results .p3-body {
  align-items: stretch;
  justify-content: flex-start;
  padding-top: 4px;
  padding-bottom: 28px;
  padding-left: 12px;
  padding-right: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
}

#page3.has-results .p3-frame-wrap.p3-analysis-preview {
  justify-content: flex-start;
  flex: 0 1 auto;
  height: auto;
  min-height: 0;
  max-width: 100%;
  overflow: visible;
}

.p3-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px 8px;
}

.p3-completion-badge {
  font-size: 8px;
  letter-spacing: 2.5px;
  color: #9c6d2e;
  text-transform: uppercase;
  border: 1px solid rgba(156,109,46,0.4);
  padding: 3px 10px;
  border-radius: 20px;
}

.p3-body {
  width: 100%;
  flex: 1;
  display: flex;
  gap: 20px;
  padding: 0 20px;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.p3-frame-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 900px;
  height: 100%;
}

.p3-results-row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 16px;
  width: 100%;
}

.p3-results-row .p3-frame {
  flex: 0 0 auto;
  width: min(100%, 300px);
  max-width: 300px;
  height: auto;
  min-width: 0;
}

.p3-results-row.has-both .p3-frame {
  width: min(100%, 260px);
  max-width: 260px;
}

.p3-results-row.has-both {
  flex-wrap: wrap;
}

.p3-video-error {
  width: 100%;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(194, 24, 91, 0.15);
  color: #7b5e7b;
  font-size: 11px;
  text-align: center;
}

.p3-frame {
  position: relative;
  width: min(100%, 300px);
  aspect-ratio: 9 / 16;
  height: auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(194,24,91,0.2);
  background: linear-gradient(135deg, #f8bbd0 0%, #e1bee7 50%, #bbdefb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.p3-frame img#resultImg,
.p3-frame video#resultVideo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  position: relative;
  z-index: 1;
}

.p3-frame-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(74,22,40,0.6) 100%);
  pointer-events: none;
}

.region-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.result-mesh-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.result-mesh-canvas.is-visible {
  opacity: 0.52;
}

.region-span-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.region-span {
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.region-span:focus,
.region-span:focus-visible {
  outline: none;
}

.region-callout-line {
  stroke: rgba(255, 255, 255, 0.88);
  stroke-width: 1.25;
  fill: none;
  transition: stroke 0.18s ease, stroke-width 0.18s ease, filter 0.18s ease;
}

.region-callout-pin {
  fill: #ffffff;
  stroke: rgba(255, 255, 255, 0.35);
  transition: fill 0.18s ease, r 0.18s ease, stroke 0.18s ease;
}

.region-callout-label {
  font-family: 'Outfit', 'Montserrat', sans-serif;
  font-size: clamp(15px, 3.6vw, 24px);
  font-weight: 600;
  letter-spacing: -0.3px;
  paint-order: stroke fill;
  stroke: rgba(18, 10, 22, 0.58);
  stroke-width: 3.5px;
  stroke-linejoin: round;
  transition: fill 0.18s ease, stroke 0.18s ease;
}

/* Severity stacked under/above the concern name */
.region-callout-severity {
  font-family: 'Outfit', 'Montserrat', sans-serif;
  font-size: clamp(11px, 2.4vw, 15px);
  font-weight: 600;
  letter-spacing: 0.2px;
  paint-order: stroke fill;
  stroke: rgba(18, 10, 22, 0.72);
  stroke-width: 3px;
  stroke-linejoin: round;
  transition: fill 0.18s ease, stroke 0.18s ease;
}

.region-span:hover .region-callout-line,
.region-span.is-active .region-callout-line {
  stroke: #ffd0e0;
  stroke-width: 2.35;
  filter: drop-shadow(0 0 4px rgba(194, 24, 91, 0.55));
}

.region-span:hover .region-callout-pin,
.region-span.is-active .region-callout-pin {
  fill: #ffd6e4;
  stroke: #c2185b;
}

.region-span:hover .region-callout-label,
.region-span.is-active .region-callout-label,
.region-span:hover .region-callout-severity,
.region-span.is-active .region-callout-severity {
  fill: #ffe8f0;
}

/* Callout reveal is driven in JS (line draw + letter typing) */
.region-callout.is-visible {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .region-callout-line {
    transition: none !important;
  }
}

/* Pink circular tip removed — markup kept for compatibility, never shown */
.region-tooltip,
.region-tooltip[hidden] {
  display: none !important;
}

.region-span .region-span-spot {
  fill: transparent;
  stroke: #8a8a8a;
  stroke-width: 2;
  stroke-opacity: 0.9;
  pointer-events: all;
  transition: stroke 0.15s ease, stroke-opacity 0.15s ease, stroke-width 0.15s ease;
}

.region-span:hover .region-span-spot,
.region-span.is-active .region-span-spot {
  stroke: #c2185b;
  stroke-opacity: 1;
  stroke-width: 2.4;
}

.skin-marker-hint {
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #7b5e7b;
  line-height: 1.4;
  margin: 0;
  padding: 0 4px;
}

.skin-marker-hint[hidden] {
  display: none !important;
}

.concern-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  min-height: 0;
}

.concern-chips[hidden] {
  display: none !important;
}

.concern-chip {
  appearance: none;
  border: 1px solid rgba(194, 24, 91, 0.28);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(255, 240, 246, 0.88) 100%
  );
  color: #6b2f45;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.2;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
  box-shadow: 0 1px 0 rgba(156, 109, 46, 0.08);
}

.concern-chip:hover {
  border-color: rgba(194, 24, 91, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(194, 24, 91, 0.12);
}

.concern-chip.is-active {
  border-color: #c2185b;
  background: linear-gradient(
    180deg,
    rgba(255, 236, 244, 0.98) 0%,
    rgba(255, 220, 232, 0.95) 100%
  );
  color: #8e1450;
  box-shadow:
    0 0 0 2px color-mix(in srgb, #c2185b 28%, transparent),
    0 4px 14px rgba(194, 24, 91, 0.16);
}

.concern-chip:focus-visible {
  outline: 2px solid #c2185b;
  outline-offset: 2px;
}

.condition-row {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.condition-row.is-active {
  border-color: var(--marker-color, #c2185b);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--marker-color, #c2185b) 35%, transparent);
  transform: translateY(-1px);
}

.condition-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-right: 8px;
  border-radius: 999px;
  background: #c2185b;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.condition-name-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
}

.p3-flowers-svg {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  pointer-events: none;
}

.p3-frame-label {
  position: absolute;
  bottom: 10px; left: 0; right: 0;
  text-align: center;
  color: #fff;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 14px;
}

.p3-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f8bbd0 0%, #e1bee7 50%, #bbdefb 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.p3-placeholder-icon { font-size: 40px; color: rgba(194,24,91,0.35); }

.p3-placeholder-text {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 13px;
  color: #c2185b;
  text-align: center;
  padding: 0 20px;
}

.p3-action-bar {
  display: flex;
  gap: 8px;
  margin-top: 0;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 6px 4px 10px;
  overflow: visible;
}

.btn-action {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.12s;
  border: none;
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  justify-content: center;
  white-space: nowrap;
}

.btn-action:hover { transform: translateY(-1px); }

.btn-download { background: #c2185b; color: #fff; box-shadow: 0 4px 12px rgba(194,24,91,0.35); }
.btn-share { background: rgba(255,255,255,0.8); color: #c2185b; border: 1px solid rgba(194,24,91,0.35); }
.btn-again { background: rgba(255,255,255,0.8); color: #7b5e7b; border: 1px solid rgba(123,94,123,0.3); }
.btn-soap-next {
  background: linear-gradient(135deg, #c2185b, #9c6d2e);
  color: #fff;
  box-shadow: 0 4px 14px rgba(194,24,91,0.3);
}

#btnSoapMatch {
  transform-origin: center center;
  animation: soap-match-breathe 2.2s ease-in-out infinite;
  /* Keep glow inside the padded action bar so edges aren't clipped */
  box-shadow: 0 4px 12px rgba(194, 24, 91, 0.28);
}

@keyframes soap-match-breathe {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.96);
  }
}

#btnSoapMatch[hidden],
.btn-soap-next[hidden] {
  display: none !important;
}

.p3-right {
  display: none;
}

.p3-right.p3-analysis-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 55%;
  min-width: 0;
  max-width: none;
  width: auto;
  padding: 8px 8px 20px 12px;
}

.heroine-title {
  font-family: 'Playfair Display', serif;
  font-size: 11px;
  font-weight: 400;
  color: #7b5e7b;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.heroine-main {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 700;
  font-style: italic;
  color: #c2185b;
  line-height: 1.1;
  margin-bottom: 2px;
}

.heroine-crown { font-size: 16px; vertical-align: middle; }

.heroine-sub {
  font-family: 'Cormorant Garamond', serif;
  font-size: 11px;
  color: #7b5e7b;
  margin-bottom: 12px;
}

.p3-quote-box {
  background: rgba(255,255,255,0.6);
  border-left: 3px solid #c2185b;
  padding: 10px 12px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 12px;
}

.p3-quote-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 12px;
  font-style: italic;
  color: #4a1628;
  line-height: 1.6;
}

.p3-product-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.p3-mini-soap {
  width: 40px;
  height: 28px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 8px;
  font-weight: 700;
  color: #9c6d2e;
  letter-spacing: 1px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.p3-mini-soap.pink { background: linear-gradient(135deg, #f8bbd0, #f48fb1); }
.p3-mini-soap.blue { background: linear-gradient(135deg, #bbdefb, #90caf9); }

.p3-bottom-strip {
  width: 100%;
  padding: 8px 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  border-top: 1px solid rgba(194,24,91,0.1);
}

.bottom-word {
  font-size: 8px;
  letter-spacing: 3px;
  color: #a87aad;
  text-transform: uppercase;
  font-weight: 500;
}

.bottom-dot { color: #c2185b; font-size: 10px; }

/* Scan overlay — full-page selfie + beam while API runs */
.scan-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: linear-gradient(155deg, #fce4ec 0%, #f3e5f5 40%, #e8eaf6 100%);
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}

.scan-overlay.show {
  display: flex;
}

.scan-panel {
  width: 100%;
  height: 100%;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 28px;
  box-sizing: border-box;
  overflow: hidden;
}

.scan-brand {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 700;
  color: #9c6d2e;
  letter-spacing: 4px;
  flex-shrink: 0;
}

.scan-frame {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  aspect-ratio: auto;
  max-height: none;
  border-radius: 18px;
  overflow: hidden;
  background: #1b1020;
  border: 1px solid rgba(194,24,91,0.2);
  box-shadow: 0 16px 40px rgba(61, 28, 94, 0.18);
}

.scan-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  display: block;
}

.scan-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(194,24,91,0.12) 0%,
    transparent 30%,
    transparent 70%,
    rgba(156,109,46,0.1) 100%
  );
  pointer-events: none;
}

.scan-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.35;
  pointer-events: none;
}

.scan-beam {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  top: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.2) 20%,
    #f8bbd0 45%,
    #c2185b 50%,
    #f8bbd0 55%,
    rgba(255,255,255,0.2) 80%,
    transparent 100%
  );
  box-shadow:
    0 0 12px rgba(194,24,91,0.85),
    0 0 28px rgba(248,187,208,0.55);
  pointer-events: none;
  animation: scan-beam-move 3.2s ease-in-out infinite;
}

.scan-beam::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -28px;
  height: 56px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(194,24,91,0.18) 50%,
    transparent 100%
  );
}

@keyframes scan-beam-move {
  0% { top: 0%; opacity: 0.7; }
  45% { top: 100%; opacity: 1; }
  50% { top: 100%; opacity: 0.7; }
  95% { top: 0%; opacity: 1; }
  100% { top: 0%; opacity: 0.7; }
}

.scan-label {
  font-size: 14px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #c2185b;
  font-weight: 600;
  text-align: center;
  flex-shrink: 0;
}

.scan-sublabel {
  font-size: 13px;
  color: #7b5e7b;
  text-align: center;
  margin-top: -4px;
  flex-shrink: 0;
}

@media (min-width: 641px) and (max-width: 1180px) {
  .scan-panel {
    width: 100%;
    padding: 24px 28px 32px;
  }

  .scan-brand {
    font-size: 36px;
  }

  .scan-frame {
    max-height: none;
    aspect-ratio: auto;
  }

  .scan-label {
    font-size: 16px;
    letter-spacing: 3px;
  }

  .scan-sublabel {
    font-size: 15px;
  }
}

@media (max-width: 640px) {
  .scan-panel {
    width: 100%;
    padding: 16px 16px 24px;
  }

  .scan-frame {
    max-height: none;
  }

  .scan-brand {
    font-size: 28px;
  }

  .scan-label {
    font-size: 12px;
  }

  .scan-sublabel {
    font-size: 11px;
  }
}

/* ===== RESPONSIVE / MOBILE ===== */
@media (max-width: 768px) {
  #lux-root {
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100dvh;
    -webkit-overflow-scrolling: touch;
  }

  .page {
    min-height: auto;
    overflow-x: hidden;
    overflow-y: visible;
  }

  #page1, #page2 {
    min-height: 100dvh;
    overflow-y: auto;
  }

  #page3 {
    overflow-y: auto;
  }

  .floral-tl, .floral-br {
    width: 60px;
    opacity: 0.35;
  }

  /* Page 1 */
  .p1-top-bar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px 6px;
  }

  .lux-logo { font-size: 28px; letter-spacing: 3px; }

  .p1-tagline-top { font-size: 8px; letter-spacing: 2px; }

  .p1-hero { padding: 0 16px 12px; }

  .p1-headline h1 { font-size: 24px; }

  .soaps-row {
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0;
  }

  .p1-duo-divider { display: none; }

  .soap-card { width: 130px; }

  .soap-box {
    width: 110px;
    height: 76px;
    padding: 8px;
  }

  .soap-lux { font-size: 20px; }

  .p1-benefits {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 0 8px;
  }

  .benefit-pill {
    font-size: 12px;
    padding: 8px 10px;
  }

  .p1-quote {
    font-size: 18px;
    padding: 0 12px;
    margin: 8px 0 12px;
  }

  .btn-start {
    padding: 14px 32px;
    font-size: 10px;
    letter-spacing: 2px;
    min-height: 44px;
    width: calc(100% - 32px);
    max-width: 320px;
  }

  .p1-bottom-tagline {
    font-size: 10px;
    letter-spacing: 3px;
    margin-bottom: 16px;
  }

  /* Page 2 */
  .p2-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px 8px;
  }

  .p2-header .steps-row {
    width: 100%;
    justify-content: center;
  }

  .p2-body { padding: 0 16px 20px; }

  .p2-title { font-size: 26px; }

  .p2-subtitle { font-size: 11px; }

  .upload-zone {
    width: 200px;
    height: 200px;
  }

  .upload-text { font-size: 13px; }

  .upload-hint { font-size: 11px; }

  .p2-tips-title { font-size: 10px; }

  .p2-tips-list span { font-size: 11px; padding: 6px 12px; }

  .btn-transform { font-size: 11px; padding: 14px 28px; }

  .p2-promise { font-size: 10px; }

  .p2-looks-section {
    margin-top: 20px;
    padding: 16px;
    gap: 14px;
    border-radius: 16px;
  }

  .p2-looks-title {
    font-size: 13px;
    letter-spacing: 1px;
  }

  .p2-looks-title::before,
  .p2-looks-title::after {
    font-size: 10px;
  }

  .p2-looks-grid {
    gap: 12px;
  }

  .look-card {
    width: 85px;
    height: 120px;
    border-radius: 14px;
    border-width: 2px;
    box-shadow: 0 6px 20px rgba(194,24,91,0.12);
  }

  .look-card:hover {
    transform: translateY(-6px) scale(1.04);
  }

  .look-label {
    font-size: 9px;
    padding: 7px 5px 5px;
  }

  .look-check {
    width: 26px;
    height: 26px;
    top: 6px;
    right: 6px;
  }

  .upload-zone {
    width: min(200px, 70vw);
    height: min(200px, 70vw);
  }

  .btn-transform {
    width: 100%;
    max-width: 320px;
    padding: 14px 24px;
    min-height: 44px;
    font-size: 9px;
    letter-spacing: 2px;
  }

  .p2-promise {
    font-size: 7px;
    padding: 0 8px;
    line-height: 1.6;
  }

  /* Page 3 */
  .p3-header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px 8px;
  }

  .p3-completion-badge {
    font-size: 7px;
    letter-spacing: 1.5px;
    padding: 4px 8px;
  }

  .p3-body {
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 0 16px;
    min-height: 0;
  }

  .p3-frame-wrap {
    width: 100%;
    max-width: 100%;
    height: 100%;
  }

  .p3-results-row {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .p3-results-row .p3-frame {
    width: min(78vw, 280px);
    max-width: 280px;
    flex: 0 0 auto;
    aspect-ratio: 9 / 16;
    height: auto;
  }

  .p3-results-row.has-both .p3-frame {
    width: min(72vw, 240px);
    max-width: 240px;
  }

  .p3-frame {
    width: min(78vw, 280px);
    max-width: 280px;
    aspect-ratio: 9 / 16;
    height: auto;
  }

  .p3-frame img#resultImg,
  .p3-frame video#resultVideo,
  .p3-placeholder {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
  }

  .p3-analysis-preview .p3-frame {
    flex: 1 1 0;
    min-height: 0;
    width: auto;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    aspect-ratio: 3 / 4;
    margin-inline: auto;
  }

  .p3-analysis-preview .p3-frame img#resultImg {
    object-fit: cover;
    object-position: center 35%;
  }

  .p3-right {
    display: none;
  }

  .p3-right.p3-analysis-panel {
    display: block;
    max-width: 100%;
    min-width: 0;
    padding: 0 0 24px;
  }

  .heroine-main { font-size: 28px; }

  .p3-quote-box {
    text-align: left;
    width: 100%;
  }

  .p3-product-row {
    justify-content: center;
    width: 100%;
  }

  .p3-action-bar {
    gap: 10px;
    width: 100%;
  }

  .btn-action {
    flex: 1 1 auto;
    min-width: 90px;
    justify-content: center;
    padding: 12px 14px;
    font-size: 10.5px;
    min-height: 44px;
    border-radius: 22px;
  }

  .p3-bottom-strip {
    flex-wrap: wrap;
    padding: 10px 16px 16px;
    gap: 8px;
  }

  .loading-lux { font-size: 24px; }
}

@media (max-width: 400px) {
  .lux-logo, .p2-lux { font-size: 28px; }

  .p1-headline h1 { font-size: 21px; }

  .p1-headline .introducing,
  .p1-headline .sub { font-size: 9px; }

  .soaps-row { gap: 8px; }

  .soap-card { width: calc(50% - 6px); max-width: 140px; }

  .soap-box {
    width: 100%;
    height: auto;
    min-height: 72px;
    aspect-ratio: 1.45;
  }

  .soap-name { font-size: 10px; }

  .soap-desc { font-size: 8px; }

  .benefit-pill {
    flex: 1 1 calc(50% - 8px);
    text-align: center;
    font-size: 10px;
  }

  .step-line { width: 20px; }

  .step-circle {
    width: 22px;
    height: 22px;
    font-size: 8px;
  }

  .step-name { font-size: 7px; }

  .p2-looks-section {
    margin-top: 18px;
    padding: 14px;
    gap: 12px;
  }

  .p2-looks-title {
    font-size: 12px;
    letter-spacing: 0.8px;
  }

  .p2-looks-grid {
    gap: 10px;
  }

  .look-card {
    width: 75px;
    height: 105px;
    border-radius: 12px;
  }

  .look-label {
    font-size: 8px;
    padding: 6px 4px 4px;
  }

  .look-check {
    width: 24px;
    height: 24px;
  }

  .heroine-main { font-size: 24px; }

  .p3-action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-action { width: 100%; }
}
/* ---- Skin Snapshot analysis UI ---- */
.p2-tips {
  width: 100%;
  margin-top: 22px;
  text-align: center;
}

.p2-tips-title {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #9c6d2e;
  font-weight: 600;
  margin-bottom: 10px;
}

.p2-tips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.p2-tips-list span {
  font-size: 13px;
  color: #7b5e7b;
  padding: 8px 14px;
  border-radius: 20px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(194,24,91,0.12);
}

.photo-source-row {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.btn-photo-source {
  flex: 0 0 auto;
  width: 120px;
  max-width: 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(194,24,91,0.2);
  background: rgba(255,255,255,0.75);
  color: #7b5e7b;
  border-radius: 999px;
  padding: 12px 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.btn-photo-source:hover {
  transform: translateY(-1px);
  border-color: rgba(194,24,91,0.4);
  box-shadow: 0 6px 16px rgba(194,24,91,0.12);
}

.btn-photo-camera {
  background: linear-gradient(135deg, #c2185b, #9c6d2e);
  border-color: transparent;
  color: #fff;
  width: 250px;
  max-width: 250px;
  padding: 14px 12px;
  font-size: 14px;
}

.btn-photo-upload {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 40;
  width: 78px;
  max-width: 78px;
  padding: 7px 6px;
  font-size: 10px;
  gap: 3px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 6px 18px rgba(61, 28, 94, 0.12);
}

.camera-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(155deg, #fce4ec 0%, #f3e5f5 40%, #e8eaf6 100%);
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.06);
  transform-origin: var(--camera-origin-x, 50%) var(--camera-origin-y, 72%);
  transition:
    transform 0.48s cubic-bezier(0.22, 1.15, 0.36, 1),
    opacity 0.36s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.48s linear;
  will-change: transform, opacity;
}

.camera-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
}

.camera-panel {
  width: 100%;
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
  background: transparent;
  border-radius: 0;
  border: none;
  box-shadow: none;
  padding: 16px 20px 28px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .camera-overlay {
    transition: opacity 0.2s ease, visibility 0.2s linear;
    transform: none;
  }

  .camera-overlay.show {
    transform: none;
  }
}

.camera-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.camera-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: #3d1c5e;
}

.camera-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.camera-upload {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(194,24,91,0.22);
  background: rgba(255,255,255,0.9);
  color: #7b5e7b;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(61, 28, 94, 0.1);
}

.camera-upload:hover {
  border-color: rgba(194,24,91,0.4);
  color: #c2185b;
}

.camera-close {
  border: none;
  background: rgba(255,255,255,0.85);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #7b5e7b;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(61, 28, 94, 0.1);
}

.camera-stage {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  aspect-ratio: auto;
  max-height: none;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  background: #1b1020;
  border: 1px solid rgba(194,24,91,0.15);
}

.camera-stage video,
.camera-mesh-canvas,
.camera-capture-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

.camera-stage video,
.camera-mesh-canvas {
  transform: scaleX(-1);
}

.camera-mesh-canvas {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  display: block;
  opacity: 0;
  visibility: visible;
  transition: opacity 1s ease;
}

.camera-mesh-canvas.is-revealed {
  opacity: 0.52;
}

.camera-mesh-canvas.is-hidden {
  opacity: 0 !important;
  transition: none;
}

.camera-analyze-ui {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.camera-analyze-ui.is-active {
  opacity: 1;
  visibility: visible;
}

.camera-analyze-beam {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  top: 0;
  opacity: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.2) 20%,
    #f8bbd0 45%,
    #c2185b 50%,
    #f8bbd0 55%,
    rgba(255,255,255,0.2) 80%,
    transparent 100%
  );
  box-shadow:
    0 0 12px rgba(194,24,91,0.85),
    0 0 28px rgba(248,187,208,0.55);
  transition: opacity 0.45s ease;
}

.camera-analyze-ui.is-active .camera-analyze-beam {
  opacity: 1;
  animation: scan-beam-move 2.4s ease-in-out infinite;
}

.camera-analyze-beam::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -28px;
  height: 56px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(194,24,91,0.18) 50%,
    transparent 100%
  );
}

.camera-analyze-text {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: min(92%, 420px);
  padding: 16px 22px;
  border-radius: 18px;
  background: rgba(27, 16, 32, 0.72);
  backdrop-filter: blur(10px);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(16px, 4.2vw, 22px);
  font-weight: 600;
  letter-spacing: 0.4px;
  line-height: 1.35;
  text-align: center;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.55s ease 0.35s, transform 0.55s ease 0.35s;
}

.camera-analyze-ui.is-active .camera-analyze-text {
  opacity: 1;
  transform: translateY(0);
}

.camera-face-guide {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.camera-face-guide.is-hidden {
  opacity: 0;
}

.camera-face-guide-oval {
  width: min(58%, 260px);
  aspect-ratio: 3 / 4;
  border-radius: 50%;
  border: 2px solid rgba(255, 214, 228, 0.85);
  box-shadow:
    0 0 0 1px rgba(194, 24, 91, 0.2),
    inset 0 0 24px rgba(255, 182, 201, 0.12);
  animation: faceGuidePulse 2.4s ease-in-out infinite;
}

.camera-shutter-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
}

.camera-shutter-blade {
  position: absolute;
  left: 0;
  right: 0;
  height: 52%;
  background: linear-gradient(180deg, #2a1220 0%, #1b1020 100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.camera-shutter-blade-top {
  top: 0;
  transform: translateY(-105%);
  border-bottom: 1px solid rgba(255, 182, 201, 0.25);
}

.camera-shutter-blade-bottom {
  bottom: 0;
  transform: translateY(105%);
  background: linear-gradient(0deg, #2a1220 0%, #1b1020 100%);
  border-top: 1px solid rgba(255, 182, 201, 0.25);
}

.camera-shutter-overlay.is-closing .camera-shutter-blade-top,
.camera-shutter-overlay.is-closed .camera-shutter-blade-top {
  transform: translateY(0);
}

.camera-shutter-overlay.is-closing .camera-shutter-blade-bottom,
.camera-shutter-overlay.is-closed .camera-shutter-blade-bottom {
  transform: translateY(0);
}

.camera-stage.is-capturing .btn-camera-capture {
  pointer-events: none;
}

@keyframes faceGuidePulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.72;
    box-shadow:
      0 0 0 1px rgba(194, 24, 91, 0.18),
      inset 0 0 20px rgba(255, 182, 201, 0.1);
  }
  50% {
    transform: scale(1.035);
    opacity: 1;
    box-shadow:
      0 0 0 2px rgba(255, 214, 228, 0.55),
      0 0 22px rgba(233, 30, 99, 0.28),
      inset 0 0 28px rgba(255, 182, 201, 0.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  .camera-face-guide-oval {
    animation: none;
  }

  .camera-shutter-blade {
    transition-duration: 0.01ms;
  }
}

.camera-hint {
  margin: 14px 0 12px;
  text-align: center;
  font-size: 13px;
  color: #7b5e7b;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}

.camera-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 12px;
  justify-content: center;
  align-items: stretch;
  margin-top: 0;
  width: 100%;
  max-width: 480px;
  align-self: center;
  flex-shrink: 0;
}

.camera-actions[hidden] {
  display: none !important;
}

.camera-actions .btn-photo-source {
  flex: 1 1 0;
  width: auto;
  max-width: none;
  min-width: 0;
  padding: 14px 12px;
  font-size: 14px;
}

.camera-actions .btn-photo-camera {
  width: auto;
  max-width: none;
  padding: 14px 12px;
  font-size: 14px;
}

.btn-camera-capture {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: none;
  border-radius: 999px;
  padding: 16px 36px;
  background: #c2185b;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.6px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(194,24,91,0.3);
}

.camera-shutter {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 3px rgba(194,24,91,0.35);
}

/* Tablet: landing type scale + camera panel */
@media (min-width: 641px) and (max-width: 1180px) {
  .p1-headline {
    margin-bottom: 28px;
  }

  .p1-headline .introducing {
    font-size: 16px;
    letter-spacing: 4px;
    margin-bottom: 14px;
  }

  .p1-headline h1 {
    font-size: 52px;
    line-height: 1.1;
  }

  .p1-headline .sub {
    font-size: 15px;
    letter-spacing: 3px;
    margin-top: 14px;
  }

  .p1-benefits {
    gap: 16px;
    margin: 28px 0 16px;
  }

  .benefit-pill {
    font-size: 15px;
    padding: 14px 22px;
  }

  .p1-quote {
    font-size: 30px;
    margin: 16px 0 24px;
  }

  .btn-start {
    font-size: 16px;
    padding: 18px 56px;
    letter-spacing: 3.5px;
    min-height: 56px;
  }

  .p1-bottom-tagline {
    font-size: 15px;
    letter-spacing: 5px;
    margin-top: 8px;
  }

  /* Page 2 — upload / selfie */
  .p2-title {
    font-size: 44px;
    margin-bottom: 10px;
  }

  .p2-subtitle {
    font-size: 15px;
    letter-spacing: 2.5px;
    margin-bottom: 28px;
  }

  .upload-zone {
    width: 280px;
    height: 280px;
  }

  .upload-icon {
    font-size: 48px;
  }

  .upload-text {
    font-size: 18px;
  }

  .upload-hint {
    font-size: 14px;
  }

  .btn-photo-source {
    width: 140px;
    max-width: 140px;
    font-size: 15px;
    padding: 14px 12px;
  }

  .btn-photo-camera {
    width: 160px;
    max-width: 160px;
    font-size: 16px;
    padding: 16px 14px;
  }

  .btn-photo-upload {
    width: 82px;
    max-width: 82px;
    padding: 8px 6px;
    font-size: 11px;
  }

  .p2-tips {
    margin-top: 28px;
  }

  .p2-tips-title {
    font-size: 14px;
    letter-spacing: 2.5px;
    margin-bottom: 12px;
  }

  .p2-tips-list {
    gap: 12px;
  }

  .p2-tips-list span {
    font-size: 15px;
    padding: 10px 18px;
  }

  .btn-transform {
    font-size: 15px;
    padding: 18px 48px;
    letter-spacing: 3px;
    min-height: 56px;
    margin-top: 22px;
  }

  .p2-promise {
    font-size: 14px;
    margin-top: 16px;
  }

  .camera-overlay {
    padding: 0;
  }

  .camera-panel {
    width: 100%;
    height: 100%;
    max-height: 100dvh;
    padding: 20px 28px 32px;
  }

  .camera-title {
    font-size: 26px;
  }

  .camera-stage {
    aspect-ratio: auto;
    max-height: none;
  }

  .camera-stage video,
  .camera-mesh-canvas,
  .camera-capture-preview {
    object-fit: cover;
    object-position: center 35%;
  }

  .camera-stage video,
  .camera-mesh-canvas {
    transform: scaleX(-1);
    transform-origin: center center;
  }

  .camera-hint {
    margin: 16px 0 14px;
    font-size: 15px;
  }

  .btn-camera-capture {
    font-size: 16px;
    padding: 18px 42px;
  }

  .camera-actions {
    max-width: 520px;
  }

  .camera-actions .btn-photo-source,
  .camera-actions .btn-photo-camera {
    font-size: 15px;
    padding: 16px 14px;
  }
}

@media (max-width: 768px) {
  .photo-source-row {
    flex-direction: row;
    justify-content: center;
  }

  .btn-photo-source {
    width: 88px;
    max-width: 88px;
  }

  .camera-panel {
    width: 100%;
    padding: 14px 16px 22px;
  }

  .camera-stage {
    max-height: none;
  }
}

.p3-body-analysis {
  --p3-stack-gap: 8px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  row-gap: var(--p3-stack-gap);
  overflow: visible;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 6px 8px 20px;
  box-sizing: border-box;
  flex: 1 1 auto;
  min-height: 0;
}

.p3-analysis-preview {
  width: 100%;
  max-width: none;
  flex: 0 1 auto;
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: var(--p3-stack-gap);
}

.p3-analysis-preview .p3-frame {
  /* Size to content; leave room for buttons + chips in the viewport */
  flex: 0 1 auto;
  min-height: 0;
  width: auto;
  max-width: min(100%, 400px);
  height: auto;
  max-height: calc(100dvh - 280px);
  aspect-ratio: 3 / 4;
  margin-inline: auto;
  margin-bottom: 0;
  background: #1b1020;
}

.p3-analysis-preview .p3-frame img#resultImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

.p3-analysis-preview .p3-frame-overlay {
  display: none;
}

.p3-analysis-preview .p3-action-bar {
  flex: 0 0 auto;
  margin-top: 0;
  margin-bottom: 0;
  width: fit-content;
  max-width: min(100%, 360px);
  margin-inline: auto;
  overflow: visible;
  padding: 6px 2px 10px;
}

.p3-analysis-preview .p3-action-bar .btn-action {
  flex: 0 1 auto;
  width: auto;
  max-width: none;
  min-width: 0;
}

.p3-analysis-details {
  width: 100%;
  min-width: 0;
  flex: 0 0 auto;
  flex-shrink: 0;
  max-height: none;
  overflow: visible;
  padding: 0 0 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--p3-stack-gap);
}

.p3-analysis-panel {
  width: 100%;
  min-width: 0;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.skin-type-pill {
  display: inline-block;
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #c2185b;
  border: 1px solid rgba(194,24,91,0.25);
  background: rgba(255,255,255,0.65);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.analysis-summary {
  font-size: 12px;
  line-height: 1.55;
  color: #5a4460;
  margin: 8px 0 14px;
}

.analysis-section {
  margin-bottom: 14px;
}

.analysis-section-title {
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #9c6d2e;
  font-weight: 600;
  margin-bottom: 8px;
}

.analysis-section-sub {
  font-size: 10px;
  color: #7b5e7b;
  margin: -4px 0 10px;
  line-height: 1.4;
}

.analysis-section-sub[hidden] {
  display: none !important;
}

.skin-congrats,
.skin-noface {
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(156,109,46,0.28);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-style: italic;
  color: #5d2868;
  line-height: 1.4;
  margin-bottom: 12px;
}

.skin-noface {
  border-color: rgba(140, 70, 90, 0.35);
  color: #6b2f45;
  font-style: normal;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.skin-noface-text {
  margin: 0;
}

.btn-noface-retake {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border: none;
  border-radius: 24px;
  background: linear-gradient(135deg, #c2185b, #9c6d2e);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(194, 24, 91, 0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn-noface-retake:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(194, 24, 91, 0.35);
}

.skin-congrats[hidden],
.skin-noface[hidden] {
  display: none !important;
}

.analysis-section-conditions[hidden] {
  display: none !important;
}

.analysis-section-conditions .conditions-list {
  max-height: none;
}

.analysis-wrong-list {
  margin: 0;
  padding-left: 16px;
  color: #5a4460;
  font-size: 11px;
  line-height: 1.5;
}

.analysis-wrong-list li {
  margin-bottom: 4px;
}

.conditions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.condition-row {
  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(194,24,91,0.12);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.condition-empty {
  background: rgba(255,255,255,0.65);
  border: 1px dashed rgba(194,24,91,0.2);
  border-radius: 12px;
  padding: 16px 14px;
  text-align: center;
  font-size: 13px;
  color: #7b5e7b;
  line-height: 1.45;
}

.condition-row.is-detected {
  border-color: rgba(194,24,91,0.28);
  background: rgba(255,255,255,0.85);
}

.condition-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.condition-name {
  font-size: 13px;
  font-weight: 700;
  color: #3d1c5e;
}

.condition-badge {
  font-size: 8px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(168,153,168,0.2);
  color: #7b5e7b;
  white-space: nowrap;
}

.condition-meta {
  font-size: 9px;
  color: #9a879a;
  margin-bottom: 6px;
}

.condition-row.sev-mild .condition-badge {
  background: rgba(156,109,46,0.15);
  color: #9c6d2e;
}

.condition-row.sev-moderate .condition-badge {
  background: rgba(194,24,91,0.12);
  color: #c2185b;
}

.condition-row.sev-pronounced .condition-badge {
  background: rgba(194,24,91,0.22);
  color: #880e4f;
}

.condition-bar {
  height: 5px;
  border-radius: 4px;
  background: rgba(168,153,168,0.25);
  overflow: hidden;
}

.condition-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, #f8bbd0, #c2185b);
  transition: width 0.4s ease;
}

.condition-notes {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.45;
  color: #5a4460;
}

.analysis-disclaimer {
  margin-top: 8px;
  padding: 8px 10px;
  font-size: 8px;
  line-height: 1.5;
  color: #7b5e7b;
  background: rgba(255,255,255,0.55);
  border-radius: 8px;
  border: 1px solid rgba(194,24,91,0.12);
}

.product-rec-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(194,24,91,0.12);
}

.product-rec-headline {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: #3d1c5e;
  margin-bottom: 6px;
}

.product-rec-summary {
  font-size: 11px;
  line-height: 1.5;
  color: #5a4460;
  margin-bottom: 12px;
}

.product-rec-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.product-rec-grid.is-duo {
  grid-template-columns: 1fr 1fr;
}

.product-rec-card {
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(194,24,91,0.14);
  border-radius: 14px;
  padding: 10px;
  text-align: center;
}

.product-rec-card.product-rec-blue {
  border-color: rgba(21,101,192,0.22);
}

.product-rec-badge {
  display: inline-block;
  font-size: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #c2185b;
  background: rgba(194,24,91,0.08);
  border-radius: 999px;
  padding: 3px 8px;
  margin-bottom: 8px;
}

.product-rec-blue .product-rec-badge {
  color: #1565c0;
  background: rgba(21,101,192,0.1);
}

.product-rec-image {
  width: 100%;
  max-width: 100px;
  height: auto;
  object-fit: contain;
  margin: 0 auto 8px;
  display: block;
}

.product-rec-name {
  font-size: 12px;
  font-weight: 700;
  color: #3d1c5e;
}

.product-rec-blue .product-rec-name {
  color: #1565c0;
}

.product-rec-variant {
  font-size: 9px;
  color: #7b5e7b;
  margin-top: 2px;
}

.product-rec-focus {
  font-size: 9px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #9c6d2e;
  margin: 8px 0 6px;
  font-weight: 600;
}

.product-rec-reason {
  font-size: 10px;
  line-height: 1.45;
  color: #5a4460;
}

/* Tablet + below: layout shell (phone refines further at 640) */
@media (max-width: 1366px) {
  .p3-body-analysis {
    --p3-stack-gap: 8px;
    max-width: 100%;
    padding: 4px 12px 16px;
    row-gap: var(--p3-stack-gap);
    flex: 1 1 auto;
    min-height: 0;
    overflow: visible;
  }

  #page3.has-results .p3-frame-wrap.p3-analysis-preview {
    justify-content: flex-start;
    flex: 1 1 0;
    height: auto;
    min-height: 0;
  }

  .p3-analysis-preview {
    width: 100%;
    max-width: none;
    flex: 1 1 0;
    min-height: 0;
    gap: var(--p3-stack-gap);
  }

  .p3-analysis-preview .p3-frame {
    flex: 1 1 0;
    min-height: 0;
    width: auto;
    max-width: min(100%, 420px);
    height: 100%;
    max-height: calc(100dvh - 230px);
    aspect-ratio: 3 / 4;
    margin-inline: auto;
  }

  .p3-analysis-details {
    width: 100%;
    padding: 0 0 12px;
    gap: var(--p3-stack-gap);
    flex: 0 0 auto;
    flex-shrink: 0;
    max-height: none;
  }

  #page3 .p3-action-bar .btn-action {
    padding: 11px 16px;
    font-size: 11px;
    letter-spacing: 1px;
    border-radius: 24px;
    min-height: 44px;
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
  }

  .p3-analysis-preview .p3-action-bar {
    width: fit-content;
    max-width: min(100%, 380px);
    margin-inline: auto;
    gap: 10px;
    margin-top: 0;
    padding: 4px 4px 8px;
  }

  .skin-congrats,
  .skin-noface {
    margin-top: 0;
    margin-bottom: 10px;
  }

  .btn-start {
    max-width: 320px;
    width: 100%;
  }
}

/* Tablet (incl. large Samsung tabs that report >1024px CSS width): big selfie */
@media (min-width: 641px) and (max-width: 1366px) {
  #page3.has-results {
    height: 100dvh;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  #page3.has-results .p3-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 2px 12px 10px;
    justify-content: stretch;
  }

  .p3-body-analysis {
    --p3-stack-gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    padding: 2px 10px 8px;
    row-gap: var(--p3-stack-gap);
  }

  #page3.has-results .p3-frame-wrap.p3-analysis-preview,
  .p3-analysis-preview {
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    justify-content: center;
  }

  .p3-analysis-preview .p3-frame {
    flex: 0 1 auto;
    min-height: min(560px, calc(100dvh - 190px));
    width: min(94vw, calc((100dvh - 175px) * 0.78));
    max-width: min(94vw, 620px);
    height: auto;
    max-height: calc(100dvh - 175px);
    aspect-ratio: 3 / 4;
    margin-inline: auto;
  }

  .p3-analysis-preview .p3-action-bar {
    flex: 0 0 auto;
    width: fit-content;
    max-width: min(100%, 480px);
    padding: 6px 4px 8px;
  }

  .p3-analysis-details {
    flex: 0 0 auto;
    flex-shrink: 0;
    padding: 0 0 10px;
  }
}

/* Tall tablet portrait: use even more vertical space for the selfie */
@media (min-width: 641px) and (max-width: 1366px) and (orientation: portrait) {
  .p3-analysis-preview .p3-frame {
    min-height: min(620px, calc(100dvh - 165px));
    width: min(96vw, calc((100dvh - 160px) * 0.78));
    max-width: min(96vw, 680px);
    max-height: calc(100dvh - 160px);
  }

  .region-callout-label {
    font-size: clamp(16px, 2.4vw, 22px);
  }

  .region-callout-severity {
    font-size: clamp(12px, 1.8vw, 14px);
  }
}

/* Laptop / desktop: compact action buttons, chips fully visible */
@media (min-width: 1367px) {
  .p3-analysis-preview .p3-action-bar {
    width: fit-content;
    max-width: 320px;
    margin-inline: auto;
    gap: 10px;
  }

  #page3 .p3-action-bar .btn-action {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 10px 18px;
    font-size: 10px;
  }

  .p3-analysis-preview .p3-frame {
    max-width: min(100%, 380px);
    max-height: calc(100dvh - 290px);
    height: auto;
  }

  .p3-body-analysis {
    padding-bottom: 28px;
  }

  .p3-analysis-details {
    padding-bottom: 20px;
  }
}

/* Soft Lux confetti when opening soap match */
.soap-confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  overflow: hidden;
  display: none;
}

.soap-confetti.is-active {
  display: block;
}

.soap-confetti-piece {
  position: absolute;
  top: -16px;
  left: var(--c-left, 50%);
  width: var(--c-size, 8px);
  height: calc(var(--c-size, 8px) * 0.55);
  background: var(--c-color, #c2185b);
  border-radius: 2px;
  opacity: 0;
  animation: soapConfettiFall var(--c-duration, 2s) ease-in var(--c-delay, 0s) forwards;
  will-change: transform, opacity;
}

.soap-confetti-piece.is-round {
  height: var(--c-size, 8px);
  border-radius: 50%;
}

@keyframes soapConfettiFall {
  0% {
    opacity: 0;
    transform: translate3d(0, -20px, 0) rotate(0deg);
  }
  8% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--c-drift, 0px), 110vh, 0) rotate(var(--c-rotate, 360deg));
  }
}

@media (prefers-reduced-motion: reduce) {
  .soap-confetti {
    display: none !important;
  }
}

/* ===== PAGE 4: Soap Match ===== */
#page4 {
  background: linear-gradient(155deg, #fce4ec 0%, #f3e5f5 35%, #e8eaf6 70%, #e3f2fd 100%);
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  flex-direction: column;
  height: auto;
  min-height: 100dvh;
  -webkit-overflow-scrolling: touch;
}

@keyframes p4PageIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes p4RiseIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes p4SoapFloatIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#page4.is-revealing {
  animation: p4PageIn 0.35s ease-out both;
}

#page4.is-revealing .p4-header {
  animation: p4RiseIn 0.4s ease-out both;
}

#page4.is-revealing .p4-eyebrow {
  animation: p4RiseIn 0.4s ease-out 0.08s both;
}

#page4.is-revealing .p4-title {
  animation: p4RiseIn 0.45s ease-out 0.16s both;
}

#page4.is-revealing .p4-lead {
  animation: p4RiseIn 0.45s ease-out 0.24s both;
}

#page4.is-revealing .p4-soap-card {
  animation: p4SoapFloatIn 0.52s cubic-bezier(0.22, 1, 0.36, 1) 0.34s both;
}

#page4.is-revealing .p4-soap-card:nth-child(2) {
  animation-delay: 0.44s;
}

#page4.is-revealing .p4-benefit-block {
  animation: p4RiseIn 0.45s ease-out 0.52s both;
}

#page4.is-revealing .p4-actions {
  animation: p4RiseIn 0.4s ease-out 0.6s both;
}

/* Page 3: same soft reveal when returning from soap match */
#page3.is-revealing {
  animation: p4PageIn 0.35s ease-out both;
}

#page3.is-revealing .p3-header {
  animation: p4RiseIn 0.4s ease-out both;
}

#page3.is-revealing .p3-analysis-preview .p3-frame {
  animation: p4SoapFloatIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

#page3.is-revealing .p3-action-bar {
  animation: p4RiseIn 0.4s ease-out 0.22s both;
}

#page3.is-revealing .skin-marker-hint,
#page3.is-revealing .skin-congrats,
#page3.is-revealing .skin-noface {
  animation: p4RiseIn 0.4s ease-out 0.3s both;
}

#page3.is-revealing .concern-chips {
  animation: p4RiseIn 0.4s ease-out 0.38s both;
}

#page3.is-revealing .concern-chip {
  animation: p4SoapFloatIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.42s both;
}

#page3.is-revealing .concern-chip:nth-child(2) {
  animation-delay: 0.5s;
}

#page3.is-revealing .concern-chip:nth-child(3) {
  animation-delay: 0.58s;
}

#page3.is-revealing .concern-chip:nth-child(4) {
  animation-delay: 0.66s;
}

@media (prefers-reduced-motion: reduce) {
  #page4.is-revealing,
  #page4.is-revealing .p4-header,
  #page4.is-revealing .p4-eyebrow,
  #page4.is-revealing .p4-title,
  #page4.is-revealing .p4-lead,
  #page4.is-revealing .p4-soap-card,
  #page4.is-revealing .p4-benefit-block,
  #page4.is-revealing .p4-actions,
  #page3.is-revealing,
  #page3.is-revealing .p3-header,
  #page3.is-revealing .p3-analysis-preview .p3-frame,
  #page3.is-revealing .p3-action-bar,
  #page3.is-revealing .skin-marker-hint,
  #page3.is-revealing .skin-congrats,
  #page3.is-revealing .skin-noface,
  #page3.is-revealing .concern-chips,
  #page3.is-revealing .concern-chip {
    animation: none !important;
  }
}

.p4-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px 8px;
  flex: 0 0 auto;
}

.p4-body {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 4px 20px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  flex: 0 0 auto;
  min-height: 0;
}

.p4-eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #9c6d2e;
  font-weight: 600;
  margin-bottom: 8px;
  flex: 0 0 auto;
}

.p4-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: #3d1c5e;
  text-align: center;
  line-height: 1.25;
  margin-bottom: 10px;
  flex: 0 0 auto;
  max-width: 100%;
  padding: 0 4px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.p4-lead {
  font-size: 15px;
  line-height: 1.55;
  color: #5a4460;
  text-align: center;
  max-width: 560px;
  margin-bottom: 18px;
  flex: 0 0 auto;
}

.p4-soap-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 16px;
  flex: 0 0 auto;
  min-height: 0;
  align-content: start;
  position: relative;
  z-index: 1;
}

.p4-soap-grid.is-duo {
  grid-template-columns: 1fr 1fr;
}

.p4-soap-grid.is-empty {
  align-content: center;
}

.p4-soap-empty {
  width: 100%;
  padding: 28px 20px;
  border-radius: 16px;
  border: 1px dashed rgba(156, 109, 46, 0.35);
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: #5a4460;
}

.p4-soap-card {
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(194,24,91,0.16);
  border-radius: 16px;
  padding: 18px 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  gap: 8px;
  min-height: 0;
  height: auto;
  overflow: hidden;
  box-sizing: border-box;
}

.p4-soap-card.product-rec-blue {
  border-color: rgba(21,101,192,0.22);
}

.p4-soap-card .product-rec-badge {
  font-size: 9px;
  padding: 4px 10px;
  margin-bottom: 4px;
}

.p4-soap-card .product-rec-name {
  font-size: 16px;
}

.p4-soap-card .product-rec-variant {
  font-size: 11px;
}

.p4-soap-card .product-rec-reason {
  font-size: 12px;
  line-height: 1.5;
  max-width: 36em;
}

.p4-soap-image {
  width: min(100%, 280px);
  height: auto;
  max-height: min(42dvh, 320px);
  object-fit: contain;
  margin: 8px 0 6px;
  flex: 0 0 auto;
  display: block;
  position: relative;
  z-index: 0;
}

.p4-benefit-block {
  width: 100%;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(156,109,46,0.22);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 18px;
  box-sizing: border-box;
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  isolation: isolate;
}

.p4-benefit-label {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #9c6d2e;
  font-weight: 600;
  margin-bottom: 10px;
  text-align: center;
}

.p4-benefit-text {
  font-size: 16px;
  line-height: 1.65;
  color: #4a3355;
  text-align: center;
}

.p4-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  flex: 0 0 auto;
  margin-top: 4px;
  padding-bottom: 8px;
  width: 100%;
  position: relative;
  z-index: 2;
}

.p4-actions .btn-action {
  font-size: 11px;
  padding: 12px 20px;
}

@media (min-width: 641px) and (max-width: 1180px) {
  .p4-title {
    font-size: 34px;
  }

  .p4-lead {
    font-size: 16px;
  }

  .p4-benefit-text {
    font-size: 17px;
  }

  .p4-soap-image {
    width: min(100%, 300px);
    max-height: min(44dvh, 340px);
  }
}

@media (max-width: 640px) {
  #page4 {
    height: auto;
    min-height: 100dvh;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .p4-header {
    padding: 10px 14px 4px;
  }

  .p4-soap-grid.is-duo {
    grid-template-columns: 1fr;
  }

  .p4-body {
    padding: 2px 14px 24px;
    width: 100%;
  }

  .p4-eyebrow {
    font-size: 10px;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
  }

  .p4-title {
    font-size: clamp(20px, 5.6vw, 24px);
    line-height: 1.3;
    margin-bottom: 8px;
    padding: 0 8px;
  }

  .p4-lead {
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 12px;
    max-width: 100%;
    padding: 0 4px;
  }

  .p4-soap-grid {
    margin-bottom: 12px;
  }

  .p4-soap-card {
    padding: 12px 12px 14px;
    gap: 4px;
    border-radius: 14px;
  }

  .p4-soap-card .product-rec-badge {
    font-size: 8px;
    padding: 3px 8px;
    margin-bottom: 2px;
  }

  .p4-soap-image {
    width: min(100%, 180px);
    max-height: min(28dvh, 200px);
    margin: 4px 0 2px;
  }

  .p4-soap-card .product-rec-name {
    font-size: 14px;
  }

  .p4-soap-card .product-rec-variant {
    font-size: 10px;
  }

  /* Benefit block already covers this copy — hide to avoid clutter/overlap feel */
  .p4-soap-card .product-rec-reason {
    display: none;
  }

  .p4-benefit-text {
    font-size: 14px;
    line-height: 1.55;
  }

  .p4-benefit-block {
    padding: 14px 14px;
    margin-bottom: 12px;
  }

  .p4-benefit-label {
    font-size: 10px;
    margin-bottom: 8px;
  }

  .p4-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 2px;
  }

  .p4-actions .btn-action {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    justify-content: center;
  }
}

/* Short phones: tighter soap hero so title + benefit stay readable */
@media (max-width: 640px) and (max-height: 740px) {
  .p4-lead {
    display: none;
  }

  .p4-soap-image {
    width: min(100%, 150px);
    max-height: min(22dvh, 160px);
  }

  .p4-soap-card {
    padding: 10px 10px 12px;
  }

  .p4-title {
    font-size: clamp(18px, 5.2vw, 22px);
  }
}

/* Phone: stack everything */
@media (max-width: 640px) {
  .p1-hero { padding: 0 16px 20px; }

  .soaps-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }

  .btn-start {
    width: min(100%, 280px);
    max-width: 280px;
    padding: 12px 18px;
    font-size: 11px;
  }

  .p2-body {
    padding: 0 16px 28px;
  }

  .upload-zone {
    width: min(100%, 280px);
  }

  .btn-transform {
    width: min(100%, 280px);
    max-width: 280px;
  }

  .p3-body-analysis {
    --p3-stack-gap: 8px;
    padding: 4px 10px 18px;
    row-gap: var(--p3-stack-gap);
    overflow: visible;
  }

  #page3.has-results .p3-frame-wrap.p3-analysis-preview {
    justify-content: flex-start;
    flex: 0 1 auto;
    height: auto;
    min-height: 0;
  }

  .p3-analysis-preview {
    max-width: none;
    width: 100%;
    flex: 0 1 auto;
    min-height: 0;
    gap: var(--p3-stack-gap);
  }

  .p3-analysis-preview .p3-frame {
    flex: 0 1 auto;
    min-height: 0;
    width: min(96vw, calc((100dvh - 240px) * 0.78));
    max-width: min(96vw, 420px);
    height: auto;
    max-height: calc(100dvh - 230px);
    aspect-ratio: 3 / 4;
    margin-inline: auto;
  }

  .region-callout-label {
    font-size: clamp(13px, 3.5vw, 17px);
    stroke-width: 3px;
  }

  .region-callout-severity {
    font-size: clamp(10px, 2.6vw, 12px);
    stroke-width: 2.5px;
  }

  .p3-analysis-details {
    width: 100%;
    padding: 0 0 16px;
    max-height: none;
    gap: var(--p3-stack-gap);
    flex: 0 0 auto;
    flex-shrink: 0;
  }

  .p3-analysis-preview .p3-action-bar {
    width: 100%;
    max-width: min(100%, 360px);
    margin-inline: auto;
  }

  .p3-analysis-preview .p3-action-bar .btn-action {
    flex: 1 1 auto;
    min-width: 0;
  }

  .concern-chips {
    gap: 8px;
    padding: 0 4px;
  }

  .concern-chip {
    font-size: 11px;
    padding: 8px 12px;
  }

  .product-rec-grid.is-duo {
    grid-template-columns: 1fr;
  }

  .product-rec-image {
    max-width: 100px;
  }

  .heroine-main {
    font-size: 24px;
  }

  #page3 {
    height: auto;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
  }
}

@media (max-width: 480px) {
  .p3-completion-badge {
    font-size: 7px;
    letter-spacing: 1px;
    padding: 3px 7px;
  }

  .photo-source-row {
    gap: 6px;
  }

  .btn-photo-source {
    width: 84px;
    max-width: 84px;
    font-size: 8px;
  }

  .product-rec-headline {
    font-size: 16px;
  }
}
