:root {
  --bg: #0a0c10;
  --panel: #12161d;
  --panel-2: #181d26;
  --line: #242b37;
  --text: #eef1f5;
  --muted: #8b95a5;
  --accent: #ffc531;
  --accent-ink: #1a1405;
  --danger: #e5383b;
  --ok: #3ccf8e;
  --radius: 14px;
  --display: "Bebas Neue", Impact, sans-serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(255, 197, 49, 0.08), transparent 60%),
    radial-gradient(900px 500px at 0% 10%, rgba(229, 56, 59, 0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(10, 12, 16, 0.75); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.2px; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink); font-size: 13px;
}
.nav nav { display: flex; gap: 22px; color: var(--muted); font-size: 14px; }
.nav nav a:hover { color: var(--text); }
.nav nav { align-items: center; }
.stopped { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(10, 12, 16, 0.94); text-align: center; padding: 24px; }
.stopped h2 { font: 400 44px/1 var(--display); letter-spacing: 1px; margin: 0 0 10px; }

main { max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px) 80px; }

/* Hero */
.hero { padding: clamp(48px, 9vw, 110px) 0 40px; text-align: center; }
.kicker {
  font: 500 12px/1 var(--mono); letter-spacing: 4px; text-transform: uppercase;
  color: var(--accent); margin: 0 0 18px;
}
.hero h1 {
  font: 400 clamp(52px, 9vw, 108px)/0.9 var(--display); letter-spacing: 1px;
  margin: 0 0 18px;
}
.sub { color: var(--muted); max-width: 560px; margin: 0 auto 36px; font-size: 16px; }

