:root {
  --bg: #f6f3ee; --card: #ffffff; --ink: #1d1b19; --muted: #6b665f; --line: #e3ddd3;
  --accent: #2f5bd3; --accent-ink: #ffffff; --ok: #1f7a3a; --ok-bg: #e3f4e7; --warn: #8a5a00; --warn-bg: #fdf1d8;
  --bad: #b3261e; --bad-bg: #fbe4e2; --info-bg: #e6edfb; --radius: 14px; --tap: 48px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141311; --card: #1f1d1a; --ink: #f1ede6; --muted: #a59e94; --line: #34302b;
    --accent: #7aa2ff; --accent-ink: #0d1530; --ok: #7fd394; --ok-bg: #173322; --warn: #f2c56b; --warn-bg: #3a2c10;
    --bad: #ff8a80; --bad-bg: #3d1714; --info-bg: #1b2440;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI",
  Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--accent); }
header.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: var(--card); border-bottom: 1px solid var(--line); }
header.top .brand { font-weight: 700; text-decoration: none; color: var(--ink); font-size: 18px; flex: 1; }
header.top form { margin: 0; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
h1 { font-size: 24px; line-height: 1.25; margin: 4px 0 8px; }
h2 { font-size: 19px; margin: 24px 0 10px; }
h3 { font-size: 17px; margin: 0 0 6px; }
p { margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  margin: 12px 0; }
.card.picked { border-color: var(--ok); }
.stack > * + * { margin-top: 8px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 10px 18px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit;
  font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.small { min-height: 40px; padding: 6px 12px; font-size: 15px; }
input[type=text], input[type=password], textarea { width: 100%; min-height: var(--tap); padding: 10px 12px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; }
textarea { min-height: 80px; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: var(--info-bg); color: var(--ink); white-space: nowrap; }
.badge.ok, .b-done { background: var(--ok-bg); color: var(--ok); }
.badge.warn, .b-storylines, .b-script, .b-scenes, .b-spend_approval, .b-done_qa_failed { background: var(--warn-bg); color: var(--warn); }
.badge.bad, .b-failed { background: var(--bad-bg); color: var(--bad); }
.notice { border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.info { background: var(--info-bg); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice pre { white-space: pre-wrap; margin: 0; font: inherit; }
.bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.bar > span { display: block; height: 100%; background: var(--accent); width: 0; transition: width .4s; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 6px 0; }
.kv dt { font-weight: 700; color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: .03em; }
.kv dd { margin: 0; }
.beat .role { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.beat .say { font-size: 18px; font-weight: 600; margin: 4px 0 6px; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 8px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.check-ok::before { content: "✓ "; color: var(--ok); font-weight: 800; }
.check-bad::before { content: "✗ "; color: var(--bad); font-weight: 800; }
.check-unk::before { content: "• "; color: var(--muted); font-weight: 800; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line);
  border-radius: 12px; margin: 8px 0; cursor: pointer; font-weight: 400; }
.choice input { width: 24px; height: 24px; margin-top: 2px; flex: none; }
.thumb { display: block; max-width: 100%; max-height: 52vh; width: auto; height: auto; margin: 0 auto;
  border-radius: 10px; background: var(--line); }
.thumb.wide { max-height: none; width: 100%; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 620px) { .grid { grid-template-columns: 1fr 1fr; } }
video { width: 100%; max-height: 80vh; border-radius: 12px; background: #000; display: block; }
.worker { font-size: 14px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.dot.on { background: var(--ok); } .dot.busy { background: var(--warn); }
.ep-link { display: block; text-decoration: none; color: inherit; }
details summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; font-weight: 600; }
pre.text { white-space: pre-wrap; font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-x: auto; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0 14px; border-top: 1px solid var(--line); }
