/* ==========================================================================
   심야 위스키 바 (Midnight Whiskey Bar) - 스타일시트 (style.css)
   ========================================================================== */

:root {
  --bg-deep: #090604;
  --bg-wood: #170f0a;
  --amber-gold: #d4a359;
  --amber-bright: #f2c97d;
  --amber-dim: rgba(212, 163, 89, 0.25);
  --wax-red: #9e1b1b;
  --wax-red-bright: #c92a2a;
  --wax-shadow: #4a0a0a;
  --text-primary: #f5efe6;
  --text-secondary: #cbbba6;
  --text-muted: #8c7b67;
  --glass-bg: rgba(18, 12, 8, 0.72);
  --glass-border: rgba(212, 163, 89, 0.28);
  --parchment-bg: #f7f1e5;
  --parchment-dark: #eadcc4;
  --parchment-ink: #241a12;
  --font-serif: 'Gowun Batang', Georgia, serif;
  --font-sans: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-brand: 'Cinzel', 'Gowun Batang', serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: #040302;
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ==========================================================================
   1. 9:16 모바일 앱 뷰포트 컨테이너
   ========================================================================== */
.app-viewport {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: var(--vvh, 100dvh);
  max-height: 920px;
  background-color: var(--bg-deep);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.95), 0 0 1px rgba(212, 163, 89, 0.35);
}

@media (min-width: 520px) {
  .app-viewport {
    height: min(94dvh, 880px);
    aspect-ratio: 9 / 16;
    border-radius: 26px;
    border: 1px solid rgba(212, 163, 89, 0.25);
  }
}

/* ==========================================================================
   2. 배경 미디어 & 씬별 CSS 시네마틱 카메라 모션 연출
   ========================================================================== */
.stage-media {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background-color: #0b0705;
}

.bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.9s ease;
  pointer-events: none;
}

.bg-video.is-playing {
  opacity: 1;
  z-index: 2;
}

/* 모바일 브라우저가 멈춘 영상 위에 띄우는 기본 재생 버튼·컨트롤 숨김 */
.bg-video::-webkit-media-controls,
.bg-video::-webkit-media-controls-start-playback-button,
.bg-video::-webkit-media-controls-overlay-play-button,
.bg-video::-webkit-media-controls-panel {
  display: none !important;
  -webkit-appearance: none;
  opacity: 0 !important;
}

/* 크로스페이드 시 새 영상을 기존 영상 위에 올림 */
.bg-video.is-front {
  z-index: 3;
}

.bg-image-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  transform-origin: center center;
  transition: filter 1.2s ease, transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.stage-media.scene-1-motion .bg-image {
  animation: scene1CameraPushIn 14s ease-in-out infinite alternate;
  filter: brightness(0.9) contrast(1.05);
}

@keyframes scene1CameraPushIn {
  0% { transform: scale(1.0) translateY(0%); }
  100% { transform: scale(1.12) translateY(-1.5%); }
}

.stage-media.scene-2-motion .bg-image {
  animation: scene2GentleBreathing 6s ease-in-out infinite alternate;
  filter: brightness(0.95) contrast(1.05);
}

@keyframes scene2GentleBreathing {
  0% { transform: scale(1.08) translateY(-1%); }
  100% { transform: scale(1.11) translateY(-1.8%); }
}

.stage-media.scene-3-motion .bg-image {
  animation: scene3TiltDownTable 9s ease-in-out infinite alternate;
  filter: blur(3.5px) brightness(0.8) saturate(1.1);
}

@keyframes scene3TiltDownTable {
  0% { transform: scale(1.18) translateY(-6%); }
  100% { transform: scale(1.23) translateY(-8.5%); }
}

/* Scene 4 (문진 단계): 바텐더 얼굴이 선명하게 보이도록 블러 제거 및 밝기 확보 */
.stage-media.scene-4-motion .bg-image {
  animation: scene4SlideGlassWait 7s ease-in-out infinite alternate;
  filter: brightness(0.92) contrast(1.04);
}

@keyframes scene4SlideGlassWait {
  0% { transform: scale(1.08) translateY(-1.5%); }
  100% { transform: scale(1.11) translateY(-2.5%); }
}

/* Scene 5 (실시간 상담 단계): 배경 영상/이미지가 채팅창 뒤로 선명히 비치도록 밝기 유지 */
.stage-media.scene-5-motion .bg-image {
  animation: scene5AttentiveLoop 4s ease-in-out infinite alternate;
  filter: brightness(0.9) contrast(1.05);
}

@keyframes scene5AttentiveLoop {
  0% { transform: scale(1.08) translateY(-1.2%); }
  100% { transform: scale(1.095) translateY(-1.6%); }
}

.ambient-lamp-glow {
  position: absolute;
  top: -8%;
  left: 50%;
  transform: translateX(-50%);
  width: 85%;
  height: 45%;
  background: radial-gradient(circle, rgba(242, 185, 100, 0.24) 0%, rgba(212, 140, 55, 0.08) 45%, transparent 72%);
  pointer-events: none;
  z-index: 3;
  animation: lampPulse 5s ease-in-out infinite alternate;
}

@keyframes lampPulse {
  0% { opacity: 0.72; transform: translateX(-50%) scale(0.96); }
  100% { opacity: 1; transform: translateX(-50%) scale(1.05); }
}

.smoke-container {
  position: absolute;
  bottom: 18%;
  left: 52%;
  width: 140px;
  height: 260px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 3;
}

.smoke-wisp {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 48px;
  height: 150px;
  background: radial-gradient(ellipse at center, rgba(235, 225, 210, 0.16) 0%, rgba(210, 195, 175, 0.05) 50%, transparent 75%);
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0;
}

.smoke-wisp.wisp-1 { animation: smokeRise 7.5s ease-in-out infinite; }
.smoke-wisp.wisp-2 { left: 35%; animation: smokeRise 9s ease-in-out 2.5s infinite; }
.smoke-wisp.wisp-3 { left: 62%; animation: smokeRise 8.2s ease-in-out 4.8s infinite; }

@keyframes smokeRise {
  0% { opacity: 0; transform: translateY(20px) scaleX(0.7) rotate(-4deg); }
  35% { opacity: 0.55; }
  70% { opacity: 0.3; transform: translateY(-95px) scaleX(1.35) rotate(8deg); }
  100% { opacity: 0; transform: translateY(-170px) scaleX(1.7) rotate(-6deg); }
}

/* 배경 영상이 더 잘 보이도록 비네팅 농도 완화 */
.vignette-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(7, 4, 3, 0.55) 0%,
    rgba(7, 4, 3, 0.05) 28%,
    rgba(7, 4, 3, 0.12) 58%,
    rgba(9, 6, 4, 0.72) 88%,
    rgba(7, 4, 3, 0.88) 100%
  );
}

/* ==========================================================================
   3. 상단 헤더 (뒤로가기 / 로고 / 오디오 / 홈 버튼)
   ========================================================================== */
.top-bar {
  position: relative;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 10px;
  background: linear-gradient(180deg, rgba(6, 4, 2, 0.82) 0%, transparent 100%);
  gap: 8px;
}

.top-left-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  cursor: pointer;
  user-select: none;
  min-width: 0;
}

.brand-sub {
  display: block;
  font-size: 8.5px;
  letter-spacing: 0.22em;
  color: var(--amber-gold);
  opacity: 0.85;
  margin-bottom: 2px;
}

.brand-title {
  font-family: var(--font-brand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(20, 14, 9, 0.75);
  border: 1px solid var(--amber-dim);
  font-size: 10.5px;
  color: var(--amber-bright);
  backdrop-filter: blur(6px);
}

.mode-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber-bright);
  box-shadow: 0 0 8px var(--amber-bright);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(212, 163, 89, 0.3);
  background: rgba(18, 12, 8, 0.72);
  color: var(--amber-bright);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(6px);
  flex-shrink: 0;
}

.icon-btn:hover {
  background: rgba(212, 163, 89, 0.22);
  border-color: var(--amber-bright);
}

.svg-icon {
  width: 17px;
  height: 17px;
}

/* ==========================================================================
   4. 씬(Scene) 전환 애니메이션 및 공통 레이아웃
   ========================================================================== */
.scene-stage {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.scene {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px 16px 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              visibility 0.45s;
}

.scene.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  /* 나타날 땐 visibility를 즉시 켜야 바로 focus()가 먹어 모바일 키패드가 자동으로 뜸 (사라질 땐 기존처럼 페이드) */
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              visibility 0s;
}

.scene-content {
  width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
}

/* ■ Scene 1 */
.scene-1-layout {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: 12px;
}

.intro-typography {
  margin-top: auto;
  margin-bottom: 24px;
  text-align: center;
}

.intro-time {
  font-family: var(--font-brand);
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--amber-gold);
  margin-bottom: 10px;
}

.intro-headline {
  font-family: var(--font-serif);
  font-size: 23px;
  line-height: 1.5;
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.9);
  margin-bottom: 12px;
}

