:root {
  /* tokens */
  --bg: #0B0B0F;
  --bg-1: #111116;
  --bg-2: #16161D;
  --bg-3: #1E1E27;
  --line: #24242F;
  --line-2: #2E2E3A;
  --ink: #EDEDF2;
  --ink-2: #A8A8B4;
  --ink-3: #6E6E7C;
  --ink-4: #4A4A58;

  --accent: oklch(68% 0.20 300); /* violet */
  --accent-2: oklch(72% 0.18 200); /* teal */
  --accent-3: oklch(78% 0.16 80);  /* amber */

  --radius: 10px;
  --radius-lg: 16px;
  --font-sans: 'Inter', -apple-system, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-display: 'Fraunces', 'Inter', serif;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--line-2); }

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }

.mono { font-family: var(--font-mono); }
.display { font-family: var(--font-display); font-variation-settings: "opsz" 72, "SOFT" 50; }

.app-root {
  display: grid;
  grid-template-columns: 220px 1fr;
  height: 100vh;
  background: var(--bg);
  transition: grid-template-columns 180ms ease;
}
.app-root.sidebar-collapsed {
  grid-template-columns: 56px 1fr;
}

/* ─── Sidebar ─── */
.sidebar {
  background: var(--bg-1);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  gap: 4px;
  min-width: 0;
  position: relative;
  z-index: 5;
  transition: padding 180ms ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
  position: relative;
  padding: 6px 34px 20px 10px;
  letter-spacing: -0.01em;
}
.sidebar-brand .logo {
  flex: 0 0 auto;
  width: 22px; height: 22px; border-radius: 6px;
  background: conic-gradient(from 210deg, oklch(68% 0.20 300), oklch(72% 0.18 200), oklch(78% 0.16 80), oklch(68% 0.20 300));
  position: relative;
}
.sidebar-brand .logo::after {
  content: ""; position: absolute; inset: 4px; border-radius: 3px; background: var(--bg-1);
}
.sidebar-brand-name { font-weight: 600; font-size: 15px; }
.sidebar-brand-sub { color: var(--ink-3); font-size: 11px; margin-top: -3px; }
.sidebar-brand-copy {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 120ms ease, transform 180ms ease;
}
.sidebar-toggle {
  position: absolute;
  top: 4px;
  right: 2px;
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in oklch, var(--bg-2) 74%, transparent);
  color: var(--ink-3);
  transition: background 140ms, border-color 140ms, color 140ms, transform 180ms ease;
}
.sidebar-toggle:hover {
  background: var(--bg-2);
  border-color: var(--line-2);
  color: var(--ink);
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms, color 120ms;
}
.nav-item:hover { background: var(--bg-2); color: var(--ink); }
.nav-item.active { background: var(--bg-3); color: var(--ink); }
.nav-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.nav-item.active .dot { background: var(--accent); }
.library-album-action-slot {
  width: 22px;
  height: 22px;
  margin-left: auto;
  display: inline-grid;
  place-items: center;
  position: relative;
  flex: 0 0 22px;
}
.library-album-count {
  color: var(--ink-4);
  font-family: var(--font-mono);
  font-size: 10px;
  transition: opacity 120ms;
}
.library-album-delete {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #ff6b81;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms, background 120ms, color 120ms;
}
.library-album-item.can-delete:hover .library-album-count { opacity: 0; }
.library-album-item.can-delete:hover .library-album-delete {
  opacity: 1;
  pointer-events: auto;
}
.library-album-delete:hover {
  background: rgba(255,107,129,0.16);
  color: #ff8da0;
}
.nav-section { font-size: 10.5px; color: var(--ink-4); text-transform: uppercase; letter-spacing: 0.08em; padding: 14px 10px 6px; font-weight: 600; }

.sidebar-spacer { flex: 1; }

