/* Ministry Voice AI - App Styles */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --success: #16a34a;
  --success-light: #dcfce7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--gray-800);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-header {
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  border-bottom: 1px solid var(--gray-200);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04), 0 1px 2px rgba(0, 0, 0, .02);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
}
.app-header .logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.3px;
}
.app-header .subtitle {
  font-size: 13px;
  color: var(--gray-500);
}
.header-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px;
}
.container.wide { max-width: 960px; }

/* Cards */
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04), 0 1px 2px rgba(0, 0, 0, .03);
  margin-bottom: 16px;
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--gray-900);
  letter-spacing: -0.2px;
}

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--gray-700);
}
.form-group .hint {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}
.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--gray-800);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.form-control.error { border-color: var(--danger); }

select.form-control { cursor: pointer; }

/* Checkbox */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}
.checkbox-group input[type=checkbox] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--primary);
}
.checkbox-group label {
  font-size: 14px;
  color: var(--gray-700);
  cursor: pointer;
  margin-bottom: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, opacity .15s, transform .1s;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover:not(:disabled) { background: var(--primary-light); }
.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border: 1px solid var(--gray-300);
}
.btn-ghost:hover:not(:disabled) { background: var(--gray-100); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; }

/* Talk Button — 세련된 마이크 버튼 (SVG 아이콘 + 리플 애니메이션) */
.talk-btn {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 8px 20px rgba(37, 99, 235, .35),
    0 1px 2px rgba(0, 0, 0, .08),
    inset 0 1px 0 rgba(255, 255, 255, .15);
  transition: transform .18s cubic-bezier(.4, 0, .2, 1),
              box-shadow .18s cubic-bezier(.4, 0, .2, 1),
              background .25s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  outline: none;
  overflow: visible;
}
.talk-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 28px rgba(37, 99, 235, .42),
    0 1px 2px rgba(0, 0, 0, .08),
    inset 0 1px 0 rgba(255, 255, 255, .15);
}
.talk-btn:active { transform: scale(.94); }
.talk-btn:focus-visible {
  outline: 3px solid rgba(59, 130, 246, .35);
  outline-offset: 3px;
}

.talk-btn-icon {
  width: 30px;
  height: 30px;
  position: relative;
  z-index: 2;
  transition: transform .25s cubic-bezier(.4, 0, .2, 1);
}
.talk-btn:active .talk-btn-icon { transform: scale(.9); }

/* 리플 (recording 상태일 때만 표시) */
.talk-btn-ripple {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(239, 68, 68, .55);
  opacity: 0;
  pointer-events: none;
}

/* 녹음 중 상태 — 빨강 그라디언트 + 리플 애니메이션 */
.talk-btn.recording {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  box-shadow:
    0 8px 22px rgba(220, 38, 38, .45),
    0 1px 2px rgba(0, 0, 0, .08),
    inset 0 1px 0 rgba(255, 255, 255, .15);
  animation: talk-pulse 1.6s ease-in-out infinite;
}
.talk-btn.recording .talk-btn-icon {
  animation: mic-bounce 1.6s ease-in-out infinite;
}
.talk-btn.recording .talk-btn-ripple {
  animation: talk-ripple 1.6s ease-out infinite;
}
.talk-btn.recording .talk-btn-ripple:nth-child(2) {
  animation-delay: .8s;
}

@keyframes talk-pulse {
  0%, 100% { box-shadow: 0 8px 22px rgba(220, 38, 38, .45), 0 1px 2px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.15); }
  50%      { box-shadow: 0 10px 30px rgba(220, 38, 38, .7),  0 1px 2px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.15); }
}
@keyframes talk-ripple {
  0%   { transform: scale(1);    opacity: .9; }
  100% { transform: scale(1.85); opacity: 0; }
}
@keyframes mic-bounce {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}

