/* ═══ Reset & Root ═══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:          #ffffff;
  --surface:     #ffffff;
  --surface2:    #f7f8fa;
  --surface3:    #eff0f3;
  --border:      #e8e9ec;
  --border2:     #d4d6db;
  --text-1:      #1a1d23;
  --text-2:      #6b7280;
  --text-3:      #adb5bd;
  --accent:      #1a73e8;      /* 구글 블루 */
  --accent-dim:  rgba(26,115,232,0.08);
  --accent-glow: rgba(26,115,232,0.22);
  --purple:      #7c3aed;
  --purple-dim:  rgba(124,58,237,0.08);
  --amber:       #f59e0b;
  --amber-dim:   rgba(245,158,11,0.10);
  --red:         #ef4444;
  --red-dim:     rgba(239,68,68,0.08);
  --green:       #16a34a;
  --green-dim:   rgba(22,163,74,0.08);
  --sp-a:        #1a73e8;
  --sp-b:        #db2777;
  --sp-c:        #059669;
  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   14px;
  --app-w:       420px;
  --app-h:       780px;
}

body {
  background: #e8eaed;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: 'Pretendard', sans-serif;
  overflow: hidden;
}

/* ── 앱 셸 ── */
.app-shell {
  width: var(--app-w);
  height: var(--app-h);
  background: var(--bg);
  border-radius: 28px;
  border: 1px solid var(--border2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 1px 3px rgba(0,0,0,0.08),
    0 8px 32px rgba(0,0,0,0.10),
    0 0 0 1px rgba(0,0,0,0.05);
}

/* ── 상단 헤더 ── */
.app-header {
  padding: 20px 20px 0;
  flex-shrink: 0;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.app-logo {
  font-family: 'Syne', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.3px;
}

.app-logo span {
  color: var(--accent);
}

.app-logo .logo-accent {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.api-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.api-indicator:hover { border-color: var(--border2); color: var(--text-2); }

.api-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 6px var(--amber);
}

.api-dot.ok { background: var(--accent); box-shadow: 0 0 6px var(--accent-glow); }

/* ── 스크롤 영역 ── */
.app-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface3) transparent;
}

.app-body::-webkit-scrollbar { width: 3px; }
.app-body::-webkit-scrollbar-track { background: transparent; }
.app-body::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }

/* ── 카드 기본 ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.card-label {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
}

/* ══ 녹음 컨트롤 카드 ══ */
.rec-card {
  border-color: var(--border2);
}

.rec-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 파형 */
.waveform {
  display: flex;
  align-items: center;
  gap: 2.5px;
  height: 32px;
  flex: 1;
}

.wbar {
  width: 3px;
  border-radius: 2px;
  background: var(--border2);
  height: 4px;
  transition: background 0.3s;
}

.is-recording .wbar {
  background: #16a34a;
  animation: wave 0.9s ease-in-out infinite;
}

.rec-card.is-recording {
  border-color: rgba(22,163,74,0.30);
  box-shadow: 0 0 0 3px rgba(22,163,74,0.06) inset;
}

@keyframes wave {
  0%,100% { height: 4px; }
  50%      { height: 24px; }
}

.wbar:nth-child(1)  { animation-delay: 0.00s; }
.wbar:nth-child(2)  { animation-delay: 0.07s; }
.wbar:nth-child(3)  { animation-delay: 0.14s; }
.wbar:nth-child(4)  { animation-delay: 0.21s; }
.wbar:nth-child(5)  { animation-delay: 0.10s; }
.wbar:nth-child(6)  { animation-delay: 0.18s; }
.wbar:nth-child(7)  { animation-delay: 0.05s; }
.wbar:nth-child(8)  { animation-delay: 0.24s; }
.wbar:nth-child(9)  { animation-delay: 0.12s; }
.wbar:nth-child(10) { animation-delay: 0.19s; }
.wbar:nth-child(11) { animation-delay: 0.08s; }
.wbar:nth-child(12) { animation-delay: 0.16s; }

