:root {
  --bg: #ffffff;
  --bg-soft: #f5f7fa;
  --panel: #ffffff;
  --border: #dde3ec;
  --text: #111111;
  --muted: #66707f;
  --accent: #005eb8;
  --accent-soft: #e6f0fa;
  --accent-dark: #00477a;
  --danger: #d64545;
  --ok: #1a8f5c;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(17, 34, 64, 0.06);
  --shadow-hover: 0 6px 20px rgba(0, 94, 184, 0.14);
}

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

[hidden] { display: none !important; }

body {
  font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  background: var(--bg-soft);
  color: var(--text);
  min-height: 100vh;
}

/* ============ 상단바 + 단계 표시 ============ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 26px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 11px; cursor: pointer; }
.brand:hover h1 { color: var(--accent); }
.brand h1 { font-size: 17px; letter-spacing: 0.2px; color: var(--accent-dark); }
.brand p { font-size: 11.5px; color: var(--muted); }

.steps { display: flex; gap: 6px; list-style: none; }
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  transition: all 0.35s ease;
  white-space: nowrap;
}
.step:not(:last-child)::after {
  content: "›";
  margin-left: 12px;
  color: #c3ccd9;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px; height: 21px;
  border-radius: 50%;
  border: 1.5px solid #c3ccd9;
  font-size: 11.5px;
  font-weight: 700;
  transition: all 0.35s ease;
}
.step.active { color: var(--accent); font-weight: 700; background: var(--accent-soft); }
.step.active .step-num { background: var(--accent); border-color: var(--accent); color: #fff; transform: scale(1.08); }
.step.done { color: var(--ok); }
.step.done .step-num { background: var(--ok); border-color: var(--ok); color: #fff; }

.topbar-right { display: flex; align-items: center; gap: 10px; }
.api-status {
  font-size: 12.5px;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  padding: 6px 12px;
  border-radius: 8px;
}

main { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }

/* 뷰 전환 애니메이션 */
.view { animation: viewIn 0.4s ease; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ============ 공용 ============ */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card h2 { font-size: 17px; margin-bottom: 8px; }
.muted { color: var(--muted); font-size: 13px; }
.badge:empty { display: none; } /* 내용 없는 배지(모델명 미표시)는 렌더링하지 않음 */
.badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #b8d4ee;
  padding: 2px 9px;
  border-radius: 999px;
  vertical-align: middle;
}
.row-end { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.btn {
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 9px 17px;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s ease;
}
.btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}
.btn:active:not(:disabled) { transform: translateY(0); box-shadow: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn.big { padding: 12px 24px; font-size: 15px; }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 600; }
.btn.danger:hover:not(:disabled) { background: #b93333; border-color: #b93333; color: #fff; }

textarea, input[type="text"], input[type="password"] {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14.5px;
  font-family: inherit;
  line-height: 1.7;
  resize: vertical;
  transition: border-color 0.18s, box-shadow 0.18s;
}
textarea:focus, input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 94, 184, 0.12);
}

