/* LUX brand typefaces */
@font-face {
  font-family: 'Fantasm and Secrets';
  src: url('../fonts/Fantasm%20and%20Secrets.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'GT Eesti Pro Display';
  src: url('../fonts/gteestiprodisplay_thin.otf') format('opentype');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'GT Eesti Pro Display';
  src: url('../fonts/gteestiprodisplay_light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'GT Eesti Pro Display';
  src: url('../fonts/gteestiprodisplay_regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'GT Eesti Pro Display';
  src: url('../fonts/gteestiprodisplay_medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'GT Eesti Pro Display';
  src: url('../fonts/gteestiprodisplay_bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'GT Eesti Pro Display';
  src: url('../fonts/gteestiprodisplay_ultrabold.otf') format('opentype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* LUX brand base colour — lilac (top-right) → off-white (bottom-left) */
:root {
  --lux-lilac: #cebaee;
  --lux-off-white: #f3f2f6;
  --lux-studio-bg: linear-gradient(
    to bottom left,
    var(--lux-lilac) 0%,
    #e9e2f4 70%,
    var(--lux-off-white) 100%
  );
  --lux-font-display: 'Fantasm and Secrets', cursive;
  --lux-font-sans: 'GT Eesti Pro Display', sans-serif;
  --lux-font-serif: 'Cormorant Garamond', 'Times New Roman', Times, serif;
}

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

html, body {
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--lux-off-white);
}

#lux-root {
  font-family: var(--lux-font-sans);
  font-weight: 400;
  background: var(--lux-studio-bg);
  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; }

/* ===== Landing idle screensaver (fog wipe) ===== */
.lux-screensaver {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
  background: var(--lux-studio-bg);
}

.lux-screensaver[hidden] {
  display: none !important;
}

.lux-screensaver.is-active {
  cursor: grabbing;
}

.lux-screensaver-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.lux-screensaver-cue {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 20px 28px 28px;
  width: min(92vw, 520px);
  min-height: min(78dvh, 640px);
  text-align: center;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.lux-screensaver.is-swiping .lux-screensaver-cue {
  opacity: 0;
}

.lux-screensaver-logo {
  position: absolute;
  top: clamp(12px, 3vh, 28px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}

/* Must beat .lux-brand-logo img (same element also has that class) */
.lux-brand-logo.lux-screensaver-logo img,
#luxScreensaver .lux-screensaver-logo img {
  display: block;
  height: clamp(80px, 20vw, 142px) !important;
  width: auto !important;
  max-width: min(86vw, 400px) !important;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(61, 28, 94, 0.2));
}

/* Tablet: smaller logo, sit higher, clear gap above “Swipe to” */
@media (min-width: 641px) and (max-width: 1366px) {
  .lux-screensaver-logo {
    top: clamp(4px, 1vh, 12px);
  }

  .lux-brand-logo.lux-screensaver-logo img,
  #luxScreensaver .lux-screensaver-logo img {
    height: clamp(70px, 10.5vw, 104px) !important;
    max-width: min(48vw, 280px) !important;
  }

  .lux-screensaver-cue {
    padding-top: 24px;
    min-height: min(78dvh, 680px);
  }

  .ss-illu {
    padding-top: clamp(128px, 16vh, 168px);
  }
}

/* Screensaver: GT Eesti for Swipe/to/Begin/your; Fantasm for Skin Analysis */
.ss-illu {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12em;
  margin: 0;
  padding: 108px 8px 0;
  flex: 1 1 auto;
  width: 100%;
  font-family: var(--lux-font-sans);
  font-weight: 400;
  color: #1a1220;
  line-height: 1.05;
  filter: drop-shadow(0 6px 16px rgba(61, 28, 94, 0.12));
}

.ss-line {
  display: inline-flex;
  align-items: baseline;
  gap: 0.22em;
}

.ss-word {
  display: inline-block;
  white-space: nowrap;
}

.ss-swipe-line {
  transform: none;
}

.ss-swipe {
  font-size: clamp(34px, 9vw, 52px);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.ss-to {
  font-size: clamp(14px, 3.4vw, 20px);
  font-weight: 300;
  color: #2a1a35;
  transform: none;
  opacity: 0.85;
  letter-spacing: 0.06em;
}

.ss-begin {
  font-size: clamp(52px, 14vw, 88px);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #120c18;
  transform: none;
  margin: 0.02em 0 0.06em;
}

.ss-your {
  font-size: clamp(16px, 4vw, 24px);
  font-weight: 300;
  color: #2a1a35;
  transform: none;
  align-self: center;
  margin: -0.05em 0 0.02em;
  opacity: 0.88;
  letter-spacing: 0.04em;
}

.ss-skin-line {
  transform: rotate(1.5deg);
  gap: 0.28em;
  font-family: var(--lux-font-display);
  font-weight: 400;
  line-height: 0.92;
}

.ss-skin {
  font-size: clamp(40px, 11vw, 64px);
  font-weight: 400;
  letter-spacing: 0.005em;
}

.ss-analysis {
  font-size: clamp(40px, 11vw, 64px);
  font-weight: 400;
  letter-spacing: 0.005em;
}

.lux-screensaver-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: clamp(36px, 8vh, 64px);
  padding-bottom: 8px;
  flex: 0 0 auto;
}

.lux-screensaver-hint {
  margin: 0;
  font-family: var(--lux-font-sans);
  font-size: clamp(12px, 3.2vw, 15px);
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #5c3d6e;
  opacity: 0.95;
}

.lux-screensaver-gesture {
  margin-top: 0;
  animation: luxScreensaverPulse 2s ease-in-out infinite;
}

.lux-screensaver-hand {
  width: clamp(64px, 16vw, 88px);
  height: clamp(64px, 16vw, 88px);
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

@keyframes luxScreensaverPulse {
  0%, 100% { transform: translateX(0); opacity: 0.75; }
  50% { transform: translateX(14px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .lux-screensaver-gesture {
    animation: none;
  }

  .ss-word,
  .ss-swipe-line {
    transform: none !important;
  }
}

/* Shared LUX media logo */
.lux-brand-logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
}

.lux-brand-logo img {
  display: block;
  width: auto;
  height: clamp(40px, 8vw, 58px);
  max-width: min(42vw, 180px);
  object-fit: contain;
  filter: drop-shadow(0 3px 10px rgba(61, 28, 94, 0.18));
}

#page4 .p4-header .lux-brand-logo img {
  height: clamp(60px, 12vw, 84px);
  max-width: min(78vw, 320px);
  filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(61, 28, 94, 0.2));
}

.camera-lux-logo {
  margin-right: 8px;
}

.camera-lux-logo img {
  height: clamp(34px, 7vw, 46px);
  max-width: 120px;
}

.scan-brand.lux-brand-logo {
  justify-content: center;
  margin-bottom: 10px;
}

.scan-brand.lux-brand-logo img {
  height: clamp(42px, 9vw, 60px);
}

/* ===== PAGE 1 ===== */
#page1 {
  background: var(--lux-studio-bg);
  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(206, 186, 238, 0.55),
    0 0 18px 6px rgba(206, 186, 238, 0.28);
  animation: p1StarTwinkle var(--t) ease-in-out var(--d) infinite;
  opacity: 0.55;
}

.p1-stars span:nth-child(3n) {
  background: #f3f2f6;
  box-shadow:
    0 0 5px 1px rgba(255, 255, 255, 0.95),
    0 0 12px 4px rgba(206, 186, 238, 0.5),
    0 0 20px 7px rgba(206, 186, 238, 0.28);
}

.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: center;
  align-items: center;
  /* Sit logo lower — toward the space above INTRODUCING */
  padding: clamp(88px, 16vh, 140px) 24px clamp(12px, 2.5vh, 24px);
}

.lux-logo {
  font-family: var(--lux-font-display);
  font-size: 28px;
  font-weight: 700;
  color: #9c6d2e;
  letter-spacing: 4px;
}

.p1-lux-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.p1-lux-logo img {
  display: block;
  width: auto;
  height: clamp(92px, 22vw, 140px);
  max-width: min(80vw, 360px);
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(61, 28, 94, 0.2));
}

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

#page1 .p1-lux-logo {
  animation: luxLogoFade 3.2s ease-in-out infinite;
}

