/* =========================================================
   JANGSAENG TALK (장생꿀단톡) — Design Tokens
   Palette v3: 노랑·황금·짙은 주황·검정·녹색을 섞은 대비 강한
   벌꿀 테마 — 멤버스톡과 확실히 구분되도록 배경 자체를
   그라데이션으로 바꾸고, 채도/명도 대비를 크게 키움 (2026-08)
   Type: Fraunces(디스플레이 세리프) + Pretendard(한글 본문/UI)
   ========================================================= */

:root {
  --bg: #f7b100;
  --bg-soft: #f0b23a;
  --card-bg: #fffaf0;
  --line: rgba(40, 24, 4, 0.24);

  --orange-1: #ffc107; /* 선명한 황금빛 노랑 */
  --orange-2: #e8710d; /* 짙은 주황 (메인) */
  --orange-3: #6e3300; /* 검정에 가까운 짙은 앰버 */

  --leaf: #3f6b2e; /* 녹색 포인트 (온라인 표시·자연 이미지 강조) */

  --cream: #4a2a0a; /* 한국어 본문/헤드라인용 진한 초콜릿브라운 (검정 대신) */
  --ink-en: #201305; /* 영어 워드마크·라벨 전용, 검정에 가까운 톤 */
  --muted: #5c4013;
  --muted-2: #8c6318;

  --surface-soft: rgba(255, 250, 232, 0.62); /* 골드 배경 위 메뉴류 — 흰 박스 대신 반투명 카드 */

  --danger: #b0473a;
  --success: #3f6b2e;

  --font-kr: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Fraunces', 'Pretendard', serif;
  --font-num: 'Manrope', var(--font-kr);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-kr);
  overflow: hidden;
}

body {
  position: relative;
  min-height: 100vh;
}

/* ---------- 배경 육각형 필드 (앰비언트) ---------- */
.bg-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.hex {
  position: absolute;
  width: 220px;
  height: 190px;
  clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0% 50%);
  background: linear-gradient(135deg, var(--orange-1), var(--orange-3));
  opacity: 0.14;
  filter: blur(1px);
  animation: drift 22s ease-in-out infinite;
}
.h1 { top: -60px; left: -60px; animation-delay: 0s; }
.h2 { top: 20%; right: -100px; width: 300px; height: 260px; animation-delay: -4s; }
.h3 { bottom: -80px; left: 10%; animation-delay: -9s; }
.h4 { bottom: 10%; right: 5%; width: 150px; height: 130px; animation-delay: -13s; }
.h5 { top: 55%; left: -80px; width: 180px; height: 155px; animation-delay: -6s; }
.h6 { top: -40px; right: 20%; width: 130px; height: 112px; animation-delay: -17s; }

@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-24px) rotate(6deg); }
}

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

/* ---------- 홈 화면에 추가(설치) 안내 배너 ---------- */
.install-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--orange-2), var(--orange-3));
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.install-banner[hidden] {
  display: none;
}

.install-banner-text {
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  flex: 1;
  min-width: 180px;
}

.install-banner-btns {
  display: flex;
  gap: 8px;
}

.install-btn-primary,
.install-btn-dismiss {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
}

.install-btn-primary {
  background: var(--cream);
  color: var(--orange-1);
}

.install-btn-dismiss {
  background: rgba(74, 42, 10, 0.18);
  color: var(--cream);
}

/* ---------- 로고 입체(3D) 한바퀴 회전 (앱 진입 시 한 번만) ---------- */
/* 기존의 별도 인트로 화면(로고 회전 → 정지 → 타이틀) 대신, 실제 화면(게이트 또는
   통화 화면)에 로고가 나타나면서 그 자리에서 한 바퀴만 입체적으로 회전합니다.
   평면(2D) 회전과 달리 rotateY + perspective를 써서, 회전 중간에 로고의
   "옆면 → 뒷면 → 다시 앞면" 순서로 보이는 입체적인 느낌을 줍니다. */
@keyframes logoFlip3D {
  from { transform: perspective(600px) rotateY(0deg); }
  to { transform: perspective(600px) rotateY(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .logo,
  .ring-static {
    animation: none !important;
  }
}

/* ---------- 공통 화면 레이아웃 ---------- */
.screen {
  position: relative;
  z-index: 1;
  display: none;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.screen.active { display: flex; }

/* ---------- 1. 게이트 ---------- */
.card {
  width: 100%;
  max-width: 360px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 40px 28px 32px;
  text-align: center;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}

.logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin-bottom: 18px;
  animation: logoFlip3D 1s cubic-bezier(0.65, 0, 0.35, 1) both;
}

/* ---- 게이트 화면: 로고 위를 맴도는 꿀벌 ---- */
.logo-bee-wrap {
  position: relative;
  display: inline-block;
}
.bee-fly {
  position: absolute;
  top: -6px;
  left: 50%;
  font-size: 18px;
  line-height: 1;
  animation: beeOrbit 5.5s ease-in-out infinite;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.25));
}
@keyframes beeOrbit {
  0%   { transform: translate(-50%, 0) rotate(0deg); }
  20%  { transform: translate(6px, -14px) rotate(18deg); }
  40%  { transform: translate(28px, 4px) rotate(-10deg); }
  50%  { transform: translate(34px, -10px) rotate(6deg) scaleX(-1); }
  65%  { transform: translate(14px, -20px) rotate(-14deg) scaleX(-1); }
  80%  { transform: translate(-18px, -6px) rotate(10deg) scaleX(1); }
  100% { transform: translate(-50%, 0) rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) {
  .bee-fly { animation: none; }
}

.eyebrow {
  font-family: var(--font-num);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--orange-1);
  font-weight: 800;
  margin: 0 0 6px;
  text-transform: uppercase;
}