.composer {
  max-width: 820px; margin: 0 auto; text-align: left;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: 20px; padding: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.prompt { display: flex; gap: 12px; align-items: flex-start; padding: 6px 6px 10px; }
.prompt-caret { font: 500 26px/1.3 var(--mono); color: var(--accent); }
.prompt textarea {
  flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: var(--text);
  font: 500 20px/1.45 var(--body); padding: 2px 0;
}
.prompt textarea::placeholder { color: #566072; }

.examples { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 6px 14px; border-bottom: 1px solid var(--line); }
.chip {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  padding: 6px 12px; border-radius: 999px; font-size: 13px;
}
.chip:hover { color: var(--text); border-color: #3a4352; }

.options { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; padding: 14px 6px 4px; }
.segmented { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.segmented legend { font: 500 11px/1 var(--mono); letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span {
  display: block; padding: 8px 14px; border-radius: 10px; font-size: 14px; font-weight: 600;
  background: #0d1015; border: 1px solid var(--line); color: var(--muted);
}
.segmented input:checked + span { background: rgba(255, 197, 49, 0.12); border-color: var(--accent); color: var(--accent); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.generate {
  margin-left: auto; border: 0; border-radius: 12px; padding: 13px 22px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 15px;
  box-shadow: 0 10px 30px rgba(255, 197, 49, 0.25);
}
.generate:hover { filter: brightness(1.05); }
.generate:disabled { opacity: 0.6; cursor: progress; }
.form-note { min-height: 20px; margin: 10px 6px 0; font-size: 13px; color: var(--muted); }
.form-note.error { color: var(--danger); }

/* Sections */
.section { padding-top: 56px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin-bottom: 18px; }
.section h2 { font: 400 40px/1 var(--display); letter-spacing: 1px; margin: 0; }
.hint { color: var(--muted); font-size: 13px; margin: 0; }
.empty {
  border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px;
  color: var(--muted); text-align: center; font-size: 14px;
}

/* Jobs */
.jobs { display: grid; gap: 14px; }
.job { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.job-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.job-topic { margin: 0; font-size: 17px; font-weight: 600; }
.job-meta { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.badge {
  flex: none; font: 500 11px/1 var(--mono); letter-spacing: 1.5px; text-transform: uppercase;
  padding: 7px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
}
.badge.running { color: var(--accent); border-color: rgba(255, 197, 49, 0.4); }
.badge.done { color: var(--ok); border-color: rgba(60, 207, 142, 0.4); }
.badge.failed, .badge.interrupted { color: var(--danger); border-color: rgba(229, 56, 59, 0.4); }

.stages { list-style: none; margin: 16px 0 12px; padding: 0; display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; }
.stage { font-size: 12px; color: var(--muted); }
.stage::before {
  content: ""; display: block; height: 4px; border-radius: 4px; background: var(--line); margin-bottom: 7px;
}
.stage.done { color: var(--text); }
.stage.done::before { background: var(--ok); }
.stage.active { color: var(--accent); font-weight: 600; }
.stage.active::before { background: linear-gradient(90deg, var(--accent), rgba(255, 197, 49, 0.25)); animation: pulse 1.4s ease-in-out infinite; }
.stage.failed { color: var(--danger); }
.stage.failed::before { background: var(--danger); }
@keyframes pulse { 50% { opacity: 0.45; } }

.job-line { margin: 0; font: 500 12.5px/1.5 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-line.error { color: var(--danger); white-space: normal; }
.job-log { margin-top: 10px; }
.job-log summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
.job-log pre {
  max-height: 260px; overflow: auto; background: #07090c; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; font: 12px/1.5 var(--mono); color: #b9c1cd; white-space: pre-wrap;
}

/* Library */
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.video-card {
  text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0; overflow: hidden; transition: transform 0.15s ease, border-color 0.15s ease;
}
.video-card:hover { transform: translateY(-2px); border-color: #3a4352; }
.thumb { position: relative; aspect-ratio: 16 / 9; background: #07090c; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.duration, .mode {
  position: absolute; bottom: 8px; font: 500 11px/1 var(--mono); padding: 5px 7px; border-radius: 6px;
  background: rgba(0, 0, 0, 0.75);
}
.duration { right: 8px; }
.mode { left: 8px; color: var(--accent); letter-spacing: 1px; text-transform: uppercase; }
.video-info { padding: 12px 14px 14px; }
.video-title { margin: 0 0 4px; font-size: 15px; font-weight: 600; line-height: 1.35; }
.video-date { margin: 0; color: var(--muted); font-size: 12.5px; }

/* Viewer */
.viewer {
  width: min(1000px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0;
  border: 1px solid var(--line); border-radius: 18px; background: var(--panel); color: var(--text);
}
.viewer::backdrop { background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px); }
.viewer-inner { position: relative; }
.viewer video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.close {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, 0.6);
}
.viewer-body { padding: 18px 22px 22px; display: grid; gap: 16px; }
.field-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.field-head span { font: 500 11px/1 var(--mono); letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.copy { border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 4px 10px; font-size: 12px; color: var(--muted); }
.copy:hover { color: var(--text); }
.viewer-title { margin: 0; font-size: 20px; font-weight: 700; }
.viewer-description {
  margin: 0; max-height: 180px; overflow: auto; white-space: pre-wrap; font: 13.5px/1.55 var(--body); color: #c8cfda;
  background: #0d1015; border: 1px solid var(--line); border-radius: 10px; padding: 12px;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: #0d1015; border: 1px solid var(--line); color: #c8cfda; }
.viewer-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button {
  display: inline-block; padding: 10px 16px; border-radius: 10px; font-weight: 700; font-size: 14px;
  background: var(--accent); color: var(--accent-ink);
}
.button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }

@media (max-width: 720px) {
  .nav nav { display: none; }
  .stages { grid-template-columns: repeat(4, 1fr); row-gap: 12px; }
  .generate { width: 100%; margin-left: 0; }
  .prompt textarea { font-size: 17px; }
}

/* ---------- Project editor ---------- */
.button.small { padding: 7px 12px; font-size: 13px; border: 0; cursor: pointer; }
.button { border: 0; cursor: pointer; }
.button:disabled { opacity: 0.55; cursor: not-allowed; }
.editor { max-width: 1320px; padding-top: 28px; }
.editor-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.editor-head .kicker { text-align: left; margin-bottom: 10px; }
.editor-title { font: 400 clamp(34px, 5vw, 52px)/1 var(--display); letter-spacing: 1px; margin: 0 0 6px; }
.editor-actions { display: flex; gap: 10px; }
.render-status { min-height: 22px; margin: 14px 0 0; font: 500 13px/1.5 var(--mono); color: var(--muted); }
.render-status.active { color: var(--accent); }
.render-status.done { color: var(--ok); }
.render-status a { text-decoration: underline; }

.editor-grid { display: grid; grid-template-columns: minmax(260px, 360px) 1fr; gap: 20px; margin-top: 18px; align-items: start; }
.scene-list {
  list-style: none; margin: 0; padding: 0 4px 0 0; display: grid; gap: 8px;
  max-height: calc(100vh - 220px); overflow: auto; position: sticky; top: 80px;
}
.scene-card {
  width: 100%; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; display: grid; gap: 6px;
}
.scene-card:hover { border-color: #3a4352; }
.scene-card.selected { border-color: var(--accent); background: #1a1810; }
.scene-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.scene-no { font: 500 12px/1 var(--mono); color: var(--muted); }
.scene-tags { display: flex; gap: 4px; }
.tag { font: 500 10px/1 var(--mono); letter-spacing: 1px; text-transform: uppercase; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.tag.chapter { color: var(--accent); border-color: rgba(255, 197, 49, 0.4); }
.tag.graphic { color: #7cc4ff; border-color: rgba(124, 196, 255, 0.4); }
.tag.treatment { color: #ff9f7c; border-color: rgba(255, 159, 124, 0.4); }
.scene-snippet { margin: 0; font-size: 13px; line-height: 1.4; color: #c8cfda; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.thumb-strip { display: flex; gap: 4px; }
.mini { width: 56px; aspect-ratio: 16 / 9; border-radius: 4px; overflow: hidden; background: #07090c; border: 1px solid var(--line); }
.mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini.missing, .shot.missing .shot-thumb { border-color: var(--danger); background: rgba(229, 56, 59, 0.12); }

.scene-panel { display: grid; gap: 14px; }
.panel-block { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 16px; }
.panel-head h2 { font: 400 28px/1 var(--display); letter-spacing: 1px; }
.narration { margin: 0; font-size: 15px; line-height: 1.6; color: #dfe4ec; }

.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 10px; }
.shot { display: grid; gap: 6px; }
.shot-thumb, .result-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #07090c; border: 1px solid var(--line); }
.shot-thumb img, .result-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot-source { position: absolute; left: 6px; bottom: 6px; font: 500 10px/1 var(--mono); padding: 4px 6px; border-radius: 5px; background: rgba(0, 0, 0, 0.75); color: var(--accent); }
.shot.missing .shot-source { color: var(--danger); }
.shot-desc { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shot-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.shot-actions button { border: 1px solid var(--line); background: transparent; border-radius: 7px; padding: 4px 8px; font-size: 12px; color: var(--text); cursor: pointer; }
.shot-actions button:hover:not(:disabled) { border-color: #3a4352; }
.shot-actions button:disabled { opacity: 0.35; cursor: default; }
.shot-actions .danger { color: var(--danger); }

.graphic-form { display: grid; gap: 10px; }
.field-row { display: grid; grid-template-columns: 170px 1fr; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.field-row[hidden] { display: none; }
#graphic-fields { display: grid; gap: 10px; }
.field-row input, .field-row select, .field-row textarea, .search-row input {
  background: #0d1015; border: 1px solid var(--line); color: var(--text); border-radius: 9px; padding: 8px 10px; font: 14px var(--body);
}
.field-row input:focus, .field-row select:focus, .field-row textarea:focus, .search-row input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-actions { display: flex; justify-content: flex-end; }
#preview-video { width: 100%; max-width: 720px; border-radius: 10px; background: #000; margin-top: 8px; display: block; }
#preview-video[hidden] { display: none; }

.shot-dialog { width: min(1040px, calc(100vw - 32px)); }
.dialog-inner { padding: 22px; position: relative; }
.dialog-inner h2 { margin: 0 40px 14px 0; font-size: 20px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tab { border: 0; background: transparent; color: var(--muted); padding: 8px 12px; border-bottom: 2px solid transparent; cursor: pointer; font-weight: 600; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.search-form { display: grid; gap: 10px; }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 10px; max-height: 52vh; overflow: auto; }
.result { text-align: left; background: transparent; border: 1px solid transparent; border-radius: 12px; padding: 4px; display: grid; gap: 6px; cursor: pointer; }
.result:hover:not(:disabled) { border-color: var(--accent); }
.result:disabled { opacity: 0.5; cursor: progress; }
.result.busy { opacity: 1; border-color: var(--accent); }
.result-desc { margin: 0; font-size: 12px; color: #c8cfda; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.upload-form { display: grid; gap: 12px; }
.dropzone { display: grid; gap: 8px; border: 1px dashed #3a4352; border-radius: 12px; padding: 22px; color: var(--muted); font-size: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  background: #1c222c; border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.toast.error { border-color: rgba(229, 56, 59, 0.6); color: #ffb3b4; }
.toast[hidden] { display: none; }

@media (max-width: 860px) {
  .editor-grid { grid-template-columns: 1fr; }
  .scene-list { position: static; max-height: 320px; }
  .field-row { grid-template-columns: 1fr; }
}

/* Subtitles panel */
.subtitles { margin-top: 18px; }
.subs-body { display: grid; grid-template-columns: 1fr minmax(240px, 380px); gap: 18px; align-items: center; margin: 6px 0 10px; }
.subs-body.disabled { opacity: 0.45; }
.subs-controls { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: flex-end; }
.field-row.compact { grid-template-columns: 1fr; gap: 8px; }
.field-row.compact span { font: 500 11px/1 var(--mono); letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.field-row.compact select { min-width: 190px; }
.subs-controls .segmented legend { margin-bottom: 8px; }
.color-field { display: grid; gap: 8px; font: 500 11px/1 var(--mono); letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.color-field input { width: 54px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 9px; background: #0d1015; cursor: pointer; }
.subs-sample {
  position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; border: 1px solid var(--line);
  background: linear-gradient(160deg, #2a3442, #0e1218 70%);
  display: flex; justify-content: center; align-items: flex-end; padding: 8% 4%;
}
.subs-sample[data-position="top"] { align-items: flex-start; }
.subs-sample[data-position="middle"] { align-items: center; }
.subs-line { font-family: "Montserrat", sans-serif; text-transform: uppercase; text-align: center; line-height: 1.05; -webkit-text-stroke: 1px rgba(0, 0, 0, 0.9); paint-order: stroke fill; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.75); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 42px; height: 24px; border-radius: 999px; background: var(--line); position: relative; transition: background 0.15s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #c8cfda; transition: transform 0.15s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(18px); background: var(--accent-ink); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.subtitles .form-actions { justify-content: space-between; align-items: center; gap: 12px; }
@media (max-width: 860px) { .subs-body { grid-template-columns: 1fr; } }

.segmented label.disabled span { opacity: 0.35; cursor: not-allowed; }

/* ---------- Channels & Review (automation) ---------- */
main.auto { padding-top: 28px; }
.link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.auto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin: 20px 0 28px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.stack-form { display: grid; gap: 8px; margin: 10px 0; }
.auto input:not([type=radio]):not([type=checkbox]):not([type=color]), .auto textarea {
  background: #0d1015; border: 1px solid var(--line); border-radius: 10px; color: var(--text);
  padding: 9px 12px; font: inherit; width: 100%;
}
.auto input[type=time], .auto input[type=number] { width: auto; }
.auto input[type=color] { width: 44px; height: 36px; padding: 2px; background: #0d1015; border: 1px solid var(--line); border-radius: 8px; }
.steps { color: var(--muted); font-size: 13px; padding-left: 18px; margin: 10px 0; }
.steps li { margin-bottom: 4px; }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.channel-list { display: grid; gap: 18px; }
.channel-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 12px; }
.channel-top .channel-name { font: 400 30px/1.1 var(--display) !important; letter-spacing: 1px; flex: 1 1 260px; }
.switch-line { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 600; color: var(--muted); }
.field-label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); margin: 10px 0; }
.field-label.small { display: inline-grid; margin: 0; }
.options.left { justify-content: flex-start; padding-left: 0; }
.channel-actions, .review-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.channel-actions .yt { margin-left: auto; font-size: 13px; color: var(--muted); }
.history ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.badge.ok { color: var(--ok); border-color: rgba(60, 207, 142, 0.4); }
.badge.warn { color: var(--danger); border-color: rgba(229, 56, 59, 0.4); }
.review-list { display: grid; gap: 18px; }
.review { display: grid; grid-template-columns: minmax(280px, 1.1fr) 1fr; gap: 20px; }
.review-media { display: grid; gap: 10px; align-content: start; }
.review-media video, .review-media img, .thumb-preview { width: 100%; border-radius: 10px; background: #000; display: block; }
.thumb-preview { max-width: 320px; margin-top: 10px; }
.review-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.review-title { margin: 2px 0 4px; font-size: 20px; }
.kicker.left { text-align: left; margin: 0; }
.issues { margin: 10px 0; padding-left: 18px; font-size: 13px; color: #f0b4b5; }
.choice { border: 0; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.choice legend { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.choice label { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.report pre { white-space: pre-wrap; font: 12px/1.5 var(--mono); color: var(--muted); }
@media (max-width: 860px) { .review { grid-template-columns: 1fr; } }
.topic-scores { list-style: none; padding: 0; margin: 0 0 6px; display: grid; gap: 4px; font-size: 13px; }
.topic-scores li { display: flex; gap: 8px; align-items: baseline; color: var(--muted); }
.topic-scores b { color: var(--text); font-weight: 600; }
.topic-scores .score { color: var(--accent); font-family: var(--mono); min-width: 2.2em; text-align: right; }
.topic-scores .pin { background: none; border: 0; color: var(--accent); padding: 0; font-size: 15px; }
.sound-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.sound-list { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 8px; }
.sound-list li { display: grid; grid-template-columns: 1fr; gap: 4px; font-size: 13px; }
.sound-list audio { width: 100%; height: 32px; }

/* ---------- Accounts ---------- */
.nav { gap: 16px; }
.account { display: flex; align-items: center; gap: 12px; margin-left: 22px; font-size: 13px; color: var(--muted); }
.account-email { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font-size: inherit; text-decoration: underline; text-underline-offset: 3px; }
.auth-main { min-height: calc(100vh - 62px); display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 28px; }
.auth-card h1 { font: 400 44px/1 var(--display); letter-spacing: 1px; margin: 0 0 8px; }
.auth-card .sub { margin: 0 0 22px; color: var(--muted); }
.auth-card label { display: block; margin: 14px 0 6px; font-size: 13px; color: var(--muted); }
.auth-card input { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; }
.auth-card input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.auth-card .generate { width: 100%; margin: 22px 0 0; }
.auth-error { margin: 14px 0 0; color: var(--danger); font-size: 14px; }
.auth-switch { margin: 18px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.nav a, .nav button { white-space: nowrap; }
@media (max-width: 1100px) { .account-email { display: none; } .nav nav { gap: 16px; } }
@media (max-width: 760px) { .account { margin-left: auto; } }

/* ---------- Plans & credits ---------- */
.credits-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--text); font-size: 13px; font-weight: 600; }
.credits-chip.low { border-color: var(--danger); color: var(--danger); }
.credits-chip:hover { border-color: var(--accent); }
.billing { padding-top: 40px; }
.bill-head h1 { font: 400 clamp(36px, 6vw, 56px)/1 var(--display); letter-spacing: 1px; margin: 6px 0 10px; }
.bill-head .sub { margin: 0; color: var(--muted); }
.bill-banner { margin: 16px 0 0; padding: 12px 16px; border: 1px solid var(--ok); border-radius: 10px; background: rgba(60, 207, 142, 0.08); }
.bill-banner.error { border-color: var(--danger); background: rgba(229, 56, 59, 0.08); }
.bill-now { display: flex; flex-wrap: wrap; align-items: center; gap: 28px 48px; margin: 28px 0 8px; padding: 22px 26px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.bill-label { margin: 0; font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.bill-big { margin: 2px 0; font: 400 34px/1.1 var(--display); letter-spacing: 1px; }
.bill-small { margin: 0; color: var(--muted); font-size: 13px; }
.bill-now .generate { margin-left: auto; }
.interval { display: inline-flex; gap: 4px; margin: 24px 0 18px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.interval label { cursor: pointer; }
.interval input { position: absolute; opacity: 0; pointer-events: none; }
.interval span { display: block; padding: 8px 18px; border-radius: 999px; font-size: 14px; color: var(--muted); }
.interval input:checked + span { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.plan { position: relative; padding: 26px 24px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; }
.plan.popular { border-color: var(--accent); }
.plan.popular::before { content: "Most popular"; position: absolute; top: -11px; left: 20px; padding: 2px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; }
.plan.current { box-shadow: 0 0 0 2px var(--ok); }
.plan h3 { margin: 0; font: 400 30px/1 var(--display); letter-spacing: 1px; }
.price { margin: 12px 0 2px; }
.price .amount { font-size: 40px; font-weight: 700; }
.price .per { color: var(--muted); }
.plan-credits { margin: 0 0 14px; color: var(--accent); font-weight: 600; }
.plan ul { margin: 0 0 22px; padding: 0; list-style: none; color: var(--muted); font-size: 14px; flex: 1; }
.plan li { padding: 5px 0 5px 22px; position: relative; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); }
.plan .generate { width: 100%; margin: 0; }
.generate.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.generate:disabled { opacity: .55; cursor: default; }
.bill-history { margin-top: 48px; }
.bill-history h2 { font: 400 28px/1 var(--display); letter-spacing: 1px; }
.bill-history table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bill-history th { text-align: left; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.bill-history td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.bill-history .num { text-align: right; font-variant-numeric: tabular-nums; }
.bill-history .plus { color: var(--ok); }
.bill-history .minus { color: var(--muted); }
.cost-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.cost-note a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Admin ---------- */
.admin-grant form { width: 100%; }
.grant-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 6px; }
.grant-row input { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; }
.grant-row #g-email { flex: 1 1 260px; }
.grant-row #g-amount { width: 120px; }
.grant-row .generate { margin: 0; }

/* ---------- Narrator picker ---------- */
fieldset.voices { border: 0; padding: 0; margin: 0; min-width: 0; flex: 1 1 100%; }
fieldset.voices legend { padding: 0; margin-bottom: 8px; font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.voice { position: relative; display: flex; align-items: center; gap: 8px; padding: 9px 10px 9px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); cursor: pointer; }
.voice:hover { border-color: #3a4456; }
.voice input { position: absolute; opacity: 0; pointer-events: none; }
.voice:has(input:checked) { border-color: var(--accent); background: rgba(255, 197, 49, 0.08); }
.voice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.voice-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.voice-text .vname { font-size: 15px; }
.voice-text .vdesc { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vplay { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-size: 12px; line-height: 1; }
.vplay:hover, .vplay.playing { border-color: var(--accent); color: var(--accent); }
.kit { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }

/* ---------- Template picker ---------- */
fieldset.looks { border: 0; padding: 0; margin: 0 0 4px; min-width: 0; flex: 1 1 100%; }
fieldset.looks legend { padding: 0; margin-bottom: 8px; font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.tpl { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); cursor: pointer; }
.tpl:hover { border-color: #3a4456; }
.tpl input { position: absolute; opacity: 0; pointer-events: none; }
.tpl:has(input:checked) { border-color: var(--accent); background: rgba(255, 197, 49, 0.08); }
.tpl:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.tpl-art { display: block; height: 64px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); position: relative; overflow: hidden; }
.tpl-documentary .tpl-art { background: linear-gradient(135deg, #2b2418 0 40%, #3a3020 40% 100%); }
.tpl-documentary .tpl-art::before { content: ""; position: absolute; left: 14%; top: 18%; width: 38%; height: 62%; background: #e9dfc7; transform: rotate(-5deg); box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.tpl-documentary .tpl-art::after { content: ""; position: absolute; right: 12%; top: 26%; width: 30%; height: 52%; background: #c9c0a8; transform: rotate(4deg); box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.tpl-explainer .tpl-art { background: linear-gradient(135deg, #10202e, #1b3b52); }
.tpl-explainer .tpl-art::before { content: ""; position: absolute; left: 12%; right: 12%; bottom: 14%; height: 8px; border-radius: 4px; background: rgba(255,255,255,.75); }
.tpl-explainer .tpl-art::after { content: ""; position: absolute; left: 12%; top: 20%; width: 44%; height: 14px; border-radius: 3px; background: var(--accent); }
.tpl-newsreel .tpl-art { background: repeating-linear-gradient(0deg, #3b3b3b 0 2px, #2a2a2a 2px 4px); filter: grayscale(1) contrast(1.1); }
.tpl-newsreel .tpl-art::before { content: ""; position: absolute; inset: 8px 22px; border: 2px solid #bdbdbd; }
.tpl-newsreel .tpl-art::after { content: ""; position: absolute; left: 0; right: 0; top: 0; bottom: 0; background: radial-gradient(circle at 50% 50%, transparent 40%, rgba(0,0,0,.55)); }
.tpl-text { display: flex; flex-direction: column; gap: 2px; }
.tpl-text .tname { font-size: 16px; }
.tpl-text .ttag { font-style: normal; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); }
.tpl-text .tdesc { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.video-expiry { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.video-expiry.soon { color: var(--danger); font-weight: 600; }
.viewer-expiry { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.viewer-expiry.soon { color: var(--danger); }

.job-actions { margin: 10px 0 0; display: flex; align-items: center; gap: 8px; }
