/* ════════════════════════════════════════════════════
   콜메이트 – Dark Card Design
════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700&display=swap');

@font-face {
  font-family: 'Jalnan2';
  src: url('./fonts/Jalnan2TTF.ttf') format('truetype');
  font-weight: normal;
  font-display: swap;
}

:root {
  --bg:         #0c0c14;
  --surface:    #14141f;
  --surface-hi: #1c1c2a;
  --surface-lo: #0a0a12;

  --accent:     #6366f1;
  --accent-glow: rgba(99,102,241,0.35);

  /* 카드 팔레트 */
  --c1: #e85c4a;
  --c2: #6366f1;
  --c3: #0ea5e9;
  --c4: #f59e0b;
  --c5: #10b981;

  --text:       #ffffff;
  --text-muted: #8b8b9e;
  --text-dim:   #44445a;

  --danger:     #ef4444;
  --success:    #10b981;
  --led:        #6366f1;
  --led-amber:  #f59e0b;
  --led-glow:   rgba(99,102,241,0.5);
  --led-off:    #1e1e2a;

  --border:     rgba(255,255,255,0.07);

  --r:    18px;
  --r-sm: 12px;
  --r-lg: 24px;

  --header-h: 56px;
  --nav-h:    68px;

  --mono: 'Jalnan2', 'Noto Sans KR', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }

body {
  font-family: 'Jalnan2', 'Noto Sans KR', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: 'Jalnan2', 'Noto Sans KR', -apple-system, sans-serif;
}

/* ════════════════════════════════════════════════════
   레이아웃
════════════════════════════════════════════════════ */

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* ── 헤더 ── */
#header {
  height: var(--header-h);
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 10;
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.header-logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 22px; }
.logo-text {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--text);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--led-off);
  transition: all 0.3s;
}
.status-dot.connected {
  background: var(--success);
  box-shadow: 0 0 8px rgba(16,185,129,0.6);
}
.status-dot.calling {
  background: var(--led-amber);
  box-shadow: 0 0 8px rgba(245,158,11,0.6);
  animation: led-blink 0.8s infinite;
}

@keyframes led-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ── 메인 콘텐츠 ── */
#main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  padding-bottom: 110px;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
}
#main-content::-webkit-scrollbar { display: none; }

/* 홈탭은 패딩 없이 꽉 채움 */
#main-content.tab-home-active {
  padding: 0 !important;
  overflow: hidden;
}
#tab-home {
  padding: 0 !important;
}
#main-content.tab-home-active #tab-home {
  gap: 0;
  height: 100%;
  overflow: hidden;
}

/* ── 탭 ── */
.tab-section {
  display: none;
  flex-direction: column;
  gap: 14px;
  animation: fadeIn 0.2s ease;
  padding: calc(env(safe-area-inset-top) + 20px) 0 0;
}
.tab-section.active { display: flex; }

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

/* ════════════════════════════════════════════════════
   공통 카드
════════════════════════════════════════════════════ */

.glass-card {
  background: var(--surface-hi);
  border-radius: var(--r);
  padding: 18px;
  border: 1px solid var(--border);
}

.card-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}
.card-icon { font-size: 14px; }

/* ════════════════════════════════════════════════════
   히어로 카드
════════════════════════════════════════════════════ */

.hero-card {
  display: none; /* 새 디자인에서 숨김 */
}

/* ════════════════════════════════════════════════════
   섹션 헤더
════════════════════════════════════════════════════ */

.section-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 0;
}
.section-title {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.btn-text-only {
  background: none; border: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--accent);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  background: rgba(99,102,241,0.12);
  transition: background 0.15s;
}
.btn-text-only:hover { background: rgba(99,102,241,0.2); }

/* ════════════════════════════════════════════════════
   통화 상대 뷰어 (홈) – 상하 분할
════════════════════════════════════════════════════ */

/* 홈탭은 스크롤 없이 꽉 채움 */
#tab-home {
  gap: 0;
  height: 100%;
}

.teacher-viewer {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  touch-action: pan-y;
}

/* 슬라이드 트랙 */
.tv-track {
  display: flex;
  flex: 1;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 각 슬라이드 = 한 명 */
.tv-slide {
  min-width: 100%;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* ── 위: 비주얼 카드 (화면 전체) ── */
.tv-hero {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 70px 24px 0;
}

.tv-hero-bg {
  position: absolute; inset: 0;
  background: var(--card-color, var(--c1));
  opacity: 0.85;
  border-radius: 0 0 28px 28px;
}
.tv-hero-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.45) 100%);
  border-radius: 0 0 28px 28px;
}