/* 타이머 */
.rec-timer {
  font-family: 'DM Mono', monospace;
  font-size: 22px;
  font-weight: 500;
  color: var(--text-1);
  letter-spacing: 0.04em;
  min-width: 72px;
  text-align: right;
}

.rec-controls {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text-2);
  font-family: 'Pretendard', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s;
}

.btn:hover { background: var(--surface3); color: var(--text-1); border-color: var(--border2); }

.btn-primary {
  background: #1a73e8;
  color: #ffffff;
  border-color: #1a73e8;
}

.btn-primary:hover {
  background: #1557b0;
  color: #ffffff;
  border-color: #1557b0;
  box-shadow: 0 2px 8px rgba(26,115,232,0.30);
}

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(248,113,113,0.2);
}

.btn-danger:hover { background: rgba(248,113,113,0.18); }

/* 상태 배지 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 500;
}

.badge-rec  { background: rgba(239,68,68,0.08);   color: #dc2626; border: 1px solid rgba(239,68,68,0.20); }
.badge-ai   { background: rgba(124,58,237,0.08);  color: #7c3aed; border: 1px solid rgba(124,58,237,0.18); }
.badge-ok   { background: rgba(22,163,74,0.08);   color: #15803d; border: 1px solid rgba(22,163,74,0.20); }
.badge-wait { background: var(--surface2);        color: var(--text-3); border: 1px solid var(--border); }

.badge-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: blink 1.2s ease-in-out infinite;
}

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ══ 메트릭 행 ══ */
.metrics-row {
  display: grid;
  gap: 8px;
}

.metric-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-label {
  font-size: 11px;
  color: var(--text-3);
}

.metric-value {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
}

.metric-value.accent { color: var(--accent); }
.metric-value.purple { color: var(--purple); }

/* ══ STT 스트림 카드 ══ */
.stt-stream {
  max-height: 130px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: none;
}

.stt-stream::-webkit-scrollbar { display: none; }

.stt-line {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-2);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.stt-line.latest {
  color: var(--text-1);
  background: var(--surface2);
}

.stt-line.correction {
  color: var(--purple);
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  padding-left: 10px;
  border-left: 2px solid rgba(167,139,250,0.3);
}

/* ══ 다자 회의 채팅창 ══ */
.chat-window {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
  max-height: 260px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.chat-window::-webkit-scrollbar { width: 3px; }
.chat-window::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* 웹 확대 뷰에서는 높이 더 넉넉하게 */
@media (min-width: 600px) {
  .chat-window { max-height: 340px; }
}

.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

/* 짝수 화자는 오른쪽 정렬 */
.chat-row.right {
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  flex-shrink: 0;
  margin-bottom: 18px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.chat-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 76%;
}

.chat-row.right .chat-body {
  align-items: flex-end;
}

.chat-name {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  padding: 0 4px;
}

.chat-bubble {
  padding: 9px 13px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-1);
  background: var(--surface2);
  border: 1px solid var(--border);
  word-break: keep-all;
  position: relative;
}

/* 왼쪽 화자: 흰 배경 + 진한 테두리 */
.chat-row.left .chat-bubble {
  border-top-left-radius: 4px;
  background: #ffffff;
  border-color: var(--border2);
}

/* 오른쪽 화자: 진한 파란 배경 + 흰 텍스트 */
.chat-row.right .chat-bubble {
  border-top-right-radius: 4px;
  background: #1a73e8;
  border-color: #1557b0;
  color: #ffffff;
}

.chat-ts {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  color: var(--text-3);
  padding: 0 4px;
}

.chat-correction {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--purple);
  background: rgba(124,58,237,0.08);
  border: 1px solid rgba(124,58,237,0.18);
  border-radius: 6px;
  padding: 3px 7px;
  margin-top: 3px;
}

/* 오른쪽(파란) 버블 내 보정 배지는 흰색 계열로 */
.chat-row.right .chat-correction {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.25);
}