.sidebar-collapsed .sidebar {
  padding: 18px 8px;
  align-items: center;
}
.sidebar-collapsed .sidebar-brand {
  width: 100%;
  justify-content: center;
  padding: 6px 0 20px;
}
.sidebar-collapsed .sidebar-brand-copy,
.sidebar-collapsed .nav-section,
.sidebar-collapsed .library-album-action-slot,
.sidebar-collapsed .sidebar > div:last-of-type {
  opacity: 0;
  transform: translateX(-6px);
  pointer-events: none;
}
.sidebar-collapsed .sidebar-brand-copy,
.sidebar-collapsed .nav-section,
.sidebar-collapsed .library-album-action-slot {
  width: 0;
  height: 0;
  padding: 0;
  overflow: hidden;
}
.sidebar-collapsed .sidebar-toggle {
  right: -21px;
  z-index: 3;
  background: var(--bg-2);
  box-shadow: 0 10px 26px rgba(0,0,0,0.28);
}
.sidebar-collapsed .nav-item {
  position: relative;
  width: 38px;
  min-height: 38px;
  justify-content: center;
  gap: 0;
  padding: 0;
  overflow: visible;
  white-space: nowrap;
}
.sidebar-collapsed .nav-item > span:not(.dot),
.sidebar-collapsed .nav-item > svg + span {
  display: none !important;
}
.sidebar-collapsed .nav-item .dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
}
.sidebar-collapsed .sidebar .nav-item + div[style*="border-left"] {
  display: none;
}
.sidebar-collapsed .sidebar .nav-item[style*="margin-top"] {
  margin-top: 0 !important;
}
.sidebar-collapsed .nav-item[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  z-index: 20;
  max-width: 220px;
  padding: 7px 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: color-mix(in oklch, var(--bg-2) 92%, black);
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  text-overflow: ellipsis;
  overflow: hidden;
  transition: opacity 120ms ease, transform 120ms ease;
}
.sidebar-collapsed .nav-item[data-tooltip]::before {
  content: "";
  position: absolute;
  left: calc(100% + 7px);
  top: 50%;
  z-index: 21;
  width: 8px;
  height: 8px;
  border-left: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  background: color-mix(in oklch, var(--bg-2) 92%, black);
  transform: translateY(-50%) rotate(45deg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}
.sidebar-collapsed .nav-item[data-tooltip]:hover::after,
.sidebar-collapsed .nav-item[data-tooltip]:hover::before {
  opacity: 1;
}
.sidebar-collapsed .nav-item[data-tooltip]:hover::after {
  transform: translateY(-50%) translateX(0);
}

/* ─── Main area ─── */
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.topbar {
  height: 46px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
  background: var(--bg);
  flex-shrink: 0;
}
.breadcrumb {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--ink-3);
}
.breadcrumb .current { color: var(--ink); }
.breadcrumb .sep { color: var(--ink-4); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.pill-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg-1);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  transition: all 140ms;
}
.pill-btn:hover { border-color: var(--line-2); color: var(--ink); background: var(--bg-2); }
.pill-btn.primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.pill-btn.primary:hover { background: #fff; color: #000; }
.pill-btn.accent {
  background: color-mix(in oklch, var(--accent) 20%, transparent);
  color: var(--accent);
  border-color: color-mix(in oklch, var(--accent) 40%, transparent);
}
.pill-btn.accent:hover { background: color-mix(in oklch, var(--accent) 30%, transparent); }
.pill-btn.danger { color: #ff6b81; border-color: rgba(255,107,129,0.35); }
.pill-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.view { flex: 1; overflow: auto; }

/* ─── Album Hub ─── */
.hub-header {
  padding: 44px 52px 28px;
  display: flex;
  gap: 36px;
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
}
.hub-cover {
  width: 200px; height: 200px;
  border-radius: 8px;
  background: linear-gradient(135deg, oklch(45% 0.18 300) 0%, oklch(40% 0.15 250) 40%, oklch(50% 0.15 30) 100%);
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.08) inset;
  flex-shrink: 0;
}
.hub-cover::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.2), transparent 60%);
}
.hub-cover .cover-title {
  position: absolute; bottom: 14px; left: 16px; right: 16px;
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: 28px; line-height: 1; letter-spacing: -0.01em;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0,0,0,0.4);
}
.hub-meta .label { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.hub-meta .title {
  font-family: var(--font-display); font-weight: 600;
  font-size: 64px; line-height: 0.95; letter-spacing: -0.03em;
  margin: 6px 0 14px;
  color: var(--ink);
}
.hub-meta .subtitle {
  color: var(--ink-2); font-size: 13.5px;
}
.hub-meta .subtitle strong { color: var(--ink); font-weight: 500; }

.hub-actions { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }

.song-table {
  padding: 16px 52px 80px;
}
.song-row-header, .song-row {
  display: grid;
  grid-template-columns: 40px 1fr 200px 140px 100px 58px 124px;
  gap: 16px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 8px;
}
.song-row-header {
  font-size: 11px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 14px;
}
.song-row {
  position: relative;
  cursor: pointer;
  transition: background 120ms, opacity 120ms, transform 120ms;
}
.song-row:hover { background: var(--bg-1); }
.song-row.is-dragging {
  opacity: 0.42;
  background: var(--bg-1);
}
.song-row.is-drag-over-before::before,
.song-row.is-drag-over-after::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 18px color-mix(in oklch, var(--accent) 45%, transparent);
  pointer-events: none;
}
.song-row.is-drag-over-before::before { top: -1px; }
.song-row.is-drag-over-after::after { bottom: -1px; }
.song-row .num { color: var(--ink-3); font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
.num-cell {
  position: relative;
  width: 28px;
  height: 28px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.num-cell .num-value {
  transition: opacity 120ms, color 120ms;
}
.num-cell:hover .num-value,
.num-cell.is-audio-active:hover .num-value,
.num-cell .track-play-toggle.is-loading + .num-value {
  opacity: 0;
}
.num-cell.is-audio-active .num-value {
  color: var(--accent);
}
.track-play-toggle {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--ink);
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 120ms, transform 120ms, background 120ms;
}
.num-cell:hover .track-play-toggle,
.track-play-toggle.is-loading {
  opacity: 1;
  transform: scale(1);
}
.track-play-toggle:hover {
  background: color-mix(in oklch, var(--accent) 28%, transparent);
}
.song-row .song-title { font-weight: 500; font-size: 14px; }
.song-row .song-sub { color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.song-row .status-dot {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--ink-2);
}
.status-dot .sd {
  width: 7px; height: 7px; border-radius: 50%;
}
.sd.ready { background: oklch(72% 0.18 145); }
.sd.draft { background: var(--accent-3); }
.sd.empty { background: var(--ink-4); }
.song-row .duration {
  color: var(--ink-3);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.song-row .row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--ink-4);
  border-radius: 6px;
  opacity: 0.55;
  transition: opacity 120ms, color 120ms, background 120ms;
}
.icon-btn:hover:not(:disabled) {
  opacity: 1;
  color: var(--ink);
  background: var(--bg-2);
}
.icon-btn:disabled {
  opacity: 0.22;
  cursor: not-allowed;
}
.drag-handle {
  cursor: grab;
  color: var(--ink-3);
}
.drag-handle:active {
  cursor: grabbing;
}
.icon-btn.drag-handle:hover {
  color: var(--accent);
}
.song-backup-btn:hover:not(:disabled) {
  color: var(--accent-2);
}
.song-row .scenes-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  background: var(--bg-2);
  border-radius: 4px;
  font-size: 11px;
  color: var(--ink-2);
  font-family: var(--font-mono);
}