h1 {
  font-family: 'Nanum Brush Script', var(--font-display), cursive;
  font-size: 44px;
  font-weight: 400;
  margin: 0 0 6px;
  color: var(--orange-2);
  letter-spacing: 0.01em;
}

.sub {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 0 28px;
}

#gate-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#gate-nickname,
#gate-password {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--cream);
  font-size: 15px;
  text-align: center;
  letter-spacing: 0.08em;
  outline: none;
  transition: border-color 0.15s ease;
}
#gate-nickname:focus,
#gate-password:focus {
  border-color: var(--orange-2);
}
#gate-nickname::placeholder,
#gate-password::placeholder { color: var(--muted-2); }

.gate-error {
  min-height: 18px;
  font-size: 12.5px;
  color: var(--danger);
  margin: 10px 0 0;
}

/* ---------- 버튼 공통 ---------- */
button {
  font-family: var(--font-kr);
  border: none;
  cursor: pointer;
  border-radius: 14px;
  font-weight: 700;
  transition: transform 0.12s ease, opacity 0.12s ease, filter 0.12s ease;
}
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.5; pointer-events: none; }
button:focus-visible {
  outline: 2px solid var(--orange-1);
  outline-offset: 2px;
}

.btn-primary {
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--orange-2), var(--orange-3));
  color: #ffffff;
  font-size: 15px;
}
.btn-primary:hover { filter: brightness(1.08); }

.btn-secondary {
  padding: 14px 18px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--cream);
  font-size: 15px;
}

.btn-danger {
  padding: 14px 20px;
  background: var(--danger);
  color: #ffffff;
  font-size: 15px;
}

.btn-icon {
  padding: 14px 18px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--cream);
  font-size: 14px;
}

.btn-row { display: flex; gap: 12px; margin-top: 6px; }

/* ---------- 2. 통화 화면 ---------- */
.call-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 20px;
}
.header-pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--orange-1);
  box-shadow: 0 0 8px 2px rgba(255, 193, 7, 0.7);
  animation: dotFadePulse 1.8s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes dotFadePulse {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.05); }
}
@media (prefers-reduced-motion: reduce) {
  .header-pulse-dot { animation: none; opacity: 1; }
}
.header-title {
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--ink-en);
}

.header-role {
  font-family: var(--font-num);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--orange-2);
  border: 1px solid rgba(110, 51, 0, 0.35);
  padding: 3px 9px;
  border-radius: 999px;
  margin-left: auto;
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.state[hidden] {
  display: none;
}

.status-text {
  font-size: 15px;
  color: var(--muted);
  margin: 0;
  letter-spacing: 0.02em;
}

.timer {
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 800;
  color: var(--orange-1);
  margin: -10px 0 0;
  letter-spacing: 0.05em;
}

.call-volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 260px;
  margin: 18px auto 0;
}
.call-volume-icon {
  font-size: 15px;
  flex-shrink: 0;
}
.call-volume-row input[type='range'] {
  flex: 1;
  accent-color: var(--orange-2);
}

/* ---------- 시그니처: 육각 링 파동 (벨/연결 표시) ---------- */
.ring-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ring-static,
.ring-core {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.ring-static {
  animation: logoFlip3D 1s cubic-bezier(0.65, 0, 0.35, 1) both;
}

.ring-core.solid {
  /* box-shadow는 이미지의 사각형 박스 기준으로 빛나기 때문에, 로고가
     원형/육각형이어도 사각형 테두리처럼 보이는 문제가 있었습니다.
     filter:drop-shadow는 이미지의 실제(투명하지 않은) 픽셀 모양을
     따라가므로 이 문제가 생기지 않습니다. */
  filter: drop-shadow(0 0 18px rgba(169, 124, 61, 0.6));
}

.pulsing .ring-core {
  animation: logo-glow 1.6s ease-in-out infinite;
}

@keyframes logo-glow {
  0%, 100% {
    filter: drop-shadow(0 0 0px rgba(169, 124, 61, 0));
  }
  50% {
    filter: drop-shadow(0 0 22px rgba(169, 124, 61, 0.75));
  }
}

@media (prefers-reduced-motion: reduce) {
  .pulsing .ring-core {
    animation: none;
    filter: drop-shadow(0 0 14px rgba(169, 124, 61, 0.5));
  }
}

.ring-pulse {
  position: absolute;
  width: 96px;
  height: 96px;
  clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0% 50%);
  border: 2px solid var(--orange-2);
  opacity: 0;
  animation: hexpulse 2.4s ease-out infinite;
}
.r1 { animation-delay: 0s; }
.r2 { animation-delay: 0.8s; }
.r3 { animation-delay: 1.6s; }

