/* ── VIRAL REMAKER — Premium Dark UI v4 ────────────────────── */
:root {
  --bg:         #07070f;
  --bg2:        #0c0c18;
  --surface:    rgba(255,255,255,0.038);
  --surface2:   rgba(255,255,255,0.022);
  --border:     rgba(255,255,255,0.09);
  --border2:    rgba(255,255,255,0.06);
  --gold:       #c9a227;
  --gold2:      #f0cc50;
  --gold-glow:  rgba(201,162,39,0.18);
  --gold-ring:  rgba(201,162,39,0.35);
  --text:       #eeeaf8;
  --muted:      rgba(238,234,248,0.38);
  --muted2:     rgba(238,234,248,0.58);
  --green:      #1fd97a;
  --green-glow: rgba(31,217,122,0.12);
  --red:        #ff3d5e;
  --orange:     #ff8c42;
  --radius:     14px;
  --radius-sm:  9px;
  --radius-xs:  6px;
  --shadow:     0 8px 40px rgba(0,0,0,0.6);
  --shadow-sm:  0 2px 16px rgba(0,0,0,0.45);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(100,60,200,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(201,162,39,0.05) 0%, transparent 50%);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ── ANIMATIONS ── */
@keyframes fade-in    { from { opacity:0 } to { opacity:1 } }
@keyframes slide-in   { from { opacity:0; transform:translateY(12px) } to { opacity:1; transform:translateY(0) } }
@keyframes slide-from-right { from { transform:translateX(100%) } to { transform:translateX(0) } }
@keyframes shimmer    { 0%{width:15%;margin-left:0} 50%{width:35%;margin-left:35%} 100%{width:15%;margin-left:85%} }
@keyframes pulse-bar  { 0%,100%{opacity:1} 50%{opacity:0.4} }
@keyframes spin       { to { transform:rotate(360deg) } }
@keyframes glow-pulse { 0%,100%{box-shadow:0 0 0 0 var(--gold-glow)} 50%{box-shadow:0 0 24px 4px var(--gold-glow)} }

/* ── HEADER ── */
.header {
  position: sticky; top: 0; z-index: 200;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  background: rgba(7,7,15,0.85);
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  border-bottom: 1px solid var(--border);
}
.header::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,162,39,0.3), transparent);
}
.logo {
  font-size: 15px; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(115deg, #c9a227 0%, #f0cc50 45%, #fff8e0 75%, #c9a227 100%);
  background-size: 200% auto;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo span {
  -webkit-text-fill-color: var(--muted);
  font-weight: 400; font-size: 13px; margin-left: 2px;
}
.header-badge {
  font-size: 11px; font-weight: 500;
  color: var(--muted2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 14px;
}

/* ── LAYOUT ── */
.layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  min-height: calc(100vh - 56px);
}

/* ── MAIN ── */
.main {
  padding: 24px 28px;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 16px;
  overflow-y: auto;
}

/* ── SCENE / PHOTO COUNT PICKER ── */
.scene-count-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--muted2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 36px;
}
.scene-count-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}
.scene-count-btn.active {
  background: rgba(201,162,39,0.14);
  border-color: var(--gold-ring);
  color: var(--gold2);
  font-weight: 700;
}

/* ── FORMAT SELECTOR ── */
.format-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}
.format-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  font-family: inherit; color: var(--muted2);
  transition: all 0.18s;
  text-align: left;
}
.format-btn:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.14);
}
.format-btn.active {
  background: rgba(201,162,39,0.09);
  border-color: var(--gold-ring);
  color: var(--text);
}
.format-btn-icon { font-size: 24px; flex-shrink: 0; }
.format-btn-info { display: flex; flex-direction: column; gap: 2px; }
.format-btn-name { font-size: 13px; font-weight: 700; }
.format-btn-dim  { font-size: 11px; color: var(--muted); }
.format-btn.active .format-btn-dim { color: var(--gold); }
.format-btn-check {
  margin-left: auto;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--gold);
  display: none; align-items: center; justify-content: center;
  font-size: 10px; color: #07070f; font-weight: 800; flex-shrink: 0;
}
.format-btn.active .format-btn-check { display: flex; }

/* ── INPUT CARD ── */
.input-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  backdrop-filter: blur(12px);
}
.input-card-title {
  font-size: 10px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1.4px;
  margin-bottom: 13px;
}

