/* ===== Breakpoints =====
 * sm:  640px  - 모바일 가로
 * md:  768px  - 태블릿
 * lg:  1024px - 태블릿 가로 / 작은 데스크탑
 * xl:  1280px - 데스크탑
 * 2xl: 1536px - 큰 데스크탑
 * ==================== */

:root {
  color-scheme: light;
  --bg-1: #4b3a33;
  --bg-2: #6a554d;
  --bg-3: #F5F5F4;
  --bg-white: #ffffff;
  --accent: #EBF5F8;
  --accent-strong: #BEE0EA;
  --accent-highlight: rgba(190, 224, 234, 0.8);
  --color-brown-primary: #4b3a34;
  --text-strong: #0C0A09;
  --text-medium: #57534D;
  --text-muted: #A6A09B;
  --text-on-brand: #ffffff;
  --chip-bg: rgba(255, 255, 255, 0.1);
  --chip-active: #f4f8f9;
  --chip-text: #f6f1ee;
  --chip-text-active: #3b2d28;
  --cta-bg: var(--color-brown-primary);
  --cta-text: #f7f1ed;
  --border-soft: rgba(255, 255, 255, 0.18);
  --shadow-soft: 0 28px 80px rgba(22, 13, 9, 0.45);
  --radius-lg: 28px;
  --color-sale: #D6001C;
  font-family: "Plus Jakarta Sans", "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg-3);
}

body {
  background: linear-gradient(180deg, var(--bg-1) 0%, #5c483f 45%, var(--bg-3) 100%);
  color: var(--text-strong);
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
}

[hidden] {
  display: none !important;
}

.start-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.bg-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 15vh;
  background: linear-gradient(0deg, rgba(235, 236, 230, 0) 0%, #EBECE6 50%, #EBECE6 100%);
  pointer-events: none;
  z-index: 1;
}

.language-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 24px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  z-index: 4;
}

.language-bar::-webkit-scrollbar {
  display: none;
}

.lang-menu {
  display: inline-flex;
  gap: 24px;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  padding: 0 16px;
  min-width: 100%;
  justify-content: center;
  box-sizing: border-box;
}

.lang-chip {
  position: relative;
  border: none;
  background: transparent;
  color: var(--color-brown-primary);
  padding: 20px 40px;
  font-weight: 600;
  font-size: 24px;
  cursor: pointer;
  letter-spacing: 0.02em;
  border-radius: 4px;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  transition: background 150ms ease, color 150ms ease;
}

.lang-chip.is-active {
  background: var(--color-brown-primary);
  color: var(--accent-strong);
}

.hero-image {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-cta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 80px 24px 24px;
  padding-bottom: max(36px, calc(28px + env(safe-area-inset-bottom, 0px)));
  background: linear-gradient(0deg, rgba(92, 72, 63, 1) 0%, rgba(92, 72, 63, 1) 50%, rgba(92, 72, 63, 0) 100%);
  z-index: 3;
}

.hero-cta .cta-button {
  width: 100%;
  max-width: none;
  min-width: 0;
  padding: 22px;
  font-size: 18px;
  font-weight: 800;
  gap: 12px;
  border-radius: 4px;
  border: none;
  box-shadow: none;
  justify-content: center;
  background: var(--accent-strong);
  color: var(--color-brown-primary);
}

@media (min-width: 768px) {
  .hero-cta .cta-button {
    padding: 33px;
    font-size: 27px;
    gap: 18px;
  }
}

@media (min-width: 1024px) {
  .hero-cta .cta-button {
    padding: 44px;
    font-size: 36px;
    gap: 24px;
  }
}

.hero-cta .cta-button-text {
  flex: 0 0 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.hero-cta .cta-button-arrow {
  display: block;
  width: clamp(24px, 4vw, 48px);
  height: clamp(24px, 4vw, 48px);
  background: currentColor;
  border-radius: 0;
  box-shadow: none;
  -webkit-mask: url('./resource/icon/arrow_forward.svg') center / contain no-repeat;
  mask: url('./resource/icon/arrow_forward.svg') center / contain no-repeat;
}

@media (max-width: 640px) {
  .language-bar {
    padding: 16px 0;
  }

  .lang-chip {
    font-size: 14px;
  }
}

.cta-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px 16px 28px;
  border-radius: 999px;
  background: var(--cta-bg);
  color: var(--cta-text);
  border: 1px solid var(--border-soft);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: var(--shadow-soft);
  min-width: 180px;
  width: fit-content;
  max-width: 420px;
  cursor: pointer;
}

@media (min-width: 768px) {
  .cta-button {
    font-size: 20px;
    padding: 20px 22px 20px 32px;
  }
}

.cta-button.camera-cta {
  min-width: 180px;
  max-width: 320px;
}

.cta-button-text {
  flex: 1;
  text-align: left;
  pointer-events: none;
}

.cta-button-arrow {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: inherit;
  font-size: 24px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4), 0 12px 30px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}


.screen.camera-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: #0d0d0f;
  color: #e7edf1;
  padding: 0;
}

button {
  font-family: inherit;
  border: none;
  background: transparent;
}

button.ghost {
  border: 1px solid rgba(226, 232, 240, 0.35);
  color: #e2e8f0;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.8);
  color: #f8fafc;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 10;
}

.toast.is-visible {
  opacity: 1;
}

.camera-full {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
}

#liveVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

