/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --bg:        #080808;
  --bg2:       #111111;
  --bg3:       #1a1a1a;
  --border:    #2a2a2a;
  --yellow:    #FFD700;
  --yellow2:   #FFC200;
  --yellow-dim:#3d3200;
  --text:      #f0f0f0;
  --text2:     #888;
  --text3:     #555;
  --success:   #22c55e;
  --error:     #ef4444;
  --radius:    14px;
  --radius-sm: 8px;
  --font:      'Inter', system-ui, sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--font);
       min-height: 100vh; line-height: 1.6; }
a { text-decoration: none; color: inherit; }
button, select, input, textarea { font-family: var(--font); }

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 240px;
  background: #0a0a0a; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 100;
  padding: 1.5rem 1rem 1.25rem;
}

.sidebar-brand { margin-bottom: 2.5rem; padding: 0 .5rem; }
.brand { display: flex; align-items: center; gap: .75rem; }
.brand-icon {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: var(--yellow); display: flex; align-items: center;
  justify-content: center; font-size: 1rem;
}
.brand-name {
  font-size: 1rem; font-weight: 800; letter-spacing: -.3px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.sidebar-nav { flex: 1; }
.nav-section-label {
  font-size: .65rem; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: 1px;
  padding: 0 .75rem; margin-bottom: .5rem;
}
.sidebar-nav ul { list-style: none; display: flex; flex-direction: column; gap: .15rem; }

.nav-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem .9rem; border-radius: 10px;
  font-size: .875rem; font-weight: 500; color: var(--text2); transition: all .2s;
}
.nav-link:hover { color: var(--text); background: var(--bg3); }
.nav-link.active { color: var(--yellow); background: var(--yellow-dim); font-weight: 600; }
.nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-bottom {
  border-top: 1px solid var(--border); padding-top: 1rem;
  display: flex; flex-direction: column; gap: .5rem;
}
.sidebar-status {
  display: flex; align-items: center; gap: .5rem; padding: .4rem .5rem;
  font-size: .8rem; color: var(--text2);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%;
              background: var(--success); animation: pulse 2s infinite; flex-shrink: 0; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
.sidebar-version { font-size: .7rem; color: var(--text3); padding: 0 .5rem; }

/* ── Layout ────────────────────────────────────────────────────────────────── */
.main { margin-left: 240px; min-height: 100vh; padding: 2.5rem 2.5rem 4rem; }
.main-inner { max-width: 1100px; }

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 2.5rem;
}
.page-title { font-size: 2rem; font-weight: 800; letter-spacing: -.5px; }
.page-sub   { color: var(--text2); margin-top: .25rem; }
.section-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.25rem;
                 color: var(--text2); text-transform: uppercase; letter-spacing: .5px; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1.25rem; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: all .2s; border: none; white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary  { background: var(--yellow); color: #000; }
.btn-primary:hover:not(:disabled) { background: var(--yellow2); transform: translateY(-1px);
                                    box-shadow: 0 4px 20px rgba(255,215,0,.3); }
.btn-outline  { background: transparent; color: var(--yellow);
                border: 1.5px solid var(--yellow); }
.btn-outline:hover:not(:disabled) { background: var(--yellow-dim); }
.btn-lg { padding: .75rem 1.75rem; font-size: 1rem; border-radius: 10px; }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }

/* ── Inputs ────────────────────────────────────────────────────────────────── */
.input {
  width: 100%; padding: .7rem 1rem; border-radius: var(--radius-sm);
  background: var(--bg3); border: 1.5px solid var(--border);
  color: var(--text); font-size: .95rem; outline: none; transition: border .2s;
}
.input:focus { border-color: var(--yellow); }
.input-sm { width: auto; }
textarea.input { resize: vertical; line-height: 1.7; }

.input-row { display: flex; gap: 1rem; }
.input-row .input { flex: 1; }
.action-row { display: flex; gap: .75rem; align-items: center; margin-top: 1.25rem;
              flex-wrap: wrap; }
.action-row .input { flex: 1; min-width: 220px; }

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
}

/* ── Stats ─────────────────────────────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
             margin-bottom: 2.5rem; }
.stat-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  text-align: center; transition: border .2s;
}
.stat-card:hover { border-color: var(--yellow); }
.stat-icon  { font-size: 1.75rem; margin-bottom: .5rem; }
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--yellow); }
.stat-label { font-size: .8rem; color: var(--text2); margin-top: .2rem;
              text-transform: uppercase; letter-spacing: .5px; }

/* ── Resume banner ─────────────────────────────────────────────────────────── */
.resume-banner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1.25rem 1.5rem;
  background: var(--yellow-dim); border: 1px solid var(--yellow);
  border-radius: var(--radius); margin-bottom: 2.5rem;
}
.resume-info  { display: flex; align-items: center; gap: 1rem; }
.resume-icon  { font-size: 1.5rem; }
.resume-title { font-size: .8rem; color: var(--yellow); font-weight: 600;
                text-transform: uppercase; letter-spacing: .5px; }
