
/* Speakers panel — bottom-left, fills remaining height */
.speakers-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 60px;
  flex: 1;
}

.speakers-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
}

.speakers-panel-header h2 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.speakers-table-wrap {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.speakers-table-wrap::-webkit-scrollbar { width: 4px; }
.speakers-table-wrap::-webkit-scrollbar-track { background: transparent; }
.speakers-table-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.speakers-table {
  width: 100%;
  border-collapse: collapse;
}

.speakers-table thead th {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.5rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--surface);
  position: sticky;
  top: 0;
}

.speakers-table tbody tr {
  border-bottom: 1px solid rgba(42, 42, 50, 0.6);
  transition: background 0.1s;
}

.speakers-table tbody tr:hover { background: var(--surface2); }
.speakers-table tbody tr:last-child { border-bottom: none; }

.speakers-table td {
  padding: 0.55rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text);
  vertical-align: middle;
}

.speaker-row-swatch {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
  margin-right: 0.5rem;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.2);
  transition: transform 0.1s;
}
.speaker-row-swatch:hover { transform: scale(1.3); }
/* endregion */

/* region ── Speaker voice sample ─────────────────────────────────────────────── */
.sample-cell {
  min-width: 160px;
  max-width: 220px;
}

.sample-empty {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}

.sample-btn {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.05em;
  padding: 3px 7px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.sample-btn:hover { background: var(--surface2); color: var(--text); border-color: var(--muted); }
.sample-btn.rec-active { border-color: #ff4444; color: var(--danger); }
.sample-btn.rec-active:hover { background: rgba(255,68,68,0.1); }

.sample-waveform-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sample-play-btn {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 0.6rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.sample-play-btn:hover { background: var(--surface2); border-color: var(--muted); }

.sample-canvas-wrap {
  flex: 1;
  height: 28px;
  position: relative;
  cursor: pointer;
}
.sample-canvas-wrap canvas {
  display: block;
  width: 100%; height: 100%;
}
.sample-progress-line {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--accent);
  pointer-events: none;
  display: none;
}

.sample-remove-btn {
  flex-shrink: 0;
  font-size: 0.6rem;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 3px;
  border-radius: 2px;
  border: none;
  background: transparent;
  transition: color 0.1s;
}
.sample-remove-btn:hover { color: var(--danger); }

.speaker-del-btn {
  flex-shrink: 0;
  font-size: 0.65rem;
  color: var(--muted);
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 2px;
  border: none;
  background: transparent;
  transition: color 0.1s, background 0.1s;
  opacity: 0;
  line-height: 1;
}
tr:hover .speaker-del-btn { opacity: 1; }
.speaker-del-btn:hover { color: var(--danger); background: rgba(255,119,119,0.08); }
.speaker-del-btn:disabled { opacity: 0 !important; cursor: default; }

/* Segment picker overlay */

.seg-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.seg-picker-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 520px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
  font-family: var(--font-mono);
}

.seg-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.65rem;
  color: var(--muted);
  flex-shrink: 0;
}

.seg-picker-close {
  cursor: pointer; color: var(--muted); font-size: 0.9rem;
  background: none; border: none;
}
.seg-picker-close:hover { color: var(--text); }
.seg-picker-list {
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.seg-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(42,42,50,0.5);
  transition: background 0.1s;
}
.seg-picker-item:hover { background: var(--surface2); }
.seg-picker-speaker-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.seg-picker-speaker-name {
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
  width: 4.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.seg-picker-time {
  font-size: 0.58rem;
  color: var(--muted);
  flex-shrink: 0;
  white-space: nowrap;
}
.seg-picker-text {
  font-size: 0.65rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.seg-picker-play {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.5rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.12s;
}
.seg-picker-play:hover { border-color: var(--muted); color: var(--text); background: var(--surface2); }
.seg-picker-play.playing { border-color: var(--accent); color: var(--accent); }