.new-song-row,
.song-backup-upload-row {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border-radius: 8px;
  border: 1px dashed var(--line-2);
  color: var(--ink-2);
  cursor: pointer;
  margin-top: 10px;
  transition: all 140ms;
}
.new-song-row:hover,
.song-backup-upload-row:hover:not(.is-busy) {
  border-color: var(--accent);
  color: var(--ink);
  background: color-mix(in oklch, var(--accent) 8%, transparent);
}
.song-backup-upload-row.is-busy {
  opacity: 0.7;
  cursor: wait;
}

/* ─── Creator ─── */
.creator {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  overflow-x: auto;
  flex-shrink: 0;
}
.step {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-3);
  white-space: nowrap;
  transition: all 120ms;
}
.step.active { color: var(--ink); background: var(--bg-2); }
.step.done { color: var(--ink-2); cursor: pointer; }
.step.done:hover { color: var(--ink); background: var(--bg-1); }
.step-num {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-2); border: 1px solid var(--line);
  font-size: 11px; font-family: var(--font-mono); font-weight: 600;
}
.step.active .step-num { background: var(--accent); color: #fff; border-color: var(--accent); }
.step.done .step-num { background: transparent; color: var(--ink-2); border-color: var(--line-2); }
.step.done .step-num::before { content: "✓"; }
.step.done .step-num-val { display: none; }
.step-sep {
  height: 1px; width: 24px; background: var(--line); margin: 0 4px;
  flex-shrink: 0;
}

.creator-body { flex: 1; overflow: auto; padding: 32px 24px 100px; }

.footer-bar {
  height: 56px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 10px;
  flex-shrink: 0;
}

/* ─── Upload ─── */
.upload-zone {
  max-width: 640px;
  margin: 40px auto 0;
  padding: 60px 40px;
  border: 1.5px dashed var(--line-2);
  border-radius: 16px;
  text-align: center;
  transition: all 200ms;
  cursor: pointer;
  background: var(--bg-1);
}
.upload-zone:hover, .upload-zone.dragging {
  border-color: var(--accent);
  background: color-mix(in oklch, var(--accent) 5%, var(--bg-1));
}
.upload-zone .upload-icon {
  width: 54px; height: 54px;
  margin: 0 auto 20px;
  border-radius: 14px;
  background: var(--bg-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.upload-zone h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 24px; margin: 0 0 6px; letter-spacing: -0.02em;
}
.upload-zone p { color: var(--ink-3); margin: 0; font-size: 13px; }
.upload-zone .browse { color: var(--accent); font-weight: 500; }

.uploaded-card {
  max-width: 640px;
  margin: 40px auto 0;
  padding: 24px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex; align-items: center; gap: 18px;
}
.uploaded-card .art {
  width: 64px; height: 64px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.uploaded-card .info { flex: 1; min-width: 0; }
.uploaded-card .fname { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.uploaded-card .fmeta { color: var(--ink-3); font-size: 12px; font-family: var(--font-mono); }

.waveform {
  height: 44px;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0 4px;
}
.waveform-svg {
  display: block;
  width: 100%;
  height: 100%;
}
.waveform-area,
.waveform-line {
  transition: fill 140ms, stroke 140ms, filter 140ms, opacity 140ms, d 90ms linear;
}
.waveform-area {
  fill: rgba(148, 145, 160, 0.28);
}
.waveform-line {
  fill: none;
  stroke: rgba(184, 180, 196, 0.84);
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.waveform.live .waveform-area {
  fill: rgba(67, 199, 224, 0.26);
}
.waveform.live .waveform-line {
  stroke: #43c7e0;
  filter: drop-shadow(0 0 10px rgba(67, 199, 224, 0.28));
}

.spectrum {
  height: 44px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  width: 100%;
  padding: 0 4px;
}
.spectrum-bar {
  flex: 1;
  min-width: 2px;
  border-radius: 999px;
  background: rgba(166, 160, 180, 0.5);
  transition: height 80ms linear, background 120ms, box-shadow 120ms, opacity 120ms;
}
.spectrum.live .spectrum-bar {
  background: #43c7e0;
  box-shadow: 0 0 10px rgba(67, 199, 224, 0.24);
}

/* ─── Transcribe progress ─── */
.process-panel {
  max-width: 720px;
  margin: 40px auto 0;
}
.process-panel h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 28px;
  letter-spacing: -0.02em; margin: 0 0 6px;
}
.process-panel .sub {
  color: var(--ink-3); font-size: 13px; margin-bottom: 28px;
}
.log-viewer {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.8;
  color: var(--ink-2);
  height: 260px;
  overflow-y: auto;
}
.log-viewer .log-line {
  display: grid;
  grid-template-columns: 70px 14px 1fr;
  gap: 10px;
  animation: logIn 300ms ease-out;
}
.log-viewer .log-ts { color: var(--ink-4); }
.log-viewer .log-tag.ok { color: oklch(78% 0.14 145); }
.log-viewer .log-tag.work { color: var(--accent-3); }
.log-viewer .log-tag.info { color: var(--accent-2); }
@keyframes logIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.progress-track {
  height: 4px;
  background: var(--bg-2);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 20px;
  position: relative;
}
.progress-track .bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 200ms linear;
}

/* ─── Lyrics/subtitle editor ─── */
.lyrics-panel { display: grid; grid-template-columns: 1fr 340px; gap: 24px; max-width: 1200px; margin: 0 auto; }
.lyrics-list {
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden;
}
.lyric-row {
  display: grid;
  grid-template-columns: 80px 80px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  transition: background 120ms;
}
.lyric-row:last-child { border-bottom: none; }
.lyric-row:hover { background: var(--bg-2); }
.lyric-row.current { background: color-mix(in oklch, var(--accent) 12%, transparent); }
.lyric-row .ts { color: var(--ink-3); font-family: var(--font-mono); font-size: 11.5px; }
.lyric-row .dur { color: var(--ink-4); font-family: var(--font-mono); font-size: 11px; }
.lyric-row .text { color: var(--ink); }
.lyric-row .conf {
  font-family: var(--font-mono); font-size: 10.5px;
  padding: 2px 6px; border-radius: 3px;
  background: var(--bg-2); color: var(--ink-3);
}

.side-card {
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px;
}
.side-card h3 {
  margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--ink);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.stat-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.stat-row .k { color: var(--ink-3); }
.stat-row .v { color: var(--ink); font-family: var(--font-mono); font-size: 12.5px; }

/* ─── Scene design ─── */
.scene-board { max-width: 1400px; margin: 0 auto; }
.scene-board-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 24px;
}
.scene-board-header h2 { font-family: var(--font-display); font-weight: 600; font-size: 28px; margin: 0; letter-spacing: -0.02em; }
.scene-board-header p { color: var(--ink-3); font-size: 13px; margin: 6px 0 0; }

.scenes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.scene-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: all 160ms;
  display: flex; flex-direction: column;
}
.scene-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.scene-card .art {
  aspect-ratio: 16 / 9;
  background: var(--bg-2);
  position: relative;
  overflow: hidden;
}
.scene-card .art .ts {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 7px; border-radius: 4px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  font-family: var(--font-mono); font-size: 11px; color: #fff;
}
.scene-card .art .scene-num {
  position: absolute; top: 10px; right: 10px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px; color: #fff;
  font-weight: 600;
}
.scene-card .meta { padding: 12px 14px; }
.scene-card .prompt {
  font-size: 12px; color: var(--ink-2);
  font-style: italic;
  margin-bottom: 8px;
  line-height: 1.4;
}
.scene-card .lyric {
  font-size: 13.5px; color: var(--ink);
  line-height: 1.4;
  font-weight: 500;
}
.scene-card.loading .art {
  background: linear-gradient(90deg, var(--bg-2) 0%, var(--bg-3) 50%, var(--bg-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.scene-card.excluded { opacity: 0.45; }
.scene-card.excluded:hover { opacity: 0.65; transform: none; }
.excluded-badge {
  position: absolute; bottom: 8px; right: 8px;
  padding: 2px 6px; border-radius: 4px;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  font-size: 10px; color: #ff8ea1; font-weight: 600; letter-spacing: 0.05em;
}
.scene-source-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0,0,0,0.68);
  border: 1px solid rgba(255,255,255,0.16);
  color: #d8faff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  backdrop-filter: blur(5px);
}
.scene-card-clickable { cursor: pointer; }
.scene-card-clickable:hover .art::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.06);
  border-radius: 10px 10px 0 0;
  pointer-events: none;
}