@keyframes luxLogoFade {
  0%, 100% {
    opacity: 0.72;
  }
  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 28px;
  flex: 1 1 auto;
  gap: 22px;
}

.p1-main-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  max-width: min(94vw, 760px);
  margin: 0;
  padding: 8px 12px 4px;
}

.p1-main-eyebrow {
  font-family: var(--lux-font-sans);
  font-size: clamp(13px, 3.2vw, 16px);
  font-weight: 300;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: #8a6a9a;
}

/* Fantasm illustrative composition — readable rhythm + breathing room */
.p1-illu {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  width: min(96vw, 640px);
  font-family: var(--lux-font-display);
  font-weight: 400;
  font-style: normal;
  color: #000;
  line-height: 1.05;
  filter: drop-shadow(0 8px 18px rgba(91, 45, 130, 0.14));
}

.p1-illu-product {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.18em 0.35em;
  padding: 0.2em 0.35em 0.45em;
  max-width: 100%;
}

.p1-illu-word {
  display: inline-block;
  white-space: nowrap;
}

.p1-illu-lux {
  font-family: var(--lux-font-serif);
  font-size: clamp(38px, 9vw, 58px);
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #000;
  transform: none;
  padding: 0 0.02em;
  line-height: 1;
}

.p1-illu-gluta {
  font-size: clamp(44px, 10.5vw, 68px);
  letter-spacing: 0.05em;
  color: #000;
  transform: rotate(2.5deg);
}

