/* ============================================================
   AI CLIPPING PLATFORM — Production UI
   ============================================================ */

/* --- Reset & Design Tokens --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a12;
  --bg-elevated: #12121f;
  --bg-glass: rgba(18, 18, 31, 0.75);
  --bg-input: rgba(10, 10, 18, 0.6);
  --border: rgba(139, 92, 246, 0.2);
  --border-strong: rgba(139, 92, 246, 0.35);
  --text: #f1f5f9;
  --text-dim: #94a3b8;
  --text-muted: #475569;
  --accent: #8b5cf6;
  --accent-dim: rgba(139, 92, 246, 0.12);
  --success: #10b981;
  --success-dim: rgba(16, 185, 129, 0.12);
  --error: #ef4444;
  --error-dim: rgba(239, 68, 68, 0.12);
  --warning: #f59e0b;
  --gradient: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #a78bfa 100%);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 24px;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(139, 92, 246, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(99, 102, 241, 0.08) 0%, transparent 50%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 900px; margin: 0 auto; }

/* --- Loading Overlay --- */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 18, 0.92);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.4s ease;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.loading-spinner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.loading-spinner span { font-size: 14px; color: var(--text-dim); font-weight: 500; }
.spinner-ring {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Connection Badge --- */
.connection-badge {
  display: none !important;
  position: fixed;
  bottom: 20px;
  left: 20px;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  z-index: 100;
  transition: all var(--transition);
  user-select: none;
}
.connection-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--warning);
  transition: background var(--transition);
}
.connection-badge.connected .connection-dot { background: var(--success); box-shadow: 0 0 8px rgba(16,185,129,0.5); }
.connection-badge.disconnected .connection-dot { background: var(--error); box-shadow: 0 0 8px rgba(239,68,68,0.5); }
.connection-badge.connected { color: var(--success); }
.connection-badge.disconnected { color: var(--error); }

/* --- Header --- */
/* Marquee ticker banner */
.marquee-bar {
  overflow: hidden; white-space: nowrap;
  background: #000000;
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: 6px 0; font-size: 10px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: #ffffff;
}
.marquee-track {
  display: inline-flex; white-space: nowrap;
  animation: marquee-scroll 32s linear infinite;
}
.marquee-track span { white-space: nowrap; flex-shrink: 0; }
.marquee-track strong { color: #EAFF1E; }
@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.header { text-align: center; margin-bottom: 32px; padding: 28px 0; }
.header h1 {
  font-size: 42px; font-weight: 800;
  background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; letter-spacing: -1px;
}
.subtitle { color: var(--text-dim); font-size: 15px; margin-top: 10px; font-weight: 400; }

/* --- Input Section --- */
.input-section {
  background: var(--bg-glass); backdrop-filter: blur(20px); border-radius: var(--radius-lg);
  padding: 20px 24px; margin-bottom: 24px; border: 1px solid var(--border);
}
.input-wrapper { display: flex; gap: 12px; align-items: center; }
input[type="text"] {
  flex: 1; padding: 14px 18px; border-radius: var(--radius); border: 2px solid var(--border);
  background: var(--bg-input); color: var(--text); font-size: 15px; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,92,246,0.18); }
input[type="text"]::placeholder { color: var(--text-muted); }

button, .btn {
  padding: 14px 24px; border-radius: var(--radius); border: none; background: var(--gradient);
  color: white; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  white-space: nowrap;
}
button:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(139,92,246,0.35); }
button:active { transform: translateY(0); }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-icon { font-size: 18px; font-weight: 700; line-height: 1; }

.status-msg { font-size: 12px; color: var(--text-dim); margin-top: 10px; min-height: 18px; }
.status-msg:empty { display: none; }