/* ─── Scene Detail Modal ─── */
.scene-detail-modal {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 16px;
  width: min(800px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,0.65);
  display: flex;
  flex-direction: column;
}
.sdm-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px 13px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.sdm-scene-num {
  font-size: 14px; font-weight: 700;
  color: var(--accent); flex-shrink: 0;
}
.sdm-timestamp {
  font-size: 12px; color: var(--ink-3);
  font-family: var(--font-mono); flex-shrink: 0;
}
.sdm-close {
  margin-left: auto;
  width: 30px; height: 30px;
  border-radius: 50%; font-size: 13px;
  color: var(--ink-3); background: var(--bg-2);
  border: 1px solid var(--line); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.sdm-close:hover { background: var(--bg-3); color: var(--ink); }

/* 단일 컬럼 스크롤 영역 */
.sdm-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* 이미지 — 생성 원본 비율(1:1) */
.sdm-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-0);
  overflow: hidden;
}
.sdm-image-loading {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--ink-3);
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
}

/* 가사 */
.sdm-lyric {
  padding: 12px 22px;
  font-size: 14px; color: var(--ink-2);
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  line-height: 1.55;
}

/* 필드 영역 */
.sdm-fields {
  padding: 18px 22px;
  display: flex; flex-direction: column; gap: 16px;
}
.sdm-field-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.06em; color: var(--ink-3);
  text-transform: uppercase; margin-bottom: 6px;
}
.sdm-label-badge {
  font-size: 9.5px; font-weight: 500;
  letter-spacing: 0.03em; text-transform: none;
  color: var(--ink-4);
  background: var(--bg-3);
  border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 4px;
}
.sdm-textarea {
  width: 100%; box-sizing: border-box;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 13px; color: var(--ink);
  line-height: 1.65; resize: vertical; outline: none;
  font-family: inherit;
}
.sdm-textarea:focus { border-color: var(--accent); }
.sdm-textarea.mono { font-family: var(--font-mono); font-size: 11.5px; }
.sdm-textarea.sdm-readonly {
  opacity: 0.65; cursor: default;
  background: var(--bg-0);
}