.resume-topic { font-weight: 700; font-size: 1.05rem; }

/* ── Pipeline ──────────────────────────────────────────────────────────────── */
.pipeline-grid {
  display: flex; align-items: center; gap: 0;
  overflow-x: auto; padding-bottom: .25rem; margin-bottom: 3rem;
  scrollbar-width: none; -ms-overflow-style: none;
}
.pipeline-grid::-webkit-scrollbar { display: none; }
.pipeline-step {
  flex-shrink: 0; background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem 1.25rem; text-align: center;
  min-width: 160px; transition: all .2s;
}
.pipeline-step:hover { border-color: var(--yellow); transform: translateY(-2px); }
.pipeline-arrow { color: var(--text3); font-size: 1.5rem; padding: 0 .5rem; flex-shrink: 0; }
.step-num   { font-size: .75rem; color: var(--yellow); font-weight: 700;
              letter-spacing: 1px; margin-bottom: .5rem; }
.step-icon  { font-size: 2rem; margin-bottom: .75rem; }
.step-title { font-weight: 700; margin-bottom: .25rem; }
.step-desc  { font-size: .8rem; color: var(--text2); line-height: 1.5; }

/* ── Quick actions ─────────────────────────────────────────────────────────── */
.quick-actions { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }
.quick-card {
  position: relative; background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem 1.5rem;
  transition: all .25s; cursor: pointer; display: block;
}
.quick-card:hover { border-color: var(--yellow); transform: translateY(-3px);
                    box-shadow: 0 8px 30px rgba(255,215,0,.1); }
.quick-card.featured { border-color: var(--yellow); background: var(--yellow-dim); }
.qc-badge { position: absolute; top: 1rem; right: 1rem;
            background: var(--yellow); color: #000; font-size: .65rem;
            font-weight: 800; padding: .2rem .5rem; border-radius: 4px;
            letter-spacing: .5px; }
.qc-icon  { font-size: 2.5rem; margin-bottom: 1rem; }
.qc-title { font-size: 1.1rem; font-weight: 700; margin-bottom: .35rem; }
.qc-desc  { font-size: .85rem; color: var(--text2); }

/* ── Step wizard ───────────────────────────────────────────────────────────── */
.steps-bar {
  display: flex; gap: 0; margin-bottom: 2rem;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .5rem; overflow-x: auto;
}
.step-item {
  flex: 1; min-width: 80px; text-align: center; padding: .6rem .5rem;
  font-size: .8rem; font-weight: 600; color: var(--text3);
  border-radius: 8px; cursor: pointer; transition: all .2s; white-space: nowrap;
}
.step-item span {
  display: inline-flex; width: 22px; height: 22px; align-items: center;
  justify-content: center; border-radius: 50%; border: 1.5px solid currentColor;
  font-size: .75rem; margin-right: .35rem;
}
.step-item.active { color: var(--yellow); background: var(--yellow-dim); }
.step-item.done   { color: var(--success); }
.step-item.done span { background: var(--success); border-color: var(--success); color: #000; }
.step-item.done span::after { content: '✓'; }

/* ── Step panels ───────────────────────────────────────────────────────────── */
.step-panel { display: none; animation: fadeIn .3s ease; }
.step-panel.active { display: block; }
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }

.step-header {
  display: flex; align-items: flex-start; gap: 1.25rem;
  margin-bottom: 1.75rem;
}
.step-badge {
  flex-shrink: 0; width: 48px; height: 48px; border-radius: 12px;
  background: var(--yellow); color: #000; display: flex; align-items: center;
  justify-content: center; font-size: 1.1rem; font-weight: 900;
}
.step-header h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: .2rem; }
.step-header p  { color: var(--text2); font-size: .9rem; }

