:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --ink: #14202e;
  --muted: #5d6b7c;
  --line: #dfe4ea;
  --brand: #0b5cad;
  --brand-ink: #ffffff;
  --brand-soft: #e7f0fa;
  --good: #1a7f4b;
  --good-soft: #e3f4ea;
  --warn: #9a6200;
  --warn-soft: #fdf1dc;
  --bad: #b42318;
  --bad-soft: #fde8e6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.5; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }

.topbar { background: var(--ink); color: #fff; padding: .75rem 1rem; display: flex; align-items: center; gap: 1rem; }
.topbar .brand { font-weight: 700; letter-spacing: .2px; }
.topbar .spacer { flex: 1; }
.topbar button { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }

.wrap { max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem 4rem; }
.narrow { max-width: 720px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1rem; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }

label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .25rem; }
input, textarea, select {
  width: 100%; font: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.field { margin-bottom: .75rem; }

button, .btn {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 8px; padding: .55rem 1rem;
  border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: .4rem;
}
button.primary, .btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
button.good { background: var(--good); color: #fff; border-color: var(--good); }
button.danger { color: var(--bad); }
button.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
button.small, .btn.small { padding: .3rem .6rem; font-size: .85rem; }
button:disabled { opacity: .55; cursor: not-allowed; }
button.big { padding: .8rem 1.4rem; font-size: 1.05rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tr.click { cursor: pointer; } tr.click:hover { background: var(--brand-soft); }
.table-wrap { overflow-x: auto; }

.pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #eef1f4; color: var(--muted); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs button { border: none; border-bottom: 3px solid transparent; border-radius: 0; background: none; color: var(--muted); }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }

.notice { padding: .75rem 1rem; border-radius: 8px; background: var(--warn-soft); color: var(--warn); margin-bottom: 1rem; }
.notice.info { background: var(--brand-soft); color: var(--brand); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }

.q-item { border: 1px solid var(--line); border-radius: 8px; padding: .75rem; margin-bottom: .6rem; background: #fbfcfd; }
.q-item .q-head { display: flex; gap: .5rem; align-items: center; margin-bottom: .4rem; }
.q-item .q-num { font-weight: 700; color: var(--brand); }

.score { font-size: 2.2rem; font-weight: 800; }
.stat { min-width: 120px; }
.stat .label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.answer { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }
.answer video { width: 100%; max-width: 480px; border-radius: 8px; background: #000; }
.transcript { background: #f7f8fa; border-left: 3px solid var(--line); padding: .6rem .8rem; border-radius: 4px; white-space: pre-wrap; }
.followup { margin-left: 1rem; padding-left: 1rem; border-left: 3px solid var(--brand-soft); margin-top: .8rem; }
.dots { display: inline-flex; gap: 2px; }
.dots i { width: 10px; height: 10px; border-radius: 2px; background: var(--line); display: inline-block; }
.dots i.on { background: var(--brand); }

.toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 8px; z-index: 50; box-shadow: var(--shadow); max-width: calc(100vw - 2rem); }

.modal-back { position: fixed; inset: 0; background: rgba(20, 32, 46, .5); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 1rem; z-index: 40; overflow-y: auto; }
.modal { background: #fff; border-radius: var(--radius); padding: 1.25rem; width: 100%; max-width: 620px; }

/* ---------------- candidate interview ---------------- */
.iv-shell { min-height: 100vh; display: flex; flex-direction: column; }
.iv-main { flex: 1; display: flex; justify-content: center; padding: 1rem; }
.iv-stage { width: 100%; max-width: 980px; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 820px) { .iv-stage { grid-template-columns: 1fr; } }
.self-view { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; }
.self-view video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.rec-badge { position: absolute; top: .6rem; left: .6rem; background: var(--bad); color: #fff; font-weight: 700; font-size: .8rem; padding: .15rem .55rem; border-radius: 999px; display: flex; align-items: center; gap: .35rem; }
.rec-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.timer { position: absolute; top: .6rem; right: .6rem; background: rgba(0,0,0,.6); color: #fff; font-variant-numeric: tabular-nums; padding: .15rem .55rem; border-radius: 999px; font-weight: 700; }

.interviewer { display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem; }
.orb { width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #6fb1f2, var(--brand) 60%, #073c73); flex: none; box-shadow: 0 0 0 0 rgba(11,92,173,.4); }
.orb.speaking { animation: pulse 1.2s infinite; }
.orb.thinking { animation: spin 1.4s linear infinite; background: conic-gradient(var(--brand), #6fb1f2, var(--brand)); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(11,92,173,.45); } 70% { box-shadow: 0 0 0 16px rgba(11,92,173,0); } 100% { box-shadow: 0 0 0 0 rgba(11,92,173,0); } }
@keyframes spin { to { transform: rotate(360deg); } }
.question-text { font-size: 1.2rem; font-weight: 600; margin: .25rem 0 1rem; }
.live-transcript { min-height: 70px; max-height: 160px; overflow-y: auto; font-size: .9rem; }
.progress { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin: .5rem 0 1rem; }
.progress > div { height: 100%; background: var(--brand); transition: width .3s; }
.meter { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.meter > div { height: 100%; width: 0; background: var(--good); transition: width .08s; }
.checklist { list-style: none; padding: 0; margin: 0 0 1rem; }
.checklist li { padding: .35rem 0; display: flex; gap: .5rem; align-items: center; }
.checklist .ok { color: var(--good); font-weight: 700; } .checklist .no { color: var(--bad); font-weight: 700; }
.consent-box { background: #f7f8fa; border: 1px solid var(--line); border-radius: 8px; padding: .9rem 1rem; font-size: .92rem; }
.consent-box ul { margin: .25rem 0 .5rem 1.1rem; padding: 0; }
.check-row { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; }
.check-row input { width: auto; margin-top: .3rem; }
