/* =========================================================
   Qlipto — Design System
   Dark cinematic palette, Cinzel display + Inter body
   ========================================================= */

:root {
  --bg:          #0e0e12;
  --bg-panel:    #16161d;
  --bg-input:    #1e1e28;
  --bg-hover:    #22222e;
  --border:      #2a2a3a;
  --border-light:#383850;

  --gold:        #c9a84c;
  --gold-dim:    #8a6f30;
  --gold-glow:   rgba(201,168,76,0.15);

  --text:        #e8e6df;
  --text-muted:  #8888a0;
  --text-dim:    #55556a;

  --green:       #4caf7a;
  --green-dim:   rgba(76,175,122,0.15);
  --red:         #c9504c;
  --red-dim:     rgba(201,80,76,0.15);
  --blue:        #4c7ec9;
  --blue-dim:    rgba(76,126,201,0.15);

  --radius:      8px;
  --radius-sm:   5px;
  --font-display: 'Cinzel', serif;
  --font-body:    'Inter', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 96px;
  display: flex;
  align-items: center;
}
.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.logo img {
  height: 84px;
  width: auto;
  display: block;
  object-fit: contain;
}
.logo-fallback {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.03em;
}
.logo-icon { font-size: 20px; }
.logo em { color: var(--text-muted); font-style: normal; font-weight: 600; }

/* ── Layout ── */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0;
}

/* ── Panels ── */
.panel {
  padding: 28px 28px 40px;
  border-right: 1px solid var(--border);
  min-height: calc(100vh - 96px);
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 96px;
}
.panel-right { border-right: none; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.panel-header h2 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Badges ── */
.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--bg-input);
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge.done    { background: var(--green-dim); color: var(--green); }
.badge.running { background: var(--blue-dim);  color: var(--blue);  }
.badge.error   { background: var(--red-dim);   color: var(--red);   }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-row { flex-direction: row; gap: 14px; }
.form-row > div { flex: 1; display: flex; flex-direction: column; gap: 7px; }

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
input[type="text"],
input[type="number"],
textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
input:focus, textarea:focus {
  border-color: var(--gold-dim);
  background: var(--bg-hover);
}
textarea { resize: vertical; min-height: 72px; line-height: 1.5; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary {
  background: var(--gold);
  color: #0e0e12;
}
.btn-primary:hover:not(:disabled) { background: #d4b55c; }
.btn-success {
  background: var(--green);
  color: #0e0e12;
}
.btn-success:hover { background: #5dc98a; }
.btn-ghost {
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-full { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }

/* ── Scene editor ── */
.scene-editor { display: flex; flex-direction: column; gap: 12px; }
.scene-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.scene-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s;
}
.scene-card:hover { border-color: var(--border-light); }

.scene-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.scene-number {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  color: var(--gold-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.scene-fields { display: flex; flex-direction: column; gap: 8px; }
.scene-field-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

/* ── Stages ── */
.stages { display: flex; flex-direction: column; gap: 0; }
.stage {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.stage:last-child { border-bottom: none; }
.stage-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.2s;
}
.stage.done    .stage-dot { background: var(--green); box-shadow: 0 0 6px var(--green); }
.stage.running .stage-dot { background: var(--blue);  box-shadow: 0 0 6px var(--blue); animation: pulse 1s infinite; }
.stage.error   .stage-dot { background: var(--red);   box-shadow: 0 0 6px var(--red); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.stage-info { flex: 1; display: flex; align-items: center; justify-content: space-between; }
.stage-name { font-weight: 600; font-size: 13px; }
.stage-status { font-size: 12px; color: var(--text-muted); }
.stage.done    .stage-status { color: var(--green); }
.stage.running .stage-status { color: var(--blue); }
.stage.error   .stage-status { color: var(--red); }

.stage-btn { margin-left: 12px; }

/* ── Run controls ── */
.run-controls { display: flex; flex-direction: column; gap: 10px; }

/* ── Log ── */
.log-panel {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 200px;
}
.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.log-output {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 14px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  max-height: 320px;
}
.log-placeholder { color: var(--text-dim); font-style: italic; font-family: var(--font-body); }
.log-line-error { color: var(--red); }
.log-line-done  { color: var(--green); }

/* ── Jobs bar ── */
.jobs-bar {
  border-top: 1px solid var(--border);
  background: var(--bg-panel);
  padding: 10px 24px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}
.jobs-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.jobs-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.job-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.job-chip:hover { border-color: var(--gold-dim); color: var(--gold); }
.job-chip .chip-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-dim);
}
.job-chip.done    .chip-dot { background: var(--green); }
.job-chip.running .chip-dot { background: var(--blue); animation: pulse 1s infinite; }
.job-chip.error   .chip-dot { background: var(--red); }

/* ── Utilities ── */
.hidden { display: none !important; }

/* ── Header actions ── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.yt-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-muted);
}
.yt-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s;
}
.yt-dot.connected { background: var(--green); box-shadow: 0 0 5px var(--green); }
.yt-dot.disconnected { background: var(--text-dim); }

/* ── YouTube button ── */
.btn-youtube {
  background: #ff0000;
  color: #fff;
}
.btn-youtube:hover { background: #cc0000; }

/* ── Action row (download + publish side by side) ── */
.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── Select input ── */
select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  width: 100%;
  cursor: pointer;
}
select:focus { border-color: var(--gold-dim); }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.06em;
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 70vh;
  overflow-y: auto;
}
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}
.field-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
  display: block;
}
.label-hint {
  font-weight: 400;
  color: var(--text-dim);
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
}

/* ── Upload progress ── */
.upload-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.progress-bar-wrap {
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: #ff0000;
  border-radius: 3px;
  transition: width 0.3s;
}
.progress-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Upload success ── */
.upload-success {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--green-dim);
  border: 1px solid var(--green);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--green);
}
.success-icon { font-size: 16px; }
.upload-success a { color: var(--green); font-weight: 600; }