#capturedImage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle 24vw at 50% 42%,
    rgba(0, 0, 0, 0) 24vw,
    rgba(0, 0, 0, 0.88) 24.5vw
  );
  transition: opacity 200ms ease;
  width: 100%;
  height: 100%;
  opacity: 1;
}

.camera-mask.is-hidden {
  opacity: 0;
}

.timer-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(64px, 12vw, 108px);
  font-weight: 700;
  color: #f8fafc;
  background: rgba(0, 0, 0, 0.35);
}

.timer-overlay[hidden] {
  display: none !important;
}

.flash-overlay {
  position: fixed;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
}

.flash-overlay.is-active {
  animation: camera-flash 750ms ease;
}

@keyframes camera-flash {
  0% {
    opacity: 1;
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.camera-note {
  margin: 0;
  text-align: center;
  color: #d9e2e8;
  font-size: 16px;
  padding: 0 12px;
}

.camera-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.camera-actions__prev,
.camera-actions__next {
  position: relative;
  bottom: auto;
  left: auto;
  right: auto;
}

.camera-actions__prev {
  flex: 0 0 auto;
}

.camera-actions__next {
  flex: 1;
}

.camera-actions__next .cta-button {
  width: 100%;
  max-width: none;
  min-width: 0;
  padding: 22px;
  font-size: 24px;
  font-weight: 800;
  gap: 12px;
  border-radius: 4px;
  border: none;
  box-shadow: none;
  justify-content: center;
  background: var(--accent-strong);
  color: var(--color-brown-primary);
}

.camera-actions__next .cta-button-text {
  flex: 0 0 auto;
  white-space: nowrap;
  text-align: center;
}

.camera-actions__next .cta-button-arrow {
  display: none;
}

/* Camera prev button - same style as draping prev */
.draping-actions__prev .cta-button,
.camera-actions__prev .cta-button {
  width: 100%;
  min-width: auto;
  max-width: none;
  background: #fdfaf7;
  color: var(--color-brown-primary);
  border: none;
  border-radius: 4px;
  font-size: 24px;
  font-weight: 600;
  box-shadow: none;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.draping-actions__prev .cta-button {
  padding: 32px 22px;
}

.camera-actions__prev .cta-button {
  padding: 22px;
}

.draping-actions__prev .cta-button-arrow,
.camera-actions__prev .cta-button-arrow {
  display: none;
}

.draping-actions__prev .cta-button-text,
.camera-actions__prev .cta-button-text {
  flex: 0 0 auto;
  text-align: center;
}

.draping-actions__prev .cta-button-text::before,
.camera-actions__prev .cta-button-text::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 28px;
  margin-right: 8px;
  vertical-align: middle;
  background: currentColor;
  -webkit-mask: url('./resource/icon/back.svg') center / contain no-repeat;
  mask: url('./resource/icon/back.svg') center / contain no-repeat;
}

.camera-countdown {
  display: none;
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 700;
  color: #f8fafc;
  text-align: center;
  line-height: 1;
  min-height: 1.4em;
}

.cta-camera {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--cta-bg);
  color: var(--cta-text);
  border: 1px solid var(--border-soft);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: var(--shadow-soft);
}

.analysis-screen {
  height: 100vh;
  height: 100dvh;
  min-height: auto;
  background: var(--color-brown-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  box-sizing: border-box;
  color: #2b1c18;
  overflow: hidden;
}

.analysis-banner {
  width: 100%;
  background: var(--color-brown-primary);
  border-radius: 0;
  padding: clamp(10px, 2vw, 18px) 36px;
  box-shadow: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 2vw, 14px);
}

.analysis-shell {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 32px;
  align-items: stretch;
  background: var(--bg-white);
  border-radius: 16px 16px 0 0;
  box-shadow: none;
  padding: 36px;
  padding-bottom: 0;
  margin: 0;
  border: none;
  position: relative;
  overflow: hidden;
}


.analysis-headline {
  grid-column: 1 / -1;
  grid-row: 1;
  margin: 0 auto;
  padding: 0;
  max-width: min(900px, 90vw);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-brown-primary);
  text-align: center;
}

@media (min-width: 768px) {
  .analysis-headline {
    font-size: 32px;
  }
}

.analysis-headline mark {
  background: linear-gradient(to top, var(--accent-highlight) 30%, transparent 30%);
  color: inherit;
  font-weight: 700;
}

.analysis-stepper {
  width: 100%;
  max-width: 1400px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.56vw, 16px);
  padding: clamp(6px, 1vw, 12px) 0;
  margin: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  --stepper-color: #3c2b24;
  --stepper-muted: rgba(43, 28, 24, 0.6);
  color: var(--stepper-color);
  letter-spacing: 0.04em;
}

.analysis-banner .analysis-stepper {
  --stepper-color: rgba(253, 250, 247, 0.95);
  --stepper-muted: rgba(247, 241, 237, 0.58);
  border-top-color: rgba(247, 241, 237, 0.25);
  border-bottom-color: rgba(247, 241, 237, 0.25);
}

.analysis-step {
  display: flex;
  flex: 1;
  gap: clamp(8px, 1.56vw, 16px);
  align-items: center;
  justify-content: center;
  border-radius: 0;
  padding: 0;
  font-weight: 600;
  font-size: 18px;
}

.analysis-step-index {
  display: inline-flex;
  width: clamp(32px, 3vw, 40px);
  height: clamp(32px, 3vw, 40px);
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  font-size: clamp(14px, 1.5vw, 20px);
  font-weight: 700;
  color: var(--color-brown-primary);
  flex-shrink: 0;
}