@keyframes hexpulse {
  0% { transform: scale(1); opacity: 0.55; }
  100% { transform: scale(1.9); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ring-pulse { animation: none; opacity: 0.25; }
}

.conn-note {
  position: fixed;
  bottom: 18px;
  left: 0; right: 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--muted-2);
  margin: 0;
  padding: 0 24px;
}

/* ---------- 접속자 목록 / 채팅 패널 ---------- */
.panel-fab {
  position: fixed;
  right: 18px;
  bottom: 24px;
  z-index: 10;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange-2), var(--orange-3));
  color: #ffffff;
  font-size: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 20;
  width: 100%;
  max-width: 720px;
  height: 100%;
  height: 100dvh;
  background: var(--card-bg);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

/* 실제 휴대폰 화면(대부분 480px 이하)에서는 무조건 화면 전체를 꽉 채웁니다 */
@media (max-width: 480px) {
  .side-panel {
    max-width: 100%;
  }
}
.side-panel.open {
  transform: translateX(0);
}

.side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}
.side-panel-header span {
  font-size: 14px;
  font-weight: 800;
  color: var(--cream);
  letter-spacing: 0.03em;
}

.panel-close {
  background: none;
  color: var(--muted);
  font-size: 16px;
  padding: 4px 8px;
}

.people-list {
  list-style: none;
  margin: 0;
  padding: 10px 12px;
  overflow-y: auto;
  flex: 1;
}

.idle-list-label {
  width: 100%;
  max-width: 300px;
  margin: 4px auto 0;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--cream);
  text-align: left;
  padding-left: 2px;
}

.idle-list {
  flex: none;
  width: 100%;
  max-width: 300px;
  max-height: 200px;
  background: var(--surface-soft);
  border: 1px solid rgba(110, 51, 0, 0.35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-radius: 16px;
  padding: 6px 8px;
  margin-top: 4px;
}

.people-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 12px;
  border-radius: 12px;
  color: var(--cream);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.people-item:hover {
  background: var(--bg-soft);
}

.people-name {
  flex: 1;
}

.people-call-btn,
.people-msg-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 24px;
  padding: 0;
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(74, 42, 10, 0.22);
}
.people-msg-btn {
  background: var(--orange-2);
  color: #fff;
}
.people-call-btn {
  background: var(--leaf);
  color: #fff;
}
.people-call-btn .icon-inline,
.people-msg-btn .icon-inline {
  margin-right: 0;
  width: 1em;
  height: 1em;
}
.people-call-btn:hover,
.people-msg-btn:hover {
  filter: brightness(1.08);
  transform: scale(1.04);
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}
.dot-online {
  background: #ff3b30;
  box-shadow: 0 0 6px rgba(255, 59, 48, 0.8);
}
.dot-offline {
  background: var(--muted-2);
}

.people-empty {
  color: var(--muted-2);
  font-size: 13px;
  padding: 14px 12px;
  cursor: default;
}
.people-empty:hover {
  background: none;
}

.chat-area {
  position: absolute;
  inset: 0;
  background: #f5e6c8;
  display: flex;
  flex-direction: column;
}

.chat-area[hidden] {
  display: none;
}

.chat-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--cream);
  font-size: 15px;
  font-weight: 800;
  padding: 10px 16px;
  margin: 14px 14px 6px;
  border-radius: 999px;
  align-self: flex-start;
}
.chat-back:hover {
  background: rgba(169, 124, 61, 0.15);
  border-color: var(--orange-2);
}
.chat-back:active {
  transform: scale(0.96);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-bubble {
  max-width: 78%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.4;
  word-break: break-word;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.12s ease;
}
.chat-bubble:active {
  transform: scale(0.97);
}
.chat-bubble.mine {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--orange-2), var(--orange-3));
  color: #ffffff;
}
.chat-bubble.theirs {
  align-self: flex-start;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--cream);
}

.chat-form {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.chat-form[hidden] {
  display: none;
}

.chat-image-btn {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--orange-1);
  font-size: 16px;
  padding: 0 12px;
  border-radius: 12px;
  flex-shrink: 0; /* 좁은 화면에서도 이 버튼들은 절대 찌그러지지 않게 고정 */
}
.chat-image-btn:hover {
  background: rgba(169, 124, 61, 0.12);
}

.chat-attach-btn {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  width: 40px;
  padding: 0;
}