/* ── Ideas ─────────────────────────────────────────────────────────────────── */
.ideas-controls { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.25rem; }
.divider-text   { text-align: center; color: var(--text3); margin: 1.25rem 0; font-size: .9rem; }
.ideas-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: .75rem; }
.idea-card {
  background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: 10px; padding: .9rem 1rem;
  font-size: .9rem; cursor: pointer; transition: all .2s;
  display: flex; align-items: flex-start; gap: .75rem;
}
.idea-card:hover, .idea-card.selected {
  border-color: var(--yellow); background: var(--yellow-dim); color: var(--yellow);
}
.idea-num { flex-shrink: 0; color: var(--yellow); font-weight: 700; font-size: .8rem;
            width: 20px; margin-top: 2px; }

/* ── Script area ───────────────────────────────────────────────────────────── */
.script-meta { display: flex; gap: .5rem; margin-bottom: .75rem; }
.script-area { min-height: 280px; font-size: .9rem; }

/* ── Scenes ────────────────────────────────────────────────────────────────── */
.scenes-list { display: flex; flex-direction: column; gap: .5rem;
               margin-bottom: .5rem; max-height: 420px; overflow-y: auto; }
.scene-row {
  display: flex; align-items: flex-start; gap: 1rem;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: .75rem 1rem;
}
.scene-num  { flex-shrink: 0; color: var(--yellow); font-weight: 700;
              font-size: .85rem; width: 28px; }
.scene-desc { font-size: .9rem; color: var(--text2); line-height: 1.5; }

/* ── Images grid ───────────────────────────────────────────────────────────── */
.images-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(180px,1fr));
               gap: .75rem; margin: 1.25rem 0; }
.img-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover;
             border-radius: 8px; border: 2px solid var(--border);
             cursor: pointer; transition: all .2s; }
.img-thumb:hover { border-color: var(--yellow); transform: scale(1.02); }
/* Fade-in + pop animation when a new image arrives in real-time */
@keyframes img-pop { 0% { opacity:0; transform:scale(.88); } 60% { transform:scale(1.04); } 100% { opacity:1; transform:scale(1); } }
.img-thumb-appear { animation: img-pop .55s cubic-bezier(.22,.68,0,1.2) forwards; border-color: var(--yellow) !important; }

/* ── Progress bars ─────────────────────────────────────────────────────────── */
.progress-wrap { margin: 1.25rem 0; }
.progress-label { font-size: .85rem; color: var(--text2); margin-bottom: .5rem; }
.progress-bar { height: 8px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg,var(--yellow),var(--yellow2));
                 border-radius: 99px; transition: width .5s ease; }

/* ── Audio ─────────────────────────────────────────────────────────────────── */
.audio-player { width: 100%; margin-bottom: .75rem;
                accent-color: var(--yellow); }
.vo-filename  { font-size: .8rem; color: var(--text2); }

/* ── Music tracks ──────────────────────────────────────────────────────────── */
.music-tracks { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.25rem; }
.track-card {
  display: flex; align-items: center; gap: 1rem;
  background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: 10px; padding: .9rem 1.25rem; cursor: pointer; transition: all .2s;
}
.track-card:hover, .track-card.selected {
  border-color: var(--yellow); background: var(--yellow-dim);
}
.track-num  { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
              background: var(--bg); border: 1.5px solid var(--border);
              display: flex; align-items: center; justify-content: center;
              font-size: .8rem; font-weight: 700; color: var(--text2); }
.track-card.selected .track-num { background: var(--yellow); border-color: var(--yellow); color: #000; }
.track-info { flex: 1; }
.track-name { font-weight: 600; font-size: .95rem; }
.track-desc { font-size: .8rem; color: var(--text2); margin-top: .1rem; }
.track-check { color: var(--yellow); font-size: 1.1rem; opacity: 0; transition: .2s; }
.track-card.selected .track-check { opacity: 1; }
.status-msg { font-size: .85rem; color: var(--yellow); margin-top: .5rem; }
.music-prev-btn {
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text2); padding: .28rem .65rem;
  border-radius: 6px; font-size: .78rem; cursor: pointer;
  transition: all .2s; white-space: nowrap; flex-shrink: 0;
}
.music-prev-btn:hover { border-color: var(--yellow); color: var(--yellow); }

/* ── Export/Toggle ─────────────────────────────────────────────────────────── */
.export-options { margin-bottom: 1.5rem; }
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem 1.25rem;
}
.toggle-title { font-weight: 600; }
.toggle-sub   { font-size: .8rem; color: var(--text2); margin-top: .2rem; }
.toggle-wrap  { position: relative; flex-shrink: 0; }
.toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-slider {
  display: block; width: 48px; height: 26px; background: var(--bg);
  border: 1.5px solid var(--border); border-radius: 99px; cursor: pointer;
  transition: all .3s; position: relative;
}
.toggle-slider::after {
  content:''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: var(--text3); top: 3px; left: 3px; transition: all .3s;
}
.toggle-input:checked + .toggle-slider { background: var(--yellow-dim); border-color: var(--yellow); }
.toggle-input:checked + .toggle-slider::after { left: 23px; background: var(--yellow); }

