:root {
  --bg: #111318; --panel: #1a1d24; --line: #2a2e38; --text: #e8e9ec; --muted: #8b90a0;
  --accent: #f0a23b; --ok: #3ecf8e; --warn: #f5c84c; --bad: #f2555a; --info: #6aa8ff;
  font-family: "Noto Sans Thai", "Sarabun", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); }
.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5; }
.brand { font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; }
.brand span { color: var(--accent); }
.who { color: var(--muted); font-size: 13px; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; padding-bottom: 80px; }
h1 { font-size: 22px; margin: 4px 0; }
h2 { font-size: 17px; margin: 24px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }
textarea, input, select { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px; font: inherit; }
textarea { min-height: 84px; resize: vertical; }
select, input[type=number] { width: auto; }
button, .btn { background: var(--accent); color: #1b1406; border: 0; border-radius: 8px; padding: 9px 14px;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; }
button.ghost, .btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
button:disabled { opacity: .5; cursor: default; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; background: var(--line); }
.b-planning, .b-planned, .b-keyframed { background: #2b3550; color: #a9c2ff; }
.b-flow, .b-awaiting_clip { background: #4a3a17; color: var(--warn); }
.b-review { background: #20384a; color: var(--info); }
.b-ready, .b-approved, .b-done { background: #183d2e; color: var(--ok); }
.b-needs_redo, .b-failed { background: #4a1f22; color: var(--bad); }
.list { display: grid; gap: 10px; }
.card-link { display: block; color: inherit; text-decoration: none; }
.card-link:hover .panel { border-color: var(--accent); }
.shots { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.shot img { width: 100%; max-height: 340px; object-fit: contain; border-radius: 8px; background: #000; display: block; }
.frames { display: grid; grid-template-columns: 1fr; gap: 6px; }
.frames.two { grid-template-columns: 1fr 1fr; }
.prompt { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: 13px;
  white-space: pre-wrap; max-height: 150px; overflow: auto; margin: 6px 0; }
.takes { margin: 8px 0; padding: 0; list-style: none; font-size: 13px; }
.takes li { padding: 4px 0; border-top: 1px dashed var(--line); }
.v-pass { color: var(--ok); } .v-fail { color: var(--bad); } .v-pending { color: var(--muted); }
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.log { max-height: 320px; overflow: auto; font-size: 13px; }
.log div { padding: 4px 0; border-bottom: 1px solid var(--line); white-space: pre-wrap; }
.log .l-success { color: var(--ok); } .log .l-warn { color: var(--warn); } .log .l-error { color: var(--bad); }
.log time { color: var(--muted); margin-right: 6px; }
video { width: 100%; max-height: 70vh; border-radius: 10px; background: #000; }
details summary { cursor: pointer; color: var(--muted); }
pre.cost { white-space: pre-wrap; font-size: 12px; }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--muted);
  border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #2a2e38;
  padding: 10px 16px; border-radius: 10px; max-width: 90vw; z-index: 10; }
.toast.err { background: #5a2226; }
.auth { max-width: 420px; margin: 40px auto; }
.auth form { display: grid; gap: 12px; }
.field { display: grid; gap: 4px; }
input.code { font-size: 26px; letter-spacing: 8px; text-align: center; }
img.qr { width: 220px; height: 220px; image-rendering: pixelated; background: #fff; border-radius: 8px; padding: 6px; }
.mono { font-family: ui-monospace, Menlo, monospace; word-break: break-all; }
.who .row { gap: 12px; }
.who button { padding: 4px 10px; }
.segs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
button.seg { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.seg.on { background: var(--accent); color: #1b1406; border-color: var(--accent); }
.clips { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-top: 10px; }
.clip img { width: 100%; height: 160px; object-fit: contain; background: #000; border-radius: 8px; display: block; }
table.plan { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
table.plan th, table.plan td { text-align: left; padding: 6px 4px; border-top: 1px solid var(--line); vertical-align: top; }
table.plan th { color: var(--muted); font-weight: 500; }
.perms { display: grid; gap: 8px; margin-top: 8px; }
label.perm { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; }
label.perm input[type=checkbox] { width: auto; margin: 0; }
.covers { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.covers img { width: 100%; max-height: 300px; object-fit: contain; background: #000; border-radius: 8px; display: block; }
img.sheet { width: 100%; border-radius: 8px; margin-top: 8px; }
.posts { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.post .caption { white-space: pre-wrap; font-size: 14px; margin: 6px 0; }
.post .tags { color: var(--info); word-break: break-word; }