.chat-bubble-image {
  padding: 4px;
  background: transparent !important;
  border: none !important;
}
.chat-bubble-image img {
  display: block;
  max-width: 100%;
  border-radius: 12px;
}

#chat-input {
  flex: 1;
  min-width: 0; /* ★ 이게 빠져있으면 좁은 화면에서 입력창이 안 줄어들고
                   전송 버튼을 밀어내서 화면 밖으로 잘려나갑니다 */
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--cream);
  font-size: 14px;
  outline: none;
}
#chat-input:focus {
  border-color: var(--orange-2);
}
#chat-input::placeholder {
  color: var(--muted-2);
}

.chat-send {
  padding: 12px 16px;
  background: var(--orange-1);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  border-radius: 12px;
  flex-shrink: 0; /* 절대 안 찌그러지고 항상 보이도록 고정 */
  white-space: nowrap;
}
.chat-send:hover {
  filter: brightness(1.06);
}

/* ---------- "+" 첨부 시트 (앨범 / 카메라 / 음성메시지) ---------- */
.attach-sheet {
  display: flex;
  gap: 10px;
  padding: 14px 14px 6px;
  border-top: 1px solid var(--line);
}

.attach-sheet[hidden] {
  display: none;
}

.attach-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 6px 14px;
  color: var(--cream);
  font-size: 12px;
  font-weight: 700;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.attach-option:hover {
  background: rgba(169, 124, 61, 0.12);
  border-color: var(--orange-2);
}
.attach-option:active {
  transform: scale(0.96);
}

.attach-option-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(201, 161, 101, 0.18), rgba(124, 90, 40, 0.14));
  color: var(--orange-1);
}

.attach-option-icon svg {
  width: 24px;
  height: 24px;
}

/* 아주 좁은 화면(갤럭시 폴드 커버 화면 등)에서도 전송 버튼이 절대
   화면 밖으로 밀려나가지 않도록 여백/크기를 한 번 더 줄여줍니다 */
@media (max-width: 340px) {
  .chat-form {
    gap: 4px;
    padding: 10px 8px;
  }
  .chat-attach-btn {
    width: 34px;
    font-size: 18px;
  }
  #chat-input {
    padding: 10px 10px;
    font-size: 13px;
  }
  .chat-send {
    padding: 10px 12px;
    font-size: 12px;
  }
}

/* ---------- 모바일 ---------- */
@media (max-width: 420px) {
  .card { padding: 32px 22px 26px; }
  .ring-wrap { width: 150px; height: 150px; }
  .ring-static, .ring-core, .ring-pulse { width: 80px; height: 80px; }
}

/* ---------- 선택/롱프레스 네모 박스 방지 (Android 텍스트 선택 충돌 수정) ---------- */
*,
*::before,
*::after {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

input,
textarea {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

.people-del-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--danger);
  color: #fff;
  font-size: 20px;
  padding: 0;
  border-radius: 50%;
  opacity: 0.92;
  box-shadow: 0 3px 8px rgba(74, 42, 10, 0.2);
}
.people-del-btn .icon-inline {
  margin-right: 0;
  width: 1em;
  height: 1em;
}
.people-del-btn:hover {
  filter: brightness(1.08);
  transform: scale(1.04);
  opacity: 1;
}

/* ---------- 로그인 입력창: 자동완성 시 글자가 안 보이는 문제 방지 ---------- */
/* 브라우저 자동완성(자동채움)이 켜지면 배경/글자색을 브라우저가 임의로
   흰 배경+검은 글씨로 바꿔버려서, 어두운 테마에서는 글자가 안 보이게 됩니다. */
#gate-nickname,
#gate-password {
  caret-color: var(--cream);
}
#gate-nickname:-webkit-autofill,
#gate-nickname:-webkit-autofill:hover,
#gate-nickname:-webkit-autofill:focus,
#gate-password:-webkit-autofill,
#gate-password:-webkit-autofill:hover,
#gate-password:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--cream);
  -webkit-box-shadow: 0 0 0px 1000px var(--bg-soft) inset;
  box-shadow: 0 0 0px 1000px var(--bg-soft) inset;
  transition: background-color 9999s ease-in-out 0s;
}
.settings-pill {
  margin-left: 10px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--orange-2);
  border: 1px solid rgba(110, 51, 0, 0.35);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.settings-pill:hover {
  filter: brightness(1.08);
}

/* ---------- '끊고 걸기' 전환 마스크 ---------- */
/* 호스트가 '끊고 걸기'를 누르면, 실제로는 방을 지웠다가 다시 만드는
   과정이 잠깐 있는데, 그 사이 상대방 화면이 "대기 중"으로 깜빡였다가
   다시 "전화가 왔습니다"로 바뀌는 티가 납니다. 그 순간을 이 화면으로
   덮어서, 상대방 입장에서는 계속 "연결 중"으로만 보이게 합니다. */
.call-flip-mask {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
}
.call-flip-mask[hidden] {
  display: none;
}

/* ---------- 데스크탑 접속 안내 (모바일 유도) ---------- */
#desktop-guard {
  display: none;
}

