:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #16212e;
  --muted: #5d6b7a;
  --line: #dde3ea;
  --brand: #0b6bcb;
  --brand-ink: #ffffff;
  --ok: #1d8a4e;
  --warn: #b26a00;
  --bad: #c62828;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; letter-spacing: .3px; display: flex; align-items: center; gap: 8px; }
.logo {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px;
  background: var(--brand); color: var(--brand-ink); font-weight: 800;
}
.muted { color: var(--muted); font-weight: 400; }
main { max-width: 960px; margin: 24px auto; padding: 0 16px 80px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; margin-bottom: 16px;
}
.center { text-align: center; }
h1 { font-size: 1.5rem; margin: 0 0 8px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
ul.rules { padding-left: 20px; margin: 8px 0 0; }
ul.rules li { margin: 6px 0; }
.btn {
  appearance: none; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink);
  font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 8px; cursor: pointer;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--brand); }
.btn.danger { background: var(--bad); border-color: var(--bad); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.steps { display: grid; gap: 12px; margin: 16px 0; }
.step {
  display: flex; gap: 14px; align-items: center; justify-content: space-between;
  border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px;
}
.step .state { font-weight: 600; }
.state.ok { color: var(--ok); }
.state.bad { color: var(--bad); }
.notice { border-radius: 8px; padding: 12px 14px; margin: 12px 0; }
.notice.warn { background: #fff4e0; color: #6b4300; }
.notice.bad { background: #fdecea; color: #7f1d1d; }
.notice.ok { background: #e8f5ee; color: #14532d; }
label.consent { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; cursor: pointer; }
label.consent input { margin-top: 4px; width: 18px; height: 18px; }
.preview { width: 240px; aspect-ratio: 16/9; background: #000; border-radius: 8px; object-fit: cover; }

/* Test layout */
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.1rem; }
.timer.low { color: var(--bad); }
.test-grid { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: start; }
@media (max-width: 760px) { .test-grid { grid-template-columns: 1fr; } }
.nav { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.nav button {
  font: inherit; font-size: .85rem; padding: 6px 0; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
.nav button.answered { background: #e3effb; border-color: #9cc3ea; }
.nav button.current { outline: 2px solid var(--brand); outline-offset: 1px; }
.tag {
  display: inline-block; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
  color: var(--brand); background: #e3effb; border-radius: 999px; padding: 2px 10px; margin-bottom: 10px;
}
.prompt { font-size: 1.08rem; font-weight: 600; margin: 0 0 16px; white-space: pre-wrap; }
.options { display: grid; gap: 10px; }
.option {
  display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; cursor: pointer; background: var(--card);
}
.option:hover { border-color: #9cc3ea; }
.option.selected { border-color: var(--brand); background: #f0f7ff; }
.option input { margin-top: 4px; }
.saved { font-size: .85rem; color: var(--muted); min-height: 1.2em; }
.progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--brand); width: 0; transition: width .3s; }

#selfview {
  position: fixed; right: 16px; bottom: 16px; width: 180px; aspect-ratio: 16/9; object-fit: cover;
  border-radius: 8px; border: 2px solid var(--card); box-shadow: 0 4px 16px rgba(0,0,0,.25); background: #000; z-index: 10;
}
.rec-dot { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--bad); font-weight: 600; }
.rec-dot::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }

.overlay {
  position: fixed; inset: 0; background: rgba(10, 20, 30, .82); z-index: 20;
  display: grid; place-items: center; padding: 16px;
}
.overlay .card { max-width: 520px; width: 100%; }
[hidden] { display: none !important; }