/* 접기/펼치기 섹션 */
.sdm-section { display: flex; flex-direction: column; gap: 0; }
.sdm-collapsible-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: none; border: none;
  padding: 7px 10px; border-radius: 8px;
  cursor: pointer; text-align: left;
  color: var(--ink);
}
.sdm-collapsible-btn:hover { background: var(--bg-2); }
.sdm-toggle-icon { font-size: 10px; color: var(--ink-4); margin-left: 8px; flex-shrink: 0; }

/* 액션 */
.sdm-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 13px 22px 18px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.album-info-modal {
  width: min(860px, 96vw);
}
.album-info-cover-preview {
  position: relative;
  width: min(360px, calc(100% - 44px));
  aspect-ratio: 1 / 1;
  margin: 22px auto 0;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-0);
  border: 1px solid var(--line);
  box-shadow: 0 22px 70px rgba(0,0,0,0.35);
}
.album-info-grid {
  padding: 18px 22px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.2fr) minmax(120px, 0.5fr);
  gap: 12px;
}
.album-info-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  outline: none;
  padding: 10px 13px;
  font-size: 13px;
}
.album-info-input:focus {
  border-color: var(--accent);
}
.album-info-inline-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 760px) {
  .album-info-grid {
    grid-template-columns: 1fr;
  }
  .sdm-actions {
    flex-wrap: wrap;
  }
}