.p1-illu-bars {
  font-size: clamp(36px, 8.5vw, 54px);
  letter-spacing: 0.02em;
  color: #000;
  transform: rotate(-2.5deg);
  padding: 0;
}

.p1-illu-rule {
  width: 56px;
  height: 1px;
  margin: 12px 0 10px;
  background: linear-gradient(90deg, transparent, #b39ddb, transparent);
}

.p1-illu-tagline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18em;
  max-width: 20em;
  padding: 0 8px;
}

.p1-illu-lead {
  font-size: clamp(28px, 6.4vw, 40px);
  letter-spacing: 0.04em;
  color: #000;
  transform: rotate(-2deg);
  line-height: 1.2;
}

.p1-illu-skincare {
  font-size: clamp(36px, 8.5vw, 54px);
  letter-spacing: 0.03em;
  color: #000;
  transform: rotate(2.5deg);
  line-height: 1.15;
}

.p1-illu-inbar {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28em;
  transform: rotate(-2deg);
  line-height: 1.05;
  margin-top: -0.12em;
}

.p1-illu-in {
  font-size: clamp(24px, 5.6vw, 34px);
  letter-spacing: 0.04em;
  color: #000;
}

.p1-illu-bar-word {
  font-size: clamp(36px, 8.5vw, 54px);
  letter-spacing: 0.03em;
  color: #000;
}

/* Landing reveal */
#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-main-eyebrow {
  animation: p1WordIn 0.45s ease-out 0.08s both;
}

#page1.is-revealing .p1-illu-lux {
  animation: p1IlluIn 0.5s ease-out 0.14s both;
}

#page1.is-revealing .p1-illu-gluta {
  animation: p1IlluIn 0.55s ease-out 0.22s both;
}

#page1.is-revealing .p1-illu-bars {
  animation: p1IlluIn 0.5s ease-out 0.3s both;
}

#page1.is-revealing .p1-illu-rule {
  animation: p1WordIn 0.4s ease-out 0.36s both;
}

#page1.is-revealing .p1-illu-lead {
  animation: p1IlluIn 0.45s ease-out 0.42s both;
}

#page1.is-revealing .p1-illu-skincare {
  animation: p1IlluIn 0.5s ease-out 0.5s both;
}

#page1.is-revealing .p1-illu-inbar {
  animation: p1IlluIn 0.45s ease-out 0.58s both;
}

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

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

@media (prefers-reduced-motion: reduce) {
  #page1 .lux-logo,
  #page1.is-revealing .p1-top-bar .lux-logo,
  #page1.is-revealing .p1-main-eyebrow,
  #page1.is-revealing .p1-illu-word,
  #page1.is-revealing .p1-illu-rule,
  #page1.is-revealing .p1-cta-wrap,
  #page1.is-revealing .p1-bottom-disclaimer {
    animation: none !important;
  }

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

  .p1-illu-word {
    transform: none !important;
  }
}

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

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

