/* ═══════════════════════════════════════════════════════════
   style.css  │  병원 번역 플랫폼  │  모바일 퍼스트
   디자인: 딥 네이비 + 클린 화이트 + 청록 포인트 (의료적 신뢰감)
   폰트: Noto Sans KR (8개 언어 지원) + 디스플레이용 Plus Jakarta Sans
═══════════════════════════════════════════════════════════ */

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

/* ── 변수 ─────────────────────────────────────── */
:root {
  --navy:      #0B1F3A;
  --navy-2:    #122847;
  --teal:      #00A896;
  --teal-dark: #007A6E;
  --teal-pale: #E0F5F3;
  --amber:     #FF8C42;
  --amber-pale:#FFF0E5;
  --white:     #FFFFFF;
  --gray-50:   #F7F9FC;
  --gray-100:  #EDF0F5;
  --gray-200:  #D4DAE4;
  --gray-400:  #8E9BAD;
  --gray-600:  #4A5568;
  --gray-800:  #1A202C;
  --red:       #E53E3E;
  --red-pale:  #FFF0F0;
  --green:     #38A169;

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 1px 4px rgba(11,31,58,.08);
  --shadow:    0 4px 16px rgba(11,31,58,.12);
  --shadow-lg: 0 8px 32px rgba(11,31,58,.18);

  --font-body: 'Noto Sans KR', 'Noto Sans SC', 'Noto Sans JP', sans-serif;
  --font-ui:   'Plus Jakarta Sans', sans-serif;

  --header-h: 64px;
  --bottom-h: 72px;
}

/* ── 리셋 ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ── 헤더 ─────────────────────────────────────── */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--navy);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.header-logo {
  width: 38px; height: 38px;
  background: var(--teal);
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.header-logo svg { width: 22px; height: 22px; color: white; }
.header-title {
  flex: 1;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 16px;
  color: white;
  letter-spacing: -.3px;
}
.header-title span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,.55);
  letter-spacing: .5px;
}
.header-badge {
  background: rgba(0,168,150,.2);
  border: 1px solid rgba(0,168,150,.4);
  color: #4ECDC4;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-ui);
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: .5px;
}

/* ── 메인 콘텐츠 영역 ────────────────────────── */
.app-body {
  padding-top: var(--header-h);
  padding-bottom: calc(var(--bottom-h) + 16px);
  min-height: 100dvh;
}

/* ── 탭 내비 ─────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--bottom-h);
  background: white;
  border-top: 1px solid var(--gray-100);
  display: flex;
  box-shadow: 0 -4px 20px rgba(11,31,58,.08);
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 4px;
  color: var(--gray-400);
  transition: color .2s;
  -webkit-tap-highlight-color: transparent;
}
.nav-btn.active { color: var(--teal); }
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn span { font-size: 10px; font-weight: 500; letter-spacing: .3px; }

/* ── 탭 페이지 ───────────────────────────────── */
.tab-page { display: none; }
.tab-page.active { display: block; }

/* ── 언어 선택 바 ────────────────────────────── */
.lang-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid var(--gray-100);
  position: sticky;
  top: var(--header-h);
  z-index: 50;
}
.lang-select-wrap {
  flex: 1;
  position: relative;
}
.lang-select {
  width: 100%;
  appearance: none;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 10px 32px 10px 12px;
  font-size: 15px;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--gray-800);
  cursor: pointer;
  outline: none;
  transition: border-color .2s;
}
.lang-select:focus { border-color: var(--teal); }
.lang-select-wrap::after {
  content: '▾';
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
  font-size: 12px;
}
.lang-swap-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--teal-pale);
  border: none;
  color: var(--teal);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s, transform .3s;
  -webkit-tap-highlight-color: transparent;
}
.lang-swap-btn:active { transform: rotate(180deg); background: var(--teal); color: white; }
.lang-swap-btn svg { width: 18px; height: 18px; }