/* mode tabs */
.mode-tabs {
  display: flex; gap: 0;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xs);
  padding: 3px;
  width: fit-content;
  margin-bottom: 16px;
}
.mode-tab {
  background: none; border: none;
  border-radius: 4px;
  font-family: inherit; font-size: 12px; font-weight: 600;
  padding: 6px 16px; cursor: pointer;
  color: var(--muted);
  transition: all 0.15s;
}
.mode-tab.active {
  background: var(--gold);
  color: #07070f;
}

.input-row { display: flex; gap: 8px; }
.url-input {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit; font-size: 14px;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.url-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.url-input::placeholder { color: var(--muted); }

.btn-start {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold2) 100%);
  color: #07070f;
  border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px; font-weight: 700;
  padding: 12px 22px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  letter-spacing: 0.1px;
}
.btn-start:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(201,162,39,0.4);
}
.btn-start:active { transform: scale(0.97) translateY(0); }
.btn-start:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }

.platform-hints { display: flex; gap: 5px; margin-top: 10px; flex-wrap: wrap; }
.platform-tag {
  font-size: 10px; color: var(--muted);
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 20px; padding: 3px 9px;
}

/* ── RUN STATUS ── */
.run-status {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
}
.run-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted); flex-shrink: 0;
}
.run-status.running .run-dot { background: var(--gold); animation: glow-pulse 1.4s infinite; }
.run-status.done    .run-dot { background: var(--green); }
.run-status.error   .run-dot { background: var(--red); }
.run-status.waiting .run-dot { background: var(--orange); animation: pulse-bar 1s infinite; }

/* ── COST BAR ── */
.cost-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 16px; font-size: 12px;
}
.cost-bar-label { color: var(--muted); }
.cost-bar-total { font-weight: 700; color: var(--gold2); }
.cost-bar-breakdown { flex: 1; display: flex; gap: 6px; flex-wrap: wrap; }