/* ── Input mode toggle ── */
.input-mode-toggle {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}
.mode-btn {
  flex: 1;
  padding: 7px 12px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.15s;
}
.mode-btn.active {
  background: var(--bg-panel);
  color: var(--gold);
  border: 1px solid var(--border);
}
.mode-btn:hover:not(.active) { color: var(--text); }

/* ── Music panel ── */
.music-panel {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.music-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.music-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.music-selected {
  font-size: 13px;
  color: var(--text);
  min-height: 20px;
}
.music-none { color: var(--text-dim); font-style: italic; }
.music-selected-name {
  color: var(--gold);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.music-selected-name button {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
}
.music-selected-name button:hover { color: var(--red); }

.music-library { display: flex; flex-direction: column; gap: 8px; }
.music-tracks { display: flex; flex-direction: column; gap: 6px; }
.music-track {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.music-track:hover { border-color: var(--gold-dim); }
.music-track.selected { border-color: var(--gold); background: var(--gold-glow); }
.track-name { flex: 1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-size { font-size: 11px; color: var(--text-dim); flex-shrink: 0; }
.track-play {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  flex-shrink: 0;
}
.track-play:hover { color: var(--gold); }
.music-hint {
  font-size: 11px;
  color: var(--text-dim);
  padding: 4px 0;
}
.music-hint code {
  background: var(--bg-input);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
}

/* ── Music upload ── */
.music-actions { display: flex; gap: 8px; }
.music-upload-label { cursor: pointer; }

/* ── Preview modal ── */
.modal-preview { max-width: 420px; }

.preview-body {
  display: flex;
  justify-content: center;
  padding: 24px;
  background: #000;
}

.preview-phone {
  width: 270px;
  height: 480px;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 2px var(--border), 0 16px 48px rgba(0,0,0,0.6);
  position: relative;
}

.preview-phone video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Three-button action row */
.action-row {
  grid-template-columns: 1fr 1fr 1fr;
}

/* ── Thumbnail strip ── */
.thumbnail-strip {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.thumbnail-strip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.thumbnail-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.thumb-img {
  width: 64px;
  height: 114px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}
.thumb-img:hover { border-color: var(--gold-dim); }
.thumb-img.selected { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-glow); }

/* ── Calendar modal ── */
.modal-calendar { max-width: 900px; width: 95vw; }
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  min-height: 240px;
}
.cal-day {
  background: var(--bg-panel);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 180px;
}
.cal-day.today { background: var(--bg-hover); }
.cal-day-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cal-day.today .cal-day-label { color: var(--gold); }
.cal-event {
  background: var(--gold-glow);
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  padding: 5px 7px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cal-time { font-size: 10px; color: var(--gold-dim); font-weight: 600; }
.cal-name { font-size: 11px; color: var(--text); line-height: 1.3; }
.cal-empty { font-size: 12px; color: var(--text-dim); text-align: center; margin-top: 12px; }

/* ── Scene image preview ── */
.scene-image-area {
  width: 100%;
  height: 120px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.scene-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-sm);
}
.scene-img-placeholder {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
  text-align: center;
  padding: 8px;
}
.scene-img-error { color: var(--red); }
.scene-regen-btn { margin-top: 6px; width: 100%; }

/* ── Brand settings modal ── */
.modal-brand { max-width: 520px; }
.brand-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

/* ── Library modal ── */
.modal-library {
  max-width: 960px;
  width: 95vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}
.lib-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
}
.lib-card:hover { border-color: var(--gold-dim); transform: translateY(-2px); }
.lib-card.done { border-color: var(--border); }
.lib-card.error { border-color: var(--red-dim); }

.lib-thumb-wrap {
  width: 100%;
  aspect-ratio: 9/16;
  max-height: 180px;
  overflow: hidden;
  background: var(--bg);
}
.lib-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lib-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-dim);
}
.lib-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.lib-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lib-meta { font-size: 11px; color: var(--text-dim); }
.lib-stages { display: flex; gap: 4px; }
.lib-stage {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--bg);
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.lib-stage-done    { background: var(--green-dim); color: var(--green); }
.lib-stage-error   { background: var(--red-dim);   color: var(--red); }
.lib-stage-running { background: var(--blue-dim);  color: var(--blue); }
.lib-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.lib-yt-badge {
  font-size: 10px;
  font-weight: 600;
  color: #ff0000;
  text-decoration: none;
  padding: 2px 6px;
  border: 1px solid rgba(255,0,0,0.3);
  border-radius: 3px;
}
.lib-yt-badge:hover { background: rgba(255,0,0,0.1); }
.lib-scheduled-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--gold);
  padding: 2px 6px;
  border: 1px solid var(--gold-dim);
  border-radius: 3px;
}