/* ── 입력 카드 ───────────────────────────────── */
.translate-card {
  margin: 12px 16px 0;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 0;
}
.card-label-text {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-ui);
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--gray-400);
}
.char-count {
  font-size: 11px;
  color: var(--gray-400);
  font-family: var(--font-ui);
}
.char-count.warn { color: var(--amber); }

textarea.input-area {
  width: 100%;
  min-height: 130px;
  border: none;
  resize: none;
  padding: 10px 14px;
  font-size: 17px;
  line-height: 1.6;
  font-family: var(--font-body);
  color: var(--gray-800);
  outline: none;
  background: transparent;
}
textarea.input-area::placeholder { color: var(--gray-200); }

.input-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 12px;
  border-top: 1px solid var(--gray-100);
}
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--gray-50);
  color: var(--gray-600);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s, color .15s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover, .icon-btn:active { background: var(--gray-100); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.mic-btn { background: var(--teal-pale); color: var(--teal); }
.icon-btn.mic-btn.recording { background: var(--red); color: white; animation: pulse-rec .8s ease-in-out infinite; }
.icon-btn.clear-btn { margin-left: auto; }

.translate-btn {
  flex: 1;
  height: 42px;
  background: var(--teal);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-ui);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  letter-spacing: .3px;
  transition: background .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.translate-btn:active { background: var(--teal-dark); transform: scale(.98); }
.translate-btn svg { width: 17px; height: 17px; }
.translate-btn.loading { background: var(--gray-200); pointer-events: none; }

/* ── 번역 결과 카드 ──────────────────────────── */
.result-card {
  margin: 10px 16px 0;
  background: var(--navy);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 130px;
}
.result-card.empty { background: var(--gray-100); }
.result-lang-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px 0;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-ui);
  letter-spacing: .8px;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
}
.result-card.empty .result-lang-tag { color: var(--gray-400); }
.result-text-wrap {
  padding: 8px 14px;
  min-height: 90px;
  display: flex;
  align-items: flex-start;
}
.result-text {
  font-size: 18px;
  line-height: 1.65;
  color: white;
  font-family: var(--font-body);
  word-break: break-word;
}
.result-card.empty .result-text { color: var(--gray-400); font-size: 15px; padding-top: 8px; }
.result-actions {
  display: flex;
  gap: 8px;
  padding: 8px 12px 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.result-card.empty .result-actions { border-top-color: var(--gray-200); }
.result-icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.7);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.result-icon-btn:active { background: rgba(255,255,255,.2); }
.result-icon-btn svg { width: 17px; height: 17px; }
.result-card.empty .result-icon-btn { background: var(--gray-100); color: var(--gray-400); }
.tts-play-btn {
  flex: 1;
  height: 38px;
  background: rgba(0,168,150,.3);
  border: 1px solid rgba(0,168,150,.4);
  color: #4ECDC4;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.tts-play-btn:active { background: rgba(0,168,150,.5); }
.tts-play-btn.playing { background: rgba(255,140,66,.2); border-color: rgba(255,140,66,.4); color: var(--amber); }
.tts-play-btn svg { width: 16px; height: 16px; }

/* ── 녹음 상태 표시줄 ────────────────────────── */
.recording-bar {
  display: none;
  margin: 8px 16px 0;
  background: var(--red-pale);
  border: 1px solid rgba(229,62,62,.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--red);
  font-weight: 500;
}
.recording-bar.show { display: flex; }
.rec-dot {
  width: 10px; height: 10px;
  background: var(--red);
  border-radius: 50%;
  animation: pulse-rec .8s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse-rec {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(.8); }
}
.rec-wave {
  display: flex;
  gap: 3px;
  align-items: center;
  margin-left: auto;
}
.rec-wave span {
  display: block;
  width: 3px;
  background: var(--red);
  border-radius: 2px;
  animation: wave .6s ease-in-out infinite;
}
.rec-wave span:nth-child(1) { height: 8px;  animation-delay: 0s; }
.rec-wave span:nth-child(2) { height: 16px; animation-delay: .1s; }
.rec-wave span:nth-child(3) { height: 12px; animation-delay: .2s; }
.rec-wave span:nth-child(4) { height: 20px; animation-delay: .15s; }
.rec-wave span:nth-child(5) { height: 8px;  animation-delay: .05s; }
@keyframes wave {
  0%, 100% { transform: scaleY(1); }
  50%       { transform: scaleY(.4); }
}

/* ── 빠른 문구 탭 ────────────────────────────── */
.phrases-page { padding: 12px 16px 0; }
.phrases-lang-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.phrases-lang-info p {
  font-size: 13px;
  color: var(--gray-400);
}
.phrases-lang-select {
  appearance: none;
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 6px 28px 6px 10px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--gray-800);
  font-weight: 500;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%238E9BAD' stroke-linecap='round' stroke-width='2' d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.cat-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  margin-bottom: 12px;
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0;
  padding: 6px 14px;
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-ui);
  color: var(--gray-600);
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.cat-tab.active {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
}