/* 화자 레전드 바 */
.speaker-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 0 2px;
}
.sp-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--text-2);
}
.sp-legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}

/* ══ 요약 카드 ══ */
.summary-block {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-2);
}

.summary-ts {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  color: var(--text-3);
  margin-bottom: 6px;
}

.summary-speaker-tag {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  margin-bottom: 4px;
}

/* ══ 잠금 오버레이 ══ */
.locked-overlay {
  background: var(--surface);
  border: 1px dashed var(--border2);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.locked-overlay svg { opacity: 0.3; }

/* ══ 파이프라인 뷰 ══ */
.pipe-section {
  margin-bottom: 4px;
}

.pipe-section-title {
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 8px;
  padding-left: 2px;
}

.pipe-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.pipe-step:last-child { border-bottom: none; }

.pipe-num {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  flex-shrink: 0;
  margin-top: 1px;
}

.pipe-num.n-input  { background: var(--red-dim);    color: var(--red); }
.pipe-num.n-ai     { background: var(--purple-dim); color: var(--purple); }
.pipe-num.n-proc   { background: var(--amber-dim);  color: var(--amber); }
.pipe-num.n-out    { background: var(--accent-dim); color: var(--accent); }

.pipe-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 2px;
}

.pipe-desc {
  font-size: 11px;
  color: var(--text-3);
  font-family: 'DM Mono', monospace;
  line-height: 1.5;
}

.pipe-connector {
  width: 1px;
  height: 12px;
  background: var(--border2);
  margin-left: 10px;
}

/* ══ API Key 입력 패널 ══ */
.api-panel {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px;
  border-radius: 28px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.api-panel.visible { opacity: 1; pointer-events: all; }

.api-panel-title {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
}

.api-input-wrap {
  width: 100%;
}

.api-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-1);
  outline: none;
  transition: border-color 0.2s;
}

.api-input::placeholder { color: var(--text-3); }
.api-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

.api-hint {
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
  line-height: 1.6;
}

/* ══ 하단 탭바 ══ */
.app-footer {
  flex-shrink: 0;
  padding: 0 16px 16px;
}

.footer-tabs {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4px;
  gap: 2px;
}

.footer-tab {
  padding: 9px 4px;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  flex: 1;
  color: var(--text-3);
  font-family: 'Pretendard', sans-serif;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.footer-tab.active {
  background: var(--surface3);
  color: var(--text-1);
  border: 1px solid var(--border2);
}

.footer-tab svg { width: 16px; height: 16px; }

/* ══ 탭 패널 ══ */
.panel { display: none; flex-direction: column; gap: 10px; }
.panel.active { display: flex; }

/* ══ 화자 요약 구간 선택 ══ */
.segment-select {
  display: flex;
  gap: 4px;
}

.seg-btn {
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-3);
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.seg-btn.active {
  background: var(--purple-dim);
  color: var(--purple);
  border-color: rgba(167,139,250,0.3);
}

/* ══ 원문 모달 ══ */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(220,222,226,0.80);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }

.modal-sheet {
  margin-top: auto;
  background: var(--surface);
  border-top: 1px solid var(--border2);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  max-height: 76%;
  overflow: hidden;
}

.modal-handle {
  width: 36px; height: 4px;
  background: var(--border2);
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 0;
  flex-shrink: 0;
}

.modal-title {
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
}

.modal-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text-2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: all 0.15s;
}
.modal-close:hover { background: var(--surface3); color: var(--text-1); }

.modal-tabs {
  display: flex;
  gap: 0;
  padding: 10px 16px 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-tab {
  padding: 7px 14px;
  font-family: 'Pretendard', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
}
.modal-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface3) transparent;
}
.modal-body::-webkit-scrollbar { width: 3px; }
.modal-body::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }

.modal-tab-content { display: none; }
.modal-tab-content.active { display: block; }