.tv-hero-illust {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 0 0 28px 28px;
}
/* 패턴 1: 동심원 */
.tv-hero-illust.illust-phone::before {
  content: '';
  position: absolute;
  right: -40px; bottom: 10px;
  width: 240px; height: 240px;
  border-radius: 50%;
  border: 40px solid rgba(255,255,255,0.06);
}
.tv-hero-illust.illust-phone::after {
  content: '';
  position: absolute;
  right: 20px; bottom: 60px;
  width: 120px; height: 120px;
  border-radius: 50%;
  border: 24px solid rgba(255,255,255,0.08);
}
/* 패턴 2: 별/점 */
.tv-hero-illust.illust-star::before {
  content: '✦  ✦  ✦';
  position: absolute;
  top: 30%; left: 50%;
  transform: translateX(-50%);
  font-size: 28px;
  color: rgba(255,255,255,0.15);
  letter-spacing: 20px;
  white-space: nowrap;
}
.tv-hero-illust.illust-star::after {
  content: '✦  ✦';
  position: absolute;
  top: 55%; left: 50%;
  transform: translateX(-50%);
  font-size: 20px;
  color: rgba(255,255,255,0.10);
  letter-spacing: 28px;
  white-space: nowrap;
}
/* 패턴 3: 큰 원 */
.tv-hero-illust.illust-heart::before {
  content: '';
  position: absolute;
  left: -60px; top: -60px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}
.tv-hero-illust.illust-heart::after {
  content: '';
  position: absolute;
  right: -30px; bottom: 0;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
/* 패턴 4: 사선 스트라이프 */
.tv-hero-illust.illust-clock::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 18px,
    rgba(255,255,255,0.04) 18px,
    rgba(255,255,255,0.04) 20px
  );
}
/* 패턴 5: 물결 */
.tv-hero-illust.illust-wave::before {
  content: '';
  position: absolute;
  left: -20%; top: 20%;
  width: 140%; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.tv-hero-illust.illust-wave::after {
  content: '';
  position: absolute;
  left: -10%; top: 45%;
  width: 120%; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}

.tv-hero-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin-bottom: 12px;
  gap: 8px;
}

.tv-hero-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.tv-name-hero {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  letter-spacing: -0.2px;
  text-align: center;
}

.tv-arrow {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.1s;
  padding-bottom: 2px;
}
.tv-arrow:hover { background: rgba(255,255,255,0.2); }
.tv-arrow:active { transform: scale(0.92); }
.tv-arrow:disabled { opacity: 0.2; cursor: default; }

.tv-status-badge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.tv-status-badge.active {
  background: rgba(16,185,129,0.12);
  border-color: rgba(16,185,129,0.35);
  color: var(--success);
}

.tv-emoji {
  font-size: 96px;
  line-height: 1;
  position: relative;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.4));
  margin: 8px 0 16px;
}

.tv-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

/* ── 아래: 정보 카드 (위 카드 위에 겹침) ── */
.tv-info {
  position: absolute;
  bottom: 110px;
  left: 12px; right: 12px;
  height: auto;
  background: #000;
  border-radius: 28px;
  border: none;
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.6);
  overflow: hidden;
}

.tv-inner-card {
  background: #161620;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tv-inner-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #555570;
}

.tv-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.tv-next {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  letter-spacing: 0.02em;
}

.tv-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tv-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tv-tag {
  font-size: 11px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 20px;
}

.tv-call-btn {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: var(--r-sm);
  background: #22c55e;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  letter-spacing: 0.02em;
  transition: opacity 0.15s, transform 0.1s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.tv-call-btn:active { opacity: 0.85; transform: scale(0.98); }
.tv-call-btn:disabled {
  background: var(--surface-lo);
  color: var(--text-dim);
  cursor: not-allowed;
  box-shadow: none;
}

/* ════════════════════════════════════════════════════
   최근 기록 (홈)
════════════════════════════════════════════════════ */

.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.recent-item:last-child { border-bottom: none; }

.recent-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
  flex-shrink: 0;
}
.recent-date {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  flex-shrink: 0;
  min-width: 72px;
}
.recent-summary {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-empty {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  padding: 10px 0;
}

/* ════════════════════════════════════════════════════
   경고 배너
════════════════════════════════════════════════════ */

.warning-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(239,68,68,0.08) !important;
  border: 1px solid rgba(239,68,68,0.25) !important;
  border-radius: var(--r) !important;
  padding: 14px 16px;
}
.warning-icon { font-size: 20px; flex-shrink: 0; }
.warning-content { flex: 1; min-width: 0; }
.warning-title { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--danger); letter-spacing: 0.06em; text-transform: uppercase; }
.warning-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.btn-warning-action {
  padding: 7px 14px;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--danger);
  cursor: pointer;
  white-space: nowrap;
}

