/* ==========================================================================
   ききくすり (内耳薬) - SoySauce Studio Online Official Website Stylesheet
   Concept: Pharmacy Prescription Envelope / Medical Aesthetic / CD Disc
   Faithfully matched to KKKS G.png and KKS_BACK.png design specifications
   ========================================================================== */

:root {
  --bg-desk: #e5e5e5;
  --paper-cream: #ffffff;
  --paper-border: #000000;
  --text-main: #000000;
  --text-sub: #333333;
  --text-muted: #666666;
  
  --clinic-red: #d63031;
  --clinic-stamp: #d63031;
  --rx-mint: #d7f3de;
  --rx-mint-hover: rgba(215, 243, 222, 0.55);
  
  --ekg-green: #00ff77;
  --ekg-dark: #0a110d;
  --ekg-grid: rgba(0, 255, 119, 0.15);
  
  --kraft-base: #bfa588;
  --kraft-dark: #a08263;
  --disc-silver: #f0f0f0;
  
  --shadow-paper: 0 16px 45px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.06);
  --radius-rx: 22px;
}

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

body {
  background-color: var(--bg-desk);
  background-image: 
    radial-gradient(#d4d4d4 1px, transparent 1px),
    linear-gradient(to bottom, #dedede 0%, #ebebeb 100%);
  background-size: 24px 24px, 100% 100%;
  color: var(--text-main);
  font-family: 'Noto Sans JP', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: 24px;
  transition: padding-bottom 0.35s ease;
  position: relative;
  overflow-x: hidden;
}

body.player-dock-visible {
  padding-bottom: 120px;
}

/* 약봉투 전용 비닐 파우치 포장 래퍼 */
.envelope-pouch-wrapper {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
}

/* 수축 포장이 아닌 자연스럽게 담긴 약국 비닐 봉투 오버레이 */
.vinyl-pouch-overlay {
  position: absolute;
  top: -26px;
  bottom: -28px;
  left: -24px;
  right: -24px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.35s ease;
  background-color: rgba(246, 250, 248, 0.42); /* 약국 특유의 반투명 밀키 비닐 필름 */
  background-image: 
    url('assets/pharmacy_vinyl_dots.png'), /* 엠보싱 땡땡이 도트 텍스처 */
    radial-gradient(ellipse at 30% 15%, rgba(255, 255, 255, 0.45) 0%, transparent 60%),
    linear-gradient(130deg, rgba(255, 255, 255, 0.22) 0%, transparent 35%, rgba(255, 255, 255, 0.12) 65%, transparent 100%),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.28) 0%, transparent 40px);
  background-repeat: repeat, no-repeat, no-repeat, no-repeat;
  background-size: 256px 256px, 100% 100%, 100% 100%, 100% 100%;
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 
    0 16px 45px rgba(15, 35, 25, 0.15),
    0 2px 10px rgba(0, 0, 0, 0.03),
    inset 0 0 20px rgba(255, 255, 255, 0.5);
  transform: translateZ(1px); /* 카드 지면 바로 1px 위에 완전 밀착하여 3D 동반 회전 */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

body.vinyl-active .vinyl-pouch-overlay {
  opacity: 1;
}

/* 비닐 봉투 상단 입구 및 자연스러운 구김/주름 디테일 */
.vinyl-bag-opening {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 22px;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.6);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.05));
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  pointer-events: none;
}

.vinyl-bag-crease-1 {
  position: absolute;
  top: 40px;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.18) 45%, rgba(255, 255, 255, 0.04) 50%, transparent 60%);
  pointer-events: none;
}

.vinyl-bag-crease-2 {
  position: absolute;
  bottom: 60px;
  left: 0;
  right: 0;
  height: 160px;
  background: linear-gradient(45deg, transparent 42%, rgba(255, 255, 255, 0.15) 48%, rgba(255, 255, 255, 0.02) 53%, transparent 65%);
  pointer-events: none;
}

/* ==========================================================================
   상단 병원 처방 및 조제 관리 헤더 (Clinical Pharmacy Dispensary Header)
   ========================================================================== */
.app-header {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid #d8e2dc;
  position: sticky;
  top: 0;
  z-index: 980;
  box-shadow: 0 2px 12px rgba(20, 35, 25, 0.04);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.clinic-emblem {
  display: flex;
  align-items: center;
  gap: 10px;
}

.clinic-brand-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

.clinic-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.clinic-main-brand {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}

.brand-yakdang {
  font-size: 14px;
  font-weight: 800;
  color: #11241a;
  letter-spacing: 0.5px;
}

.brand-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #2e4438;
  font-family: 'Share Tech Mono', -apple-system, sans-serif;
  letter-spacing: 0.2px;
}

.clinic-sub-desc {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: #61776b;
}

.badge-dept {
  background: #e2ece6;
  color: #165237;
  font-weight: 700;
  padding: 0 4px;
  border-radius: 2px;
  border: 1px solid #c2d8cc;
  font-size: 9.5px;
}

.dispensary-name {
  font-weight: 500;
  letter-spacing: 0.3px;
}

.header-meta-tags {
  display: flex;
  align-items: center;
  gap: 6px;
}

.catalog-badge {
  background: #1d2b24;
  color: #fff;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

.booth-tag {
  background: #f0f5f2;
  border: 1px solid #c7d8ce;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  color: #3b5044;
}

/* (View-nav relocated to right floating dock) */

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.action-btn {
  background: #ffffff;
  border: 1px solid #c8d6ce;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
  font-family: inherit;
  color: #2e4236;
}

.action-btn:hover {
  background: #f0f6f2;
  border-color: #9ab4a5;
  color: #112219;
}

body.vinyl-active .action-btn#toggleVinylBtn {
  background: #0f7654;
  color: #ffffff;
  border-color: #0f7654;
  box-shadow: 0 2px 8px rgba(15, 118, 84, 0.25);
}

.lang-switch {
  display: flex;
  border: 1px solid #c8d6ce;
  border-radius: 4px;
  overflow: hidden;
  background: #eef3f0;
}

.lang-btn {
  border: none;
  background: transparent;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  color: #556b5e;
  transition: all 0.15s;
}

.lang-btn.active {
  background: #1d2b24;
  color: #ffffff;
}

/* ==========================================================================
   우측 플로팅 차트 인덱스 독 (Clinical Chart Index Dock)
   ========================================================================== */
.floating-nav-dock {
  position: fixed;
  right: 24px;
  top: 140px;
  z-index: 970;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  border: 1px solid #c9d8cf;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(18, 38, 26, 0.09);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 175px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.floating-dock-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px 6px 6px;
  border-bottom: 1px solid #e1ece5;
}

.dock-badge-pulse {
  width: 7px;
  height: 7px;
  background: #0f9d58;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(15, 157, 88, 0.6);
  animation: ledPulse 1.2s infinite ease-in-out;
}

.dock-badge-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10.5px;
  font-weight: 700;
  color: #435b4d;
  letter-spacing: 0.8px;
}

.floating-dock-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.floating-dock-buttons .nav-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  background: #f7faf8;
  border: 1px solid #dbe6df;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #2e4438;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}

.floating-dock-buttons .nav-btn .tab-index {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  background: #e3ede6;
  color: #165237;
  padding: 2px 5px;
  border-radius: 3px;
  line-height: 1;
}

.floating-dock-buttons .nav-btn .tab-label {
  font-size: 12px;
  letter-spacing: 0.2px;
}