/* PC로 접속한 경우(html.is-desktop-guard)에는 배경/모든 화면을 숨기고
   안내 화면만 보여줍니다 */
html.is-desktop-guard .bg-field,
html.is-desktop-guard .screen,
html.is-desktop-guard .install-banner,
html.is-desktop-guard .msg-toast,
html.is-desktop-guard .settings-panel {
  display: none !important;
}

html.is-desktop-guard #desktop-guard {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 32px 20px;
  overflow-y: auto;
}

.dg-card {
  width: 100%;
  max-width: 400px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 40px 28px 32px;
  text-align: center;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}

.dg-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin-bottom: 18px;
}

.dg-eyebrow {
  font-family: var(--font-num);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--orange-1);
  font-weight: 800;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.dg-title {
  font-size: 23px;
  font-weight: 800;
  color: var(--cream);
  line-height: 1.4;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

.dg-accent {
  background: linear-gradient(135deg, var(--orange-1), var(--orange-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dg-sub {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 24px;
}

.dg-qr-wrap {
  width: 168px;
  height: 168px;
  margin: 0 auto 14px;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(201, 161, 101, 0.16), rgba(124, 90, 40, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
}

#dg-qrcode {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
}

#dg-qrcode img,
#dg-qrcode canvas {
  width: 100% !important;
  height: 100% !important;
}

.dg-url {
  font-family: var(--font-num);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin: 0 0 26px;
  word-break: break-all;
}

.dg-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.dg-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 8px;
  font-size: 11.5px;
  color: var(--cream);
  line-height: 1.4;
}

.dg-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange-2), var(--orange-3));
  color: #ffffff;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- 메시지 시각 + 안읽음 표시 (카톡 스타일) ---------- */
/* 말풍선 자체가 아니라, 말풍선 바로 앞(내 메시지는 왼쪽 옆)에
   시각과 안읽음 표시를 담는 별도 영역을 둡니다 */
.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  width: 100%; /* 폭을 명확히 고정해야 말풍선의 max-width(%)가 정확히 계산됩니다 */
}
.msg-row.mine {
  justify-content: flex-end;
}
.msg-row.theirs {
  justify-content: flex-start;
}

/* 말풍선이 이제 msg-row 안에 있으므로, 기존 .chat-bubble.mine/.theirs의
   align-self(원래는 chat-messages 기준 좌우 정렬용)가 row 안에서는
   세로 정렬을 어긋나게 만들 수 있어 이 부분만 무효화합니다 */
.msg-row .chat-bubble.mine,
.msg-row .chat-bubble.theirs {
  align-self: auto;
}

.msg-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  padding-bottom: 2px;
}

.msg-time {
  font-size: 10px;
  font-family: var(--font-num);
  color: var(--muted-2);
  white-space: nowrap;
}

/* 안읽음 표시 — 오렌지빛 작은 탁구공. 상대가 읽으면 사라집니다 */
.msg-unread-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fdba74, var(--orange-2) 55%, var(--orange-3));
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.msg-unread-dot[hidden] {
  display: none;
}

/* ---------- 메시지 도착 알림 배너 ---------- */
.msg-toast {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70; /* 설치 배너(60)보다 위, 데스크탑 안내(9999)보다는 아래 */
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transform: translateY(-100%);
  transition: transform 0.25s cubic-bezier(0.34, 1.2, 0.4, 1);
}

.msg-toast[hidden] {
  display: none;
}

.msg-toast.show {
  transform: translateY(0);
}

.msg-toast-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.msg-toast-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.msg-toast-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--orange-1);
}

.msg-toast-body {
  font-size: 12.5px;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 음성 메시지 녹음 바 ---------- */
.voice-record-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.voice-record-bar[hidden] {
  display: none;
}

.voice-cancel-btn {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
}

.voice-record-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
  animation: voice-record-pulse 1s ease-in-out infinite;
}

@keyframes voice-record-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.voice-record-hint {
  font-size: 13px;
  color: var(--muted);
  flex-shrink: 0;
}

.voice-record-time {
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 700;
  color: var(--cream);
  flex: 1;
}

.voice-stop-btn {
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--orange-2), var(--orange-3));
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 12px;
  flex-shrink: 0;
}

/* ---------- 음성 메시지 말풍선 ---------- */
.chat-bubble-voice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 130px;
  cursor: default;
}