.phrase-list { display: flex; flex-direction: column; gap: 8px; }
.phrase-item {
  background: white;
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .1s, box-shadow .1s;
  -webkit-tap-highlight-color: transparent;
  border: 1.5px solid transparent;
}
.phrase-item:active { transform: scale(.98); box-shadow: none; border-color: var(--teal); }
.phrase-icon { font-size: 22px; flex-shrink: 0; line-height: 1.3; }
.phrase-texts { flex: 1; min-width: 0; }
.phrase-ko {
  font-size: 13px;
  color: var(--gray-400);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phrase-translated {
  font-size: 16px;
  font-weight: 500;
  color: var(--gray-800);
  line-height: 1.4;
}
.phrase-tts-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--teal-pale);
  border: none;
  color: var(--teal);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
  margin-top: 2px;
  -webkit-tap-highlight-color: transparent;
}
.phrase-tts-btn svg { width: 15px; height: 15px; }

.phrases-loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-400);
  font-size: 14px;
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 대화 모드 탭 ────────────────────────────── */
.conv-page { display: flex; flex-direction: column; height: calc(100dvh - var(--header-h) - var(--bottom-h)); }
.conv-lang-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: white;
  border-bottom: 1px solid var(--gray-100);
}
.conv-lang-tag {
  flex: 1;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
  text-align: center;
}
.conv-lang-tag .flag { font-size: 18px; }
.conv-arrow { color: var(--gray-400); }
.conv-arrow svg { width: 16px; height: 16px; }

.conv-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.conv-bubble-wrap { display: flex; flex-direction: column; gap: 3px; }
.conv-bubble-wrap.right { align-items: flex-end; }
.conv-bubble-wrap.left  { align-items: flex-start; }
.conv-bubble-meta {
  font-size: 11px;
  color: var(--gray-400);
  padding: 0 4px;
  font-family: var(--font-ui);
}
.conv-bubble {
  max-width: 80%;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 16px;
  line-height: 1.5;
}
.conv-bubble-wrap.right .conv-bubble { background: var(--teal); color: white; border-bottom-right-radius: 4px; }
.conv-bubble-wrap.left  .conv-bubble { background: white; color: var(--gray-800); border-bottom-left-radius: 4px; box-shadow: var(--shadow-sm); }
.conv-bubble-sub {
  font-size: 13px;
  opacity: .7;
  margin-top: 4px;
  border-top: 1px solid rgba(255,255,255,.2);
  padding-top: 4px;
}
.conv-bubble-wrap.left .conv-bubble-sub { border-top-color: var(--gray-100); }

