/* ── Listening Skill — listening.css ──
 * Tokyonight palette:
 *   --bg: #1a1b26  --bg-light: #24283b  --bg-lighter: #2f3349
 *   --fg: #c0caf5  --fg-dim: #565f89   --accent: #7aa2f7
 *   --green: #9ece6a  --red: #f7768e  --yellow: #e0af68  --border: #3b4261
 */

/* ════════════════════════════════════════
   1. Global Mic Button
   ════════════════════════════════════════ */

html[data-theme="light"] {
  --li-mic-bg: #f8fbff;
  --li-mic-fg: #2c54c8;
  --li-mic-border: rgba(59, 102, 224, 0.26);
  --li-mic-shadow: inset 0 1px 0 rgba(255,255,255,0.90), 0 1px 2px rgba(15,23,42,0.06);
  --li-mic-hover-bg: #eef3ff;
  --li-mic-hover-fg: #1d3fae;
  --li-mic-hover-border: rgba(59, 102, 224, 0.52);
  --li-mic-hover-shadow: 0 0 0 3px rgba(59, 102, 224, 0.14), 0 2px 8px rgba(15,23,42,0.08);
  --li-mic-recording-bg: #fff1f2;
  --li-mic-recording-fg: #b91c1c;
  --li-mic-recording-border: rgba(225, 29, 72, 0.34);
  --li-mic-inline-bg: #ffffff;
  --li-mic-inline-fg: #3b66e0;
  --li-mic-inline-border: rgba(59, 102, 224, 0.24);
}

#global-mic-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--li-mic-border, #3b4261);
  border-radius: 50%;
  background: var(--li-mic-bg, #24283b);
  color: var(--li-mic-fg, #565f89);
  box-shadow: var(--li-mic-shadow, none);
  font-size: 16px;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  padding: 0;
  flex-shrink: 0;
}

#global-mic-btn svg {
  width: 16px;
  height: 16px;
  margin-right: 0;
}

