:root {
  --navy: #1B3768; --ink: #101828; --muted: #667085; --line: #e4e7ec; --bg: #f5f7fb; --card: #fff;
  --ok: #12b76a; --warn: #f79009; --bad: #f04438; --accent: #2e6bd8;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #f2f4f7; --muted: #98a2b3; --line: #344054; --bg: #0c111d; --card: #161b26; color-scheme: dark; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh; min-height: 100dvh; -webkit-tap-highlight-color: transparent;
}
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--navy); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { border-radius: 50%; background: #fff; flex: none; }
.brand b { display: block; font-size: 13px; letter-spacing: .02em; }
.brand span { display: block; font-size: 12px; opacity: .8; }
.lang { display: flex; gap: 4px; flex: none; }
.lang button { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; padding: 4px 8px; font: inherit; font-size: 12px; }
.lang button.on { background: #fff; color: var(--navy); border-color: #fff; }
main { max-width: 520px; margin: 0 auto; padding: 16px; }
.scr { display: none; text-align: center; }
.scr.on { display: block; }
h1 { font-size: 22px; margin: 12px 0 8px; }
h2 { font-size: 17px; margin: 0; }
p { margin: 8px 0; }
.sub { color: var(--muted); font-size: 14px; }
.kind { font-weight: 700; color: var(--navy); margin: 0 0 10px; }
@media (prefers-color-scheme: dark) { .kind { color: #9db7ee; } }
.hint { font-size: 17px; font-weight: 600; margin-top: 14px; }
.cam { position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: 62vh; margin: 0 auto; border-radius: 20px; overflow: hidden; background: #000; }
.cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam.scan video { transform: none; }
.oval { position: absolute; left: 50%; top: 46%; width: 64%; height: 66%; transform: translate(-50%, -50%);
  border-radius: 50%; border: 4px dashed rgba(255,255,255,.85); box-shadow: 0 0 0 999px rgba(0,0,0,.35); transition: border-color .2s; }
.oval.ok { border-style: solid; border-color: var(--ok); }
.frame { position: absolute; inset: 18%; border: 4px solid rgba(255,255,255,.9); border-radius: 16px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity .12s; }
.flash.on { opacity: .55; }
.btn { display: block; width: 100%; margin: 12px 0 0; padding: 13px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.big { padding: 16px; font-size: 17px; }
.btn:disabled { opacity: .55; }
.icon { width: 72px; height: 72px; margin: 20px auto 4px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 40px; font-weight: 800; color: #fff; background: var(--muted); }
.icon.ok { background: var(--ok); } .icon.warn { background: var(--warn); } .icon.bad { background: var(--bad); }
.spin { width: 48px; height: 48px; margin: 40px auto 12px; border: 5px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: r 1s linear infinite; }
@keyframes r { to { transform: rotate(360deg); } }
.ok-line { color: var(--ok); font-weight: 600; }
#after { margin-top: 18px; text-align: left; }
#students { margin-top: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.st-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
#st-until { color: var(--muted); font-size: 13px; }
.st-count { font-size: 14px; margin: 6px 0; }
#st-list { list-style: none; margin: 8px 0 0; padding: 0; }
#st-list li.g { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 10px 0 4px; }
#st-list label { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-top: 1px solid var(--line); }
#st-list input { width: 22px; height: 22px; flex: none; accent-color: var(--accent); }
#st-list .nm { flex: 1; min-width: 0; }
#st-list .bd { font-size: 11px; color: var(--ok); white-space: nowrap; }
@media (max-width: 360px) { .brand span { display: none; } }
.icon.qr { font-size: 24px; letter-spacing: .04em; }