/* ── PIPELINE ── */
.pipeline-section { display: flex; flex-direction: column; gap: 12px; }
.phase-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.phase-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.018);
}
.phase-number {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface2); color: var(--muted2);
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; border: 1px solid var(--border);
}
.phase-number.active { background: var(--gold); color: #07070f; border-color: var(--gold); }
.phase-number.done   { background: var(--green); color: #07070f; border-color: var(--green); }
.phase-title    { font-size: 13px; font-weight: 600; }
.phase-subtitle { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* ── NODES GRID ── */
.nodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1px;
  background: var(--border);
}
.node-cell {
  background: var(--bg);
  padding: 14px 14px 12px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative; overflow: hidden;
}
.node-cell:hover { background: rgba(255,255,255,0.025); }
.node-cell.selected { background: rgba(201,162,39,0.07); outline: 1px solid var(--gold-ring) inset; }
.node-state-bar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: rgba(255,255,255,0.04); overflow: hidden;
}
.node-state-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  transition: width 0.4s ease;
}
.node-cell.done    .node-state-bar-fill { width: 100%; background: var(--green); }
.node-cell.error   .node-state-bar-fill { width: 100%; background: var(--red); }
.node-cell.running .node-state-bar-fill { animation: shimmer 1.4s infinite; }
.node-cell.waiting .node-state-bar-fill { width: 60%; background: var(--orange); animation: pulse-bar 1s infinite; }
.node-icon   { font-size: 18px; margin-bottom: 6px; }
.node-name   { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.node-model  { font-size: 10px; color: var(--muted); margin-bottom: 5px; }
.node-status { font-size: 11px; color: var(--muted2); min-height: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-pct    { position: absolute; top: 6px; right: 7px; font-size: 10px; font-weight: 700; color: var(--gold); display: none; }
.node-cell.running .node-pct { display: block; }
.node-cell.done    .node-pct { display: block; color: var(--green); }
.node-cell.waiting .node-pct { display: block; color: var(--orange); }
.node-pct.stalled  { color: var(--red); animation: pulse-bar 1.2s infinite; }
.node-cell.done    .node-status { color: var(--green); }
.node-cell.error   .node-status { color: var(--red); }
.node-cell.running .node-status { color: var(--gold); }
.node-cell.waiting .node-status { color: var(--orange); }
.node-retry-btn {
  display: none; margin-top: 7px; padding: 4px 10px;
  background: rgba(255,61,94,0.12); border: 1px solid rgba(255,61,94,0.3);
  border-radius: var(--radius-xs); color: var(--red);
  font-family: inherit; font-size: 10px; cursor: pointer;
}

/* ── PANELS ── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: none;
}
.panel.visible { display: block; animation: slide-in 0.28s ease; }
.panel-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.018);
}
.panel-header-icon  { font-size: 18px; }
.panel-header-title { font-size: 14px; font-weight: 700; flex: 1; }
.panel-header-badge {
  font-size: 10px; font-weight: 600;
  background: rgba(201,162,39,0.12);
  color: var(--gold2);
  border: 1px solid var(--gold-ring);
  border-radius: 20px; padding: 3px 11px;
}
.panel-body { padding: 18px 20px; }
.panel-desc { font-size: 13px; color: var(--muted2); line-height: 1.6; margin-bottom: 16px; }
.panel-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* ── GENERIC BUTTONS ── */
.btn {
  font-family: inherit; font-size: 12px; font-weight: 600;
  border-radius: var(--radius-xs); padding: 8px 16px;
  cursor: pointer; transition: all 0.15s; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  display: inline-flex; align-items: center; gap: 5px;
}
.btn:hover { background: rgba(255,255,255,0.06); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-green {
  background: rgba(31,217,122,0.12); border-color: rgba(31,217,122,0.35); color: var(--green);
}
.btn-green:hover { background: rgba(31,217,122,0.2); }
.btn-red {
  background: rgba(255,61,94,0.10); border-color: rgba(255,61,94,0.3); color: var(--red);
}
.btn-red:hover { background: rgba(255,61,94,0.18); }
.btn-ghost {
  background: var(--surface); border-color: var(--border); color: var(--muted2);
}
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  border: none; color: #07070f; font-weight: 700;
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 4px 20px var(--gold-glow); }
.btn-dl {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(31,217,122,0.1); border: 1px solid rgba(31,217,122,0.28);
  border-radius: var(--radius-xs); color: var(--green);
  font-family: inherit; font-size: 12px; font-weight: 600;
  padding: 8px 16px; cursor: pointer; text-decoration: none;
  transition: all 0.15s;
}
.btn-dl:hover { background: rgba(31,217,122,0.2); }
.btn-lang { flex: 1; min-width: 135px; justify-content: center; padding: 12px 14px; }

/* ── EDIT TEXTAREA ── */
.edit-textarea {
  width: 100%; background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text); font-family: inherit; font-size: 13px;
  line-height: 1.75; padding: 14px 16px; resize: vertical; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.edit-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

/* ── SCENES TOOLBAR ── */
.scenes-toolbar {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.scenes-toolbar-title { font-size: 12px; font-weight: 700; color: var(--muted2); }
.ratio-btn {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xs); color: var(--muted2);
  font-family: inherit; font-size: 11px; font-weight: 600;
  width: 26px; height: 26px; cursor: pointer; transition: all 0.12s;
  display: flex; align-items: center; justify-content: center;
}
.ratio-btn.active, .ratio-btn:hover { background: var(--gold); color: #07070f; border-color: var(--gold); }
.gen-all-progress {
  display: none; align-items: center; gap: 7px;
  font-size: 11px; color: var(--gold);
}
.gen-all-progress.visible { display: flex; }

/* ── SCENES CONTAINER ── */
.scenes-container { display: flex; flex-direction: column; gap: 10px; }

/* ── SCENE CARD ── */
.scene-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.15s;
}
.scene-card:hover { border-color: rgba(255,255,255,0.13); }
.scene-card.img-ready { border-color: rgba(31,217,122,0.22); }
.scene-card.generating { border-color: var(--gold-ring); }
.scene-header {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.scene-badge { font-size: 10px; font-weight: 700; color: var(--muted2); }
.scene-group-tag {
  font-size: 9px; background: rgba(201,162,39,0.12);
  border: 1px solid var(--gold-ring); border-radius: 10px;
  color: var(--gold); padding: 1px 7px;
}
.scene-img-status { font-size: 10px; color: var(--muted); margin-left: auto; }
.scene-img-status.ok  { color: var(--green); }
.scene-img-status.gen { color: var(--gold); }
.scene-img-status.err { color: var(--red); }
.scene-del-btn {
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 13px; padding: 2px 4px;
  transition: color 0.12s;
}
.scene-del-btn:hover { color: var(--red); }
.scene-body { display: flex; gap: 0; }
.scene-text-wrap { flex: 1; padding: 10px 12px; }
.scene-textarea {
  width: 100%; background: transparent;
  border: none; color: var(--text);
  font-family: inherit; font-size: 13px; line-height: 1.7;
  resize: none; outline: none; overflow: hidden;
  min-height: 48px;
}
.scene-image-wrap {
  width: 88px; flex-shrink: 0;
  border-left: 1px solid var(--border);
  position: relative; overflow: hidden;
  min-height: 88px; background: rgba(0,0,0,0.2);
}
.scene-img-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  cursor: pointer; transition: background 0.15s;
}
.scene-img-placeholder:hover { background: rgba(201,162,39,0.08); }
.scene-img-placeholder-icon { font-size: 18px; opacity: 0.4; }
.scene-img-placeholder-text { font-size: 9px; color: var(--muted); text-align: center; }
.scene-img-placeholder-btn {
  display: none; background: var(--gold); border: none;
  border-radius: 4px; color: #07070f; font-size: 9px; font-weight: 700;
  padding: 3px 8px; cursor: pointer; margin-top: 2px;
}
.scene-img-placeholder:hover .scene-img-placeholder-btn { display: block; }
.scene-img-loader {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  background: rgba(7,7,15,0.8);
}
.scene-img-loader-text { font-size: 9px; color: var(--muted2); text-align: center; line-height: 1.4; }
.scene-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  cursor: pointer;
}
.scene-img-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  padding: 6px 4px 4px;
  opacity: 0; transition: opacity 0.15s;
}
.scene-image-wrap:hover .scene-img-overlay { opacity: 1; }
.scene-img-refresh {
  width: 100%; background: none; border: none;
  color: #fff; font-size: 9px; cursor: pointer; padding: 2px 0;
  font-family: inherit;
}
.scene-shared-img-wrap {
  width: 88px; flex-shrink: 0;
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  padding: 8px; background: rgba(0,0,0,0.15);
}
.scene-shared-img { width: 100%; height: auto; border-radius: 4px; }

