/* Video Review — plain CSS, no build step. Tokens from the original prototype. */
:root {
  --bg: #f6f7f9; --panel: #ffffff; --ink: #1b1f24; --muted: #667080; --line: #e3e6eb;
  --accent: #0a7c86; --accent-ink: #ffffff; --accent-soft: #e3f3f4; --warn: #b42318; --warn-soft: #fdecea;
  --ok: #157f3b; --ok-soft: #e4f4e9; --done: #8a94a3; --marker: #f59e0b; --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121417; --panel: #1b1e23; --ink: #e8eaed; --muted: #9aa3ae; --line: #2c3138;
    --accent: #2bb3bd; --accent-ink: #0b1214; --accent-soft: #163236; --warn: #f97066; --warn-soft: #3a1d1b;
    --ok: #4ade80; --ok-soft: #173322; --done: #6b7380; --marker: #fbbf24;
  }
}
:root[data-theme="dark"] {
  --bg: #121417; --panel: #1b1e23; --ink: #e8eaed; --muted: #9aa3ae; --line: #2c3138;
  --accent: #2bb3bd; --accent-ink: #0b1214; --accent-soft: #163236; --warn: #f97066; --warn-soft: #3a1d1b;
  --ok: #4ade80; --ok-soft: #173322; --done: #6b7380; --marker: #fbbf24;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; }
input, textarea, button, select { font: inherit; color: inherit; }
input[type=text], input[type=email], input[type=password], input[type=url], textarea, select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
}
textarea { resize: vertical; min-height: 72px; }
button, .btn { cursor: pointer; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 7px 12px; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.approve, .btn.approve { background: var(--ok); color: #fff; border-color: var(--ok); font-weight: 600; }
button.danger, .btn.danger { color: var(--warn); }
button.link { border: 0; background: none; padding: 0; color: var(--accent); }
button.sm, .btn.sm { padding: 3px 8px; font-size: 13px; }
button:disabled { opacity: .5; cursor: not-allowed; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }

/* ---------- layout ---------- */
.topbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
.topbar .brand { font-weight: 700; font-size: 16px; color: var(--ink); text-decoration: none; }
.topbar .brand small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.topbar nav { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 20px; }
@media (max-width: 640px) { .wrap { padding: 16px; } .topbar { padding: 12px 16px; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.muted { color: var(--muted); font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
.flash { padding: 10px 14px; border-radius: 8px; background: var(--ok-soft); color: var(--ok); }
.flash.err { background: var(--warn-soft); color: var(--warn); }
.page-title { margin: 0 0 4px; font-size: 22px; }
.section-title { margin: 0 0 10px; font-size: 16px; }
details > summary { cursor: pointer; font-weight: 600; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- stage pills ---------- */
.stages { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.done { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.current { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: 600; }
.pill.complete { background: var(--ok); color: #fff; border-color: var(--ok); font-weight: 600; }
.badge { display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 700; text-align: center; background: var(--marker); color: #1b1f24; }
.badge.zero { background: var(--line); color: var(--muted); }
.sep { color: var(--muted); font-size: 11px; }

/* ---------- client topic list ---------- */
.topic-list { display: flex; flex-direction: column; gap: 10px; }
.topic-card { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.topic-card h3 { margin: 0 0 6px; font-size: 16px; }

/* ---------- list editor (stages/topics) ---------- */
.edit-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.edit-list li { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.edit-list li form.grow { flex: 1 1 200px; display: flex; gap: 6px; }
.edit-list .idx { width: 22px; color: var(--muted); font-variant-numeric: tabular-nums; }
form.inline { display: inline; }

/* ---------- login ---------- */
.login { max-width: 380px; margin: 10vh auto; }

/* ================= review page (ported prototype) ================= */
.review-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
.review-head h1 { font-size: 17px; margin: 0; }
.review-head h1 small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.review-head .vsel { display: flex; gap: 8px; align-items: center; flex: 0 1 380px; }
.review-head .vsel select { min-width: 0; }
.review-main { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; padding: 18px 20px; max-width: 1500px; margin: 0 auto; }
@media (max-width: 960px) { .review-main { grid-template-columns: 1fr; padding: 12px 16px; } .review-head { padding: 12px 16px; } }
.player-wrap { background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; position: relative; }
.player-wrap > div, .player-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.empty { display: grid; place-items: center; color: #c9ced6; text-align: center; padding: 20px; }
.bar { position: relative; height: 26px; margin-top: 10px; cursor: pointer; }
.bar .track { position: absolute; left: 0; right: 0; top: 11px; height: 4px; border-radius: 2px; background: var(--line); }
.bar .fill { position: absolute; left: 0; top: 11px; height: 4px; border-radius: 2px; background: var(--accent); }
.bar .mk { position: absolute; top: 4px; width: 4px; height: 18px; margin-left: -2px; border-radius: 2px; background: var(--marker); }
.bar .mk.done { background: var(--done); }
.bar .mk:hover { transform: scaleX(1.8); }
.meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-top: 2px; }
.status-box { margin-top: 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.status-box.locked { border-style: dashed; }
.vnotes { margin-top: 10px; white-space: pre-wrap; }
.side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.form .tc { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 2px 8px; font-variant-numeric: tabular-nums; }
.form .row { margin-top: 8px; }
label.file { display: inline; color: var(--accent); cursor: pointer; font-size: 14px; margin: 0; }
label.file input { display: none; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.thumbs img { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); cursor: zoom-in; }
.thumbs .x { position: relative; }
.thumbs .x button { position: absolute; top: -6px; right: -6px; padding: 0 5px; font-size: 12px; border-radius: 50%; line-height: 18px; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-head h2 { font-size: 15px; margin: 0; }
.list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; max-height: 62vh; overflow: auto; }
.item { border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.item.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.item.done { opacity: .6; }
.item.admin { border-left: 3px solid var(--accent); }
.item .top { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.item .who { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .txt { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.item .acts { display: flex; gap: 10px; margin-top: 8px; font-size: 13px; align-items: center; }
.item .acts button { border: 0; padding: 0; background: none; color: var(--muted); }
.item .acts button:hover { color: var(--ink); }
.item .acts .del:hover { color: var(--warn); }
.item .tag { font-size: 11px; padding: 0 6px; border-radius: 4px; background: var(--ok-soft); color: var(--ok); }
.tcbtn { border: 0; background: var(--accent-soft); color: var(--accent); font-weight: 600; padding: 2px 8px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: none; place-items: center; z-index: 10; cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 6px; }
.tools { display: flex; gap: 6px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 8px; z-index: 20; display: none; max-width: 90vw; }
.filter { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.filter input { width: auto; }
