/* Input mode tabs */
.mode-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
  background: var(--bg-0);
  border-radius: var(--radius);
  padding: 4px;
}

.mode-tab {
  flex: 1;
  padding: 0.55rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  color: var(--fg-5);
  transition: all 0.2s;
  border: none;
  background: none;
}

.mode-tab.active {
  background: var(--bg-2);
  color: var(--fg-2);
}

.mode-tab:hover:not(.active) { color: var(--fg-4); }

.mode-panel { display: none; }
.mode-panel.active { display: block; }

/* File upload */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.upload-area:hover { border-color: var(--accent); background: var(--accent-subtle); }
.upload-area.has-file { border-color: var(--success); border-style: solid; }

.upload-area input[type="file"] { display: none; }

.upload-icon { font-size: 2rem; margin-bottom: 0.5rem; color: var(--fg-5); }
.upload-text { font-size: 0.9rem; color: var(--fg-4); }
.upload-filename { font-size: 0.85rem; color: var(--success); font-weight: 600; margin-top: 0.5rem; }

/* MP3 preview card (step 2 upload mode) */
.mp3-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-0);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
}

.mp3-preview-icon { font-size: 2.5rem; flex-shrink: 0; color: var(--accent); }
.mp3-preview .vp-title { font-weight: 600; font-size: 0.9rem; color: var(--fg-1); margin-bottom: 0.25rem; word-break: break-all; }
.mp3-preview .vp-duration { font-size: 0.8rem; color: var(--fg-4); }

/* Progress */
.progress-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-0);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--fg-5);
  transition: all 0.3s;
}

.progress-step.active {
  color: var(--fg-2);
  background: var(--accent-subtle);
  border: 1px solid var(--border);
}

.progress-step.done { color: var(--success); }
.progress-step.error { color: var(--danger); }

.progress-step .icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Download/Transcription progress detail */
.download-detail {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--bg-0);
  border-radius: var(--radius);
  display: none;
}

.download-detail.visible { display: block; }

.download-elapsed {
  font-size: 0.78rem;
  color: var(--fg-4);
  font-variant-numeric: tabular-nums;
}

.transcribe-detail {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--bg-0);
  border-radius: var(--radius);
  display: none;
}

.transcribe-detail.visible { display: block; }

.transcribe-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.transcribe-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.5s ease;
  width: 0%;
}

.transcribe-times {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--fg-4);
  font-variant-numeric: tabular-nums;
}

.hidden { display: none !important; }

/* AI Analysis Panel */
.analysis-progress-card { padding: 1.25rem 1.5rem; }

.analysis-progress-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-5);
  margin-bottom: 0.25rem;
}

.analysis-progress-steps { margin-top: 0.75rem; }

.btn-analyze { background: var(--info); color: white; }
.btn-analyze:hover { background: var(--info-hover); }
.btn-analyze:disabled { opacity: 0.5; cursor: not-allowed; }

.analysis-section { margin-bottom: var(--space-6); }
.analysis-section:last-child { margin-bottom: 0; }

.analysis-section-title {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-5);
  margin-bottom: var(--space-4);
}

/* Wizard step 5: cover choice */
.cover-options { display: flex; flex-direction: column; gap: var(--space-3); }

.cover-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--bg-1);
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
  transition: border-color 0.2s, background 0.2s;
}

.cover-option:hover { background: var(--bg-2); }
.cover-option:has(input:checked) { border-color: var(--fg-0); background: var(--bg-2); }
.cover-option input[type="radio"] { margin-top: 0.15rem; accent-color: var(--fg-0); flex-shrink: 0; }

.cover-option__body { display: flex; flex-direction: column; gap: 0.65rem; min-width: 0; flex: 1; }
.cover-option__label { font-size: 0.9rem; font-weight: 600; color: var(--fg-1); }

.cover-option__preview {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: var(--bg-0);
}

.cover-option__upload { margin: calc(-1 * var(--space-2)) 0 0 2.1rem; }
.cover-option__upload[hidden] { display: none; }
.cover-option__upload input[type="file"] {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg-1);
  color: var(--fg-4);
  font-size: 0.85rem;
  cursor: pointer;
}

.analysis-summary { font-size: 0.95rem; color: var(--fg-2); line-height: 1.65; }
