:root {
  --bg: #0f1220;
  --card: #191d2e;
  --card2: #212642;
  --ink: #eef1f7;
  --muted: #9aa3bd;
  --accent: #6ea8fe;
  --accent2: #7ee0c2;
  --danger: #ff6b6b;
  --ok: #4ade80;
  --warn: #ffcf5c;
  --err: #ff8080;
  --line: #2a3050;
  --radius: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { overflow-x: hidden; }
body {
  margin: 0;
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1b2140 0%, var(--bg) 55%);
  color: var(--ink);
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px 48px; }
header h1 { margin: 0; font-size: 26px; letter-spacing: -0.5px; }
header .tag { margin: 4px 0 18px; color: var(--muted); font-size: 14px; }

.card {
  background: linear-gradient(180deg, var(--card) 0%, #171b2b 100%);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.card h2 { margin: 0 0 12px; font-size: 20px; }
.who { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.who b { color: var(--ink); }

.prep { list-style: none; padding: 0; margin: 0 0 20px; }
.prep li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.prep li:last-child { border-bottom: 0; }

button {
  appearance: none; border: 0; border-radius: 12px; padding: 15px 20px;
  font: inherit; font-weight: 700; cursor: pointer; color: #0b0e18;
}
button.big { width: 100%; font-size: 17px; margin-top: 6px; min-height: 52px; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--accent); }
button.danger { background: var(--danger); color: #fff; }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }

.how { margin-top: 16px; color: var(--muted); font-size: 14px; }
.how summary { cursor: pointer; }
.how p { margin: 10px 0 0; }

.statusbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.rec { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--muted); letter-spacing: 1px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: #3a4266; }
.dot.live { background: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.timer { font-variant-numeric: tabular-nums; font-size: 34px; font-weight: 800; letter-spacing: 1px; }
.timer.warn { color: var(--warn); }
.timer.crit { color: var(--danger); }
.banner { color: var(--muted); font-size: 14px; min-height: 20px; margin: 0 0 8px; }

.nonce { background: var(--card2); border: 2px dashed var(--accent2); border-radius: 14px; padding: 16px; margin-bottom: 16px; text-align: center; }
.nonce-label { color: var(--muted); font-size: 13px; }
.nonce-val { font-family: ui-monospace, Menlo, monospace; font-size: clamp(26px, 8vw, 40px); font-weight: 800; letter-spacing: 2px; color: var(--accent2); margin: 6px 0 2px; word-break: break-word; }
.nonce-idx { color: var(--muted); font-size: 12px; }
.nonce.flash { animation: flash .7s ease; }
@keyframes flash { 0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(126,224,194,.6); } 30% { transform: scale(1.03); box-shadow: 0 0 0 10px rgba(126,224,194,0); } 100% { transform: scale(1); } }

.qbox { background: #0e1120; border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.qmeta { color: var(--accent); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; margin: 0 0 6px; }
.qprompt { font-size: 18px; line-height: 1.45; margin: 0; }
.hint { color: var(--muted); font-size: 13px; text-align: center; margin: 10px 0 0; }

.certstate { font-weight: 700; margin: 4px 0 12px; }
.certstate.ok { color: var(--ok); }
.certstate.err { color: var(--err); }
audio { width: 100%; margin: 4px 0 14px; }
.steps { color: var(--muted); font-size: 14px; margin: 14px 0 0; padding-left: 20px; }
.steps code, .sha code { color: var(--ink); }
.sha { color: var(--muted); font-size: 11px; word-break: break-all; margin-top: 12px; }
.failmsg { color: var(--muted); }

footer { color: var(--muted); font-size: 12px; text-align: center; margin-top: 20px; }
.hidden { display: none !important; }

/* screen-reader-only live regions (INV-PLAT-4) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* visible keyboard focus (INV-PLAT-4) */
:focus-visible { outline: 3px solid #7aa2ff; outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
@media (prefers-reduced-motion: reduce) {
  .dot.live, .nonce.flash { animation: none !important; }
}

/* ---- identity step (v3): student self-identifies; email never leaves the tab ---- */
.fieldlabel { display:block; font-weight:600; margin:.9rem 0 .35rem; }
.field {
  width:100%; box-sizing:border-box; font-size:1.05rem; padding:.8rem .9rem;
  min-height:44px; border-radius:10px; border:1px solid #4a4f6a;
  background:#171a2b; color:inherit;
}
.field:focus-visible { outline:3px solid #7aa2ff; outline-offset:2px; }
.fieldhelp { font-size:.9rem; opacity:.8; margin:.5rem 0 1rem; }
.fieldErr { color:#ff9a9a; font-weight:600; min-height:1.2em; margin:.6rem 0 0; }
.linkish {
  display:block; width:100%; min-height:44px; margin-top:.6rem;
  background:none; border:none; color:#9ab6ff; font:inherit;
  text-decoration:underline; cursor:pointer; padding:.5rem;
}
.linkish.inline { display:inline; width:auto; min-height:0; padding:0; }
.linkish:focus-visible { outline:3px solid #7aa2ff; outline-offset:2px; border-radius:6px; }