/* Alerts */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.alert-error { background: var(--danger-light); color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: var(--success-light); color: #166534; border: 1px solid #86efac; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fcd34d; }
.alert-info { background: var(--primary-light); color: #1e40af; border: 1px solid #93c5fd; }
.alert .close-btn { margin-left: auto; background: none; border: none; cursor: pointer; opacity: .6; }

/* Participant List */
.participant-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.participant-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #ffffff, #fafbfc);
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  transition: border-color .15s, box-shadow .15s;
}
.participant-item:hover {
  border-color: var(--gray-300);
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.participant-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.participant-avatar.speaking {
  background: var(--danger-light);
  color: var(--danger);
  animation: pulse-avatar 1s infinite;
}
@keyframes pulse-avatar {
  0%, 100% { opacity: 1; }
  50% { opacity: .7; }
}
.participant-info { flex: 1; min-width: 0; }
.participant-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.participant-langs { font-size: 12px; color: var(--gray-500); }
.participant-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 500;
}
.participant-badge.speaking {
  background: var(--danger-light);
  color: var(--danger);
}
.participant-actions { display: flex; gap: 4px; }

/* Subtitle Panel */
.subtitle-panel {
  height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
  border-radius: 10px;
  scroll-behavior: smooth;
}
.subtitle-item {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.5;
  border: 1px solid transparent;
  animation: subtitle-fade-in .25s ease-out;
}
@keyframes subtitle-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.subtitle-item .speaker-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  margin-bottom: 4px;
  letter-spacing: .2px;
}
.subtitle-item .original {
  font-size: 12px;
  color: var(--gray-500);
  font-style: italic;
  margin-bottom: 4px;
}
.subtitle-item .translated {
  color: #f9fafb;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.1px;
}
.subtitle-item.my-speech {
  background: linear-gradient(135deg, rgba(59,130,246,.22), rgba(37,99,235,.18));
  border-color: rgba(96, 165, 250, .25);
}
.subtitle-item.other-speech {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.06);
}
.subtitle-item .time { font-size: 10px; color: var(--gray-500); margin-top: 4px; opacity: .8; }


/* Room Info Bar */
.room-info-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--primary-light);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.room-code {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 2px;
  font-family: monospace;
}
.room-code-label { font-size: 12px; color: var(--gray-500); }
.copy-btn {
  background: none;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
.copy-btn:active { background: var(--primary-light); }

/* Status Dots */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.online { background: var(--success); }
.status-dot.offline { background: var(--gray-400); }
.status-dot.speaking { background: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Tab Bar */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 16px;
  overflow-x: auto;
}
.tab-item {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  margin-bottom: -1px;
}
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Loading */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.loading-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--gray-400);
  font-size: 13px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* Responsive (index/history) */
@media (max-width: 480px) {
  .container { padding: 16px 12px; }
  .card { padding: 16px; }
  .btn { padding: 10px 14px; }
  /* iOS: 16px 미만이면 입력 시 화면 자동 확대 방지 */
  .form-control { font-size: 16px; }
}

/* ═══════════════════════════════════════════════════════════
   ROOM PAGE — 모바일 우선 레이아웃
   ═══════════════════════════════════════════════════════════ */

/* 룸 헤더 */
.room-header {
  padding: 10px 12px;
}
.room-header .logo { font-size: 16px; }
.room-code-badge {
  font-family: monospace;
  font-size: 13px;
  letter-spacing: 1px;
}

/* 배지 추가 색상 */
.badge-warning { background: var(--warning-light); color: var(--warning); }

/* 모바일 탭 바 */
.mob-tabs {
  display: none;
  background: #fff;
  border-bottom: 2px solid var(--gray-200);
  flex-shrink: 0;
}
.mob-tab {
  flex: 1;
  padding: 12px 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-500);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .15s;
}
.mob-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* 룸 알림 */
.room-alerts { padding: 0; }

/* 데스크탑 룸코드 바 숨김/표시 제어 */
.room-info-bar-desktop { margin: 0; }

