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

:root {
  --accent: #2C5EAD;
  --accent-hover: #234a8a;
  --accent-btn: #2C5EAD;
  --accent-btn-hover: #234a8a;
}

body.dark {
  --accent: #a4cbfc;
  --accent-hover: #7ec0ed;
  --accent-btn: #2172db;
  --accent-btn-hover: #1a5fb8;
}

body {
  font-family: 'IBM Plex Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f8f9fa;
  color: #232f3e;
  min-height: 100vh;
  display: flex;
}

/* --- Sidebar --- */
.sidebar {
  width: 250px; min-width: 250px; height: 100vh;
  background: #232f3e; color: #d5dbdb;
  display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; z-index: 10;
  overflow: hidden; transition: width 0.2s, min-width 0.2s;
}
.sidebar.collapsed { width: 48px !important; min-width: 48px !important; }
.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .sidebar-nav,
.sidebar.collapsed .sidebar-bottom { display: none; }

/* Sub Panel (slides out from sidebar) */
.sub-panel {
  position: fixed; top: 0; bottom: 0; width: 390px;
  left: var(--sidebar-width, 220px);
  background: #fff; border-right: 1px solid #e9ecef;
  z-index: 200; overflow-y: auto;
  transition: left 0.2s;
  box-shadow: 4px 0 12px rgba(0,0,0,0.08);
}
.sidebar.collapsed ~ .sub-panel { left: 48px; }
.sub-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; height: 62px; border-bottom: 1px solid #e9ecef;
  font-weight: 600; font-size: 0.95rem; box-sizing: border-box;
}
.sub-panel-body { padding: 16px; }