/* ── Video result ──────────────────────────────────────────────────────────── */
.video-result { margin-top: 2rem; }
.result-title { font-size: 1.2rem; font-weight: 700; color: var(--success);
                margin-bottom: 1.25rem; }
.video-preview { width: 100%; max-width: 800px; border-radius: 12px;
                 border: 2px solid var(--border); display: block; }
.result-actions { display: flex; gap: 1rem; margin-top: 1.25rem; }

/* ── Log panel ─────────────────────────────────────────────────────────────── */
.log-panel {
  position: fixed; bottom: 1.5rem; right: 1.5rem; width: 420px; max-height: 280px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; z-index: 200;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.log-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; border-bottom: 1px solid var(--border);
  font-size: .85rem; font-weight: 600; color: var(--yellow);
}
.log-close { background: none; border: none; color: var(--text2); cursor: pointer;
             font-size: 1rem; padding: .1rem .3rem; }
.log-close:hover { color: var(--text); }
.log-body { overflow-y: auto; padding: .75rem 1rem; flex: 1; }
.log-line { font-size: .78rem; color: var(--text2); padding: .15rem 0;
            font-family: monospace; border-bottom: 1px solid var(--bg3); }
.log-line:last-child { color: var(--text); }
.log-error { border-color: var(--error) !important; }

/* ── Badge ─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: .2rem .6rem; border-radius: 99px;
  background: var(--yellow-dim); color: var(--yellow);
  font-size: .75rem; font-weight: 700; letter-spacing: .3px;
}

/* ── Spinner ───────────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(0,0,0,.3); border-top-color: #000; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Gallery ───────────────────────────────────────────────────────────────── */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(300px,1fr));
              gap: 1.25rem; margin-bottom: 2.5rem; }
.video-card { background: var(--bg2); border: 1px solid var(--border);
              border-radius: var(--radius); overflow: hidden; transition: all .2s; }
.video-card:hover { border-color: var(--yellow); transform: translateY(-2px); }
.video-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover;
               background: var(--bg3); cursor: pointer; display: block; }
.video-card-info { padding: 1rem; display: flex; align-items: center;
                   justify-content: space-between; gap: .75rem; }
.video-name { font-weight: 600; font-size: .85rem; flex: 1;
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-size { font-size: .8rem; color: var(--text2); flex-shrink: 0; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr));
                gap: .75rem; }
.gallery-item { position: relative; border-radius: 10px; overflow: hidden;
                aspect-ratio: 16/9; cursor: pointer; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: .3s; }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.4);
                   display: flex; align-items: center; justify-content: center;
                   opacity: 0; transition: .2s; }
.gallery-item:hover .gallery-overlay { opacity: 1; }

.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 1000;
            display: none; align-items: center; justify-content: center; }
.lightbox.active { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 10px;
                border: 2px solid var(--border); }

/* ── Empty state ───────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-icon  { font-size: 3rem; margin-bottom: 1rem; }
.empty-title { font-size: 1.2rem; font-weight: 700; margin-bottom: .5rem; }
.empty-sub   { color: var(--text2); margin-bottom: 1.5rem; }

/* ── Settings ──────────────────────────────────────────────────────────────── */
.settings-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1.25rem; }
.settings-card { background: var(--bg2); border: 1px solid var(--border);
                 border-radius: var(--radius); padding: 1.5rem; }
.settings-card-title { font-weight: 700; font-size: 1rem; margin-bottom: 1.25rem;
                       padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.form-group   { margin-bottom: 1.1rem; }
.form-label   { display: block; font-size: .85rem; font-weight: 600;
                color: var(--text2); margin-bottom: .4rem; text-transform: uppercase;
                letter-spacing: .3px; }
.form-hint    { font-size: .78rem; color: var(--text3); margin-top: .35rem; }
.input-with-btn { display: flex; gap: .5rem; }
.input-with-btn .input { flex: 1; }
.link { color: var(--yellow); }
.link:hover { text-decoration: underline; }

.settings-info { background: var(--bg2); border: 1px solid var(--border);
                 border-radius: var(--radius); padding: 1.5rem; margin-top: 2rem; }
.info-title { font-weight: 700; margin-bottom: 1rem; }
.info-list  { list-style: none; display: flex; flex-direction: column; gap: .6rem; }
.info-list li { font-size: .9rem; color: var(--text2); padding-left: 1.25rem; position: relative; }
.info-list li::before { content: '→'; position: absolute; left: 0; color: var(--yellow); }

/* ── Voice selector ─────────────────────────────────────────────────────────── */
.voice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: .75rem; margin-bottom: 1.5rem;
}
.voice-card {
  background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: 10px; padding: .9rem 1rem;
  cursor: pointer; transition: all .2s;
  display: flex; flex-direction: column; gap: .4rem;
}
.voice-card:hover  { border-color: rgba(255,215,0,.5); }
.voice-card.selected { border-color: var(--yellow); background: var(--yellow-dim); }
.voice-name  { font-weight: 700; font-size: .95rem; }
.voice-style { font-size: .72rem; color: var(--yellow); font-weight: 700;
               text-transform: uppercase; letter-spacing: .6px; }