/* 모바일 룸코드 카드 (참여자 탭 최상단) */
.mob-room-info-card {
  display: none;
  background: var(--primary-light);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.mob-room-code-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 자막 카드 */
.subtitle-card {
  padding: 0;
  overflow: hidden;
  margin-bottom: 0;
}
.subtitle-card-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
}
.subtitle-card-title { font-size: 14px; font-weight: 600; }
.show-original-label {
  margin-left: auto;
  font-size: 12px;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.subtitle-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px;
  text-align: center;
  color: var(--gray-500);
  font-size: 14px;
  line-height: 1.6;
}

/* 발화 바 — 데스크탑: 인라인 카드 */
.talk-bar {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-top: 16px;
}
.talk-bar-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.speaking-indicator {
  font-size: 13px;
  color: var(--gray-500);
  min-height: 18px;
  text-align: center;
  width: 100%;
}
.lang-selects {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}
.lang-select-group {
  display: flex;
  align-items: center;
  gap: 4px;
}
.lang-select-group label {
  font-size: 12px;
  color: var(--gray-500);
  white-space: nowrap;
}
.lang-select {
  padding: 6px 8px !important;
  font-size: 14px !important;
  width: auto !important;
  min-width: 90px;
}
.lang-arrow { color: var(--gray-400); font-size: 14px; }
.talk-hint {
  font-size: 12px;
  color: var(--gray-400);
  text-align: center;
  margin-top: 4px;
}

/* 상태 그리드 */
.status-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  font-size: 13px;
  align-items: center;
}

/* ── 데스크탑 레이아웃 (768px 이상) ───────────────────── */
@media (min-width: 768px) {
  body.room-page .room-scroll-area {
    padding: 0 16px 24px;
  }
  .mob-tabs { display: none !important; }
  .mob-room-info-card { display: none !important; }
  .room-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    grid-template-rows: auto auto;
    gap: 16px;
    margin-top: 16px;
  }
  .room-main-panel {
    grid-area: 1 / 1 / 2 / 2;
  }
  .talk-bar {
    grid-area: 2 / 1 / 3 / 2;
    margin-top: 0;
  }
  .room-sidebar-panel {
    grid-area: 1 / 2 / 3 / 3;
  }
  .subtitle-panel { height: 340px; }
}