.sidebar-brand {
  padding: 0 12px; height: 62px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid #37475a; font-size: 1rem; font-weight: 700;
  color: #fff; letter-spacing: -0.02em; white-space: nowrap; box-sizing: border-box;
}
.sidebar-toggle {
  background: none; border: none; color: #d5dbdb; font-size: 1.1rem;
  cursor: pointer; padding: 4px; border-radius: 4px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; width: 24px; height: 24px;
}
.sidebar-toggle:hover { background: #37475a; }
.sidebar-nav { padding: 12px 0; flex: 1; overflow-y: auto; }
.sidebar-resize {
  position: absolute; right: 0; top: 0; width: 4px; height: 100%;
  cursor: ew-resize; background: transparent; z-index: 11;
}
.sidebar-resize:hover, .sidebar-resize.active { background: var(--accent); }
.sidebar-section {
  padding: 8px 20px 4px; font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: #879596; margin-top: 8px;
}
.sidebar-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 20px;
  font-size: 0.85rem; color: #d5dbdb; cursor: pointer;
  transition: background 0.12s; border-left: 3px solid transparent;
}
.sidebar-item:hover { background: #37475a; }
.sidebar-item.active { background: #37475a; border-left-color: var(--accent); color: #fff; }
.sidebar-item .si-icon { width: 18px; text-align: center; font-size: 0.95rem; }
.sidebar-item .si-meta { font-size: 0.7rem; color: #879596; margin-top: 1px; }
.sidebar-item .si-delete {
  margin-left: auto; background: none; border: none; color: #879596;
  cursor: pointer; font-size: 0.75rem; padding: 2px 5px; border-radius: 3px;
  opacity: 0; transition: opacity 0.15s;
}
.sidebar-item:hover .si-delete { opacity: 1; }
.sidebar-item .si-delete:hover { color: #ff6b6b; background: rgba(255,107,107,0.1); }

/* Toggle switch items in sidebar */
.sidebar-toggle-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 20px; font-size: 0.85rem; color: #d5dbdb;
  transition: background 0.12s;
}
.sidebar-toggle-item:hover { background: #37475a; }
.sidebar-toggle-item:active { background: #4a5d73; }
.toggle-switch {
  position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #555; border-radius: 22px; transition: 0.25s;
}
.toggle-slider::before {
  content: ''; position: absolute; height: 16px; width: 16px;
  left: 3px; bottom: 3px; background: #fff; border-radius: 50%;
  transition: 0.25s;
}
.toggle-switch input:checked + .toggle-slider { background: #4dabf7; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* --- Main Content --- */
.main {
  margin-left: 250px; flex: 1; display: flex; flex-direction: column;
  min-height: 100vh; transition: margin-left 0.2s;
}
.main.expanded { margin-left: 48px; }

.sticky-header { position: sticky; top: 0; z-index: 5; background: #fff; }
body.dark .sticky-header { background: #1a2332; }

.topbar {
  background: #fff; border-bottom: 1px solid #e9ecef; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  height: 62px; box-sizing: border-box;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }

.mobile-menu-btn {
  display: none;
  background: none; border: none; color: #232f3e;
  font-size: 1.2rem; cursor: pointer; padding: 4px 6px;
  border-radius: 4px; align-items: center; justify-content: center;
}
.mobile-menu-btn:hover { background: #f1f3f5; }
.topbar-left select {
  padding: 7px 12px; border-radius: 6px; border: 1px solid #d5dbdb;
  background: #fff; font-size: 0.85rem; color: #232f3e; outline: none;
}
.topbar-left select:focus { border-color: var(--accent); }
.topbar-left select:disabled { background: #e9ecef; color: #adb5bd; cursor: not-allowed; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.audio-controls {
  display: none;
  align-items: center;
  gap: 6px;
}

.timer-badge {
  font-variant-numeric: tabular-nums; font-size: 0.85rem; color: #687078;
  background: #f1f3f5; padding: 5px 12px; border-radius: 6px; cursor: pointer;
  user-select: none; position: relative;
}
.status-pill { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: #687078; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #adb5bd; }
.status-dot.active { background: #40c057; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.btn {
  padding: 8px 18px; border: none; border-radius: 6px;
  font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--accent-btn); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-btn-hover); }
.btn-danger { background: #d13212; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b02a0c; }
.btn-secondary { background: #232f3e; color: #fff; }
.btn-secondary:hover:not(:disabled) { background: #37475a; }
.btn-success { background: #2f9e44; color: #fff; }
.btn-success:hover:not(:disabled) { background: #268c38; }

.content { flex: 1; padding: 16px 20px; overflow: hidden; }

/* Panels */
.panels { display: grid; grid-template-columns: 1fr; gap: 20px; margin-bottom: 24px; }
.panels.transcript-only #translationPanel { display: none; }

/* Main Layout: left transcript + right side panel */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 6px 1fr;
  gap: 0;
  height: calc(80vh - 60px);
}
.main-left {
  display: flex; flex-direction: column; overflow: hidden; min-width: 0;
}
.main-left .panel {
  flex: 1; max-height: none; min-height: 0;
}
.main-right {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid #e9ecef; border-radius: 10px;
  overflow: hidden; min-width: 0;
}

/* Horizontal resize handle (between left and right) */
.layout-resize-h {
  width: 6px; cursor: col-resize; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.layout-resize-h::after {
  content: ''; width: 3px; height: 40px; background: #d5dbdb;
  border-radius: 2px; transition: background 0.15s;
}
.layout-resize-h:hover::after { background: var(--accent); }

/* Side Tabs */
.side-tabs {
  display: flex; border-bottom: 1px solid #e9ecef;
  background: #fafbfc; border-radius: 10px 10px 0 0;
  flex-shrink: 0;
}
.side-tab {
  flex: 1; padding: 10px 8px; border: none; background: none;
  font-size: 0.78rem; font-weight: 600; color: #687078;
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.side-tab:hover { color: #232f3e; background: #f1f3f5; }
.side-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.side-tab.drag-over { border-bottom: 2px solid var(--accent); }
.side-tab[draggable] { cursor: grab; }
.side-tab[draggable]:active { cursor: grabbing; }
.side-tab-content { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.side-tab-body { flex: 1; overflow-y: auto; padding: 12px; }

.panel {
  background: #fff; border: 1px solid #e9ecef; border-radius: 10px;
  min-height: 200px; overflow-y: auto;
  display: flex; flex-direction: column;
}
.panel-header {
  padding: 12px 16px; border-bottom: 1px solid #e9ecef; font-size: 0.8rem;
  font-weight: 600; color: #687078; text-transform: none;
  letter-spacing: 0.04em; background: #fafbfc; border-radius: 10px 10px 0 0;
  position: sticky; top: 0;
}
.panel-body { padding: 0; flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.panel-history { flex: 1; overflow-y: auto; padding: 8px 0; min-height: 0; }
.panel-live {
  border-top: 2px solid #37475a; padding: 6px 0;
  background: #eef1f4; overflow-y: auto;
  min-height: 120px; max-height: 300px; flex-shrink: 0;
}
.panel-history { position: relative; }

.font-size-controls { float: right; display: inline-flex; gap: 2px; margin-right: 8px; }
.font-size-controls button {
  background: none; border: 1px solid #d5dbdb; border-radius: 3px;
  color: #687078; cursor: pointer; font-size: 0.75rem; padding: 1px 6px; line-height: 1.4;
}
.font-size-controls button:hover { background: #e9ecef; color: #232f3e; }

.transcript-line {
  padding: 10px 14px; font-size: inherit; line-height: 1.6; cursor: pointer;
  transition: all 0.12s; color: #232f3e;
  user-select: none; -webkit-user-select: none;
  background: #f1f3f5; border-radius: 12px; margin: 4px 12px 0 12px;
  max-width: 85%; width: fit-content; border-left: none;
}
.transcript-line:not(.ch-spk):hover { background: #e9ecef; }
.transcript-line.ch-mic { background: #f1f3f5; margin-left: auto; margin-right: 12px; border-radius: 12px 12px 4px 12px; }
.transcript-line.ch-sys { background: #dae8f5; margin-right: auto; margin-left: 12px; border-radius: 12px 12px 12px 4px; }
.transcript-line.ch-mic:hover { background: #e9ecef; }
.transcript-line.ch-sys:hover { background: #c4d9f0; }
.speaker-icon { margin-right: 6px; font-size: 0.85em; user-select: none; display: inline-flex; align-items: center; vertical-align: middle; }

/* Speaker diarization colors */
.transcript-line.ch-spk { border-left: none; }
.transcript-line.spk_0 { background: linear-gradient(135deg, rgba(44,94,173,0.10), rgba(99,102,241,0.10)); }
.transcript-line.spk_1 { background: linear-gradient(135deg, rgba(16,185,129,0.10), rgba(52,211,153,0.10)); }
.transcript-line.spk_2 { background: linear-gradient(135deg, rgba(245,158,11,0.10), rgba(251,191,36,0.10)); }
.transcript-line.spk_3 { background: linear-gradient(135deg, rgba(239,68,68,0.08), rgba(248,113,113,0.08)); }
.transcript-line.spk_4 { background: linear-gradient(135deg, rgba(168,85,247,0.08), rgba(192,132,252,0.08)); }
.transcript-line.spk_5 { background: linear-gradient(135deg, rgba(236,72,153,0.08), rgba(244,114,182,0.08)); }
.transcript-line.spk_6 { background: linear-gradient(135deg, rgba(20,184,166,0.10), rgba(94,234,212,0.10)); }
.transcript-line.spk_7 { background: linear-gradient(135deg, rgba(79,70,229,0.08), rgba(129,140,248,0.08)); }
.transcript-line.spk_8 { background: linear-gradient(135deg, rgba(132,204,22,0.10), rgba(163,230,53,0.10)); }
.transcript-line.spk_9 { background: linear-gradient(135deg, rgba(251,146,60,0.10), rgba(253,186,116,0.10)); }
.translation-line.ch-spk { border-left: none; }
body.dark .transcript-line.spk_0 { background: linear-gradient(135deg, rgba(74,143,230,0.12), rgba(139,92,246,0.10)); }
body.dark .transcript-line.spk_1 { background: linear-gradient(135deg, rgba(52,211,153,0.12), rgba(16,185,129,0.10)); }
body.dark .transcript-line.spk_2 { background: linear-gradient(135deg, rgba(251,191,36,0.10), rgba(245,158,11,0.10)); }
body.dark .transcript-line.spk_3 { background: linear-gradient(135deg, rgba(248,113,113,0.10), rgba(239,68,68,0.10)); }
body.dark .transcript-line.spk_4 { background: linear-gradient(135deg, rgba(192,132,252,0.10), rgba(168,85,247,0.10)); }
body.dark .transcript-line.spk_5 { background: linear-gradient(135deg, rgba(244,114,182,0.10), rgba(236,72,153,0.10)); }
body.dark .transcript-line.spk_6 { background: linear-gradient(135deg, rgba(94,234,212,0.10), rgba(20,184,166,0.10)); }
body.dark .transcript-line.spk_7 { background: linear-gradient(135deg, rgba(129,140,248,0.10), rgba(79,70,229,0.10)); }
body.dark .transcript-line.spk_8 { background: linear-gradient(135deg, rgba(163,230,53,0.10), rgba(132,204,22,0.10)); }
body.dark .transcript-line.spk_9 { background: linear-gradient(135deg, rgba(253,186,116,0.10), rgba(251,146,60,0.10)); }
/* Speaker hover effects — Light mode (opacity 0.10 → 0.18) */
.transcript-line.spk_0:hover { background: linear-gradient(135deg, rgba(44,94,173,0.18), rgba(99,102,241,0.18)) !important; }
.transcript-line.spk_1:hover { background: linear-gradient(135deg, rgba(16,185,129,0.18), rgba(52,211,153,0.18)) !important; }
.transcript-line.spk_2:hover { background: linear-gradient(135deg, rgba(245,158,11,0.18), rgba(251,191,36,0.18)) !important; }
.transcript-line.spk_3:hover { background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(248,113,113,0.15)) !important; }
.transcript-line.spk_4:hover { background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(192,132,252,0.15)) !important; }
.transcript-line.spk_5:hover { background: linear-gradient(135deg, rgba(236,72,153,0.15), rgba(244,114,182,0.15)) !important; }
.transcript-line.spk_6:hover { background: linear-gradient(135deg, rgba(20,184,166,0.18), rgba(94,234,212,0.18)) !important; }
.transcript-line.spk_7:hover { background: linear-gradient(135deg, rgba(79,70,229,0.15), rgba(129,140,248,0.15)) !important; }
.transcript-line.spk_8:hover { background: linear-gradient(135deg, rgba(132,204,22,0.18), rgba(163,230,53,0.18)) !important; }
.transcript-line.spk_9:hover { background: linear-gradient(135deg, rgba(251,146,60,0.18), rgba(253,186,116,0.18)) !important; }

/* Speaker hover effects — Dark mode (opacity 0.10/0.12 → 0.20) */
body.dark .transcript-line.spk_0:hover { background: linear-gradient(135deg, rgba(74,143,230,0.20), rgba(139,92,246,0.18)) !important; }
body.dark .transcript-line.spk_1:hover { background: linear-gradient(135deg, rgba(52,211,153,0.20), rgba(16,185,129,0.18)) !important; }
body.dark .transcript-line.spk_2:hover { background: linear-gradient(135deg, rgba(251,191,36,0.18), rgba(245,158,11,0.18)) !important; }
body.dark .transcript-line.spk_3:hover { background: linear-gradient(135deg, rgba(248,113,113,0.18), rgba(239,68,68,0.18)) !important; }
body.dark .transcript-line.spk_4:hover { background: linear-gradient(135deg, rgba(192,132,252,0.18), rgba(168,85,247,0.18)) !important; }
body.dark .transcript-line.spk_5:hover { background: linear-gradient(135deg, rgba(244,114,182,0.18), rgba(236,72,153,0.18)) !important; }
body.dark .transcript-line.spk_6:hover { background: linear-gradient(135deg, rgba(94,234,212,0.18), rgba(20,184,166,0.18)) !important; }
body.dark .transcript-line.spk_7:hover { background: linear-gradient(135deg, rgba(129,140,248,0.18), rgba(79,70,229,0.18)) !important; }
body.dark .transcript-line.spk_8:hover { background: linear-gradient(135deg, rgba(163,230,53,0.18), rgba(132,204,22,0.18)) !important; }
body.dark .transcript-line.spk_9:hover { background: linear-gradient(135deg, rgba(253,186,116,0.18), rgba(251,146,60,0.18)) !important; }

body.dark .transcript-line.spk_0.highlighted { background: linear-gradient(135deg, rgba(74,143,230,0.28), rgba(139,92,246,0.25)) !important; }
body.dark .transcript-line.spk_1.highlighted { background: linear-gradient(135deg, rgba(52,211,153,0.28), rgba(16,185,129,0.25)) !important; }
body.dark .transcript-line.spk_2.highlighted { background: linear-gradient(135deg, rgba(251,191,36,0.25), rgba(245,158,11,0.25)) !important; }
body.dark .transcript-line.spk_3.highlighted { background: linear-gradient(135deg, rgba(248,113,113,0.25), rgba(239,68,68,0.25)) !important; }
body.dark .transcript-line.spk_4.highlighted { background: linear-gradient(135deg, rgba(192,132,252,0.25), rgba(168,85,247,0.25)) !important; }
body.dark .transcript-line.spk_5.highlighted { background: linear-gradient(135deg, rgba(244,114,182,0.25), rgba(236,72,153,0.25)) !important; }
body.dark .transcript-line.spk_6.highlighted { background: linear-gradient(135deg, rgba(94,234,212,0.25), rgba(20,184,166,0.25)) !important; }
body.dark .transcript-line.spk_7.highlighted { background: linear-gradient(135deg, rgba(129,140,248,0.25), rgba(79,70,229,0.25)) !important; }
body.dark .transcript-line.spk_8.highlighted { background: linear-gradient(135deg, rgba(163,230,53,0.25), rgba(132,204,22,0.25)) !important; }
body.dark .transcript-line.spk_9.highlighted { background: linear-gradient(135deg, rgba(253,186,116,0.25), rgba(251,146,60,0.25)) !important; }
body.dark .transcript-line.spk_0.selected-for-suggest { outline-color: #93c5fd; }
body.dark .transcript-line.spk_1.selected-for-suggest { outline-color: #6ee7b7; }
body.dark .transcript-line.spk_2.selected-for-suggest { outline-color: #fcd34d; }
body.dark .transcript-line.spk_3.selected-for-suggest { outline-color: #fca5a5; }
body.dark .transcript-line.spk_4.selected-for-suggest { outline-color: #d8b4fe; }
body.dark .transcript-line.spk_5.selected-for-suggest { outline-color: #f9a8d4; }
body.dark .transcript-line.spk_6.selected-for-suggest { outline-color: #5eead4; }
body.dark .transcript-line.spk_7.selected-for-suggest { outline-color: #a5b4fc; }
body.dark .transcript-line.spk_8.selected-for-suggest { outline-color: #bef264; }
body.dark .transcript-line.spk_9.selected-for-suggest { outline-color: #fdba74; }
/* Dark mode — translation text color by speaker (matches bubble gradient) */
body.dark .translation-line.spk_0 { color: #93c5fd; }
body.dark .translation-line.spk_1 { color: #6ee7b7; }
body.dark .translation-line.spk_2 { color: #fcd34d; }
body.dark .translation-line.spk_3 { color: #fca5a5; }
body.dark .translation-line.spk_4 { color: #d8b4fe; }
body.dark .translation-line.spk_5 { color: #f9a8d4; }
body.dark .translation-line.spk_6 { color: #5eead4; }
body.dark .translation-line.spk_7 { color: #a5b4fc; }
body.dark .translation-line.spk_8 { color: #bef264; }
body.dark .translation-line.spk_9 { color: #fdba74; }

.transcript-line.partial { color: #232f3e; font-style: italic; cursor: default; background: transparent; border-radius: 0; margin: 0; max-width: 100%; }
.transcript-line.note-line { background: #fff9db; border-left: 3px solid #fab005; color: #5c4813; font-style: italic; max-width: calc(100% - 24px); width: auto; border-radius: 4px; margin: 6px 12px; padding: 10px 14px; border: 1px solid #fab005; }
.transcript-line.note-line:hover { background: #fff3bf; }
.transcript-line.partial:hover { background: transparent; }
.translation-line.partial { color: #879596; font-style: italic; cursor: default; padding: 2px 16px 4px 16px; font-size: 0.83em; margin-top: -2px; }
.transcript-line.highlighted { background: #dee2e6; color: #232f3e; font-weight: 600; }
.transcript-line.selected-for-suggest { outline: 1.5px solid #495057; outline-offset: -1.5px; }
.transcript-line.ch-mic.selected-for-suggest { outline-color: #495057; }
.transcript-line.ch-sys.selected-for-suggest { outline-color: #1864ab; }
.transcript-line.spk_0.selected-for-suggest { outline-color: #2C5EAD; }
.transcript-line.spk_1.selected-for-suggest { outline-color: #10B981; }
.transcript-line.spk_2.selected-for-suggest { outline-color: #D97706; }
.transcript-line.spk_3.selected-for-suggest { outline-color: #EF4444; }
.transcript-line.spk_4.selected-for-suggest { outline-color: #6b21a8; }
.transcript-line.spk_5.selected-for-suggest { outline-color: #9d174d; }
.transcript-line.spk_6.selected-for-suggest { outline-color: #115e59; }
.transcript-line.spk_7.selected-for-suggest { outline-color: #3730a3; }
.transcript-line.spk_8.selected-for-suggest { outline-color: #3f6212; }
.transcript-line.spk_9.selected-for-suggest { outline-color: #7c2d12; }
.transcript-line.ch-mic.highlighted { background: #ced4da !important; }
.transcript-line.ch-sys.highlighted { background: #b0c8e6 !important; }
.transcript-line.spk_0.highlighted { background: linear-gradient(135deg, rgba(44,94,173,0.25), rgba(99,102,241,0.25)) !important; }
.transcript-line.spk_1.highlighted { background: linear-gradient(135deg, rgba(16,185,129,0.25), rgba(52,211,153,0.25)) !important; }
.transcript-line.spk_2.highlighted { background: linear-gradient(135deg, rgba(245,158,11,0.25), rgba(251,191,36,0.25)) !important; }
.transcript-line.spk_3.highlighted { background: linear-gradient(135deg, rgba(239,68,68,0.25), rgba(248,113,113,0.25)) !important; }
.transcript-line.spk_4.highlighted { background: rgba(168,85,247,0.25) !important; }
.transcript-line.spk_5.highlighted { background: rgba(236,72,153,0.25) !important; }
.transcript-line.spk_6.highlighted { background: rgba(20,184,166,0.25) !important; }
.transcript-line.spk_7.highlighted { background: rgba(79,70,229,0.25) !important; }
.transcript-line.spk_8.highlighted { background: rgba(132,204,22,0.25) !important; }
.transcript-line.spk_9.highlighted { background: rgba(251,146,60,0.25) !important; }
.transcript-line.ch-sys.highlighted { background: #fff3cd; }

.translation-line {
  padding: 4px 14px 8px 14px; font-size: 0.92em; line-height: 1.5; color: #687078;
  cursor: pointer; transition: all 0.12s;
  user-select: none; -webkit-user-select: none;
  margin: 0 12px 6px 12px; max-width: 85%; width: fit-content; border-left: none;
}
.translation-line:hover { background: #f8f9fa; border-radius: 8px; }
.translation-line.ch-mic { margin-left: auto; margin-right: 12px; text-align: right; }
.translation-line.ch-sys { margin-right: auto; margin-left: 12px; }
.translation-line.ch-mic:hover { background: #f8f9fa; }
.translation-line.ch-sys:hover { background: #f8f9fa; }
.translation-line.highlighted { background: #fff3cd; color: #545b64; font-weight: 600; border-radius: 8px; }
.translation-line.ch-mic.highlighted { background: #d0ebff; }
.translation-line.ch-sys.highlighted { background: #fff3cd; }

/* Cards */
.card {
  background: #fff; border: 1px solid #e9ecef; border-radius: 10px;
  padding: 20px; margin-bottom: 16px;
}
.card h2 { font-size: 1rem; color: #232f3e; margin-bottom: 14px; }
.card h3 { font-size: 0.85rem; color: var(--accent); margin-bottom: 6px; margin-top: 14px; }
.card p { font-size: 0.88rem; line-height: 1.6; color: #545b64; }
.card ul { padding-left: 20px; }
.card li { font-size: 0.88rem; line-height: 1.6; color: #545b64; margin-bottom: 3px; }

.mid-summary { border-left: 3px solid var(--accent); }
.mid-summary .timestamp { font-size: 0.72rem; color: #adb5bd; margin-top: 8px; }
.mid-summary-header { display: flex; justify-content: space-between; align-items: center; }
.mid-summary-header h2 { margin-bottom: 0; flex: 1; }
.mid-summary-actions { display: flex; gap: 6px; flex-shrink: 0; }
.mid-summary-actions button {
  background: none; border: 1px solid #d5dbdb; border-radius: 4px;
  color: #687078; cursor: pointer; font-size: 0.8rem; padding: 4px 10px;
  font-weight: 400; line-height: 1;
}
.mid-summary-actions button:hover { background: #f1f3f5; color: #232f3e; }
.mid-summary-actions .ms-delete:hover { color: #d13212; border-color: #d13212; }
.mid-summary-body.collapsed { display: none; }

.loading { text-align: center; padding: 20px; color: var(--accent); display: none; font-size: 0.9rem; }
.loading.visible { display: block; }
.notes-section { display: none; }
.notes-section.visible { display: block; }

/* Empty state */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; color: #adb5bd; text-align: center;
}
.empty-state .es-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.9rem; }

/* Modal */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  z-index: 300; align-items: center; justify-content: center;
}
.modal-overlay.visible { display: flex; }
.modal {
  background: #fff; border-radius: 12px; padding: 28px; min-width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.modal h3 { font-size: 1rem; color: #232f3e; margin-bottom: 8px; }
.modal p { font-size: 0.88rem; color: #545b64; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

.btn-outline {
  padding: 8px 18px; border: 1px solid #d5dbdb; border-radius: 6px;
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  background: #fff; color: #232f3e; transition: all 0.15s;
}
.btn-outline:hover { background: #f1f3f5; }

/* Toast */
#copyToast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #232f3e; color: #fff; padding: 8px 20px; border-radius: 6px;
  font-size: 0.85rem; opacity: 0; transition: opacity 0.2s, transform 0.2s;
  pointer-events: none; z-index: 200;
}
#copyToast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Agent reconnect toast */
#agentToast {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: #fff; color: #232f3e;
  padding: 16px 28px; border-radius: 12px;
  font-size: 0.9rem; font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  border: 1px solid #e9ecef;
  opacity: 0; transition: opacity 0.2s, transform 0.2s;
  pointer-events: none; z-index: 9999; text-align: center;
  will-change: transform;
}
#agentToast.visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* Panel resize handle */
.panels-resize-handle {
  width: 100%; height: 10px; cursor: ns-resize;
  display: flex; align-items: center; justify-content: center;
  margin: -4px 0 20px; user-select: none;
}
.panels-resize-handle::after {
  content: ''; width: 40px; height: 4px; background: #d5dbdb;
  border-radius: 2px; transition: background 0.15s;
}
.panels-resize-handle:hover::after { background: var(--accent); }

/* Suggestion items (in side panel) */
.suggest-context {
  padding: 10px 12px; margin-bottom: 10px; background: #f6f8fa;
  border-radius: 6px; font-size: 0.88em; line-height: 1.5; color: #232f3e;
}
.suggest-context-label {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--accent); margin-bottom: 4px;
}
.suggest-context-translation {
  margin-top: 6px; font-size: 1em; color: #687078;
  border-top: 1px dashed #e9ecef; padding-top: 6px;
}

.suggest-item {
  padding: 10px 12px; border-radius: 6px; margin-bottom: 6px; cursor: pointer;
  transition: background 0.12s; font-size: inherit; line-height: 1.5;
  color: #232f3e; border-left: 3px solid transparent; position: relative;
}
.suggest-item:hover { background: #fff8e1; }
.suggest-item .suggest-cat {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; margin-bottom: 3px;
}
.suggest-copy-btn {
  position: absolute; top: 8px; right: 8px; font-size: 0.7rem;
  padding: 2px 8px; border: 1px solid #d5dbdb; border-radius: 4px;
  background: #fff; color: #687078; cursor: pointer; opacity: 0;
  transition: opacity 0.15s;
}
.suggest-item:hover .suggest-copy-btn { opacity: 1; }
.suggest-copy-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.suggest-cat-tab {
  padding: 4px 12px; border-radius: 4px; border: 1px solid #d5dbdb;
  background: #fff; color: #687078; font-size: 0.78rem; font-weight: 600;
  cursor: pointer; transition: all 0.12s; text-transform: capitalize;
}
.suggest-cat-tab:hover { border-color: var(--accent); color: var(--accent); }
.suggest-cat-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.suggest-references {
  margin-top: 12px; padding: 10px 12px; background: #f6f8fa;
  border-radius: 6px; border-left: 3px solid var(--accent);
}
.suggest-item[data-cat="question"] .suggest-cat { color: #1971c2; }
.suggest-item[data-cat="answer"] .suggest-cat { color: #2f9e44; }
.suggest-item[data-cat="comment"] .suggest-cat { color: #e8590c; }
.suggest-item[data-cat="action"] .suggest-cat { color: #9c36b5; }
.suggest-item[data-cat="question"] { border-left-color: #1971c2; background: #e7f5ff; }
.suggest-item[data-cat="answer"] { border-left-color: #2f9e44; background: #ebfbee; }
.suggest-item[data-cat="comment"] { border-left-color: #e8590c; background: #fff4e6; }
.suggest-item[data-cat="action"] { border-left-color: #9c36b5; background: #f8f0fc; }

.suggest-loading { text-align: center; padding: 24px; color: #adb5bd; font-size: 0.85rem; }
.suggest-translation {
  margin-top: 4px; font-size: 0.92em; color: #687078;
  border-top: 1px dashed #e9ecef; padding-top: 4px;
}

/* --- Help Page (GitHub README style) --- */
#helpPage {
  width: 100%;
  padding: 0;
}

.markdown-body {
  font-family: inherit;
  font-size: 16px;
  line-height: 1.6;
  color: #1f2328;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 40px 60px;
}

.markdown-body h1 {
  font-size: 2rem; font-weight: 700; color: #1f2328;
  border-bottom: 1px solid #d0d7de; padding-bottom: 10px; margin: 0 0 16px;
}
.markdown-body h2 {
  font-size: 1.4rem; font-weight: 600; color: #1f2328;
  border-bottom: 1px solid #d0d7de; padding-bottom: 8px; margin: 32px 0 12px;
}
.markdown-body h3 {
  font-size: 1.1rem; font-weight: 600; color: #1f2328;
  margin: 24px 0 8px;
}
.markdown-body p { margin: 0 0 12px; }
.markdown-body ul, .markdown-body ol { padding-left: 24px; margin: 0 0 12px; }
.markdown-body li { margin-bottom: 4px; }
.markdown-body li + li { margin-top: 2px; }
.markdown-body strong { font-weight: 600; }
.markdown-body em { font-style: italic; }
.markdown-body a { color: #0969da; text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }
.markdown-body hr { border: none; border-top: 1px solid #d0d7de; margin: 24px 0; }

.markdown-body pre {
  background: #f6f8fa; border: 1px solid #d0d7de; border-radius: 6px;
  padding: 12px 16px; font-size: 0.875rem; overflow-x: auto; margin: 0 0 12px;
}
.markdown-body code {
  background: #f6f8fa; border: 1px solid #d0d7de; border-radius: 4px;
  padding: 2px 5px; font-size: 0.875em;
}
.markdown-body pre code { background: none; border: none; padding: 0; font-size: inherit; }

.markdown-body blockquote {
  border-left: 4px solid #d0d7de; padding: 4px 16px;
  color: #57606a; margin: 0 0 12px;
}
.markdown-body blockquote p { margin: 0; }

.markdown-body table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 0.9rem; }
.markdown-body table th {
  padding: 8px 12px; text-align: left; font-weight: 600;
  background: #f6f8fa; border: 1px solid #d0d7de;
}
.markdown-body table td { padding: 8px 12px; border: 1px solid #d0d7de; }
.markdown-body table tr:nth-child(even) td { background: #f6f8fa; }
/* Notes action buttons */
.notes-action-btn {
  background: none; border: 1px solid #d5dbdb; border-radius: 4px;
  color: #687078; cursor: pointer; font-size: 0.8rem; padding: 4px 10px;
  font-weight: 400; line-height: 1;
}
.notes-action-btn:hover { background: #f1f3f5; color: #232f3e; }
.notes-delete-btn:hover { color: #d13212; border-color: #d13212; }

/* Context menu */
.line-context-menu {
  display: none; position: fixed; background: #fff; border: 1px solid #e9ecef;
  border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.12); z-index: 300;
  min-width: 120px; padding: 4px 0;
}
.line-context-menu.visible { display: block; }
.ctx-item {
  padding: 8px 14px; font-size: 0.85rem; cursor: pointer; color: #232f3e;
}
.ctx-item:hover { background: #f1f3f5; }
.ctx-item[data-action="delete"]:hover { color: #d13212; background: #fff5f5; }

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: 260px !important;
    min-width: 260px !important;
    z-index: 200;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 199;
  }
  .sidebar-overlay.visible { display: block; }
  .main { margin-left: 0 !important; }
  .mobile-menu-btn {
    display: flex !important;
  }
  .panels { grid-template-columns: 1fr; }
  .main-layout { grid-template-columns: 1fr !important; height: auto; }
  .main-right { max-height: 300px; }
  .layout-resize-h { display: none; }
  .topbar { padding: 8px 12px; flex-wrap: wrap; gap: 8px; height: auto; }
  .topbar-left { flex-wrap: wrap; gap: 8px; }
  .topbar-left select { font-size: 0.8rem; padding: 6px 8px; }
  .topbar-left label { display: none; }
  .btn { padding: 6px 12px; font-size: 0.8rem; }
  .content { padding: 12px; }
  .panel { min-height: 200px; max-height: 400px; }
  .panel-header { padding: 8px 12px; font-size: 0.75rem; }
  .panel-header select { font-size: 0.72rem !important; padding: 2px 6px !important; }
  .font-size-controls button { padding: 2px 5px; font-size: 0.7rem; }
  .card { padding: 14px; }
  .card h2 { font-size: 0.9rem; }
  .card h3 { font-size: 0.8rem; }
  .card p, .card li { font-size: 0.82rem; }
  .suggest-popup {
    width: calc(100vw - 24px) !important; min-width: unset !important;
    right: 12px; bottom: 12px; max-height: 60vh;
  }
  .modal { min-width: unset; width: calc(100vw - 40px); padding: 20px; }
}

/* --- Dark Mode (matched to sidebar #232f3e tone) --- */
body.dark { background: #232f3e; color: #d5dbdb; }
body.dark .main { background: #1a2332; }
body.dark .topbar { background: #1a2332; border-bottom-color: #37475a; }
body.dark .topbar-left select { background: #2a3a4e !important; color: #d5dbdb !important; border-color: #37475a !important; }
body.dark .topbar-left select:disabled { background: #1a2332; color: #879596; }
/* Dark mode — all select elements that have inline white background */
body.dark #autoSummaryInterval { background: #2a3a4e !important; color: #d5dbdb !important; border-color: #37475a !important; }
body.dark #srcLangSelect { background: #2a3a4e !important; color: #d5dbdb !important; border-color: #37475a !important; }
body.dark #translateFrom { background: #2a3a4e !important; color: #d5dbdb !important; border-color: #37475a !important; }
body.dark #translateTo { background: #2a3a4e !important; color: #d5dbdb !important; border-color: #37475a !important; }
body.dark #sideSummary > div:first-child { border-bottom-color: #37475a !important; }
body.dark .topbar-left label { color: #879596 !important; }
body.dark .topbar-left { color: #d5dbdb; }
body.dark .topbar-right { color: #d5dbdb; }
body.dark .topbar-right span { color: #d5dbdb; }
body.dark .audio-controls span { color: #879596 !important; }
body.dark .btn-secondary { background: #37475a; color: #d5dbdb; }
body.dark .btn-secondary:hover:not(:disabled) { background: #4a5d73; }
body.dark .btn-primary { background: var(--accent-btn); color: #fff; }
body.dark #agentMode { accent-color: var(--accent); }
body.dark .panel { background: #141c24; border-color: #37475a; }
body.dark .panel-header { background: #1a2332; border-bottom-color: #37475a; color: #879596; }
body.dark .panel-header select { background: #2a3a4e !important; color: #d5dbdb !important; border-color: #37475a !important; }
body.dark .panel-live { background: #1a2332; border-top-color: #37475a; }
body.dark .transcript-line { color: #d5dbdb; background: #2a3a4e; }
body.dark .transcript-line:not(.ch-spk):hover { background: #37475a; }
body.dark .transcript-line.ch-mic { background: #2a3a4e; color: #d5dbdb; }
body.dark .transcript-line.ch-sys { background: #1a3a5c; color: #d5dbdb; }
body.dark .transcript-line.ch-mic:hover { background: #243a52; }
body.dark .transcript-line.ch-sys:hover { background: #37475a; }
body.dark .transcript-line.highlighted { background: #3d3a20; color: #f0e68c; }
body.dark .transcript-line.ch-mic.highlighted { color: #1a2332 !important; outline-color: #adb5bd; }
body.dark .transcript-line.ch-mic.selected-for-suggest { outline-color: #adb5bd; }
body.dark .transcript-line.ch-sys.highlighted { background: #b0c8e6 !important; color: #1a2332 !important; }
body.dark .transcript-line.ch-sys.selected-for-suggest { outline-color: #74b9ff; }
body.dark .transcript-line.partial { color: #687078; background: transparent; }
body.dark .transcript-line.note-line { background: #3d3a20; border-left-color: #fab005; color: #f0e68c; }
body.dark .transcript-line.note-line:hover { background: #4a4520; }
body.dark .transcript-line.note-line textarea,
body.dark .transcript-line.note-line input { color: #f0e68c; background: #3d3a20; border-color: #fab005; }
body.dark .translation-line.partial { color: #5a6a6e; }
body.dark .translation-line { color: #adb5bd; }
body.dark .translation-line:hover { background: rgba(255,255,255,0.03); border-radius: 8px; }
body.dark .translation-line.ch-mic { color: #adb5bd; }
body.dark .translation-line.ch-sys { color: #adb5bd; }
body.dark .translation-line.ch-mic:hover { background: #243a52; }
body.dark .translation-line.highlighted { background: #3d3a20; color: #d4c87a; border-radius: 8px; }
body.dark .main-right { background: #232f3e; border-color: #37475a; }
body.dark .side-tabs { background: #1a2332; border-bottom-color: #37475a; }
body.dark .side-tab { color: #879596; }
body.dark .side-tab:hover { color: #d5dbdb; background: #2a3a4e; }
body.dark .side-tab.active { color: var(--accent); }
body.dark .side-tab-body { color: #d5dbdb; }
body.dark .suggest-context { background: #1a2332; color: #d5dbdb; }
body.dark .suggest-item { color: #d5dbdb; }
body.dark .suggest-item:hover { background: #37475a; }
body.dark .suggest-item[data-cat="question"] { background: #1a2a3e; }
body.dark .suggest-item[data-cat="answer"] { background: #1a2e1f; }
body.dark .suggest-item[data-cat="comment"] { background: #2e1f1a; }
body.dark .suggest-item[data-cat="action"] { background: #261a2e; }
body.dark .suggest-copy-btn { background: #2a3a4e; color: #879596; border-color: #37475a; }
body.dark .suggest-copy-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
body.dark .suggest-cat-tab { background: #2a3a4e; color: #879596; border-color: #37475a; }
body.dark .suggest-cat-tab:hover { border-color: var(--accent-btn); color: var(--accent-btn); }
body.dark .suggest-cat-tab.active { background: var(--accent-btn); color: #fff; border-color: var(--accent-btn); }
body.dark .suggest-references { background: #1a2332; }
body.dark .suggest-translation { color: #879596; border-top-color: #37475a; }
body.dark .suggest-context-translation { color: #879596; border-top-color: #37475a; }
body.dark .card { background: #141c24; border-color: #37475a; }
body.dark .card h2 { color: #d5dbdb; }
body.dark .card p, body.dark .card li { color: #b0bec5; }
body.dark .modal { background: #232f3e; }
body.dark .modal h3 { color: #d5dbdb; }
body.dark .modal p { color: #b0bec5; }
body.dark .btn-outline { background: #2a3a4e; color: #d5dbdb; border-color: #37475a; }
body.dark .btn-outline:hover { background: #37475a; }
body.dark #btnExpandAll, body.dark #btnCollapseAll { border-color: #37475a !important; color: #b0bec5 !important; background: none !important; }
body.dark #btnExpandAll:hover, body.dark #btnCollapseAll:hover { background: rgba(255,255,255,0.05) !important; }
body.dark .timer-badge { background: #37475a; color: #d5dbdb; }
body.dark .status-pill { color: #879596; }
body.dark .empty-state { color: #687078; }
body.dark .loading { color: var(--accent); }
body.dark .notes-action-btn { color: #879596; border-color: #37475a; }
body.dark .notes-action-btn:hover { background: #37475a; color: #d5dbdb; }
body.dark .line-context-menu { background: #232f3e; border-color: #37475a; }
body.dark .ctx-item { color: #d5dbdb; }
body.dark .ctx-item:hover { background: #37475a; }
body.dark #copyToast { background: #d5dbdb; color: #232f3e; }
body.dark #agentToast { background: #232f3e; color: #d5dbdb; border-color: #37475a; }
body.dark .font-size-controls button { color: #879596; border-color: #37475a; }
body.dark .font-size-controls button:hover { background: #37475a; color: #d5dbdb; }
body.dark .layout-resize-h::after { background: #37475a; }
body.dark .panels-resize-handle::after { background: #37475a; }
body.dark #translateInput { background: #1e2d3d !important; color: #d5dbdb !important; border-color: #37475a !important; }
body.dark #briefInput { background: #1e2d3d !important; color: #d5dbdb !important; border-color: #37475a !important; }
body.dark textarea::placeholder, body.dark input::placeholder { color: #b0bec5 !important; }
body.dark select option[value=""][disabled] { color: #b0bec5; }
#translateResult { background: transparent; }
body.dark #translateResult { background: transparent; color: #d5dbdb; }

/* Translate result cards */
.tr-card-direct { border-left-color: #495057; background: #f1f3f5; }
.tr-card-formal { border-left-color: #53629E; background: #eef0f8; }
.tr-card-verbal { border-left-color: #87BAC3; background: #edf6f8; }
.tr-card-direct .suggest-cat { color: #495057; }
.tr-card-formal .suggest-cat { color: #53629E; }
.tr-card-verbal .suggest-cat { color: #5a9aa6; }
body.dark .tr-card-direct { background: #2a3a4e; }
body.dark .tr-card-formal { background: #2a2e3e; }
body.dark .tr-card-verbal { background: #1e2e32; }
body.dark .tr-card-direct .suggest-cat { color: #adb5bd; }
body.dark .tr-card-formal .suggest-cat { color: #9aa4d4; }
body.dark .tr-card-verbal .suggest-cat { color: #87BAC3; }
body.dark #translateFrom, body.dark #translateTo { background: #2a3a4e; color: #d5dbdb; border-color: #37475a; }
body.dark .markdown-body { color: #d5dbdb; }
body.dark .markdown-body h1, body.dark .markdown-body h2, body.dark .markdown-body h3 { color: #d5dbdb; border-bottom-color: #37475a; }
body.dark .markdown-body pre { background: #1a2332; border-color: #37475a; }
body.dark .markdown-body code { background: #1a2332; border-color: #37475a; }
body.dark .markdown-body blockquote { border-left-color: #37475a; color: #879596; }
body.dark .markdown-body table th { background: #1a2332; border-color: #37475a; }
body.dark .markdown-body table td { border-color: #37475a; }
body.dark .markdown-body table tr:nth-child(even) td { background: #1a2332; }
body.dark .sidebar-toggle-item { color: #d5dbdb; }
body.dark .sub-panel { background: #232f3e; border-right-color: #37475a; }
body.dark .sub-panel-header { border-bottom-color: #37475a; color: #d5dbdb; }
body.dark .sub-panel-body { color: #d5dbdb; }
body.dark .sub-panel select { background: #1a2332; color: #d5dbdb; border-color: #37475a; }
body.dark .sub-panel label { color: #adb5bd; }
/* Dark mode: override inline styles in side panel */
body.dark .side-tab-body h3 { color: var(--accent) !important; }
body.dark .side-tab-body p { color: #d5dbdb !important; }
body.dark .side-tab-body li { color: #d5dbdb !important; }
body.dark .side-tab-body hr { border-top-color: #37475a !important; }
body.dark .suggest-loading { color: #879596; }
body.dark .suggest-item .suggest-cat { opacity: 0.9; }
body.dark #btnSwapLang { color: #d5dbdb; }
body.dark #btnSwapLang { color: #d5dbdb !important; }
body.dark #translateBtn { background: var(--accent-btn); color: #fff; }
body.dark #translateSwap { color: #d5dbdb !important; }
body.dark #translateFrom, body.dark #translateTo { background: #2a3a4e !important; color: #d5dbdb !important; border-color: #37475a !important; }
body.dark #advancedSettings { background: #232f3e !important; border-bottom-color: #37475a !important; }
body.dark #advancedSettings label { color: #879596 !important; }
body.dark #advancedSettings select { background: #2a3a4e !important; color: #d5dbdb !important; border-color: #37475a !important; }
body.dark #btnSettings { color: #879596; border-color: #37475a; }
body.dark .panel-live { background: #1a2332; }
body.dark .panel-live .transcript-line { color: #fff; }
body.dark .panel-live .transcript-line.partial { color: #ccc; }
body.dark #notesEditor { background: #2a3a4e; color: #d5dbdb; border-color: #37475a; }
body.dark #notesPreview { background: #1a2332; border-color: #37475a; }

/* === Transcript Search (Cmd+F) === */
.search-bar { display:flex; align-items:center; gap:6px; padding:6px 28px; background:#fff3cd; border-bottom:1px solid #ffc107; font-size:0.85rem; z-index:4; }
.search-bar input { flex:1; padding:5px 8px; border:1px solid #ffc107; border-radius:4px; font-size:0.85rem; outline:none; background:#fff; }
.search-bar input:focus { border-color:var(--accent); box-shadow:0 0 0 2px rgba(44,94,173,0.15); }
.search-bar .search-count { font-size:0.78rem; color:#687078; min-width:40px; text-align:center; }
.search-bar button { background:none; border:1px solid #d5dbdb; border-radius:4px; cursor:pointer; padding:2px 7px; font-size:0.9rem; color:#232f3e; line-height:1; }
.search-bar button:hover { background:#f1f3f5; }
.search-match { background: rgba(255, 235, 59, 0.25) !important; }
.search-active { background: rgba(44, 94, 173, 0.2) !important; outline: 2px solid var(--accent); border-radius: 3px; }
mark.search-highlight { background: #ffeb3b; color: inherit; padding: 0 1px; border-radius: 2px; }
.search-active mark.search-highlight { background: var(--accent); color: #fff; }

/* Dark mode search */
body.dark .search-bar { background:#3a2e00; border-bottom-color:#7a5c00; }
body.dark .search-bar input { background:#1a2332; color:#d5dbdb; border-color:#7a5c00; }
body.dark .search-bar input:focus { border-color:var(--accent); }
body.dark .search-bar .search-count { color:#879596; }
body.dark .search-bar button { color:#d5dbdb; border-color:#37475a; }
body.dark .search-bar button:hover { background:#2a3a4e; }
body.dark .search-match { background: rgba(255, 235, 59, 0.15) !important; }
body.dark .search-active { background: rgba(44, 94, 173, 0.3) !important; outline-color: var(--accent); }
body.dark mark.search-highlight { background: #b8860b; color: #fff; }
body.dark .search-active mark.search-highlight { background: var(--accent); color: #fff; }

/* --- Summary Loading --- */
.summary-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  color: #687078;
  font-size: 0.85rem;
  border-bottom: 1px solid #f0f0f0;
  animation: pulse 1.5s ease-in-out infinite;
}
body.dark .summary-loading { border-bottom-color: #37475a; color: #7a8fa0; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.loading-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #e9ecef;
  border-top: 2px solid var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === Radio Card Selection (Settings Audio) === */
.radio-cards { display: flex; flex-direction: column; gap: 8px; }
.radio-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; background: var(--settings-card-bg, #f7f8fa);
  border: 1px solid var(--border-color, rgba(0,0,0,0.08));
  border-radius: 10px; cursor: pointer; transition: all 0.15s;
}
.radio-card:hover { border-color: var(--accent, #2C5EAD); }
.radio-card.selected { border-color: var(--accent, #2C5EAD); background: rgba(44,94,173,0.06); }
.radio-dot {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border-color, rgba(0,0,0,0.15));
  flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s;
}
.radio-card.selected .radio-dot { border-color: var(--accent, #2C5EAD); }
.radio-card.selected .radio-dot::after {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent, #2C5EAD);
}
.radio-content { flex: 1; min-width: 0; }
.radio-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 500; color: var(--text-primary, #232f3e);
  margin-bottom: 2px;
}
.radio-title svg { width: 16px; height: 16px; color: var(--text-muted, #7a8fa0); flex-shrink: 0; }
.radio-card.selected .radio-title svg { color: var(--accent, #2C5EAD); }
.radio-desc { font-size: 0.72rem; color: var(--text-muted, #687078); line-height: 1.4; }
.radio-card.selected .radio-desc { color: var(--text-secondary, #4a5568); }
.radio-sub-option {
  margin-top: 8px; padding: 8px 12px;
  background: rgba(44,94,173,0.04); border-radius: 8px;
  border: 1px solid rgba(44,94,173,0.12); display: none;
}
.radio-card.selected .radio-sub-option { display: block; }
.radio-select {
  width: 100%; padding: 7px 10px;
  background: var(--settings-card-bg, #fff);
  border: 1px solid var(--border-color, rgba(0,0,0,0.1));
  border-radius: 6px; color: var(--text-primary, #232f3e);
  font-size: 0.78rem;
}
.download-link {
  color: var(--accent, #2C5EAD); text-decoration: none;
  font-weight: 500; border-bottom: 1px dashed currentColor;
}
.download-link:hover { opacity: 0.7; }

/* Dark mode overrides for radio cards */
body.dark .radio-card { background: #1a2332; border-color: rgba(255,255,255,0.08); }
body.dark .radio-card:hover { border-color: var(--accent, #2C5EAD); }
body.dark .radio-card.selected { background: rgba(44,94,173,0.1); }
body.dark .radio-dot { border-color: rgba(255,255,255,0.2); }
body.dark .radio-title { color: #f1f3f7; }
body.dark .radio-desc { color: #5a6f80; }
body.dark .radio-card.selected .radio-desc { color: #7a8fa0; }
body.dark .radio-sub-option { background: rgba(44,94,173,0.08); border-color: rgba(44,94,173,0.2); }
body.dark .radio-select { background: #1a2332; border-color: rgba(255,255,255,0.08); color: #f1f3f7; }