/* ─── Scene Common Settings Modal ─── */
.scene-common-modal {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 16px;
  width: min(860px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,0.65);
  display: flex;
  flex-direction: column;
}
.scene-common-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.scene-common-guide {
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.65;
  display: grid;
  gap: 10px;
}
.scene-common-guide .mono {
  color: var(--ink-3);
  font-size: 11px;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
.scene-common-error {
  border: 1px solid rgba(255,107,129,0.35);
  background: rgba(255,107,129,0.08);
  color: #ff8ea1;
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
}
.scene-option-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}
.scene-option-card {
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
  color: var(--ink-2);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: border-color 140ms, background 140ms, transform 140ms;
}
.scene-option-card:hover:not(:disabled) {
  border-color: var(--line-2);
  background: var(--bg-3);
  transform: translateY(-1px);
}
.scene-option-card.active {
  border-color: color-mix(in oklch, var(--accent) 55%, transparent);
  background: color-mix(in oklch, var(--accent) 13%, var(--bg-2));
  color: var(--ink);
}
.scene-option-card span {
  font-size: 12.5px;
  font-weight: 700;
}
.scene-option-card small {
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.45;
}
.scene-global-image-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255,255,255,0.025), rgba(255,255,255,0.005));
  border-radius: 14px;
  padding: 12px;
}
.scene-global-image-preview {
  position: relative;
  min-height: 180px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.scene-global-image-preview img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  aspect-ratio: 16 / 9;
}
.scene-global-image-meta {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0,0,0,0.68);
  border: 1px solid rgba(255,255,255,0.13);
  backdrop-filter: blur(10px);
  display: grid;
  gap: 2px;
}
.scene-global-image-meta strong {
  font-size: 12px;
  color: #fff;
  overflow-wrap: anywhere;
}
.scene-global-image-meta span {
  font-size: 10.5px;
  color: rgba(255,255,255,0.62);
}
.scene-common-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}
@media (max-width: 900px) {
  .scene-option-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.scene-common-empty {
  border: 1px dashed var(--line-2);
  color: var(--ink-4);
  background: var(--bg-2);
  border-radius: 10px;
  padding: 22px 14px;
  text-align: center;
  font-size: 12px;
  grid-column: 1 / -1;
}
.scene-common-image-card {
  position: relative;
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 10px;
  overflow: hidden;
}
.scene-common-image-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--bg-0);
}
.scene-common-image-card .sdm-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border-color: rgba(255,255,255,0.2);
}
.scene-common-image-meta {
  padding: 9px 10px 10px;
  display: grid;
  gap: 3px;
}
.scene-common-image-meta .mono {
  color: var(--ink-2);
  font-size: 10.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.scene-common-image-meta span {
  color: var(--ink-4);
  font-size: 10.5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ─── Preview player ─── */
.preview-shell {
  max-width: 1100px; margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}
.preview-stage {
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  border: 1px solid var(--line);
}
.preview-controls {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 12px;
}
.preview-time { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2); min-width: 94px; }
.preview-scrub {
  flex: 1;
  height: 4px; background: var(--bg-3); border-radius: 2px;
  position: relative; cursor: pointer;
}
.preview-scrub .fill { height: 100%; background: var(--accent); border-radius: 2px; position: relative; }
.preview-scrub .fill::after {
  content: ""; position: absolute; right: -6px; top: -4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff;
}
.play-circle-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--ink); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: transform 120ms;
}
.play-circle-btn:hover { transform: scale(1.06); }

