:root {
  --bg: #f7f6f2; --card: #ffffff; --ink: #222226; --muted: #6b6b73; --line: #e4e2dc;
  --accent: #d6342b; --accent-soft: #fbe3e0; --green: #228b54; --green-soft: #e1f3e8; --blue: #2f5fb3;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
header.top { background: var(--card); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; gap: 22px; height: 56px; flex-wrap: wrap; }
.logo { font-family: "Caveat", cursive; font-size: 28px; font-weight: 700; color: var(--ink); }
.logo span { color: var(--accent); }
nav { display: flex; gap: 16px; flex: 1; flex-wrap: wrap; }
nav a { color: var(--muted); }
nav a.on { color: var(--ink); font-weight: 600; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 60px; }
h1 { font-size: 26px; margin: 0 0 18px; }
h2 { font-size: 19px; margin: 28px 0 12px; }
h3 { font-size: 16px; margin: 0 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }
label { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }
textarea { min-height: 90px; resize: vertical; }
textarea.code { font: 12px/1.4 ui-monospace, Menlo, monospace; min-height: 420px; }
.btn { display: inline-block; padding: 8px 15px; border-radius: 8px; border: 1px solid var(--line); background: #fff;
  color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: #f1f0eb; text-decoration: none; }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #000; }
.btn.danger { color: var(--accent); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: default; }
form.inline { display: inline; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #eee; }
.badge.review { background: #fff3d6; color: #8a5a00; }
.badge.done, .badge.approved { background: var(--green-soft); color: var(--green); }
.badge.error { background: var(--accent-soft); color: var(--accent); }
.badge.working, .badge.rendering, .badge.queued, .badge.generating { background: #e5edfb; color: var(--blue); }
.badge.new { background: #fff3d6; color: #8a5a00; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.flash.ok { background: var(--green-soft); color: var(--green); }
.flash.error { background: var(--accent-soft); color: var(--accent); }
.thumb { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.thumb img { width: 100%; aspect-ratio: 3/4; object-fit: contain; background: #fff; }
.thumb .meta { padding: 8px 10px; font-size: 13px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.thumb .ph { aspect-ratio: 3/4; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; padding: 10px; text-align: center; }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress div { height: 100%; background: var(--green); transition: width .5s; }
.scene { border-left: 4px solid var(--line); padding-left: 14px; margin-bottom: 18px; }
.scene .time { font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: var(--muted); }
.items { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.item { background: #fbfaf7; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; max-width: 260px; }
.item img { width: 120px; height: 160px; object-fit: contain; background: #fff; display: block; margin-bottom: 6px; }
.item .k { color: var(--muted); font-size: 12px; }
.chip { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
video { width: 100%; max-width: 960px; border-radius: var(--radius); background: #000; }
details summary { cursor: pointer; font-weight: 600; }
.transcript { white-space: pre-wrap; font-size: 14px; max-height: 260px; overflow: auto; }
.keyrow { display: grid; grid-template-columns: 160px 1fr; gap: 10px; align-items: center; }
@media (max-width: 600px) { .keyrow { grid-template-columns: 1fr; } }
.login { max-width: 380px; margin: 80px auto; }