.intro-desc {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.scene-action-bottom {
  text-align: center;
}

.primary-glow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  border-radius: 13px;
  border: 1px solid rgba(242, 201, 125, 0.55);
  background: linear-gradient(135deg, #b88136 0%, #87581d 50%, #613c10 100%);
  color: #fffaf2;
  font-family: var(--font-serif);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(184, 129, 54, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.2s ease, box-shadow 0.25s ease, filter 0.2s ease;
}

.primary-glow-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.sound-notice {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ■ Scene 2 & 3 */
.scene-bottom-sheet {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 100%;
}

.dialogue-box {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 15px 18px;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
}

.dialogue-box.compact {
  padding: 12px 16px;
}

.speaker-tag {
  font-family: var(--font-brand);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--amber-gold);
  margin-bottom: 5px;
}

.bartender-quote {
  font-family: var(--font-serif);
  font-size: 14.2px;
  line-height: 1.62;
  color: var(--text-primary);
  word-break: keep-all;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 15px;
  border-radius: 12px;
  border: 1px solid rgba(212, 163, 89, 0.24);
  background: rgba(22, 15, 10, 0.82);
  color: var(--text-primary);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.22s ease;
}

.choice-btn:hover {
  border-color: var(--amber-bright);
  background: rgba(45, 30, 18, 0.9);
  transform: translateX(3px);
}

.choice-prefix {
  font-family: var(--font-brand);
  font-size: 11px;
  color: var(--amber-gold);
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(212, 163, 89, 0.14);
}

/* ■ Scene 3: 칵테일 3종 */
.cocktail-cards {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.cocktail-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(212, 163, 89, 0.25);
  background: rgba(19, 13, 9, 0.84);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.24s ease;
}

.cocktail-card.recommended {
  border-color: rgba(242, 201, 125, 0.65);
  background: linear-gradient(135deg, rgba(42, 28, 16, 0.9) 0%, rgba(22, 14, 9, 0.9) 100%);
  box-shadow: 0 6px 22px rgba(212, 163, 89, 0.18);
}

.cocktail-card:hover {
  border-color: var(--amber-bright);
  transform: translateY(-2px);
}

.recommend-ribbon {
  position: absolute;
  top: -8px;
  right: 14px;
  background: var(--amber-gold);
  color: #140c06;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
}

.cocktail-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(212, 163, 89, 0.3);
}

.cocktail-icon-wrap.peach { background: rgba(235, 135, 110, 0.15); color: #f4a28c; }
.cocktail-icon-wrap.gintonic { background: rgba(120, 195, 220, 0.15); color: #9be0f7; }
.cocktail-icon-wrap.ontherocks { background: rgba(212, 163, 89, 0.18); color: var(--amber-bright); }

.cocktail-svg { width: 22px; height: 22px; }
.cocktail-info { flex: 1; }
.cocktail-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.cocktail-name { font-family: var(--font-serif); font-size: 14.5px; font-weight: 700; color: var(--text-primary); }
.cocktail-tag { font-size: 10.5px; padding: 2px 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); color: var(--text-secondary); }
.cocktail-tag.highlight { background: rgba(212, 163, 89, 0.25); color: var(--amber-bright); }
.cocktail-desc { font-size: 11.8px; line-height: 1.45; color: var(--text-secondary); word-break: keep-all; }

/* ==========================================================================
   5. Scene 4: 질문 1개씩 노출되는 컴팩트 문진 카드 (바텐더 얼굴 시야 확보)
   ========================================================================== */
.coaster-card.compact-step-card {
  background: linear-gradient(160deg, rgba(22, 15, 10, 0.78) 0%, rgba(14, 9, 6, 0.85) 100%);
  border: 1px solid rgba(212, 163, 89, 0.38);
  border-radius: 18px;
  padding: 4px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
}

.coaster-border {
  border: 1px dashed rgba(212, 163, 89, 0.28);
  border-radius: 14px;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.phase-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.phase-step {
  display: inline-block;
  font-family: var(--font-brand);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--amber-bright);
  background: rgba(212, 163, 89, 0.15);
  border: 1px solid rgba(212, 163, 89, 0.3);
  padding: 3px 9px;
  border-radius: 999px;
}

.step-counter-text {
  font-family: var(--font-brand);
  font-size: 10.5px;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
}

.step-progress-bar-wrap {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.step-progress-fill {
  height: 100%;
  width: 11%;
  background: linear-gradient(90deg, var(--amber-gold), var(--amber-bright));
  transition: width 0.3s ease;
}

.coaster-header.compact-header {
  text-align: center;
  margin-bottom: 2px;
}

.coaster-quote {
  font-family: var(--font-serif);
  font-size: 13px;
  line-height: 1.52;
  color: var(--text-primary);
  word-break: keep-all;
}

.question-step-pane {
  animation: stepFadeIn 0.25s ease forwards;
}

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

.input-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.input-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--amber-bright);
}

.coaster-input {
  width: 100%;
  padding: 10px 11px;
  border-radius: 10px;
  border: 1px solid rgba(212, 163, 89, 0.32);
  background: rgba(9, 6, 4, 0.78);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease, opacity 0.2s ease;
}

.coaster-input:focus {
  border-color: var(--amber-bright);
}

.coaster-input:disabled {
  opacity: 0.45;
  background: rgba(30, 22, 16, 0.5);
  color: var(--text-muted);
  cursor: not-allowed;
}

.uppercase-input {
  text-transform: uppercase;
}

/* 본인 / 상대방 2열 입력 + '모름' 토글 버튼 */
.dual-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.input-with-unknown {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-unknown .coaster-input {
  padding-right: 46px;
  font-size: 12.2px;
}

.unknown-toggle-btn {
  position: absolute;
  right: 5px;
  padding: 4px 7px;
  border-radius: 6px;
  border: 1px solid rgba(212, 163, 89, 0.3);
  background: rgba(32, 22, 14, 0.9);
  color: var(--text-secondary);
  font-size: 10.5px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.unknown-toggle-btn.active {
  background: var(--amber-gold);
  color: #140c06;
  border-color: var(--amber-bright);
  font-weight: 700;
}

/* 1. 선택지 칩 영역 전체를 세로 1열로 강제 설정 */
.option-chips-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.option-chips-wrap.single-col {
  flex-direction: column;
  width: 100%;
}

/* 2. 세로 스크롤 영역 및 가로 스크롤/잘림 현상 원천 차단 */
.option-chips-wrap.compact-chips {
  display: flex;
  flex-direction: column;
  max-height: 195px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 3px;
  width: 100%;
}

.option-chips-wrap.compact-chips::-webkit-scrollbar {
  width: 4px;
}
.option-chips-wrap.compact-chips::-webkit-scrollbar-thumb {
  background: rgba(212, 163, 89, 0.35);
  border-radius: 4px;
}

/* 3. 개별 버튼 폭을 카드 전체 가로 폭(100%)에 맞추어 세로로 정렬 */
.opt-chip {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(212, 163, 89, 0.25);
  background: rgba(14, 9, 6, 0.78);
  color: var(--text-secondary);
  font-size: 12.3px;
  text-align: left;
  cursor: pointer;
  word-break: keep-all;
  transition: all 0.18s ease;
}

.opt-chip:hover {
  border-color: rgba(242, 201, 125, 0.55);
  color: var(--text-primary);
}

.opt-chip.active {
  background: rgba(212, 163, 89, 0.28);
  border-color: var(--amber-bright);
  color: var(--amber-bright);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(212, 163, 89, 0.16);
}

/* Q8 고민 복수 선택 리스트 (바텐더 얼굴 가리지 않도록 스크롤 높이 제한) */
.worry-choice-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 195px;
  overflow-y: auto;
  padding-right: 3px;
}

.worry-choice-list::-webkit-scrollbar {
  width: 4px;
}
.worry-choice-list::-webkit-scrollbar-thumb {
  background: rgba(212, 163, 89, 0.35);
  border-radius: 4px;
}

.worry-btn {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(212, 163, 89, 0.24);
  background: rgba(16, 11, 7, 0.8);
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
}

.worry-btn:hover {
  border-color: rgba(242, 201, 125, 0.55);
}

.worry-btn.active {
  background: rgba(212, 163, 89, 0.28);
  border-color: var(--amber-bright);
  box-shadow: 0 0 12px rgba(212, 163, 89, 0.18);
}

.worry-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.worry-btn.active .worry-title {
  color: var(--amber-bright);
}

.worry-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

.step-next-btn {
  margin-top: 2px;
  padding: 12px 18px;
}

/* ==========================================================================
   6. Scene 5: 실시간 심층 상담 오버레이 (배경 영상이 잘 보이도록 투명도 대폭 낮춤)
   ========================================================================== */
#scene-5 {
  padding: 8px 12px 14px;
  justify-content: flex-end;
}

.chat-overlay-container {
  width: 100%;
  height: 72%;
  display: flex;
  flex-direction: column;
  /* 배경 바텐더 영상이 선명히 비치도록 투명도를 0.26으로 낮추고 블러를 최소화 */
  background: rgba(12, 8, 5, 0.26);
  border: 1px solid rgba(212, 163, 89, 0.24);
  border-radius: 20px;
  backdrop-filter: blur(2px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.chat-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(212, 163, 89, 0.16);
  background: rgba(16, 10, 7, 0.42);
}

.status-left {
  display: flex;
  align-items: center;
  gap: 7px;
}

.bartender-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #52c41a;
  box-shadow: 0 0 8px #52c41a;
}

.status-title {
  font-size: 11.5px;
  color: var(--text-primary);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}

.relationship-pill {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(20, 13, 9, 0.55);
  color: var(--amber-bright);
  border: 1px solid rgba(212, 163, 89, 0.32);
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(212, 163, 89, 0.3);
  border-radius: 4px;
}

.msg-row {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: msgFadeIn 0.32s ease forwards;
}

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

.msg-row.bartender { align-self: flex-start; }
.msg-row.user { align-self: flex-end; }

.msg-sender {
  font-size: 10.5px;
  color: var(--amber-bright);
  margin-bottom: 4px;
  padding-left: 2px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
}

/* 말풍선도 반투명 글래스 처리하여 뒷배경 영상의 움직임이 은은하게 투과되도록 설정 */
.msg-bubble {
  padding: 11px 14px;
  border-radius: 15px;
  font-size: 13.6px;
  line-height: 1.65;
  word-break: keep-all;
  white-space: pre-wrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.msg-row.bartender .msg-bubble {
  font-family: var(--font-serif);
  background: rgba(22, 15, 10, 0.58);
  border: 1px solid rgba(212, 163, 89, 0.32);
  color: var(--text-primary);
  border-top-left-radius: 4px;
}

.msg-row.user .msg-bubble {
  background: rgba(143, 98, 38, 0.64);
  border: 1px solid rgba(242, 201, 125, 0.42);
  color: #fffaf2;
  border-top-right-radius: 4px;
}

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber-gold);
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.15); }
}

