@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');
:root { --bg:#000; --panel:#0b1018; --line:#1f2a3a; --text:#fff; --muted:#9aa7bd; --blue:#3B82F6; --red:#f87171; --green:#34d399; }
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--text); font:15px/1.5 Poppins, Arial, sans-serif; }
a { color:var(--blue); }
h1,h2,h3 { margin:0 0 .5em; line-height:1.2; }
.muted { color:var(--muted); }
button, .btn { background:var(--blue); color:#fff; border:0; padding:10px 16px; font:600 14px Poppins, Arial, sans-serif; cursor:pointer; border-radius:6px; text-decoration:none; display:inline-block; }
button.ghost, .btn.ghost { background:transparent; border:1px solid var(--line); color:var(--text); }
button.danger { background:transparent; border:1px solid #5b2330; color:var(--red); }
button:disabled { opacity:.5; cursor:default; }
input, textarea, select { width:100%; background:#05080d; color:var(--text); border:1px solid var(--line); border-radius:6px; padding:10px 12px; font:14px Poppins, Arial, sans-serif; }
textarea { min-height:80px; resize:vertical; }
label { display:block; font-weight:600; font-size:13px; margin:14px 0 6px; }
.hint { font-size:12px; color:var(--muted); margin-top:4px; }

.login { display:flex; min-height:100vh; align-items:center; justify-content:center; padding:16px; }
.login-box { width:100%; max-width:400px; text-align:center; }
.login-box form { text-align:left; margin-top:20px; }
.login-box button { width:100%; margin-top:14px; padding:13px; }
.wordmark { font-weight:700; letter-spacing:.12em; color:var(--blue); margin:0 0 6px; }

header.top { display:flex; align-items:center; gap:16px; padding:14px 20px; border-bottom:1px solid var(--line); position:sticky; top:0; background:#000d; backdrop-filter:blur(8px); z-index:5; }
header.top .brand { font-weight:700; }
header.top .brand span { color:var(--blue); }
header.top .spacer { flex:1; }
nav.tabs { display:flex; gap:4px; padding:10px 20px 0; border-bottom:1px solid var(--line); overflow-x:auto; }
nav.tabs button { background:none; border-radius:0; color:var(--muted); border-bottom:2px solid transparent; padding:10px 14px; white-space:nowrap; }
nav.tabs button.on { color:#fff; border-bottom-color:var(--blue); }
nav.tabs .count { background:var(--blue); color:#fff; border-radius:10px; padding:0 7px; font-size:11px; margin-left:6px; }
main.app { max-width:1100px; margin:0 auto; padding:20px 16px 60px; }
.panel { background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:18px; margin-bottom:16px; }
.row { display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:16px; }
.two { display:grid; grid-template-columns:1fr 1fr; gap:0 16px; }
@media (max-width:640px) { .two { grid-template-columns:1fr; } }

.card { background:var(--panel); border:1px solid var(--line); border-radius:10px; overflow:hidden; display:flex; flex-direction:column; }
.card .media { background:#05080d; aspect-ratio:9/16; max-height:520px; display:flex; align-items:center; justify-content:center; color:var(--muted); font-size:13px; }
.card .media video, .card .media img { width:100%; height:100%; object-fit:contain; background:#000; }
.card .body { padding:14px; display:flex; flex-direction:column; gap:8px; flex:1; }
.card .actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:auto; padding-top:8px; }
.badge { display:inline-block; font-size:11px; font-weight:600; padding:2px 8px; border-radius:10px; background:#1f2a3a; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; }
.badge.review { background:#1e3a8a; color:#fff; } .badge.approved { background:#065f46; color:#fff; } .badge.published { background:#14532d; color:#bbf7d0; }
.badge.failed { background:#5b2330; color:#fecaca; } .badge.pending { background:#3b2f0a; color:#fde68a; }
.error { color:var(--red); font-size:13px; }
.ok { color:var(--green); }
.spinner { width:22px; height:22px; border:3px solid #1f2a3a; border-top-color:var(--blue); border-radius:50%; animation:spin 1s linear infinite; margin-bottom:8px; }
@keyframes spin { to { transform:rotate(360deg); } }

.checklist { list-style:none; padding:0; margin:0; display:grid; gap:6px; }
.checklist li::before { content:'○ '; color:var(--muted); }
.checklist li.done::before { content:'✓ '; color:var(--green); }
.checklist li.done { color:var(--muted); }
.refs { display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; }
.refs figure { margin:0; width:110px; }
.refs img { width:110px; height:140px; object-fit:cover; border-radius:6px; border:1px solid var(--line); display:block; }
.refs button { width:100%; margin-top:4px; padding:4px; font-size:12px; }
.log { list-style:none; padding:0; margin:0; font-size:13px; }
.log li { padding:8px 0; border-bottom:1px solid var(--line); display:flex; gap:12px; }
.log time { color:var(--muted); white-space:nowrap; }
.log .err { color:var(--red); }
#toast { position:fixed; bottom:20px; left:50%; transform:translateX(-50%); background:#111827; border:1px solid var(--line); padding:12px 18px; border-radius:8px; display:none; z-index:20; max-width:90vw; }
.section-title { display:flex; align-items:center; justify-content:space-between; margin:24px 0 12px; }
.section-title:first-child { margin-top:0; }
.empty { color:var(--muted); padding:20px; text-align:center; border:1px dashed var(--line); border-radius:10px; }
@media (max-width:640px) { #who { display:none; } header.top { padding:12px 16px; } nav.tabs { padding:6px 8px 0; } }
.label-row { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:14px 0 6px; }
.label-row label { margin:0; }
button.gen { padding:5px 10px; font-size:12px; white-space:nowrap; }
.refs.cands figure { width:150px; } .refs.cands img { width:150px; height:200px; }
/* No single word alone on the last line. */
h1, h2, h3, p, .hint, label { text-wrap: pretty; }
.login-box p, .empty, .section-title h2 { text-wrap: balance; }