/* ── SPINNER ── */
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(201,162,39,0.2);
  border-top-color: var(--gold);
  animation: spin 0.8s linear infinite;
}

/* ── EMPTY STATE ── */
.empty-pipeline {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 24px;
  gap: 10px; text-align: center;
}
.empty-pipeline-icon {
  font-size: 44px; margin-bottom: 4px;
  filter: grayscale(0.3);
}
.empty-pipeline-title { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.empty-pipeline-sub { font-size: 13px; color: var(--muted); max-width: 340px; line-height: 1.6; }

/* ── COOKIES ── */
.cookies-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.cookies-header {
  display: flex; align-items: center;
  padding: 11px 16px; cursor: pointer;
  transition: background 0.15s;
}
.cookies-header:hover { background: rgba(255,255,255,0.03); }
.cookies-title  { font-size: 12px; font-weight: 600; flex: 1; }
.cookies-status { font-size: 11px; color: var(--muted2); }
.cookies-body { padding: 14px 16px; border-top: 1px solid var(--border); display: none; }
.cookies-body.open { display: block; }
.cookies-hint { font-size: 11px; color: var(--muted); line-height: 1.6; margin-bottom: 10px; }
.cookies-textarea {
  width: 100%; min-height: 90px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-xs); color: var(--text);
  font-family: monospace; font-size: 11px;
  padding: 8px 10px; resize: vertical; outline: none;
  margin-bottom: 8px;
}

/* ── SIDEBAR ── */
.sidebar {
  display: flex; flex-direction: column;
  background: rgba(7,7,15,0.6);
}
.sidebar-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.015);
  flex-shrink: 0;
}
.sidebar-tab {
  flex: 1; background: none; border: none;
  font-family: inherit; font-size: 12px; font-weight: 600;
  color: var(--muted); padding: 13px 8px; cursor: pointer;
  transition: all 0.15s; border-bottom: 2px solid transparent;
}
.sidebar-tab:hover { color: var(--muted2); }
.sidebar-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.sidebar-pane { display: none; flex: 1; overflow-y: auto; }
.sidebar-pane.active { display: flex; flex-direction: column; }