.voice-play-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  font-size: 13px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-bubble.mine .voice-play-btn {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.chat-bubble.theirs .voice-play-btn {
  background: rgba(169, 124, 61, 0.18);
  color: var(--orange-1);
}

.voice-waveform {
  flex: 1;
  height: 18px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.voice-waveform span {
  display: block;
  width: 2px;
  border-radius: 1px;
  background: currentColor;
  opacity: 0.55;
}

.voice-duration {
  font-family: var(--font-num);
  font-size: 11.5px;
  flex-shrink: 0;
  opacity: 0.85;
}

/* ---------- 사진 크게 보기 (라이트박스) ---------- */
.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(10, 6, 3, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px 12px;
}

.image-viewer[hidden] {
  display: none;
}

.image-viewer img {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 12px;
  object-fit: contain;
}

.image-viewer-hint {
  font-size: 12px;
  color: var(--muted-2);
  margin: 0;
}

/* ---------- 사진 롱프레스 액션 시트 (다운로드/삭제/취소) ---------- */
.image-action-sheet {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(10, 6, 3, 0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 14px 26px;
}

.image-action-sheet[hidden] {
  display: none;
}

.image-action-card {
  width: 100%;
  max-width: 380px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
}

.image-action-btn {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--cream);
  font-size: 14.5px;
  font-weight: 700;
}
.image-action-btn:hover {
  background: rgba(169, 124, 61, 0.12);
}

.image-action-danger {
  color: var(--danger);
}

.image-action-cancel {
  background: none;
  border: none;
  color: var(--muted);
  font-weight: 600;
}

/* ---------- 설정 패널 (왼쪽에서 슬라이드) ---------- */
/* 메시지 목록/채팅 패널(.side-panel)은 오른쪽에서 열리므로, 설정은 반대쪽인
   왼쪽에서 열리도록 해서 두 패널이 서로 다른 종류의 화면이라는 걸 구분해줍니다.
   항목 수가 많아서 중앙 팝업보다 세로로 긴 패널 형태가 더 적합합니다. */
.settings-panel {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 25;
  width: 100%;
  max-width: 720px;
  height: 100%;
  height: 100dvh;
  background: var(--card-bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
}

@media (max-width: 480px) {
  .settings-panel {
    max-width: 100%;
  }
}

.settings-panel.open {
  transform: translateX(0);
}

.settings-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.settings-panel-header span {
  font-size: 14px;
  font-weight: 800;
  color: var(--cream);
  letter-spacing: 0.03em;
}

.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px 28px;
}

.settings-section-title {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  text-transform: uppercase;
  margin: 4px 0 8px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}
.settings-row-tight {
  margin-top: 14px;
}
.settings-row-label {
  font-size: 14px;
  color: var(--cream);
}
.settings-row-value {
  font-size: 13px;
  color: var(--muted);
}

.settings-hint {
  font-size: 11.5px;
  color: var(--muted-2);
  margin: 2px 0 0;
  line-height: 1.5;
}

.settings-divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
}

.settings-action-btn {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--cream);
  font-size: 14px;
  font-weight: 700;
  margin-top: 10px;
}
.settings-action-btn.settings-danger {
  color: var(--danger);
  border-color: rgba(176, 71, 58, 0.35);
}
.settings-action-btn.settings-danger:hover {
  background: rgba(176, 71, 58, 0.12);
}

.settings-toggle {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  position: relative;
  padding: 0;
}
.settings-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--muted-2);
  transition: transform 0.18s ease, background 0.18s ease;
}
.settings-toggle.on {
  background: rgba(169, 124, 61, 0.18);
  border-color: rgba(169, 124, 61, 0.4);
}
.settings-toggle.on .settings-toggle-knob {
  background: linear-gradient(135deg, var(--orange-2), var(--orange-3));
  transform: translateX(20px);
}

.settings-segmented {
  display: flex;
  gap: 6px;
}
.settings-segment {
  flex: 1;
  padding: 10px 4px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}
.settings-segment.active {
  background: linear-gradient(135deg, var(--orange-2), var(--orange-3));
  color: #ffffff;
  border-color: transparent;
}

.settings-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.settings-slider-row input[type='range'] {
  flex: 1;
  accent-color: var(--orange-2);
}

.settings-preview-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(169, 124, 61, 0.15);
  border: 1px solid rgba(169, 124, 61, 0.32);
  color: var(--orange-1);
  font-size: 13px;
  flex-shrink: 0;
}
.settings-preview-btn:hover {
  background: rgba(169, 124, 61, 0.24);
}

/* =========================================================
   JANGSAENG TALK — 브랜드 전용 컴포넌트 (퀵메뉴 / 모달 / 효능탭 / 게이트 분기)
   ※ 위에서 정의한 :root 골드 토큰을 그대로 사용합니다.
   ========================================================= */

/* ---- 게이트: 게스트/대표 2분기 진입 ---- */
.gate-role-select {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gate-role-btn {
  padding: 16px 18px;
  border-radius: 14px;
  font-size: 15px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gate-role-btn .gate-role-label { font-weight: 800; }
.gate-role-btn .gate-role-desc { display: block; font-size: 11.5px; font-weight: 500; opacity: 0.85; margin-top: 2px; }
.gate-role-btn.gate-role-guest {
  background: linear-gradient(135deg, var(--orange-2), var(--orange-3));
  color: #fff;
}
.gate-role-btn.gate-role-staff {
  background: linear-gradient(135deg, var(--orange-2), var(--orange-3));
  border: 1px solid var(--line);
  color: #fff;
}
.gate-staff-form {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.gate-staff-form.open { display: flex; }
.gate-staff-back {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12.5px;
  text-align: left;
  padding: 4px 2px;
  font-weight: 600;
}

/* ---- 대기 화면 퀵메뉴 ---- */
.clinic-quick-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 320px;
  margin: 20px auto 16px;
  position: relative;
  z-index: 5;
}
.quick-btn {
  padding: 13px 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--orange-2), var(--orange-3));
  border: 1px solid rgba(110, 51, 0, 0.35);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(110, 51, 0, 0.2);
}
.quick-btn:hover { filter: brightness(1.08); }
.quick-btn-wide { grid-column: 1 / -1; }