/* ── Library legend ── */
.library-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
}
.legend-divider {
  color: var(--border);
  font-size: 16px;
  margin: 0 4px;
}

/* ── Global refine toolbar ── */
.refine-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.refine-toolbar-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: 4px;
}
.refine-status {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  margin-left: 4px;
}

/* ── Per-scene refine panel ── */
.refine-panel {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.refine-toggle {
  align-self: flex-start;
  color: var(--gold-dim);
}
.refine-toggle:hover { color: var(--gold); }
.refine-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.refine-quick-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.refine-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.15s;
}
.refine-chip:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
}
.refine-custom {
  display: flex;
  gap: 6px;
  align-items: center;
}
.refine-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 12px;
  padding: 6px 10px;
  outline: none;
}
.refine-input:focus { border-color: var(--gold-dim); }
.refine-preview {
  background: var(--bg);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.refine-preview-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--gold-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.refine-preview-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  font-style: italic;
}
.refine-preview-actions {
  display: flex;
  gap: 6px;
}

/* ── Video settings panel ── */
.video-settings-panel {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.video-settings-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.video-settings-toggle:hover { color: var(--text); }
.settings-chevron { font-size: 14px; color: var(--text-dim); }
.video-settings-body {
  padding: 4px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border);
}
.settings-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
}
.settings-row label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}
.settings-unit { color: var(--text-dim); font-size: 10px; }
.settings-row input[type="range"] {
  width: 120px;
  accent-color: var(--gold);
  cursor: pointer;
  padding: 0;
  border: none;
  background: none;
}
.settings-val {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  min-width: 48px;
  text-align: right;
  font-family: monospace;
}