@media (max-width: 640px) {
  .p1-illu {
    width: min(96vw, 420px);
    gap: 0.3rem;
  }

  .p1-illu-product {
    gap: 0.12em 0.3em;
  }

  .p1-illu-lux {
    font-size: clamp(34px, 9vw, 48px);
    font-weight: 500;
    font-style: italic;
    letter-spacing: 0.04em;
    transform: none;
  }

  .p1-illu-gluta {
    font-size: clamp(40px, 10.5vw, 54px);
    transform: rotate(2deg);
  }

  .p1-illu-bars {
    font-size: clamp(32px, 8.5vw, 42px);
    letter-spacing: 0.02em;
    transform: rotate(-2deg);
  }

  .p1-illu-tagline {
    gap: 0.16em;
  }

  .p1-illu-lead {
    font-size: clamp(24px, 6.2vw, 32px);
  }

  .p1-illu-in {
    font-size: clamp(20px, 5.4vw, 28px);
  }

  .p1-illu-skincare,
  .p1-illu-bar-word {
    font-size: clamp(32px, 8.5vw, 42px);
  }

  .p1-main-eyebrow {
    font-size: clamp(12px, 3.4vw, 15px);
  }

  .p1-bottom-disclaimer {
    font-size: clamp(15px, 4vw, 17px);
    max-width: min(94vw, 420px);
    line-height: 1.55;
  }

  .p1-lux-logo img {
    height: clamp(86px, 20vw, 128px);
    max-width: min(82vw, 340px);
  }

  .btn-start,
  .shiny-cta {
    font-size: 13px;
    padding: 15px 36px;
  }
}

@media (min-width: 641px) and (max-width: 1180px) {
  .p1-illu-lux {
    letter-spacing: 0.04em;
    font-size: clamp(40px, 8vw, 54px);
    font-weight: 500;
    font-style: italic;
    transform: none;
  }

  .p1-illu-gluta {
    font-size: clamp(46px, 9vw, 64px);
  }

  .p1-illu-bars,
  .p1-illu-skincare,
  .p1-illu-bar-word {
    letter-spacing: 0.02em;
    font-size: clamp(36px, 7.5vw, 52px);
  }

  .p1-illu-lead {
    font-size: clamp(28px, 5.8vw, 38px);
  }
}

.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: var(--lux-font-display);
  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: var(--lux-font-display);
  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;
  --lux-cta-purple: #7e4e9f;

  position: relative;
  overflow: hidden;
  cursor: pointer;
  outline-offset: 4px;
  padding: 16px 48px;
  font-family: var(--lux-font-sans);
  font-size: 14px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 360px;
  color: var(--shiny-cta-fg);
  background: var(--lux-cta-purple);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    0 8px 24px rgba(126, 78, 159, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 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);
  background: #734690;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    0 12px 28px rgba(126, 78, 159, 0.42);
}

@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-disclaimer {
  font-family: var(--lux-font-sans);
  font-size: clamp(15px, 3.8vw, 18px);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: #6a5a78;
  text-align: center;
  text-transform: none;
  max-width: min(94vw, 520px);
  margin: 0 auto;
  padding: 0 12px;
  opacity: 0.95;
}

/* 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: var(--lux-studio-bg);
  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: var(--lux-font-display); font-size: 28px; font-weight: 400; color: #9c6d2e; letter-spacing: 2px; }

.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: var(--lux-font-display);
  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: var(--lux-font-display);
  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: var(--lux-font-sans);
  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: var(--lux-studio-bg);
  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;
  container-type: size;
  container-name: p3-frame;
}

.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;
  /* Undo Camera Kit mirrored selfie so results match natural orientation */
  transform: scaleX(-1);
}

.result-mask-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  opacity: 1;
  mix-blend-mode: normal;
  /* Match #resultImg un-mirror so PNG aligns with the selfie */
  transform: scaleX(-1);
}

.result-mask-layer[hidden] {
  display: none !important;
}