#global-mic-btn:hover {
  color: var(--li-mic-hover-fg, #c0caf5);
  border-color: var(--li-mic-hover-border, #7aa2f7);
  background: var(--li-mic-hover-bg, #2f3349);
  box-shadow: var(--li-mic-hover-shadow, none);
}

#global-mic-btn:focus-visible {
  outline: none;
  color: var(--li-mic-hover-fg, #c0caf5);
  border-color: var(--li-mic-hover-border, #7aa2f7);
  box-shadow: var(--li-mic-hover-shadow, 0 0 0 2px rgba(122, 162, 247, 0.35));
}

#global-mic-btn:active {
  transform: translateY(1px);
}

#global-mic-btn.li-recording {
  color: var(--li-mic-recording-fg, #f7768e);
  border-color: var(--li-mic-recording-border, #f7768e);
  background: var(--li-mic-recording-bg, rgba(247, 118, 142, 0.12));
  animation: li-mic-pulse 1.5s ease-in-out infinite;
}

@keyframes li-mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(247, 118, 142, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(247, 118, 142, 0); }
}

/* ════════════════════════════════════════
   2. Recording Pill Indicator
   ════════════════════════════════════════ */

.li-recording-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 8px;
  background: #24283b;
  border: 1px solid #3b4261;
  border-radius: 20px;
  font-size: 12px;
  color: #c0caf5;
  white-space: nowrap;
  margin-right: 8px;
  animation: li-pill-fadein 0.2s ease;
}

@keyframes li-pill-fadein {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.li-rec-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f7768e;
  animation: li-dot-blink 1s ease-in-out infinite;
  flex-shrink: 0;
}

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

.li-rec-timer {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 12px;
  color: #f7768e;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 32px;
}

.li-rec-mode {
  font-size: 11px;
  color: rgba(247, 118, 142, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.li-rec-stop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(247, 118, 142, 0.2);
  color: #f7768e;
  font-size: 10px;
  cursor: pointer;
  transition: background 0.15s;
  padding: 0;
  margin-left: 2px;
  line-height: 1;
}

.li-rec-stop:hover {
  background: rgba(247, 118, 142, 0.35);
}

/* ════════════════════════════════════════
   3. Mode Picker Dropdown
   ════════════════════════════════════════ */

.li-mode-picker {
  position: fixed;
  z-index: 9999;
  min-width: 200px;
  background: #24283b;
  border: 1px solid #3b4261;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  padding: 6px 0;
  animation: li-picker-in 0.15s ease;
}

@keyframes li-picker-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.li-picker-title {
  padding: 8px 14px 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #565f89;
}

.li-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.1s;
  color: #c0caf5;
  font-size: 13px;
}

.li-picker-item:hover {
  background: #2f3349;
}

.li-picker-item.li-picker-active {
  background: rgba(122, 162, 247, 0.1);
  color: #7aa2f7;
}

.li-picker-item.li-picker-active .li-picker-icon {
  color: #7aa2f7;
}

.li-picker-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.li-picker-label {
  flex: 1;
}

.li-picker-divider {
  height: 1px;
  background: #3b4261;
  margin: 6px 0;
}

.li-picker-loading {
  opacity: 0.5;
  pointer-events: none;
}

.li-mic-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
}
.li-mic-builtin { background: rgba(158, 206, 106, 0.15); color: #9ece6a; }
.li-mic-phone   { background: rgba(247, 118, 142, 0.15); color: #f7768e; }
.li-mic-virtual  { background: rgba(187, 154, 247, 0.15); color: #bb9af7; }

/* ════════════════════════════════════════
   4. Inline Mic Buttons (Chat / Prompt)
   ════════════════════════════════════════ */

.li-inline-mic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--li-mic-inline-border, #3b4261);
  border-radius: 50%;
  background: var(--li-mic-inline-bg, #2f3349);
  color: var(--li-mic-inline-fg, #565f89);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
  flex-shrink: 0;
}

.li-inline-mic:hover {
  color: #7aa2f7;
  border-color: #7aa2f7;
  background: rgba(122, 162, 247, 0.1);
}

.li-inline-mic.li-recording,
.li-inline-mic.li-inline-mic-active {
  color: #f7768e;
  border-color: #f7768e;
  background: rgba(247, 118, 142, 0.15);
  animation: li-mic-pulse 1.5s ease-in-out infinite;
}

.li-inline-mic svg {
  width: 14px;
  height: 14px;
}

/* Dictation interim text overlay */
.li-dictation-interim {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  padding: 6px 10px;
  background: #2f3349;
  border: 1px solid #3b4261;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  font-size: 12px;
  color: #565f89;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* ════════════════════════════════════════
   5. Waveform Canvas
   ════════════════════════════════════════ */

.li-waveform-wrap {
  width: 100%;
  padding: 12px;
  background: #1a1b26;
  border: 1px solid #3b4261;
  border-radius: 8px;
  overflow: hidden;
}

.li-waveform-canvas,
.li-waveform {
  display: block;
  width: 100%;
  height: 48px;
  border-radius: 6px;
  background: #1a1b26;
}

.li-waveform-wrap.li-inactive {
  opacity: 0.3;
}

.li-waveform-wrap.li-inactive .li-waveform-canvas {
  filter: grayscale(1);
}

/* ════════════════════════════════════════
   6. Listening Sub-Tab Content
   ════════════════════════════════════════ */

/* ── View Container ── */

.li-view {
  padding: 16px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.li-tab-content {
  padding: 16px;
}

/* ── Toolbar ── */

.li-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.li-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.li-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.li-search-input {
  width: 220px;
  padding: 6px 10px;
  background: #1a1b26;
  border: 1px solid #3b4261;
  border-radius: 6px;
  color: #c0caf5;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}

.li-search-input::placeholder {
  color: #565f89;
}

.li-search-input:focus {
  border-color: #7aa2f7;
}

.li-filter-btn {
  padding: 6px 10px;
  background: #24283b;
  border: 1px solid #3b4261;
  border-radius: 6px;
  color: #565f89;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.li-filter-btn:hover,
.li-filter-btn.active {
  color: #c0caf5;
  border-color: #7aa2f7;
  background: rgba(122, 162, 247, 0.1);
}

.li-record-btn {
  padding: 6px 14px;
  background: #f7768e;
  border: none;
  border-radius: 6px;
  color: #1a1b26;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.li-record-btn:hover {
  opacity: 0.85;
}

.li-record-btn.recording {
  background: #565f89;
  animation: li-dot-blink 1s ease-in-out infinite;
}

/* ── Active Recording Panel ── */

.li-active-recording {
  background: #24283b;
  border: 1px solid rgba(247, 118, 142, 0.3);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
}

.li-active-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.li-active-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.li-active-title {
  color: #f7768e;
  font-weight: 600;
  font-size: 14px;
}

.li-active-right {
  display: flex;
  gap: 8px;
}

/* ── Live Transcript ── */

.li-live-transcript {
  max-height: 200px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
  color: #c0caf5;
  padding: 8px;
  background: #1a1b26;
  border-radius: 6px;
}

.li-transcript-placeholder {
  color: #565f89;
  font-style: italic;
}

/* ── Recordings List ── */

.li-recordings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.li-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #c0caf5;
}

.li-recordings-list {
  flex: 1;
  overflow-y: auto;
}

.li-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.li-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #24283b;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.1s;
}

.li-list-item:hover {
  border-color: #3b4261;
  background: #2f3349;
}

.li-list-item.active {
  border-color: #7aa2f7;
  background: rgba(122, 162, 247, 0.08);
}

.li-list-icon {
  font-size: 18px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.li-list-info {
  flex: 1;
  min-width: 0;
}

.li-list-title {
  font-size: 13px;
  color: #c0caf5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.li-list-meta {
  font-size: 11px;
  color: #565f89;
  margin-top: 2px;
}

.li-list-meta span + span::before {
  content: '\00B7';
  margin: 0 6px;
}

.li-list-duration {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 12px;
  color: #565f89;
  flex-shrink: 0;
}

.li-list-status {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.li-list-status.processing { background: #e0af68; }
.li-list-status.complete { background: #9ece6a; }
.li-list-status.error { background: #f7768e; }
.li-list-status.recording { background: #f7768e; animation: li-dot-blink 1s ease-in-out infinite; }

/* ── Recording Card (alternate layout) ── */

.li-recording-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #24283b;
  border: 1px solid #3b4261;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.li-recording-card:hover {
  border-color: #7aa2f7;
}

.li-rec-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #c0caf5;
  margin-bottom: 2px;
}

.li-rec-card-meta {
  font-size: 11px;
  color: #565f89;
}

/* ── Status Badges ── */

.li-status-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: capitalize;
}

.li-status-done {
  background: rgba(158, 206, 106, 0.15);
  color: #9ece6a;
}

.li-status-error {
  background: rgba(247, 118, 142, 0.15);
  color: #f7768e;
}

.li-status-pending {
  background: rgba(224, 175, 104, 0.15);
  color: #e0af68;
}

/* ── Empty State ── */

.li-empty {
  text-align: center;
  padding: 48px 16px;
  color: #565f89;
  font-size: 13px;
}

.li-empty-icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ── Detail View ── */

.li-detail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px;
}

.li-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.li-detail-header h3 {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: #c0caf5;
  margin: 0;
}

.li-detail-title {
  font-size: 16px;
  font-weight: 600;
  color: #c0caf5;
}

.li-detail-meta {
  font-size: 12px;
  color: #565f89;
  margin-top: 4px;
}

.li-detail-section {
  margin-bottom: 16px;
}

.li-detail-section h4 {
  font-size: 13px;
  font-weight: 600;
  color: #c0caf5;
  margin-bottom: 8px;
}

.li-detail-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid #3b4261;
}

.li-detail-btn {
  padding: 5px 10px;
  background: #2f3349;
  border: 1px solid #3b4261;
  border-radius: 6px;
  color: #c0caf5;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.li-detail-btn:hover {
  background: #3b4261;
}

.li-detail-btn.danger {
  color: #f7768e;
}

.li-detail-btn.danger:hover {
  background: rgba(247, 118, 142, 0.15);
  border-color: #f7768e;
}

/* ── Back Button ── */

.li-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  background: none;
  border: none;
  color: #565f89;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s;
}

.li-back-btn:hover {
  color: #7aa2f7;
}

/* ── Transcript Section ── */

.li-transcript {
  background: #1a1b26;
  border: 1px solid #3b4261;
  border-radius: 8px;
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
}

.li-transcript-line {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  line-height: 1.5;
}

.li-transcript-line + .li-transcript-line {
  border-top: 1px solid #24283b;
}

.li-transcript-ts {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 11px;
  color: #565f89;
  min-width: 42px;
  flex-shrink: 0;
  padding-top: 2px;
}

.li-transcript-speaker {
  font-size: 12px;
  font-weight: 600;
  min-width: 80px;
  flex-shrink: 0;
  cursor: pointer;
  padding-top: 1px;
}

.li-transcript-speaker:hover {
  text-decoration: underline;
}

.li-transcript-text {
  color: #c0caf5;
  font-size: 13px;
  line-height: 1.6;
  flex: 1;
  white-space: pre-wrap;
}

/* ── Transcript Segments (alternate layout) ── */

.li-segment {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
  line-height: 1.5;
}

.li-segment-speaker {
  font-size: 12px;
  font-weight: 600;
  min-width: 80px;
  flex-shrink: 0;
}

.li-segment-text {
  font-size: 13px;
  color: #c0caf5;
}

/* Speaker colors (cycled) */
.li-speaker-0 { color: #7aa2f7; }
.li-speaker-1 { color: #9ece6a; }
.li-speaker-2 { color: #e0af68; }
.li-speaker-3 { color: #bb9af7; }
.li-speaker-4 { color: #7dcfff; }
.li-speaker-5 { color: #ff9e64; }

/* ── Summary Section ── */

.li-summary {
  background: #24283b;
  border: 1px solid #3b4261;
  border-radius: 8px;
  padding: 16px;
}

.li-summary h4 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #565f89;
  margin: 0 0 10px 0;
}

.li-summary p,
.li-summary ul {
  font-size: 13px;
  color: #c0caf5;
  line-height: 1.6;
  margin: 0;
}

.li-summary ul {
  padding-left: 18px;
}

.li-summary li + li {
  margin-top: 4px;
}

/* ════════════════════════════════════════
   7. Speaker Label Modal
   ════════════════════════════════════════ */

.li-speaker-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: li-modal-fade 0.15s ease;
}

/* Legacy class (overlay + content combined) */
.li-speaker-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: li-modal-fade 0.15s ease;
}

@keyframes li-modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.li-speaker-modal-content {
  width: 440px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  background: #24283b;
  border: 1px solid #3b4261;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  animation: li-modal-slide 0.2s ease;
}

@keyframes li-modal-slide {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.li-speaker-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #3b4261;
}

.li-speaker-modal-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #c0caf5;
  margin: 0;
}

.li-speaker-modal-close {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #565f89;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.li-speaker-modal-close:hover {
  color: #c0caf5;
  background: #2f3349;
}

.li-speaker-modal-body {
  padding: 16px;
}

.li-speaker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: #1a1b26;
  border-radius: 6px;
  margin-bottom: 8px;
}

.li-speaker-row + .li-speaker-row {
  border-top: 1px solid #2f3349;
}

.li-speaker-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.li-speaker-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.li-speaker-id {
  font-size: 12px;
  color: #565f89;
  min-width: 72px;
  flex-shrink: 0;
}

.li-speaker-name-input {
  flex: 1;
  padding: 6px 8px;
  background: #2f3349;
  border: 1px solid #3b4261;
  border-radius: 4px;
  color: #c0caf5;
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s;
}

.li-speaker-name-input::placeholder {
  color: #565f89;
}

.li-speaker-name-input:focus {
  border-color: #7aa2f7;
}

.li-speaker-play {
  padding: 4px 8px;
  border-radius: 4px;
  background: #2f3349;
  border: none;
  color: #565f89;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.li-speaker-play:hover {
  color: #c0caf5;
  background: #3b4261;
}

.li-speaker-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #3b4261;
}

.li-speaker-modal-btn {
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.li-speaker-modal-btn.cancel {
  background: transparent;
  border: 1px solid #3b4261;
  color: #565f89;
}

.li-speaker-modal-btn.cancel:hover {
  color: #c0caf5;
  border-color: #565f89;
}

.li-speaker-modal-btn.save {
  background: #7aa2f7;
  border: none;
  color: #1a1b26;
  font-weight: 600;
}

.li-speaker-modal-btn.save:hover {
  opacity: 0.85;
}

/* ════════════════════════════════════════
   Scrollbars (Tokyonight)
   ════════════════════════════════════════ */

.li-transcript::-webkit-scrollbar,
.li-live-transcript::-webkit-scrollbar,
.li-recordings-list::-webkit-scrollbar,
.li-view::-webkit-scrollbar {
  width: 6px;
}

.li-transcript::-webkit-scrollbar-track,
.li-live-transcript::-webkit-scrollbar-track,
.li-recordings-list::-webkit-scrollbar-track,
.li-view::-webkit-scrollbar-track {
  background: transparent;
}

.li-transcript::-webkit-scrollbar-thumb,
.li-live-transcript::-webkit-scrollbar-thumb,
.li-recordings-list::-webkit-scrollbar-thumb,
.li-view::-webkit-scrollbar-thumb {
  background: #3b4261;
  border-radius: 3px;
}

.li-transcript::-webkit-scrollbar-thumb:hover,
.li-live-transcript::-webkit-scrollbar-thumb:hover,
.li-recordings-list::-webkit-scrollbar-thumb:hover,
.li-view::-webkit-scrollbar-thumb:hover {
  background: #565f89;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* 8. Phase 2: Transcription progress, provider badge, status        */
/* ═══════════════════════════════════════════════════════════════════ */

.li-status-transcribing {
  background: rgba(224, 175, 104, 0.15);
  color: #e0af68;
}

.li-progress-container {
  margin: 12px 0;
}

.li-progress-bar {
  height: 6px;
  background: #24283b;
  border-radius: 3px;
  overflow: hidden;
}

.li-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7aa2f7, #73daca);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.li-progress-msg {
  margin-top: 6px;
  font-size: 12px;
  color: #565f89;
}

.li-provider-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(122, 162, 247, 0.15);
  color: #7aa2f7;
  vertical-align: middle;
  margin-left: 6px;
}

.li-transcript-meta {
  font-size: 12px;
  color: #565f89;
  margin-bottom: 10px;
}

.li-segment-time {
  font-size: 11px;
  color: #565f89;
  margin: 0 6px;
  font-variant-numeric: tabular-nums;
}

.li-transcribe-btn {
  margin-top: 10px;
}

.li-transcribe-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* 9. Phase 3: Speaker label modal                                    */
/* ═══════════════════════════════════════════════════════════════════ */

.li-speaker-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: li-modal-fade 0.2s ease;
}

.li-speaker-modal-content {
  background: #1a1b26;
  border: 1px solid #414868;
  border-radius: 12px;
  padding: 24px;
  min-width: 400px;
  max-width: 520px;
  max-height: 80vh;
  overflow-y: auto;
  animation: li-modal-slide 0.2s ease;
}

.li-speaker-modal-content h3 {
  margin: 0 0 4px 0;
  color: #c0caf5;
  font-size: 16px;
}

.li-modal-desc {
  color: #565f89;
  font-size: 13px;
  margin: 0 0 16px 0;
}

.li-speaker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #24283b;
}

.li-speaker-row:last-of-type {
  border-bottom: none;
}

.li-speaker-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.li-speaker-label {
  font-size: 13px;
  color: #a9b1d6;
  min-width: 80px;
}

.li-speaker-meta {
  font-size: 11px;
  color: #565f89;
  min-width: 90px;
}

.li-speaker-name-input {
  flex: 1;
  background: #24283b;
  border: 1px solid #414868;
  border-radius: 4px;
  padding: 4px 8px;
  color: #c0caf5;
  font-size: 13px;
}

.li-speaker-name-input:focus {
  outline: none;
  border-color: #7aa2f7;
}

.li-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #24283b;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* 10. Phase 4: Meeting notes display                                 */
/* ═══════════════════════════════════════════════════════════════════ */

.li-notes-section {
  margin-top: 8px;
}

.li-notes-content {
  background: #24283b;
  border-radius: 6px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: #a9b1d6;
  white-space: pre-wrap;
  max-height: 300px;
  overflow-y: auto;
}

.li-email-draft {
  background: #24283b;
  border-radius: 6px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: #a9b1d6;
  white-space: pre-wrap;
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: 8px;
}

.li-copy-email-btn {
  margin-top: 4px;
}

.li-generate-notes-btn {
  margin-right: 8px;
}

.li-generate-notes-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* 11. Phase 5: Calendar meeting banner                               */
/* ═══════════════════════════════════════════════════════════════════ */

.li-meeting-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(122,162,247,0.1), rgba(115,218,202,0.1));
  border: 1px solid rgba(122,162,247,0.3);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.li-meeting-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.li-meeting-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(122,162,247,0.2);
  color: #7aa2f7;
}

.li-meeting-title {
  font-size: 14px;
  color: #c0caf5;
  font-weight: 500;
}

.li-start-meeting-btn {
  white-space: nowrap;
}

/* ════════════════════════════════════════
   12. Context-Aware Dictation Feedback
   ════════════════════════════════════════ */

/* Pulsing border on the targeted input during dictation */
.li-dictation-active {
  border-color: #f7768e !important;
  box-shadow: 0 0 0 2px rgba(247, 118, 142, 0.25) !important;
  animation: li-dictation-glow 1.5s ease-in-out infinite;
}

@keyframes li-dictation-glow {
  0%, 100% { box-shadow: 0 0 0 2px rgba(247, 118, 142, 0.25); }
  50% { box-shadow: 0 0 0 4px rgba(247, 118, 142, 0.1); }
}

/* Status indicator near the input */
.li-dictation-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11px;
  color: #f7768e;
  background: rgba(247, 118, 142, 0.08);
  border-radius: 12px;
  animation: li-pill-fadein 0.2s ease;
  position: absolute;
  top: -28px;
  left: 0;
  z-index: 10;
  pointer-events: none;
  white-space: nowrap;
}

.li-dictation-label {
  font-size: 11px;
  color: #f7768e;
  opacity: 0.8;
}

/* Audio level meter bar (inside dictation indicator) */
.li-level-bar {
  display: inline-block;
  height: 6px;
  min-width: 4px;
  max-width: 60px;
  border-radius: 3px;
  background: #9ece6a;
  transition: width 0.08s ease-out, background 0.15s;
  vertical-align: middle;
  margin-left: 4px;
}

/* Interim (unfinalized) text preview — hidden since text goes directly into input */
.li-interim-preview {
  display: none;
}

/* ════════════════════════════════════════
   7. Terminal Dictation Indicator
   ════════════════════════════════════════ */

.li-terminal-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  font-size: 11px;
  color: #f7768e;
  background: rgba(247, 118, 142, 0.06);
  border-bottom: 1px solid rgba(247, 118, 142, 0.15);
  animation: li-pill-fadein 0.2s ease;
  z-index: 5;
  flex-shrink: 0;
}

.li-terminal-indicator .li-interim-text {
  margin-left: auto;
  color: #565f89;
  font-style: italic;
  font-size: 11px;
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Terminal dictation input textarea — appears at bottom of terminal during dictation */
.li-terminal-dictation {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: #1a1b26;
  border: none;
  border-top: 2px solid #f7768e;
  color: #c0caf5;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  outline: none;
  flex-shrink: 0;
  min-height: 40px;
  max-height: 120px;
  box-sizing: border-box;
  animation: li-pill-fadein 0.2s ease;
}
.li-terminal-dictation::placeholder {
  color: #565f89;
  font-style: italic;
}
.li-terminal-dictation:focus {
  border-top-color: #9ece6a;
}

/* Toast notification */
.li-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #24283b;
  color: #c0caf5;
  border: 1px solid #3b4261;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  z-index: 99999;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  animation: li-toast-in 0.2s ease;
  pointer-events: none;
}

@keyframes li-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes li-toast-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Mobile touch feedback */
@media (pointer: coarse) {
  #global-mic-btn {
    width: 40px;
    height: 40px;
  }
  #global-mic-btn svg {
    width: 18px;
    height: 18px;
  }
}
