:root {
  --bg: #f5f6f8; --card: #fff; --ink: #1c2230; --muted: #6b7385; --line: #e3e6ec;
  --brand: #1f4fd1; --brand-ink: #fff; --ok: #138a4c; --warn: #c27a00; --err: #c62f2f;
  --radius: 12px; --shadow: 0 1px 2px rgba(20,30,50,.06), 0 4px 16px rgba(20,30,50,.05);
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--brand); text-decoration: none; }
h1 { font-size: 26px; margin: 4px 0 12px; } h2 { font-size: 20px; margin: 18px 0 10px; } h3 { font-size: 16px; margin: 6px 0 10px; }
h4 { margin: 14px 0 6px; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 13px; } .err { color: var(--err); } .hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .between { justify-content: space-between; } .center { justify-content: center; }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 24px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; gap: 8px; }
.topbar nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); }
.brand.big { font-size: 20px; margin-bottom: 16px; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 20px 24px 60px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.btn { display: inline-block; border: 0; background: var(--brand); color: var(--brand-ink); padding: 10px 16px; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { filter: brightness(1.08); } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 6px 12px; font-size: 13px; } .btn.wide { width: 100%; padding: 12px; margin-top: 10px; }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
.btn.danger { background: var(--err); } .btn.danger.ghost { background: transparent; color: var(--err); }
.btn.wa { background: #1fa855; }

label { display: block; margin: 10px 0; font-weight: 600; font-size: 14px; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-weight: 400; background: #fff; color: var(--ink); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 30%, transparent); border-color: var(--brand); }
.row label { flex: 1; min-width: 180px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { width: auto; margin-top: 4px; }
.checks { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px; }
.check.all { font-weight: 600; border-bottom: 1px solid var(--line); padding-bottom: 8px; }

.flash { padding: 11px 14px; border-radius: 9px; margin-bottom: 16px; background: #e8f6ee; color: var(--ok); border: 1px solid #bfe5cf; }
.flash.error { background: #fdecec; color: var(--err); border-color: #f4c4c4; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 820px) { .grid2 { grid-template-columns: 1fr; } }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 10px 0 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: var(--ink); }
.stat b { display: block; font-size: 24px; } .stat span { color: var(--muted); font-size: 13px; }
.stat.active { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(3, 1fr); } }
.filters { display: flex; gap: 10px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.filters input { flex: 1; min-width: 200px; margin: 0; } .filters select { width: auto; margin: 0; }

.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfc; }
.table th, .table td { padding: 11px 14px; border-bottom: 1px solid var(--line); }
.table tbody tr { cursor: pointer; } .table tbody tr:hover { background: #f7f9ff; }
@media (max-width: 760px) { .table th:nth-child(2), .table td:nth-child(2), .table th:nth-child(7), .table td:nth-child(7) { display: none; } }

.tag { font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 20px; background: #eef1f6; color: var(--muted); vertical-align: middle; }
.tag.student { background: #e9f0ff; color: #2350c4; } .tag.employee { background: #f3ebff; color: #6b34c4; } .tag.ai { background: #fff3dc; color: #a26200; }
.status { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 20px; background: #eef1f6; color: var(--muted); white-space: nowrap; }
.s-in_progress { background: #e9f0ff; color: #2350c4; } .s-submitted, .s-scoring { background: #fff3dc; color: #a26200; }
.s-scored { background: #e8f6ee; color: var(--ok); } .s-error { background: #fdecec; color: var(--err); }
.score { font-weight: 800; font-size: 16px; }
.rec { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.r-strong_yes { background: #0f7a41; color: #fff; } .r-yes { background: #e8f6ee; color: var(--ok); }
.r-maybe { background: #fff3dc; color: #a26200; } .r-no { background: #fdecec; color: var(--err); }

.worker { font-size: 13px; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--line); background: #fff; max-width: 560px; }
.worker .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.worker.on .dot { background: var(--ok); } .worker.off .dot { background: var(--err); } .worker.off { color: var(--err); }

.list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.list-item { display: flex; justify-content: space-between; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: var(--ink); }
.list-item:hover { border-color: var(--brand); }
.empty { text-align: center; padding: 40px; }
details summary { cursor: pointer; }
details.q { padding: 12px 16px; margin-bottom: 8px; }
details.q summary { display: flex; gap: 10px; align-items: baseline; list-style: none; }
.qtext { flex: 1; }
.qnum { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 6px; background: #eef1f6; font-size: 12px; font-weight: 700; }

.head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.verdict { text-align: right; } .bigscore { font-size: 44px; font-weight: 800; line-height: 1; } .bigscore small { font-size: 16px; color: var(--muted); }
.copyrow { display: flex; gap: 8px; align-items: center; } .copyrow input, .copyrow textarea { margin: 0; }
.invite form { margin-top: 10px; } .invite input[type=number] { display: inline-block; margin: 0 4px; }
.report ul { margin: 4px 0; padding-left: 20px; }
.answer-body { display: grid; grid-template-columns: 320px 1fr; gap: 18px; }
.answer-body video { width: 100%; border-radius: 10px; background: #000; }
@media (max-width: 820px) { .answer-body { grid-template-columns: 1fr; } }
.bars { display: grid; gap: 6px; margin-bottom: 10px; }
.bar { display: grid; grid-template-columns: 110px 1fr 28px; align-items: center; gap: 8px; font-size: 13px; }
.bar i { height: 8px; background: #eef1f6; border-radius: 6px; overflow: hidden; } .bar b { display: block; height: 100%; background: var(--brand); }
.bar em { font-style: normal; font-weight: 700; text-align: right; }
.transcript { white-space: pre-wrap; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 14px; }
.metrics { margin: 8px 0; }

/* login + messages */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 400px; }

/* candidate */
.candidate { background: #eef1f6; }
.ctop { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; background: #fff; border-bottom: 1px solid var(--line); }
.cwrap { max-width: 760px; margin: 0 auto; padding: 20px 16px 60px; }
.rules li { margin: 6px 0; }
#preview, #live { width: 100%; max-height: 52vh; background: #000; border-radius: 12px; transform: scaleX(-1); object-fit: cover; }
.meter { height: 10px; background: #e3e6ec; border-radius: 6px; overflow: hidden; margin: 10px 0; }
.meter b { display: block; height: 100%; width: 0; background: var(--ok); transition: width .08s; }
.qcard h2 { font-size: 22px; line-height: 1.35; margin: 8px 0; }
.qhead { display: flex; justify-content: space-between; align-items: center; }
.timer { font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 800; }
.timer.warn { color: var(--err); }
.phase { font-weight: 600; } .phase.think { color: var(--warn); } .phase.recording { color: var(--err); }
.stage { position: relative; margin-bottom: 14px; }
.rec-dot { position: absolute; top: 12px; left: 12px; background: rgba(198,47,47,.9); color: #fff; font-weight: 700; font-size: 12px; padding: 4px 10px; border-radius: 20px; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .55; } }
.upload { text-align: center; margin-top: 12px; }

@media print {
  .topbar, .noprint, video, details summary { display: none !important; }
  body { background: #fff; } .card { box-shadow: none; break-inside: avoid; }
  .answer-body { grid-template-columns: 1fr; } details[open] summary ~ * , details > * { display: block; }
}

/* practice mode */
.tag.practice { background: #e6f7f3; color: #0c7a63; }
.modes { display: grid; gap: 8px; margin-bottom: 14px; }
label.mode { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; cursor: pointer; }
label.mode input { width: auto; margin-top: 4px; }
label.mode:has(input:checked) { border-color: var(--brand); background: #f5f8ff; }
.fb-wait { text-align: center; padding: 30px 0; }
.spinner { width: 36px; height: 36px; border: 4px solid #e3e6ec; border-top-color: var(--brand); border-radius: 50%; margin: 0 auto 12px; animation: spin 0.9s linear infinite; }
.spinner.big { width: 48px; height: 48px; }
@keyframes spin { to { transform: rotate(360deg); } }
.fb-score { font-size: 46px; font-weight: 800; line-height: 1; margin: 6px 0 12px; }
.fb-score small { font-size: 18px; color: var(--muted); }
.center-text { text-align: center; }
.coach { background: #f5f8ff; border-left: 4px solid var(--brand); padding: 10px 14px; border-radius: 6px; }
.log { background: #111827; color: #d1d5db; padding: 12px; border-radius: 8px; font-size: 12px; max-height: 320px; overflow: auto; white-space: pre-wrap; }
.table.plain { border: 0; } .table.plain td { padding: 8px 4px; }
code { background: #eef1f6; padding: 1px 5px; border-radius: 4px; font-size: 13px; }
tr.sub td { background: #fafbfc; padding: 8px 14px 14px; }
tr.sub .list-item { margin-top: 6px; }
.saved { color: var(--ok); font-weight: 700; margin: 4px 0 10px; }
video.review { width: 100%; max-height: 50vh; background: #000; border-radius: 12px; transform: scaleX(-1); }
.eta { font-size: 18px; background: #f5f8ff; border-left: 4px solid var(--brand); padding: 10px 14px; border-radius: 6px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
form.inline { display: inline; margin: 0; }
.users select { width: auto; margin: 0; padding: 5px 8px; }
.users .actions { white-space: nowrap; text-align: right; }
.users .actions .linkbtn { margin-left: 10px; }
tr.muted td { opacity: .6; }
.creds { border-color: var(--ok); }
.creds textarea { font-family: ui-monospace, Menlo, Consolas, monospace; }
a.myiv { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--ink); }
a.myiv:hover { border-color: var(--brand); }
a.myiv .right { text-align: right; }
.warn-text { color: var(--warn); font-weight: 600; }
.results { border-left: 4px solid var(--brand); }
.results .status { margin-left: 6px; }
form.review { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
form.review input { margin: 0; width: auto; }
form.review input[type=number] { width: 70px; }
form.review input[name=note] { flex: 1; min-width: 180px; }
.settings h2 { margin-top: 4px; }
.settings .hint { font-size: 13px; color: var(--muted); font-weight: 400; }
pre.diag { max-height: none; font-size: 12.5px; line-height: 1.45; }