/* video subtitle overlay */
.video-subtitle {
  position: absolute;
  left: 0; right: 0;
  padding: 0 8%;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0,0,0,0.8), 0 1px 2px rgba(0,0,0,1);
  pointer-events: none;
}
.video-subtitle .text {
  display: inline-block;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  animation: subIn 400ms ease-out;
}
.video-subtitle.lines-mode {
  padding: 0 6%;
}
.video-subtitle .subtitle-stack {
  position: relative;
  width: 100%;
  min-height: calc(var(--subtitle-line-step, 56px) * 3);
}
.video-subtitle .subtitle-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  font-size: var(--subtitle-font-size, 36px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.24;
  text-align: center;
  white-space: nowrap;
  transform-origin: center center;
  transition:
    transform 260ms ease,
    opacity 260ms ease,
    filter 260ms ease;
}
.video-subtitle .subtitle-line.is-prev {
  opacity: 0.34;
  filter: blur(0.2px);
  transform: translateY(calc(-50% - var(--subtitle-line-step, 56px))) scale(0.94);
}
.video-subtitle .subtitle-line.is-current {
  opacity: 1;
  filter: none;
  transform: translateY(-50%) scale(1);
}
.video-subtitle .subtitle-line.is-next {
  opacity: 0.52;
  filter: blur(0.1px);
  transform: translateY(calc(-50% + var(--subtitle-line-step, 56px))) scale(0.96);
}
.video-subtitle .subtitle-word {
  display: inline-block;
  transition:
    color 120ms linear,
    text-shadow 120ms linear;
}
.video-subtitle .subtitle-word.is-active {
  color: #FFD700;
  text-shadow: 0 0 8px rgba(255,196,79,0.5);
}
.video-subtitle .subtitle-gap {
  display: inline-block;
  width: 0.42em;
}
@keyframes subIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ─── Export ─── */
.export-panel {
  max-width: 720px; margin: 0 auto;
}
.video-play-panel {
  max-width: min(1600px, calc(100vw - 96px));
}
.export-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 14px;
}
.export-card h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.export-card p { margin: 0 0 14px; color: var(--ink-3); font-size: 12.5px; }
.file-list { display: flex; flex-direction: column; gap: 6px; }
.file-row {
  display: grid;
  grid-template-columns: 18px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--bg-2);
  font-family: var(--font-mono);
  font-size: 12px;
}
.file-row .k { color: var(--ink-3); }
.file-row .sz { color: var(--ink-3); font-size: 11px; min-width: 52px; text-align: right; }
.pill-btn.sm { height: 22px; padding: 0 9px; font-size: 11px; border-radius: 5px; gap: 4px; }

.video-play-grid {
  display: block;
}
.video-play-stage-card {
  padding: 20px;
}
.video-play-stage-shell {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  box-shadow: 0 22px 80px rgba(0,0,0,0.35);
  min-height: min(72vh, calc(100vh - 260px));
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-play-stage {
  display: block;
  width: 100%;
  height: min(72vh, calc(100vh - 260px));
  background: #000;
}
.video-play-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-3);
  font-size: 13px;
}
.video-play-error {
  color: #ff7b72;
  font-size: 13px;
}
@media (max-width: 1100px) {
  .video-play-panel {
    max-width: 100%;
  }
  .video-play-stage-shell {
    min-height: 0;
  }
  .video-play-stage {
    height: auto;
    aspect-ratio: 16 / 9;
  }
}

/* ─── Viewer ─── */
.viewer-shell {
  max-width: 1200px; margin: 0 auto;
  padding: 40px 24px;
}
.viewer-stage {
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  border: 1px solid var(--line);
}
.viewer-stage:fullscreen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
  border: none;
}
.viewer-stage:fullscreen .viewer-video {
  width: 100%;
  height: 100%;
}
.viewer-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.viewer-queue {
  display: flex; gap: 10px;
  padding: 16px 0;
  overflow-x: auto;
}
.queue-item {
  flex-shrink: 0;
  width: 160px;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: all 140ms;
}
.queue-item.current { border-color: var(--accent); }
.queue-item .thumb { aspect-ratio: 16/9; background: var(--bg-2); position: relative; }
.queue-item .name {
  padding: 8px 2px 4px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-item .sub { font-size: 10.5px; color: var(--ink-3); padding: 0 2px; font-family: var(--font-mono); }

.viewer-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 14px;
}