.analysis-step.is-active .analysis-step-index {
  background: var(--accent-strong);
}

.analysis-step-label {
  font-size: clamp(18px, 2vw, 28px);
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analysis-step.is-active .analysis-step-label {
  color: #ffffff;
  font-weight: 700;
}

.analysis-content {
  display: contents;
}

.analysis-photo-card {
  grid-column: 1;
  grid-row: 2;
  background: transparent;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
  min-height: 0;
  overflow: hidden;
}

.analysis-photo {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  background: #0d0d0f;
}

#analysisCanvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.analysis-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--accent-strong);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  z-index: 2;
}

.analysis-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.analysis-readouts {
  display: contents;
}

.analysis-meters {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 64px;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
}

.analysis-meter {
  display: grid;
  grid-template-columns: clamp(80px, 10vw, 150px) 1fr clamp(80px, 10vw, 150px);
  align-items: center;
  gap: clamp(8px, 1vw, 12px);
}

.analysis-meter-scale {
  display: contents;
}

.analysis-meter-scale span {
  font-size: clamp(17px, 2.34vw, 24px);
  color: var(--color-brown-primary);
  font-weight: 500;
  white-space: nowrap;
}

.analysis-meter-scale span:first-child {
  order: 1;
  text-align: center;
}

.analysis-meter-scale span:last-child {
  order: 3;
  text-align: center;
}

