:root {
  --bg: #0b0a0e;
  --panel: #15131a;
  --panel-2: #1d1a24;
  --line: #2c2834;
  --text: #f1ebdf;
  --muted: #a39b8d;
  --gold: #e8b64c;
  --gold-soft: #8a6420;
  --ok: #4cc38a;
  --warn: #e8a33d;
  --err: #e5534b;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 650; line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; margin-top: 1.6em; }
h3 { font-size: 1rem; }
code, pre, textarea.code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; }
pre { background: #08070a; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; overflow: auto; max-height: 70vh; white-space: pre-wrap; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: #0e0c12; position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
.brand { font-weight: 800; letter-spacing: .35em; color: var(--gold); }
.brand span { letter-spacing: .1em; font-weight: 400; color: var(--muted); font-size: .8em; }
.topbar nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.topbar nav a { color: var(--text); }
.container { max-width: 1200px; margin: 0 auto; padding: 24px 16px 64px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.gallery { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.gallery.tall { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.gallery figure { margin: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.gallery img { width: 100%; display: block; }
.gallery figcaption { padding: 6px 8px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
video { width: 100%; max-height: 70vh; background: #000; border-radius: 8px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }

label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input[type=text], input[type=password], input[type=number], input[type=url], select, textarea {
  width: 100%; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line); background: #0d0c11; color: var(--text); font: inherit;
}
textarea.code { min-height: 70vh; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 180px; }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 14px; margin: 8px 0; }
.check input { width: auto; }

button, .btn { display: inline-block; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--gold-soft); background: var(--gold); color: #1a1408; font-weight: 650; cursor: pointer; font-size: 14px; }
button.secondary, .btn.secondary { background: transparent; color: var(--gold); }
button.danger { background: transparent; border-color: var(--err); color: var(--err); }
button.link { background: none; border: none; color: var(--text); padding: 0; font-weight: 400; }
button:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
form.inline { display: inline; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.queued { color: var(--muted); }
.badge.running { color: var(--warn); border-color: var(--warn); }
.badge.succeeded, .badge.approved, .badge.rendered, .badge.uploaded { color: var(--ok); border-color: var(--ok); }
.badge.failed { color: var(--err); border-color: var(--err); }
.badge.script { color: var(--warn); border-color: var(--warn); }
.badge.voiced { color: var(--gold); border-color: var(--gold-soft); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; }
.flash.ok { border-color: var(--ok); color: var(--ok); }
.flash.err { border-color: var(--err); color: var(--err); }
.scene { border-left: 3px solid var(--gold-soft); padding: 6px 12px; margin: 10px 0; background: var(--panel-2); border-radius: 0 8px 8px 0; display: grid; grid-template-columns: 1fr auto; gap: 12px; }
.scene img { width: 160px; border-radius: 6px; }
.scene audio { width: 100%; height: 32px; margin-top: 6px; }
.narration { margin: 4px 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; }
.narrow { max-width: 420px; margin: 8vh auto; }
@media (max-width: 640px) { .scene { grid-template-columns: 1fr; } .scene img { width: 100%; } }