.raw-line {
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-2);
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.raw-line:last-child { border-bottom: none; }
.raw-line .ts {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  color: var(--text-3);
  margin-right: 8px;
}
.raw-line .orig { color: var(--red); text-decoration: line-through; font-size: 11px; }
.raw-line .corr { color: var(--accent); font-size: 11px; }

/* ══ 히스토리 패널 ══ */
.hist-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-3);
  font-size: 13px;
}
.hist-empty svg { opacity: 0.25; margin-bottom: 10px; }

.hist-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 8px;
}
.hist-item:hover { border-color: var(--border2); background: var(--surface2); }
.hist-item:last-child { margin-bottom: 0; }

.hist-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.hist-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
}

.hist-meta {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  color: var(--text-3);
  margin-bottom: 6px;
}

.hist-preview {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hist-del {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  transition: all 0.15s;
}
.hist-del:hover { background: var(--red-dim); color: var(--red); border-color: rgba(248,113,113,0.3); }

/* ══ 슬라이드 카드 ══ */
.slide-item {
  min-width: 100%;
  padding: 0 1px;
  flex-shrink: 0;
}

.slide-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--border2);
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  padding: 0;
  flex-shrink: 0;
}

.slide-dot.active {
  background: var(--accent);
  width: 14px;
  border-radius: 3px;
  box-shadow: 0 0 6px var(--accent-glow);
}

/* ══ 최종 요약 상단 고정 배너 ══ */
#finalPinnedBanner {
  display: none;
  background: var(--accent-dim);
  border: 1px solid rgba(74,222,128,0.25);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  order: -1;
}

/* ══ STT / AI 좌우 2컬럼 ══ */
.stt-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-height: 180px;
}

.stt-split-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.stt-split-label {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px 6px;
  border-bottom: 1px solid var(--border);
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--text-3);
  flex-shrink: 0;
}

.stt-col-badge {
  font-size: 8px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}

.stt-col-badge-raw {
  background: var(--surface3);
  color: var(--text-2);
  border: 1px solid var(--border2);
}

.stt-col-badge-ai {
  background: var(--purple-dim);
  color: var(--purple);
  border: 1px solid rgba(124,58,237,0.18);
}

.stt-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
  font-size: 12px;
  line-height: 1.6;
}

.stt-col-body::-webkit-scrollbar { width: 2px; }
.stt-col-body::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.stt-col-empty {
  color: var(--text-3);
  font-style: italic;
  font-size: 11px;
  text-align: center;
  padding: 16px 0;
}

/* STT 원문 행 */
.stt-raw-line {
  color: var(--text-2);
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.6;
}
.stt-raw-line:last-child { border-bottom: none; }
.stt-raw-line.interim { color: var(--text-3); font-style: italic; }

/* AI 보정 행 */
.stt-ai-line {
  color: var(--text-1);
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.6;
}
.stt-ai-line:last-child { border-bottom: none; }
.stt-ai-line.changed { color: var(--accent); }
.stt-ai-line.pending { color: var(--text-3); font-style: italic; font-size: 11px; }

/* ══ Interim STT (미확정, 회색) ══ */
.stt-interim {
  color: var(--text-3) !important;
  font-style: italic;
}

.chat-interim {
  color: var(--text-3) !important;
  font-style: italic;
  background: var(--surface3) !important;
  border-color: var(--border) !important;
}

/* ══ STT 2줄 블록 (원문 / AI보정) ══ */
.stt-block {
  border-bottom: 1px solid var(--border);
  padding: 6px 0;
}
.stt-block:last-child { border-bottom: none; }
.stt-block.latest { background: rgba(26,115,232,0.03); border-radius: var(--radius-sm); }

.stt-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 20px;
}

.stt-row-label {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.06em;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
  padding: 1px 4px;
  border-radius: 3px;
  color: var(--text-3);
  background: var(--surface3);
  border: 1px solid var(--border);
}

.stt-row-label.ai {
  color: var(--purple);
  background: var(--purple-dim);
  border-color: rgba(124,58,237,0.18);
}