/* Fixed color-key legend for each concern mask (not driven by score) */
.concern-legend {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

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

.concern-legend-badge {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 4px;
  background: #00acc1;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.concern-legend-scale {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.concern-legend-end {
  display: block;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(40, 40, 40, 0.78);
  color: #fff;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
}

.concern-legend-track {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  width: 42px;
  height: 130px;
  min-height: 130px;
  padding: 0 14px 0 12px;
  box-sizing: border-box;
}

.concern-legend-bar {
  flex: 0 0 auto;
  width: 12px;
  height: 100%;
  margin: 0 auto;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
  background: linear-gradient(
    180deg,
    #2196f3 0%,
    #26c6da 18%,
    #66bb6a 38%,
    #ffee58 55%,
    #ff9800 72%,
    #f44336 88%,
    #e53935 100%
  );
}

/* Score marker — left of bar; 0 at top, 10 at bottom */
.concern-legend-arrow {
  position: absolute;
  left: 2px;
  top: 0;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid #2d1b3d;
  transform: translateY(-50%);
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.85));
  z-index: 2;
}

.concern-legend-ticks {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 12px;
  pointer-events: none;
}

.concern-legend-tick {
  position: absolute;
  right: 0;
  transform: translateY(-50%);
  color: rgba(40, 40, 40, 0.9);
  font-size: 7px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.85);
}

.concern-legend-tick.is-dash {
  width: 5px;
  height: 1px;
  background: rgba(40, 40, 40, 0.55);
  right: 2px;
  font-size: 0;
}

.concern-legend-tick.is-major {
  right: 0;
}

/* Dryness / moisture */
.concern-legend[data-concern="Dry patches"] .concern-legend-badge {
  background: #00acc1;
}
.concern-legend[data-concern="Dry patches"] .concern-legend-bar {
  background: linear-gradient(
    180deg,
    #2196f3 0%,
    #26c6da 18%,
    #66bb6a 38%,
    #ffee58 55%,
    #ff9800 72%,
    #f44336 88%,
    #e53935 100%
  );
}

/* Dullness / radiance — cool slate (Radiant light → Dull dark) */
.concern-legend[data-concern="Dullness"] .concern-legend-badge {
  background: #455a64;
}
.concern-legend[data-concern="Dullness"] .concern-legend-bar {
  background: linear-gradient(
    180deg,
    #eceff1 0%,
    #cfd8dc 20%,
    #90a4ae 40%,
    #607d8b 62%,
    #455a64 82%,
    #263238 100%
  );
}

/* Hyperpigmentation / age spots — match Makeupar cyan/teal spot markers */
.concern-legend[data-concern="Hyperpigmentation"] .concern-legend-badge {
  background: #00acc1;
}
.concern-legend[data-concern="Hyperpigmentation"] .concern-legend-bar {
  background: linear-gradient(
    180deg,
    #e0f7fa 0%,
    #b2ebf2 18%,
    #4dd0e1 40%,
    #00bcd4 58%,
    #0097a7 78%,
    #006064 100%
  );
}

/* Uneven tone — dark purple (redness) or dark burgundy (age-spot fallback) */
.concern-legend[data-concern="Uneven skin tone"] .concern-legend-badge {
  background: #6a1b9a;
}
.concern-legend[data-concern="Uneven skin tone"] .concern-legend-bar {
  background: linear-gradient(
    180deg,
    #f3e5f5 0%,
    #ce93d8 28%,
    #9c27b0 55%,
    #6a1b9a 78%,
    #4a148c 100%
  );
}
.concern-legend[data-concern="Uneven skin tone"][data-mask-source="hd_age_spot"] .concern-legend-badge {
  background: #6d4c41;
}
.concern-legend[data-concern="Uneven skin tone"][data-mask-source="hd_age_spot"] .concern-legend-bar {
  background: linear-gradient(
    180deg,
    #efebe9 0%,
    #bcaaa4 28%,
    #8d6e63 55%,
    #6d4c41 78%,
    #3e2723 100%
  );
}

/* Tint only the translucent mask layer for Uneven (not the selfie) —
   bright saturated purple so sparse spots stay easy to locate */