.voice-desc  { font-size: .78rem; color: var(--text2); }
.voice-preview-btn {
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text2); padding: .22rem .55rem;
  border-radius: 6px; font-size: .75rem; cursor: pointer;
  transition: all .2s; white-space: nowrap; flex-shrink: 0;
}
.voice-preview-btn:hover { border-color: var(--yellow); color: var(--yellow); }
.vo-result-label {
  font-size: .85rem; color: var(--success); margin-bottom: .6rem;
}

/* ── Audio list (gallery) ───────────────────────────────────────────────────── */
.audio-list { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1rem; }
.audio-row {
  display: flex; align-items: center; gap: 1rem;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .85rem 1.25rem;
  flex-wrap: wrap;
}
.audio-row-info { flex: 0 0 220px; }
.audio-name { font-weight: 600; font-size: .9rem;
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audio-size { font-size: .75rem; color: var(--text2); margin-top: .1rem; }
.audio-player-inline { flex: 1; min-width: 200px; accent-color: var(--yellow); height: 32px; }

/* ── Dashboard categories ───────────────────────────────────────────────────── */
.stat-icon-text {
  font-size: 1.4rem; font-weight: 900; color: var(--yellow);
  margin-bottom: .5rem; line-height: 1;
}
.stat-icon-svg {
  width: 32px; height: 32px; color: var(--yellow);
  margin: 0 auto .5rem; display: block;
}
.stat-icon-svg svg { width: 100%; height: 100%; }

.category-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
  margin-bottom: 2.5rem;
}
@media (max-width: 1100px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .category-grid { grid-template-columns: 1fr; }
}
.category-card {
  position: relative; background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem 1.5rem;
  display: flex; flex-direction: column; gap: .75rem; transition: all .25s;
  overflow: hidden;
}
.category-active {
  border-color: var(--yellow);
  background: linear-gradient(135deg, var(--bg2) 60%, rgba(255,215,0,.06));
}
.category-active:hover { transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(255,215,0,.12); }
.category-soon { opacity: .6; cursor: default; }

.cat-badge {
  display: inline-block; font-size: .65rem; font-weight: 800;
  padding: .2rem .55rem; border-radius: 4px; letter-spacing: .6px;
  background: var(--yellow); color: #000; align-self: flex-start;
}
.cat-badge-soon { background: var(--bg3); color: var(--text3); }

.cat-character {
  width: 80px; height: 80px; object-fit: cover; border-radius: 50%;
  border: 2px solid var(--yellow); align-self: flex-start;
}
.cat-character-placeholder {
  width: 100%; height: 140px; border-radius: 10px; background: var(--bg3);
  border: 1px solid var(--border); display: flex; align-items: center;
  justify-content: center; font-size: 2.5rem; color: var(--yellow);
  flex-shrink: 0; overflow: hidden; position: relative;
}
.cat-body { flex: 1; }
.cat-title { font-size: 1.05rem; font-weight: 800; margin-bottom: .35rem; }
.cat-desc  { font-size: .82rem; color: var(--text2); line-height: 1.55; }
.cat-stats { font-size: .75rem; color: var(--yellow); margin-top: .5rem;
             font-weight: 600; }
.cat-arrow { font-size: 1.5rem; color: var(--yellow); align-self: center;
             flex-shrink: 0; }

