:root {
  --bg: #0f1117; --panel: #171a23; --panel2: #1e2230; --line: #2a2f40; --text: #e7e9f0; --muted: #9aa1b5;
  --accent: #6366f1; --accent2: #818cf8; --ok: #22c55e; --bad: #ef4444; --warn: #f59e0b; --rec: #e11d48;
  --radius: 10px; font-size: 15px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: "Segoe UI", Roboto, system-ui, Arial, sans-serif; }
a { color: var(--accent2); text-decoration: none; }
button, select, input, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.pad { padding: 24px; }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.top { display: flex; align-items: center; gap: 22px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 10; }
.brand { color: var(--text); font-size: 17px; }
.brand b { color: var(--accent2); }
.top nav { display: flex; gap: 6px; }
.top nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); }
.top nav a.on { background: var(--panel2); color: var(--text); }
.who { margin-left: auto; color: var(--muted); font-size: 13px; display: flex; gap: 10px; align-items: center; }

.btn { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ok { background: #15803d; border-color: #15803d; color: #fff; }
.btn.bad { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn.rec { background: var(--rec); border-color: var(--rec); color: #fff; }
.btn.big { padding: 11px 20px; font-size: 16px; }
.btn.tiny { padding: 3px 8px; font-size: 12.5px; }
input[type=text], input[type=email], textarea, select { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
textarea { width: 100%; min-height: 64px; resize: vertical; }
kbd { background: var(--panel2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 12px; }

.chip { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; background: var(--panel2); border: 1px solid var(--line); white-space: nowrap; }
.chip.waiting { border-color: var(--warn); color: var(--warn); }
.chip.approved { border-color: var(--ok); color: var(--ok); }
.chip.rejected { border-color: var(--bad); color: var(--bad); }
.chip.superseded { color: var(--muted); }
.chip.fail { border-color: var(--bad); color: #fca5a5; }
.chip.pass { border-color: var(--ok); color: #86efac; }

/* login */
.login { max-width: 380px; margin: 10vh auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.login h1 { font-size: 20px; margin: 0 0 6px; }
.login label { display: block; margin: 16px 0 6px; color: var(--muted); font-size: 13px; }
.login input { width: 100%; }
.login .btn { width: 100%; margin-top: 14px; }
.login .code { letter-spacing: 8px; font-size: 22px; text-align: center; }

/* inbox */
.wrap { max-width: 1400px; margin: 0 auto; padding: 18px; }
.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0 14px; }
.bar h2 { margin: 0 12px 0 0; font-size: 18px; }
table.list { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); overflow: hidden; }
table.list th, table.list td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; vertical-align: middle; }
table.list th { color: var(--muted); font-weight: 500; font-size: 12.5px; background: var(--panel2); }
table.list tr:hover td { background: #1b1f2b; }
table.list td.act { text-align: right; white-space: nowrap; }
table.list td.act .btn { margin-left: 6px; }
.empty { padding: 30px; text-align: center; color: var(--muted); background: var(--panel); border-radius: var(--radius); }
section + section { margin-top: 28px; }

/* review + voice layout */
.split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(380px, 1fr); gap: 14px; padding: 14px; height: calc(100vh - 53px); }
.col { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.head h1 { font-size: 18px; margin: 0; }
video { width: 100%; max-height: 58vh; background: #000; border-radius: var(--radius); }
.now { font-size: 17px; line-height: 1.45; min-height: 50px; }
.now .beat { color: var(--accent2); font-size: 12.5px; margin-right: 8px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 8px 12px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs button .n { font-size: 11px; background: var(--panel2); border-radius: 99px; padding: 0 6px; margin-left: 4px; }
.pane { overflow: auto; min-height: 0; flex: 1; padding: 6px 2px; }
.tl { display: grid; grid-template-columns: 58px 62px 1fr 28px; gap: 6px; padding: 7px 8px; border-radius: 8px; cursor: pointer; align-items: start; }
.tl:hover { background: var(--panel2); }
.tl.cur { background: #262b45; outline: 1px solid var(--accent); }
.tl .t { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tl .b { color: var(--accent2); font-size: 12.5px; }
.tl .heard { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.tl .heard b { color: var(--warn); font-weight: 500; }
.tl .fl { color: var(--bad); font-size: 12px; text-align: right; }
.tl .done { color: var(--ok); text-align: right; }
.note-banner { background: #2a2210; border: 1px solid #5b4413; color: #fcd34d; padding: 8px 10px; border-radius: 8px; font-size: 13px; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 4px 12px; font-size: 13.5px; }
.kv div:nth-child(odd) { color: var(--muted); }
pre.raw { white-space: pre-wrap; word-break: break-word; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 12.5px; max-height: none; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.thumbs img { width: 100%; border-radius: 6px; border: 1px solid var(--line); cursor: zoom-in; }
.thumbs .cap { font-size: 11.5px; color: var(--muted); }
.sheet img { width: 100%; border-radius: 6px; margin-bottom: 8px; }
.flagrow { display: grid; grid-template-columns: 120px 1fr auto; gap: 8px; align-items: center; }
.flags { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 22vh; overflow: auto; }
.flag { display: grid; grid-template-columns: 66px 70px 78px 1fr auto; gap: 8px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 13px; }
.decide { display: flex; gap: 10px; align-items: flex-start; }
.decide textarea { flex: 1; min-height: 44px; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; z-index: 50; cursor: zoom-out; }
.lightbox img { max-width: 96vw; max-height: 94vh; }

/* voice */
.prompter { background: #0b0d13; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.prompter .prev, .prompter .next { color: #6b7288; font-size: 16px; line-height: 1.4; }
.prompter .curline { font-size: 26px; line-height: 1.4; margin: 10px 0; }
.prompter .meta { color: var(--accent2); font-size: 13px; }
.prompter .hints { color: var(--warn); font-size: 13px; margin-top: 4px; }
.prompter.recording { border-color: var(--rec); box-shadow: 0 0 0 2px rgba(225,29,72,.35) inset; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.meter { height: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; flex: 1; min-width: 140px; }
.meter i { display: block; height: 100%; width: 0; background: var(--ok); transition: width 60ms linear; }
.meter.hot i { background: var(--bad); }
.countin { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 160px; color: #fff; background: rgba(0,0,0,.45); z-index: 40; pointer-events: none; }
.takes { display: flex; flex-direction: column; gap: 6px; }
.take { display: grid; grid-template-columns: 26px 60px 1fr auto; gap: 8px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 13px; }
.take.best { border-color: var(--ok); }
.progress { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; width: 180px; }
.progress i { display: block; height: 100%; background: var(--ok); width: 0; }
.opts { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.opts label { display: flex; gap: 6px; align-items: center; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; z-index: 60; max-width: 80vw; }
.toast.err { border-color: var(--bad); }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; height: auto; } .pane { max-height: 60vh; } }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent2); cursor: pointer; text-align: left; }