.analysis-meter-track {
  position: relative;
  height: clamp(10px, 1.2vw, 16px);
  border-radius: 999px;
  background: linear-gradient(90deg, #e8c9a8, #f5d4b8);
  overflow: visible;
  order: 2;
}

.analysis-meter[data-analysis-attr="brightness"] .analysis-meter-track {
  background: linear-gradient(90deg, #c9a57a, #e8c9a8);
}

.analysis-meter[data-analysis-attr="clarity"] .analysis-meter-track {
  background: linear-gradient(90deg, #d4c4b5, #e8d4c4);
}

.analysis-meter[data-analysis-attr="saturation"] .analysis-meter-track {
  background: linear-gradient(90deg, #deb896, #e89080);
}

.analysis-meter-indicator {
  position: absolute;
  top: 100%;
  margin-top: 4px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 10px solid var(--color-brown-primary);
}

.analysis-actions {
  grid-column: 1 / -1;
  grid-row: 3;
  display: flex;
  justify-content: center;
  position: relative;
  width: 100%;
  z-index: 100;
  padding-bottom: max(36px, calc(28px + env(safe-area-inset-bottom, 0px)));
}

.analysis-next {
  width: 100%;
  min-width: auto;
  max-width: none;
  background: var(--color-brown-primary);
  color: var(--accent-strong);
  border: none;
  border-radius: 4px;
  padding: 32px 22px;
  font-size: 24px;
  font-weight: 700;
  box-shadow: none;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.analysis-next .cta-button-arrow {
  display: none;
}

.analysis-next .cta-button-text {
  flex: 0 0 auto;
  text-align: center;
}

.analysis-next .cta-button-text::after {
  content: "";
  display: inline-block;
  width: 28px;
  height: 28px;
  margin-left: 8px;
  vertical-align: middle;
  background: currentColor;
  -webkit-mask: url('./resource/icon/arrow_forward.svg') center / contain no-repeat;
  mask: url('./resource/icon/arrow_forward.svg') center / contain no-repeat;
}

.cta-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.cta-button--prev {
  background: #f6f1ed;
  color: #3b241d;
  border-color: rgba(59, 36, 29, 0.18);
  box-shadow: none;
  flex-direction: row-reverse;
  gap: 12px;
  padding: 16px 26px 16px 20px;
}

.cta-button--prev .cta-button-arrow {
  background: var(--color-brown-primary);
  color: #fdfaf7;
  box-shadow: none;
  transform: rotate(180deg);
}

.draping-actions {
  position: relative;
  z-index: 120;
  display: flex;
  gap: 2px;
  background: transparent;
  width: 100%;
  flex-shrink: 0;
  padding-bottom: max(36px, calc(28px + env(safe-area-inset-bottom, 0px)));
}

.results-actions {
  position: relative;
  z-index: 120;
}

.draping-actions__prev,
.draping-actions__next {
  position: relative;
  bottom: auto;
  left: auto;
  right: auto;
}

.draping-actions__prev {
  flex: 0 0 auto;
}

.draping-actions__next {
  flex: 1;
}

.draping-actions__prev .cta-button-text::after {
  display: none;
}

/* Draping next button - brown style */
.draping-actions__next .cta-button {
  width: 100%;
  min-width: auto;
  max-width: none;
  background: var(--color-brown-primary);
  color: var(--accent-strong);
  border: none;
  border-radius: 4px;
  padding: 32px 22px;
  font-size: 24px;
  font-weight: 700;
  box-shadow: none;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.draping-actions__next .cta-button-arrow {
  display: none;
}

.draping-actions__next .cta-button-text {
  flex: 0 0 auto;
  text-align: center;
}

.draping-actions__next .cta-button-text::after {
  content: "";
  display: inline-block;
  width: 28px;
  height: 28px;
  margin-left: 8px;
  vertical-align: middle;
  background: currentColor;
  -webkit-mask: url('./resource/icon/arrow_forward.svg') center / contain no-repeat;
  mask: url('./resource/icon/arrow_forward.svg') center / contain no-repeat;
}

/* When prev is hidden, next takes full width automatically via flex */
.draping-actions__prev[hidden] + .draping-actions__next {
  flex: 1;
}

.results-actions__prev,
.results-actions__next {
  position: fixed;
  bottom: clamp(20px, 4vw, 40px);
}

.results-actions__prev {
  left: clamp(20px, 5vw, 60px);
}

.results-actions__next {
  right: clamp(20px, 5vw, 60px);
}

@media (max-width: 1180px) {
  .analysis-shell {
    width: 100%;
    padding: 36px;
    padding-bottom: 0;
    margin-top: 0;
  }
  .analysis-content {
    grid-template-columns: 1fr 1fr;
    gap: clamp(16px, 2vw, 24px);
  }
  .analysis-photo-card {
    padding: 0;
  }
  .analysis-photo {
    width: 100%;
  }
}

@media (max-width: 960px) {
  .analysis-shell {
    padding: 36px;
    padding-bottom: 0;
    margin-top: 0;
  }
  .analysis-content {
    grid-template-columns: 1fr;
  }
  .analysis-photo-card {
    max-width: 420px;
    margin: 0 auto;
  }
  .analysis-photo {
    width: auto;
    height: 40vh;
    max-width: 100%;
  }
  /* Removed: .analysis-actions position static reset to keep it fixed */
  .analysis-step {
    flex: 1 1 100%;
  }
}

.draping-screen {
  --drape-loading-color: #eb7a47;
  position: relative;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  min-height: auto;
  padding-bottom: 0;
  background: var(--color-brown-primary);
}

.draping-screen .analysis-banner {
  flex-shrink: 0;
}

.draping-screen .analysis-shell {
  flex: 1;
  margin-top: 0;
  padding: 36px;
  padding-bottom: 0;
  overflow: auto;
  border-radius: 16px 16px 0 0;
}

.draping-screen.is-loading .analysis-shell,
.draping-screen.is-loading .analysis-banner {
  visibility: hidden;
}

.draping-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  overflow: hidden;
  background: var(--drape-loading-color, #eb7a47);
}

.draping-loading:not([hidden]) {
  display: flex;
}

.draping-loading-preview {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.draping-loading-preview video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  clip-path: circle(24vw at 50% 42%);
}

.draping-color-overlay {
  position: absolute;
  inset: 0;
  background: var(--drape-loading-color, #eb7a47);
  mix-blend-mode: multiply;
  opacity: 0.35;
  pointer-events: none;
}



#drapingPanel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 32px;
  flex: 1;
  height: 100%;
}

.draping-shell {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  color: inherit;
}

.draping-card-head {
  text-align: center;
  width: 100%;
  padding: 0;
  flex-shrink: 0;
}

.draping-progress {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-brown-primary);
}

@media (min-width: 768px) {
  .draping-progress {
    font-size: 32px;
  }
}

.draping-progress mark {
  background: linear-gradient(to top, var(--accent-highlight) 30%, transparent 30%);
  color: inherit;
  font-weight: 700;
}

.draping-subtext {
  display: none;
}

.match-options {
  width: 100%;
  max-width: none;
  margin-left: auto;
  margin-right: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

.match-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 0;
  flex: 1;
}

.match-card {
  width: 100%;
  position: relative;
  border-radius: 4px;
  padding: 8px;
  color: #2b1c18;
  background: var(--card-color, #f3c6c2);
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-height: 0;
  box-shadow: 0 12px 30px rgba(43, 28, 20, 0.1);
  transition: transform 180ms ease, box-shadow 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.match-card:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.9);
  outline-offset: 4px;
}

.match-card-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  background: var(--color-brown-primary);
  color: var(--accent-strong);
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: none;
  min-height: 32px;
  position: absolute;
  top: 8px;
  left: 8px;
}

@media (min-width: 768px) {
  .match-card-badge {
    font-size: 18px;
    padding: 10px 18px;
  }
}

.match-card-badge.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.match-card-portrait {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: none;
  box-shadow: none;
  position: relative;
  isolation: isolate;
  margin-top: 12px;
  background: transparent;
  flex: 1;
  min-height: 0;
  max-width: 220px;
}

/* Color overlay removed - draping cards now show unfiltered face */

.match-card-portrait img,
.match-card-portrait canvas {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  object-fit: cover;
}

.match-card-info {
  width: 100%;
  margin-top: auto;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  padding: 12px 16px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #ffffff;
}

/* Adjust colors for specific cards if needed, but using transparency works well */

.match-card-stars {
  display: flex;
  align-items: center;
  gap: 0;
}

.match-card-stars img {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
}

@media (min-width: 768px) {
  .match-card-stars img {
    width: 32px;
    height: 32px;
  }
}

.match-card-benefit {
  font-weight: 600;
  font-size: 15px;
  text-align: center;
  line-height: 1.35;
}

@media (min-width: 768px) {
  .match-card-benefit {
    font-size: 20px;
  }
}

.match-option-check {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.match-option-check::after {
  content: "";
  display: block;
  width: 36px;
  height: 36px;
  background-color: #D6D3D1;
  -webkit-mask: url("./resource/icon/check_circle_fill.svg") center / contain no-repeat;
  mask: url("./resource/icon/check_circle_fill.svg") center / contain no-repeat;
  transition: background-color 0.2s ease;
}

.match-card.is-selected + .match-option-check::after {
  background-color: var(--color-brown-primary);
}

.match-card.is-selected {
  border: 2px solid var(--color-brown-primary);
}

.match-card.is-dark-card {
  color: rgba(255, 255, 255, 0.95);
}

.match-card.is-dark-card .match-card-info {
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.95);
}

.match-card.is-dark-card .match-card-badge {
  background: var(--accent-strong);
  color: #2b1c18;
}



.draping-summary {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(43, 28, 24, 0.12);
}

.draping-summary-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 600;
}

#drapingSummaryText {
  margin: 0 0 16px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.4;
}


.results-loading-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top, rgba(136, 94, 75, 0.4), transparent 55%), #3a241e;
  color: #d9f5ff;
  text-align: center;
  padding: 40px 20px;
}