/* ─── Modal ─── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  animation: fade 180ms;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  width: 440px;
  max-width: 90vw;
  box-shadow: 0 30px 90px rgba(0,0,0,0.5);
}
.modal h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.modal p { margin: 0 0 18px; color: var(--ink-3); font-size: 13px; }
.modal input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}
.modal input:focus { border-color: var(--accent); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.batch-render-modal {
  width: 680px;
}
.batch-render-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.batch-render-status {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  background: var(--bg-2);
  font-size: 11px;
  font-family: var(--font-mono);
}
.batch-render-status.running {
  color: var(--accent-2);
  border-color: color-mix(in oklch, var(--accent-2) 36%, transparent);
}
.batch-render-status.done {
  color: oklch(78% 0.14 145);
  border-color: color-mix(in oklch, oklch(78% 0.14 145) 36%, transparent);
}
.batch-render-status.error,
.batch-render-status.stopped {
  color: #ff8da0;
  border-color: rgba(255,107,129,0.35);
}
.batch-render-options {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in oklch, var(--bg-2) 78%, transparent);
}
.batch-render-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.batch-render-option input,
.batch-render-check {
  width: 16px !important;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  flex: 0 0 auto;
}
.batch-render-option span {
  display: grid;
  gap: 3px;
}
.batch-render-option strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.batch-render-option em {
  color: var(--ink-3);
  font-size: 11.5px;
  font-style: normal;
}
.batch-render-select-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.batch-render-select-actions span {
  margin-left: auto;
  color: var(--ink-3);
  font-size: 11px;
}
.batch-render-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0 0;
}
.batch-render-summary > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
}
.batch-render-summary strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--ink);
}
.batch-render-summary span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--ink-3);
}
.batch-render-progress {
  margin-top: 16px;
}
.batch-render-stage {
  margin-top: 8px;
  color: var(--ink-3);
  font-size: 11px;
}
.batch-render-list {
  margin-top: 16px;
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}
.batch-render-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 92px 70px;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}
.batch-render-row:last-child {
  border-bottom: 0;
}
.batch-render-row.active {
  background: color-mix(in oklch, var(--accent) 8%, transparent);
}
.batch-render-row.excluded {
  opacity: 0.58;
}
.batch-render-index {
  color: var(--ink-4);
  font-size: 11px;
}
.batch-render-title {
  min-width: 0;
}
.batch-render-title span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--ink);
}
.batch-render-title em {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-3);
  font-size: 11px;
  font-style: normal;
}
.batch-render-mini {
  height: 4px;
  border-radius: 999px;
  background: var(--bg-2);
  overflow: hidden;
}
.batch-render-mini > div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 180ms linear;
}
.batch-render-badge {
  justify-self: end;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
}
.batch-render-badge.excluded {
  color: var(--ink-4);
}
.batch-render-badge.done,
.batch-render-badge.skipped {
  color: oklch(78% 0.14 145);
}
.batch-render-badge.rendering,
.batch-render-badge.bundling,
.batch-render-badge.uploading,
.batch-render-badge.uploading-video {
  color: var(--accent-2);
}
.batch-render-badge.error,
.batch-render-badge.stopped {
  color: #ff8da0;
}
.batch-render-error {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,107,129,0.28);
  border-radius: 10px;
  color: #ff8da0;
  background: rgba(255,107,129,0.08);
  font-size: 12px;
}

/* ─── Tweaks panel ─── */
.tweaks-panel {
  position: fixed;
  bottom: 16px; right: 16px;
  width: 280px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  z-index: 200;
  font-size: 13px;
}
.tweaks-panel h4 { margin: 0 0 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink); }
.tweaks-panel p { margin: 0 0 12px; font-size: 11px; color: var(--ink-3); }
.tweak-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 12px; }
.tweak-row .label { color: var(--ink-2); }
.swatch-row { display: flex; gap: 6px; }
.swatch {
  width: 20px; height: 20px; border-radius: 5px;
  cursor: pointer;
  border: 2px solid transparent;
}
.swatch.active { border-color: var(--ink); }
.seg {
  display: inline-flex; background: var(--bg-2); border-radius: 6px; padding: 2px;
}
.seg button {
  padding: 3px 8px; font-size: 11px; color: var(--ink-3); border-radius: 4px;
}
.seg button.active { background: var(--bg-3); color: var(--ink); }

/* empty states */
.empty-state {
  text-align: center; padding: 80px 20px; color: var(--ink-3); font-size: 13px;
}

/* notifications */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--bg-3); border: 1px solid var(--line-2);
  padding: 10px 18px; border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  z-index: 300;
  animation: toastIn 240ms;
}
@keyframes toastIn { from { transform: translate(-50%, 10px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