/* ════════════════════════════════════════════════════
   하단 내비게이션
════════════════════════════════════════════════════ */

#bottom-nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100vw - 24px), 456px);
  z-index: 100;
  display: flex;
  align-items: center;
  background: #111118 !important;
  border-radius: 22px;
  padding: 10px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  height: auto;
  flex-shrink: 0;
}

.nav-btn {
  flex: 1;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.nav-btn.active {
  background: #4ED4C2 !important;
  color: #fff !important;
}
.nav-icon { font-size: 22px; }
.nav-label { display: none; }

/* ════════════════════════════════════════════════════
   설정 탭
════════════════════════════════════════════════════ */

/* 설정 섹션 카드 공통 */
.settings-section-card {
  background: var(--surface-hi);
  border-radius: var(--r);
  border: 1px solid var(--border);
  overflow: hidden;
}

.settings-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.settings-section-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.settings-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.settings-section-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.settings-section-body {
  padding: 16px 18px;
}

/* ════════════════════════════════════════════════════
   설정 탭 – 섹션 카드 시스템
════════════════════════════════════════════════════ */

/* 베이스 카드 */
.s-card {
  background: var(--s-color, #6366f1);
  border-radius: 20px;
  padding: 0;
  overflow: hidden;
  border: none;
}

/* 카드 헤더 */
.s-card-header {
  padding: 20px 18px 16px;
  background: transparent;
}
.s-card-icon { display: none; }
.s-card-title {
  font-family: 'Jalnan2', 'Noto Sans KR', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1;
}

/* 카드 컬러 변형 – Tubik 레퍼런스 색상 */
.s-card--indigo { --s-color: #E8503A; } /* 빨강 */
.s-card--blue   { --s-color: #F2C13A; } /* 노랑 */
.s-card--coral  { --s-color: #4ED4C2; } /* 민트 */
.s-card--green  { --s-color: #E8503A; } /* 빨강 */
.s-card--amber  { --s-color: #F2C13A; } /* 노랑 */
.s-card--purple { --s-color: #4ED4C2; } /* 민트 */
.s-card--pink   { --s-color: #E8503A; } /* 빨강 */

/* 카드 바디 */
.s-card > *:not(.s-card-header) {
  padding-left: 18px;
  padding-right: 18px;
}
.s-card.flex-between { padding: 18px; }

/* 컬러 배경 위 텍스트 */
.s-card .setting-label,
.s-card .api-key-desc { color: rgba(0,0,0,0.65); }
.s-card .api-key-desc a { color: rgba(0,0,0,0.85); font-weight: 700; }
.s-card .toggle-title { color: rgba(0,0,0,0.9); }
.s-card .toggle-desc { color: rgba(0,0,0,0.55); }

/* 컬러 배경 위 입력창 */
.s-card .setting-input,
.s-card .setting-select,
.s-card .input-password-wrap input {
  background: rgba(0,0,0,0.15);
  border-color: rgba(0,0,0,0.12);
  color: #fff;
  width: 100%;
  box-sizing: border-box;
}
.s-card .setting-input::placeholder { color: rgba(0,0,0,0.35); }
.s-card .input-password-wrap input::placeholder { color: rgba(255,255,255,0.4); }
.family-input-row .setting-input { color: #fff !important; }
.s-card .setting-select option { background: #1a1a26; color: #fff; }

/* 컬러 배경 위 구분선 */
.s-card .setting-row { border-bottom-color: rgba(0,0,0,0.1); }

/* 버튼 */
.s-card .btn-save-key {
  background: rgba(0,0,0,0.15);
  color: rgba(0,0,0,0.75);
}
.s-card .btn-toggle-visibility { color: rgba(0,0,0,0.5); }

/* 토글 슬라이더 */
.s-card .toggle-slider { background: rgba(0,0,0,0.15); }
.s-card .toggle-slider::before { background: rgba(0,0,0,0.35); }
.s-card .schedule-toggle input:checked + .toggle-slider { background: rgba(0,0,0,0.7); }
.s-card .schedule-toggle input:checked + .toggle-slider::before { background: #fff; }

/* API 키 */
.api-key-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  padding: 14px 18px 10px;
}
.api-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.api-link:hover { text-decoration: underline; }
.api-key-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 0 18px 16px;
}
.input-password-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}
.input-password-wrap input {
  width: 100%;
  padding: 11px 36px 11px 14px;
  background: #1a1a26;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
}
.input-password-wrap input:focus { border-color: var(--accent); }
.btn-toggle-visibility {
  position: absolute; right: 10px;
  background: none; border: none;
  color: var(--text-dim); cursor: pointer;
  font-size: 14px; padding: 2px;
}
.btn-save-key {
  padding: 11px 14px;
  border: none;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.07);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  text-align: center;
}
.btn-save-key:active { background: rgba(255,255,255,0.14); }

.family-row {
  padding: 0 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.family-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(0,0,0,0.55);
}
.family-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.family-input-row .setting-input {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  text-align: left;
}
.family-input-row .btn-save-key {
  min-width: 64px;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* 설정 행 */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.setting-row:last-of-type { border-bottom: none; }
.setting-label {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.setting-input, .setting-select {
  background: #1a1a26;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 13px;
  padding: 9px 12px;
  text-align: right;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
}
.setting-input:focus, .setting-select:focus { border-color: var(--accent); }
.setting-select option { background: #1a1a26; color: var(--text); }

/* ── 통화 상대 네비게이션 바 ── */
/* 설정 히어로 – tv-hero 컴포넌트 재사용 */
#tab-settings {
  padding-top: 0 !important;
}
#settings-hero {
  position: relative;
  width: 100%;
  height: calc(260px + env(safe-area-inset-top));
  overflow: hidden;
  flex-shrink: 0;
}
#settings-hero .tv-hero {
  position: absolute;
  inset: 0;
  padding-top: calc(env(safe-area-inset-top) + 20px);
}

/* 활성화 토글 행 */
.s-enabled-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(0,0,0,0.12);
  border-radius: 14px;
  margin: 0 18px 4px;
}
.s-enabled-label {
  font-size: 15px;
  font-weight: 600;
  color: rgba(0,0,0,0.75);
}
.s-enabled-switch {
  position: relative;
  width: 52px;
  height: 30px;
  flex-shrink: 0;
}
.s-enabled-switch input { display: none; }
.s-enabled-slider {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.2);
  border-radius: 30px;
  transition: background 0.2s;
  cursor: pointer;
}
.s-enabled-slider::before {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.s-enabled-switch input:checked + .s-enabled-slider {
  background: rgba(0,0,0,0.65);
}
.s-enabled-switch input:checked + .s-enabled-slider::before {
  transform: translateX(22px);
}

.s-teacher-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px 16px;
}
.s-teacher-nav-arrow {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.07);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.s-teacher-nav-arrow:disabled { opacity: 0.2; cursor: default; }
.s-teacher-nav-arrow:active { background: rgba(255,255,255,0.15); }
.s-teacher-nav-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.s-teacher-nav-emoji { font-size: 64px; line-height: 1; }
.s-teacher-nav-name {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  text-align: center;
  margin-top: 4px;
}

/* ── 스와이프 에니메이션 ── */
#s-edit-section {
  will-change: transform, opacity;
}

/* 하위 호환: 구 s-teacher-cards 는 숨김 */
.s-teacher-cards { display: none; }

.s-teacher-card {
  flex-shrink: 0;
  width: 110px;
  height: 130px;
  border-radius: 18px;
  border: none;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  transition: transform 0.15s;
  outline: 3px solid transparent;
}
.s-teacher-card.active {
  outline-color: #fff;
  outline-offset: 2px;
}
.s-teacher-card:active { transform: scale(0.96); }
.s-teacher-card-bg {
  position: absolute; inset: 0;
  background: var(--tc, #6366f1);
  opacity: 1;
}
.s-teacher-card-emoji {
  font-size: 40px;
  line-height: 1;
  position: relative;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}
.s-teacher-card-name {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  position: relative;
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.s-teacher-card-status {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 10px;
  position: relative;
  background: rgba(0,0,0,0.3);
  color: rgba(255,255,255,0.5);
}
.s-teacher-card-status.on {
  background: rgba(16,185,129,0.3);
  color: #6ee7b7;
}

/* ── 편집 섹션 래퍼 ── */
.s-edit-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.s-edit-banner {
  font-size: 12px;
  color: var(--text-muted);
  padding: 2px 0 4px;
  letter-spacing: 0.02em;
}
.s-edit-banner:empty { display: none; }

/* ── 서브카드 ── */
.s-sub-card {
  background: #1a1a26;
  border-radius: 14px;
  padding: 14px;
  width: 100%;
  box-sizing: border-box;
}
.s-sub-card--red    { background: transparent; }
.s-sub-card--yellow { background: transparent; }
.s-sub-card--mint   { background: transparent; }

/* 컬러 서브카드 위 콘텐츠 — 배경 제거 후 부모(노랑) 위 다크 텍스트 */
.s-sub-card--red .s-sub-card-label,
.s-sub-card--yellow .s-sub-card-label,
.s-sub-card--mint .s-sub-card-label { color: rgba(0,0,0,0.65); }

.s-sub-card--red .setting-label,
.s-sub-card--yellow .setting-label,
.s-sub-card--mint .setting-label { color: rgba(0,0,0,0.55); }

.s-sub-card--red .setting-row,
.s-sub-card--yellow .setting-row,
.s-sub-card--mint .setting-row { border-bottom-color: rgba(0,0,0,0.1); }

.s-sub-card--red .setting-input,
.s-sub-card--red .setting-select,
.s-sub-card--mint .setting-input,
.s-sub-card--mint .setting-select {
  background: rgba(0,0,0,0.15);
  border-color: rgba(0,0,0,0.1);
  color: #fff;
}
.s-sub-card--yellow .setting-input,
.s-sub-card--yellow .setting-select {
  background: rgba(0,0,0,0.1);
  border-color: rgba(0,0,0,0.1);
  color: #000;
}

/* 토글 (활성화 카드) */
.s-sub-card--red .toggle-title { color: #fff; }
.s-sub-card--red .toggle-desc  { color: rgba(255,255,255,0.6); }
.s-sub-card--red .toggle-slider { background: rgba(0,0,0,0.2); }
.s-sub-card--red .toggle-slider::before { background: rgba(255,255,255,0.5); }
.s-sub-card--red .schedule-toggle input:checked + .toggle-slider { background: #fff; }
.s-sub-card--red .schedule-toggle input:checked + .toggle-slider::before { background: #E8503A; }

/* 체크/스케줄 내부 입력창 */
.s-sub-card--mint .editor-input,
.s-sub-card--red .editor-input { background: rgba(0,0,0,0.15); color: #fff; }
.s-sub-card--mint .editor-emoji-input,
.s-sub-card--red .editor-emoji-input { background: rgba(0,0,0,0.15); }
.s-sub-card--mint .check-editor-row,
.s-sub-card--red .check-editor-row { background: rgba(0,0,0,0.12); }
.s-sub-card--mint .schedule-row,
.s-sub-card--red .schedule-row { background: rgba(0,0,0,0.12); }
.s-sub-card--red .time-input,
.s-sub-card--mint .time-input { background: rgba(0,0,0,0.15); color: #fff; }
.s-sub-card--red .day-btn,
.s-sub-card--mint .day-btn { background: rgba(0,0,0,0.15); color: rgba(255,255,255,0.7); border: none; }
.s-sub-card--red .day-btn.active { background: #fff; color: #E8503A; }
.s-sub-card--mint .day-btn.active { background: #fff; color: #4ED4C2; }
.s-sub-card.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.s-sub-card-label {
  font-family: 'Jalnan2', 'Noto Sans KR', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}
.s-sub-card-label span { font-size: inherit; font-family: inherit; }

.s-sub-card-body {
  background: rgba(255,255,255,0.18);
  border-radius: 12px;
  padding: 4px 12px 8px;
}


/* 서브카드 내 setting-row 패딩 제거 */
.s-sub-card .setting-row {
  padding: 11px 0;
}

/* 프로필 카드 — 라벨 없이 인풋 전체 폭으로 쌓기 */
.s-sub-card-body .setting-input,
.s-sub-card-body .setting-select {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 6px 0;
  text-align: left;
  color: #fff;
}
.s-sub-card-body .setting-input::placeholder { color: rgba(255,255,255,0.45); }

.tool-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 4px 2px;
}
.tool-toggle-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tool-toggle-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}
.tool-toggle-desc {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
}

/* 체크/스케줄 서브카드 내 간격 */
.s-sub-card .check-item-editor { padding: 4px 0 0; }
.s-sub-card .schedule-editor { padding: 4px 0 0; }
.s-sub-card #btn-add-item,
.s-sub-card #btn-add-schedule { margin: 8px 0 0; width: 100%; }

/* 편집 배너 */
.edit-status-banner {
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.2);
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.04em;
}

/* 활성화 토글 */
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.toggle-info { flex: 1; padding-right: 14px; min-width: 0; }
.toggle-title { font-size: 15px; font-weight: 700; color: var(--text); }
.toggle-desc { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 4px; }

.schedule-toggle {
  position: relative;
  display: inline-block;
  width: 52px; height: 30px;
  flex-shrink: 0;
}
.schedule-toggle input { display: none; }
.toggle-slider {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 15px;
  cursor: pointer;
  transition: background 0.25s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  left: 4px; top: 4px;
  background: rgba(255,255,255,0.4);
  border-radius: 50%;
  transition: transform 0.25s, background 0.25s;
}
.schedule-toggle input:checked + .toggle-slider {
  background: rgba(255,255,255,0.9);
}
.schedule-toggle input:checked + .toggle-slider::before {
  transform: translateX(22px);
  background: #111118;
}

/* 체크 항목 에디터 */
.check-item-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 18px 4px;
}
.check-editor-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #1a1a26;
  border-radius: var(--r-sm);
}
.editor-emoji-input {
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.06);
  border: none;
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 20px;
  text-align: center;
  font-family: inherit;
  outline: none;
}
.editor-fields { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.editor-input {
  background: rgba(255,255,255,0.06);
  border: none;
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  padding: 7px 10px;
  width: 100%;
  outline: none;
}
.editor-input:focus { background: rgba(255,255,255,0.10); }
.editor-input::placeholder { color: var(--text-dim); }
.editor-del-btn {
  width: 32px; height: 32px;
  border: none;
  background: rgba(239,68,68,0.15);
  color: var(--danger);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
}
#btn-add-item { margin: 8px 18px 16px; width: calc(100% - 36px); }

/* 스케줄 에디터 */
.schedule-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 0;
}
.schedule-row {
  background: rgba(0,0,0,0.12);
  border-radius: var(--r-sm);
  padding: 14px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.schedule-days {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}
.day-btn {
  flex: 1;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: rgba(255,255,255,0.15);
  color: rgba(0,0,0,0.5);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.day-btn.active {
  background: rgba(0,0,0,0.55);
  color: #fff;
}
.time-input {
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: var(--r-sm);
  color: rgba(0,0,0,0.8);
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  padding: 12px 14px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.time-input:focus { background: rgba(255,255,255,0.3); }
.schedule-del {
  width: 100%;
  padding: 10px;
  border: none;
  background: rgba(239,68,68,0.15);
  color: var(--danger);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  box-sizing: border-box;
}
#btn-add-schedule { margin: 0; width: 100%; }

/* 버튼 */
.btn-primary {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s, transform 0.1s;
  box-shadow: 0 4px 20px rgba(99,102,241,0.35);
}
.btn-primary:active { opacity: 0.85; transform: scale(0.98); }

.btn-secondary {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--accent);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 8px;
  transition: border-color 0.15s, color 0.15s;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger {
  padding: 13px 18px;
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--r-sm);
  background: rgba(239,68,68,0.08);
  color: var(--danger);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.btn-danger:active { background: rgba(239,68,68,0.15); }

.settings-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }

/* ════════════════════════════════════════════════════
   기록 탭
════════════════════════════════════════════════════ */

.history-item {
  background: var(--surface-hi);
  border-radius: var(--r);
  padding: 16px 18px;
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.history-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
}
.history-duration {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
}
.history-summary { font-size: 13px; color: var(--text); line-height: 1.6; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px;
  text-align: center;
  gap: 6px;
  color: var(--text-dim);
}
.empty-icon { font-size: 48px; margin-bottom: 8px; opacity: 0.4; }
.empty-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.btn-toggle-transcript {
  background: none; border: none;
  font-family: var(--mono);
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 6px 0 0;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s;
}
.btn-toggle-transcript:hover { color: var(--accent); }

.history-transcript {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.history-transcript.hidden { display: none; }
.history-transcript-inner { display: flex; flex-direction: column; gap: 10px; }

.hist-msg { display: flex; gap: 8px; align-items: flex-start; }
.hist-msg.user { flex-direction: row-reverse; }
.hist-msg-avatar {
  width: 26px; height: 26px;
  background: var(--surface-lo);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
}
.hist-msg-content { display: flex; flex-direction: column; max-width: 75%; }
.hist-msg.user .hist-msg-content { align-items: flex-end; }
.hist-msg-sender { font-family: var(--mono); font-size: 9px; color: var(--text-dim); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 3px; }
.hist-msg-bubble {
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 12px;
  line-height: 1.5;
  background: var(--surface-lo);
  border: 1px solid var(--border);
  color: var(--text);
}

/* ════════════════════════════════════════════════════
   오버레이 공통
════════════════════════════════════════════════════ */

.overlay {
  position: fixed; inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.overlay.hidden { display: none; }

/* ════════════════════════════════════════════════════
   수신 전화 오버레이
════════════════════════════════════════════════════ */

.incoming-bg {
  position: absolute; inset: 0;
  background: #0c0c18;
}
.incoming-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(99,102,241,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.incoming-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 70px 40px 50px;
}

.incoming-avatar-wrap {
  position: relative;
  width: 120px; height: 120px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 32px;
}

.pulse-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(99,102,241,0.5);
  animation: ring-expand 2.4s infinite;
}
.pr1 { inset: 0;     animation-delay: 0s; }
.pr2 { inset: -18px; animation-delay: 0.7s; }
.pr3 { inset: -36px; animation-delay: 1.4s; }

@keyframes ring-expand {
  0%   { opacity: 0.7; transform: scale(0.9); }
  70%  { opacity: 0;   transform: scale(1.15); }
  100% { opacity: 0;   transform: scale(1.15); }
}

.incoming-avatar {
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(99,102,241,0.1);
  border: 2px solid rgba(99,102,241,0.3);
  box-shadow: 0 0 40px rgba(99,102,241,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 56px;
}

.incoming-name {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.incoming-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 64px;
}

.incoming-actions { display: flex; gap: 60px; margin-bottom: 14px; }

.call-btn {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: none;
  font-size: 28px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.1s;
}
.call-btn:active { transform: scale(0.92); }

.answer-btn {
  background: var(--success);
  box-shadow: 0 6px 24px rgba(16,185,129,0.4);
  animation: btn-breathe 1.2s infinite alternate;
}
@keyframes btn-breathe {
  from { box-shadow: 0 4px 16px rgba(16,185,129,0.35); }
  to   { box-shadow: 0 8px 32px rgba(16,185,129,0.55); }
}

.decline-btn {
  background: var(--danger);
  box-shadow: 0 6px 24px rgba(239,68,68,0.4);
}

.incoming-hint {
  display: flex;
  width: 204px;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ════════════════════════════════════════════════════
   통화 중 오버레이
════════════════════════════════════════════════════ */

.call-bg {
  position: absolute; inset: 0;
  background: #0c0c18;
}
.call-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,0.1) 0%, transparent 60%);
  pointer-events: none;
}

.call-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  height: 100%;
}

.call-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: calc(env(safe-area-inset-top) + 16px) 20px 16px;
  border-bottom: 1px solid var(--border);
}
.call-avatar {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: rgba(99,102,241,0.1);
  border: 2px solid rgba(99,102,241,0.3);
  box-shadow: 0 0 16px rgba(99,102,241,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
}
.call-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.call-timer {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-top: 3px;
}

/* 비주얼라이저 */
.visualizer-wrap {
  padding: 16px 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#visualizer {
  width: 100%;
  height: 80px;
  border-radius: var(--r-sm);
  background: rgba(99,102,241,0.04);
  border: 1px solid rgba(99,102,241,0.1);
}

.ai-speaking-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 20px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  align-self: center;
  margin: 8px 0 0;
  opacity: 0;
  transition: opacity 0.3s;
}
.ai-speaking-badge.visible { opacity: 1; }
.speaking-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
  animation: led-blink 0.6s infinite;
}

/* 볼륨 조절 – 제거됨 */
.volume-control-wrap {
  display: none;
}
.volume-control-wrap-HIDDEN {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 14px;
  margin: 12px 20px 0;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.vol-icon { font-size: 12px; color: var(--text-dim); }
#volume-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.1);
  outline: none;
  cursor: pointer;
}
#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  cursor: pointer;
}

/* 대화 로그 */
.transcript-wrap {
  flex: 1;
  overflow: hidden;
  padding: 16px 16px 100px;
}
.transcript-scroll {
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  padding-bottom: 8px;
}
.transcript-scroll::-webkit-scrollbar { display: none; }
#transcript-log { display: flex; flex-direction: column; gap: 12px; }

.transcript-msg { display: flex; gap: 10px; animation: fadeIn 0.2s ease; align-items: flex-end; }
.transcript-msg.user { flex-direction: row-reverse; }
.msg-bubble {
  max-width: 75%;
  padding: 11px 16px;
  border-radius: 20px;
  font-size: 14px;
  line-height: 1.55;
  color: #fff;
}
.transcript-msg.ai .msg-bubble {
  background: rgba(255,255,255,0.1);
  border-radius: 4px 20px 20px 20px;
}
.transcript-msg.user .msg-bubble {
  background: #4ED4C2;
  border-radius: 20px 20px 4px 20px;
  color: #0a0a14;
}
.msg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.08);
}

/* 통화 컨트롤 – 플로팅 네비 스타일 */
.call-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100vw - 24px), 456px);
  background: #111118;
  border-radius: 22px;
  padding: 10px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.call-nav-btn {
  flex: 1;
  height: 48px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.1s, background 0.15s;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.07);
}
.call-nav-btn:active { transform: scale(0.95); }
.call-nav-btn.mute-btn { }
.call-nav-btn.mute-btn.muted {
  background: rgba(239,68,68,0.2);
  color: #ef4444;
}
.call-nav-btn.end-btn {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 4px 16px rgba(239,68,68,0.4);
}

/* ════════════════════════════════════════════════════
   통화 요약 오버레이
════════════════════════════════════════════════════ */

#overlay-summary {
  background: rgba(0,0,0,0.6);
  padding: 20px;
}
.summary-content {
  width: 100%;
  max-width: 380px;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--surface-hi);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  position: relative;
}
.summary-header { text-align: center; margin-bottom: 20px; }
.summary-emoji { font-size: 44px; margin-bottom: 10px; }
.summary-header h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}
.summary-duration {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
}
.summary-divider { height: 1px; background: var(--border); margin: 16px 0; }
.summary-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.summary-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 20px;
}