/* ── Character showcase (dashboard) ──────────────────────────────────────────── */
.char-showcase-bar {
  display: flex; align-items: center; gap: 2rem;
  background: linear-gradient(135deg, var(--bg2), rgba(255,215,0,.04));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem 2rem; margin-bottom: 2.5rem; overflow: hidden;
}
.char-showcase-images {
  display: flex; align-items: center; position: relative;
  height: 96px; width: 180px; flex-shrink: 0;
}
.char-showcase-img {
  position: absolute; object-fit: cover;
  border-radius: 50%; border: 2px solid var(--yellow);
}
.char-showcase-left   { width:68px;height:68px; left:0;   top:50%; transform:translateY(-50%) rotate(-8deg) scale(.85); opacity:.6; z-index:1; }
.char-showcase-center { width:84px;height:84px; left:50%; top:50%; transform:translate(-50%,-50%); z-index:3; border-width:3px; }
.char-showcase-right  { width:68px;height:68px; right:0;  top:50%; transform:translateY(-50%) rotate(8deg) scale(.85);  opacity:.6; z-index:2; }
.char-showcase-title { font-size:1.05rem; font-weight:800; margin-bottom:.25rem; }
.char-showcase-sub   { font-size:.82rem; color:var(--text2); }

.step-icon-text { font-size: 1.5rem; color: var(--yellow); margin-bottom: .5rem; }
.qc-icon-text   { font-size: 2rem; font-weight: 900; color: var(--yellow);
                  margin-bottom: 1rem; }
.pipe-icon { width: 36px; height: 36px; color: var(--yellow); margin: 0 auto .6rem; }
.pipe-icon svg { width: 100%; height: 100%; }

/* ── Subtitle step ──────────────────────────────────────────────────────────── */
.sub-row { margin-bottom: 1.25rem; }
.sub-row .form-label { margin-bottom: .5rem; }
.color-swatches { display: flex; gap: .6rem; align-items: center; }
.color-swatch {
  width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; border: 3px solid transparent;
  transition: all .2s; flex-shrink: 0;
}
.color-swatch:hover    { transform: scale(1.12); }
.color-swatch.selected { border-color: var(--yellow); transform: scale(1.18); }
.style-opts { display: flex; gap: .5rem; flex-wrap: wrap; }
.style-opt {
  padding: .38rem .9rem; border-radius: 7px;
  background: var(--bg3); border: 1.5px solid var(--border);
  font-size: .85rem; font-weight: 600; cursor: pointer; transition: all .18s;
  color: var(--text2);
}
.style-opt:hover    { border-color: rgba(255,215,0,.5); color: var(--text); }
.style-opt.selected { border-color: var(--yellow); color: var(--yellow); background: var(--yellow-dim); }
.sub-preview-wrap {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; margin: 1.25rem 0;
  aspect-ratio: 16/9; max-width: 420px;
}
.sub-preview-screen {
  position: relative;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #0d1b33 0%, #1a2e50 100%);
}
.sub-preview-text {
  position: absolute;
  left: 5%; right: 5%; text-align: center;
  font-size: 18px; font-weight: 700; color: #fff;
  text-shadow: 2px 2px 4px rgba(0,0,0,.9); transition: all .18s;
  border-radius: 4px;
}

/* ── More-colors popup ──────────────────────────────────────────────────────── */
.color-more-btn {
  background: var(--bg2); border: 1.5px solid var(--border) !important;
  color: var(--text2); font-size: 1rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .2s;
}
.color-more-btn:hover { border-color: var(--yellow) !important; color: var(--yellow); }
.more-colors-grid {
  display: none; flex-wrap: wrap; gap: .45rem;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: .7rem; margin-top: .5rem;
}
.more-colors-grid.open { display: flex; }

/* ── Volume controls ────────────────────────────────────────────────────────── */
.vol-controls {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem 1.25rem;
  margin-bottom: 1.25rem; display: flex; flex-direction: column; gap: .85rem;
}
.vol-row { display: flex; flex-direction: column; gap: .35rem; }
.vol-label {
  display: flex; justify-content: space-between; align-items: center;
}
.vol-value {
  font-size: .85rem; font-weight: 700; color: var(--yellow);
  min-width: 42px; text-align: right;
}
.vol-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 5px; border-radius: 3px; outline: none;
  background: linear-gradient(to right, var(--yellow) 0%, var(--yellow) var(--pct, 50%), var(--border) var(--pct, 50%), var(--border) 100%);
  cursor: pointer;
}
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--yellow); cursor: pointer;
  border: 2px solid #000; box-shadow: 0 0 4px rgba(255,215,0,.4);
}
.vol-slider::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--yellow); cursor: pointer;
  border: 2px solid #000;
}

/* ── Slider wrap + default marker ─────────────────────────────────────────── */
.slider-wrap {
  position: relative; width: 100%;
}
.slider-wrap .vol-slider { width: 100%; }
.slider-mark {
  position: absolute;
  top: calc(50% - 5px);
  width: 2px; height: 10px;
  background: var(--yellow);
  border-radius: 1px;
  opacity: 0.45;
  pointer-events: none;
  transform: translateX(-50%);
}