/* --- Caption Options --- */
.caption-options,
.mode-toggle,
.hook-mode-toggle,
.ocr-toggle {
  display: flex; gap: 0;
  background: rgba(255,255,255,0.05);
  border-radius: 8px; padding: 3px;
  border: 1px solid rgba(255,255,255,0.06);
}
.caption-btn,
.mode-btn,
.hook-btn,
.ocr-btn {
  padding: 8px 18px; border-radius: 6px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  border: none; background: transparent; color: var(--text-dim);
  transition: all 0.2s ease; white-space: nowrap;
}
.caption-btn:hover,
.mode-btn:hover,
.hook-btn:hover,
.ocr-btn:hover { color: #e2e8f0; }

/* Orange — skip/warn/fast options */
.caption-btn--warn.active,
.mode-btn.active[data-mode="fast"],
.ocr-btn.active[data-mode="skip"],
.hook-btn.active[data-hook="skip"] {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

/* Purple — positive/keep options */
.caption-btn.active:not(.caption-btn--warn),
.ocr-btn.active[data-mode="keep"],
.hook-btn.active[data-hook="required"],
.mode-btn.active[data-mode="quality"] {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

/* --- Mode Toggle --- */
.options-row {
  display: flex; gap: 12px; align-items: center; margin-bottom: 14px;
  flex-wrap: wrap;
}

/* --- Stats Bar --- */
.stats-bar {
  display: flex; justify-content: center; gap: 24px; margin-bottom: 14px; padding: 12px 24px;
  background: var(--bg-glass); backdrop-filter: blur(20px); border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.stat { text-align: center; padding: 0 16px; position: relative; }
.stat:not(:last-child)::after {
  content: ''; position: absolute; right: -12px; top: 50%; transform: translateY(-50%);
  width: 1px; height: 32px; background: var(--border);
}
.stat-num {
  display: block; font-size: 32px; font-weight: 800;
  background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; line-height: 1;
}
.stat-label {
  font-size: 10px; color: var(--text-dim); text-transform: uppercase;
  letter-spacing: 1.5px; margin-top: 4px; font-weight: 600;
}

/* --- Job Cards --- */
.job-list { display: flex; flex-direction: column; gap: 8px; min-height: 120px; }

.job-card {
  background: var(--bg-glass); backdrop-filter: blur(20px); border-radius: var(--radius-lg);
  padding: 12px; border: 1px solid var(--border); transition: all var(--transition);
  position: relative; overflow: hidden;
  animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.job-card[data-status="DONE"] { border-color: rgba(16,185,129,0.3); }
.job-card[data-status="ERROR"] { border-color: rgba(239,68,68,0.3); }

.job-card-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 8px;
}
.card-title {
  font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; flex: 1; min-width: 0;
}
.card-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 6px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  white-space: nowrap; color: white; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.card-badge.badge-done {
  background: linear-gradient(135deg, #059669, #10b981) !important;
  border-color: rgba(16,185,129,0.3);
}
.card-badge.badge-error {
  background: linear-gradient(135deg, #dc2626, #ef4444) !important;
  border-color: rgba(239,68,68,0.3);
}
.delete-btn {
  width: auto; height: auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(239,68,68,0.06); border: 1px solid rgba(239,68,68,0.15); color: #f87171;
  border-radius: 6px; font-size: 10px; font-weight: 500; cursor: pointer;
  padding: 3px 8px; flex-shrink: 0; transition: all var(--transition);
}
.delete-btn:hover {
  background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.35); color: #fca5a5;
}
.delete-confirm-modal .modal-body p { color: #aaa9ba; font-size: 13px; margin: 0; }
.delete-confirm-modal .modal-body strong { color: #f5f3ff; }
.delete-confirm-modal .modal-footer { display: flex; gap: 8px; justify-content: flex-end; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.delete-cancel-btn { padding: 8px 16px; border-radius: 8px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); color: #aaa9ba; font-size: 12px; font-weight: 600; cursor: pointer; transition: all .2s; }
.delete-cancel-btn:hover { background: rgba(255,255,255,.08); color: #f5f3ff; }
.delete-confirm-btn { padding: 8px 16px; border-radius: 8px; border: none; background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; transition: all .2s; box-shadow: 0 2px 8px rgba(239,68,68,.3); }
.delete-confirm-btn:hover { filter: brightness(1.1); box-shadow: 0 4px 12px rgba(239,68,68,.4); }

/* --- Retry Controls --- */
.retry-controls { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.retry-btn {
  background: var(--accent-dim); border: 1px solid rgba(139,92,246,0.3); color: var(--accent);
  padding: 6px 12px; border-radius: var(--radius-sm); font-size: 12px; cursor: pointer;
  transition: all var(--transition); font-weight: 500;
}
.retry-btn:hover { background: rgba(139,92,246,0.25); border-color: rgba(139,92,246,0.5); }
.retry-full { background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.3); color: #fbbf24; }
.retry-full:hover { background: rgba(245,158,11,0.25); border-color: rgba(245,158,11,0.5); }

/* --- Timeline --- */
.timeline-container { display: flex; flex-direction: column; gap: 0; position: relative; }

/* Continuous vertical connector line */
.timeline-container::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: var(--border);
  opacity: 0.35;
  z-index: 0;
}

.timeline-stage {
  display: flex; gap: 14px; padding: 4px 0; transition: all var(--transition);
  border-radius: var(--radius-sm); position: relative;
}
.timeline-stage.active {
  background: rgba(255,255,255,0.025);
  padding: 4px 10px; margin: 0 -10px;
}

.timeline-marker { display: flex; flex-direction: column; align-items: center; width: 28px; flex-shrink: 0; position: relative; z-index: 1; }
.timeline-dot {
  width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; transition: all var(--transition); flex-shrink: 0;
  background: var(--bar-color, #1e293b); color: white; box-shadow: 0 0 8px rgba(0,0,0,0.3);
}
.timeline-stage.done .timeline-dot { background: #10b981; box-shadow: 0 0 10px rgba(16,185,129,0.35); }
.timeline-stage.active .timeline-dot {
  background: var(--stage-color, var(--accent));
  box-shadow: 0 0 16px color-mix(in srgb, var(--stage-color, var(--accent)) 50%, transparent);
  animation: dotPulse 1.5s infinite;
}
.timeline-stage.error .timeline-dot { background: #ef4444; box-shadow: 0 0 12px rgba(239,68,68,0.35); }

@keyframes dotPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.timeline-line { display: none; }

.timeline-content { flex: 1; min-width: 0; padding-bottom: 10px; }
.timeline-header { display: flex; align-items: center; gap: 8px; padding: 6px 0; flex-wrap: wrap; }
.timeline-icon { font-size: 18px; width: 24px; text-align: center; }
.timeline-label { font-size: 13px; font-weight: 700; letter-spacing: -0.2px; }
.timeline-stage.done .timeline-label { color: #10b981; }
.timeline-stage.active .timeline-label { color: var(--stage-color, var(--accent)); }
.timeline-stage.pending .timeline-label { color: var(--text-muted); }
.timeline-stage.error .timeline-label { color: #ef4444; }

.timeline-desc { font-size: 11px; color: var(--text-muted); font-weight: 400; flex: 1; min-width: 60px; }
.timeline-stage.pending .timeline-desc { color: var(--text-muted); opacity: 0.6; }

.timeline-status {
  font-size: 10px; font-weight: 600; display: flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 8px; white-space: nowrap;
}
.timeline-stage.done .timeline-status { color: #10b981; }
.timeline-stage.active .timeline-status { color: var(--stage-color, var(--accent)); }
.timeline-stage.pending .timeline-status { color: var(--text-muted); }
.timeline-stage.error .timeline-status { color: #ef4444; }

.pulsing-dot {
  width: 7px; height: 7px; border-radius: 50%; display: inline-block;
  animation: pulseDot 1s infinite;
}
@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
}

/* --- Stage Expanded Content --- */
.stage-expanded { padding: 6px 0 2px 0; animation: fadeInUp 0.25s ease; }
.stage-summary { font-size: 11px; color: var(--text-dim); padding: 2px 0; animation: fadeInUp 0.25s ease; }
.stage-status-msg { font-size: 12px; color: var(--text); font-weight: 500; margin-bottom: 6px; }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* Download progress */
.dl-bar-bg { height: 8px; background: rgba(59,130,246,0.1); border-radius: 4px; overflow: hidden; margin-bottom: 10px; }
.dl-bar-fill {
  height: 100%; background: linear-gradient(90deg, #3b82f6, #6366f1, #8b5cf6);
  border-radius: 4px; transition: width 0.4s; position: relative;
}
.dl-bar-shimmer {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  animation: shimmer 1.2s infinite;
}

.dl-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stat-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.dl-stat {
  text-align: center; padding: 8px 4px; background: rgba(10,10,18,0.5);
  border-radius: var(--radius-sm); border: 1px solid rgba(59,130,246,0.08);
}
.dl-stat-label {
  display: block; font-size: 8px; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 3px;
}
.dl-stat-value { display: block; font-size: 13px; font-weight: 700; color: #60a5fa; font-family: var(--font-mono); }
.dl-stat-wide { flex: 2; text-align: left; }

/* Multi-stage progress steps */
.multi-stage-steps {
  display: flex; gap: 2px; margin: 10px 0; padding: 6px 8px;
  background: rgba(10,10,18,0.4); border-radius: var(--radius-sm);
  overflow-x: auto; flex-wrap: wrap;
}
.multi-step {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 4px;
  font-size: 10px; color: var(--text-dim);
  background: rgba(255,255,255,0.03);
  white-space: nowrap; transition: all 0.3s;
}
.multi-step.active {
  color: #fff; background: rgba(139,92,246,0.2);
  border: 1px solid rgba(139,92,246,0.3);
}
.multi-step.done {
  color: #6ee7b7; background: rgba(16,185,129,0.1);
}
.step-icon { font-size: 11px; }
.step-label { font-weight: 600; }

/* Structured analyzer phases — live push list (kind, status, error) */
.analyzer-phases {
  display: flex; flex-direction: column; gap: 4px;
  margin: 10px 0; padding: 8px;
  background: rgba(10,10,18,0.4); border-radius: var(--radius-sm);
  max-height: 260px; overflow-y: auto;
}
.analyzer-phase {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 5px;
  font-size: 11px; color: var(--text-dim);
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  transition: all 0.25s ease;
}
.analyzer-phase.active {
  color: #fff; border-color: rgba(139,92,246,0.4);
  background: rgba(139,92,246,0.12);
  animation: pulsePhase 1.6s ease-in-out infinite;
}
.analyzer-phase.done { color: #6ee7b7; background: rgba(16,185,129,0.08); }
.analyzer-phase.skipped { color: #94a3b8; background: rgba(100,116,139,0.06); opacity: 0.75; }
.analyzer-phase.error { color: #fca5a5; background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); }
@keyframes pulsePhase {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139,92,246,0.0); }
  50% { box-shadow: 0 0 0 3px rgba(139,92,246,0.15); }
}
.ap-icon { font-size: 12px; width: 14px; text-align: center; flex-shrink: 0; }
.analyzer-phase.active .ap-icon { color: #a78bfa; }
.analyzer-phase.done .ap-icon { color: #34d399; }
.analyzer-phase.error .ap-icon { color: #ef4444; }
.ap-label { font-weight: 600; }
.ap-kind {
  margin-left: auto; flex-shrink: 0;
  font-size: 9px; font-weight: 700; letter-spacing: 0.4px;
  padding: 1px 5px; border-radius: 3px;
}
.ap-kind--llm { color: #a78bfa; background: rgba(139,92,246,0.15); }
.ap-kind--py { color: #60a5fa; background: rgba(59,130,246,0.15); }
.ap-error {
  flex-shrink: 0; max-width: 200px;
  font-size: 10px; color: #fca5a5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Reel group detail panel */
.reel-groups-container {
  margin-top: 10px; display: flex; flex-direction: column; gap: 8px;
}
.reel-group-detail {
  background: rgba(10,10,18,0.5); border: 1px solid rgba(59,130,246,0.1);
  border-radius: var(--radius-sm); padding: 10px; margin-top: 6px;
}
.reel-group-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  padding-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.reel-group-index {
  font-size: 10px; font-weight: 700; color: #8b5cf6;
  background: rgba(139,92,246,0.15); padding: 2px 6px; border-radius: 3px;
}
.reel-group-title {
  font-size: 12px; font-weight: 600; color: #e2e8f0; flex: 1;
}
.reel-group-duration {
  font-size: 11px; font-weight: 700; color: #60a5fa;
  font-family: var(--font-mono);
}
.reel-group-meta {
  margin-bottom: 8px;
}
.meta-field {
  font-size: 10px; color: var(--text-dim); margin: 2px 0;
  line-height: 1.4;
}
.meta-label {
  font-weight: 700; color: #94a3b8; margin-right: 4px;
}

/* Clips table */
.clips-section { margin-top: 6px; }
.section-label {
  font-size: 9px; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.clips-table {
  font-size: 10px; font-family: var(--font-mono);
}
.clip-row {
  display: grid; grid-template-columns: 28px 50px 50px 40px 1fr;
  gap: 4px; padding: 3px 4px; border-radius: 3px;
  align-items: center;
}
.clip-row:nth-child(even) { background: rgba(255,255,255,0.02); }
.clip-row.clip-header {
  font-weight: 700; color: var(--text-dim); font-size: 8px;
  text-transform: uppercase; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.clip-hook { background: rgba(245,158,11,0.08); }
.clip-hook .clip-num { color: #f59e0b; }
.clip-col { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip-start, .clip-end, .clip-dur { color: #60a5fa; }
.clip-reason { color: var(--text-dim); font-size: 9px; }

/* Narration events */
.narration-section { margin-top: 6px; }
.narration-event {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 4px 6px; border-radius: 3px; margin: 2px 0;
  font-size: 10px;
}
.narration-hook { background: rgba(245,158,11,0.08); }
.narration-commentary { background: rgba(59,130,246,0.05); }
.narration-icon { font-size: 12px; flex-shrink: 0; }
.narration-type {
  font-weight: 700; text-transform: capitalize; min-width: 60px;
  color: #94a3b8;
}
.narration-timing {
  font-family: var(--font-mono); color: #60a5fa; min-width: 70px;
}
.narration-text { color: var(--text-dim); flex: 1; }

/* Collapsible panels */
.collapsible-panel {
  margin-top: 8px; border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm); overflow: hidden;
}
.panel-header {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; cursor: pointer;
  background: rgba(10,10,18,0.4);
  font-size: 11px; font-weight: 600; color: var(--text-dim);
  transition: background 0.2s;
}
.panel-header:hover { background: rgba(10,10,18,0.6); }
.panel-icon { font-size: 12px; }
.panel-title { flex: 1; }
.panel-toggle {
  font-size: 9px; transition: transform 0.2s;
}
.collapsible-panel.expanded .panel-toggle { transform: rotate(180deg); }
.panel-body {
  display: none; padding: 8px 10px;
  background: rgba(10,10,18,0.3);
}
.collapsible-panel.expanded .panel-body { display: block; }

/* Structure analysis grid */
.structure-grid {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px;
}
.structure-grid .dl-stat { flex: 1; min-width: 80px; }

.units-list { margin-top: 4px; }
.unit-row {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 6px; border-radius: 3px; margin: 2px 0;
  font-size: 10px;
}
.unit-kept { background: rgba(16,185,129,0.05); }
.unit-dropped { background: rgba(239,68,68,0.05); opacity: 0.6; }
.unit-kept-badge { font-size: 10px; width: 14px; }
.unit-kept .unit-kept-badge { color: #10b981; }
.unit-dropped .unit-kept-badge { color: #ef4444; }
.unit-name { font-weight: 600; color: #e2e8f0; flex: 1; }
.unit-timing { font-family: var(--font-mono); color: #60a5fa; }
.unit-usable { font-family: var(--font-mono); color: var(--text-dim); }

/* Validation warnings */
.validation-warnings {
  margin-top: 8px; padding: 6px 10px;
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.15);
  border-radius: var(--radius-sm);
}
.validation-item {
  font-size: 10px; padding: 2px 0; color: var(--text-dim);
}
.validation-error { color: #fca5a5; }
.validation-warn { color: #fbbf24; }
.validation-info { color: #94a3b8; }

/* Dev panel */
.dev-panel .panel-body { padding: 0; }
.dev-data {
  font-size: 9px; font-family: var(--font-mono);
  color: var(--text-dim); padding: 8px 10px;
  margin: 0; max-height: 300px; overflow: auto;
  white-space: pre-wrap; word-break: break-all;
}

/* Generic stage progress bar */
.stage-progress-bg { height: 6px; background: rgba(255,255,255,0.05); border-radius: 3px; overflow: hidden; }
.stage-progress-fill { height: 100%; border-radius: 3px; transition: width 0.5s; position: relative; }
.stage-progress-shimmer {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  animation: shimmer 1.5s infinite;
}

/* Clip chips */
.clip-grid { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.clip-chip {
  display: flex; align-items: center; gap: 3px; padding: 3px 8px 3px 5px; border-radius: 16px;
  font-size: 10px; font-weight: 600; border: 1px solid transparent; transition: all var(--transition);
}
.clip-chip.clipping_done, .clip-chip.voicing_done, .clip-chip.captioning_done {
  background: rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.25); color: #6ee7b7;
}
.clip-chip.clipping, .clip-chip.voicing, .clip-chip.captioning {
  background: var(--accent-dim); border-color: rgba(139,92,246,0.25); color: #c4b5fd;
  animation: chipPulse 1s infinite;
}
.clip-chip.pending { background: rgba(71,85,105,0.15); border-color: rgba(71,85,105,0.15); color: #94a3af; }
@keyframes chipPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }
.chip-icon { font-size: 10px; }
.chip-progress { font-size: 9px; background: rgba(0,0,0,0.3); padding: 1px 4px; border-radius: 5px; }

/* --- Outputs Grid --- */
.outputs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 14px; }
.output-card {
  background: rgba(10, 10, 18, 0.5); border-radius: var(--radius); padding: 12px;
  border: 1px solid var(--border); transition: all var(--transition);
}
.output-card:hover { border-color: var(--accent); box-shadow: 0 0 16px rgba(139,92,246,0.15); }
.output-card video { width: 100%; border-radius: var(--radius-sm); max-height: 280px; background: #000; }
.output-meta { margin-top: 8px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.output-title { font-size: 13px; font-weight: 700; color: var(--text); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.output-duration {
  font-size: 11px; color: var(--text-dim); background: rgba(255,255,255,0.06);
  padding: 2px 7px; border-radius: 12px; white-space: nowrap; font-family: var(--font-mono);
}
.output-reasoning {
  font-size: 10px; color: var(--text-muted); margin-top: 6px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.download-btn {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 8px 16px;
  background: var(--gradient); color: white; border-radius: var(--radius-sm); text-decoration: none;
  font-size: 12px; font-weight: 600; transition: all var(--transition);
}
.download-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(16,185,129,0.35); }
.video-error { text-align: center; padding: 24px; color: var(--error); font-size: 13px; }

/* Placeholders for pending groups */
.outputs-grid.placeholders .output-card.placeholder { opacity: 0.6; }
.outputs-grid.placeholders .output-card.placeholder.active-group { opacity: 1; border-color: var(--accent); }
.placeholder-video {
  height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(10,10,18,0.4); border-radius: var(--radius-sm); border: 1px dashed var(--border);
}
.placeholder-icon { font-size: 32px; opacity: 0.3; margin-bottom: 6px; }
.placeholder-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-dim); background: rgba(139,92,246,0.1); padding: 3px 10px; border-radius: 10px;
}
.active-group .placeholder-badge { color: var(--accent); background: var(--accent-dim); }

/* --- Group Progress --- */
.group-progress-info {
  margin-top: 10px; padding: 8px 12px; background: var(--accent-dim);
  border: 1px solid rgba(139,92,246,0.15); border-radius: var(--radius-sm);
  font-size: 11px; color: var(--text-dim); display: flex; gap: 10px;
}
.group-count { font-weight: 600; color: var(--accent); }
.current-group { color: var(--text); }

/* --- Error --- */
.timeline-error {
  margin-top: 12px; padding: 12px 16px; background: var(--error-dim);
  border: 1px solid rgba(239,68,68,0.25); border-radius: var(--radius);
  color: #fca5a5; font-size: 12px; line-height: 1.5;
}

/* --- Empty State --- */
.empty-state { text-align: center; padding: 56px 20px; color: var(--text-dim); }
.empty-state-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.35; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.empty-state p { font-size: 14px; max-width: 320px; margin: 0 auto; line-height: 1.6; }

/* --- Footer --- */
.footer { text-align: center; margin-top: 40px; padding: 16px; color: var(--text-muted); font-size: 11px; }
.mono { font-family: var(--font-mono); }

/* --- Toast --- */
.toast-container { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; }
.toast {
  padding: 10px 16px; background: rgba(18,18,31,0.92); backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 10px;
  color: var(--text); font-size: 12px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: toastIn 0.3s cubic-bezier(0.4,0,0.2,1); display: flex; align-items: center; gap: 10px; max-width: 320px;
}
.toast-icon {
  width: 22px; height: 22px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.toast.success { border-color: rgba(16,185,129,0.25); }
.toast.success .toast-icon { background: rgba(16,185,129,0.15); color: #34d399; }
.toast.error { border-color: rgba(239,68,68,0.25); }
.toast.error .toast-icon { background: rgba(239,68,68,0.15); color: #f87171; }
.toast.warn { border-color: rgba(245,158,11,0.25); }
.toast.warn .toast-icon { background: rgba(245,158,11,0.15); color: #fbbf24; }
.toast.info { border-color: rgba(139,92,246,0.25); }
.toast.info .toast-icon { background: rgba(139,92,246,0.15); color: #a78bfa; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.toast.fade-out { animation: toastOut 0.2s forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px) scale(0.96); } }

/* --- Modal --- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
  background: #1a1a2e; border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  width: 90vw; max-width: 800px; max-height: 85vh; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: modalSlideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.modal-header span { font-size: 14px; font-weight: 700; color: var(--text); }
.modal-close-btn {
  background: var(--error-dim); border: 1px solid rgba(239,68,68,0.2); color: #fca5a5;
  padding: 4px 10px; border-radius: var(--radius-sm); font-size: 13px; cursor: pointer;
  transition: all var(--transition);
}
.modal-close-btn:hover { background: rgba(239,68,68,0.3); color: #ff7373; }
.modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.modal-body pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
.modal-body code { font-family: var(--font-mono); font-size: 12px; line-height: 1.6; color: #e2e8f0; }

/* --- Delete Confirmation Modal --- */
.confirm-modal .modal-content { max-width: 420px; }
.confirm-modal .modal-body { padding: 24px 18px; text-align: center; }
.confirm-modal .confirm-icon { font-size: 36px; margin-bottom: 12px; }
.confirm-modal .confirm-text { font-size: 14px; color: var(--text); margin-bottom: 6px; }
.confirm-modal .confirm-sub { font-size: 12px; color: var(--text-dim); margin-bottom: 20px; }
.confirm-modal .confirm-actions { display: flex; gap: 10px; justify-content: center; }
.confirm-modal .confirm-cancel {
  background: rgba(71,85,105,0.2); border: 1px solid rgba(71,85,105,0.3); color: var(--text-dim);
}
.confirm-modal .confirm-cancel:hover { background: rgba(71,85,105,0.35); transform: none; box-shadow: none; }
.confirm-modal .confirm-delete {
  background: rgba(239,68,68,0.2); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5;
}
.confirm-modal .confirm-delete:hover { background: rgba(239,68,68,0.4); box-shadow: 0 4px 16px rgba(239,68,68,0.2); }

/* --- Modern LLM Log --- */
.llm-log-section {
  margin-top: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
}
.llm-log-section.expanded { border-color: var(--border-strong); }

.llm-log-header {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  cursor: pointer; user-select: none; transition: background 0.2s;
  background: rgba(139, 92, 246, 0.04);
}
.llm-log-header:hover { background: rgba(139, 92, 246, 0.08); }
.llm-log-title { font-size: 12px; font-weight: 700; color: var(--accent); flex: 1; letter-spacing: -0.2px; }
.llm-log-count {
  font-size: 9px; color: var(--text-dim); background: var(--accent-dim);
  padding: 2px 8px; border-radius: 6px; font-weight: 600; margin-left: auto;
}
.llm-log-vad-count {
  font-size: 9px; color: #10b981; background: rgba(16,185,129,0.1);
  padding: 2px 8px; border-radius: 6px; font-weight: 600;
}
.llm-log-toggle { font-size: 10px; color: var(--text-muted); transition: transform 0.3s; cursor: pointer; padding: 2px 6px; }
.llm-log-toggle:hover { color: var(--accent); }
.llm-log-section.expanded .llm-log-toggle { transform: rotate(180deg); }

.llm-log-body {
  max-height: 0; overflow-y: auto; transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 14px;
}
.llm-log-section.expanded .llm-log-body { max-height: 700px; padding: 10px 14px 14px; }
.llm-log-body::-webkit-scrollbar { width: 5px; }
.llm-log-body::-webkit-scrollbar-track { background: transparent; }
.llm-log-body::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.2); border-radius: 4px; }

.llm-log-empty {
  text-align: center; padding: 24px 10px; color: var(--text-muted);
  font-size: 11px; font-style: italic;
}

/* LLM interaction cards */
.llm-card {
  margin-top: 6px; padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 11px; line-height: 1.5; animation: fadeInUp 0.2s ease;
  border: 1px solid rgba(255,255,255,0.05); background: rgba(255,255,255,0.02);
  transition: border-color 0.2s;
}
.llm-card:first-child { margin-top: 2px; }
.llm-card:hover { border-color: rgba(255,255,255,0.1); }

.llm-card.user-card { border-left: 3px solid #60a5fa; }
.llm-card.system-card { border-left: 3px solid #64748b; background: rgba(100,116,139,0.04); }
.llm-card.assistant-card { border-left: 3px solid #10b981; background: rgba(16,185,129,0.03); }
.llm-card.error-card { border-left: 3px solid #ef4444; background: rgba(239,68,68,0.04); }
.llm-card.retry-card { border-left: 3px solid #f59e0b; background: rgba(245,158,11,0.04); text-align: center; }
.llm-card.streaming-card {
  border-left: 3px solid #f59e0b; background: rgba(245,158,11,0.03);
  animation: streamingGlow 2s infinite;
}
@keyframes streamingGlow {
  0%, 100% { border-left-color: rgba(245,158,11,0.4); }
  50% { border-left-color: rgba(245,158,11,0.7); }
}

.llm-card-header {
  display: flex; align-items: center; gap: 6px; margin-bottom: 5px; flex-wrap: wrap;
}
.llm-card-label { font-weight: 600; color: var(--text); }
.llm-timestamp { font-size: 9px; color: var(--text-muted); font-family: var(--font-mono); }

.llm-role-badge {
  font-size: 9px; font-weight: 700; padding: 2px 8px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.system-role { color: #94a3b8; background: rgba(100,116,139,0.12); }
.user-role { color: #60a5fa; background: rgba(96,165,250,0.1); }
.assistant-role { color: #34d399; background: rgba(16,185,129,0.1); }
.error-role { color: #f87171; background: rgba(239,68,68,0.1); }
.retry-role { color: #fbbf24; background: rgba(245,158,11,0.1); }
.streaming-role { color: #fbbf24; background: rgba(245,158,11,0.08); }
.vad-role { color: #34d399; background: rgba(16,185,129,0.1); }

.llm-badge {
  font-size: 8px; font-weight: 600; padding: 2px 7px; border-radius: 4px;
  font-family: var(--font-mono); letter-spacing: 0.2px;
}
.model-badge { color: var(--text-dim); background: rgba(255,255,255,0.06); }
.token-badge { color: #34d399; background: rgba(16,185,129,0.08); }
.error-badge { color: #f87171; background: rgba(239,68,68,0.1); }
.retry-badge { color: #fbbf24; background: rgba(245,158,11,0.08); }
.stage-badge { border: 1px solid; }

.llm-card-body {
  font-size: 11px; color: var(--text-dim); word-break: break-word; white-space: pre-wrap;
}
.llm-card.assistant-card .llm-card-body { color: #a7f3d0; }
.llm-card.error-card .llm-card-body { color: #fca5a5; }
.llm-card.retry-card .llm-card-body { color: #fde68a; font-style: italic; }
.llm-card.streaming-card .llm-card-body { color: #fde68a; font-style: italic; }

.llm-card-actions { margin-top: 6px; }
.llm-view-full {
  font-size: 10px; color: var(--accent); background: var(--accent-dim);
  border: 1px solid rgba(139,92,246,0.2); padding: 3px 10px; border-radius: 6px;
  cursor: pointer; transition: all 0.2s; font-weight: 600;
}
.llm-view-full:hover { background: rgba(139,92,246,0.2); border-color: rgba(139,92,246,0.4); }

/* VAD badge & analysis */
.vad-badge-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.vad-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.3px; white-space: nowrap;
  cursor: help; transition: all 0.2s; position: relative;
}
.vad-badge.vad-active {
  background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7;
}
.vad-badge.vad-active:hover { background: rgba(16,185,129,0.2); box-shadow: 0 0 10px rgba(16,185,129,0.15); }
.vad-badge.vad-done {
  background: rgba(16,185,129,0.06); border: 1px solid rgba(16,185,129,0.18); color: #6ee7b7;
}
.vad-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #10b981; display: inline-block;
  animation: vadPulse 2s infinite;
}
@keyframes vadPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
  50% { box-shadow: 0 0 0 3px rgba(16,185,129,0); }
}
.vad-check { font-size: 11px; font-weight: 800; }
.vad-segments-count { font-size: 10px; color: var(--text-dim); font-weight: 500; }
.vad-detail { font-size: 9px; color: var(--text-muted); font-style: italic; }

.vad-analysis-section { margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid rgba(16,185,129,0.12); }
.vad-analysis-header { font-size: 10px; font-weight: 700; color: #34d399; padding: 4px 0; text-transform: uppercase; letter-spacing: 0.5px; }
.vad-card { border-left: 3px solid rgba(16,185,129,0.3) !important; background: rgba(16,185,129,0.03) !important; }
.vad-card .llm-card-body { color: #a7f3d0; }
.vad-card .llm-card-body strong { color: #34d399; }

/* --- Stage Progress Row (percentage label) --- */
.stage-progress-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.stage-progress-row .stage-progress-bg { flex: 1; }
.stage-progress-pct { font-size: 12px; font-weight: 800; font-family: var(--font-mono); min-width: 36px; text-align: right; }

/* --- Group indicator --- */
.group-indicator {
  font-size: 9px; font-weight: 700; color: var(--accent); background: var(--accent-dim);
  padding: 1px 6px; border-radius: 4px; margin-left: 4px; vertical-align: middle;
}
.group-badge {
  font-size: 9px; font-weight: 700; color: var(--accent); background: var(--accent-dim);
  padding: 2px 7px; border-radius: 5px; margin-left: 4px; letter-spacing: 0.3px;
}

/* --- Output Summary Card (in timeline done) --- */
.output-summary-card {
  margin-top: 6px; padding: 8px 10px; background: rgba(139,92,246,0.04);
  border: 1px solid rgba(139,92,246,0.12); border-radius: var(--radius-sm);
}
.summary-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 2px 0; font-size: 11px;
}
.summary-label { color: var(--text-dim); font-weight: 500; }
.summary-value { color: var(--accent); font-weight: 700; font-family: var(--font-mono); }
.summary-group {
  padding: 4px 0; border-top: 1px solid rgba(255,255,255,0.04); margin-top: 4px;
}
.summary-group:first-child { border-top: none; margin-top: 0; }
.summary-group-title { font-size: 11px; font-weight: 600; color: var(--text); display: block; }
.summary-group-meta { font-size: 10px; color: var(--text-dim); font-family: var(--font-mono); }
.summary-desc { font-size: 10px; color: var(--text-dim); line-height: 1.4; margin-top: 3px; }
.desc-key { font-weight: 700; color: var(--text-muted); }

/* --- Output Summary Drawer (in LLM log) --- */
.output-summary-drawer {
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.output-summary-header {
  display: flex; align-items: center; gap: 6px; padding: 4px 0; margin-bottom: 6px;
}
.summary-icon { font-size: 14px; }
.summary-title { font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px; }
.output-summary-body { }
.summary-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.summary-pill {
  font-size: 10px; font-weight: 600; padding: 3px 10px; border-radius: 12px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); color: var(--text-dim);
}
.summary-pill.genre-pill { border: 1px solid; }
.summary-group-row {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px; margin-top: 4px;
  background: rgba(255,255,255,0.02); border-radius: 6px; border: 1px solid rgba(255,255,255,0.04);
}
.summary-group-idx {
  font-size: 10px; font-weight: 800; color: var(--accent); background: var(--accent-dim);
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; flex-shrink: 0;
}
.summary-group-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.summary-group-title { font-size: 11px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary-group-meta { font-size: 9px; color: var(--text-dim); font-family: var(--font-mono); }

/* --- Profile Dropdown --- */
.profile-dropdown {
  display: none;
  position: absolute;
  top: 56px;
  right: 0;
  width: 260px;
  background: rgba(18, 18, 31, 0.97);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04);
  z-index: 1100;
  animation: dropdownIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  flex-shrink: 0;
}
.profile-dropdown.open { display: block; }
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.profile-dropdown-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
}
.profile-avatar-lg {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.profile-email {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-label {
  font-size: 11px;
  color: var(--text-muted);
}
.profile-dropdown-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 0;
}
.profile-dropdown-items {
  display: flex;
  flex-direction: column;
  padding: 6px;
}
.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  min-height: 44px;
  border-radius: 8px;
}
.profile-dropdown-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
}
.profile-dropdown-danger {
  color: #f87171;
}
.profile-dropdown-danger:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
}
.profile-dropdown-icon {
  font-size: 15px;
  width: 20px;
  text-align: center;
}

/* --- Touch-Friendly Targets --- */
@media (pointer: coarse) {
  button, a, [role="button"] {
    min-height: 44px;
    min-width: 44px;
  }
  .delete-btn { min-height: 0; min-width: 0; }
  .studio-details-toggle { min-height: 0; min-width: 0; }
  .caption-btn, .mode-btn, .hook-btn { min-height: 0; min-width: 0; }
  .nav-toggle-btn { min-height: 38px; padding: 8px 20px; }
  .caption-btn, .mode-btn, .hook-btn, .ocr-btn { padding: 10px 16px; }
}

/* --- Responsive --- */
@media (max-width: 600px) {
  body { padding: 6px; }

  /* Header - compact */
  .header { padding: 0 0 2px; margin-bottom: 2px; }
  .studio-nav { border-bottom: 1px solid rgba(255,255,255,.06); padding-top: 0 !important; }
  .nav-top-row { height: 36px; padding: 0 2px; }
  .studio-brand { font-size: 12px; gap: 4px; }
  .brand-mark--small { width: 20px; height: 20px; padding: 3px; }
  .brand-mark--small span { width: 2px; }
  .brand-mark--small span:nth-child(1) { height: 4px; }
  .brand-mark--small span:nth-child(2) { height: 9px; }
  .brand-mark--small span:nth-child(3) { height: 6px; }

  .brand-text { font-size: 12px; }
  .nav-right { gap: 4px; }
  .token-display { flex-direction: row; gap: 4px; align-items: baseline; }
  .token-label { font-size: 8px; }
  .token-value { font-size: 12px; }
  .account-avatar { width: 22px; height: 22px; font-size: 8px; overflow: hidden; }

  /* Full-width nav toggle */
  .nav-full-toggle { padding: 0 0 6px; }
  .studio-nav-toggle { padding: 2px; border-radius: 8px; gap: 2px; }
  .nav-toggle-btn { padding: 6px 10px; min-height: 36px; gap: 6px; border-radius: 6px; }
  .nav-toggle-icon { font-size: 13px; width: 20px; }
  .nav-toggle-title { font-size: 11px; }
  .nav-toggle-desc { font-size: 8px; }

  /* Hero */
  .studio-hero { padding: 0 0 4px; }
  .studio-hero h1 { font-size: clamp(18px, 7vw, 26px); line-height: 1.05; margin-top: 0; }
  .studio-hero .eyebrow { font-size: 7px; }

  /* Input section - override lime theme large padding */
  .input-section { padding: 8px !important; border-radius: 8px; margin-bottom: 6px; }
  .queue-heading { margin-bottom: 4px !important; }
  .queue-heading h2 { font-size: 13px; margin-top: 0; }
  .eyebrow { font-size: 7px; letter-spacing: 0.08em; }
  .cost-preview { padding: 3px 6px; font-size: 8px; border-radius: 4px; width: 100%; }
  .input-wrapper { display: flex; flex-direction: row; gap: 4px; align-items: stretch; }
  .input-wrapper input { flex: 1; min-width: 0; padding: 8px 10px; font-size: 13px; border-radius: 8px; }
  .input-wrapper button { flex-shrink: 0; width: auto; min-width: 60px; padding: 8px 12px; border-radius: 8px; font-size: 12px; }
  .duration-rule { font-size: 8px; margin-top: 3px; }

  /* Options row - compact, wrap */
  .options-row { gap: 3px; margin-bottom: 4px; flex-wrap: wrap; }
  .caption-options, .hook-mode-toggle, .mode-toggle {
    padding: 1px;
    border-radius: 4px;
  }
  .caption-btn, .mode-btn, .hook-btn {
    padding: 3px 5px;
    font-size: 8px;
    min-height: 24px;
    border-radius: 3px;
  }

  /* Stats bar - override lime theme */
  .stats-bar { gap: 0; padding: 6px !important; border-radius: 8px; margin-bottom: 6px; }
  .stat { padding: 0 8px; min-width: 0; flex: 1; text-align: center; }
  .stat:not(:last-child)::after { display: none; }
  .stat-num { font-size: 16px; }
  .stat-label { font-size: 6px; letter-spacing: 0.8px; }

  /* Job cards - override lime theme */
  .job-card { padding: 8px !important; border-radius: 8px !important; }
  .job-card-header { flex-wrap: wrap; gap: 4px; margin-bottom: 4px !important; }
  .card-title { font-size: 11px; }
  .card-badge { font-size: 8px; padding: 2px 6px !important; border-radius: 4px !important; min-height: auto !important; }
  .delete-btn { width: 22px !important; height: 22px !important; border-radius: 4px !important; font-size: 10px !important; padding: 0 !important; }
  .timeline-collapse-btn { font-size: 9px !important; padding: 2px 8px !important; border-radius: 4px !important; }

  /* Download stats */
  .dl-stats { grid-template-columns: repeat(2, 1fr); gap: 3px; }
  .stat-grid-3 { grid-template-columns: repeat(2, 1fr); gap: 3px; }
  .dl-stat { padding: 4px 3px; border-radius: 4px; }
  .dl-stat-label { font-size: 6px; margin-bottom: 1px; }
  .dl-stat-value { font-size: 9px; }

  /* Timeline */
  .timeline-header { gap: 2px; padding: 2px 0; }
  .timeline-icon { font-size: 11px; width: 16px; }
  .timeline-label { font-size: 10px; }
  .timeline-desc { display: none; }
  .timeline-marker { width: 18px; }
  .timeline-dot { width: 18px; height: 18px; font-size: 8px; }
  .timeline-ticks { padding-left: 38px; font-size: 6px; }
  .timeline-canvas-panel .track-label { width: 44px; font-size: 7px; }
  .timeline-canvas-panel .timeline-ticks { padding-left: 50px; }

  /* Outputs */
  .outputs-grid { grid-template-columns: 1fr; gap: 4px; }
  .output-card { padding: 6px; border-radius: 6px; }
  .output-title { font-size: 10px; }
  .download-btn { padding: 4px 8px; font-size: 9px; border-radius: 5px; }

  /* Connection badge */
  .connection-badge { bottom: 4px; left: 4px; font-size: 8px; padding: 3px 6px; border-radius: 10px; }

  /* Toast */
  .toast-container { bottom: 4px; right: 4px; left: 4px; }
  .toast { max-width: 100%; padding: 6px 8px; font-size: 10px; border-radius: 6px; }

  /* Auth card */
  .auth-card { padding: 16px 12px; border-radius: 12px; }
  .auth-card h1 { font-size: clamp(22px, 6vw, 28px); margin: 6px 0 8px; }
  .auth-copy { font-size: 11px; margin-bottom: 12px; }
  .google-login { padding: 10px; border-radius: 8px; font-size: 12px; }
  .brand-mark { width: 32px; height: 32px; padding: 5px; margin-bottom: 12px; }

  /* Billing */
  .billing-panel { padding: 8px; border-radius: 8px; }
  .billing-panel h2 { font-size: 13px; }
  .pricing-grid { grid-template-columns: 1fr; gap: 6px; }
  .price-card { min-height: 90px; padding: 8px; border-radius: 8px; }
  .price-card strong { font-size: 20px; margin: 6px 0 3px; }

  /* Reel studio */
  .reel-studio-card { padding: 8px; border-radius: 8px; }
  .player-916-frame { max-height: 200px; border-radius: 8px; }
  .studio-panel-layout { flex-direction: column; gap: 0; }
  .studio-reel-title { font-size: 12px; }
  .studio-tab { padding: 3px 10px; font-size: 10px; border-radius: 4px; }

  /* Audience worth */
  .ra-card { padding: 8px; border-radius: 8px; }
  .ra-score-stage { grid-template-columns: 1fr; gap: 8px; padding: 8px; border-radius: 8px; }
  .ra-score-num { font-size: 24px; }
  .ra-metrics { grid-template-columns: 1fr; }
  .ra-status { display: none; }

  /* Multi-stage steps */
  .multi-stage-steps { overflow-x: auto; flex-wrap: nowrap; padding: 3px 4px; border-radius: 4px; }
  .multi-step { padding: 2px 5px; font-size: 7px; border-radius: 3px; }

  /* Modal */
  .modal-content { width: 95vw; max-height: 85vh; border-radius: 10px; }
  .modal-body { padding: 6px; }

  /* Trust strip hidden */
  .trust-strip { display: none; }

  /* Profile dropdown */
  .profile-dropdown { width: 200px; right: -2px; top: 36px; }
  .profile-dropdown-header { padding: 8px; }
  .profile-avatar-lg { width: 28px; height: 28px; font-size: 11px; }
  .profile-email { font-size: 10px; }

  /* Empty state */
  .empty-state { padding: 16px 10px; }
  .empty-state-icon { font-size: 28px; margin-bottom: 6px; }
  .empty-state p { font-size: 11px; }

  /* Footer */
  .footer { margin-top: 10px; padding: 6px; font-size: 8px; }
}

/* --- Very Small Phones --- */
@media (max-width: 380px) {
  .studio-brand { font-size: 11px; }
  .nav-toggle-btn { padding: 3px 7px; font-size: 9px; }
  .account-avatar { width: 20px; height: 20px; font-size: 8px; overflow: hidden; }
  .stat-num { font-size: 14px; }
  .dl-stat-value { font-size: 8px; }
  .clip-row { grid-template-columns: 16px 28px 28px 20px 1fr; font-size: 6px; }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Final studio controls: white selection state with violet input focus. */
.caption-btn.active,
.mode-btn.active,
.caption-btn--warn.active,
.mode-btn.active[data-mode="fast"],
.ocr-btn.active[data-mode="skip"],
.hook-btn.active[data-hook="skip"] {
  background: #ffffff !important;
  color: #1c1830 !important;
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.14) !important;
}
.caption-btn.active[data-value="true"],
.mode-btn.active[data-mode="quality"] {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.4) !important;
}

input[type="text"],
.input-wrapper input {
  border-color: rgba(139, 92, 246, 0.48) !important;
}

input[type="text"]:focus,
.input-wrapper input:focus {
  border-color: #8b5cf6 !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2) !important;
}

/* --- Auth, token, and billing surfaces --- */
.app-shell { max-width: 1120px; }
.auth-view { min-height: calc(100vh - 48px); display: grid; place-items: center; position: relative; overflow: hidden; isolation: isolate; }
.auth-view[hidden], .app-shell[hidden], .billing-panel[hidden] { display: none; }
.auth-aurora { position: fixed; border-radius: 50%; filter: blur(3px); pointer-events: none; z-index: -1; animation: authFloat 12s ease-in-out infinite; }
.auth-aurora--one { width: min(58vw, 760px); aspect-ratio: 1; left: -15vw; top: -18vw; background: radial-gradient(circle, rgba(121, 75, 255, .28), transparent 67%); }
.auth-aurora--two { width: min(52vw, 680px); aspect-ratio: 1; right: -15vw; bottom: -22vw; background: radial-gradient(circle, rgba(47, 118, 255, .18), transparent 66%); animation-delay: -5s; }
@keyframes authFloat { 50% { transform: translate3d(4vw, 3vh, 0) scale(1.07); } }
.auth-card { width: min(100%, 490px); padding: 46px; text-align: center; background: linear-gradient(145deg, rgba(26, 25, 45, .92), rgba(12, 12, 22, .88)); border: 1px solid rgba(183, 160, 255, .22); border-radius: 28px; box-shadow: 0 30px 100px rgba(0, 0, 0, .5), inset 0 1px rgba(255,255,255,.08); animation: authEnter .7s cubic-bezier(.2,.8,.2,1); }
@keyframes authEnter { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.brand-mark { width: 46px; height: 46px; padding: 8px; margin: 0 auto 26px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; border-radius: 14px; background: linear-gradient(140deg, #9d79ff, #5635cb); box-shadow: 0 10px 28px rgba(109, 72, 235, .4); }
.brand-mark span { display: block; width: 5px; border-radius: 4px; background: #fff; transform-origin: bottom; }
.brand-mark span:nth-child(1) { height: 11px; }.brand-mark span:nth-child(2) { height: 22px; }.brand-mark span:nth-child(3) { height: 15px; }
.eyebrow { font-size: 10px; font-weight: 800; letter-spacing: .17em; color: #ad9aff; text-transform: uppercase; }
.eyebrow--white { color: #F7F7F2 !important; }
.eyebrow--grey { color: #9899ad !important; }
.eyebrow--grey strong { color: #F7F7F2 !important; }
.eyebrow--right { text-align: right; justify-content: flex-end; }
.auth-card h1, .studio-hero h1 { margin: 13px 0 15px; color: #fafaff; font-size: clamp(36px, 5vw, 52px); line-height: .98; letter-spacing: -.065em; background: none; -webkit-text-fill-color: initial; }
.auth-card h1 em, .studio-hero h1 em { color: #a98cff; font-family: Georgia, serif; font-weight: 400; }
.auth-copy { max-width: 360px; margin: 0 auto 28px; color: #a6a7ba; font-size: 14px; line-height: 1.65; }
.google-login { width: 100%; display: flex; gap: 12px; justify-content: center; align-items: center; padding: 15px; color: #171720; background: #fff; border: 1px solid #e7e7ef; border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .22); }
.google-login:hover { background: #fafafa; box-shadow: 0 11px 28px rgba(0,0,0,.3); }.google-login svg { width: 19px; height: 19px; }
.login-error { min-height: 20px; margin-top: 13px; color: #ff9b9b; font-size: 12px; }.auth-trust { display: flex; justify-content: center; gap: 14px; margin-top: 27px; color: #74758a; font-size: 10px; }.auth-trust span + span { border-left: 1px solid #39394b; padding-left: 14px; }.auth-legal { position: absolute; bottom: 12px; color: #66677c; font-size: 10px; }
/* --- Header & Nav --- */
.header { padding: 4px 0 12px; margin: 0; text-align: left; }
.studio-nav { position: relative; border-bottom: 1px solid rgba(255,255,255,.08); }
.nav-top-row { display: flex; align-items: center; justify-content: space-between; height: 58px; padding: 0 4px; }
.studio-brand { display: inline-flex; align-items: center; gap: 10px; color: #f7f5ff; font-size: 15px; font-weight: 800; text-decoration: none; letter-spacing: .06em; white-space: nowrap; }
.brand-text { white-space: nowrap; }
.brand-mark--small { width: 28px; height: 28px; padding: 5px; margin: 0; gap: 2px; border-radius: 8px; flex-shrink: 0; }
.brand-mark--small span { width: 3px; }
.brand-mark--small span:nth-child(1) { height: 7px; }
.brand-mark--small span:nth-child(2) { height: 14px; }
.brand-mark--small span:nth-child(3) { height: 10px; }
.nav-right { display: flex; align-items: center; gap: 12px; }
.token-display { display: flex; flex-direction: column; align-items: flex-end; gap: 0; line-height: 1.2; }
.token-label { font-size: 10px; color: #858699; font-weight: 500; letter-spacing: .02em; }
.token-value { font-size: 18px; font-weight: 700; color: #F7F7F2; letter-spacing: -.02em; }

/* Full-width nav toggle */
.nav-full-toggle { padding: 0 0 6px; }
.studio-nav-toggle { display: flex; background: rgba(255,255,255,0.04); border-radius: 12px; padding: 4px; border: 1px solid rgba(255,255,255,0.08); gap: 4px; width: 100%; }
.nav-toggle-btn { flex: 1; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 600; border: none; background: transparent; color: var(--text-dim); cursor: pointer; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); white-space: nowrap; min-height: 44px; text-align: left; }
.nav-toggle-btn:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-toggle-btn.active { background: var(--gradient); color: #fff; box-shadow: 0 2px 10px rgba(139, 92, 246, 0.35); }
.nav-toggle-icon { font-size: 16px; flex-shrink: 0; width: 24px; text-align: center; }
.nav-toggle-content { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.nav-toggle-title { font-size: 13px; font-weight: 600; line-height: 1.2; }
.nav-toggle-desc { font-size: 10px; font-weight: 400; opacity: 0.7; line-height: 1.2; }

.studio-hero { padding: 8px 0 6px; max-width: 650px; }.studio-hero h1 { font-size: clamp(47px, 7vw, 76px); }
.account-avatar { width: 34px; height: 34px; padding: 0; border-radius: 50%; background: linear-gradient(145deg, #3f3c5f, #1d1c2e); border: 1px solid rgba(255,255,255,.15); box-shadow: none; font-size: 13px; cursor: pointer; transition: all 0.2s ease; flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.account-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.account-avatar:hover { border-color: rgba(139,92,246,0.4); transform: scale(1.05); }
.trust-strip { display: flex; gap: 24px; padding: 13px 15px; margin-bottom: 18px; border: 1px solid rgba(255,255,255,.07); border-radius: 10px; background: rgba(255,255,255,.025); color: #9899ad; font-size: 11px; }.trust-strip span { display: inline-flex; align-items: center; gap: 7px; }.trust-strip i { width: 5px; height: 5px; border-radius: 50%; background: #8e70fb; box-shadow: 0 0 9px #8e70fb; }
.input-section { padding: 8px; background: linear-gradient(145deg, rgba(27,26,45,.9), rgba(16,16,28,.9)); }.queue-heading { display: flex; align-items: center; margin-bottom: 6px; }.queue-heading h2, .billing-panel h2 { margin-top: 5px; font-size: 20px; letter-spacing: -.04em; }.cost-preview { padding: 8px 10px; border: 1px solid rgba(167,142,255,.2); background: rgba(139,92,246,.08); border-radius: 8px; color: #9fa0b6; font-size: 11px; }.cost-preview strong { color: #e6dfff; }.duration-rule { margin: 8px 1px 0; color: #6d6e82; font-size: 11px; }.input-wrapper input { border-radius: 11px; }.input-wrapper button { border-radius: 11px; }
.billing-panel { padding: 27px; margin: 0 0 22px; border: 1px solid rgba(169,140,255,.25); border-radius: 18px; background: linear-gradient(150deg, rgba(36,31,64,.82), rgba(16,16,30,.92)); animation: fadeInUp .3s ease; }.billing-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 21px; }.panel-close { width: 31px; height: 31px; padding: 0; color: #aaa9bd; background: transparent; border: 1px solid rgba(255,255,255,.1); box-shadow: none; }.panel-close:hover { background: rgba(255,255,255,.06); box-shadow: none; }.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }.price-card { position: relative; min-height: 190px; padding: 18px; display: flex; flex-direction: column; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; background: rgba(5,5,13,.32); }
.price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }.price-card.featured { border-color: #9e81ff; box-shadow: inset 0 0 30px rgba(133,95,255,.12); }.price-card b { position: absolute; top: -9px; left: 14px; padding: 3px 6px; color: #201740; background: #c8b8ff; border-radius: 4px; font-size: 8px; letter-spacing: .08em; }.price-card p { color: #aaa9ba; font-size: 12px; }.price-card strong { margin: 17px 0 5px; color: #fff; font-size: 32px; letter-spacing: -.06em; }.price-card strong small { color: #aaa9bf; font-size: 11px; letter-spacing: 0; }.price-card > span { color: #b8a7ff; font-size: 13px; }.price-card button { margin-top: auto; padding: 8px; background: rgba(255,255,255,.07); color: #838397; font-size: 10px; box-shadow: none; }.billing-note { margin-top: 15px; color: #858699; font-size: 11px; }.ledger-section { margin-top: 24px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 18px; }.ledger-header { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }.ledger-toggle { font-size: 10px; color: #aaa9bd; transition: transform 0.3s; }.ledger-section.expanded .ledger-toggle { transform: rotate(180deg); }.ledger-list { list-style: none; margin: 0; padding: 0; max-height: 0; overflow: hidden; transition: max-height .3s ease, margin .3s ease; }.ledger-section.expanded .ledger-list { max-height: 280px; margin: 10px 0 0; overflow-y: auto; }.ledger-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid rgba(255,255,255,.05); font-size: 12px; }.ledger-row:last-child { border-bottom: 0; }.ledger-label { flex: 1; color: #d6d5e4; }.ledger-date { color: #6d6e82; font-size: 10px; }.ledger-amount { font-variant-numeric: tabular-nums; font-size: 12px; }.ledger-amount--pos { color: #7ee2a8; }.ledger-amount--neg { color: #f78fa3; }.ledger-empty { padding: 10px 4px; color: #858699; font-size: 11px; }.secure-output-loading, .secure-output-note { color: var(--text-dim); font-size: 12px; }.secure-output-loading { display: grid; place-items: center; min-height: 340px; background: rgba(0,0,0,.18); }
@media (max-width: 720px) {
  body { padding: 8px; }
  .auth-view { min-height: calc(100vh - 16px); }
  .auth-card { padding: 16px 12px; }
  .studio-hero { padding: 8px 0 4px; }
  .theme-toggle-btn { position: static; margin: 4px 0 0; }
  .trust-strip { gap: 6px; flex-wrap: wrap; }
  .queue-heading { align-items: flex-start; }
  .pricing-grid { grid-template-columns: 1fr; }
  .price-card { min-height: 100px; }
  .price-card strong { margin: 6px 0 3px; }
  .auth-trust { gap: 6px; }
  .auth-trust span + span { padding-left: 6px; }
  .secure-output-loading { min-height: 160px; }
}

/* --- Animations --- */
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* --- Genre & Audience Worth Meta Banner --- */
.job-meta-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 14px 0;
  flex-wrap: wrap;
}

.genre-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  backdrop-filter: blur(8px);
  letter-spacing: 0.2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.genre-icon {
  font-size: 14px;
}

/* --- Job Detail Metadata Row --- */
.job-detail-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 10px 0;
  flex-wrap: wrap;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 500;
  background: rgba(255,255,255,0.03);
  color: var(--text-dim);
  border: 1px solid rgba(255,255,255,0.06);
  white-space: nowrap;
  transition: all 0.2s ease;
  letter-spacing: 0.01em;
}

.meta-chip:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
}

.meta-chip.entity-chip {
  background: rgba(139, 92, 246, 0.08);
  color: #a78bfa;
  border-color: rgba(139, 92, 246, 0.2);
}

.meta-chip.entity-chip:hover {
  background: rgba(139, 92, 246, 0.14);
  border-color: rgba(139, 92, 246, 0.3);
}

.meta-chip.qa-warn {
  background: rgba(245, 158, 11, 0.08);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.2);
}

/* --- Multimodal / OCR Stats Row --- */
.mm-stats-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.mm-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(139, 92, 246, 0.08);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.2);
  white-space: nowrap;
}

.mm-chip.mm-chip-name {
  background: rgba(16, 185, 129, 0.08);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.2);
}

/* --- Content Identity (Identifier) Card --- */
.ci-card {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 10px;
}

.ci-header {
  font-size: 11px;
  font-weight: 700;
  color: #a78bfa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.ci-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.ci-field {
  font-size: 11px;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ci-label {
  font-weight: 600;
  color: var(--text);
  opacity: 0.7;
}

.ci-entities {
  flex-basis: 100%;
}

.ci-entity-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.ci-notes {
  margin-top: 8px;
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.4;
  font-style: italic;
}

.meta-chip.qa-pass {
  background: rgba(16, 185, 129, 0.08);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.2);
}

.meta-chip.qa-pass:hover {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.3);
}

/* --- Reel Studio & 9:16 Video Player --- */
.reel-studio-card {
  margin-top: 18px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

.studio-header {
  display: flex;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}

.studio-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.studio-icon { font-size: 20px; }
.studio-title { font-size: 16px; font-weight: 700; color: var(--text); }

.studio-tabs {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 1;
  min-width: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.5) transparent;
  mask-image: linear-gradient(to right, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
}

.studio-tab {
  flex-shrink: 0;
  white-space: nowrap;
}

.studio-tabs::-webkit-scrollbar {
  height: 3px;
}

.studio-tabs::-webkit-scrollbar-track {
  background: transparent;
}

.studio-tabs::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 10px;
}

.studio-tab {
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  white-space: nowrap;
}

.studio-tab.active {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.4);
}

.studio-group-panel { display: none; }
.studio-group-panel.active { display: block; animation: fadeIn 0.3s ease; }

.studio-panel-layout {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
}

.player-916-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 480px;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.player-916-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-aspect-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #a78bfa;
  border: 1px solid rgba(167, 139, 250, 0.3);
  pointer-events: none;
}

.studio-info-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.studio-reel-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.studio-reel-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.studio-meta-pill {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
}

.studio-desc-box, .studio-reasoning-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.desc-label, .reasoning-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  display: block;
  margin-bottom: 4px;
}

.studio-desc-box p, .studio-reasoning-box p {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}

.studio-clip-sequence {
  background: rgba(0, 0, 0, 0.2);
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.sequence-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.sequence-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.sequence-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  flex-wrap: wrap;
}

.sequence-item.hook {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.seq-num { font-weight: 700; width: 20px; }
.seq-time { font-family: var(--font-mono); font-size: 11px; color: var(--accent); min-width: 95px; }
.seq-reason { color: var(--text-dim); flex: 1; min-width: 0; overflow-wrap: break-word; word-break: break-word; }

.studio-actions { margin-top: 6px; }

/* Download button inline — left aligned below video */
.studio-actions-row { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; gap: 8px; }
.studio-actions-inline { display: flex; align-items: center; }
.studio-actions-inline .download-btn { margin: 0; font-size: 12px; padding: 7px 14px; }

/* Show More Details toggle — grey oval pill, right side */
.studio-details-toggle {
  display: inline-flex; align-items: center; gap: 2px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px; padding: 3px 8px; cursor: pointer;
  color: rgba(255,255,255,0.5); font-size: 8px; font-weight: 600;
  transition: background 0.2s, color 0.2s; white-space: nowrap;
}
.studio-details-toggle:hover { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.8); }

/* Collapsible details panel */
.studio-details-panel {
  max-height: 0; overflow: hidden;
  transition: max-height 0.35s ease, padding 0.3s ease, opacity 0.3s ease;
  padding: 0; opacity: 0;
}
.studio-details-panel.open { max-height: 800px; padding: 12px 0 0; opacity: 1; }

/* --- Audience Retention & Worth (Redesigned) --- */
.ra-card {
  margin-top: 14px;
  background: rgba(14,14,26,0.85);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ra-pass { border-color: rgba(16,185,129,0.18); }
.ra-warn { border-color: rgba(245,158,11,0.14); }

/* --- Header --- */
.ra-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ra-top-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ra-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ra-icon-svg {
  width: 24px;
  height: 24px;
}

.ra-titles {
  display: flex;
  flex-direction: column;
}

.ra-heading {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.ra-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.ra-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 6px 14px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ra-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  animation: ra-pulse 2s ease-in-out infinite;
}

@keyframes ra-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.85); }
}

.pill-ok { background: rgba(16,185,129,0.12); color: #34d399; }
.pill-warn { background: rgba(245,158,11,0.1); color: #fbbf24; }

/* --- Score Strip --- */
.ra-score-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: rgba(255,255,255,0.025);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.04);
}

.ra-score-big {
  display: flex;
  align-items: baseline;
  gap: 3px;
  flex-shrink: 0;
}

.ra-score-num {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
}

.ra-score-of {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.ra-score-bar-wrap {
  flex: 1;
}

.ra-score-bar {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  overflow: hidden;
}

.ra-score-bar-fill {
  height: 100%;
  border-radius: 8px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.ra-score-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* --- Verdict --- */
.ra-verdict {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  padding: 0 2px;
}

.ra-verdict-score {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.ra-verdict-dash {
  color: var(--text-muted);
  margin: 0 2px;
}

/* --- Metrics --- */
.ra-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.ra-metric {
  padding: 12px 14px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s;
}

.ra-metric:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}

.ra-metric-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ra-metric-icon {
  font-size: 11px;
  opacity: 0.55;
  flex-shrink: 0;
}

.ra-metric-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ra-metric-score {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.ra-metric-of {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

.ra-metric-bar {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.ra-metric-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Interactive Timeline Canvas --- */
.timeline-canvas-panel { margin-top: 14px; }
.timeline-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; font-size: 10px; color: var(--text-dim); }
.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-dot { width: 8px; height: 8px; border-radius: 2px; }
.legend-dot.hook { background: #f59e0b; }
.legend-dot.clip { background: #8b5cf6; }
.legend-dot.stakes { background: #ef4444; }
.legend-dot.roast { background: #ec4899; }
.legend-dot.region-early { background: rgba(59, 130, 246, 0.3); }
.legend-dot.region-mid { background: rgba(139, 92, 246, 0.3); }
.legend-dot.region-late { background: rgba(16, 185, 129, 0.3); }

.timeline-canvas-container { display: flex; flex-direction: column; gap: 8px; }
.track-row { display: flex; align-items: center; gap: 10px; }
.track-label { width: 110px; font-size: 10px; font-weight: 600; color: var(--text-dim); flex-shrink: 0; }
.track-bar { position: relative; flex: 1; height: 24px; background: rgba(0, 0, 0, 0.4); border-radius: 4px; overflow: hidden; border: 1px solid var(--border); }

.region-span {
  position: absolute;
  top: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.6);
}

.region-span.early { background: rgba(59, 130, 246, 0.2); border-right: 1px dashed rgba(59, 130, 246, 0.4); }
.region-span.mid { background: rgba(139, 92, 246, 0.2); border-right: 1px dashed rgba(139, 92, 246, 0.4); }
.region-span.late { background: rgba(16, 185, 129, 0.2); }

.clip-span {
  position: absolute;
  top: 2px; bottom: 2px;
  background: var(--gradient);
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.clip-span.hook-span { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }

.timeline-ticks {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 9px; color: var(--text-muted);
  margin-top: 4px; padding-left: 120px;
}

@media (max-width: 768px) {
  .studio-panel-layout { flex-direction: column; }
  .player-916-frame { max-height: 360px; }
  .retention-body { flex-direction: column; align-items: center; }
  .retention-metrics-grid { grid-template-columns: 1fr; }
  .retention-header { flex-direction: column; gap: 10px; }
  .ra-top { flex-direction: column; align-items: flex-start; gap: 10px; }
  .ra-metrics { grid-template-columns: 1fr; }
  .ra-score-strip { flex-wrap: wrap; }
}

/* --- Pipeline Progress Bar --- */
.pipeline-progress-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 4px; padding: 0 2px;
}
.pipeline-progress-bg {
  flex: 1; height: 4px; background: rgba(255,255,255,0.06);
  border-radius: 3px; overflow: hidden;
}
.pipeline-progress-fill {
  height: 100%; border-radius: 3px; transition: width 0.5s;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #a78bfa);
  position: relative;
}
.pipeline-progress-pct {
  font-size: 10px; font-weight: 800; color: var(--accent);
  font-family: var(--font-mono); min-width: 28px; text-align: right;
}
.pipeline-elapsed {
  font-size: 9px; color: var(--text-muted); font-family: var(--font-mono);
  white-space: nowrap;
}

/* --- Timeline Toolbar --- */
.timeline-toolbar {
  display: flex; justify-content: flex-end; margin-bottom: 3px;
}
.timeline-collapse-btn {
  font-size: 10px; font-weight: 600; color: var(--text-dim);
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer; padding: 4px 10px;
  border-radius: 6px; transition: all 0.2s;
  letter-spacing: 0.02em;
}
.timeline-collapse-btn:hover {
  color: var(--accent); background: var(--accent-dim);
  border-color: rgba(139,92,246,0.3);
}

/* Collapsed timeline: hide done stages but keep Pipeline Output Summary visible */
.timeline-container.collapsed .timeline-stage.done:not(.active) {
  display: flex !important;
  padding: 0 !important;
  margin: 0 !important;
  gap: 0 !important;
}

.timeline-container.collapsed .timeline-stage.done:not(.active) > .timeline-marker {
  display: none;
}

.timeline-container.collapsed .timeline-stage.done:not(.active) > .timeline-content {
  padding: 0 !important;
  flex: 1 !important;
  min-width: 0 !important;
}

.timeline-container.collapsed .timeline-stage.done:not(.active) > .timeline-content > .timeline-header {
  display: none;
}

.timeline-container.collapsed .timeline-stage.done:not(.active) > .timeline-content > .stage-expanded,
.timeline-container.collapsed .timeline-stage.done:not(.active) > .timeline-content > .stage-summary {
  display: none;
}

/* --- Selected Job Card (keyboard nav) --- */
.job-card--selected {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(139,92,246,0.25);
}

/* --- Log Stream Panel --- */
.log-stream-panel {
  margin-top: 14px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.log-stream-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(139,92,246,0.06) 0%, rgba(99,102,241,0.03) 100%);
  border-bottom: 1px solid var(--border);
}
.log-stream-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px rgba(16,185,129,0.5);
  animation: logPulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes logPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(16,185,129,0.5); }
  50% { opacity: 0.4; box-shadow: 0 0 2px rgba(16,185,129,0.2); }
}
.log-stream-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.log-stream-count {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  background: rgba(255,255,255,0.04);
  padding: 2px 8px;
  border-radius: 10px;
}
.log-stream-toggle {
  font-size: 10px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background var(--transition);
}
.log-stream-toggle:hover { background: var(--accent-dim); }
.log-stream-body {
  max-height: 160px;
  overflow-y: auto;
  padding: 4px 0;
  position: relative;
}
.log-stream-body::before {
  content: '';
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 16px;
  display: block;
  background: linear-gradient(to bottom, rgba(10,10,18,0.95), transparent);
  pointer-events: none;
  z-index: 1;
}
.log-stream-body::-webkit-scrollbar { width: 4px; }
.log-stream-body::-webkit-scrollbar-track { background: transparent; }
.log-stream-body::-webkit-scrollbar-thumb {
  background: rgba(139,92,246,0.3);
  border-radius: 4px;
}
.log-stream-body::-webkit-scrollbar-thumb:hover { background: rgba(139,92,246,0.5); }
.log-line {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  padding: 5px 16px;
  line-height: 1.5;
  word-break: break-word;
  transition: background 0.15s ease;
}
.log-line:hover { background: rgba(255,255,255,0.02); }
.log-line:nth-child(even) { background: rgba(255,255,255,0.01); }
.log-line:nth-child(even):hover { background: rgba(255,255,255,0.03); }
.log-line:last-child { border-bottom: none; }
.log-timestamp { color: var(--text-muted); }
.log-level-icon { margin-right: 2px; }

/* --- Video Player Speed & Loop Controls --- */
.player-controls-overlay {
  position: absolute; bottom: 8px; left: 8px; right: 8px;
  display: flex; justify-content: space-between; align-items: center;
  pointer-events: none;
}
.player-speed-group {
  display: flex; gap: 3px; pointer-events: auto;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
  border-radius: 6px; padding: 3px;
}
.speed-btn {
  font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 4px;
  background: transparent; border: none; color: rgba(255,255,255,0.6);
  cursor: pointer; transition: all 0.2s; font-family: var(--font-mono);
}
.speed-btn:hover { color: #fff; }
.speed-btn.active { background: var(--accent); color: #fff; }
.loop-btn {
  font-size: 14px; padding: 4px 8px; border-radius: 4px;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
  border: none; cursor: pointer; opacity: 0.5; transition: all 0.2s;
  pointer-events: auto;
}
.loop-btn:hover { opacity: 0.8; }
.loop-btn.active { opacity: 1; background: rgba(139,92,246,0.5); }

/* Disabled lime recolor: preserve the original violet/indigo studio palette. */
@media not all {
/* Ingest module and controls */
.queue-heading h2, .billing-panel h2, .studio-title, .reel-studio-card h2 { color: #F7F7F2 !important; }
.cost-preview { color: #B8B8B0 !important; background: rgba(255,255,255,.04) !important; border: 1px solid rgba(255,255,255,.06) !important; border-radius: 999px !important; }
.cost-preview strong { color: #EAFF1E !important; }

/* Stats and status language */
.stats-bar { border-radius: 3px !important; background: #0b0c02 !important; }
.stat:not(:last-child)::after { background: #2E3306 !important; }
.stat-num { color: #EAFF1E !important; background: none !important; -webkit-text-fill-color: #EAFF1E !important; text-shadow: 0 0 16px rgba(234,255,30,.2); }
.connection-badge { color: #A3B215 !important; background: #000000 !important; border-radius: 2px !important; }
.connection-badge.connected { color: #EAFF1E !important; }.connection-badge.disconnected { color: #A3B215 !important; }
.connection-dot, .connection-badge.connected .connection-dot, .connection-badge.disconnected .connection-dot { background: #EAFF1E !important; box-shadow: 0 0 10px rgba(234,255,30,.75) !important; }

/* Pipeline energy rail */
.job-card { border-radius: 3px !important; background: linear-gradient(135deg, #171903, #000000 62%) !important; }
.job-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 2px;
  background: #464C09;
}
.job-card[data-status="DONE"] { border-color: #A3B215 !important; }
.job-card[data-status="ERROR"] { border-color: #757F0F !important; }
.card-title, .timeline-label, .panel-title, .studio-reel-title { color: #D2E51B !important; }
.card-badge, .card-badge[style], .card-badge.badge-done, .card-badge.badge-error { color: #000000 !important; background: #D2E51B !important; border-color: #EAFF1E !important; box-shadow: none !important; }
.delete-btn, .retry-btn, .retry-full, .timeline-collapse-btn, .panel-close, .log-stream-toggle {
  color: #D2E51B !important;
  background: #171903 !important;
  border-color: #5D660C !important;
  box-shadow: none !important;
}
.delete-btn:hover, .retry-btn:hover, .retry-full:hover, .timeline-collapse-btn:hover, .panel-close:hover { color: #000000 !important; background: #D2E51B !important; }
.timeline-container::before { background: #464C09 !important; opacity: 1 !important; }
.timeline-stage { --stage-color: #8C9912 !important; --bar-color: #2E3306 !important; }
.timeline-stage.done { --stage-color: #A3B215 !important; --bar-color: #757F0F !important; }
.timeline-stage.active { --stage-color: #EAFF1E !important; --bar-color: #EAFF1E !important; background: linear-gradient(90deg, rgba(234,255,30,.1), transparent 75%) !important; }
.timeline-stage.error { --stage-color: #D2E51B !important; --bar-color: #5D660C !important; }
.timeline-dot, .timeline-stage.done .timeline-dot, .timeline-stage.error .timeline-dot { color: #000000 !important; background: #A3B215 !important; box-shadow: none !important; }
.timeline-stage.active .timeline-dot { color: #000000 !important; background: #EAFF1E !important; box-shadow: 0 0 20px rgba(234,255,30,.52) !important; }
.timeline-stage.done .timeline-label, .timeline-stage.done .timeline-status, .timeline-stage.error .timeline-label, .timeline-stage.error .timeline-status { color: #D2E51B !important; }
.timeline-stage.pending .timeline-label, .timeline-stage.pending .timeline-status, .timeline-desc { color: #757F0F !important; }
.timeline-stage.active .timeline-label, .timeline-stage.active .timeline-status { color: #EAFF1E !important; }
.pulsing-dot, .log-stream-live-dot { background: #EAFF1E !important; box-shadow: 0 0 9px rgba(234,255,30,.75) !important; }
.stage-expanded, .stage-summary, .stage-status-msg { color: #BBCC18 !important; }
.dl-bar-bg, .stage-progress-bg { background: #171903 !important; }
.dl-bar-fill, .stage-progress-fill { background: linear-gradient(90deg, #5D660C, #EAFF1E, #D2E51B) !important; }
.dl-bar-shimmer, .stage-progress-shimmer { background: linear-gradient(90deg, transparent, rgba(234,255,30,.55), transparent) !important; }
.dl-stat { background: #000000 !important; border-color: #2E3306 !important; }.dl-stat-label { color: #757F0F !important; }
.multi-stage-steps, .multi-step { background: #000000 !important; border-color: #2E3306 !important; color: #8C9912 !important; }
.multi-step.active { color: #EAFF1E !important; background: rgba(234,255,30,.09) !important; border-color: #5D660C !important; }.multi-step.done { color: #D2E51B !important; background: #171903 !important; }

/* Analysis, output, video, and overlays */
.genre-badge, .meta-chip, .summary-pill, .studio-meta-pill, .token-badge, .llm-role-badge {
  color: #D2E51B !important;
  background: #171903 !important;
  border-color: #5D660C !important;
}
.timeline-canvas-container, .track-bar, .output-card, .studio-info-panel, .sequence-item,
.llm-card, .log-stream-body, .modal-body, .terminal-drawer { background: #000000 !important; border-color: #2E3306 !important; }
.region-span.early, .region-span.mid, .region-span.late, .clip-span, .clip-span.hook-span { color: #000000 !important; background: #A3B215 !important; border-color: #EAFF1E !important; }
.timeline-legend .legend-dot, .legend-dot.hook, .legend-dot.clip, .legend-dot.stakes, .legend-dot.roast { background: #D2E51B !important; }
.llm-card.user-card, .llm-card.system-card, .llm-card.assistant-card, .llm-card.error-card, .llm-card.retry-card, .llm-card.streaming-card { border-left-color: #A3B215 !important; background: #000000 !important; }
.llm-card-body, .llm-card.assistant-card .llm-card-body, .llm-card.error-card .llm-card-body, .llm-card.retry-card .llm-card-body, .vad-card .llm-card-body { color: #A3B215 !important; }
.llm-log-header, .log-stream-header { background: linear-gradient(90deg, rgba(234,255,30,.09), transparent) !important; border-color: #2E3306 !important; }
.llm-view-full, .speed-btn, .loop-btn { color: #D2E51B !important; background: #171903 !important; border-color: #5D660C !important; }
.speed-btn.active, .loop-btn.active { color: #000000 !important; background: #EAFF1E !important; }
.player-916-frame, .output-card video, .player-speed-group { background: #000000 !important; border-color: #464C09 !important; }
.player-aspect-badge { color: #000000 !important; background: #D2E51B !important; }
.download-btn { color: #000000 !important; background: #EAFF1E !important; }.secure-output-loading, .secure-output-note { color: #A3B215 !important; }

/* Billing and feedback */
.billing-panel { background: linear-gradient(135deg, #171903, #000000) !important; border-radius: 3px !important; }
.price-card { color: #A3B215 !important; background: #000000 !important; border-color: #464C09 !important; border-radius: 2px !important; }
.price-card.featured { border-color: #EAFF1E !important; box-shadow: inset 0 0 28px rgba(234,255,30,.07) !important; }
.price-card b { color: #000000 !important; background: #EAFF1E !important; border-radius: 0 !important; }
.price-card strong, .price-card > span { color: #EAFF1E !important; }.price-card strong small { color: #8C9912 !important; }
.toast { color: #D2E51B !important; background: #171903 !important; border-color: #5D660C !important; }.toast-icon, .toast.success .toast-icon, .toast.error .toast-icon, .toast.warn .toast-icon, .toast.info .toast-icon { color: #000000 !important; background: #D2E51B !important; }
.timeline-error, .validation-error, .validation-warn, .validation-info, .video-error { color: #D2E51B !important; background: #171903 !important; border-color: #5D660C !important; }

@media (max-width: 720px) {
  .trust-strip { gap: 8px; }
  .auth-card { border-radius: 3px !important; }
  .stats-bar { gap: 8px; }
}

/* --- Modern Lime Studio refinement --- */
:root {
  --bg: #080808;
  --bg-elevated: #141414;
  --bg-glass: rgba(20,20,20,.74);
  --bg-input: rgba(255,255,255,.045);
  --border: rgba(255,255,255,.09);
  --border-strong: rgba(255,255,255,.16);
  --text: #F7F7F2;
  --text-dim: #B8B8B0;
  --text-muted: #787870;
  --accent: #EAFF1E;
  --accent-dim: rgba(234,255,30,.12);
  --success: #EAFF1E;
  --success-dim: rgba(234,255,30,.12);
  --error: #FF6D67;
  --error-dim: rgba(255,109,103,.12);
  --warning: #F4C95D;
  --input-border: rgba(255,255,255,.08);
  --input-border-focus: rgba(234,255,30,.6);
  --card-border: rgba(255,255,255,.06);
}
body {
  background: #080808 !important;
  background-image:
    radial-gradient(ellipse 58% 45% at 5% -10%, rgba(234,255,30,.11), transparent 72%),
    radial-gradient(ellipse 44% 38% at 104% 22%, rgba(255,255,255,.055), transparent 72%),
    linear-gradient(180deg, #11110f 0, #080808 43%, #080808 100%) !important;
}
body::before {
  z-index: -1;
  opacity: 1;
  background: radial-gradient(circle at 50% 115%, rgba(234,255,30,.065), transparent 42%) !important;
  animation: ambientDrift 16s ease-in-out infinite alternate;
}
@keyframes ambientDrift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(2%, 1%, 0) scale(1.08); }
}

/* Surfaces are quiet and deep, not heavy outlined boxes. */
.input-section, .stats-bar, .job-card, .billing-panel, .reel-studio-card,
.collapsible-panel, .llm-log-section, .log-stream-panel, .modal-content,
.connection-badge, .auth-card {
  background: rgba(255,255,255,.03) !important;
  border: 1px solid rgba(255,255,255,.06) !important;
  box-shadow: 0 16px 48px rgba(0,0,0,.28), inset 0 1px rgba(255,255,255,.03) !important;
  backdrop-filter: blur(20px) saturate(110%) !important;
}
.delete-cancel-btn { color: #B8B8B0 !important; border-color: rgba(255,255,255,.12) !important; background: rgba(255,255,255,.05) !important; }
.delete-cancel-btn:hover { color: #F7F7F2 !important; background: rgba(255,255,255,.08) !important; }
.input-section, .job-card, .billing-panel, .reel-studio-card { border-radius: 22px !important; }
.auth-card { border-radius: 30px !important; background: linear-gradient(145deg, rgba(31,31,29,.88), rgba(13,13,13,.88)) !important; }
.input-section::before, .job-card::before, .billing-panel::before, .reel-studio-card::before, .auth-card::before,
.job-card::after { display: none !important; }
.job-card { overflow: visible !important; transition: transform .28s cubic-bezier(.2,.8,.2,1), border-color .28s ease, box-shadow .28s ease; }
.job-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.18) !important; box-shadow: 0 26px 72px rgba(0,0,0,.48) !important; }

/* Typography: white holds the reading hierarchy; lime is a deliberate signal. */
.auth-card h1, .studio-hero h1 { color: #F7F7F2 !important; font-weight: 700; letter-spacing: -.07em; }
.auth-card h1 em, .studio-hero h1 em { color: #EAFF1E !important; text-shadow: 0 0 28px rgba(234,255,30,.22); }
.studio-hero .subtitle, .auth-copy { color: #B8B8B0 !important; }
.eyebrow { color: #909088 !important; letter-spacing: .14em; }
.queue-heading h2, .billing-panel h2, .studio-title, .card-title, .panel-title,
.studio-reel-title, .timeline-label, .ra-heading, .ra-metric-name, .unit-name { color: #F7F7F2 !important; }
.subtitle, .auth-copy, .status-msg, .trust-strip, .footer, .stage-expanded,
.stage-summary, .stage-status-msg, .seq-reason, .studio-desc-box p,
.studio-reasoning-box p, .llm-card-body, .ra-verdict, .ci-field { color: #B8B8B0 !important; }
.duration-rule, .billing-note, .stat-label, .auth-legal, .timeline-desc,
.timeline-stage.pending .timeline-label, .timeline-stage.pending .timeline-status { color: #787870 !important; }

/* Auth uses a single elevated card with an intentional, not decorative, glow. */
.auth-view { min-height: calc(100vh - 48px); }
.auth-aurora--one { background: radial-gradient(circle, rgba(234,255,30,.18), transparent 66%) !important; }
.auth-aurora--two { background: radial-gradient(circle, rgba(255,255,255,.07), transparent 64%) !important; }
.brand-mark { background: #EAFF1E !important; border-radius: 13px !important; box-shadow: 0 12px 32px rgba(234,255,30,.2) !important; }
.brand-mark span { background: #101010 !important; }
.google-login { border-radius: 14px !important; background: #F7F7F2 !important; border-color: #F7F7F2 !important; color: #101010 !important; box-shadow: none !important; }
.google-login:hover { background: #EAFF1E !important; box-shadow: 0 12px 28px rgba(234,255,30,.18) !important; transform: translateY(-2px); }
.google-login svg path { fill: #101010 !important; }

/* Navigation, input, and tokens. */
.studio-nav { border-color: rgba(255,255,255,.08) !important; }
.studio-brand { color: #F7F7F2 !important; }
.studio-brand .brand-mark { box-shadow: none !important; }
.nav-toggle-btn { color: #909088 !important; background: transparent !important; border-radius: 9px !important; }
.nav-toggle-btn.active, .nav-toggle-btn:hover { color: #F7F7F2 !important; background: rgba(255,255,255,.07) !important; }
.token-value { color: #EAFF1E !important; text-shadow: none !important; }
.account-avatar { color: #F7F7F2 !important; background: rgba(255,255,255,.07) !important; border-color: rgba(255,255,255,.1) !important; border-radius: 50% !important; overflow: hidden !important; }
.profile-dropdown-item, .profile-dropdown-danger { background: transparent !important; color: #B8B8B0 !important; }
.profile-dropdown-item:hover { background: rgba(255,255,255,.06) !important; color: #F7F7F2 !important; }
.nav-toggle-btn.active { background: rgba(234,255,30,.12) !important; color: #EAFF1E !important; }
.profile-dropdown-danger:hover { background: rgba(255,109,103,.1) !important; color: #FF6D67 !important; }
.profile-dropdown { background: #141414 !important; border-color: rgba(255,255,255,.1) !important; }
.profile-dropdown-divider { background: rgba(255,255,255,.06) !important; }
.profile-badge { background: rgba(234,255,30,.1) !important; color: #EAFF1E !important; }
.trust-strip { background: transparent !important; border-color: transparent !important; box-shadow: none !important; padding-left: 0; }
.trust-strip i { background: #EAFF1E !important; box-shadow: none !important; }
.cost-preview { color: #B8B8B0 !important; background: rgba(255,255,255,.055) !important; border-color: rgba(255,255,255,.09) !important; border-radius: 999px !important; }
.cost-preview strong { color: #EAFF1E !important; }
input[type="text"], .input-wrapper input {
  color: #F7F7F2 !important;
  background: rgba(255,255,255,.035) !important;
  border: 1px solid rgba(255,255,255,.06) !important;
  border-radius: 12px !important;
  outline: none !important;
}
input[type="text"]:focus {
  border-color: rgba(234,255,30,.5) !important;
  box-shadow: 0 0 0 3px rgba(234,255,30,.08) !important;
}
input[type="text"]::placeholder { color: #787870 !important; }
button, .btn { border-radius: 13px !important; background: #EAFF1E !important; color: #101010 !important; font-weight: 700; }
button:hover, .btn:hover { background: #F7F7F2 !important; color: #101010 !important; box-shadow: 0 10px 26px rgba(255,255,255,.11) !important; }
.profile-dropdown-item, .profile-dropdown-danger, .nav-toggle-btn { background: transparent !important; color: #B8B8B0 !important; }
.profile-dropdown-item:hover, .nav-toggle-btn:hover { background: rgba(255,255,255,.06) !important; color: #F7F7F2 !important; }
.nav-toggle-btn.active { background: rgba(234,255,30,.12) !important; color: #EAFF1E !important; }
.profile-dropdown-danger:hover { background: rgba(255,109,103,.1) !important; color: #FF6D67 !important; }
.profile-dropdown { background: #141414 !important; border-color: rgba(255,255,255,.1) !important; }
.profile-dropdown-divider { background: rgba(255,255,255,.06) !important; }
.caption-options, .mode-toggle, .hook-mode-toggle, .ocr-toggle {
  border-radius: 10px !important;
  background: rgba(255,255,255,.03) !important;
  border: 1px solid rgba(255,255,255,.06) !important;
  padding: 3px !important;
}
.caption-btn, .mode-btn, .hook-btn, .ocr-btn {
  border-radius: 8px !important;
  color: #787870 !important;
  background: transparent !important;
  text-transform: uppercase;
  border: none !important;
  transition: all 0.2s ease !important;
}
.caption-btn:hover, .mode-btn:hover, .hook-btn:hover, .ocr-btn:hover {
  color: #B8B8B0 !important;
  background: rgba(255,255,255,.04) !important;
}
.caption-btn.active, .mode-btn.active, .hook-btn.active, .ocr-btn.active,
.caption-btn--warn.active, .mode-btn.active[data-mode="fast"], .ocr-btn.active[data-mode="skip"], .hook-btn.active[data-hook="skip"] {
  background: #EAFF1E !important;
  color: #101010 !important;
  box-shadow: none !important;
}

/* Modern progress behavior: muted history, white completion, one live lime signal. */
.stats-bar { border-radius: 18px !important; background: rgba(255,255,255,.025) !important; }.stat-num { color: #F7F7F2 !important; -webkit-text-fill-color: #F7F7F2 !important; text-shadow: none !important; }
.stat:not(:last-child)::after { background: rgba(255,255,255,.08) !important; }
.job-card[data-status="DONE"] { border-color: rgba(255,255,255,.14) !important; }.job-card[data-status="ERROR"] { border-color: rgba(255,109,103,.32) !important; }
.card-badge, .card-badge[style] { color: #101010 !important; background: #EAFF1E !important; border-color: transparent !important; border-radius: 999px !important; }
.card-badge.badge-done { color: #101010 !important; background: #F7F7F2 !important; }.card-badge.badge-error { color: #F7F7F2 !important; background: #FF6D67 !important; }
.delete-btn, .retry-btn, .retry-full, .timeline-collapse-btn, .panel-close, .log-stream-toggle { color: #B8B8B0 !important; background: rgba(255,255,255,.055) !important; border-color: rgba(255,255,255,.09) !important; border-radius: 10px !important; }
.delete-btn:hover, .retry-btn:hover, .retry-full:hover, .timeline-collapse-btn:hover, .panel-close:hover { color: #101010 !important; background: #F7F7F2 !important; }
.timeline-container::before { background: rgba(255,255,255,.09) !important; opacity: 1 !important; }
.timeline-stage { --stage-color: #73736e !important; --bar-color: #2a2a28 !important; }.timeline-stage.done { --stage-color: #E5E5DC !important; --bar-color: #7b7b75 !important; }.timeline-stage.active { --stage-color: #EAFF1E !important; --bar-color: #EAFF1E !important; background: linear-gradient(90deg, rgba(234,255,30,.1), transparent 70%) !important; animation: activeStageBreath 2.4s ease-in-out infinite; }.timeline-stage.error { --stage-color: #FF6D67 !important; --bar-color: #6f302e !important; }
@keyframes activeStageBreath { 50% { background-color: rgba(234,255,30,.045); } }
.timeline-dot, .timeline-stage.done .timeline-dot { color: #101010 !important; background: #E5E5DC !important; }.timeline-stage.active .timeline-dot { color: #101010 !important; background: #EAFF1E !important; box-shadow: 0 0 24px rgba(234,255,30,.4) !important; }.timeline-stage.error .timeline-dot { color: #F7F7F2 !important; background: #FF6D67 !important; }
.timeline-stage.done .timeline-label, .timeline-stage.done .timeline-status { color: #E5E5DC !important; }.timeline-stage.active .timeline-label, .timeline-stage.active .timeline-status { color: #EAFF1E !important; }.timeline-stage.error .timeline-label, .timeline-stage.error .timeline-status { color: #FF9E9A !important; }
.dl-bar-bg, .stage-progress-bg { background: rgba(255,255,255,.07) !important; }.dl-bar-fill, .stage-progress-fill { background: linear-gradient(90deg, #A3B215, #EAFF1E) !important; }.dl-stat { background: rgba(0,0,0,.28) !important; border-color: rgba(255,255,255,.06) !important; }.dl-stat-value { color: #F7F7F2 !important; }

/* Supporting content and output studio. */
.genre-badge, .meta-chip, .summary-pill, .studio-meta-pill, .token-badge, .llm-role-badge { color: #D9DACB !important; background: rgba(255,255,255,.055) !important; border-color: rgba(255,255,255,.08) !important; border-radius: 999px !important; }
.timeline-canvas-container, .track-bar, .output-card, .studio-info-panel, .sequence-item, .llm-card, .log-stream-body, .modal-body, .terminal-drawer { background: rgba(0,0,0,.24) !important; border-color: rgba(255,255,255,.06) !important; }
.region-span.early, .region-span.mid, .region-span.late, .clip-span, .clip-span.hook-span { color: #101010 !important; background: #C9D720 !important; border-color: transparent !important; }.timeline-legend .legend-dot, .legend-dot.hook, .legend-dot.clip, .legend-dot.stakes, .legend-dot.roast { background: #EAFF1E !important; }
.llm-log-header, .log-stream-header { background: rgba(255,255,255,.035) !important; border-color: rgba(255,255,255,.07) !important; }.log-stream-live-dot, .pulsing-dot { background: #EAFF1E !important; }
.player-916-frame { border-radius: 18px !important; border-color: rgba(255,255,255,.1) !important; }.player-aspect-badge { border-radius: 999px !important; background: rgba(0,0,0,.65) !important; color: #F7F7F2 !important; border-color: rgba(255,255,255,.12) !important; }.download-btn { background: #EAFF1E !important; }

.billing-panel { border-radius: 22px !important; }
.price-card {
  background: rgba(255,255,255,.025) !important;
  border: 1px solid rgba(255,255,255,.05) !important;
  border-radius: 16px !important;
}
.price-card.featured {
  border-color: rgba(234,255,30,.4) !important;
  box-shadow: 0 8px 24px rgba(234,255,30,.06) !important;
}
.price-card b {
  border-radius: 999px !important;
  background: #EAFF1E !important;
  color: #101010 !important;
}
.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.price-card strong {
  color: #F7F7F2 !important;
  font-size: 42px !important;
  letter-spacing: -.06em;
  line-height: 1;
}
.price-card > span { color: #EAFF1E !important; font-size: 15px !important; font-weight: 700 !important; }
.price-card button {
  background: rgba(255,255,255,.08) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
  transition: all .2s !important;
}
.price-card button:hover {
  background: rgba(255,255,255,.14) !important;
  box-shadow: 0 4px 12px rgba(255,255,255,.1) !important;
}
.toast { border-radius: 15px !important; background: rgba(25,25,24,.93) !important; border-color: rgba(255,255,255,.1) !important; color: #F7F7F2 !important; }
.toast.error .toast-icon { background: #FF6D67 !important; }
.toast-icon { background: #EAFF1E !important; color: #101010 !important; font-weight: 800 !important; }

@media (prefers-reduced-motion: reduce) {
  body::before, .timeline-stage.active { animation: none !important; }
  .job-card { transition: none !important; }
}

}

/* Disabled lime final override: the violet studio controls above are canonical. */
@media not all {
/* === FINAL OVERRIDE: Clean minimal borders, consistent toggle states === */
/* This section intentionally sits last to guarantee a single, clean visual language. */

/* Auth card: no visible border */
.auth-card { border: none !important; }

/* Google login: white button, no black outline */
.google-login, .google-login:hover, .google-login:focus-visible {
  color: #101010 !important;
  background: #F7F7F2 !important;
  border: none !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.2) !important;
  border-radius: 14px !important;
}
.google-login:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,.25) !important; }

/* URL input: clean minimal border */
input[type="text"], .input-wrapper input {
  color: #F7F7F2 !important;
  background: rgba(255,255,255,.03) !important;
  border: 1px solid rgba(255,255,255,.06) !important;
  border-radius: 12px !important;
  outline: none !important;
}
input[type="text"]:focus {
  border-color: rgba(234,255,30,.5) !important;
  box-shadow: 0 0 0 3px rgba(234,255,30,.08) !important;
}
input[type="text"]::placeholder { color: #787870 !important; }

/* Toggle containers: subtle background */
.caption-options, .mode-toggle, .hook-mode-toggle, .ocr-toggle {
  background: rgba(255,255,255,.03) !important;
  border: 1px solid rgba(255,255,255,.06) !important;
  border-radius: 10px !important;
  padding: 3px !important;
}

/* Toggle buttons: inactive = muted, active = lime */
.caption-btn, .mode-btn, .hook-btn, .ocr-btn {
  color: #787870 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 8px !important;
  transition: all 0.15s ease !important;
}
.caption-btn:hover, .mode-btn:hover, .hook-btn:hover, .ocr-btn:hover {
  color: #B8B8B0 !important;
  background: rgba(255,255,255,.04) !important;
}
.caption-btn.active, .mode-btn.active, .hook-btn.active, .ocr-btn.active,
.caption-btn--warn.active, .mode-btn.active[data-mode="fast"],
.ocr-btn.active[data-mode="skip"], .hook-btn.active[data-hook="skip"] {
  color: #101010 !important;
  background: #EAFF1E !important;
  box-shadow: none !important;
}


/* General surface: clean minimal borders */
.input-section, .stats-bar, .job-card, .billing-panel, .reel-studio-card {
  border: 1px solid rgba(255,255,255,.06) !important;
  border-radius: 18px !important;
}

/* === PERMANENT DARK MODE: night mode is the only mode === */
html { background: #080808 !important; }
body {
  background: #080808 !important;
  color: #F7F7F2 !important;
}

/* ============================================================
   SOURCE VIDEO ARC & CLIP MAPPING — semantic color system
   Each color carries meaning; nothing collapses to a single hue.
   ============================================================ */

/* Color tokens used only by the timeline canvas */
.timeline-canvas-panel {
  --region-early: #3B82F6;     /* blue   — calm intro */
  --region-mid:   #8B5CF6;     /* purple — tension / buildup */
  --region-late:  #10B981;     /* green  — payoff / resolve */
  --cat-hook:     #F59E0B;     /* amber  — attention grab */
  --cat-clip:     #EAFF1E;     /* lime   — primary brand */
  --cat-stakes:   #EF4444;     /* red    — danger / stakes */
  --cat-roast:    #EC4899;     /* pink   — playful / reaction */
  --cat-payoff:   #34D399;     /* mint   — release */
  --cat-build:    #A78BFA;     /* violet — escalation */
  --cat-setup:    #60A5FA;     /* sky    — introduction */
}

/* Track label: dimmer than clip colors so the eye lands on data */
.timeline-canvas-panel .track-label {
  color: #B8B8B0 !important;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.timeline-canvas-panel .track-meta {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  font-weight: 500;
  color: #787870;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

/* Track bar: deep neutral so colors stay legible on top */
.timeline-canvas-panel .track-bar {
  background: rgba(0,0,0,0.55) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 6px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

/* Region spans: distinct, semantic colors. Override the monochrome override above. */
.timeline-canvas-panel .region-span {
  color: #F7F7F2 !important;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none !important;
  position: relative;
  overflow: hidden;
}
.timeline-canvas-panel .region-span::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), transparent 55%);
  pointer-events: none;
}
.timeline-canvas-panel .region-span.early {
  background: linear-gradient(135deg, rgba(59,130,246,0.32), rgba(59,130,246,0.12)) !important;
  border-right: 1px dashed rgba(59,130,246,0.55) !important;
}
.timeline-canvas-panel .region-span.mid {
  background: linear-gradient(135deg, rgba(139,92,246,0.32), rgba(139,92,246,0.12)) !important;
  border-right: 1px dashed rgba(139,92,246,0.55) !important;
}
.timeline-canvas-panel .region-span.late {
  background: linear-gradient(135deg, rgba(16,185,129,0.32), rgba(16,185,129,0.12)) !important;
}
.timeline-canvas-panel .region-span .region-label {
  text-shadow: 0 1px 0 rgba(0,0,0,0.45);
}

/* Region labels carry semantic color hints as left accent bars */
.timeline-canvas-panel .track-row.region-track .track-bar {
  background-image:
    linear-gradient(90deg, rgba(59,130,246,0.08) 0 15%, rgba(139,92,246,0.08) 15% 70%, rgba(16,185,129,0.08) 70% 100%);
}

/* Clip spans: every clip gets a category color. No two clips share a hue unless
   they share meaning. Interactive: hover lifts, focus rings, active pulses. */
.timeline-canvas-panel .clip-span {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #101010 !important;
  cursor: pointer;
  border: 1px solid transparent !important;
  background: var(--cat-clip) !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.18);
  transition:
    transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.2s ease,
    filter 0.2s ease,
    outline-color 0.2s ease;
  outline: 2px solid transparent;
  outline-offset: 1px;
  z-index: 1;
}
.timeline-canvas-panel .clip-span:hover {
  transform: translateY(-2px) scale(1.04);
  filter: brightness(1.18) saturate(1.1);
  box-shadow: 0 6px 18px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.18) inset;
  z-index: 3;
}
.timeline-canvas-panel .clip-span:focus-visible {
  outline-color: #F7F7F2;
  transform: translateY(-2px) scale(1.04);
  z-index: 3;
}
.timeline-canvas-panel .clip-span:active {
  transform: translateY(0) scale(1.02);
}

/* Per-category colorways — each clip honors its own semantic color */
.timeline-canvas-panel .clip-span.cat-hook {
  background: linear-gradient(135deg, var(--cat-hook) 0%, #D97706 100%) !important;
  box-shadow: 0 2px 8px rgba(245,158,11,0.4), inset 0 1px 0 rgba(255,255,255,0.22);
  animation: clipHookGlow 2.4s ease-in-out infinite;
}
.timeline-canvas-panel .clip-span.cat-stakes {
  background: linear-gradient(135deg, var(--cat-stakes) 0%, #B91C1C 100%) !important;
  color: #F7F7F2 !important;
  box-shadow: 0 2px 8px rgba(239,68,68,0.35), inset 0 1px 0 rgba(255,255,255,0.18);
}
.timeline-canvas-panel .clip-span.cat-roast {
  background: linear-gradient(135deg, var(--cat-roast) 0%, #BE185D 100%) !important;
  color: #F7F7F2 !important;
  box-shadow: 0 2px 8px rgba(236,72,153,0.35), inset 0 1px 0 rgba(255,255,255,0.18);
}
.timeline-canvas-panel .clip-span.cat-payoff {
  background: linear-gradient(135deg, var(--cat-payoff) 0%, #059669 100%) !important;
  color: #101010 !important;
  box-shadow: 0 2px 8px rgba(52,211,153,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}
.timeline-canvas-panel .clip-span.cat-build {
  background: linear-gradient(135deg, var(--cat-build) 0%, #7C3AED 100%) !important;
  color: #F7F7F2 !important;
  box-shadow: 0 2px 8px rgba(167,139,250,0.32), inset 0 1px 0 rgba(255,255,255,0.18);
}
.timeline-canvas-panel .clip-span.cat-setup {
  background: linear-gradient(135deg, var(--cat-setup) 0%, #2563EB 100%) !important;
  color: #101010 !important;
  box-shadow: 0 2px 8px rgba(96,165,250,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}
/* Regular / default — primary brand lime so neutral clips stay distinguishable */
.timeline-canvas-panel .clip-span.cat-regular {
  background: linear-gradient(135deg, #EAFF1E 0%, #C9D720 100%) !important;
}

/* Hook variant takes precedence regardless of category extraction */
.timeline-canvas-panel .clip-span.hook-span {
  background: linear-gradient(135deg, var(--cat-hook) 0%, #D97706 100%) !important;
  box-shadow: 0 2px 10px rgba(245,158,11,0.45), inset 0 1px 0 rgba(255,255,255,0.25);
  animation: clipHookGlow 2.4s ease-in-out infinite;
}

@keyframes clipHookGlow {
  0%, 100% { box-shadow: 0 2px 10px rgba(245,158,11,0.45), inset 0 1px 0 rgba(255,255,255,0.25); }
  50%      { box-shadow: 0 2px 14px rgba(245,158,11,0.7),  inset 0 1px 0 rgba(255,255,255,0.3); }
}

.timeline-canvas-panel .clip-span-label {
  text-shadow: 0 1px 0 rgba(255,255,255,0.18);
  font-family: var(--font-mono);
}

/* Group-track row gets a subtle left stripe matching its primary clip color */
.timeline-canvas-panel .track-row.group-track .track-bar::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(234,255,30,0.5), rgba(234,255,30,0.15));
  border-radius: 6px 0 0 6px;
  pointer-events: none;
}

/* Legend: every chip has its own color, hover scales the dot */
.timeline-canvas-panel .timeline-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  font-size: 10.5px;
  color: #B8B8B0;
}
.timeline-canvas-panel .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.timeline-canvas-panel .legend-item:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
  transform: translateY(-1px);
}
.timeline-canvas-panel .legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  box-shadow: 0 0 6px currentColor;
}
.timeline-canvas-panel .legend-sep {
  width: 1px;
  background: rgba(255,255,255,0.08);
  align-self: stretch;
  margin: 0 2px;
}

/* Each legend dot uses its semantic hue — matches the span colors above */
.timeline-canvas-panel .legend-dot.region-early { background: var(--region-early) !important; color: var(--region-early); }
.timeline-canvas-panel .legend-dot.region-mid   { background: var(--region-mid)   !important; color: var(--region-mid);   }
.timeline-canvas-panel .legend-dot.region-late  { background: var(--region-late)  !important; color: var(--region-late);  }
.timeline-canvas-panel .legend-dot.hook         { background: var(--cat-hook)     !important; color: var(--cat-hook);     }
.timeline-canvas-panel .legend-dot.clip         { background: var(--cat-clip)     !important; color: var(--cat-clip);     }
.timeline-canvas-panel .legend-dot.stakes       { background: var(--cat-stakes)   !important; color: var(--cat-stakes);   }
.timeline-canvas-panel .legend-dot.roast        { background: var(--cat-roast)    !important; color: var(--cat-roast);    }

/* Ticks: subtle warm tick marks for time, no yellow bar to fight with */
.timeline-canvas-panel .timeline-ticks {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 9px;
  color: #787870 !important;
  margin-top: 8px;
  padding-left: 120px;
  padding-right: 4px;
}
.timeline-canvas-panel .timeline-ticks span {
  position: relative;
}
.timeline-canvas-panel .timeline-ticks span::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -6px;
  width: 1px;
  height: 3px;
  background: rgba(255,255,255,0.12);
  transform: translateX(-50%);
}

/* Selected clip (keyboard nav) — visible accent ring */
.timeline-canvas-panel .clip-span.is-selected {
  outline: 2px solid #F7F7F2;
  outline-offset: 2px;
  z-index: 4;
  transform: translateY(-2px) scale(1.06);
}

/* Reduced motion: kill the hook glow but keep semantic colors intact */
@media (prefers-reduced-motion: reduce) {
  .timeline-canvas-panel .clip-span,
  .timeline-canvas-panel .clip-span.cat-hook,
  .timeline-canvas-panel .clip-span.hook-span { animation: none !important; transition: none !important; }
}

}

/* Source arc board: aligned with the retention panel's editorial treatment. */
.timeline-canvas-panel {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid rgba(139, 92, 246, 0.24);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(22, 20, 42, 0.92), rgba(13, 13, 26, 0.9));
}

.timeline-canvas-panel .panel-body { padding: 18px 6px 0; }
.arc-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.arc-sigil {
  width: 42px; height: 42px; flex: 0 0 42px; padding: 9px;
  display: flex; align-items: flex-end; justify-content: center; gap: 3px;
  border-radius: 13px;
  background: linear-gradient(140deg, #9d79ff, #5635cb);
  box-shadow: 0 10px 28px rgba(109, 72, 235, .4);
}
.arc-sigil span { display: block; width: 5px; border-radius: 4px; background: #fff; transform-origin: bottom; }
.arc-sigil span:nth-child(1) { height: 11px; }.arc-sigil span:nth-child(2) { height: 22px; }.arc-sigil span:nth-child(3) { height: 15px; }
.arc-heading-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.arc-title { color: #f5f3ff; font-size: 14px; font-weight: 750; letter-spacing: -0.025em; }
.arc-subtitle { color: #8f90a9; font-size: 11px; }
.arc-total { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: #c9c1ee; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.arc-total i { width: 4px; height: 4px; border-radius: 50%; background: #8b5cf6; box-shadow: 0 0 8px rgba(139, 92, 246, 0.8); }
.arc-legend { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; margin-bottom: 13px; color: #a3a4b8; font-size: 10px; }
.arc-legend-label { color: #77788f; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; }
.arc-legend .legend-item { display: inline-flex; align-items: center; gap: 5px; }.arc-legend-divider { width: 1px; height: 14px; background: rgba(255,255,255,0.12); }
.arc-legend .legend-dot { width: 7px; height: 7px; border-radius: 50%; }.arc-legend .region-early { background: #60a5fa; }.arc-legend .region-mid, .arc-legend .clip { background: #a78bfa; }.arc-legend .region-late { background: #34d399; }.arc-legend .hook { background: #fbbf24; }
.arc-board { gap: 10px; padding: 15px; border: 1px solid rgba(255,255,255,0.065); border-radius: 13px; background: rgba(4, 4, 12, 0.34); }
.timeline-canvas-panel .track-row { gap: 13px; }.timeline-canvas-panel .track-label { width: 126px; color: #a7a8ba; font-size: 10px; font-weight: 700; letter-spacing: 0.01em; }
.timeline-canvas-panel .track-bar { height: 30px; border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; background: rgba(0,0,0,0.35); overflow: hidden; }
.timeline-canvas-panel .region-span { color: #e8e4fb; font-size: 9px; font-weight: 800; letter-spacing: 0.04em; text-shadow: 0 1px 3px rgba(0,0,0,0.4); }
.timeline-canvas-panel .region-span.early { background: linear-gradient(90deg, rgba(59,130,246,.34), rgba(96,165,250,.15)); border-right: 1px solid rgba(147,197,253,.34); }
.timeline-canvas-panel .region-span.mid { background: linear-gradient(90deg, rgba(124,58,237,.37), rgba(167,139,250,.18)); border-right: 1px solid rgba(196,181,253,.34); }
.timeline-canvas-panel .region-span.late { background: linear-gradient(90deg, rgba(16,185,129,.22), rgba(52,211,153,.1)); }
.timeline-canvas-panel .group-track .track-bar { height: 27px; }.timeline-canvas-panel .clip-span { top: 3px; bottom: 3px; border: 1px solid rgba(255,255,255,0.24); border-radius: 6px; background: linear-gradient(135deg, #8b5cf6, #6366f1); color: #fff; box-shadow: 0 3px 10px rgba(79,70,229,.34); transition: transform .18s ease, filter .18s ease; }
.timeline-canvas-panel .clip-span.hook-span { background: linear-gradient(135deg, #f59e0b, #f97316); box-shadow: 0 3px 10px rgba(245,158,11,.3); }.timeline-canvas-panel .clip-span:hover { transform: translateY(-1px); filter: brightness(1.16); }
.timeline-canvas-panel .timeline-ticks { margin-top: 9px; padding-left: 139px; color: #6f7085; font-size: 9px; }
@media (max-width: 720px) { .timeline-canvas-panel { padding: 16px; }.arc-total { display: none; }.arc-board { padding: 11px; }.timeline-canvas-panel .track-label { width: 78px; font-size: 9px; }.timeline-canvas-panel .timeline-ticks { padding-left: 91px; font-size: 8px; }.arc-legend-divider { display: none; } }

/* Audience worth: source-arc hierarchy, score stage, and metric identities. */
.ra-card { margin-top: 18px; padding: 20px; gap: 17px; border: 1px solid rgba(139, 92, 246, 0.24); border-radius: 18px; background: linear-gradient(145deg, rgba(22, 20, 42, 0.92), rgba(13, 13, 26, 0.9)); }
.ra-pass, .ra-warn { border-color: rgba(139, 92, 246, 0.24); }.ra-top { align-items: center; }.ra-icon-badge { border: 1px solid rgba(139, 92, 246, 0.3); background: radial-gradient(circle at 35% 20%, rgba(167, 139, 250, 0.28), rgba(79, 50, 170, 0.18)) !important; border-radius: 13px; }.ra-heading { color: #f5f3ff; font-size: 14px; font-weight: 750; }.ra-sub { color: #8f90a9; }.ra-status { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid color-mix(in srgb, var(--score-color) 38%, transparent); border-radius: 999px; color: #dcd7eb; background: rgba(255,255,255,.035); font-size: 10px; font-weight: 750; letter-spacing: .045em; text-transform: uppercase; white-space: nowrap; }.ra-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--score-color); box-shadow: 0 0 9px var(--score-glow); }
.ra-score-stage { display: grid; grid-template-columns: 190px 1fr; gap: 24px; align-items: center; padding: 17px 19px; border: 1px solid rgba(255,255,255,.07); border-radius: 13px; background: rgba(4, 4, 12, 0.34); }.ra-score-strip { display: contents; }.ra-score-readout { display: flex; flex-direction: column; }.ra-score-kicker { color: #8e8fa4; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }.ra-score-big { gap: 5px; margin: 5px 0 2px; }.ra-score-num { font-size: 42px; letter-spacing: -2.5px; }.ra-score-of { color: #6f7085; font-size: 12px; }.ra-score-caption { color: #77788d; font-size: 10px; }.ra-score-bar { height: 9px; border-radius: 99px; background: rgba(255,255,255,.075); }.ra-score-bar-fill { box-shadow: 0 0 18px rgba(139,92,246,.25); }.ra-score-scale { display: flex; justify-content: space-between; margin-top: 7px; color: #77788d; font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }.ra-score-note { margin-top: 14px; color: #a1a2b5; font-size: 11px; }
.ra-metrics { gap: 10px; }.ra-metric { position: relative; gap: 9px; padding: 13px 14px; overflow: hidden; border: 1px solid rgba(255,255,255,.07); border-radius: 12px; background: rgba(255,255,255,.025); }.ra-metric::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: var(--metric-color); box-shadow: 0 0 10px color-mix(in srgb, var(--metric-color) 70%, transparent); }.ra-metric:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--metric-color) 38%, transparent); background: rgba(255,255,255,.04); }.ra-metric-icon { display: grid; place-items: center; width: 21px; height: 21px; color: var(--metric-color); border: 1px solid color-mix(in srgb, var(--metric-color) 35%, transparent); border-radius: 6px; background: color-mix(in srgb, var(--metric-color) 12%, transparent); opacity: 1; }.ra-metric-name { display: flex; flex-direction: column; gap: 1px; color: #e9e6f4; font-size: 12px; }.ra-metric-name small { color: #7f8093; font-size: 9px; font-weight: 500; }.ra-metric-score { color: #f2f0f9; }.ra-metric-of { color: #6d6e82; }.ra-metric-bar { height: 4px; background: rgba(255,255,255,.075); }.ra-metric-fill { background: var(--metric-color); box-shadow: 0 0 9px color-mix(in srgb, var(--metric-color) 65%, transparent); }
@media (max-width: 720px) { .ra-card { padding: 16px; }.ra-status { display: none; }.ra-score-stage { grid-template-columns: 1fr; gap: 14px; padding: 15px; }.ra-score-note { margin-top: 10px; }.ra-metrics { grid-template-columns: 1fr; } }

/* Mobile compact overrides — must be last to beat lime theme */
@media (max-width: 600px) {
  .delete-btn { width: auto !important; height: auto !important; padding: 3px 8px !important; border-radius: 6px !important; font-size: 9px !important; min-height: 0 !important; min-width: 0 !important; flex-shrink: 0 !important; }
  .card-badge { padding: 3px 8px !important; font-size: 9px !important; border-radius: 6px !important; }
  .timeline-collapse-btn { padding: 3px 8px !important; font-size: 9px !important; border-radius: 6px !important; width: auto !important; }
  .job-card-header { gap: 6px !important; margin-bottom: 4px !important; flex-wrap: nowrap !important; }
  .job-card { padding: 10px !important; }

  /* Source Video Arc & Clip Mapping — compact on phones */
  .timeline-canvas-panel { padding: 12px !important; }
  .timeline-canvas-panel .track-row { flex-direction: row !important; gap: 6px !important; align-items: center !important; }
  .timeline-canvas-panel .track-label { width: 44px !important; flex-shrink: 0 !important; font-size: 7px !important; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .timeline-canvas-panel .track-bar { flex: 1 !important; min-width: 0 !important; height: 24px !important; overflow: hidden !important; position: relative !important; }
  .timeline-canvas-panel .region-span { font-size: 8px !important; letter-spacing: 0 !important; }
  .timeline-canvas-panel .clip-span { border-radius: 4px !important; font-size: 9px !important; }
  .timeline-canvas-panel .clip-span-label { font-size: 8px !important; }
  .timeline-canvas-panel .timeline-ticks { padding-left: 50px !important; font-size: 8px !important; }
  .arc-heading { flex-wrap: wrap; gap: 8px; }
  .arc-title { font-size: 13px; }
  .arc-subtitle { font-size: 10px; }
  .arc-legend { font-size: 9px; gap: 6px; }
  .arc-legend-label { font-size: 8px; }

  /* Reel Studio — compact header, scrollable group tabs */
  .studio-header { flex-direction: column; align-items: stretch; gap: 6px; margin-bottom: 10px; padding-bottom: 8px; }
  .studio-title-group { flex-shrink: 0; }
  .studio-title { font-size: 14px; }
  .studio-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 4px; padding: 3px; mask-image: linear-gradient(to right, black 85%, transparent 100%); -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%); }
  .studio-tab { padding: 3px 10px; font-size: 10px; flex-shrink: 0; }
  .studio-details-toggle { font-size: 7px; padding: 2px 6px; }
  .studio-details-panel.open { max-height: 600px; }

  /* Options row — hook toggle visible on mobile */
  .options-row { display: flex !important; flex-wrap: nowrap !important; gap: 4px !important; margin-bottom: 4px !important; }
  .caption-options, .mode-toggle { padding: 1px !important; border-radius: 4px !important; display: flex !important; flex-shrink: 0 !important; }
  .hook-mode-toggle { padding: 1px !important; border-radius: 4px !important; display: flex !important; flex: 1 !important; }
  .caption-btn, .mode-btn, .hook-btn { padding: 4px 8px !important; font-size: 8px !important; min-height: 22px !important; border-radius: 3px !important; }
  .hook-btn { flex: 1 !important; }

  /* Marquee ticker — compact on mobile */
  .marquee-bar { padding: 4px 0 !important; font-size: 8px !important; }

  /* Hero — remove upper padding */
  .studio-hero { padding: 0 0 4px !important; }
  .studio-hero h1 { margin-top: 0 !important; }

  /* Billing cards — compact on mobile */
  .price-row { flex-wrap: nowrap !important; }
  .price-card strong { font-size: 34px !important; }
  .price-card > span { font-size: 13px !important; }

  /* Studio details toggle — compact on mobile */
  .studio-details-toggle { font-size: 9px !important; padding: 4px 10px !important; min-height: 0 !important; min-width: 0 !important; }
}