.result-mask-layer.tint-uneven-redness {
  opacity: 1;
  filter:
    hue-rotate(270deg)
    saturate(4.2)
    contrast(1.75)
    brightness(1.45)
    drop-shadow(0 0 1.5px #ce93d8);
  mix-blend-mode: multiply;
}
.result-mask-layer.tint-uneven-age-spot {
  opacity: 1;
  filter:
    hue-rotate(300deg)
    saturate(3.6)
    contrast(1.7)
    brightness(1.35)
    drop-shadow(0 0 1.5px #ce93d8);
  mix-blend-mode: multiply;
}

@media (max-width: 480px) {
  .concern-legend {
    right: 6px;
  }

  .concern-legend-track {
    width: 38px;
    height: 110px;
    min-height: 110px;
  }

  .concern-legend-bar {
    width: 10px;
  }
}

.concern-average {
  width: 100%;
  max-width: min(100%, 440px);
  margin: 12px auto 2px;
  padding: 0 clamp(8px, 3vw, 16px);
  box-sizing: border-box;
}

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

.concern-average-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.concern-average-label {
  font-family: var(--lux-font-sans);
  font-size: clamp(11px, 2.8vw, 13px);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5c3d5c;
}

.concern-average-value {
  font-family: var(--lux-font-sans);
  font-size: clamp(14px, 3.4vw, 17px);
  font-weight: 700;
  color: #3d1c5e;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.concern-average-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(61, 28, 94, 0.12);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(61, 28, 94, 0.08);
}

.concern-average-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7e4e9f 0%, #c2185b 55%, #9c6d2e 100%);
  transition: width 0.45s ease;
}

.concern-circles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: clamp(4px, 1.5vw, 14px);
  row-gap: 10px;
  justify-items: center;
  width: 100%;
  max-width: min(100%, 440px);
  margin: 14px auto 4px;
  padding: 0 clamp(4px, 2vw, 12px);
  box-sizing: border-box;
  container-type: inline-size;
  container-name: concern-circles;
}

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

.concern-circle-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: none;
  min-width: 0;
  color: #5c3d5c;
  font-family: var(--lux-font-sans);
  transition: transform 0.18s ease;
}

.concern-circle-btn:hover {
  transform: translateY(-2px);
}

.concern-circle-btn:focus-visible {
  outline: 2px solid #c2185b;
  outline-offset: 3px;
  border-radius: 8px;
}

.concern-circle-ring {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--concern-color, #c2185b);
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.95) 0%, rgba(255,248,250,0.9) 45%, rgba(255,255,255,0.75) 100%);
  box-shadow: 0 4px 14px rgba(61, 28, 94, 0.12);
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, border-width 0.2s ease, transform 0.2s ease;
}