.clinic-brand-circle {
  width: 108px;
  height: 108px;
  clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0% 50%);
  background: var(--card-bg);
  border: 2px solid var(--orange-1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(110, 51, 0, 0.28);
}
.clinic-brand-circle img { width: 62%; height: 62%; object-fit: contain; }

.ring-wrap:has(.brand-intro-wrap) {
  height: auto;
  min-height: 180px;
  padding: 10px 0 4px;
}

/* ---- 브랜드 인트로 애니메이션 ---- */
.brand-intro-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.clinic-brand-circle {
  animation:
    brandSpinIn 1.6s cubic-bezier(0.65, 0, 0.35, 1) both,
    brandRiseUp 0.5s ease 1.6s both,
    brandGoldPulse 2.4s ease-in-out 2.1s infinite;
}
.brand-intro-text {
  font-family: 'Nanum Brush Script', var(--font-display), cursive;
  font-size: 40px;
  color: var(--orange-2);
  margin: 0;
  letter-spacing: 0.02em;
  opacity: 0;
  animation: brandTextIn 0.9s ease 2.0s both;
}

@keyframes brandSpinIn {
  from { transform: perspective(700px) rotateY(0deg) scale(0.9); }
  to   { transform: perspective(700px) rotateY(720deg) scale(1); }
}
@keyframes brandRiseUp {
  from { transform: translateY(0); }
  to   { transform: translateY(-10px); }
}
@keyframes brandGoldPulse {
  0%, 100% {
    transform: translateY(-10px) scale(1);
    filter: drop-shadow(0 0 0px rgba(201, 161, 101, 0));
  }
  50% {
    transform: translateY(-10px) scale(1.07);
    filter: drop-shadow(0 0 16px rgba(201, 161, 101, 0.65));
  }
}
@keyframes brandTextIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .clinic-brand-circle,
  .brand-intro-text {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---- 모달 공통 ---- */
.clinic-modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(36, 28, 18, 0.55);
  display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(2px);
}
.clinic-modal[hidden] { display: none; }
.clinic-modal-content {
  width: 100%; max-width: 480px; max-height: 88vh;
  background: var(--card-bg);
  border-radius: 22px 22px 0 0;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column;
  box-shadow: 0 -20px 50px rgba(60, 40, 10, 0.25);
}
.clinic-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 22px 14px; border-bottom: 1px solid var(--line);
}
.clinic-modal-header h2 {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 600; color: var(--cream); margin: 0;
}
.clinic-modal-close { background: none; border: none; font-size: 20px; color: var(--muted); cursor: pointer; padding: 4px; }
.clinic-modal-body { padding: 18px 22px 30px; overflow-y: auto; }

.clinic-input {
  width: 100%; padding: 13px 14px; margin-bottom: 8px;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--cream);
  font-size: 14px; outline: none; font-family: var(--font-kr);
}
.clinic-input:focus { border-color: var(--orange-2); }
.clinic-input[readonly] { color: var(--muted); opacity: 0.85; }
.clinic-field-label { font-size: 12px; color: var(--muted); margin: 10px 0 4px; font-weight: 700; }

/* ---- 브랜드소개 모달 ---- */
.intro-photo { width: 100%; border-radius: 14px; margin-bottom: 16px; display: block; object-fit: cover; max-height: 200px; }
.intro-eyebrow { font-family: var(--font-num); font-size: 11px; letter-spacing: 0.18em; color: var(--orange-2); font-weight: 800; text-transform: uppercase; margin: 0 0 6px; }
.intro-headline { font-family: var(--font-display); font-size: 24px; font-weight: 500; line-height: 1.3; color: var(--cream); margin: 0 0 12px; }
.intro-body { font-size: 14px; line-height: 1.7; color: var(--muted); margin: 0 0 20px; }
.intro-photo-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 4px; }
.intro-photo-row img { width: 100%; height: 96px; object-fit: cover; border-radius: 12px; }
.intro-dept-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.intro-dept-list li { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 12.5px; font-weight: 700; color: var(--cream); text-align: center; }