/* 비밀 편지 봉투: 판매 배너가 아니라 바 위에 놓인 편지처럼 차분하고 낮게 */
.secret-letter-cta-wrap {
  flex-shrink: 0;
  padding: 4px 12px 6px;
  animation: goldenRise 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

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

.golden-letter-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid rgba(212, 163, 89, 0.45);
  border-left: 3px solid var(--wax-red);
  background: linear-gradient(180deg, rgba(245, 233, 210, 0.13) 0%, rgba(32, 22, 14, 0.72) 100%);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.wax-mini-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c43232 0%, var(--wax-red) 70%);
  border: 1px solid rgba(255, 215, 160, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #ffecd2;
  flex-shrink: 0;
}

.letter-btn-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.letter-btn-text strong {
  font-family: var(--font-serif);
  font-size: 13px;
  color: var(--amber-bright);
}

.letter-btn-text span {
  font-size: 10.5px;
  color: var(--text-secondary);
}

.letter-arrow {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(212, 163, 89, 0.45);
  color: var(--amber-bright);
}

/* 채팅 입력창 영역 (반투명 처리) */
.chat-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(15, 10, 7, 0.52);
  border-top: 1px solid rgba(212, 163, 89, 0.22);
}

.chat-textarea {
  flex: 1;
  overflow-y: hidden;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(212, 163, 89, 0.3);
  background: rgba(8, 5, 3, 0.58);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.45;
  resize: none;
  outline: none;
}

.chat-textarea:focus {
  border-color: var(--amber-bright);
}

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(242, 201, 125, 0.5);
  background: linear-gradient(135deg, #b88136 0%, #7d5018 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.send-svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   7. 모달 (만년필 로딩 / 비밀 편지 페이월 / 관리자 콘솔) & 토스트
   ========================================================================== */
.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(6, 4, 3, 0.86);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  animation: fadeInModal 0.35s ease;
}

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

.loading-stage-card {
  width: 100%;
  max-width: 360px;
  background: linear-gradient(160deg, #1b120c 0%, #0e0906 100%);
  border: 1px solid rgba(212, 163, 89, 0.45);
  border-radius: 20px;
  padding: 28px 22px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
}

.fountain-pen-scene {
  position: relative;
  width: 130px;
  height: 120px;
  margin: 0 auto 18px;
}

.parchment-preview {
  width: 96px;
  height: 110px;
  margin: 0 auto;
  background: var(--parchment-bg);
  border-radius: 6px;
  padding: 16px 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.ink-line {
  height: 3px;
  background: #3a2818;
  border-radius: 2px;
  width: 0%;
  animation: writeInk 2.4s ease-in-out infinite;
}
.ink-line.line-2 { animation-delay: 0.4s; }
.ink-line.line-3 { animation-delay: 0.8s; }
.ink-line.line-4 { animation-delay: 1.2s; width: 60%; }

@keyframes writeInk {
  0% { width: 0%; opacity: 0.3; }
  60% { width: 100%; opacity: 0.9; }
  100% { width: 100%; opacity: 0.4; }
}

.fountain-pen-icon {
  position: absolute;
  top: 12px;
  right: 8px;
  font-size: 28px;
  animation: penMove 1.6s ease-in-out infinite alternate;
}

@keyframes penMove {
  0% { transform: translate(-18px, 6px) rotate(-12deg); }
  100% { transform: translate(4px, 34px) rotate(8deg); }
}

.wax-drop-anim {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
}

.wax-seal-stamp {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--wax-red-bright) 0%, var(--wax-red) 75%);
  border: 2px solid #e0a96d;
  color: #ffebd2;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(158, 27, 27, 0.7);
}

.loading-title {
  font-family: var(--font-serif);
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--amber-bright);
  margin-bottom: 10px;
}

.loading-sub {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.loading-progress-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.loading-progress-bar {
  width: 20%;
  height: 100%;
  background: linear-gradient(90deg, var(--amber-gold), var(--amber-bright));
  transition: width 0.4s ease;
}

/* 비밀 편지 뷰어 */
.letter-viewer-container {
  width: 100%;
  height: 92%;
  display: flex;
  flex-direction: column;
  background: #17100b;
  border: 1px solid rgba(212, 163, 89, 0.5);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.95);
}

.letter-top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #120c08;
  border-bottom: 1px solid rgba(212, 163, 89, 0.25);
}

.letter-serial {
  font-family: var(--font-brand);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--amber-gold);
}

.letter-close-btn {
  background: transparent;
  border: 1px solid rgba(212, 163, 89, 0.35);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}

.letter-paper {
  flex: 1;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--parchment-bg) 0%, var(--parchment-dark) 100%);
  color: var(--parchment-ink);
  padding: 24px 20px 34px;
  scroll-behavior: smooth;
}

.letter-crest {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.crest-line {
  flex: 1;
  height: 1px;
  background: rgba(90, 60, 30, 0.35);
}

.crest-symbol {
  font-family: var(--font-brand);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: #6e4920;
  font-weight: 700;
}

.letter-main-title {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.45;
  text-align: center;
  color: #1e130a;
  margin-bottom: 6px;
}

.letter-meta-info {
  text-align: center;
  font-size: 11.5px;
  color: #6c543b;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px double rgba(90, 60, 30, 0.3);
}

.letter-section {
  margin-bottom: 22px;
}

.chapter-badge {
  display: inline-block;
  font-family: var(--font-brand);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #fff8ee;
  background: #5c3b18;
  padding: 3px 9px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.chapter-title {
  font-family: var(--font-serif);
  font-size: 15.5px;
  font-weight: 700;
  color: #2b1a0c;
  margin-bottom: 10px;
  line-height: 1.45;
}

.letter-text-block {
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 1.82;
  color: #241911;
  white-space: pre-wrap;
  word-break: keep-all;
}

.highlight-free-lead {
  background: rgba(184, 129, 54, 0.11);
  border-left: 3px solid #8a5a20;
  padding: 12px 14px;
  border-radius: 0 8px 8px 0;
}

.locked-report-zone {
  position: relative;
  margin-top: 8px;
  min-height: 390px;
}

.locked-report-zone.is-locked .locked-content-inner {
  filter: blur(6.5px);
  user-select: none;
  pointer-events: none;
  max-height: 410px;
  overflow: hidden;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 100%);
}

.locked-report-zone.is-unlocked .locked-content-inner {
  filter: none;
  user-select: auto;
  pointer-events: auto;
  max-height: none;
  mask-image: none;
  transition: filter 0.9s ease;
}

.paywall-overlay-card {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: linear-gradient(180deg, rgba(247, 241, 229, 0.35) 0%, rgba(24, 15, 10, 0.96) 24%, rgba(16, 10, 7, 0.99) 100%);
  border: 1px solid rgba(212, 163, 89, 0.55);
  border-radius: 16px;
  padding: 22px 18px 20px;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.paywall-overlay-card.melting {
  opacity: 0;
  transform: scale(0.94) translateY(16px);
  pointer-events: none;
}

.sealing-wax-emblem {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d93838 0%, var(--wax-red) 62%, var(--wax-shadow) 100%);
  box-shadow: 0 6px 18px rgba(158, 27, 27, 0.65), inset 0 2px 4px rgba(255, 180, 180, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border: 2px solid rgba(242, 201, 125, 0.5);
  transition: transform 0.7s ease, filter 0.7s ease;
}

.sealing-wax-emblem.wax-melting {
  transform: scale(1.35) rotate(15deg);
  filter: blur(6px);
  opacity: 0;
}

.wax-outer-ring {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 220, 185, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wax-inner-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}

.wax-monogram {
  font-family: var(--font-brand);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffebd2;
}

.wax-sub {
  font-size: 8px;
  letter-spacing: 0.12em;
  color: #f3c69f;
}

.paywall-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--amber-bright);
  margin-bottom: 8px;
}