.concern-circle-btn.is-active .concern-circle-ring {
  border-width: 3px;
  border-color: var(--concern-fill, var(--concern-color, #c2185b));
  background: var(--concern-fill, var(--concern-color, #c2185b));
  box-shadow: 0 6px 18px rgba(61, 28, 94, 0.22);
  transform: scale(1.06);
}

.concern-circle-score {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--concern-color, #c2185b);
  line-height: 1;
}

.concern-circle-btn.is-active .concern-circle-score {
  color: var(--concern-fill-ink, #fff);
}

.concern-circle-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.concern-circle-label {
  font-size: clamp(6.5px, 2.2vw, 9px);
  font-weight: 600;
  letter-spacing: -0.03em;
  text-align: center;
  width: 100%;
  max-width: 100%;
  line-height: 1.15;
  color: #7b5e7b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

@container concern-circles (max-width: 360px) {
  .concern-circle-label {
    font-size: clamp(5.5px, 3.1cqi, 8px);
    letter-spacing: -0.045em;
  }
}

@container concern-circles (max-width: 280px) {
  .concern-circle-label {
    font-size: clamp(5px, 3.4cqi, 7px);
    letter-spacing: -0.05em;
  }
}

.concern-circle-btn.is-active .concern-circle-label {
  color: #3d1c5e;
}

.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: var(--lux-font-sans);
  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: var(--lux-font-sans);
  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: var(--lux-font-sans);
  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: var(--lux-font-sans);
  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: var(--lux-font-display);
  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: var(--lux-font-display);
  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: var(--lux-font-display);
  font-size: 11px;
  font-weight: 400;
  color: #7b5e7b;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.heroine-main {
  font-family: var(--lux-font-display);
  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: var(--lux-font-display);
  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: var(--lux-font-display);
  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: var(--lux-font-display);
  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: var(--lux-studio-bg);
  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: var(--lux-font-display);
  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: clamp(72px, 14vh, 120px) 16px 10px;
  }

  .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-disclaimer {
    font-size: clamp(15px, 3.6vw, 17px);
    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: var(--lux-studio-bg);
  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: 10px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.camera-title {
  font-family: var(--lux-font-sans);
  font-size: clamp(14px, 3.5vw, 18px);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3d1c5e;
  flex: 1 1 auto;
  text-align: center;
}

.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);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.camera-close-icon {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
  pointer-events: none;
}

.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-kit {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: min(62vh, 560px);
}

.ymk-module {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  width: 100%;
  min-height: 320px;
  height: 100%;
  font-family: var(--lux-font-sans);
}

/* GT Eesti on Camera Kit status labels (Lighting / Look Straight / Face Position) */
.ymk-module,
.ymk-module div,
.ymk-module span,
.ymk-module p,
.ymk-module button,
.ymk-module label {
  font-family: var(--lux-font-sans) !important;
}

/* Hide Camera Kit flip only — keep original in-camera close (X) */
.ymk-module img[src*="i-camera-flip"],
.ymk-module [style*="i-camera-flip"],
.ymk-module img[src*="camera-flip"],
.ymk-module [style*="camera-flip"] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.ymk-module iframe,
.ymk-module canvas,
.ymk-module video,
.ymk-module > div {
  max-width: 100% !important;
}

.camera-stage-kit .camera-quality-hint {
  top: auto;
  bottom: 14px;
  transform: none;
}

.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;
}

/* Opaque cover over the Camera Kit's own boot/splash screen */
.camera-boot-ui {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #1b1020;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  /* Instant show — fade only when lifting so the Kit splash never bleeds through */
  transition: none;
}

.camera-boot-ui.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.camera-boot-ui.is-leaving {
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

/* Hide Kit DOM while booting so its splash cannot peek past the cover */
.camera-stage.is-booting .ymk-module {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.camera-boot-spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid rgba(248, 187, 208, 0.25);
  border-top-color: #f8bbd0;
  animation: cameraBootSpin 0.9s linear infinite;
}

.camera-boot-text {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: #f8bbd0;
}

@keyframes cameraBootSpin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .camera-boot-spinner {
    animation-duration: 2.4s;
  }
  .camera-boot-ui.is-leaving {
    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: var(--lux-font-sans);
  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-quality-bar {
  position: absolute;
  top: 10px;
  left: 8px;
  right: 8px;
  z-index: 5;
  display: flex;
  gap: 6px;
  justify-content: center;
  pointer-events: none;
}

.camera-quality-pill {
  flex: 1 1 0;
  min-width: 0;
  max-width: 120px;
  padding: 6px 6px 7px;
  border-radius: 8px;
  text-align: center;
  background: rgba(180, 40, 60, 0.88);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
  transition: background 0.25s ease;
}

.camera-quality-pill.is-good {
  background: rgba(46, 125, 80, 0.9);
}

.camera-quality-pill.is-bad {
  background: rgba(180, 40, 60, 0.88);
}

.camera-quality-pill-title {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.3px;
  line-height: 1.2;
  opacity: 0.95;
}

.camera-quality-pill-status {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.2;
}

.camera-quality-hint {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 50%;
  z-index: 5;
  transform: translateY(-50%);
  text-align: center;
  pointer-events: none;
  font-family: var(--lux-font-sans);
  font-size: clamp(14px, 3.6vw, 17px);
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
  transition: opacity 0.2s ease;
}

.camera-quality-hint.is-ready {
  opacity: 0.85;
}

.camera-stage.is-analyzing .camera-quality-bar,
.camera-stage.is-analyzing .camera-quality-hint,
.camera-stage.is-analyzing .camera-face-guide {
  opacity: 0;
  visibility: hidden;
}

.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 {
  display: none !important;
}

.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);
  opacity: 0.72;
  transition: opacity 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn-camera-capture.is-ready {
  opacity: 1;
  box-shadow: 0 10px 24px rgba(194,24,91,0.42);
}

.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-disclaimer {
    font-size: clamp(16px, 2.4vw, 18px);
    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;
  }

  .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 .result-mask-layer {
  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: var(--lux-font-display);
  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: var(--lux-font-sans);
  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: var(--lux-font-sans);
  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: var(--lux-font-display);
  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: var(--lux-studio-bg);
  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-title {
  animation: p4RiseIn 0.45s ease-out 0.08s both;
}

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

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

#page4.is-revealing .p4-actions {
  animation: p4RiseIn 0.4s ease-out 0.36s 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-title,
  #page4.is-revealing .p4-soap-card,
  #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: center;
  align-items: center;
  padding: 14px 24px 4px;
  flex: 0 0 auto;
}

.p4-body {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 22px 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-title {
  font-family: var(--lux-font-sans);
  font-size: clamp(26px, 6.5vw, 40px);
  font-weight: 300;
  color: #000;
  text-align: center;
  line-height: 1.2;
  margin: 0 0 12px;
  flex: 0 0 auto;
  max-width: 100%;
  padding: 0 8px;
  overflow-wrap: anywhere;
  word-break: break-word;
  letter-spacing: 0.02em;
}

.p4-title-lux {
  font-size: 0.88em;
  letter-spacing: 0.04em;
}

.p4-avg-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  flex: 0 0 auto;
}

.p4-avg-circle[hidden] {
  display: none !important;
}

.p4-avg-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(126, 78, 159, 0.45);
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.95) 0%, rgba(255,248,250,0.92) 45%, rgba(255,255,255,0.8) 100%);
  box-shadow: 0 6px 18px rgba(61, 28, 94, 0.16);
}

.p4-avg-score {
  font-family: var(--lux-font-sans);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #7e4e9f;
  line-height: 1;
}

.p4-avg-label {
  font-family: var(--lux-font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5c3d5c;
}

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

.p4-soap-desc {
  width: 100%;
  max-width: 34em;
  margin: 0 auto 16px;
  padding: 0 8px;
  font-family: var(--lux-font-sans);
  font-size: clamp(16px, 3.8vw, 18px);
  font-weight: 400;
  line-height: 1.55;
  color: #5a4460;
  text-align: center;
  white-space: pre-line;
}

.p4-soap-desc[hidden] {
  display: none !important;
}

.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: var(--lux-font-sans);
  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: 6px;
  min-height: 0;
  height: auto;
  overflow: auto;
  box-sizing: border-box;
}

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

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

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

.p4-soap-card-desc {
  width: 100%;
  margin: 8px 0 0;
  padding: 8px 4px 0;
  border-top: 1px solid rgba(194, 24, 91, 0.1);
  font-family: var(--lux-font-sans);
  font-size: clamp(16px, 3.8vw, 18px);
  font-weight: 400;
  line-height: 1.55;
  color: #5a4460;
  text-align: center;
  white-space: pre-line;
}

.p4-soap-card-match {
  width: 100%;
  margin: 10px 0 0;
  padding: 0 4px;
  font-family: var(--lux-font-sans);
  font-size: clamp(16px, 3.8vw, 18px);
  font-weight: 400;
  line-height: 1.55;
  color: #5a4460;
  text-align: center;
}

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

.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-soap-image {
    width: min(100%, 300px);
    max-height: min(50dvh, 380px);
  }
}

@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: 18px 14px 24px;
    width: 100%;
  }

  .p4-title {
    margin-bottom: 14px;
    padding: 0 8px;
    font-size: clamp(26px, 8vw, 36px);
  }

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

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

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

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

  .p4-soap-image {
    width: min(92%, 260px);
    max-height: min(46dvh, 300px);
    margin: 2px 0 6px;
  }

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

  .p4-actions .btn-action {
    width: 100%;
    max-width: 100%;
  }
}

/* Short phones: larger soap hero */
@media (max-width: 640px) and (max-height: 740px) {
  .p4-soap-image {
    width: min(100%, 200px);
    max-height: min(36dvh, 220px);
  }

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

/* 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-circles {
    column-gap: clamp(2px, 1vw, 8px);
    max-width: 100%;
    padding: 0 4px;
  }

  .concern-circle-ring {
    width: 48px;
    height: 48px;
  }

  .concern-circle-score {
    font-size: 13px;
  }

  .concern-circle-label {
    font-size: clamp(5.5px, 2.4vw, 8px);
    letter-spacing: -0.04em;
  }

  .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;
  }
}