.results-loading-content {
  display: grid;
  gap: 22px;
  place-items: center;
}

.results-loading-icon {
  width: clamp(96px, 8vw, 140px);
  height: clamp(96px, 8vw, 140px);
  position: relative;
}

.results-loading-icon span {
  position: absolute;
  inset: 0;
  -webkit-mask: url("./ameli-icon.svg") center / contain no-repeat;
  mask: url("./ameli-icon.svg") center / contain no-repeat;
  border-radius: 0;
}

.results-loading-icon-base {
  background: rgba(255, 255, 255, 0.08);
}

.results-loading-icon-fill {
  background: #baf0ff;
  clip-path: inset(100% 0 0 0);
}

.results-loading-icon.is-animating .results-loading-icon-fill {
  animation: ameliFill 1.3s ease forwards;
}

@keyframes ameliFill {
  0% {
    clip-path: inset(100% 0 0 0);
  }
  100% {
    clip-path: inset(0 0 0 0);
  }
}

.results-loading-text {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.results-loading-title {
  font-size: 32px;
  font-weight: 600;
  margin: 0;
  color: var(--accent-strong);
}

.results-loading-subtitle {
  font-size: 24px;
  margin: 0;
  color: var(--accent-strong);
}

/* ===== Results Screen - Independent Styles ===== */
.results-screen {
  height: 100vh;
  height: 100dvh;
  min-height: auto;
  background: var(--color-brown-primary);
  display: flex;
  flex-direction: column;
  padding: 0;
  box-sizing: border-box;
  color: #2b1c18;
  overflow: hidden;
}

.results-shell {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  background: var(--bg-white);
  border-radius: 16px 16px 0 0;
  padding: 36px;
  padding-bottom: 0;
}

.results-shell > .results-header {
  grid-column: 1 / -1;
  grid-row: 1;
}

.results-model-frame {
  grid-column: 1;
  grid-row: 2;
  height: 100%;
  aspect-ratio: 3 / 4;
  width: auto;
  border: 1px solid var(--color-brown-primary);
  overflow: hidden;
}

.results-model-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.results-shell > .results-panels {
  grid-column: 2;
  grid-row: 2;
  min-height: 0;
  overflow: auto;
}

.results-shell > .results-actions {
  grid-column: 1 / -1;
  grid-row: 3;
}

.results-screen .tabs {
  height: 60px;
  justify-content: flex-start;
}

.results-screen .tab {
  font-size: 18px;
  padding: 0 16px;
  min-width: auto;
}

@media (min-width: 768px) {
  .results-screen .tab {
    font-size: 22px;
  }
}

@media (min-width: 1024px) {
  .results-screen .tab {
    font-size: 28px;
  }
}

.results-panels {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
  min-height: 0;
}


.results-panel {
  margin-bottom: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.results-panel[hidden] {
  display: none;
}

.results-panel.is-active {
  display: block;
}

.results-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
}

.results-title {
  margin: 6px 0;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  color: #2b1c18;
}

.results-tagline {
  margin: 0;
  font-size: 18px;
  color: #6b4c42;
}

/* Tabs Component */
.tabs-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.tabs-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--color-background, #fdfaf7);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  color: var(--text-strong, #0C0A09);
  cursor: pointer;
  transition: opacity 200ms ease, background 150ms ease;
}