/* ── Generation loader bar ──────────────────────────────────────────────── */
.gen-loader {
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.gen-loader-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.gen-loader-bar::after {
  content: '';
  position: absolute;
  left: -40%;
  top: 0; bottom: 0;
  width: 40%;
  background: var(--yellow);
  border-radius: 2px;
  animation: loader-slide 1.4s ease-in-out infinite;
}
@keyframes loader-slide {
  0%   { left: -40%; }
  100% { left: 110%; }
}
.gen-loader-label {
  font-size: .85rem;
  color: var(--muted);
}

/* ── Mix Preview bar ─────────────────────────────────────────────────────── */
.mix-preview-bar {
  display: flex; align-items: center; gap: .75rem;
  padding-top: .5rem; border-top: 1px solid var(--border);
  margin-top: .25rem;
}

/* ── Duration cards ─────────────────────────────────────────────────────────── */
.dur-cards {
  display: flex; gap: .6rem; flex-wrap: wrap;
}
.dur-card {
  padding: .55rem 1.1rem; border-radius: 8px;
  background: var(--bg3); border: 1.5px solid var(--border);
  font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: all .18s; color: var(--text2);
}
.dur-card:hover   { border-color: var(--yellow); color: var(--text); }
.dur-card.selected { border-color: var(--yellow); background: var(--yellow-dim);
                     color: var(--yellow); }

/* ── Projects / Drafts ─────────────────────────────────────────────────────── */
.projects-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}
.project-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.4rem 1.5rem;
  display: flex; flex-direction: column; gap: .75rem;
  transition: all .2s;
}
.project-card:hover { border-color: var(--yellow); transform: translateY(-2px);
                      box-shadow: 0 8px 30px rgba(255,215,0,.07); }

.project-top {
  display: flex; align-items: center; justify-content: space-between;
}
.project-status {
  font-size: .72rem; font-weight: 700; padding: .25rem .65rem;
  border-radius: 99px; letter-spacing: .3px;
}
.status-draft    { background: var(--bg3); color: var(--text2); border: 1px solid var(--border); }
.status-complete { background: rgba(34,197,94,.15); color: var(--success);
                   border: 1px solid rgba(34,197,94,.3); }
.proj-delete-btn {
  background: none; border: none; color: var(--text3); cursor: pointer;
  font-size: .9rem; padding: .2rem .35rem; border-radius: 6px; transition: .2s;
}
.proj-delete-btn:hover { color: var(--error); background: rgba(239,68,68,.1); }

.project-name {
  font-size: 1rem; font-weight: 700; color: var(--text);
  line-height: 1.4;
}
.project-meta {
  display: flex; gap: .75rem; flex-wrap: wrap;
}
.proj-meta-item {
  font-size: .75rem; color: var(--text3);
}

.proj-steps {
  display: flex; gap: .35rem; align-items: center;
}
.proj-step-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg3); border: 1.5px solid var(--border); transition: .2s;
}
.proj-step-dot.dot-done {
  background: var(--yellow); border-color: var(--yellow);
}