/* ── DETAIL PANEL ── */
.detail-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px; padding: 32px;
  color: var(--muted); text-align: center;
  font-size: 12px; line-height: 1.6;
}
.detail-empty-icon { font-size: 28px; opacity: 0.4; margin-bottom: 4px; }
.detail-content {
  flex: 1; padding: 14px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
}
.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
}
.detail-card-header {
  font-size: 10px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.8px;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.018);
}
.detail-card-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.detail-row { display: flex; align-items: baseline; gap: 8px; font-size: 12px; }
.detail-key { color: var(--muted); min-width: 60px; flex-shrink: 0; font-size: 11px; }
.detail-val { color: var(--text); word-break: break-all; }
.detail-text { font-size: 12px; color: var(--muted2); line-height: 1.6; }

/* ── ACTIVITY ── */
.activity-list { flex: 1; padding: 10px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; }
.activity-item {
  display: flex; gap: 7px; align-items: flex-start;
  font-size: 11px; color: var(--muted2); line-height: 1.5;
  padding: 4px 0;
}
.activity-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted); flex-shrink: 0; margin-top: 4px;
}
.activity-dot.gold    { background: var(--gold); }
.activity-dot.success { background: var(--green); }
.activity-dot.error   { background: var(--red); }
.activity-dot.warn    { background: var(--orange); }

/* ── VIDEO APPROVAL ── */
.video-preview-wrap {
  border-radius: var(--radius-sm); overflow: hidden;
  background: #000; margin-bottom: 16px;
}
.video-preview-wrap video { width: 100%; display: block; max-height: 340px; object-fit: contain; }

/* ── LANGUAGE GRID ── */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px; margin-top: 4px;
}
.btn-lang-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 13px; cursor: pointer;
  transition: all 0.15s;
  text-align: left; font-family: inherit; color: var(--text);
}
.btn-lang-card:hover:not(:disabled) {
  background: rgba(201,162,39,0.05);
  border-color: var(--gold-ring);
  box-shadow: 0 0 0 2px var(--gold-glow);
}
.btn-lang-card:active:not(:disabled) { transform: scale(0.97); }
.btn-lang-card:disabled { opacity: 0.32; cursor: not-allowed; }
.btn-lang-card.done    { border-color: rgba(31,217,122,0.4); background: var(--green-glow); }
.btn-lang-card.running { border-color: var(--gold-ring); background: var(--gold-glow); }
.btn-lang-card-flag { font-size: 20px; margin-bottom: 4px; }
.btn-lang-card-name { font-size: 12px; font-weight: 600; }
.btn-lang-card-desc { font-size: 10px; color: var(--muted); margin-top: 2px; }
.btn-all-langs {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(201,162,39,0.10), rgba(232,197,71,0.06));
  border: 1px solid rgba(201,162,39,0.30);
  border-radius: var(--radius-sm);
  padding: 12px 18px; cursor: pointer;
  font-family: inherit; color: var(--gold2);
  font-size: 12px; font-weight: 600; text-align: center;
  transition: all 0.15s;
}
.btn-all-langs:hover:not(:disabled) { background: rgba(201,162,39,0.16); box-shadow: 0 4px 16px var(--gold-glow); }
.btn-all-langs:disabled { opacity: 0.32; cursor: not-allowed; }

/* ── OUTPUT CARDS ── */
.outputs-grid { display: flex; flex-direction: column; gap: 8px; }
.output-card {
  background: var(--green-glow);
  border: 1px solid rgba(31,217,122,0.22);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
}
.output-card-flag { font-size: 24px; }
.output-card-info { flex: 1; }
.output-card-lang { font-size: 14px; font-weight: 600; }
.output-card-meta { font-size: 11px; color: var(--muted2); margin-top: 2px; }