.stt-row-raw .stt-row-text {
  font-size: 12px;
  color: var(--text-3);      /* 원문은 흐리게 */
  line-height: 1.6;
  flex: 1;
}

.stt-row-ai .stt-row-text {
  font-size: 13px;
  color: var(--text-1);      /* AI 보정은 진하게 */
  line-height: 1.6;
  flex: 1;
}

/* 보정 변경이 있을 때 AI줄 강조 */
.stt-row-ai.changed .stt-row-text {
  color: var(--accent);
}

/* 처리 중 점멸 */
.stt-ai-pending {
  color: var(--text-3) !important;
  font-size: 11px !important;
  animation: blink 1s ease-in-out infinite;
}

/* ══ 타이핑 커서 ══ */
.stt-row-text:not(.done):not(.stt-ai-pending)::after,
.chat-bubble:not(.done):empty::after {
  content: '▋';
  display: inline-block;
  color: var(--accent);
  animation: blink 0.8s step-end infinite;
  font-size: 11px;
  margin-left: 1px;
  vertical-align: middle;
}
.stt-row-text.done::after,
.chat-bubble.done::after { display: none; }


/* 모바일 전체화면 */
@media (max-width: 440px) {
  :root { --app-w: 100vw; --app-h: 100dvh; }
  .app-shell { border-radius: 0; border: none; }
  body { background: var(--bg); }
  .chat-bubble { font-size: 14px; }
}

/* 웹 확대 뷰 — 앱셸 넓히고 채팅창 높이 확보 */
@media (min-width: 600px) {
  :root { --app-w: 560px; --app-h: 820px; }
  .chat-window { max-height: 380px; }
  .chat-bubble { font-size: 13px; }
  .chat-body   { max-width: 68%; }
}

@media (min-width: 900px) {
  :root { --app-w: 640px; --app-h: 860px; }
  .chat-window { max-height: 420px; }
}

/* ══ 요약 전체화면 모달 ══ */
.summary-modal {
  position: absolute;
  inset: 0;
  background: var(--surface);
  z-index: 250;
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.summary-modal.open {
  transform: translateY(0);
}

.summary-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.summary-modal-title {
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-1);
}

.summary-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.summary-modal-close:hover { background: var(--surface3); color: var(--text-1); }

.summary-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-1);
  white-space: pre-line;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.summary-modal-body::-webkit-scrollbar { width: 3px; }
.summary-modal-body::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* 화자별 행 (다자 모달) */
.summary-modal-speaker {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.summary-modal-speaker:last-child { border-bottom: none; }
.summary-modal-sp-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  flex-shrink: 0;
  width: 56px;
  padding-top: 2px;
}

/* 클릭 힌트 */
.summary-clickable { cursor: pointer; }
.summary-expand-hint {
  font-size: 10px;
  color: var(--text-3);
  text-align: right;
  margin-top: 6px;
  font-family: 'DM Mono', monospace;
}

/* ══ 토스트 알림 ══ */
#appToast {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--text-1);
  color: var(--surface);
  font-size: 12px;
  font-family: 'Pretendard', sans-serif;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 20px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 300;
  pointer-events: none;
}

#appToast.toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.summary-modal-edit-btn {
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text-2);
  font-size: 11px;
  font-family: 'Pretendard', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}
.summary-modal-edit-btn:hover { background: var(--surface3); color: var(--text-1); }
.summary-modal-edit-btn.editing {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.summary-edit-textarea {
  width: 100%;
  min-height: 320px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: 'Pretendard', sans-serif;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-1);
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
.summary-edit-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

.summary-edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  justify-content: flex-end;
}

/* ══ Diff 뷰 ══ */
.diff-body {
  font-size: 13px;
  line-height: 1.9;
  white-space: pre-line;
  color: var(--text-1);
}

.diff-add {
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 3px;
  padding: 0 2px;
}

.diff-del {
  color: var(--red);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  background: var(--red-dim);
  border-radius: 3px;
  padding: 0 2px;
  opacity: 0.75;
}