/* ============ STEP 1: 챗봇 (대화 창만 심플하게) ============ */
.chat-shell { max-width: 720px; margin: 0 auto; }
.chat-window {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  min-height: 460px;
  max-height: 62vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.msg {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  animation: msgIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.msg.bot {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 5px;
}
.msg.user {
  background: var(--accent);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 5px;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* 타이핑 인디케이터 (점 3개) */
.msg.typing { display: flex; gap: 5px; align-items: center; padding: 15px 18px; }
.msg.typing .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.35;
  animation: dotPulse 1.2s infinite;
}
.msg.typing .dot:nth-child(2) { animation-delay: 0.18s; }
.msg.typing .dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes dotPulse { 30% { opacity: 1; transform: translateY(-3px); } }

.chat-input-area { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }

/* 대화 창 안의 선택지 — 오른쪽 정렬, 한 줄에 하나씩 */
.chat-options {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  align-self: flex-end;
  max-width: 88%;
  padding-right: 4px;
}
.chat-option-btn {
  border: 1.5px solid var(--accent);
  background: var(--bg);
  color: var(--accent);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s ease;
  animation: msgIn 0.3s ease backwards;
}
.chat-option-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}
.chat-options .chat-option-btn:nth-child(2) { animation-delay: 0.05s; }
.chat-options .chat-option-btn:nth-child(3) { animation-delay: 0.1s; }
.chat-options .chat-option-btn:nth-child(4) { animation-delay: 0.15s; }
.chat-options .chat-option-btn:nth-child(5) { animation-delay: 0.2s; }
.chat-options .chat-option-btn:nth-child(6) { animation-delay: 0.25s; }
.chat-options .chat-option-btn:nth-child(7) { animation-delay: 0.3s; }
.chat-form { display: flex; gap: 10px; }
.chat-form input { flex: 1; }

/* ============ STEP 2: 프롬프트 확인 ============ */
.prompt-card { max-width: 820px; margin: 0 auto; }
.prompt-card textarea { margin-top: 12px; background: var(--bg-soft); }
.prompt-meta { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* ============ STEP 3-A: 녹취록 ============ */
.drop-zone {
  border: 2px dashed #c3ccd9;
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 10px;
  background: var(--bg);
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.005);
}
.drop-zone p { margin: 4px 0; }
.drop-icon { font-size: 30px; margin-bottom: 6px; transition: transform 0.2s; }
.drop-zone:hover .drop-icon, .drop-zone.dragover .drop-icon { transform: translateY(-4px); }

.file-info {
  margin-top: 12px;
  padding: 11px 14px;
  background: var(--accent-soft);
  border: 1px solid #b8d4ee;
  border-radius: 10px;
  font-size: 14px;
  animation: msgIn 0.25s ease;
}

.progress { display: flex; align-items: center; gap: 12px; margin-top: 16px; color: var(--muted); font-size: 14px; }
.spinner {
  width: 20px; height: 20px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.summary-box {
  background: #f0faf5;
  border: 1px solid #bfe5d2;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.7;
  margin: 12px 0 16px;
}

.segment-header, .segment {
  display: grid;
  grid-template-columns: 110px 1fr 1fr;
  gap: 14px;
  padding: 11px 12px;
  font-size: 14px;
}
.segment-header {
  color: var(--muted);
  font-size: 12.5px;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
}
.segment { border-bottom: 1px solid #eef1f6; line-height: 1.65; transition: background 0.15s; }
.segment:hover { background: var(--accent-soft); }
.segment .time { color: var(--muted); font-size: 12.5px; }
.segment .time .speaker { display: block; color: var(--accent); font-weight: 600; }
.segment .translation { color: var(--accent-dark); }

/* ============ STEP 3-B: 실시간 통역 (가로 방향 자막) ============ */
.live-card { min-height: 66vh; display: flex; flex-direction: column; }

.source-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.source-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.segmented {
  display: inline-flex;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg);
}
.segmented .seg {
  border: none;
  background: transparent;
  padding: 8px 16px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s ease;
}
.segmented .seg:hover { color: var(--accent); }
.segmented .seg.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.mic-select, .tts-sink {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  max-width: 260px;
  cursor: pointer;
  transition: border-color 0.18s;
}
.mic-select:hover, .mic-select:focus, .tts-sink:hover, .tts-sink:focus { border-color: var(--accent); outline: none; }
.tts-sink { max-width: 200px; }
.source-hint { flex-basis: 100%; line-height: 1.6; }
.source-hint strong { color: var(--accent); }

/* ============ 회의 모드 ============ */
.mt-hint { margin-top: 10px; }
.meeting-feed {
  margin-top: 14px;
  min-height: 45vh;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px;
}
/* 화면을 함께 보며 대화하는 용도 — 번역은 크게(위), 원문은 작게(아래) */
.mt-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 18px;
  animation: msgIn 0.25s ease;
}
.mt-line { font-size: 22px; font-weight: 600; line-height: 1.55; color: var(--accent); display: flex; gap: 12px; }
.mt-line.original {
  font-size: 15px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 6px;
}
.mt-line-lang {
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  padding-top: 8px;
  min-width: 52px;
}
.mt-line.original .mt-line-lang { padding-top: 3px; }
.mt-wait { font-size: 13px; color: var(--muted); margin-top: 4px; animation: blink 1.4s infinite; }

/* 대화 창 전체 화면 모드 (⛶ 크게 보기) */
.mt-exit-btn { display: none; }
.mt-feed-wrap:fullscreen,
.mt-feed-wrap.full {
  position: relative;
  background: var(--bg-soft);
  padding: 28px 7vw;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}
.mt-feed-wrap.full { position: fixed; inset: 0; z-index: 300; }
.mt-feed-wrap:fullscreen .mt-exit-btn,
.mt-feed-wrap.full .mt-exit-btn {
  display: block;
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 10;
}
.mt-feed-wrap:fullscreen .meeting-feed,
.mt-feed-wrap.full .meeting-feed {
  flex: 1;
  min-height: 0;
  max-height: none;
  margin-top: 0;
}
.mt-feed-wrap:fullscreen .mt-line,
.mt-feed-wrap.full .mt-line { font-size: 30px; }
.mt-feed-wrap:fullscreen .mt-line.original,
.mt-feed-wrap.full .mt-line.original { font-size: 18px; }
.mt-feed-wrap:fullscreen .mt-line-lang,
.mt-feed-wrap.full .mt-line-lang { padding-top: 12px; min-width: 64px; }
.mt-feed-wrap:fullscreen .mt-current,
.mt-feed-wrap.full .mt-current { font-size: 24px; }
.mt-current {
  margin-top: 10px;
  padding: 12px 16px;
  background: var(--accent-soft);
  border: 1px dashed #b8d4ee;
  border-radius: 10px;
  font-size: 19px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--accent-dark);
}