.tabs-arrow:hover {
  background: var(--color-surface, #f5f0eb);
}

.tabs-arrow[hidden] {
  display: none;
}

.tabs-arrow--prev {
  left: 8px;
}

.tabs-arrow--next {
  right: 8px;
}

.tabs {
  position: relative;
  display: flex;
  width: 100%;
  height: 80px;
  background: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  height: 100%;
  padding: 0 24px;
  border: none;
  background: transparent;
  color: var(--text-muted, #A6A09B);
  font-family: inherit;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.1px;
  text-transform: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.tab:hover {
  color: var(--text-strong, #0C0A09);
}

.tab:focus-visible {
  outline: 2px solid var(--color-brown-primary);
  outline-offset: -2px;
}

.tab.is-active {
  color: var(--color-brown-primary, #4b3a34);
  font-weight: 600;
}

/* Active indicator */
.tab::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: calc(100% - 32px);
  height: 3px;
  background: var(--color-brown-primary, #4b3a34);
  border-radius: 3px 3px 0 0;
  transition: transform 200ms cubic-bezier(0.2, 0, 0, 1);
}

.tab.is-active::after {
  transform: translateX(-50%) scaleX(1);
}

.results-vm-preview {
  position: relative;
  background: var(--color-brown-primary);
  padding: 0;
  min-height: 400px;
  height: calc(100vh - 240px);
  width: 100%;
  overflow: hidden;
  border-radius: 4px;
}

.results-vm-canvas {
  width: 100%;
  border-radius: 4px;
  background: #0e0704;
  display: block;
  height: 100%;
  object-fit: cover;
}

.results-vm-video {
  position: absolute;
  inset: 16px;
  width: calc(100% - 32px);
  height: calc(100% - 32px);
  object-fit: cover;
  border-radius: 22px;
  opacity: 0;
}

.results-vm-placeholder {
  position: absolute;
  inset: 16px;
  border-radius: 22px;
  background: rgba(8, 5, 4, 0.82);
  color: #f8f2ef;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.results-vm-preview.is-live .results-vm-placeholder {
  display: none;
}

.results-vm-column .results-products-status {
  display: none;
}

.subtype-banner {
  margin: 0 0 8px 0;
  padding: 16px 24px;
  border-radius: 12px 12px 12px 0;
  background: var(--accent);
  color: var(--color-brown-primary);
  font-size: 24px;
  line-height: 1.6;
}

.subtype-banner-title {
  display: inline;
  margin: 0;
}

.subtype-banner-title mark {
  background: linear-gradient(to top, var(--accent-strong) 30%, transparent 30%);
  color: inherit;
  font-weight: 700;
}

.subtype-banner-subtitle {
  display: inline;
  margin: 0;
}

.results-vm-column .results-products {
  grid-template-columns: 1fr;
}

.results-vm-actions {
  display: flex;
  width: 100%;
  margin-top: 12px;
}

.results-vm-home-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  background: var(--color-brown-primary);
  color: var(--accent-strong);
  padding: 32px 36px;
  border-radius: 4px;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  border: none;
}

.results-vm-home-icon {
  display: block;
  width: 28px;
  height: 28px;
  background: currentColor;
  -webkit-mask: url('./resource/icon/home.svg') center / contain no-repeat;
  mask: url('./resource/icon/home.svg') center / contain no-repeat;
}

.results-makeup-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
}

.results-makeup-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.results-makeup-card.is-active img {
  opacity: 1;
}

.results-makeup-label {
  padding: 8px 12px;
  font-size: 18px;
  font-weight: 400;
  background: var(--bg-3);
  color: var(--text-medium);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.results-makeup-card.is-active .results-makeup-label {
  background: var(--color-brown-primary);
  color: var(--accent-strong);
  font-weight: 600;
}

/* Makeup section groups */
.makeup-section {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.makeup-section-header {
  grid-column: 1 / -1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-medium);
  padding: 0 0 4px;
  margin: 0 0 4px;
}

.makeup-section--others {
  margin-top: 16px;
}

.results-description {
  display: grid;
  gap: 8px;
  align-content: start;
}

.results-description-block {
  margin: 0;
  padding: 16px 24px;
  border-radius: 12px 12px 12px 0;
  background: var(--bg-3);
  color: var(--color-brown-primary);
  font-size: 24px;
  line-height: 1.6;
}

.results-description-block mark {
  background: linear-gradient(to top, var(--accent-highlight) 30%, transparent 30%);
  color: inherit;
  font-weight: 700;
}

.results-screen .results-actions {
  display: flex;
  justify-content: flex-end;
  padding-bottom: max(36px, calc(28px + env(safe-area-inset-bottom, 0px)));
}

.results-screen .results-actions__next {
  position: static;
  right: auto;
  bottom: auto;
  width: 100%;
}

.results-actions .cta-button {
  width: 100%;
  min-width: auto;
  max-width: none;
  background: var(--color-brown-primary);
  color: var(--accent-strong);
  border: none;
  border-radius: 4px;
  padding: 32px 36px;
  font-size: 24px;
  font-weight: 700;
  box-shadow: none;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.results-actions .cta-button-arrow {
  display: none;
}

.results-actions .cta-button-text {
  flex: 0 0 auto;
  text-align: center;
}

.results-actions .cta-button-text::after {
  content: "";
  display: inline-block;
  width: 28px;
  height: 28px;
  margin-left: 8px;
  vertical-align: middle;
  background: currentColor;
  -webkit-mask: url('./resource/icon/arrow_forward.svg') center / contain no-repeat;
  mask: url('./resource/icon/arrow_forward.svg') center / contain no-repeat;
}

/* QR Code Overlay on Model Frame */
.results-model-frame {
  position: relative;
}

.results-qr-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-brown-primary);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.results-qr-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.results-qr-description {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
}

.results-qr-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--accent-strong);
}

.results-qr-canvas {
  width: 100px;
  height: 100px;
  border-radius: 4px;
  background: #ffffff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.results-qr-canvas img,
.results-qr-canvas canvas {
  display: block;
  width: 100px !important;
  height: 100px !important;
}

.results-products {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 16px;
}

.results-products-status {
  margin: 0;
  font-size: 16px;
  color: #836c62;
}

.results-product-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.results-product-text-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.results-product-image {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 300px;
  max-height: 300px;
  border-radius: 4px;
  background: var(--bg-3);
}

.results-product-image img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
}

.results-product-card h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-strong);
}

.results-product-price {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-strong);
}

.results-product-price.is-discounted {
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: line-through;
}

.results-product-price-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.results-product-sale-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-sale);
}

.results-product-discount {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-sale);
}

.results-product-desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-medium);
  white-space: pre-line;
}