/* ════════════════════════════════════════════════════
   토스트
════════════════════════════════════════════════════ */

.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 14px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-hi);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 20px;
  border-radius: var(--r-sm);
  font-size: 13px;
  white-space: normal;
  max-width: calc(100vw - 48px);
  text-align: center;
  z-index: 200;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  animation: toastIn 0.25s ease;
}
.toast.hidden { display: none; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ════════════════════════════════════════════════════
   유틸
════════════════════════════════════════════════════ */
.hidden { display: none !important; }

/* ════════════════════════════════════════════════════
   API Key 설정 모달
════════════════════════════════════════════════════ */

.apikey-modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
}

.apikey-modal {
  position: relative;
  background: var(--surface-hi, #1c1c2a);
  border-radius: 24px;
  padding: 36px 28px 28px;
  width: calc(100% - 48px);
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(40px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.apikey-modal-icon {
  font-size: 48px;
  line-height: 1;
  filter: drop-shadow(0 0 16px rgba(99,102,241,0.5));
}

.apikey-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text, #fff);
  text-align: center;
  margin: 0;
}

.apikey-modal-desc {
  font-size: 13px;
  color: var(--text-muted, #8b8b9e);
  text-align: center;
  line-height: 1.6;
  margin: 0;
}

.apikey-modal-input {
  width: 100%;
}

.apikey-modal-input input {
  width: 100%;
  padding: 14px 44px 14px 16px;
  background: var(--surface-lo, #0a0a12);
  border: 1.5px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 12px;
  color: var(--text, #fff);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.apikey-modal-input input:focus {
  border-color: var(--accent, #6366f1);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.apikey-modal-btn {
  width: 100%;
  margin-top: 4px;
}

.push-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