.conv-input-area {
  background: white;
  border-top: 1px solid var(--gray-100);
  padding: 10px 16px 12px;
}
.conv-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.conv-who-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.conv-who-tab {
  flex: 1;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200);
  background: white;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  font-family: var(--font-ui);
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.conv-who-tab.active { background: var(--navy); border-color: var(--navy); color: white; }
.conv-text-input {
  flex: 1;
  height: 44px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0 14px;
  font-size: 15px;
  font-family: var(--font-body);
  outline: none;
  background: var(--gray-50);
  color: var(--gray-800);
  transition: border-color .2s;
}
.conv-text-input:focus { border-color: var(--teal); background: white; }
.conv-send-btn {
  width: 44px; height: 44px;
  background: var(--teal);
  color: white;
  border: none;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.conv-send-btn:active { background: var(--teal-dark); }
.conv-send-btn svg { width: 18px; height: 18px; }
.conv-mic-btn {
  width: 44px; height: 44px;
  background: var(--teal-pale);
  color: var(--teal);
  border: none;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.conv-mic-btn.recording { background: var(--red); color: white; }
.conv-mic-btn svg { width: 18px; height: 18px; }

/* ── 기록 탭 ─────────────────────────────────── */
.history-page { padding: 12px 16px 0; }
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.history-title {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-ui);
  color: var(--gray-800);
}
.clear-history-btn {
  font-size: 13px;
  color: var(--gray-400);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
}
.history-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}
.history-empty svg { width: 48px; height: 48px; margin: 0 auto 12px; opacity: .3; }
.history-empty p { font-size: 15px; }
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item {
  background: white;
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .1s;
}
.history-item:active { transform: scale(.98); }
.history-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--gray-400);
  font-family: var(--font-ui);
}
.history-lang-badge {
  background: var(--teal-pale);
  color: var(--teal-dark);
  border-radius: 4px;
  padding: 2px 6px;
  font-weight: 600;
}
.history-item-source {
  font-size: 14px;
  color: var(--gray-600);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-item-target {
  font-size: 16px;
  font-weight: 500;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── 토스트 알림 ──────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--bottom-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--gray-800);
  color: white;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-family: var(--font-ui);
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  transition: all .25s ease;
  z-index: 999;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }

/* ── 스켈레톤 로딩 ───────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── API 사용 현황 배지 (옵션) ──────────────── */
.api-status-bar {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  overflow-x: auto;
  scrollbar-width: none;
}
.api-status-bar::-webkit-scrollbar { display: none; }
.api-chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  font-family: var(--font-ui);
  font-weight: 600;
  color: var(--gray-600);
}
.api-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.api-chip .dot.off { background: var(--gray-200); }

/* ── 반응형 (태블릿 이상) ────────────────────── */
@media (min-width: 600px) {
  .app-body { max-width: 480px; margin: 0 auto; }
  .bottom-nav { max-width: 480px; left: 50%; transform: translateX(-50%); }
  .app-header { max-width: 480px; left: 50%; transform: translateX(-50%); }
}

/* ── 다크모드 ─────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --gray-50:  #0F1923;
    --gray-100: #1A2535;
    --gray-200: #2D3E52;
    --gray-400: #5C7080;
    --gray-600: #8FA4B5;
    --gray-800: #E2EAF0;
    --white:    #1A2535;
  }
  body { background: #0B1520; }
  .app-header { background: #060F1A; }
  .bottom-nav { background: #0F1923; border-top-color: #1A2535; }
  .lang-bar, .translate-card, .result-card.empty,
  .conv-lang-bar, .conv-input-area, .phrases-lang-select,
  .phrase-item, .history-item { background: #1A2535; }
  textarea.input-area { color: var(--gray-800); }
  .lang-select { background: #0B1520; color: #E2EAF0; border-color: #2D3E52; }
  .cat-tab { background: #1A2535; border-color: #2D3E52; color: var(--gray-600); }
  .conv-text-input { background: #0B1520; color: #E2EAF0; border-color: #2D3E52; }
  .conv-bubble-wrap.left .conv-bubble { background: #253346; color: #E2EAF0; }
}