.project-preview {
  font-size: .8rem; color: var(--text3); line-height: 1.6;
  border-left: 2px solid var(--border); padding-left: .75rem;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.proj-video-badge {
  font-size: .75rem; color: var(--yellow); background: var(--yellow-dim);
  padding: .3rem .75rem; border-radius: 6px; display: inline-block;
}
.project-actions {
  display: flex; gap: .6rem; align-items: center; margin-top: .25rem;
}

.gallery-del-btn {
  position: absolute; top: .5rem; right: .5rem;
  background: rgba(239,68,68,.85); border: none; color: white;
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  font-size: .75rem; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s; z-index: 10;
}
.gallery-item:hover .gallery-del-btn { opacity: 1; }
.gallery-del-btn:hover { background: #ef4444; transform: scale(1.1); }
.gallery-view-btn {
  background: rgba(0,0,0,.5); border: 1.5px solid rgba(255,255,255,.4);
  color: white; padding: .4rem 1rem; border-radius: 7px;
  font-size: .85rem; cursor: pointer; transition: all .2s;
}
.gallery-view-btn:hover { background: rgba(0,0,0,.75); border-color: white; }

/* ── Auto Mode ─────────────────────────────────────────────────────────────── */
.auto-mode-banner {
  display: flex; align-items: center; gap: 1.25rem;
  background: linear-gradient(135deg, rgba(255,215,0,.08), rgba(255,165,0,.05));
  border: 1.5px solid rgba(255,215,0,.35);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}
.auto-mode-icon { font-size: 2rem; flex-shrink: 0; }
.auto-mode-text { flex: 1; }
.auto-mode-title { font-size: 1.1rem; font-weight: 800; color: var(--yellow); margin-bottom: .2rem; }
.auto-mode-sub   { font-size: .85rem; color: var(--text2); line-height: 1.5; }

.btn-auto {
  flex-shrink: 0;
  background: var(--yellow); color: #000;
  border: none; border-radius: 10px;
  padding: .7rem 1.4rem; font-weight: 800; font-size: .95rem;
  cursor: pointer; transition: all .18s; white-space: nowrap;
}
.btn-auto:hover    { background: #ffe040; transform: translateY(-1px); box-shadow: 0 4px 20px rgba(255,215,0,.35); }
.btn-auto:active   { transform: translateY(0); }
.btn-auto:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* Auto pipeline progress panel */
.auto-progress-title {
  font-size: .9rem; font-weight: 700; color: var(--yellow);
  margin-bottom: 1rem; letter-spacing: .03em;
}
.auto-pipeline-steps {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
}
.ap-step {
  display: flex; flex-direction: column; align-items: center; gap: .2rem;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: .6rem .9rem; min-width: 72px;
  transition: all .25s;
}
.ap-step.ap-running {
  border-color: var(--yellow); background: rgba(255,215,0,.07);
  box-shadow: 0 0 12px rgba(255,215,0,.15);
}
.ap-step.ap-done { border-color: var(--success); background: rgba(34,197,94,.07); }
.ap-icon  { font-size: 1.2rem; line-height: 1; }
.ap-label { font-size: .72rem; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .05em; }
.ap-detail { font-size: .68rem; color: var(--text2); margin-top: .1rem; }
.ap-arrow  { color: var(--text3); font-size: .9rem; flex-shrink: 0; }

/* ── Auto Loading Overlay steps ─────────────────────────────────────────────── */
.alo-step {
  display: flex; align-items: center; gap: .35rem;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px; padding: .45rem .75rem;
  font-size: .8rem; color: var(--text2);
  transition: all .25s;
}
.alo-step.running {
  border-color: var(--yellow); color: var(--yellow);
  background: rgba(255,215,0,.07);
  box-shadow: 0 0 10px rgba(255,215,0,.12);
}
.alo-step.done { border-color: var(--success); color: var(--success); background: rgba(34,197,94,.07); }
.alo-arrow { color: var(--text3); font-size: .85rem; }

/* ── Idea cards in Auto Mode ─────────────────────────────────────────────────── */
.idea-card-auto {
  display: flex; align-items: center;
  border-color: rgba(255,215,0,.2) !important;
  cursor: pointer;
}
.idea-card-auto:hover { border-color: var(--yellow) !important; background: rgba(255,215,0,.07) !important; }
.idea-auto-tag {
  margin-left: auto; padding: .2rem .5rem;
  background: rgba(255,215,0,.15); border-radius: 5px;
  color: var(--yellow); font-size: .7rem; font-weight: 700;
  white-space: nowrap; flex-shrink: 0;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
/* Note: the slide-out mobile sidebar / hamburger lives in base.html so it can
   coexist with the topbar. These rules ONLY adjust content layout -- they must
   NOT redeclare .sidebar or .main margin/width below the 700px breakpoint or
   they will fight base.html. */
@media (max-width: 900px) {
  .sidebar        { width: 200px; }
  .main           { margin-left: 200px; padding: 1.75rem 1.5rem 3rem; }
  .stats-row      { grid-template-columns: repeat(2,1fr); }
  .quick-actions  { grid-template-columns: 1fr; }
  .pipeline-grid  { flex-direction: column; }
  .pipeline-arrow { transform: rotate(90deg); }
  .settings-grid  { grid-template-columns: 1fr; }
  .ideas-grid     { grid-template-columns: repeat(2,1fr); }
  .log-panel      { width: calc(100vw - 2rem); right: 1rem; }
}
@media (max-width: 640px) {
  /* Sidebar + main layout are owned by base.html's slide-out rule (<=700px).
     Only content-grid overrides here. */
  .page-header    { flex-direction: column; }
  .stats-row      { grid-template-columns: repeat(2,1fr); }
  .ideas-grid     { grid-template-columns: 1fr; }
  .input-row      { flex-direction: column; }
  .steps-bar      { flex-wrap: wrap; }
}
