.transcribe-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.25rem;
  padding: 1.25rem;
}

.transcribe-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
}

.progress-ring {
  width: 112px;
  height: 112px;
  position: relative;
}

.progress-ring svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.progress-ring circle {
  fill: none;
  stroke-width: 5;
}

.progress-ring .ring-bg {
  stroke: rgba(91, 108, 255, 0.12);
}

.progress-ring .ring-fill {
  stroke: var(--primary);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.45s ease;
}

.progress-ring .ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.progress-ring .ring-percent {
  font-size: 1.375rem;
  font-weight: 650;
  color: var(--text-title);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.progress-ring .ring-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  max-width: 5.5rem;
  text-align: center;
  line-height: 1.2;
}

.progress-meta {
  margin: 0;
  font-size: 0.75rem;
  text-align: center;
  min-height: 1.1em;
  max-width: 11rem;
}

.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 28px;
}

.waveform span {
  width: 3px;
  background: var(--primary);
  border-radius: 2px;
  animation: wave 0.8s ease-in-out infinite;
}

.waveform span:nth-child(1) { animation-delay: 0s; height: 10px; }
.waveform span:nth-child(2) { animation-delay: 0.1s; height: 18px; }
.waveform span:nth-child(3) { animation-delay: 0.2s; height: 24px; }
.waveform span:nth-child(4) { animation-delay: 0.3s; height: 18px; }
.waveform span:nth-child(5) { animation-delay: 0.4s; height: 10px; }

@keyframes wave {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1); }
}

.transcribe-meta {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.transcribe-meta .timer {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-title);
  font-variant-numeric: tabular-nums;
}

.live-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: var(--text-muted);
}

.live-indicator.recording {
  background: var(--error);
  animation: pulse 1.2s infinite;
}

.live-indicator.paused {
  background: var(--warning);
}

.live-indicator.processing {
  background: var(--primary);
}

.transcribe-panel h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-title);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.live-badge {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--error);
  padding: 0.125rem 0.45rem;
  background: rgba(220, 38, 38, 0.08);
  border-radius: 6px;
}

.live-badge.is-paused {
  color: var(--text-muted);
  background: var(--hover-fill);
}

.live-preview-hint {
  margin: -0.5rem 0 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.waveform.is-paused span {
  animation-play-state: paused;
  opacity: 0.45;
}

.progress-ring.is-paused .ring-fill {
  opacity: 0.45;
}

.live-finalize-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.live-auto-nav-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.live-finalize-fail {
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(220, 38, 38, 0.22);
  background: rgba(220, 38, 38, 0.05);
}

.live-finalize-fail-msg {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--error);
  line-height: 1.5;
}

.transcript-display {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface-muted);
  padding: 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  line-height: 1.7;
  min-height: 200px;
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border);
  font-family: var(--font-sans);
}

.transcript-display.is-live {
  max-height: 420px;
}

.transcript-display.is-upload-placeholder {
  color: var(--text-muted);
}

.transcript-display.flash-update {
  animation: flashUpdate 0.35s ease-out;
}

@keyframes flashUpdate {
  0% { background: var(--primary-soft); }
  100% { background: var(--surface-muted); }
}

.live-pending {
  color: var(--primary);
  margin-top: 0.5rem;
  font-size: 0.8125rem;
}

.transcribe-live-controls {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.voice-activity-panel {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  background: var(--surface-muted, transparent);
}

.voice-activity-panel h4 {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
}

.voice-activity-panel ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .transcribe-layout {
    grid-template-columns: 1fr;
  }

  .transcribe-layout > * {
    min-width: 0;
  }

  .transcribe-progress {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }

  .transcribe-live-controls {
    width: 100%;
    min-width: 0;
  }

  .transcribe-live-controls .btn {
    flex: 1 1 auto;
    min-width: 0;
  }
}

.transcribe-dual {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.transcribe-dual.has-translate {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 900px) {
  .transcribe-dual.has-translate {
    grid-template-columns: 1fr;
  }
}

.transcribe-dual-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.translate-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}

.translate-pane-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
}

.live-tts-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.35rem;
}

.live-tts-auto-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  margin-right: 0.15rem;
}

.live-tts-controls .btn {
  padding: 0.15rem 0.45rem;
  font-size: 0.75rem;
}

.live-tts-hint {
  margin: 0 0 0.4rem;
  font-size: 0.7rem;
}

.translate-tab {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.translate-tab:hover {
  color: var(--text-title);
}

.translate-tab.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: rgba(91, 108, 255, 0.35);
}

.translate-pane.hidden {
  display: none;
}

.translate-status-line {
  margin-top: 0.35rem;
  min-height: 1.2em;
}

.translate-langs-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  font-size: 0.8125rem;
}

.translate-langs-checks label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