/* ── Stage timeline ── */
.stage-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  position: relative;
}
.timeline-connector {
  height: 2px;
  flex: 0.5;
  background: var(--border);
  margin-bottom: 18px;
  transition: background 0.3s;
}
.tstep-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  transition: all 0.2s;
}
.tstep-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.tstep-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tstep-status {
  font-size: 10px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.timeline-step .stage-btn {
  position: absolute;
  top: -6px;
  right: -8px;
  padding: 2px 8px;
  font-size: 10px;
}

/* Timeline step states */
.timeline-step.done .tstep-icon {
  background: var(--green-dim);
  border-color: var(--green);
  color: var(--green);
}
.timeline-step.done .tstep-status { color: var(--green); }
.timeline-step.running .tstep-icon {
  background: var(--blue-dim);
  border-color: var(--blue);
  color: var(--blue);
  animation: spin 1.5s linear infinite;
}
.timeline-step.running .tstep-status { color: var(--blue); }
.timeline-step.error .tstep-icon {
  background: var(--red-dim);
  border-color: var(--red);
  color: var(--red);
}
.timeline-step.error .tstep-status { color: var(--red); }

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

/* ── Compact log ── */
.log-compact {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-input);
}
.log-compact-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
  min-height: 36px;
}
.log-compact-bar:hover { background: var(--bg-hover); }
.log-last-msg {
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}
.log-last-done  { color: var(--green); }
.log-last-error { color: var(--red); }
.log-compact-actions { display: flex; align-items: center; gap: 8px; }
.log-chevron { font-size: 12px; color: var(--text-dim); }
.log-drawer {
  border-top: 1px solid var(--border);
  max-height: 160px;
}
.log-drawer .log-output {
  max-height: 160px;
  padding: 8px 12px;
}

/* ── Compact scene cards ── */
.scene-card-compact .scene-image-area { height: 60px; }
.scene-card-compact .scene-fields { display: none; }
.scene-card-compact .refine-panel { display: none; }
.scene-card-compact .scene-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.scene-card-compact .scene-number { min-width: 60px; }

/* ── Toast notifications ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s ease;
  max-width: 300px;
}
.toast-show { opacity: 1; transform: translateY(0); }
.toast-success { border-color: var(--green); color: var(--green); }
.toast-error   { border-color: var(--red);   color: var(--red);   }
.toast-info    { border-color: var(--gold-dim); }

/* ── Preview + Publish combined modal ── */
.modal-preview {
  max-width: 480px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.modal-preview .preview-body,
.modal-preview .thumbnail-strip,
.modal-preview .preview-publish {
  flex-shrink: 0;
}
.modal-preview .modal-scroll-body {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.modal-preview .modal-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
}
.preview-publish {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.publish-panel-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.publish-form-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Smart run buttons ── */
.timeline-step.done .stage-btn { opacity: 0.6; }
.timeline-step.done .stage-btn:hover { opacity: 1; }

/* ── Drag-over textarea ── */
textarea.drag-over {
  border-color: var(--gold) !important;
  background: var(--gold-glow) !important;
}

/* ── Undo toast button ── */
.toast-undo-btn {
  background: none;
  border: 1px solid currentColor;
  border-radius: 3px;
  color: inherit;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  margin-left: 8px;
  font-family: var(--font-body);
}
.toast-undo-btn:hover { opacity: 0.8; }

/* ── Context snap animation ── */
@keyframes context-snap {
  0%   { box-shadow: inset 0 0 0 0 var(--gold-glow); }
  40%  { box-shadow: inset 0 0 0 2px var(--gold-glow); }
  100% { box-shadow: inset 0 0 0 0 transparent; }
}
.context-snap {
  animation: context-snap 0.6s ease-out;
}

/* ── Prominent music track when selected ── */
.music-selected-name {
  color: var(--gold);
  font-weight: 600;
  font-size: 13px;
}

/* ── Visual hierarchy: active stage dominates ── */
.timeline-step.running {
  transform: scale(1.05);
  transition: transform 0.2s;
}
.timeline-step.pending { opacity: 0.6; }
.timeline-step.done { opacity: 0.85; }

/* ── Scene delete button ── */
.scene-delete-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 3px;
  line-height: 1;
  transition: all 0.15s;
  opacity: 0;
}
.scene-card:hover .scene-delete-btn { opacity: 1; }
.scene-delete-btn:hover { color: var(--red); background: var(--red-dim); }

/* ── Max scenes input ── */
#max-scenes { width: 80px; }

/* ── Music direction panel ── */
.music-direction {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.music-dir-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.music-dir-mood {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.music-dir-arc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  font-style: italic;
}
.music-dir-terms-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.music-dir-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.music-dir-term {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.15s;
}
.music-dir-term:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
}

/* ── Cost estimate modal ── */
.modal-cost { max-width: 440px; }
.cost-balance {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}
.cost-balance-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cost-balance-value {
  font-size: 14px;
  font-weight: 700;
  font-family: monospace;
  color: var(--text-muted);
}
.cost-balance-value.cost-ok   { color: var(--green); }
.cost-balance-value.cost-warning { color: var(--red); }
.cost-balance-value.cost-muted { color: var(--text-dim); font-weight: 400; font-size: 12px; }

.cost-breakdown { display: flex; flex-direction: column; gap: 6px; }
.cost-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.cost-row:last-of-type { border-bottom: none; }
.cost-row span:last-child { font-family: monospace; color: var(--text); }
.cost-cached span { color: var(--green) !important; }
.cost-total {
  font-weight: 700;
  color: var(--text) !important;
  border-top: 2px solid var(--border) !important;
  margin-top: 4px;
  padding-top: 8px !important;
}
.cost-total span { color: var(--gold) !important; }
.cost-disclaimer {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 6px;
  font-style: italic;
}
.cost-alert {
  background: var(--red-dim);
  border: 1px solid var(--red);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--red);
  margin-top: 10px;
}
.cost-loading { font-size: 13px; color: var(--text-dim); font-style: italic; }