/* 회의록 카드 (최종 산출물 화면) */
.minutes-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.minutes-box h3 { font-size: 15px; }
.minutes-box pre {
  margin-top: 12px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.8;
  white-space: pre-wrap;
  color: var(--text);
}
.rm-minutes {
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.8;
  white-space: pre-wrap;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.rec-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}
.rec-toggle:hover { color: var(--accent); }
.rec-toggle input { accent-color: var(--accent); cursor: pointer; }

.live-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
  animation: msgIn 0.25s ease;
}
.live-actions .muted { margin-right: auto; }

.live-status.rec::after {
  content: " · ⏺ 녹음 중";
  color: var(--danger);
  animation: blink 1.4s infinite;
}

/* ============ STEP 3-C: 인터뷰 모드 ============ */
.interview-card { min-height: 70vh; }
.interview-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
  margin-top: 16px;
}
.iv-conversation-wrap h3, .iv-panel h3 { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.iv-panel h3 { margin-top: 16px; }
.iv-panel h3:first-child { margin-top: 0; }

.iv-conversation {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 16px 18px;
  height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 전문가(Interviewee) 발화 — 왼쪽 */
.iv-msg { max-width: 88%; animation: msgIn 0.25s ease; }
.iv-msg.expert { align-self: flex-start; }
.iv-msg.expert .bubble {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px 14px 14px 4px;
  padding: 11px 14px;
}
.iv-msg .who { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.iv-msg .orig { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin-bottom: 4px; }
.iv-msg .trans { font-size: 15.5px; line-height: 1.6; font-weight: 500; }
.iv-msg.expert.current .trans { color: var(--accent); }
.iv-msg.expert.current .trans::after { content: "▍"; animation: blink 0.9s infinite; font-weight: 400; }

/* 인터뷰어 발화 — 오른쪽 */
.iv-msg.me { align-self: flex-end; }
.iv-msg.me .bubble {
  background: var(--accent);
  color: #fff;
  border-radius: 14px 14px 4px 14px;
  padding: 11px 14px;
}
.iv-msg.me .who { text-align: right; }
.iv-msg.me .trans { font-size: 14.5px; }
.iv-msg.me .orig { color: rgba(255, 255, 255, 0.75); }
.iv-msg.me .replay {
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 0 0;
}
.iv-msg.me .replay:hover { color: #fff; }

/* 추천 질문 패널 */
.iv-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  padding: 16px;
  height: 480px;
  overflow-y: auto;
}
.iv-suggestions { display: flex; flex-direction: column; gap: 8px; }
.iv-suggest-btn {
  text-align: left;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 13.5px;
  font-family: inherit;
  line-height: 1.55;
  cursor: pointer;
  transition: all 0.18s ease;
  animation: msgIn 0.3s ease backwards;
}
.iv-suggest-btn:nth-child(2) { animation-delay: 0.06s; }
.iv-suggest-btn:nth-child(3) { animation-delay: 0.12s; }
.iv-suggest-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateX(2px);
}
.iv-suggest-btn:disabled { opacity: 0.5; cursor: wait; }
.iv-suggest-btn .num { color: var(--accent); font-weight: 700; margin-right: 6px; }

.iv-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.iv-quick-btn {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}
.iv-quick-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  transform: translateY(-1px);
}
.iv-quick-btn:disabled { opacity: 0.5; cursor: wait; }

/* 빠른 표현 말풍선 (컴팩트) */
.iv-msg.me.quick .bubble { padding: 7px 12px; }
.iv-msg.me.quick .trans { font-size: 13px; }
.iv-msg.me.quick .orig, .iv-msg.me.quick .replay { display: none; }

/* 실시간 추천 (답변 진행 중 갱신) */
.iv-live-box { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.iv-live-tag {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  animation: blink 1.6s infinite;
}
.iv-live-btn {
  width: 100%;
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
}
.iv-live-btn.updated { animation: msgIn 0.25s ease; }

.iv-custom-form { display: flex; gap: 8px; margin-top: 10px; }
.iv-custom-form input { flex: 1; font-size: 13.5px; padding: 9px 12px; }
.iv-custom-form .btn { white-space: nowrap; padding: 9px 13px; font-size: 13px; }

.iv-question-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.iv-question-list li {
  font-size: 13px;
  line-height: 1.55;
  padding: 8px 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  gap: 7px;
}
.iv-question-list li:hover:not(.used) { border-color: var(--accent); background: var(--accent-soft); }
.iv-question-list li .q-num { color: var(--accent); font-weight: 700; }
.iv-question-list li.used { opacity: 0.45; text-decoration: line-through; cursor: default; }
.iv-question-list li.used .q-num::after { content: " ✓"; color: var(--ok); }

.btn-xs { padding: 2px 8px; font-size: 12px; border-radius: 6px; }
.iv-loading { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; padding: 8px 0; }
.iv-loading .spinner { width: 15px; height: 15px; border-width: 2.5px; }

.iv-speaking {
  font-size: 12.5px;
  color: var(--accent);
  animation: blink 1s infinite;
}

@media (max-width: 900px) {
  .interview-grid { grid-template-columns: 1fr; }
  .iv-conversation, .iv-panel { height: 380px; }
}

/* ============ STEP 4: 최종 산출물 ============ */
.term-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.term-chip {
  font-size: 12.5px;
  background: var(--accent-soft);
  border: 1px solid #b8d4ee;
  color: var(--accent-dark);
  padding: 5px 12px;
  border-radius: 999px;
  animation: msgIn 0.3s ease backwards;
}
.term-chip b { color: var(--accent); }

.final-header, .final-row {
  display: grid;
  grid-template-columns: 1fr 1fr 180px;
  gap: 14px;
  padding: 11px 12px;
  font-size: 14px;
}
.final-row { border-bottom: 1px solid #eef1f6; line-height: 1.65; transition: background 0.15s; }
.final-row:hover { background: var(--accent-soft); }
.final-row .src { color: var(--muted); }
.final-row .dst { color: var(--text); font-weight: 500; }
.final-row .note { font-size: 12.5px; color: var(--muted); }
.final-row.revised { border-left: 3px solid var(--accent); background: rgba(0, 94, 184, 0.03); }
.final-row.revised .note { color: var(--accent); }
.final-row.restored { border-left: 3px solid var(--ok); background: rgba(26, 143, 92, 0.04); }
.final-row.restored .note { color: var(--ok); }

@media (max-width: 860px) {
  .final-header { display: none; }
  .final-row { grid-template-columns: 1fr; gap: 4px; }
}
.live-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.lang-chip {
  font-size: 12.5px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid #b8d4ee;
  padding: 5px 12px;
  border-radius: 999px;
}
.cost-chip {
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  cursor: help;
  transition: color 0.2s;
}
.cost-chip.active { color: var(--accent-dark); border-color: #b8d4ee; background: var(--accent-soft); }
.live-status { font-size: 13px; color: var(--muted); transition: color 0.2s; }
.live-status.on { color: var(--ok); font-weight: 600; }
.live-status.on::before { content: "● "; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

/* 번역(위) / 원문(아래) 독립 스크롤 2단 구역 — 한 화면 안에 유지 */
.live-split {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.live-pane h3 { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.pane-scroll {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 14px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pane-out { height: 34vh; }
.pane-in { height: 20vh; }
.captions-placeholder {
  margin: auto;
  color: var(--muted);
  font-size: 14.5px;
  text-align: center;
}

.cap-line {
  padding: 7px 2px;
  border-bottom: 1px dashed #eef1f6;
  line-height: 1.6;
  word-break: keep-all;
  animation: msgIn 0.2s ease;
}
.pane-out .cap-line { font-size: 20px; font-weight: 600; color: var(--text); }
.pane-in .cap-line { font-size: 14px; color: var(--muted); }
.cap-line.current { color: var(--accent); border-bottom: none; }
.pane-out .cap-line.current { color: var(--accent); }
.cap-line.current::after {
  content: "▍";
  color: var(--accent);
  animation: blink 0.9s infinite;
  font-weight: 400;
}

/* ============ 로그인 / 프로젝트 ============ */
.auth-card { max-width: 400px; margin: 8vh auto 0; }
.auth-form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.auth-error {
  color: var(--danger);
  background: rgba(214, 69, 69, 0.07);
  border: 1px solid rgba(214, 69, 69, 0.3);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
}
.auth-switch { text-align: center; margin-top: 14px; }
.auth-switch a { color: var(--accent); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.auth-footer {
  max-width: 400px;
  margin: 18px auto 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}
.auth-footer a { color: var(--accent); font-weight: 600; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }
.user-name { font-size: 13px; color: var(--muted); }
.project-chip {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}
.project-chip:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.project-create { display: flex; gap: 10px; margin: 16px 0 18px; }
.project-create input { flex: 1; }
.project-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.project-card {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.18s ease;
  background: var(--bg);
  animation: msgIn 0.3s ease backwards;
}
.project-card:hover { border-color: var(--accent); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.project-card h3 { font-size: 15px; margin-bottom: 6px; color: var(--accent-dark); }
.project-card .meta { font-size: 12.5px; color: var(--muted); }
.project-card .pc-del {
  float: right;
  border: none; background: none;
  color: #c3ccd9; cursor: pointer; font-size: 14px;
  padding: 0 2px;
}
.project-card .pc-del:hover { color: var(--danger); }
.project-card .pc-edit { font-size: 12px; margin-right: 4px; }
.project-card .pc-edit:hover { color: var(--accent); }
.project-empty {
  grid-column: 1 / -1; /* 그리드 한 칸이 아닌 전체 폭 차지 */
  color: var(--muted);
  font-size: 14px;
  padding: 20px 0;
  text-align: center;
  word-break: keep-all;
}

.ph-subtitle { font-size: 14px; color: var(--muted); margin: 18px 0 10px; }
.record-list { display: flex; flex-direction: column; }
.record-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 8px;
  border-bottom: 1px solid #eef1f6;
  transition: background 0.15s;
}
.record-row:hover { background: var(--accent-soft); }
.record-row .r-icon { font-size: 22px; text-align: center; }
.record-row .r-title {
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
}
.record-row .r-title:hover { color: var(--accent); text-decoration: underline; }
.record-row .r-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.record-row .r-actions { display: flex; gap: 6px; }
.record-row .r-actions .btn { padding: 6px 11px; font-size: 12.5px; }

/* ============ 세션 공유 모달 ============ */
.share-modal { width: min(440px, 92vw); }
.sm-users {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 46vh;
  overflow-y: auto;
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
}
.sm-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.12s;
}
.sm-user:hover { background: var(--accent-soft); }
.sm-user input { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }

/* ============ Community ============ */
.cm-form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.cm-select {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.18s;
}
.cm-select:hover, .cm-select:focus { border-color: var(--accent); outline: none; }
.cm-post {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 14px;
  animation: msgIn 0.25s ease backwards;
}
.cm-post .cm-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cm-post .cm-author { font-weight: 700; font-size: 13.5px; color: var(--accent-dark); }
.cm-post .cm-time { font-size: 12px; color: var(--muted); }
.cm-post .cm-del { margin-left: auto; border: none; background: none; color: #c3ccd9; cursor: pointer; }
.cm-post .cm-del:hover { color: var(--danger); }
.cm-post .cm-content { font-size: 14.5px; line-height: 1.7; white-space: pre-wrap; margin-bottom: 12px; }
.cm-session-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--accent-soft);
  border: 1px solid #b8d4ee;
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.cm-session-chip:hover { background: var(--accent); color: #fff; }
.cm-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.cm-comments { margin-top: 12px; border-top: 1px solid #eef1f6; padding-top: 10px; }
.cm-comment { display: flex; gap: 8px; padding: 7px 2px; font-size: 13.5px; line-height: 1.6; }
.cm-comment .who { font-weight: 700; color: var(--accent-dark); white-space: nowrap; }
.cm-comment .cm-del { margin-left: auto; }
.cm-comment-form { display: flex; gap: 8px; margin-top: 8px; }
.cm-comment-form input { flex: 1; font-size: 13.5px; padding: 8px 12px; }
.cm-empty { text-align: center; color: var(--muted); padding: 30px 0; font-size: 14px; }

/* ============ 기록 뷰어 모달 ============ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(17, 34, 64, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(17, 34, 64, 0.3);
  width: min(860px, 92vw);
  max-height: 84vh;
  overflow-y: auto;
  padding: 24px;
  animation: msgIn 0.2s ease;
}
.modal-head h2 { font-size: 16px; }
.rm-body { margin-top: 14px; }
.rm-body .segment-header { position: sticky; top: -24px; background: var(--bg); }
.rm-line { padding: 9px 4px; border-bottom: 1px solid #eef1f6; font-size: 14px; line-height: 1.65; }
.rm-line .rm-who { font-size: 11.5px; color: var(--accent); font-weight: 700; }
.rm-line .rm-sub { color: var(--muted); font-size: 13px; }

@media (max-width: 860px) {
  .steps { display: none; }
  .segment-header, .segment { grid-template-columns: 80px 1fr; }
  .segment .translation { grid-column: 2; }
  .segment-header span:nth-child(3) { display: none; }
  .pane-out .cap-line { font-size: 17px; }
}
