/* Settings bar */
.settings-bar {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 40px;
}

.settings-bar details {
  margin-top: 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.settings-bar summary {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--fg-muted);
  font-family: var(--font-display);
  font-weight: 600;
  user-select: none;
  list-style: none;
}

.settings-bar summary::-webkit-details-marker { display: none; }

.settings-inner {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.settings-inner label {
  display: block;
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

.settings-note {
  color: var(--fg-muted);
  font-size: 0.78rem;
}

.settings-inner input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 10px 14px;
  font-size: 0.85rem;
  font-family: var(--font-body);
  border-radius: 4px;
  outline: none;
}

.settings-inner input:focus { border-color: var(--accent); }

/* App-specific styles for /app page — extends theme.css tokens */

.app-container {
  padding-top: 80px;
  max-width: 900px;
  margin: 0 auto;
  padding-bottom: 80px;
}

/* Generator Section */
.gen-section {
  padding: 60px 40px;
}

.gen-compact {
  padding: 32px 40px 0;
}

.gen-header {
  margin-bottom: 40px;
}

.gen-header .section-headline {
  margin-bottom: 12px;
}

.gen-sub {
  color: var(--fg-muted);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 560px;
}

.topic-form {
  max-width: 680px;
}

.topic-input-wrap {
  display: flex;
  gap: 12px;
}

.topic-input-wrap input {
  flex: 1;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 14px 18px;
  font-size: 1rem;
  font-family: var(--font-body);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s;
}

.topic-input-wrap input:focus {
  border-color: var(--accent);
}

.topic-input-wrap input::placeholder {
  color: var(--fg-muted);
}

.form-note {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-top: 10px;
}

/* Buttons */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 14px 28px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.2s;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.btn-primary:hover { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  padding: 12px 24px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.btn-secondary:hover {
  color: var(--fg);
  border-color: rgba(245, 240, 235, 0.2);
}

.btn-large { padding: 16px 36px; font-size: 1.05rem; }

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

/* Output Section */
.output-section { padding: 60px 40px; }

.output-header { margin-bottom: 48px; }

.pipeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  margin-bottom: 40px;
}

.pipeline-step {
  display: flex;
  gap: 24px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.pipeline-step:last-child { border-bottom: none; }

.step-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: all 0.3s;
}

.step-icon--pending {
  border: 1px solid var(--border);
  color: var(--fg-muted);
}

.step-icon--done {
  background: var(--accent);
  color: #fff;
  border: none;
}

.step-body { flex: 1; min-width: 0; }

.step-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--fg);
  margin-bottom: 4px;
}

.step-status {
  font-size: 0.82rem;
  color: var(--fg-muted);
}

.step-output {
  margin-top: 10px;
  padding: 14px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--fg-muted);
  white-space: pre-wrap;
  max-height: 160px;
  overflow-y: auto;
}

/* Footage grid */
.footage-grid {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.footage-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.footage-card-icon {
  color: var(--accent);
  display: flex;
  align-items: center;
}

.footage-card-label {
  font-size: 0.82rem;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--fg-muted);
}

/* Assembly progress */
.assembly-progress {
  margin-top: 12px;
}

.progress-bar {
  height: 4px;
  background: var(--bg-alt);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
  width: 0%;
}

.progress-text {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

/* Final output */
.final-output { margin-top: 32px; }

.success-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: 4px;
  margin-bottom: 24px;
}

.video-preview {
  width: 100%;
  max-width: 640px;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 24px;
}

.video-preview video {
  width: 100%;
  display: block;
}

.download-row {
  display: flex;
  gap: 14px;
  align-items: center;
}

/* Error output */
.error-output { margin-top: 24px; }

.error-banner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  font-size: 0.9rem;
  padding: 12px 18px;
  border-radius: 4px;
  margin-bottom: 16px;
}

/* Nav link */
.nav-link {
  font-size: 0.85rem;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-link:hover { color: var(--fg); }

/* Responsive */
@media (max-width: 768px) {
  .app-container { padding-top: 70px; }
  .gen-section, .output-section { padding: 40px 24px; }
  .topic-input-wrap { flex-direction: column; }
  .topic-input-wrap input { font-size: 1rem; }
  .btn-primary { width: 100%; justify-content: center; }
  .download-row { flex-direction: column; align-items: stretch; }
}