/* ── Destructive run warning ── */
.cost-overwrite {
  background: rgba(201, 168, 76, 0.1);
  border-color: var(--gold-dim) !important;
  color: var(--gold) !important;
}

/* ── Brand settings tabs ── */
.brand-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  gap: 0;
}
.brand-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 12px 16px;
  margin-bottom: -1px;
  transition: all 0.15s;
}
.brand-tab:hover { color: var(--text); }
.brand-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ── Prompt preview ── */
.prompt-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 8px;
}
.prompt-preview-text {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
}

/* ── Format selector ── */
.format-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.format-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.format-cards {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.format-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  flex: 1;
  min-width: 100px;
}
.format-card:hover { border-color: var(--gold-dim); }
.format-card.active {
  border-color: var(--gold);
  background: var(--gold-glow);
}
.format-icon {
  font-size: 9px;
  font-weight: 800;
  color: var(--text-dim);
  border: 1.5px solid var(--border);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}
.format-916  { width: 18px; height: 32px; }
.format-169  { width: 32px; height: 18px; }
.format-11   { width: 24px; height: 24px; }
.format-card.active .format-icon { border-color: var(--gold); color: var(--gold); }
.format-info { display: flex; flex-direction: column; gap: 1px; }
.format-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.format-desc { font-size: 10px; color: var(--text-dim); }
.format-card.active .format-name { color: var(--gold); }
.format-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.platform-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 8px;
}

/* ── Re-render modal ── */
.modal-rerender { max-width: 520px; }
.rerender-source {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-style: italic;
}
.rerender-directions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rerender-dir {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.rerender-dir:hover { border-color: var(--gold-dim); }
.rerender-dir.active {
  border-color: var(--gold);
  background: var(--gold-glow);
}
.rdir-icon {
  font-size: 20px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
  color: var(--text-dim);
}
.rerender-dir.active .rdir-icon { color: var(--gold); }
.rdir-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}
.rdir-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.rerender-estimate {
  margin-top: 16px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ── Library re-render button ── */
.lib-rerender-btn {
  font-size: 10px;
  opacity: 0;
  transition: opacity 0.15s;
}
.lib-card:hover .lib-rerender-btn { opacity: 1; }

/* ── Scene media area (replaces image-only area) ── */
.scene-media-area {
  width: 100%;
  height: 130px;
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  transition: border-color 0.15s;
}
.scene-media-area:hover { border-color: var(--gold-dim); }
.scene-media-area.media-drag-over {
  border-color: var(--gold);
  background: var(--gold-glow);
}
.scene-media-area video,
.scene-media-area img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.scene-media-actions {
  position: absolute;
  bottom: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.scene-media-area:hover .scene-media-actions { opacity: 1; }
.scene-upload-btn {
  cursor: pointer;
  background: rgba(0,0,0,0.7) !important;
  border-color: rgba(255,255,255,0.2) !important;
  color: var(--text) !important;
  font-size: 10px !important;
}
.scene-media-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0,0,0,0.7);
  border: 1px solid var(--gold-dim);
  border-radius: 3px;
  color: var(--gold);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  letter-spacing: 0.04em;
}