/* ── OUTPUTS DRAWER ── */
.drawer-filter {
  background: none; border: none;
  font-family: inherit; font-size: 12px; font-weight: 500;
  color: var(--muted); padding: 10px 16px; cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.drawer-filter:hover { color: var(--muted2); }
.drawer-filter.active { color: var(--gold); border-bottom-color: var(--gold); }
.drawer-section { margin-bottom: 20px; }
.drawer-section-header {
  font-size: 10px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.8px;
  padding: 10px 14px 6px;
  display: flex; align-items: center; gap: 6px; cursor: pointer;
}
.drawer-items { display: flex; flex-direction: column; gap: 6px; padding: 0 12px 8px; }
.drawer-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; cursor: pointer;
  transition: all 0.15s;
}
.drawer-item:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.12); }
.drawer-item-thumb {
  width: 44px; height: 44px; object-fit: cover;
  border-radius: var(--radius-xs); background: var(--bg2); flex-shrink: 0;
}
.drawer-item-info { flex: 1; overflow: hidden; }
.drawer-item-label { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-item-meta  { font-size: 10px; color: var(--muted); margin-top: 2px; }
.drawer-item-actions { display: flex; gap: 4px; flex-shrink: 0; }
.drawer-item-btn {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-xs); color: var(--muted2);
  font-family: inherit; font-size: 11px; padding: 4px 8px; cursor: pointer;
  transition: all 0.12s; white-space: nowrap;
}
.drawer-item-btn:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.drawer-empty {
  text-align: center; padding: 40px 20px;
  color: var(--muted); font-size: 12px;
}

/* ── PREVIEW OVERLAY ── */
.preview-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  animation: fade-in 0.2s;
}
.preview-box {
  position: relative;
  max-width: 90vw; max-height: 90vh;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: slide-in 0.22s;
}
.preview-close {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  background: rgba(0,0,0,0.6); border: none; border-radius: 50%;
  width: 30px; height: 30px; color: #fff;
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.preview-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 8px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  font-size: 12px; color: rgba(255,255,255,0.8);
}

/* ── QG MODAL ── */
.qg-overlay {
  position: fixed; inset: 0; z-index: 700;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  animation: fade-in 0.2s;
}
.qg-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: min(480px, 92vw);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: slide-in 0.25s;
}
.qg-header {
  padding: 16px 20px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.qg-title { font-size: 15px; font-weight: 700; flex: 1; }
.qg-stage { font-size: 11px; color: var(--muted); }
.qg-body  { padding: 18px 20px; }
.qg-score-row { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.qg-score-circle {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.qg-score-num   { font-size: 20px; font-weight: 800; line-height: 1; }
.qg-score-denom { font-size: 9px; color: var(--muted); }
.qg-verdict     { font-size: 14px; font-weight: 700; }
.qg-verdict-sub { font-size: 12px; color: var(--muted2); margin-top: 3px; }
.qg-checks { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.qg-check-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted2);
  padding: 5px 8px; border-radius: var(--radius-xs);
  background: var(--surface);
}
.qg-check-icon { font-size: 13px; flex-shrink: 0; }
.qg-actions { display: flex; gap: 8px; }

/* ── RUN CARD (history) ── */
.run-card {
  margin-bottom: 6px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.run-card:hover { border-color: var(--gold-ring); }

/* ── EMOTION BADGE ── */
.scene-emotion-badge {
  font-size: 10px; font-weight: 700;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px; padding: 1px 7px;
  white-space: nowrap; transition: all 0.3s;
  background: rgba(255,255,255,0.04);
  color: var(--muted2);
}
.scene-emotion-badge.loading { opacity: 0.5; }

/* ── SCENE MUSIC ROW ── */
.scene-music-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.015);
  min-height: 36px;
  transition: background 0.3s;
}
.scene-music-play {
  background: var(--card2); border: 1px solid var(--border2);
  border-radius: 50%; width: 26px; height: 26px;
  color: var(--text); font-size: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.15s;
}
.scene-music-play:hover:not(:disabled) { background: var(--gold); color: #07060e; }
.scene-music-play:disabled { opacity: 0.35; cursor: default; }
.scene-music-info { flex: 1; min-width: 0; }
.scene-music-name {
  font-size: 11px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block;
}
.scene-music-artist {
  font-size: 9px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block;
}
.scene-music-change {
  background: none; border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--muted2);
  font-family: inherit; font-size: 10px; font-weight: 600;
  padding: 3px 9px; cursor: pointer; white-space: nowrap;
  transition: all 0.15s; flex-shrink: 0;
}
.scene-music-change:hover { border-color: var(--gold); color: var(--gold); }

/* ── SCENE VIDEO SECTION ─────────────────────────────────────── */
.scene-vid-section {
  display: none;
  border-top: 1px solid var(--border2);
  padding: 10px 12px 8px;
  background: rgba(16,185,129,0.04);
}
.scene-vid-loader {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(16,185,129,0.06);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--radius-sm);
}
.scene-vid-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(16,185,129,0.15);
  border: 1px solid rgba(16,185,129,0.35);
  color: #10b981;
  white-space: nowrap;
}