.paywall-subcopy {
  font-size: 12.8px;
  line-height: 1.58;
  color: var(--text-secondary);
  margin-bottom: 14px;
  word-break: keep-all;
}

.paywall-composition-box {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(212, 163, 89, 0.3);
  border-radius: 12px;
  padding: 12px 13px;
  margin-bottom: 15px;
  text-align: left;
}

.comp-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--amber-gold);
  margin-bottom: 4px;
}

.comp-detail {
  font-size: 12px;
  font-weight: 600;
  color: #fff6e8;
  margin-bottom: 8px;
  line-height: 1.45;
}

.comp-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.comp-checklist li::before {
  content: "✓ ";
  color: var(--amber-bright);
  font-weight: bold;
}

.unlock-pay-btn {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #f7d488;
  background: linear-gradient(135deg, #b52424 0%, #821414 100%);
  color: #fffdf9;
  font-family: var(--font-serif);
  font-size: 14.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(181, 36, 36, 0.5);
}

.paywall-guarantee {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.letter-signature {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid rgba(90, 60, 30, 0.3);
  text-align: right;
  font-family: var(--font-serif);
}

.sig-closing { font-size: 12.5px; color: #5c4328; margin-bottom: 4px; }
.sig-name { font-size: 15px; font-weight: 700; color: #2b1a0c; }

.letter-save-toolbar {
  margin-top: 22px;
  padding: 16px;
  border-radius: 12px;
  background: #23170e;
  color: var(--text-primary);
  text-align: center;
}

.save-toolbar-notice { font-size: 12px; color: var(--amber-bright); margin-bottom: 10px; }
.save-btn-group { display: flex; gap: 8px; }

.secondary-action-btn {
  flex: 1;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid rgba(212, 163, 89, 0.45);
  background: rgba(212, 163, 89, 0.15);
  color: var(--amber-bright);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.admin-modal-card {
  width: 100%;
  max-width: 410px;
  background: #16100b;
  border: 1px solid rgba(212, 163, 89, 0.45);
  border-radius: 18px;
  padding: 20px 18px;
  color: var(--text-primary);
}

.admin-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(212, 163, 89, 0.2);
}

.admin-modal-header h3 { font-size: 15px; color: var(--amber-bright); }
.admin-desc { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 14px; line-height: 1.5; }
.admin-form { display: flex; flex-direction: column; gap: 12px; }
.input-hint { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.admin-stats-box {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  color: var(--text-secondary);
}
.admin-btn-row { display: flex; gap: 8px; }

.toast-container {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200; /* 모든 모달(카드 95, 확인창 96) 위: 모달 안에서 띄운 안내가 가려지지 않게 */
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 88%;
  pointer-events: none;
}

.toast-msg {
  background: rgba(20, 14, 9, 0.95);
  border: 1px solid var(--amber-gold);
  color: var(--text-primary);
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 12.8px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
}

.hidden {
  display: none !important;
}

@media print {
  body * { visibility: hidden; }
  #secret-letter-modal, #secret-letter-modal * { visibility: visible; }
  #secret-letter-modal { position: absolute; inset: 0; background: #fff; padding: 0; }
  .letter-top-nav, #paywall-overlay-card, #letter-save-toolbar { display: none !important; }
  .letter-viewer-container, .letter-paper { height: auto; overflow: visible; border: none; box-shadow: none; }
}
/* 성별 선택 (내담자·상대) */
.gender-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.gender-who { flex: 0 0 34px; font-size: 12px; color: var(--text-secondary); }
.option-chips-wrap.gender-chips { flex-direction: row; gap: 6px; }
.gender-chips .opt-chip { flex: 1 1 0; width: auto; min-width: 0; justify-content: center; text-align: center; padding: 9px 4px; white-space: nowrap; }
.gender-chips .opt-chip:last-child { flex-grow: 1.8; }

/* MBTI: 키보드 없이 글자 쌍을 눌러 선택 */
.dual-input-grid.mbti-grid { grid-template-columns: 1fr; gap: 6px; }
.mbti-pairs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 4px; }
.mbti-pair { display: flex; border: 1px solid rgba(212, 163, 89, 0.25); border-radius: 10px; overflow: hidden; }
.mbti-pair button { flex: 1; padding: 8px 0; border: 0; background: rgba(14, 9, 6, 0.78); color: var(--text-secondary); font-size: 13px; font-weight: 600; cursor: pointer; }
.mbti-pair button.active { background: rgba(212, 163, 89, 0.28); color: var(--amber-bright); }
.mbti-pairs.disabled { opacity: 0.35; pointer-events: none; }

/* 문진: 선택 질문 건너뛰기 · 익명 활용 동의 */
.skip-optional-btn { width: 100%; margin-top: 8px; padding: 10px; border: 0; background: none; color: var(--text-secondary); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.consent-row { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: 11.5px; line-height: 1.5; color: var(--text-muted); cursor: pointer; }
.consent-row input { margin-top: 2px; accent-color: var(--amber-gold); flex: 0 0 auto; }

/* 편지 잠금: 결제 전엔 본문이 아예 없고 자리표시 줄만, 페이월 카드는 흐름 안에 (상품 두 개라 높이가 늘어남) */
.skeleton-text { min-height: 86px; border-radius: 4px; background: repeating-linear-gradient(180deg, rgba(36, 26, 18, 0.14) 0 11px, transparent 11px 25px); }
.locked-report-zone.is-locked { min-height: 0; }
.locked-report-zone.is-locked .locked-content-inner { max-height: 240px; }
.locked-report-zone.is-locked .paywall-overlay-card { position: relative; inset: auto; margin-top: -150px; }
.letter-pending-note { margin: 4px 0 14px; padding: 10px 12px; border-radius: 8px; background: rgba(212, 163, 89, 0.16); color: #6b4a22; font-size: 12.5px; text-align: center; }

/* 페이월: 상품 선택 */
.paywall-social-proof { margin: -4px 0 10px; font-size: 12px; color: var(--amber-bright); }
.tier-options { width: 100%; display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.tier-option { position: relative; width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(212, 163, 89, 0.3); background: rgba(255, 255, 255, 0.03); color: var(--text-primary); text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 5px; }
.tier-option.active { border-color: var(--amber-bright); background: rgba(212, 163, 89, 0.14); box-shadow: 0 0 0 1px var(--amber-bright) inset; }
.tier-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tier-name { font-family: var(--font-serif); font-size: 14px; font-weight: 700; }
.tier-price { font-size: 14px; font-weight: 700; color: var(--amber-bright); white-space: nowrap; }
.tier-desc { font-size: 11.5px; line-height: 1.5; color: var(--text-secondary); }
.tier-badge { position: absolute; top: -9px; right: 12px; padding: 2px 9px; border-radius: 999px; background: var(--wax-red-bright); color: #fff; font-size: 10.5px; font-weight: 700; }
.text-link-btn { margin-top: 10px; border: 0; background: none; color: var(--amber-bright); font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.text-link-btn.subtle { margin-top: 4px; color: var(--text-muted); font-size: 11.5px; }

/* 결제 후: 저장 도구 · 업그레이드 · 시그니처 · 후기 */
.save-btn-group { flex-wrap: wrap; }
.save-btn-group .secondary-action-btn { flex: 1 1 calc(50% - 4px); }
.save-btn-group .upgrade-btn { flex-basis: 100%; border-color: var(--wax-red-bright); background: rgba(201, 42, 42, 0.18); color: #ffd9d9; }

/* 연애 포지션 카드 */
#card-modal { z-index: 95; }
.card-modal-box { width: 100%; max-width: 360px; max-height: 94vh; overflow-y: auto; padding: 18px 16px; border-radius: 18px; background: #16100b; border: 1px solid rgba(212, 163, 89, 0.45); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.card-modal-title { font-family: var(--font-serif); font-size: 15px; color: var(--amber-bright); line-height: 1.5; }
.card-preview { width: 100%; max-width: 260px; aspect-ratio: 9 / 16; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); }
.card-hint { font-size: 11px; color: var(--text-muted); }

@media print {
  #paywall-overlay-card, #letter-save-toolbar, .letter-pending-note, .legal-notice { display: none !important; }
  .locked-report-zone.is-unlocked .locked-content-inner { max-height: none; }
  .rx-signal, .rx-step, .rx-branch, .rx-score, .rx-script, .rx-taboo { break-inside: avoid; }
}

/* 채팅: 전송 중 버튼 잠금 · 모바일 키보드가 올라와 화면이 낮아지면 대화창을 키워 찌그러짐 방지 */
.send-btn:disabled { opacity: 0.45; cursor: default; }
@media (max-height: 580px) {
  /* 문진: 키보드 위 좁은 공간에 바텐더 얼굴 일부 + 입력칸 + 다음 버튼이 다 보이게 */
  #scene-4 { padding: 6px 12px 8px; }
  #scene-4 .scene-bottom-sheet { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  #scene-4 .coaster-border { padding: 9px 12px 10px; gap: 7px; }
  #scene-4 .coaster-quote { font-size: 12px; line-height: 1.42; }
  #scene-4 .coaster-header.compact-header { margin-bottom: 0; }
  #scene-4 .input-group { gap: 4px; }
  #scene-4 .input-label { font-size: 11px; }
  #scene-5 { padding: 4px 8px 6px; }
  .chat-overlay-container { height: 92%; }
  .chat-status-bar { padding: 6px 12px; }
}

/* 문진: 선택 질문 한 페이지 */
.optional-group + .optional-group { margin-top: 10px; }

/* 홈 초기화 확인 창 */
#confirm-modal { z-index: 96; }
.confirm-box { width: 100%; max-width: 330px; padding: 22px 18px 18px; border-radius: 16px; background: #16100b; border: 1px solid rgba(212, 163, 89, 0.45); box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6); text-align: center; }
.confirm-title { font-family: var(--font-serif); font-size: 16px; font-weight: 700; color: var(--amber-bright); margin-bottom: 8px; }
.confirm-desc { font-size: 12.8px; line-height: 1.6; color: var(--text-secondary); margin-bottom: 16px; word-break: keep-all; }
.confirm-actions { display: flex; gap: 8px; }
.confirm-danger-btn { flex: 1; padding: 11px 12px; border-radius: 10px; border: 1px solid rgba(201, 42, 42, 0.7); background: rgba(158, 27, 27, 0.55); color: #ffe3e3; font-size: 12.5px; font-weight: 600; cursor: pointer; }

/* 페이월 하단 법적 고지 (PG 심사용) */
.legal-notice { width: 100%; margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(212, 163, 89, 0.18); text-align: left; font-size: 10.5px; line-height: 1.6; color: var(--text-muted); }
.legal-notice summary { cursor: pointer; text-align: center; font-size: 11px; color: var(--text-secondary); }
.legal-biz { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 10px 0 6px; }
.legal-biz dt { color: var(--text-secondary); }
.legal-links { margin: 6px 0; text-align: center; }
.legal-links a { color: var(--amber-bright); }
.legal-refund { word-break: keep-all; }

/* ── 비밀 편지 결과지 컴포넌트 (전문 심리 검사 결과지 톤) ── */
.chapter-badge.sig { background: linear-gradient(90deg, #7a1515, #5c3b18); }
.rx-subtitle { font-family: var(--font-serif); font-size: 14px; font-weight: 700; color: #4a2e12; margin: 16px 0 6px; }
.rx-box-title { display: block; font-family: var(--font-serif); font-size: 13.5px; color: #3b230c; margin-bottom: 8px; }

/* 인용구 콜아웃: 손님이 실제로 한 말 */
.rx-quote { margin: 0 0 14px; padding: 14px 16px 12px 18px; border-radius: 10px; background: rgba(92, 59, 24, 0.09); border-left: 4px solid #8a5a20; }
.rx-quote-text { font-family: var(--font-serif); font-size: 14.5px; font-weight: 700; line-height: 1.7; color: #2b1a0c; word-break: keep-all; }
.rx-quote cite { display: block; margin-top: 6px; font-style: normal; font-size: 11px; color: #7a6248; }

/* 송신 vs. 수신 2열 대조 카드 */
.rx-signals { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.rx-signal { display: grid; grid-template-columns: 1fr 18px 1fr; align-items: stretch; gap: 4px; }
.rx-side { padding: 10px 11px; border-radius: 10px; display: flex; flex-direction: column; gap: 3px; }
.rx-send { background: rgba(184, 129, 54, 0.14); border: 1px solid rgba(138, 90, 32, 0.35); }
.rx-recv { background: rgba(110, 30, 30, 0.08); border: 1px solid rgba(140, 40, 40, 0.3); }
.rx-side-label { font-size: 10px; letter-spacing: 0.04em; color: #7a6248; }
.rx-side strong { font-family: var(--font-serif); font-size: 14px; color: #2b1a0c; }
.rx-recv strong { color: #7a1c1c; }
.rx-side p { font-size: 12px; line-height: 1.55; color: #3a2a1c; word-break: keep-all; }
.rx-arrow { align-self: center; text-align: center; font-size: 14px; color: #8a5a20; }

/* 제2장 악순환 고리 */
.rx-cycle-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; }
.rx-cycle-step { display: flex; gap: 10px; padding: 0 0 12px; position: relative; }
.rx-cycle-step::before { content: ""; position: absolute; left: 12px; top: 26px; bottom: 0; width: 2px; background: rgba(138, 90, 32, 0.3); }
.rx-cycle-no { flex: 0 0 26px; height: 26px; border-radius: 50%; background: #5c3b18; color: #fff6e8; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.rx-cycle-step strong { display: block; font-size: 12px; color: #6b4a22; margin-bottom: 2px; }
.rx-cycle-step p { font-family: var(--font-serif); font-size: 13.2px; line-height: 1.6; color: #241911; word-break: keep-all; }
.rx-cycle-loop { margin-left: 36px; font-size: 11.5px; color: #7a1c1c; }

/* 제3장: 금기 · STEP 1~3 타임라인 · 핵심 대사 */
.rx-taboo { margin-bottom: 14px; padding: 12px 14px; border-radius: 10px; background: rgba(140, 30, 30, 0.07); border: 1px solid rgba(140, 30, 30, 0.3); }
.rx-taboo .rx-box-title { color: #7a1c1c; }
.rx-taboo ol { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.rx-taboo li { font-family: var(--font-serif); font-size: 13.2px; line-height: 1.6; color: #241911; word-break: keep-all; }
.rx-timeline { list-style: none; margin: 0 0 14px; padding: 0 0 0 14px; border-left: 2px solid rgba(138, 90, 32, 0.4); display: flex; flex-direction: column; gap: 10px; }
.rx-step { position: relative; padding: 11px 13px; border-radius: 10px; background: rgba(255, 255, 255, 0.45); border: 1px solid rgba(138, 90, 32, 0.25); }
.rx-step::before { content: ""; position: absolute; left: -21px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: #8a5a20; box-shadow: 0 0 0 3px var(--parchment-bg); }
.rx-step-no { display: inline-block; font-family: var(--font-brand); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: #fff6e8; background: #8a5a20; padding: 2px 7px; border-radius: 4px; margin-right: 6px; }
.rx-step strong { font-size: 12.5px; color: #3b230c; }
.rx-step p { margin-top: 6px; font-family: var(--font-serif); font-size: 13.2px; line-height: 1.65; color: #241911; word-break: keep-all; }
.rx-script { margin-bottom: 14px; padding: 14px; border-radius: 12px; background: #2a1c10; color: var(--text-primary); }
.rx-script .rx-box-title { color: var(--amber-bright); }
.rx-script-situation { font-size: 11.5px; color: var(--text-secondary); margin-bottom: 8px; }
.rx-script-line { font-family: var(--font-serif); font-size: 15px; font-weight: 700; line-height: 1.65; color: #fff6e8; padding: 10px 12px; border-radius: 8px; background: rgba(212, 163, 89, 0.14); border-left: 3px solid var(--amber-bright); word-break: keep-all; }
.rx-script-why { margin-top: 8px; font-size: 12.3px; line-height: 1.6; color: #e3d5c2; word-break: keep-all; }

/* 시그니처 01: 4대 지표 점수 게이지 */
.rx-scorecard { display: flex; flex-direction: column; gap: 12px; }
.rx-score { padding: 12px 13px; border-radius: 10px; background: rgba(255, 255, 255, 0.45); border: 1px solid rgba(138, 90, 32, 0.25); }
.rx-score-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.rx-score-head strong { font-size: 13px; color: #3b230c; }
.rx-score-num { font-family: var(--font-brand); font-size: 20px; font-weight: 700; color: #7a4a14; }
.rx-score-num::after { content: " / 100"; font-family: var(--font-sans); font-size: 10.5px; font-weight: 400; color: #8c7b67; }
.rx-gauge { height: 9px; border-radius: 999px; background: rgba(36, 26, 18, 0.12); overflow: hidden; margin-bottom: 8px; }
.rx-gauge span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #8a5a20, #d4a359); transition: width 0.9s ease; }
.rx-score-fatigue .rx-gauge span, .rx-score-mismatch .rx-gauge span { background: linear-gradient(90deg, #b8792a, #a32020); }
.rx-score p { font-size: 12.3px; line-height: 1.6; color: #3a2a1c; word-break: keep-all; }

/* 시그니처 02: 반응별 분기 대본 */
.rx-branches { display: flex; flex-direction: column; gap: 12px; }
.rx-branch { padding: 12px 13px; border-radius: 10px; background: rgba(255, 255, 255, 0.45); border: 1px solid rgba(138, 90, 32, 0.25); }
.rx-branch-case { display: block; font-family: var(--font-serif); font-size: 14px; color: #2b1a0c; margin-bottom: 8px; }
.rx-branch dl { display: grid; grid-template-columns: 62px 1fr; gap: 6px 8px; margin: 0; }
.rx-branch dt { font-size: 11px; font-weight: 700; color: #8a5a20; padding-top: 2px; }
.rx-branch dt.rx-no { color: #a32020; }
.rx-branch dd { margin: 0; font-size: 12.5px; line-height: 1.6; color: #241911; word-break: keep-all; }
.rx-branch dd.rx-branch-line { font-family: var(--font-serif); font-weight: 700; color: #3b230c; background: rgba(184, 129, 54, 0.14); padding: 6px 8px; border-radius: 6px; }

/* 시그니처 03: 14일 캘린더 · 유지/정리 판별 기준표 */
.rx-calendar { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 14px; }
.rx-day { display: flex; gap: 7px; padding: 8px 9px; border-radius: 8px; background: rgba(255, 255, 255, 0.45); border: 1px solid rgba(138, 90, 32, 0.2); }
.rx-day-no { flex: 0 0 auto; font-family: var(--font-brand); font-size: 11px; font-weight: 700; color: #8a5a20; padding-top: 1px; }
.rx-day p { font-size: 11.8px; line-height: 1.5; color: #241911; word-break: keep-all; }
.rx-verdict { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rx-verdict-col { padding: 11px 12px; border-radius: 10px; }
.rx-verdict-col strong { display: block; font-size: 12.5px; margin-bottom: 6px; }
.rx-verdict-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rx-verdict-col li { font-size: 12px; line-height: 1.55; color: #241911; padding-left: 16px; position: relative; word-break: keep-all; }
.rx-keep { background: rgba(60, 110, 60, 0.1); border: 1px solid rgba(60, 110, 60, 0.35); }
.rx-keep strong { color: #2f5d2f; }
.rx-keep li::before { content: "\2713"; position: absolute; left: 0; color: #2f5d2f; font-weight: 700; }
.rx-letgo { background: rgba(140, 30, 30, 0.07); border: 1px solid rgba(140, 30, 30, 0.3); }
.rx-letgo strong { color: #7a1c1c; }
.rx-letgo li::before { content: "\2715"; position: absolute; left: 0; color: #a32020; font-weight: 700; }
@media (max-width: 380px) {
  .rx-calendar, .rx-verdict { grid-template-columns: 1fr; }
  .rx-signal { grid-template-columns: 1fr; }
  .rx-arrow { transform: rotate(90deg); }
}

/* ===== 시그니처 스코어카드 미리보기 (1개 공개 + 3개 잠금) ===== */
.rx-score-teaser { border-top: 1px dashed rgba(138, 90, 32, 0.45); padding-top: 14px; }
.rx-teaser-lead { font-size: 12.5px; color: #5a4128; margin: 4px 0 10px; }
.rx-teaser-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.rx-teaser-grid .rx-score { padding: 10px 11px; }
.rx-teaser-grid .rx-score-head { flex-direction: column; align-items: flex-start; gap: 2px; }
.rx-teaser-grid .rx-score-head strong { font-size: 12px; }
.rx-teaser-open { border-color: rgba(163, 32, 32, 0.45); box-shadow: 0 0 0 1px rgba(163, 32, 32, 0.12); }
.rx-teaser-locked .rx-gauge { filter: blur(3px); opacity: 0.55; }
.rx-teaser-locked .rx-gauge span { background: linear-gradient(90deg, #8c7b67, #b9a78f); }
.rx-score-lock { font-family: var(--font-brand); font-size: 15px; font-weight: 700; color: #8c7b67; letter-spacing: 0.5px; }
.rx-teaser-tag { font-size: 10.5px !important; color: #8c7b67 !important; }
.rx-teaser-open .rx-teaser-tag { color: #a32020 !important; font-weight: 700; }
.rx-teaser-foot { margin-top: 10px; font-size: 11.5px; color: #7a4a14; text-align: center; }

/* ===== 결제 후 작성 오버레이: 바텐더 얼굴 + 앰버 조명 + 타이포그래피 ===== */
.letter-viewer-container { position: relative; }
.letter-top-nav { position: relative; z-index: 6; }
.writing-overlay { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; background: #0a0604; animation: fadeInModal 0.8s ease; touch-action: none; }
.writing-overlay.fade-out { animation: writingFadeOut 0.7s ease forwards; }
@keyframes writingFadeOut { to { opacity: 0; } }
/* 얼굴이 위쪽 1/3에 오도록 맞추고 아래만 어둡게 녹임 (얼굴 위로는 아무것도 겹치지 않음) */
.writing-portrait { position: absolute; inset: 0 0 auto 0; display: block; width: 100%; height: 78%; object-fit: cover; object-position: 50% 22%; background: url('bartender.jpg') center 22% / cover no-repeat;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%); mask-image: linear-gradient(180deg, #000 55%, transparent 100%); }
.writing-clip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; opacity: 0; z-index: 0; transition: opacity 0.9s ease; }
.writing-clip.is-front { opacity: 1; z-index: 2; }
.writing-clip.is-back { opacity: 1; z-index: 1; transition: none; } /* 다음 영상이 위에서 페이드인하는 동안 아래 영상은 그대로 보이게 */
.writing-glow { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 38% at 50% 4%, rgba(255, 196, 110, 0.22), transparent 70%), radial-gradient(ellipse 120% 60% at 50% 115%, rgba(10, 6, 4, 0.98) 40%, transparent 75%);
  animation: writingLamp 6s ease-in-out infinite; }
@keyframes writingLamp { 50% { opacity: 0.82; } }
.writing-inner { position: relative; padding: 0 28px 30px; text-align: center; color: #f3e6cf; }
.writing-eyebrow { font-family: var(--font-brand); font-size: 10px; letter-spacing: 0.42em; color: var(--amber-gold); margin-bottom: 10px; }
.writing-title { font-family: var(--font-serif); font-size: 21px; font-weight: 600; line-height: 1.45; letter-spacing: -0.01em; color: var(--amber-bright); word-break: keep-all; margin-bottom: 16px; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.8); }
.writing-line { min-height: 4.9em; font-family: var(--font-serif); font-size: 13.5px; line-height: 1.7; color: rgba(243, 230, 207, 0.86); word-break: keep-all; margin-bottom: 18px; transition: opacity 0.6s ease, transform 0.6s ease; }
.writing-line.is-fading { opacity: 0; transform: translateY(4px); }
.writing-line::before { content: '“'; } .writing-line::after { content: '”'; }
.writing-line:empty::before, .writing-line:empty::after { content: none; }
.writing-track { height: 2px; border-radius: 999px; background: rgba(212, 163, 89, 0.18); overflow: hidden; }
.writing-bar { height: 100%; width: 0; background: linear-gradient(90deg, #8a5a20, var(--amber-bright)); box-shadow: 0 0 10px rgba(242, 201, 125, 0.7); transition: width 0.5s linear; }
.writing-overlay.is-done .writing-bar { transition-duration: 0.3s; }
.writing-meta { display: flex; justify-content: space-between; margin-top: 8px; font-family: var(--font-brand); font-size: 11px; letter-spacing: 0.06em; color: var(--amber-gold); }
@media (max-height: 640px) { .writing-portrait { height: 70%; } .writing-title { font-size: 18px; margin-bottom: 10px; } .writing-inner { padding-bottom: 20px; } }
@media (prefers-reduced-motion: reduce) { .writing-glow { animation: none; } }
@media print { .writing-overlay, .rx-score-teaser { display: none !important; } }

/* 인쇄할 때 화면 고정 높이 때문에 잘리지 않게 */
@media print {
  html, body, .app-viewport { height: auto !important; overflow: visible !important; max-height: none !important; }
}

/* 시그니처 03: 14일 3단계 실행 로드맵 */
.rx-calendar .rx-phase { grid-column: 1 / -1; margin-bottom: 6px; }
.rx-phase { position: relative; padding: 14px 14px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.5); border: 1px solid rgba(138, 90, 32, 0.28); border-left: 4px solid #a8742e; break-inside: avoid; }
.rx-phase-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.rx-phase-no { font-family: var(--font-brand); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; color: #8a5a20; }
.rx-phase-days { font-size: 11.5px; color: #8c7b67; }
.rx-phase-title { display: block; font-family: var(--font-serif); font-size: 15px; color: #3b230c; margin-bottom: 9px; word-break: keep-all; }
.rx-phase-block + .rx-phase-block { margin-top: 8px; }
.rx-phase-label { display: inline-block; font-size: 10.5px; font-weight: 700; color: #7a4a14; margin-bottom: 3px; }
.rx-phase-block p { font-size: 12.8px; line-height: 1.65; color: #3a2a1c; word-break: keep-all; }
.rx-phase-check { padding: 8px 10px; border-radius: 8px; background: rgba(138, 90, 32, 0.08); }

/* 페이월 맨 아래 보조 버튼: 결제 선택을 가리지 않게 작고 흐리게 */
.paywall-free-card-btn { display: block; margin: 14px auto 2px; padding: 6px 8px; background: none; border: none; color: rgba(203, 187, 166, 0.62); font-size: 11.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.paywall-free-card-btn:hover { color: var(--amber-gold); }

/* 포지션 카드 모달: 친구에게 바 입장 링크 공유 */
.bar-share { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px dashed rgba(212, 163, 89, 0.25); }
.bar-share-btn { width: 100%; justify-content: center; }
.bar-share-note { font-size: 10.8px; line-height: 1.5; color: var(--text-muted); word-break: keep-all; }

/* 포지션 카드 모달: 휴대폰 한 화면(667~800px)에 카드 + 저장 + 공유 + 닫기가 스크롤 없이 다 들어가게 */
#card-modal { padding: 12px; }
#card-modal .card-modal-box { position: relative; max-height: calc(var(--vvh, 100dvh) - 24px); overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 14px 8px; }
#card-modal .card-modal-title { font-size: 13.5px; padding: 0 26px; }
#card-modal .card-preview {
  flex: 1 1 auto; min-height: 0; width: auto; max-width: 100%; object-fit: contain; aspect-ratio: 9 / 16;
  height: min(58dvh, calc(var(--vvh, 100dvh) - 305px)); max-height: 58dvh; /* 나머지 요소 높이를 뺀 만큼만: 짧은 화면에선 카드가 줄어듦 */
}
#card-modal #btn-card-save { padding: 10px 14px; font-size: 14px; }
#card-modal .card-hint { font-size: 10.5px; line-height: 1.35; }
#card-modal .bar-share { gap: 3px; padding-top: 7px; }
#card-modal .bar-share-btn { padding: 8px 12px; font-size: 12.5px; }
#card-modal .bar-share-note { font-size: 10px; line-height: 1.35; }
#card-modal #btn-card-close { padding: 2px 10px; font-size: 12px; }
.card-modal-x { position: absolute; top: 6px; right: 8px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(212, 163, 89, 0.35); background: rgba(0, 0, 0, 0.35); color: var(--amber-bright); font-size: 13px; cursor: pointer; z-index: 1; }
/* 카드 모달이 열려 있을 땐 토스트를 위쪽에 (아래 버튼을 가리지 않게) */
#card-modal:not(.hidden) ~ .toast-container { top: 18px; bottom: auto; }
/* ==========================================================================
   모바일 겉스크롤 방지 · 인앱 안내 바 · 상담/편지 고급화 (뒤에 둬서 위 규칙을 덮음)
   ========================================================================== */
html, body { overscroll-behavior: none; }
.chat-messages { overscroll-behavior: contain; }

/* 아이폰 인스타그램 인앱 안내 바 */
.inapp-banner { position: absolute; top: 0; left: 0; right: 0; z-index: 60; display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; padding-top: max(8px, env(safe-area-inset-top));
  background: linear-gradient(90deg, rgba(36, 12, 10, 0.96), rgba(28, 18, 10, 0.96)); border-bottom: 1px solid rgba(212, 163, 89, 0.45); color: #f2dcb4; font-size: 11.5px; line-height: 1.4; letter-spacing: -0.01em; word-break: keep-all; }
.inapp-banner span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inapp-close { flex: 0 0 26px; height: 26px; border: 1px solid rgba(212, 163, 89, 0.4); border-radius: 50%; background: none; color: var(--amber-bright); font-size: 11px; cursor: pointer; }

/* 상담 말풍선: 프라이빗 라운지 */
.chat-messages { gap: 16px; padding: 18px 16px 14px; }
.msg-sender { font-family: var(--font-brand); font-size: 9.5px; letter-spacing: 0.14em; margin-bottom: 6px; opacity: 0.9; }
.msg-row.user .msg-sender { align-self: flex-end; padding-right: 2px; font-family: var(--font-sans); letter-spacing: 0.02em; }
.msg-bubble { padding: 12px 16px; line-height: 1.7; letter-spacing: -0.005em; }
.msg-row.bartender .msg-bubble { background: linear-gradient(180deg, rgba(26, 18, 12, 0.66), rgba(14, 10, 7, 0.7)); border: 1px solid rgba(212, 163, 89, 0.22); border-left: 2px solid rgba(242, 201, 125, 0.75);
  border-radius: 4px 16px 16px 16px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 230, 190, 0.05); backdrop-filter: blur(8px); }
.msg-row.user .msg-bubble { background: linear-gradient(160deg, rgba(150, 98, 40, 0.74), rgba(104, 62, 24, 0.78)); border: 1px solid rgba(242, 201, 125, 0.34);
  border-radius: 16px 4px 16px 16px; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.26); }

/* 비밀 편지 제안: 밀랍 봉투 카드 */
.secret-letter-cta-wrap { padding: 6px 12px 8px; animation: envelopeIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes envelopeIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.golden-letter-btn { position: relative; overflow: hidden; gap: 12px; padding: 11px 14px 11px 12px; border-radius: 14px; border: 1px solid rgba(212, 163, 89, 0.55);
  background: linear-gradient(135deg, #2a1610 0%, #3b1418 55%, #22120c 100%); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(242, 201, 125, 0.08); }
.golden-letter-btn::before { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(242, 201, 125, 0.18); border-radius: 10px; pointer-events: none; }
.golden-letter-btn::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255, 220, 160, 0.12), transparent); animation: envelopeShine 4.5s ease-in-out 1s infinite; pointer-events: none; }
@keyframes envelopeShine { 0%, 70% { left: -60%; } 100% { left: 130%; } }
.golden-letter-btn:active { transform: scale(0.99); }
.wax-mini-badge { width: 42px; height: 42px; background: radial-gradient(circle at 34% 30%, #d84444 0%, #a31d1d 48%, #5e0c0c 100%); border: none;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5), inset 0 -2px 4px rgba(0, 0, 0, 0.35), inset 0 2px 3px rgba(255, 170, 150, 0.35); border-radius: 46% 54% 50% 50% / 52% 48% 52% 48%; }
.wax-mini-core { width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(255, 210, 180, 0.35); display: flex; align-items: center; justify-content: center; font-family: var(--font-brand); font-size: 13px; font-weight: 700; color: #ffd9c2; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5); }
.letter-btn-text { gap: 3px; min-width: 0; }
.letter-btn-text .letter-btn-label { font-family: var(--font-brand); font-size: 9px; letter-spacing: 0.16em; color: #d4a359; }
.letter-btn-text strong { font-size: 13.2px; line-height: 1.4; color: #fbe9cc; word-break: keep-all; }
.letter-btn-text .letter-arrow { align-self: flex-start; margin-top: 4px; padding: 5px 12px; border: none; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: #2a1608;
  background: linear-gradient(90deg, #b8823a, #f2c97d 50%, #c9944a); box-shadow: 0 2px 8px rgba(242, 201, 125, 0.3); }

/* 편지지: 에디토리얼 레터 (미세 종이결 + 이중 헤어라인 프레임) */
.letter-paper { position: relative; padding: 30px 24px 38px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.24 0 0 0 0 0.12 0 0 0 0.07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 50% 0%, #fbf6ec 0%, transparent 70%), linear-gradient(180deg, #f6efe1 0%, #ecdfc7 100%);
  box-shadow: inset 0 0 0 8px #f3ead8, inset 0 0 0 9px rgba(138, 90, 32, 0.35), inset 0 0 0 12px #f3ead8, inset 0 0 0 13px rgba(138, 90, 32, 0.18); }
.letter-crest { margin-bottom: 16px; }
.crest-line { background: linear-gradient(90deg, transparent, rgba(138, 90, 32, 0.55), transparent); }
.letter-main-title { font-size: 21px; letter-spacing: -0.02em; margin-bottom: 8px; word-break: keep-all; }
.letter-meta-info { border-bottom: 0; padding-bottom: 14px; margin-bottom: 22px; letter-spacing: 0.01em; position: relative; }
.letter-meta-info::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 0; height: 3px; border-top: 1px solid rgba(138, 90, 32, 0.4); border-bottom: 1px solid rgba(138, 90, 32, 0.4); }
.letter-section { margin-bottom: 28px; }
.chapter-badge { background: none; color: #8a5a20; padding: 0 0 6px; border-radius: 0; font-size: 10px; letter-spacing: 0.22em; border-bottom: 1px solid rgba(138, 90, 32, 0.35); margin-bottom: 10px; }
.chapter-badge.sig { background: none; color: #8e1f24; border-bottom-color: rgba(142, 31, 36, 0.45); }
.chapter-title { font-size: 17px; line-height: 1.5; letter-spacing: -0.015em; color: #1e130a; margin-bottom: 14px; word-break: keep-all; }
.letter-text-block { font-size: 14.3px; line-height: 1.88; }
.highlight-free-lead { background: rgba(184, 129, 54, 0.07); border-left: 2px solid #b8823a; padding: 14px 16px; }
.rx-quote { padding: 16px 18px 14px 20px; background: linear-gradient(90deg, rgba(184, 129, 54, 0.12), rgba(184, 129, 54, 0.03)); border-left: 3px solid #b8823a; border-radius: 0 10px 10px 0; position: relative; }
.rx-quote::before { content: "\201C"; position: absolute; top: -6px; right: 12px; font-family: Georgia, serif; font-size: 46px; color: rgba(138, 90, 32, 0.22); }
.rx-quote-text { font-size: 15px; }
/* 무료 → 잠금 경계: 스코어 미리보기 정돈 */
.rx-score-teaser { padding: 16px 14px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.38); border: 1px solid rgba(142, 31, 36, 0.22); }
.rx-teaser-grid .rx-score { background: rgba(255, 252, 245, 0.75); border-radius: 10px; }
.locked-report-zone.is-locked .locked-content-inner { -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.55) 40%, transparent 100%); mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.55) 40%, transparent 100%); }

/* 봉인 해제 표지 (결제 뒤에만) */
.unsealed-cover { display: none; text-align: center; margin: -4px 0 26px; padding: 20px 14px 18px; border-radius: 14px; background: linear-gradient(180deg, rgba(255, 252, 244, 0.7), rgba(240, 226, 200, 0.5)); border: 1px solid rgba(138, 90, 32, 0.3); animation: envelopeIn 0.8s ease both; }
.letter-paper.is-paid .unsealed-cover { display: block; }
.unsealed-seal { position: relative; width: 64px; height: 52px; margin: 0 auto 10px; }
.seal-half { position: absolute; top: 4px; width: 30px; height: 44px; box-shadow: 0 3px 8px rgba(70, 10, 10, 0.35), inset 0 2px 3px rgba(255, 170, 150, 0.3); }
.seal-l { left: 2px; border-radius: 22px 4px 4px 22px; transform: rotate(-12deg); background: radial-gradient(circle at 70% 40%, #cf3a3a 0%, #9e1b1b 55%, #5a0b0b 100%); clip-path: polygon(0 0, 100% 0, 82% 28%, 100% 52%, 80% 76%, 100% 100%, 0 100%); }
.seal-r { right: 2px; border-radius: 4px 22px 22px 4px; transform: rotate(12deg); background: radial-gradient(circle at 30% 40%, #cf3a3a 0%, #9e1b1b 55%, #5a0b0b 100%); clip-path: polygon(18% 0, 100% 0, 100% 100%, 18% 100%, 0 76%, 20% 52%, 0 28%); }
.unsealed-eyebrow { font-family: var(--font-brand); font-size: 9.5px; letter-spacing: 0.26em; color: #8e1f24; }
.unsealed-title { font-family: var(--font-serif); font-size: 18px; font-weight: 700; color: #1e130a; margin-top: 4px; }
.unsealed-rule { display: flex; align-items: center; gap: 10px; margin: 12px 18%; color: #b8823a; font-size: 10px; }
.unsealed-rule span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, #b8823a, transparent); }
.unsealed-to { font-family: var(--font-serif); font-size: 16px; font-weight: 700; color: #3b230c; }
.unsealed-sign { margin-top: 8px; font-family: var(--font-brand); font-size: 10px; letter-spacing: 0.12em; color: #7a6248; display: flex; flex-direction: column; gap: 3px; }
.unsealed-date { font-family: var(--font-sans); letter-spacing: 0; font-size: 11px; }

/* 유료 본문: 챕터 위계와 소장용 박스 */
.letter-paper.is-paid .locked-content-inner > .letter-section + .letter-section { padding-top: 22px; border-top: 1px solid rgba(138, 90, 32, 0.18); }
.rx-cycle-list, .rx-taboo, .rx-timeline { margin-bottom: 18px; }
.rx-step, .rx-taboo { border-radius: 12px; box-shadow: 0 2px 10px rgba(92, 59, 24, 0.06); }
.rx-script { padding: 18px 16px; border-radius: 14px; background: linear-gradient(160deg, #2a1a10, #1a100a); border: 1px solid rgba(212, 163, 89, 0.4); box-shadow: 0 8px 22px rgba(40, 24, 10, 0.25), inset 0 0 0 4px #1d120b, inset 0 0 0 5px rgba(212, 163, 89, 0.22); }
.rx-subtitle { font-size: 15px; margin: 22px 0 8px; padding-left: 10px; border-left: 2px solid #b8823a; }

/* 시그니처 전용: 다크 골드/버건디 프리미엄 존 */
#signature-zone { margin: 8px -8px 0; padding: 22px 14px 4px; border-radius: 16px; background: linear-gradient(170deg, #241310 0%, #2e1216 50%, #1b100b 100%); border: 1px solid rgba(212, 163, 89, 0.5);
  box-shadow: inset 0 0 0 5px #241310, inset 0 0 0 6px rgba(212, 163, 89, 0.25), 0 12px 30px rgba(40, 14, 10, 0.3); color: #f3e6d2; }
#signature-zone::before { content: "SIGNATURE PRESCRIPTION"; display: block; text-align: center; font-family: var(--font-brand); font-size: 10px; letter-spacing: 0.3em; color: #f2c97d; margin-bottom: 18px; }
#signature-zone .letter-section + .letter-section { padding-top: 22px; border-top: 1px solid rgba(212, 163, 89, 0.2); }
#signature-zone .chapter-badge.sig { color: #f2c97d; border-bottom-color: rgba(212, 163, 89, 0.4); }
#signature-zone .chapter-title { color: #fbe9cc; }
#signature-zone .rx-score, #signature-zone .rx-branch, #signature-zone .rx-phase, #signature-zone .rx-day { background: rgba(255, 240, 215, 0.05); border: 1px solid rgba(212, 163, 89, 0.28); }
#signature-zone .rx-phase { border-left: 3px solid #c9944a; }
#signature-zone .rx-score-head strong, #signature-zone .rx-branch-case, #signature-zone .rx-phase-title { color: #fbe9cc; }
#signature-zone .rx-score-num { color: #f2c97d; }
#signature-zone .rx-score p, #signature-zone .rx-branch dd, #signature-zone .rx-phase-block p, #signature-zone .rx-day p, #signature-zone .rx-verdict-col li, #signature-zone .letter-text-block { color: #e8d9c3; }
#signature-zone .rx-branch dt, #signature-zone .rx-phase-no, #signature-zone .rx-phase-label, #signature-zone .rx-day-no { color: #d4a359; }
#signature-zone .rx-branch dt.rx-no { color: #ff8a80; }
#signature-zone .rx-branch dd.rx-branch-line { color: #fff1dc; background: rgba(212, 163, 89, 0.16); border-left: 2px solid #f2c97d; }
#signature-zone .rx-gauge { background: rgba(255, 255, 255, 0.1); }
#signature-zone .rx-phase-check { background: rgba(212, 163, 89, 0.1); }
#signature-zone .rx-phase-days { color: #bfa889; }
#signature-zone .rx-keep { background: rgba(90, 150, 90, 0.12); border-color: rgba(120, 180, 120, 0.35); }
#signature-zone .rx-keep strong, #signature-zone .rx-keep li::before { color: #9fd49f; }
#signature-zone .rx-letgo { background: rgba(200, 60, 60, 0.12); border-color: rgba(220, 90, 90, 0.35); }
#signature-zone .rx-letgo strong, #signature-zone .rx-letgo li::before { color: #ff9a90; }
.letter-signature { border-top: 0; position: relative; padding-top: 20px; }
.letter-signature::before { content: ""; position: absolute; top: 0; right: 0; width: 46%; height: 3px; border-top: 1px solid rgba(138, 90, 32, 0.4); border-bottom: 1px solid rgba(138, 90, 32, 0.4); }
.sig-name { font-size: 15.5px; }
@media (prefers-reduced-motion: reduce) { .golden-letter-btn::after, .secret-letter-cta-wrap, .unsealed-cover { animation: none; } }
@media print { .inapp-banner { display: none !important; } #signature-zone { background: #fff; color: #000; box-shadow: none; } }