/* ---- 프리미엄 차별화 모달 ---- */
.doctor-profile { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.doctor-thumb { width: 84px; height: 108px; background: var(--bg-soft); border-radius: 12px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--line); }
.doctor-info h3 { font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--cream); margin: 0 0 6px; }
.doctor-info p { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0; }
.doctor-history { list-style: none; padding: 0; margin: 6px 0 0; font-size: 12.5px; color: var(--muted-2); line-height: 1.9; }
.doctor-history li { padding-left: 14px; position: relative; }
.doctor-history li::before { content: '·'; position: absolute; left: 0; color: var(--orange-2); font-weight: 800; }
.modal-divider { border: 0; height: 1px; background: var(--line); margin: 18px 0; }

/* ---- 효능안내 모달 (탭 + 카드) ---- */
.procedure-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; }
.procedure-tab { flex-shrink: 0; padding: 9px 14px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); color: var(--muted); font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.procedure-tab.active { background: linear-gradient(135deg, var(--orange-2), var(--orange-3)); color: #fff; border-color: transparent; }
.procedure-panel { display: none; }
.procedure-panel.active { display: block; }
.procedure-point { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; }
.procedure-point-num { font-family: var(--font-num); font-size: 11px; font-weight: 800; color: var(--orange-2); }
.procedure-point-title { font-size: 14.5px; font-weight: 700; color: var(--cream); margin: 4px 0 5px; line-height: 1.4; }
.procedure-point-desc { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 0; }

/* ---- 오시는 길 모달 (구글맵) ---- */
.location-map-frame { width: 100%; height: 220px; border: 0; border-radius: 14px; margin-bottom: 14px; }
.location-info-row { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.location-info-row:last-of-type { border-bottom: none; }
.location-info-icon { flex-shrink: 0; width: 20px; text-align: center; }
.location-info-label { color: var(--muted); font-weight: 700; min-width: 64px; flex-shrink: 0; }
.location-info-value { color: var(--cream); line-height: 1.5; }
.location-directions-btn { display: block; text-align: center; margin-top: 16px; padding: 13px; border-radius: 12px; background: linear-gradient(135deg, var(--orange-2), var(--orange-3)); color: #fff; font-weight: 700; font-size: 14px; text-decoration: none; }

.res-status-msg { font-size: 13px; color: var(--success); margin-top: 10px; text-align: center; font-weight: 600; }

/* ---- 건강지수 테스트 (quiz-modal) ---- */
.progress-container { width: 100%; height: 6px; background: var(--bg-soft); border-radius: 20px; margin-bottom: 24px; overflow: hidden; }
.quiz-progress-bar { width: 0%; height: 100%; background: linear-gradient(135deg, var(--orange-1), var(--orange-2)); box-shadow: 0 0 10px rgba(176,145,79,0.5); transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
.question-text { font-size: 16.5px; font-weight: 700; line-height: 1.5; color: var(--cream); margin: 0 0 20px; }
.options { display: flex; flex-direction: column; gap: 10px; }
.option-btn { background: #fff; border: 1px solid var(--line); padding: 14px; border-radius: 12px; font-size: 14.5px; font-weight: 600; color: var(--cream); text-align: center; cursor: pointer; transition: all 0.15s; }
.option-btn:hover, .option-btn:active { border-color: var(--orange-2); background: var(--bg-soft); color: var(--orange-2); transform: scale(0.98); }
.score-display { font-size: 42px; font-weight: 900; color: var(--orange-2); text-align: center; margin-bottom: 6px; font-family: var(--font-num); }
.result-desc-card { background: var(--bg-soft); border-radius: 14px; padding: 18px; margin: 0 0 18px; line-height: 1.7; color: var(--muted); text-align: left; border-left: 4px solid var(--orange-2); font-size: 13.5px; }

/* ---- 공지사항 마퀴 (대기 화면 상단) ---- */
.notice-marquee {
  width: 100%;
  max-width: 320px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.notice-marquee-track {
  display: flex;
  width: max-content;
  gap: 70px;
  animation: noticeScroll 18s linear infinite;
}
.notice-marquee-track span {
  font-size: 13.5px;
  color: var(--muted);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
@keyframes noticeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .notice-marquee-track { animation: none; }
}

/* ---- 전화상담 / 메세지상담 2탭 ---- */
.contact-tab-row {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}
.contact-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 15px 10px;
  border-radius: 14px;
  font-size: 14.5px;
  font-weight: 700;
}
.contact-tab-icon { width: 18px; height: 18px; display: inline-flex; }
.contact-tab-icon svg { width: 100%; height: 100%; }
.contact-tab-call {
  background: linear-gradient(135deg, var(--orange-2), var(--orange-3));
  color: #fff;
}
.contact-tab-message {
  background: linear-gradient(135deg, var(--orange-2), var(--orange-3));
  border: 1px solid rgba(110, 51, 0, 0.35);
  color: #fff;
}

/* ---- 라인 스타일 인라인 아이콘 공통 ---- */
.icon-inline {
  width: 1.05em;
  height: 1.05em;
  display: inline-block;
  vertical-align: -0.18em;
  margin-right: 3px;
  flex-shrink: 0;
}