.floating-dock-buttons .nav-btn:hover {
  background: #ffffff;
  border-color: #165237;
  transform: translateX(-3px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.floating-dock-buttons .nav-btn.active {
  background: #143526;
  color: #ffffff;
  border-color: #143526;
  box-shadow: 0 3px 12px rgba(20, 53, 38, 0.25);
  transform: translateX(-4px);
}

.floating-dock-buttons .nav-btn.active .tab-index {
  background: var(--clinic-red);
  color: #ffffff;
}

.floating-dock-buttons .nav-btn.active .tab-label {
  color: #ffffff;
  font-weight: 700;
}

/* ==========================================================================
   반응형 네비게이션 독 (태블릿 및 모바일: 화면 가림 방지 상단 세그먼트 전환)
   ========================================================================== */
@media (max-width: 900px) {
  .floating-nav-dock {
    position: static !important;
    top: auto !important;
    right: auto !important;
    width: calc(100% - 24px) !important;
    max-width: 440px !important;
    margin: 12px auto 14px auto !important;
    padding: 5px !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(10px) !important;
    min-width: auto !important;
    z-index: 500 !important;
  }

  .floating-dock-badge {
    display: none !important; /* 모바일에서 내부 텍스트 뱃지 숨김으로 깔끔한 탭 바 유지 */
  }

  .floating-dock-buttons {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    gap: 6px !important;
  }

  .floating-dock-buttons .nav-btn {
    flex: 1 !important;
    justify-content: center !important;
    padding: 8px 10px !important;
    text-align: center !important;
    border-radius: 7px !important;
    transform: none !important;
  }

  .floating-dock-buttons .nav-btn .tab-index {
    font-size: 10.5px !important;
    padding: 2px 6px !important;
  }

  .floating-dock-buttons .nav-btn .tab-label {
    font-size: 12px !important;
  }
}


/* ==========================================================================
   하단 플레이어 생체 바이탈 & EKG 모니터 서랍 (Audio Prescription Telemetry)
   ========================================================================== */
.player-vital-drawer {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  background: rgba(247, 250, 248, 0.98);
  border-bottom: 1px solid #d8e4dd;
}

.player-vital-drawer.active {
  max-height: 85px;
  opacity: 1;
}

.vital-drawer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.vital-patient-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
  min-width: 180px;
}

.vital-status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pulse-led {
  width: 7px;
  height: 7px;
  background: #0f7654;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(15, 118, 84, 0.6);
  animation: ledPulse 1.2s infinite ease-in-out;
}

@keyframes ledPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

.system-badge {
  font-size: 9.5px;
  font-weight: 700;
  background: #e3f2ea;
  color: #145034;
  border: 1px solid #bad4c6;
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

.patient-id-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.patient-dept {
  font-weight: 700;
  color: #d63031;
  background: #fde8e8;
  border: 1px solid #f8b4b4;
  padding: 0 5px;
  border-radius: 3px;
  font-size: 9.5px;
}

.patient-target {
  color: #4a6355;
}

.patient-target strong {
  color: #11241a;
  font-weight: 700;
}

.vital-canvas-col {
  flex: 1;
  max-width: 460px;
  height: 38px;
  background: #ffffff;
  border: 1px solid #c8d8ce;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}

.vital-canvas-col::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(to right, rgba(20, 80, 50, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(20, 80, 50, 0.06) 1px, transparent 1px);
  background-size: 10px 10px;
  pointer-events: none;
}

.vital-canvas-col #ekgCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.vital-metrics-col {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.vital-metric-card {
  background: #ffffff;
  border: 1px solid #cddcd3;
  border-radius: 5px;
  padding: 3px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 40px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.vital-metric-card .metric-label {
  font-size: 8px;
  font-weight: 700;
  color: #556e60;
  letter-spacing: 0.4px;
  margin-bottom: 1px;
}

.vital-metric-card .metric-val-wrap {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.vital-metric-card .metric-val {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #0f7654;
  line-height: 1.3;
  padding-bottom: 1px;
}

.vital-metric-card .metric-unit {
  font-size: 9px;
  color: #6d8678;
  font-family: 'Share Tech Mono', monospace;
}

.vital-metric-card .metric-val.status-green {
  color: #0f7654;
}

.vital-metric-card .metric-val.track-now {
  font-family: inherit;
  font-size: 11px;
  color: #112218;
  font-weight: 600;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.45;
  padding-bottom: 3px;
}

.vital-bar-toggle-btn {
  background: #ffffff;
  border: 1px solid #c8d8ce;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #2e4438;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

.vital-bar-toggle-btn:hover {
  background: #f0f6f2;
  border-color: #143526;
  color: #143526;
}

.vital-bar-toggle-btn.active {
  background: #143526;
  color: #ffffff;
  border-color: #143526;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(20, 53, 38, 0.25);
}

/* 메인 스테이지 */
.main-stage {
  max-width: 1100px;
  margin: 30px auto;
  padding: 0 20px;
  position: relative;
}

.view-panel {
  display: none;
  animation: fadeIn 0.3s ease forwards;
}

.view-panel.active {
  display: block;
}

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

/* ==========================================================================
   1. 처방 약봉투 (IMG_8612.JPG 실물 & KKS_Front/Back.psd 100% 일치)
   ========================================================================== */
.package-controls-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-bottom: 32px;
  flex-wrap: wrap;
  position: relative;
  z-index: 920; /* 비닐 파우치 오버레이(z-index: 900)보다 항상 확실히 앞쪽에 위치하도록 보장 */
}

.package-controls-bar .ctrl-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  padding: 4px 6px;
  border-radius: 8px;
  border: 1px solid #cbdad0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.package-controls-bar .flip-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #2e4438;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: inherit;
}

.package-controls-bar .flip-btn:hover {
  background: #f0f6f2;
  color: #122c1d;
  border-color: #bad2c3;
}

.package-controls-bar .flip-btn.active {
  background: #143526;
  color: #ffffff;
  border-color: #143526;
  box-shadow: 0 2px 8px rgba(20, 53, 38, 0.25);
}

.unbox-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #2e4438;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: inherit;
}

.unbox-btn:hover {
  background: #f0f6f2;
  color: #122c1d;
  border-color: #bad2c3;
}

.unbox-btn.active {
  background: #143526;
  color: #ffffff;
  border-color: #143526;
  box-shadow: 0 2px 8px rgba(20, 53, 38, 0.25);
}

.flip-toggle-btn {
  background: #ffffff;
  border: 1.5px solid #222;
  padding: 8px 22px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  color: #333;
  font-family: inherit;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.flip-toggle-btn.active, .flip-toggle-btn:hover {
  background: #000;
  color: #fff;
  border-color: #000;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}

/* A5 규격 약봉투 카드 (148 x 210mm) */
/* ==========================================================================
   통합 패키지 쇼케이스 스테이지 (3D Envelope + Unboxed Companion Components)
   ========================================================================== */
.package-interactive-stage {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 32px;
  position: relative;
  min-height: 940px;
  transition: all 0.4s ease;
}

.envelope-3d-scene {
  perspective: 1400px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 640px;
  height: 908px;
  margin: 0 auto;
  flex-shrink: 0;
}

.envelope-pouch-wrapper {
  position: relative;
  width: 640px;
  height: 908px;
  margin: 0 auto;
}

.envelope-3d-card {
  width: 640px;
  height: 908px;
  position: relative;
  transform-style: preserve-3d;
  transform-origin: center center;
  transition: transform 0.65s cubic-bezier(0.2, 0.8, 0.2, 1);
  cursor: grab;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none; /* 회전 및 드래그 시 글자 선택 방지 */
}

.envelope-3d-card,
.envelope-3d-card *,
.paper-envelope-card,
.paper-envelope-card *,
.envelope-face-front,
.envelope-face-back {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

.envelope-3d-card.flipped-back {
  transform: rotateY(180deg);
}

/* 3D 카드 내의 전면/후면은 반드시 top:0 left:0 절대좌표로 완전 일치 고정 */
.envelope-3d-card .paper-envelope-card {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  margin: 0 !important;
  width: 640px !important;
  height: 908px !important;
  transform-origin: center center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.envelope-face-front {
  transform: rotateY(0deg);
  z-index: 2;
  transform-style: preserve-3d;
}

.envelope-face-back {
  transform: rotateY(180deg);
  z-index: 1;
  transform-style: preserve-3d;
}

.unboxed-companion-card {
  display: none;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  flex-shrink: 0;
}

.unboxed-companion-card.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ==========================================================================
   슬리브 → CD 추출 애니메이션 & 글자 페이드 인/아웃
   ========================================================================== */
@keyframes cdSlideOutFromSleeve {
  0% {
    opacity: 0;
    transform: translateY(220px) scale(0.85);
  }
  25% {
    opacity: 0.85;
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes cdSlideInToSleeve {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  60% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: translateY(220px) scale(0.85);
  }
}

.unboxed-companion-card.cd-unboxed-panel.emerge-from-sleeve {
  animation: cdSlideOutFromSleeve 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

.unboxed-companion-card.cd-unboxed-panel.retract-to-sleeve {
  animation: cdSlideInToSleeve 0.38s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

/* 캡션 글자 페이드 인/아웃 */
.unboxed-companion-card .cd-controls-caption {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.unboxed-companion-card.active .cd-controls-caption {
  opacity: 1;
  transform: translateY(0);
}

.unboxed-companion-card.cd-unboxed-panel.emerge-from-sleeve .cd-controls-caption {
  opacity: 0;
  transform: translateY(6px);
  animation: captionFadeIn 0.45s ease 0.35s forwards !important;
}

.unboxed-companion-card.cd-unboxed-panel.retract-to-sleeve .cd-controls-caption {
  opacity: 1;
  animation: captionFadeOut 0.2s ease forwards !important;
}

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

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


/* 우측 세로 정렬 컴패니언 컬럼 (CD 맨 위, 슬리브 아래) */
.package-companions-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  flex-shrink: 0;
  transition: all 0.4s ease;
}

.unboxed-companion-card {
  display: none;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  flex-shrink: 0;
}

.unboxed-companion-card.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.unboxed-companion-card .cd-display-card {
  margin: 0 auto;
}

@media (max-width: 1200px) {
  .package-interactive-stage {
    flex-wrap: wrap;
  }
}

.paper-envelope-card {
  background: #ffffff;
  width: 640px;
  max-width: 640px;
  height: 908px; /* A5 정규 비율 고정: 640px 기준 908px (148 x 210mm) */
  aspect-ratio: 148 / 210;
  margin: 0;
  border: 1px solid #d4d4d4;
  box-shadow: var(--shadow-paper);
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 3px;
  box-sizing: border-box;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.envelope-face-front {
  padding: 30px 34px 24px 34px;
  height: 908px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.paper-texture {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  opacity: 0.025;
  background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noiseFilter"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noiseFilter)"/></svg>');
}

/* 상단 메타 (약봉투 번호 / 부스 번호 - PSD Layer 15~18) */
.envelope-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  padding: 0 40px;
}

.serial-col, .booth-col {
  display: flex;
  flex-direction: column;
}

.serial-col .meta-label, .booth-col .meta-label {
  font-size: 13.5px;
  font-weight: 600;
  color: #111;
  letter-spacing: 0.5px;
}

.serial-col .meta-value {
  font-size: 12px;
  font-weight: 500;
  color: #333;
  margin-top: 1px;
}

.booth-col {
  text-align: right;
}

.booth-col .meta-value {
  font-size: 12px;
  font-weight: 500;
  color: #333;
  margin-top: 1px;
}

/* 타이틀 블록 (PSD Layer 21 "ききくすり") */
.title-block {
  text-align: center;
  margin: 8px 0 16px 0;
}

.main-title {
  font-family: 'Noto Sans JP', 'Noto Sans KR', sans-serif;
  font-size: 45px;
  font-weight: 700;
  letter-spacing: 5px;
  color: #000;
  line-height: 1;
  display: inline-block;
}

/* 환자 및 과목 섹션 (PSD Layer 19, 22, 20, 38, 39 & 실물 사진 일치) */
.patient-envelope-section {
  padding: 0 40px;
  margin-bottom: 18px;
  position: relative;
}

.patient-dept-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: baseline;
  font-size: 18px;
  font-weight: 700;
  color: #000;
  margin-bottom: 2px;
}

.label-gairai {
  text-align: left;
}

.label-naiji {
  text-align: center;
}

.label-music {
  text-align: right;
  letter-spacing: 2px;
}

.patient-signature-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 38px;
  position: relative;
}

.patient-name-field {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-left: 0;
  padding-bottom: 2px;
  position: relative;
}

.patient-handwritten {
  font-family: 'Caveat', cursive, sans-serif;
  font-size: 36px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 0.9;
  letter-spacing: 0.5px;
  cursor: text;
  outline: none;
  display: inline-block;
  transform: rotate(-1deg);
  text-align: center;
  min-width: 150px;
}

.patient-handwritten:empty::before {
  content: attr(data-placeholder);
  color: rgba(0, 0, 0, 0.28);
  font-family: 'Noto Sans JP', 'Noto Sans KR', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.8px;
  pointer-events: none;
  display: inline-block;
  transform: rotate(0deg);
  vertical-align: middle;
}

.patient-handwritten:focus:empty::before {
  color: rgba(0, 0, 0, 0.12);
}

.patient-handwritten:focus {
  background: rgba(215, 243, 222, 0.4);
  border-radius: 4px;
}

.label-sama {
  font-size: 25px;
  font-weight: 700;
  color: #000;
  line-height: 1;
  margin-bottom: 2px;
  padding-right: 4px;
}

.patient-full-underline {
  width: 100%;
  border-bottom: 2.5px solid #000;
  margin-top: 1px;
}

/* 처방전 프레임 (PSD Layer 40 Rectangle 2) */
.prescription-frame {
  border: 2px solid #000;
  border-radius: 20px;
  padding: 24px 30px 14px 30px;
  position: relative;
  background: #ffffff;
  overflow: hidden;
}

/* 비커 심볼 워터마크 */
.watermark-symbol-wrap {
  position: absolute;
  top: 54%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 360px;
  height: 360px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.4; /* soysymbol_color 투명도 40% 적용 */
  display: flex;
  align-items: center;
  justify-content: center;
}

.watermark-symbol-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 처방전 상단 용법 / 시간 / 음악 그리드 (PSD Layer 29~36) */
.rx-header-grid {
  display: grid;
  grid-template-columns: 65px 1fr auto;
  align-items: center;
  row-gap: 8px;
  margin-bottom: 18px;
  position: relative;
  z-index: 2;
}

.rx-col-label {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.rx-col-value {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-left: 35px;
}

.rx-label-bold {
  font-size: 21px;
  font-weight: 700;
  color: #000;
  line-height: 1.1;
}

.rx-val-bold {
  font-size: 21px;
  font-weight: 700;
  color: #000;
  letter-spacing: 5px;
  line-height: 1.1;
}

.rx-label-sub {
  font-size: 15.5px;
  font-weight: 600;
  color: #000;
  line-height: 1.1;
}

.rx-val-sub {
  font-size: 15.5px;
  font-weight: 500;
  color: #000;
  line-height: 1.1;
}

.capsule-icon-original {
  width: 36px;
  height: 14px;
  border-radius: 7px;
  border: 1.8px solid #000;
  background: linear-gradient(90deg, #000 50%, #fff 50%);
  display: inline-block;
  margin-top: 1px;
}

.capsule-icon-original.large {
  width: 48px;
  height: 18px;
  border-radius: 9px;
  border: 2px solid #000;
}

.rx-val-music-row {
  display: flex;
  align-items: baseline;
  gap: 32px;
}

.rx-val-music {
  font-size: 15.5px;
  font-weight: 600;
  color: #000;
  letter-spacing: 2px;
  line-height: 1.1;
}

.rx-val-dose {
  font-size: 15.5px;
  font-weight: 600;
  color: #000;
  line-height: 1.1;
}

.rx-col-infinity {
  padding-right: 10px;
  align-self: flex-start;
}

.infinity-symbol {
  font-size: 36px;
  font-weight: 700;
  color: #000;
  line-height: 1;
}

/* 트랙리스트 (PSD Layer 46~88) */
.tracklist-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
  z-index: 2;
  margin-bottom: 18px;
}

.track-row {
  display: grid;
  grid-template-columns: 32px 145px 1fr auto;
  align-items: center;
  padding: 6px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.track-row:hover {
  background: var(--rx-mint-hover);
}

.track-row.active {
  background: rgba(215, 243, 222, 0.88);
  border-left: 3px solid #000;
}

.track-num {
  font-size: 15px;
  font-weight: 600;
  color: #111;
  font-family: 'Noto Sans JP', sans-serif;
}

.track-artist {
  font-size: 15px;
  font-weight: 500;
  color: #222;
  padding-right: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-title {
  font-size: 15px;
  font-weight: 600;
  color: #000;
  display: flex;
  align-items: center;
  gap: 8px;
}

.track-action {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-play-btn {
  background: #f0ede5;
  border: 1px solid #ccc;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0.6;
  padding: 0;
  color: #333;
}

.row-play-btn .player-svg-icon {
  width: 10px;
  height: 10px;
}

.row-play-btn .icon-play {
  transform: translateX(0.5px);
}

.track-row:hover .row-play-btn, .track-row.active .row-play-btn {
  opacity: 1;
}

.track-row:hover .row-play-btn {
  background: var(--clinic-red);
  color: #fff;
  border-color: var(--clinic-red);
}

.track-row.active .row-play-btn {
  background: #000;
  color: #fff;
  border-color: #000;
}

/* 프레임 하단 주의사항 바 (PSD Layer 41~43) */
.frame-caution-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 2;
  padding-top: 2px;
}

.caution-badge-box {
  border: 1.5px solid #d63031;
  color: #d63031;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 2px;
  line-height: 1.2;
}

.caution-desc-text {
  color: #222;
  font-size: 11.5px;
  font-weight: 400;
}

/* 프레임 하단 확인 문구 및 약국 사각 직인함 (PSD Layer 7~10, 12) */
.envelope-footer-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 18px;
  padding: 0 4px;
}

.footer-left-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notices-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notice-item {
  font-size: 11.5px;
  font-weight: 400;
  color: #111;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.notice-sq {
  font-size: 10px;
  line-height: 1;
}

/* 봉투 하단 클리닉 푸터 (PSD Layer 3~5) */
.envelope-clinic-footer {
  margin-top: 4px;
}

.clinic-brand-title {
  font-size: 19px;
  font-weight: 700;
  color: #000;
  letter-spacing: 0.5px;
  margin-bottom: 1px;
  line-height: 1.1;
}

.clinic-address-phone-row {
  display: flex;
  align-items: baseline;
  gap: 20px;
  font-size: 11px;
  font-weight: 400;
  color: #222;
}

.tel-label {
  margin-right: -14px;
}

/* 약국 사각 검인함 (PSD Layer 12 Rectangle 2 copy - 233x233px) */
.stamp-square-box {
  width: 82px;
  height: 82px;
  border: 1.8px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #fff;
  flex-shrink: 0;
}

.pharmacy-seal {
  width: 58px;
  height: 58px;
  transform: rotate(-6deg);
}

.seal-circle {
  width: 100%;
  height: 100%;
  border: 2px solid var(--clinic-stamp);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--clinic-stamp);
  font-weight: 600;
  opacity: 0.88;
}

.seal-top {
  font-size: 9.5px;
  border-bottom: 1px solid var(--clinic-stamp);
  padding-bottom: 1px;
  width: 75%;
  text-align: center;
}

.seal-mid {
  font-size: 7.5px;
  font-family: 'Share Tech Mono', sans-serif;
  letter-spacing: 0.5px;
}

.seal-bot {
  font-size: 6.5px;
  font-family: 'Share Tech Mono', sans-serif;
}

/* ==========================================================================
   裏面 (Back: KKS_Back.psd 및 KKKS 후면 원본 레이아웃 100% 재현)
   ========================================================================== */
.envelope-face-back {
  padding: 38px 44px 28px 44px;
  height: 908px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* 불필요하게 맨 아래로 밀지 않고 비례 분배 */
}

.back-sections-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.back-sec-title {
  font-size: 13px;
  font-weight: 700;
  color: #000;
  letter-spacing: 1.5px;
  margin-bottom: 3px;
}

.back-sec-desc {
  font-size: 10.5px;
  font-weight: 400;
  color: #222;
  line-height: 1.5;
}

/* 알약 이미지: 섹션과 타이틀 사이에 여유로운 숨통 */
.back-capsule-wrap {
  text-align: center;
  margin: 28px 0 16px 0;
}

/* 키키쿠스리 타이틀 블록 */
.back-title-block {
  text-align: center;
  margin-bottom: 22px;
}

.back-kiki-title {
  font-size: 40px;
  font-weight: 700;
  color: #000;
  letter-spacing: 3px;
  margin: 0;
  line-height: 1;
}

.back-naiji-sub {
  font-size: 18px;
  font-weight: 600;
  color: #000;
  letter-spacing: 5px;
  margin: 5px 0 0 0;
  line-height: 1;
}

/* 크레딧 블록: 타이틀 아래 및 하단 로고 위 사이에 균형잡힌 간격 */
.back-credits-block {
  text-align: center;
  margin-bottom: 26px;
}

.credits-header {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #000;
  margin-bottom: 6px;
}

.credits-line-producers {
  font-size: 10.5px;
  color: #333;
  line-height: 1.55;
}

.credits-line-thanks {
  font-size: 10.5px;
  color: #333;
  margin-top: 4px;
}

.back-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: none; /* 원본 사양: 상단 구분선 없음 */
  padding-top: 8px;
  margin-top: auto;
  gap: 16px;
  width: 100%;
}

.back-copyright-text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 5.6px; /* 원본 인쇄물 비율의 초소형 정밀 폰트 */
  color: #222222;
  line-height: 1.35;
  text-align: left;
  letter-spacing: 0.1px;
}

.back-copyright-text .copyright-line {
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

.back-logos-group {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-shrink: 0;
}

.back-brand-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.back-beaker-tilted-img {
  height: 22px;
  width: auto;
  display: block;
  object-fit: contain;
}

.back-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.back-brand-text .brand-line-1,
.back-brand-text .brand-line-2 {
  font-size: 8px;
  font-weight: 700;
  color: #111111;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.back-logos-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

/* 1. SoySauce Studio Online 브랜드 + 블랙 비커 심볼 로고 */
.back-brand-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
}

.back-soysymbol-img {
  height: 20px;
  width: auto;
  display: block;
  object-fit: contain;
}

.back-brand-text {
  font-size: 11px;
  font-weight: 600;
  color: #000;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* 2. 종이 마크 (紙マーク) */
.back-kami-wrap {
  display: flex;
  align-items: center;
}

.back-kami-img {
  height: 23px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* 3. CD 로고 (COMPACT disc DIGITAL AUDIO) */
.back-cd-wrap {
  display: flex;
  align-items: center;
}

.back-cd-img {
  height: 18px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* ==========================================================================
   2. CD & 크라프트 슬리브 뷰 (360px 대칭 균형 레이아웃)
   ========================================================================== */
.cd-stage-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 50px;
  flex-wrap: wrap;
  padding: 30px 10px;
}

.cd-display-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 360px;
}

/* 12cm Compact Disc 실제 규격 비율 (360px x 360px) */
.cd-disc {
  width: 360px;
  height: 360px;
  border-radius: 50%;
  position: relative;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  user-select: none;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cd-disc:hover {
  transform: scale(1.02);
}

/* 회전 애니메이션 */
.cd-disc.spinning {
  animation: spinDisc 4s linear infinite;
}

@keyframes spinDisc {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.disc-outer-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 1px 1px rgba(0, 0, 0, 0.12);
}

/* PDF 원본 고해상도 CD 라벨 아트워크 (Document.pdf 100% 실크인쇄 일치) */
.disc-printed-artwork {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  pointer-events: none;
  z-index: 1;
  display: block;
}

/* 은은한 홀로그램 프리즘 광택 */
.disc-holo-sheen {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 45deg,
    rgba(255, 255, 255, 0) 0deg,
    rgba(164, 227, 183, 0.16) 45deg,
    rgba(255, 180, 200, 0.14) 90deg,
    rgba(180, 210, 255, 0.16) 135deg,
    rgba(255, 255, 255, 0) 180deg,
    rgba(164, 227, 183, 0.16) 225deg,
    rgba(255, 180, 200, 0.14) 270deg,
    rgba(180, 210, 255, 0.16) 315deg,
    rgba(255, 255, 255, 0) 360deg
  );
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: color-dodge;
  opacity: 0.55;
}

.cd-controls-caption {
  margin-top: 20px;
  text-align: center;
  width: 100%;
}

.cd-controls-caption .badge {
  background: #333;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
}

.cd-controls-caption p {
  font-size: 12px;
  color: #666;
  margin-top: 6px;
  line-height: 1.4;
}

/* 크라프트 슬리브 패키지 재현 (360px x 360px) */
.kraft-sleeve-card {
  width: 360px;
  height: 360px;
  background: var(--kraft-base);
  border: 1px solid var(--kraft-dark);
  border-radius: 6px;
  position: relative;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.kraft-sleeve-card:hover {
  transform: translateY(-4px);
}

.kraft-texture {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  opacity: 0.12;
  background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noiseFilter"><feTurbulence type="fractalNoise" baseFrequency="0.6" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noiseFilter)"/></svg>');
  pointer-events: none;
}

.sleeve-flap {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 48px;
  background: var(--kraft-dark);
  opacity: 0.22;
  border-bottom: 1px dashed rgba(0,0,0,0.25);
}

/* 크라프트 종이 슬리브 우측 하단 소형 처방 라벨 스티커 (CD Sticker.pdf 원본 일치) */
.sleeve-sticker-wrap {
  position: absolute;
  right: 20px;
  bottom: 22px;
  width: 140px;
  z-index: 5;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.26);
  border-radius: 4px;
  overflow: hidden;
  background: #ffffff;
  border: 0.5px solid rgba(0, 0, 0, 0.12);
  transform: rotate(-0.5deg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  line-height: 0;
}

.sleeve-sticker-wrap:hover {
  transform: rotate(0deg) scale(1.04);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.36);
}

.sleeve-sticker-img {
  width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   3. 제품출고증 / 송장 뷰
   ========================================================================== */
.invoice-sheet {
  background: #ffffff;
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 50px;
  box-shadow: var(--shadow-paper);
  border: 1px solid #d0d0d0;
  border-radius: 2px;
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #222;
  padding-bottom: 18px;
  margin-bottom: 25px;
}

.invoice-main-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 8px;
  color: #111;
}

.invoice-sub-title {
  font-size: 13px;
  color: #666;
  font-family: 'Share Tech Mono', sans-serif;
}

.invoice-meta-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.inv-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.inv-meta-label {
  color: #666;
}

.inv-meta-val {
  font-weight: 600;
  font-family: 'Share Tech Mono', monospace;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 25px;
  font-size: 13px;
}

.invoice-table th, .invoice-table td {
  border: 1px solid #ccc;
  padding: 10px 12px;
  text-align: left;
}

.invoice-table th {
  background: #f4f4f4;
  font-weight: 600;
  color: #333;
}

.tear-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 28px 0;
  width: 100%;
  color: #728076;
  font-size: 11.5px;
  letter-spacing: 1px;
  user-select: none;
  font-family: 'Share Tech Mono', monospace, sans-serif;
  overflow: hidden;
}

.tear-line::before,
.tear-line::after {
  content: "";
  flex: 1;
  border-bottom: 1.5px dashed #a2b4a8;
  min-width: 12px;
}

.tear-line-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: #4a5c51;
  padding: 0 4px;
  flex-shrink: 0;
  font-weight: 600;
}

.tear-line-scissor {
  font-size: 13px;
  line-height: 1;
  display: inline-block;
  transform: translateY(-0.5px);
}

/* ==========================================================================
   출고증 내 납품처 및 행사장(M3) 부스 배치도 블록 (제작자 위 배치)
   ========================================================================== */
.invoice-map-block {
  margin: 24px 0 26px 0;
  padding: 16px 20px;
  background: #ffffff;
  border: 1px solid #c9d8cf;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.inv-map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 9px;
  border-bottom: 1px dashed #d5e2da;
  flex-wrap: wrap;
  gap: 8px;
}

.inv-map-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.inv-map-header h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: #16402a;
  margin: 0;
  letter-spacing: 0.5px;
}

.inv-map-sub {
  font-size: 11px;
  color: #556c5e;
}

.inv-map-pill {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10.5px;
  font-weight: 600;
  background: #e2ede6;
  color: #145034;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #bad4c6;
}

.inv-map-frame {
  background: #f7faf8;
  border: 1px solid #dbe6e0;
  border-radius: 6px;
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.03);
}

.inv-map-img {
  width: 100%;
  max-width: 820px;
  height: auto;
  display: block;
  border-radius: 5px;
  border: 1px solid #cad8d0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.25s ease;
}

.inv-map-caption {
  margin-top: 10px;
  font-size: 11.5px;
  color: #3b5043;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.5;
}

.map-caption-icon {
  font-size: 13px;
  flex-shrink: 0;
}

.invoice-bottom-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 30px;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

.invoice-info-col h4, .invoice-notice-col h4 {
  font-size: 14px;
  color: #222;
  margin-bottom: 12px;
}

.info-list {
  list-style: none;
  font-size: 12px;
  line-height: 1.8;
  color: #444;
}

.invoice-callout {
  background: #fbfbfb;
  border-left: 3px solid var(--clinic-red);
  padding: 10px 14px;
  font-size: 12px;
  color: #444;
  line-height: 1.6;
  margin-bottom: 15px;
}

.qr-box-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qr-img {
  width: 68px;
  height: 68px;
  border: 1px solid #ccc;
  padding: 3px;
  background: #fff;
}

.qr-caption {
  font-size: 11px;
  color: #777;
  font-family: 'Share Tech Mono', monospace;
}

/* 출고증 내 앨범 아트워크 다운로드 & 미리보기 블록 */
.invoice-artwork-block {
  margin: 25px 0;
  padding: 18px 22px;
  background: #fcfcfb;
  border: 1.5px solid #dcdcd8;
  border-radius: 6px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
}

.inv-art-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  border-bottom: 1px solid #e8e8e4;
  padding-bottom: 8px;
}

.inv-art-header h4 {
  font-size: 13.5px;
  color: #111;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.inv-art-pill {
  background: #222;
  color: #fff;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

.inv-art-content {
  display: flex;
  gap: 22px;
  align-items: center;
  flex-wrap: wrap;
}

.inv-art-preview-box {
  width: 140px;
  height: 140px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 1px solid #ccc;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.inv-art-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.inv-art-preview-box:hover .inv-art-thumb {
  transform: scale(1.06);
}

.inv-art-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.inv-art-preview-box:hover .inv-art-overlay {
  opacity: 1;
}

.inv-art-overlay .zoom-icon {
  font-size: 22px;
}

.inv-art-overlay .overlay-text {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.inv-art-info {
  flex: 1;
  min-width: 250px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inv-art-title {
  font-size: 14px;
  font-weight: 700;
  color: #111;
}

.inv-art-specs-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11.5px;
  color: #444;
}

.inv-art-specs-list .spec-label {
  color: #777;
  display: inline-block;
  width: 45px;
}

.inv-art-specs-list .spec-val {
  font-weight: 600;
  color: #222;
}

.inv-art-btn-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.inv-art-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.inv-art-btn.btn-view {
  background: #ffffff;
  color: #222;
  border: 1px solid #aaa;
}

.inv-art-btn.btn-view:hover {
  background: #f0f0f0;
  border-color: #555;
  color: #000;
}

.inv-art-btn.btn-download {
  background: #111111;
  color: #ffffff;
  border: 1px solid #111111;
}

.inv-art-btn.btn-download:hover {
  background: var(--clinic-red);
  border-color: var(--clinic-red);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(214, 48, 49, 0.35);
}

/* ==========================================================================
   4. 갤러리 뷰 (공식 앨범 아트워크 단독 전시)
   ========================================================================== */
.gallery-single-container {
  max-width: 580px;
  margin: 0 auto;
}

.gallery-card.album-art-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-tag {
  font-size: 12px;
  font-weight: 600;
  color: #555;
}

.gallery-art-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 1px solid #eee;
}

.gallery-art-wrap .gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-art-wrap:hover .gallery-img {
  transform: scale(1.03);
}

.gallery-zoom-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.gallery-art-wrap:hover .gallery-zoom-overlay {
  opacity: 1;
}

.gallery-zoom-overlay .zoom-icon {
  font-size: 32px;
}

.gallery-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.gallery-art-title {
  font-size: 14px;
  font-weight: 700;
  color: #111;
}

.gallery-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #111;
  color: #fff;
  padding: 8px 16px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.gallery-download-btn:hover {
  background: var(--clinic-red);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(214, 48, 49, 0.35);
}

/* ==========================================================================
   아트워크 고해상도 확대 모달 (Lightbox Modal)
   ========================================================================== */
.art-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.art-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.art-modal-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.art-modal-dialog {
  position: relative;
  z-index: 2;
  background: #ffffff;
  border-radius: 10px;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalPop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.art-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  background: #f7f7f7;
  border-bottom: 1px solid #e0e0e0;
}

.art-modal-header .modal-title {
  font-size: 13px;
  font-weight: 700;
  color: #222;
}

.art-modal-close {
  background: transparent;
  border: none;
  font-size: 18px;
  color: #666;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
  transition: all 0.15s;
}

.art-modal-close:hover {
  background: #eee;
  color: #000;
}

.art-modal-body {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  overflow: hidden;
}

.art-modal-full-img {
  max-width: 75vh;
  max-height: 75vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

.art-modal-footer {
  padding: 10px 18px;
  background: #f7f7f7;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: flex-end;
}

.modal-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #111;
  color: #fff;
  padding: 7px 16px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.modal-download-btn:hover {
  background: var(--clinic-red);
}

/* ==========================================================================
   하단 고정 오디오 플레이어 독 (Player Dock) - 화이트 메디컬 에스테틱
   ========================================================================== */
.player-dock {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  border-top: 1px solid #d4ded8;
  z-index: 1000;
  padding: 0;
  box-shadow: 0 -4px 20px rgba(15, 35, 25, 0.08);
  color: #11241a;
  transform: translateY(125%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

.player-dock.active {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.player-dock-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 24px 12px 24px;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto auto;
  align-items: center;
  gap: 28px;
}

.player-track-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  max-width: 480px;
}

.track-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pill-pill-badge {
  background: var(--clinic-red);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2.5px 7px;
  border-radius: 12px;
  letter-spacing: 0.5px;
  line-height: 1.2;
  flex-shrink: 0;
}

.track-meta-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.meta-artist {
  font-size: 11px;
  color: #556c5e;
  line-height: 1.4;
  padding-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.meta-title {
  font-size: 13.5px;
  color: #11241a;
  font-weight: 700;
  line-height: 1.45;
  padding-bottom: 4px;
  margin-bottom: -2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   SVG 플레이어 및 컨트롤 아이콘 (모바일 OS 이모지 대체)
   ========================================================================== */
.player-svg-icon {
  display: inline-block;
  vertical-align: middle;
  fill: currentColor;
  stroke: none;
  pointer-events: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.player-svg-icon.icon-vital {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ctrl-btn {
  background: #ffffff;
  border: 1px solid #cbdad0;
  color: #2e4438;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
}

.ctrl-btn .player-svg-icon {
  width: 14px;
  height: 14px;
}

.ctrl-btn:hover {
  background: #f0f6f2;
  color: #143526;
  border-color: #143526;
}

.ctrl-btn.play-btn {
  width: 44px;
  height: 44px;
  background: #143526;
  color: #ffffff;
  border: none;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(20, 53, 38, 0.25);
  padding: 0;
}

.ctrl-btn.play-btn .player-svg-icon {
  width: 18px;
  height: 18px;
}

.ctrl-btn.play-btn .icon-play {
  transform: translateX(1px);
}

.ctrl-btn.play-btn:hover {
  background: #0b2218;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(20, 53, 38, 0.35);
}

.vol-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.vol-icon .player-svg-icon {
  width: 16px;
  height: 16px;
  color: #556c5e;
}

.vital-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.vital-btn-icon .player-svg-icon {
  width: 15px;
  height: 15px;
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.time-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: #556c5e;
  min-width: 36px;
}

.seek-bar {
  flex: 1;
  height: 6px;
  background: #d8e4dc;
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.seek-fill {
  width: 0%;
  height: 100%;
  background: #143526;
  box-shadow: none;
  transition: width 0.1s linear;
}

.dosage-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
}

.dosage-counter {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.dosage-label {
  font-size: 9px;
  color: #556c5e;
}

.dosage-pills {
  font-size: 12px;
  font-weight: 600;
  color: #143526;
  font-family: 'Share Tech Mono', monospace;
}

.volume-dial-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vol-icon {
  font-size: 12px;
  color: #2e4438;
}

.vol-slider {
  width: 70px;
  accent-color: #143526;
  cursor: pointer;
}

/* 다국어 지원 */
body.lang-ko {
  font-family: 'Noto Sans KR', sans-serif;
}

/* 실물 패키지 처방 약봉투(앞면/뒷면)는 언어 전환과 무관하게 일본어 전용 서체 및 완벽한 조판 규격을 유지 */
body.lang-ko .paper-envelope-card,
body.lang-ko .paper-envelope-card * {
  font-family: 'Noto Sans JP', sans-serif;
}

body.lang-ko .paper-envelope-card .main-title,
body.lang-ko .paper-envelope-card .back-kiki-title {
  font-family: 'Noto Sans JP', sans-serif !important;
}

body.lang-ko .paper-envelope-card .patient-handwritten {
  font-family: 'Caveat', cursive, sans-serif !important;
}

body.lang-ko .paper-envelope-card .meta-value,
body.lang-ko .paper-envelope-card .serial-col .meta-value,
body.lang-ko .paper-envelope-card .booth-col .meta-value {
  font-family: 'Share Tech Mono', monospace !important;
}

/* 반응형 모바일 */
@media (max-width: 768px) {

  /* iOS Safe Area 인셋 대응 (노치 및 하단 홈 바 스와이프 제스처 간섭 원천 분리) */
  .app-header {
    padding-top: calc(5px + env(safe-area-inset-top, 0px)) !important;
  }

  .player-dock {
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }

  .player-dock-inner {
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body {
    padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* 야외 직사광선 시인성 강화 (명도 대비 WCAG AAA 6.8:1+ 충족) */
  .meta-artist {
    color: #364a3e !important;
    font-weight: 600 !important;
  }

  .time-text {
    color: #2e4438 !important;
    font-weight: 700 !important;
  }

  .dosage-label {
    color: #364a3e !important;
    font-weight: 700 !important;
  }

  .vital-metric-card .metric-label {
    color: #2e4438 !important;
    font-weight: 800 !important;
  }

  .vital-metric-card .metric-unit {
    color: #364a3e !important;
  }

  .vital-patient-col .patient-target {
    color: #2e4438 !important;
  }

  .vital-patient-col .patient-target strong {
    color: #0b1a13 !important;
  }

  .seek-bar {
    background: #c2d4c8 !important;
  }

  .seek-fill {
    background: #0d3a24 !important;
  }

  /* 모바일 3D 약봉투 스와이프 제스처 힌트 배지 */
  .envelope-swipe-hint {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    background: rgba(20, 53, 38, 0.08);
    border: 1px solid rgba(20, 53, 38, 0.16);
    color: #14442a;
    font-size: 10.5px;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 14px;
    margin: 4px auto 8px auto;
    transition: opacity 0.4s ease, transform 0.4s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  }

  .envelope-swipe-hint.fade-out {
    opacity: 0 !important;
    transform: translateY(-4px) !important;
    pointer-events: none !important;
  }

  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
  }

  /* 상단 헤더 컴팩트 2행 레이아웃 */
  .app-header {
    padding: 4px 0 !important;
  }

  .header-inner {
    padding: 4px 12px !important;
    gap: 4px !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .brand {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
  }

  .clinic-emblem {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 0 !important;
  }

  .clinic-brand-icon {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
  }

  .clinic-main-brand {
    display: flex !important;
    align-items: baseline !important;
    gap: 5px !important;
    white-space: nowrap !important;
  }

  .brand-yakdang {
    font-size: 12px !important;
    font-weight: 800 !important;
  }

  .brand-label {
    font-size: 10px !important;
    color: #44594e !important;
  }

  .clinic-sub-desc {
    display: none !important; /* 모바일에서 불필요한 줄바꿈 유발 차단 */
  }

  .header-meta-tags {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
  }

  .catalog-badge, .booth-tag {
    font-size: 8.5px !important;
    padding: 1.5px 5px !important;
    border-radius: 2px !important;
  }

  .header-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding-top: 4px !important;
    border-top: 1px solid #e8efe9 !important;
    gap: 6px !important;
  }

  .action-btn {
    padding: 3px 8px !important;
    font-size: 10px !important;
  }

  .lang-btn {
    padding: 3px 7px !important;
    font-size: 9.5px !important;
  }

  .main-stage {
    margin: 6px auto !important;
    padding: 0 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  /* 패키지 컨트롤 바: 모바일 1줄 고정 */
  .package-controls-bar {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 4px !important;
    margin: 6px auto 14px auto !important;
    width: 100% !important;
    max-width: 380px !important;
    flex-wrap: nowrap !important;
  }

  .package-controls-bar .ctrl-group {
    padding: 2px 3px !important;
    gap: 2px !important;
  }

  .package-controls-bar .flip-btn,
  .package-controls-bar .unbox-btn {
    padding: 4px 6px !important;
    font-size: 10px !important;
    gap: 2px !important;
    white-space: nowrap !important;
  }

  /* 하단 오디오 독 모바일 */
  .player-dock-inner {
    grid-template-columns: 1fr auto !important;
    gap: 8px !important;
    padding: 6px 12px 8px 12px !important;
  }

  .player-track-info {
    gap: 6px !important;
    min-width: 0 !important;
  }

  .meta-title {
    max-width: 130px !important;
    font-size: 12px !important;
  }

  .meta-artist {
    font-size: 10px !important;
  }

  .progress-wrap, .dosage-controls, .vital-canvas-col, .vital-metric-card.track-card {
    display: none !important;
  }

  .player-vital-drawer.active {
    max-height: 44px !important;
  }

  .vital-drawer-inner {
    padding: 4px 10px !important;
    gap: 6px !important;
  }

  .vital-patient-col {
    min-width: auto !important;
  }

  .patient-id-tag {
    font-size: 9.5px !important;
    gap: 3px !important;
  }

  .system-badge {
    font-size: 7.5px !important;
    padding: 1px 4px !important;
  }

  .vital-metrics-col {
    gap: 4px !important;
  }

  .vital-metric-card {
    padding: 1px 5px !important;
    min-height: 26px !important;
  }

  .vital-metric-card .metric-label {
    font-size: 6.5px !important;
  }

  .vital-metric-card .metric-val {
    font-size: 10.5px !important;
  }

  .vital-metric-card .metric-unit {
    font-size: 7.5px !important;
  }

  /* 출고증 모바일 */
  .invoice-sheet {
    padding: 14px 10px !important;
  }

  .invoice-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .invoice-meta-grid {
    width: 100% !important;
  }

  .invoice-bottom-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .invoice-map-block,
  .invoice-video-block,
  .invoice-artwork-block,
  .invoice-sales-block {
    padding: 10px 12px !important;
  }

  .inv-art-content {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 14px !important;
  }

  .inv-art-btn-group {
    justify-content: center !important;
  }
}

/* 스마트폰 전용 3D 약봉투 자동 비례 스케일링 (가로 넘침 원천 방지 & 화면 맞춤) */
@media (max-width: 680px) {
  /* 출고증 명세 테이블 모바일 카드형 영수증 전환 */
  .invoice-table {
    display: block !important;
    border: 1px solid #c8d8ce !important;
    border-radius: 6px !important;
    background: #f7faf8 !important;
    overflow: hidden !important;
    margin: 12px 0 16px 0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03) !important;
  }

  .invoice-table thead {
    display: none !important;
  }

  .invoice-table tbody {
    display: block !important;
  }

  .invoice-table tr {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px 12px !important;
    padding: 12px 14px !important;
  }

  .invoice-table td {
    border: none !important;
    padding: 3px 0 !important;
    text-align: left !important;
    font-size: 11.5px !important;
    background: transparent !important;
    display: flex !important;
    align-items: baseline !important;
    gap: 6px !important;
  }

  .invoice-table td:nth-child(3) {
    grid-column: 1 / -1 !important;
    font-size: 14px !important;
    color: #11241a !important;
    border-bottom: 1px dashed #cadad0 !important;
    padding-bottom: 8px !important;
    margin-bottom: 4px !important;
  }

  .invoice-table td:nth-child(1)::before { content: "NO:"; font-weight: 700; color: #556c5e; font-size: 10px; }
  .invoice-table td:nth-child(2)::before { content: "MPS番号:"; font-weight: 700; color: #556c5e; font-size: 10px; }
  .invoice-table td:nth-child(3)::before { content: "品名:"; font-weight: 700; color: #165237; font-size: 11px; }
  .invoice-table td:nth-child(4)::before { content: "ST' NO:"; font-weight: 700; color: #556c5e; font-size: 10px; }
  .invoice-table td:nth-child(5)::before { content: "品目分類:"; font-weight: 700; color: #556c5e; font-size: 10px; }
  .invoice-table td:nth-child(6)::before { content: "数量:"; font-weight: 700; color: #556c5e; font-size: 10px; }
  .invoice-table td:nth-child(7)::before { content: "備考:"; font-weight: 700; color: #556c5e; font-size: 10px; }

  .package-interactive-stage {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 16px !important;
  }

  /* 3D 약봉투: 모바일 뷰포트 정중앙 완벽 안착 & 원본 레이아웃 100% 보존 정비례 축소 */
  .envelope-3d-scene {
    width: var(--mob-scene-w, 360px) !important;
    height: var(--mob-scene-h, 511px) !important;
    position: relative !important;
    display: flex !important;
    justify-content: center !important;
    align-items: flex-start !important;
    overflow: visible !important;
    margin: 0 auto 14px auto !important;
    transform: none !important;
  }

  .envelope-3d-scene .envelope-pouch-wrapper {
    position: relative !important;
    top: 0 !important;
    left: auto !important;
    right: auto !important;
    margin: 0 auto !important;
    width: 640px !important;
    height: 908px !important;
    transform: scale(var(--mob-scale, 0.5625)) !important;
    transform-origin: top center !important;
    transform-style: preserve-3d !important;
    flex-shrink: 0 !important;
  }

  .package-companions-col {
    width: 100% !important;
    align-items: center !important;
    margin-top: 6px !important;
    gap: 16px !important;
  }

  .cd-display-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 300px !important;
  }

  .cd-disc {
    width: 250px !important;
    height: 250px !important;
  }

  .kraft-sleeve-card {
    width: 270px !important;
    height: 270px !important;
  }

  .sleeve-sticker-wrap {
    width: 210px !important;
  }

  .sales-row-item {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .sales-row-action {
    width: 100% !important;
    justify-content: flex-start !important;
  }
}

/* 출고증 크로스페이드 영상 임베드 블록 */
.invoice-video-block {
  margin: 25px 0 30px 0;
  background: #ffffff;
  border: 1px solid #c9d8cf;
  border-radius: 8px;
  padding: 16px 20px 20px 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.inv-video-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.inv-video-header h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: #1a3022;
  margin: 0;
  letter-spacing: 0.5px;
}

.inv-video-tag {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  background: #e1ede5;
  color: #145034;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid #b8d4c4;
}

.inv-video-frame-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 비율 유지 */
  height: 0;
  overflow: hidden;
  border-radius: 6px;
  background: #000000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.inv-video-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* 출고증 국내 판매 / 글로벌 판매 안내 블록 */
/* 출고증 국내 판매 / 글로벌 판매 안내 블록 (슬림 바 레이아웃) */
/* ==========================================================================
   출고증 하단 판매처 및 취급 채널 블록 (Distribution & Sales Rows)
   ========================================================================== */
.invoice-sales-block {
  margin: 22px 0 28px 0;
  background: #ffffff;
  border: 1px solid #c9d8cf;
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.inv-sales-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #d5e2da;
  flex-wrap: wrap;
  gap: 8px;
}

.inv-sales-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.inv-sales-header h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: #16402a;
  margin: 0;
  letter-spacing: 0.5px;
}

.inv-sales-note {
  font-size: 10.5px;
  color: #61776b;
}

.inv-sales-pill {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  background: #e2ede6;
  color: #145034;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #bad4c6;
}

.inv-sales-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sales-row-item {
  background: #f7faf8;
  border: 1px solid #dce6e0;
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: all 0.2s ease;
}

.sales-row-item:hover {
  background: #ffffff;
  border-color: #165237;
  box-shadow: 0 3px 10px rgba(22, 82, 55, 0.06);
}

.sales-row-channel {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sales-row-flag {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.sales-row-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sales-row-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #112218;
}

.sales-row-desc {
  font-size: 10.5px;
  color: #556c5e;
}

.sales-row-action {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* 글로벌 및 일본 판매 쪽 버튼 세로 스택 배치 */
.global-channel .sales-row-action {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 175px;
}

.global-channel .sales-row-action .channel-btn {
  width: 100%;
  justify-content: center;
}

.kr-channel .sales-row-action {
  min-width: 175px;
}

.kr-channel .sales-row-action .channel-btn {
  width: 100%;
  justify-content: center;
}

/* 채널 버튼 베이스 스타일 */
.channel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.3;
}

.channel-btn.btn-primary {
  background: #143526;
  color: #ffffff;
  border: 1px solid #143526;
  box-shadow: 0 2px 6px rgba(20, 53, 38, 0.2);
}

.channel-btn.btn-primary:hover {
  background: #0b2218;
  border-color: #0b2218;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(20, 53, 38, 0.3);
}

.channel-btn.btn-secondary {
  background: #ffffff;
  color: #1f3729;
  border: 1px solid #c4d4ca;
}

.channel-btn.btn-secondary:hover {
  background: #f0f6f2;
  border-color: #143526;
  color: #143526;
  transform: translateY(-1px);
}

.channel-btn.btn-tba {
  background: #edf3ef;
  color: #5d7568;
  border: 1px dashed #afc5b9;
  cursor: default;
  user-select: none;
}

.channel-btn.btn-tba:hover {
  background: #edf3ef;
  color: #5d7568;
  border-color: #afc5b9;
  transform: none;
  box-shadow: none;
}

.channel-btn.btn-compact {
  padding: 6px 12px;
  font-size: 11px;
}

@media (max-width: 640px) {
  .sales-row-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .sales-row-action {
    width: 100%;
    justify-content: flex-start;
  }
  .global-channel .sales-row-action,
  .kr-channel .sales-row-action {
    width: 100%;
    min-width: unset;
  }
}


/* 트랙 리스트 터치 영역 강화 및 탭 인터랙션 최적화 */
.track-row {
  position: relative;
  -webkit-tap-highlight-color: rgba(20, 53, 38, 0.18);
  touch-action: manipulation;
}

.track-row::after {
  content: '';
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: 0;
  right: 0;
  z-index: 1;
}

.track-row > * {
  position: relative;
  z-index: 2;
}

.track-row:active {
  background: rgba(20, 53, 38, 0.16) !important;
}

/* 돋보기 버튼 스타일 */
.btn-zoom {
  background: #ffffff;
  border: 1px solid #cbdad0;
  color: #2e4438;
}

.zoom-switch-group .channel-btn.active {
  background: #143526 !important;
  color: #ffffff !important;
  border-color: #143526 !important;
}

/* 데스크톱에서는 스와이프 힌트 기본 숨김 */
.envelope-swipe-hint {
  display: none;
}


/* 데스크톱에서는 모바일 전용 플레이어 완전 숨김 */
.mobile-track-player-section {
  display: none;
}

/* 모바일 전용 처방 음원 플레이어 스타일 */
@media (max-width: 768px) {
  .mobile-track-player-section {
    display: block !important;
    width: 100% !important;
    max-width: 390px !important;
    margin: 18px auto 14px auto !important;
    background: #ffffff !important;
    border: 1px solid #c9d8cf !important;
    border-radius: 10px !important;
    padding: 12px 14px !important;
    box-shadow: 0 3px 12px rgba(15, 35, 25, 0.05) !important;
    box-sizing: border-box !important;
  }

  .mob-track-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding-bottom: 9px !important;
    margin-bottom: 8px !important;
    border-bottom: 1.5px solid #e2ece6 !important;
  }

  .mob-track-title-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
  }

  .mob-rx-badge {
    background: var(--clinic-red) !important;
    color: #ffffff !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    letter-spacing: 0.5px !important;
  }

  .mob-track-heading {
    font-size: 13px !important;
    font-weight: 800 !important;
    color: #112218 !important;
    margin: 0 !important;
    letter-spacing: 0.3px !important;
  }

  .mob-track-sub-hint {
    font-size: 10px !important;
    color: #556c5e !important;
    font-weight: 600 !important;
  }

  .mobile-tracks-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
  }

  .mob-track-card {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 8px 10px !important;
    background: #f7faf8 !important;
    border: 1px solid #d8e5de !important;
    border-radius: 7px !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
    touch-action: manipulation !important;
    min-height: 48px !important; /* Apple HIG 44px 이상 */
    box-sizing: border-box !important;
  }

  .mob-track-card:active {
    background: #e6efe9 !important;
    transform: scale(0.985) !important;
  }

  .mob-track-card.active {
    background: #143526 !important;
    border-color: #143526 !important;
    box-shadow: 0 2px 8px rgba(20, 53, 38, 0.2) !important;
  }

  .mob-track-left {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    min-width: 0 !important;
  }

  .mob-track-num {
    font-family: 'Share Tech Mono', monospace !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: var(--clinic-red) !important;
    background: #fde8e8 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
  }

  .mob-track-card.active .mob-track-num {
    background: #ffffff !important;
    color: #143526 !important;
  }

  .mob-track-info {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    gap: 1px !important;
  }

  .mob-track-title {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #112218 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.3 !important;
  }

  .mob-track-card.active .mob-track-title {
    color: #ffffff !important;
  }

  .mob-track-meta {
    font-size: 10px !important;
    color: #556c5e !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .mob-track-card.active .mob-track-meta {
    color: #9cbda9 !important;
  }

  .mob-track-play-btn {
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    border: 1px solid #c8d8ce !important;
    color: #143526 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    padding: 0 !important;
  }

  .mob-track-play-btn span {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .mob-track-play-btn .player-svg-icon {
    width: 13px !important;
    height: 13px !important;
  }

  .mob-track-play-btn .icon-play {
    transform: translateX(1px);
  }

  .mob-track-card.active .mob-track-play-btn {
    background: #00ff77 !important;
    border-color: #00ff77 !important;
    color: #0d1a12 !important;
    box-shadow: 0 0 8px rgba(0, 255, 119, 0.4) !important;
  }
}