@media (max-width: 960px) {
  .results-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto;
    gap: 16px;
    padding: 24px;
    padding-bottom: 0;
  }

  .results-shell > .results-header {
    grid-column: 1;
    grid-row: 1;
  }

  .results-model-frame {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    max-width: 300px;
    height: auto;
    aspect-ratio: 3 / 4;
    margin: 0 auto;
  }

  .results-shell > .results-panels {
    grid-column: 1;
    grid-row: 3;
  }

  .results-shell > .results-actions {
    grid-column: 1;
    grid-row: 4;
  }

  .results-products {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}


@media (max-width: 1024px) {
  .match-card {
    border-radius: 4px;
    padding: 16px;
  }
  .match-card-portrait {
    width: 160px;
    height: 160px;
  }
  .match-options {
    gap: 8px;
  }
}

@media (max-width: 820px) {
  .match-options {
    grid-template-columns: 1fr;
  }
  .match-card {
    max-width: 420px;
    margin: 0 auto;
  }
}

.camera-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px;
  padding-bottom: max(36px, calc(28px + env(safe-area-inset-bottom, 0px)));
  display: grid;
  gap: 20px;
  justify-items: center;
}

.camera-bottom.is-counting .camera-note,
.camera-bottom.is-counting .camera-actions {
  display: none;
}

.camera-bottom.is-counting .camera-countdown {
  display: block;
}

.cta-camera .cta-arrow {
  position: static;
  transform: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #26414a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

@media (max-width: 1024px) {
  .portrait-wall {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero {
    padding: 96px 0 150px;
  }

  .hero-focus {
    width: min(64vw, 360px);
    height: min(70vw, 420px);
  }
}

@media (max-width: 720px) {
  .portrait-wall {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .portrait-wall img {
    height: 160px;
  }

  .hero {
    padding: 90px 0 140px;
  }

  .hero-focus {
    position: relative;
    left: 0;
    transform: none;
    width: 100%;
    height: 420px;
    margin-top: 18px;
  }
}

.results-vm-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 240px);
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  pointer-events: auto;
  position: relative;
  z-index: 1;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.results-vm-column::-webkit-scrollbar {
  display: none;
}

.header-stepper-container,
.header-results-container {
  width: 100%;
}
.results-header-content {
  width: 100%;
  flex: 1; /* Ensure it grows */
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--accent);
}

.results-banner-title {
  font-size: 24px;
  font-weight: 600;
  margin: 0;
  color: var(--accent-strong);
}

.results-home-button {
  display: flex;
  align-items: center;
  gap: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.results-home-label {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-strong);
}

.results-home-icon {
  display: block;
  width: 36px;
  height: 36px;
  background: var(--accent-strong);
  mask: url("./resource/icon/home.svg") center / contain no-repeat;
  -webkit-mask: url("./resource/icon/home.svg") center / contain no-repeat;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .results-banner-title {
    font-size: 32px;
  }
  .results-home-label {
    font-size: 26px;
  }
}

@media (min-width: 1024px) {
  .results-banner-title {
    font-size: 40px;
  }
  .results-home-label {
    font-size: 32px;
  }
}

/* VM Tab - Hide model frame and use full-width layout */
.results-shell.is-vm-active > .results-model-frame {
  display: none;
}

.results-shell.is-vm-active > .results-panels {
  grid-column: 1 / -1;
}

.results-shell.is-vm-active > .results-actions {
  display: none;
}

.results-panel[data-results-panel="vm"] {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.results-panel[data-results-panel="vm"].is-active {
  display: flex;
}

.results-panel[data-results-panel="vm"] .results-vm-content {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  flex: 1;
  min-height: 0;
}

.results-panel[data-results-panel="vm"] .results-vm-preview {
  height: 100%;
  aspect-ratio: 3 / 4;
  width: auto;
  min-height: 0;
  border: none;
  border-radius: 0;
}

.results-panel[data-results-panel="vm"] .results-vm-column {
  max-height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.results-panel[data-results-panel="vm"] .results-vm-column .results-products {
  display: contents;
}

/* VM Tab - Responsive layout for narrow screens */
@media (max-width: 768px) {
  .results-panel[data-results-panel="vm"],
  .results-panel[data-results-panel="vm"].is-active {
    display: flex;
    flex-direction: column;
  }

  .results-panel[data-results-panel="vm"] .results-vm-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }

  .results-panel[data-results-panel="vm"] .results-vm-preview {
    width: 100%;
    height: 250px;
    min-height: 200px;
    max-height: 300px;
    aspect-ratio: unset;
  }

  .results-panel[data-results-panel="vm"] .results-vm-column {
    max-height: none;
    overflow-y: visible;
  }

  .results-panel[data-results-panel="vm"] .makeup-section {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
}

.results-panel[data-results-panel="vm"] .makeup-section {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}

.results-panel[data-results-panel="vm"] .makeup-section--primary {
  grid-template-columns: repeat(2, 1fr);
  width: 50%;
}

.results-panel[data-results-panel="vm"] .makeup-section--others {
  grid-template-columns: repeat(4, 1fr);
}

/* ===== Result Detail Screen (Mobile Detail Page) ===== */
.result-detail-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  z-index: 1000;
}

.result-detail-root {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding-bottom: env(safe-area-inset-bottom);
}

/* Media Section */
.result-detail-media {
  position: relative;
  width: 100%;
  aspect-ratio: 375 / 474;
  overflow: hidden;
}

.result-detail-media-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-detail-media-gradient {
  position: absolute;
  width: 100%;
  aspect-ratio: 375 / 237;
  left: 0;
  bottom: 0;
  background: linear-gradient(to top, #ffffff, transparent);
  pointer-events: none;
}

.result-detail-media-content {
  position: absolute;
  width: 100%;
  bottom: 0;
  padding: 16px;
  padding-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  z-index: 1;
}

.result-detail-media-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-detail-media-title {
  margin: 0;
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-brown-primary);
}

.result-detail-media-title mark {
  background: linear-gradient(to top, var(--accent-highlight) 30%, transparent 30%);
  color: inherit;
}

.result-detail-download-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-brown-primary);
  color: var(--accent-strong);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 150ms ease;
}