/* ── 모바일 레이아웃 (767px 이하) ─────────────────────── */
@media (max-width: 767px) {
  /* 전체 높이 앱 레이아웃 */
  body.room-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  body.room-page .app-header { flex-shrink: 0; }
  .mob-tabs {
    display: flex;
    flex-shrink: 0;
  }

  /* 알림은 절대위치로 상단 고정 (overflow hidden 영역 위) */
  .room-alerts {
    position: fixed;
    top: 100px;
    left: 0;
    right: 0;
    z-index: 200;
    padding: 0 12px;
    pointer-events: none;
  }
  .room-alerts .alert { pointer-events: auto; }

  /* 스크롤 영역 */
  .room-scroll-area {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 150px; /* talk-bar 높이만큼 여백 */
  }

  /* 데스크탑 룸코드 바 숨김 */
  .room-info-bar-desktop { display: none; }

  /* 모바일 룸코드 카드 (참여자 탭에서 표시) */
  .mob-room-info-card { display: block; }

  /* 그리드 → 단일 열 */
  .room-layout {
    display: block;
    padding: 0;
  }

  /* 자막 패널 — 화면 가득 채우기 */
  .room-main-panel {
    display: block;
  }
  .subtitle-card {
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    margin-bottom: 0;
  }
  .subtitle-panel {
    height: calc(100vh - 108px - 148px);
    height: calc(100dvh - 108px - 148px);
  }

  /* 사이드 패널 — 기본 숨김, 탭 전환 시 표시 */
  .room-sidebar-panel {
    display: none;
    padding: 12px;
  }
  .room-sidebar-panel.mob-visible {
    display: block;
  }

  /* 주 패널 탭 숨김 */
  .room-main-panel.mob-hidden {
    display: none;
  }

  /* 발화 바 — 하단 고정, 컴팩트 모바일 레이아웃 */
  .talk-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-radius: 22px 22px 0 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
    box-shadow: 0 -10px 28px rgba(0, 0, 0, .1),
                0 -1px 0 rgba(0, 0, 0, .04);
    padding: 10px 14px 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    margin-top: 0;
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
  }
  .talk-bar-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
  }
  .speaking-indicator {
    font-size: 12px;
    min-height: 16px;
    color: var(--gray-600);
    font-weight: 500;
    text-align: center;
    padding-bottom: 4px;
  }
  /* 언어 셀렉트 컨테이너 — 한 줄에 두 select + 적용 버튼 */
  .lang-selects {
    flex: 1;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    width: auto;
    flex-wrap: nowrap;
  }
  .lang-select-group {
    flex: 1;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    min-width: 0;
  }
  .lang-select-group label {
    font-size: 10px;
    color: var(--gray-400);
    font-weight: 600;
    letter-spacing: .3px;
    text-transform: uppercase;
    flex-shrink: 0;
  }
  .lang-select {
    flex: 1;
    width: auto !important;
    min-width: 0 !important;
    font-size: 13px !important;
    padding: 7px 8px !important;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    background: #fff;
  }
  .lang-arrow { display: none; }
  #btn-apply-lang {
    flex-shrink: 0;
    font-size: 12px;
    padding: 6px 10px;
  }

  /* 마이크 버튼 — 모바일에서도 충분히 큼 */
  .talk-btn {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
  }
  .talk-btn-icon { width: 24px; height: 24px; }
  .talk-hint { display: none; }

  /* 입력폼 줌 방지 */
  .form-control, select { font-size: 16px; }
}

/* 이전 대화 / 실시간 구분선 */
.history-divider {
  text-align: center;
  font-size: 11px;
  color: var(--gray-400);
  padding: 6px 0;
  margin: 4px 0;
  position: relative;
}
.history-divider::before,
.history-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: var(--gray-200);
}
.history-divider::before { left: 0; }
.history-divider::after  { right: 0; }
.history-divider-live {
  color: var(--primary);
  font-weight: 600;
}
.history-divider-live::before,
.history-divider-live::after {
  background: var(--primary-light);
}

/* 캐시 초기화 버튼 */
.cache-clear-btn {
  font-size: 12px;
  color: var(--gray-400);
  opacity: 0.7;
}
.cache-clear-btn:hover { opacity: 1; }

/* safe-area (노치 아이폰 등) */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .talk-bar {
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
}

/* 로고 반응형 */
.logo-short { display: none; }
@media (max-width: 480px) {
  .logo-full { display: none; }
  .logo-short { display: inline; }
}

/* Utility */
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--gray-500); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }

/* History */
.session-item {
  padding: 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  margin-bottom: 8px;
}
.session-item:hover { border-color: var(--primary); background: var(--primary-light); }
.session-item .room-code-text { font-family: monospace; font-weight: 600; font-size: 15px; }
.session-item .session-meta { font-size: 13px; color: var(--gray-500); margin-top: 4px; }

.transcript-item {
  padding: 10px 12px;
  border-left: 3px solid var(--gray-200);
  margin-bottom: 10px;
}
.transcript-item .speaker { font-size: 12px; font-weight: 600; color: var(--gray-500); }
.transcript-item .original-text { font-size: 15px; color: var(--gray-800); margin: 4px 0; }
.transcript-item .translation-list { font-size: 13px; color: var(--gray-600); }
.transcript-item .translation-list span { display: block; }

/* OTP Input */
.otp-input {
  letter-spacing: 8px;
  font-size: 24px;
  font-family: monospace;
  text-align: center;
  width: 160px;
}