/* ── Upload media mode ── */
.upload-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 16px;
  text-align: center;
  transition: all 0.15s;
  cursor: pointer;
  background: var(--bg-input);
}
.upload-drop-zone.drop-active {
  border-color: var(--gold);
  background: var(--gold-glow);
}
.drop-zone-icon { font-size: 28px; margin-bottom: 8px; color: var(--text-dim); }
.drop-zone-text { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.drop-zone-hint { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

.upload-media-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }

.upload-clip-card {
  display: flex;
  gap: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  position: relative;
}
.upload-clip-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.upload-clip-preview {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg);
}
.upload-clip-type {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.upload-clip-right { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.upload-clip-filename {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-clip-desc {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 12px;
  padding: 6px 8px;
  resize: vertical;
  outline: none;
  line-height: 1.4;
}
.upload-clip-desc:focus { border-color: var(--gold-dim); }
.upload-clip-desc::placeholder { color: var(--text-dim); }
.upload-clip-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 3px;
}
.upload-clip-remove:hover { color: var(--red); background: var(--red-dim); }

/* ── Scene drag and drop ── */
.scene-drag-handle {
  cursor: grab;
  color: var(--text-dim);
  font-size: 16px;
  padding: 0 4px;
  user-select: none;
  flex-shrink: 0;
  transition: color 0.15s;
}
.scene-drag-handle:hover { color: var(--gold); }
.scene-drag-handle:active { cursor: grabbing; }

.scene-card-ghost {
  opacity: 0.4;
  background: var(--bg-input);
  border: 2px dashed var(--gold-dim) !important;
}
.scene-card-chosen {
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  border-color: var(--gold-dim) !important;
  transform: scale(1.01);
}

/* ── Upload clip drag handle ── */
.upload-clip-drag-handle {
  cursor: grab;
  color: var(--text-dim);
  font-size: 16px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  align-self: stretch;
  flex-shrink: 0;
  user-select: none;
  transition: color 0.15s;
}
.upload-clip-drag-handle:hover { color: var(--gold); }
.upload-clip-drag-handle:active { cursor: grabbing; }

/* ── Voice selector ── */
.voice-selector-panel {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.voice-selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.voice-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.voice-current-name {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}
.voice-search-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 12px;
  padding: 6px 10px;
  outline: none;
  margin-bottom: 6px;
}
.voice-search-input:focus { border-color: var(--gold-dim); }
.voice-list { display: flex; flex-direction: column; }
.voice-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
}
.voice-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.1s;
}
.voice-item:hover { background: var(--bg-hover); }
.voice-item-info { display: flex; flex-direction: column; gap: 1px; }
.voice-item-name { font-size: 12px; font-weight: 600; color: var(--text); }
.voice-item-meta { font-size: 10px; color: var(--text-dim); }
.voice-item-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ── Toggle switch ── */
.settings-toggle-row { align-items: center; }
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: all 0.2s;
}
.toggle-slider:before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: all 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--green-dim); border-color: var(--green); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(16px); background: var(--green); }

/* ── Scene trim panel ── */
.scene-trim-panel {
  background: var(--bg);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.trim-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.trim-row label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-width: 32px;
}
.trim-input {
  width: 72px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: monospace;
  font-size: 12px;
  padding: 4px 6px;
  outline: none;
}
.trim-input:focus { border-color: var(--gold-dim); }
.trim-unit { font-size: 10px; color: var(--text-dim); }
.trim-hint { font-size: 10px; color: var(--text-dim); font-style: italic; }

/* ── Settings number input (replaces range for duration) ── */
.settings-number-input {
  width: 72px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: monospace;
  font-size: 13px;
  padding: 4px 8px;
  outline: none;
  text-align: right;
}
.settings-number-input:focus { border-color: var(--gold-dim); }