.result-detail-download-btn:active {
  transform: scale(0.95);
}

/* Description Section */
.result-detail-description {
  padding: 0 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-detail-description-bubble {
  padding: 16px 24px;
  border-radius: 0 12px 12px 12px;
  background: #f6f6f6;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 500;
  color: var(--color-brown-primary);
}

.result-detail-description-bubble mark {
  background: linear-gradient(to top, var(--accent-highlight) 30%, transparent 30%);
  color: inherit;
  font-weight: 700;
}

/* Products Section */
.result-detail-products-section {
  padding: 32px 0;
  background: rgba(235, 245, 248, 0.6);
}

.result-detail-section-header {
  padding: 0 12px;
  margin-bottom: 24px;
}

.result-detail-section-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.6;
  font-weight: 700;
  color: #1a1a1a;
}

.result-detail-section-title mark {
  background: linear-gradient(to top, var(--accent-highlight) 30%, transparent 30%);
  color: inherit;
}

.result-detail-section-subtitle {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  font-weight: 500;
  color: rgba(96, 96, 96, 0.5);
}

.result-detail-products-list {
  display: flex;
  gap: 8px;
  padding: 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.result-detail-products-list::-webkit-scrollbar {
  display: none;
}

/* Product Card */
.result-detail-product-card {
  flex: 0 0 auto;
  width: 150px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

.result-detail-product-text-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.result-detail-product-image-container {
  position: relative;
  width: 150px;
  height: 180px;
  background: #ffffff;
  overflow: hidden;
}

.result-detail-product-image {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 108px;
  height: 180px;
  object-fit: contain;
}

.result-detail-product-tags {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-wrap: wrap;
}

.result-detail-product-tag {
  padding: 4px 10px;
  background: var(--color-brown-primary);
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
}

.result-detail-product-tag--secondary {
  background: var(--accent-strong);
  color: var(--color-brown-primary);
}

.result-detail-product-tag--red {
  background: #d6001c;
  color: #ffffff;
}

.result-detail-product-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-brown-primary);
  margin: 0;
}

.result-detail-product-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
}

.result-detail-product-price.is-discounted {
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: line-through;
}

.result-detail-product-price-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.result-detail-product-sale-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-sale);
}

/* Styling Sections */
.result-detail-styling-section {
  padding: 32px 0;
}

.result-detail-styling-section .result-detail-styling-box {
  margin: 0 12px;
}

.result-detail-styling-section.result-detail-styling-bad {
  background: #f6f6f6;
}

.result-detail-styling-box {
  border: 1px solid var(--color-brown-primary);
  overflow: hidden;
}

.result-detail-styling-box-bad {
  background: #ffffff;
}

.result-detail-color-strip {
  display: flex;
  height: 20px;
}

.result-detail-color-block {
  flex: 1;
  height: 100%;
}

.result-detail-styling-list {
  list-style: none;
  margin: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-detail-styling-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.result-detail-styling-dot {
  width: 4px;
  height: 4px;
  margin-top: 7px;
  margin-left: 7px;
  border-radius: 50%;
  background: var(--color-brown-primary);
  flex-shrink: 0;
}

.result-detail-styling-text {
  font-size: 12px;
  line-height: 1.6;
  font-weight: 500;
  color: var(--color-brown-primary);
  flex: 1;
}

/* Footer */
.result-detail-footer {
  padding: 56px 0;
  background: var(--color-brown-primary);
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: auto;
}

.result-detail-footer-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
}

.result-detail-footer-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #BEE0EA;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-detail-footer-icon {
  display: block;
  width: 24px;
  height: 24px;
  background: var(--color-brown-primary);
}

.result-detail-icon-replay {
  -webkit-mask: url('./resource/icon/replay.svg') center / contain no-repeat;
  mask: url('./resource/icon/replay.svg') center / contain no-repeat;
}

.result-detail-icon-share {
  -webkit-mask: url('./resource/icon/share.svg') center / contain no-repeat;
  mask: url('./resource/icon/share.svg') center / contain no-repeat;
}

.result-detail-icon-home {
  -webkit-mask: url('./resource/icon/home.svg') center / contain no-repeat;
  mask: url('./resource/icon/home.svg') center / contain no-repeat;
}

.result-detail-footer-label {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--accent-strong);
}

/* Responsive adjustments */
@media (min-width: 768px) {
  .result-detail-media {
    aspect-ratio: 16 / 9;
    max-height: 60vh;
  }

  .result-detail-description-bubble {
    font-size: 16px;
  }

  .result-detail-section-title {
    font-size: 24px;
  }

  .result-detail-product-card {
    width: 180px;
  }

  .result-detail-product-image-container {
    width: 180px;
    height: 220px;
  }

  .result-detail-product-image {
    width: 130px;
    height: 220px;
  }

  .result-detail-styling-text {
    font-size: 14px;
  }
}
