:root {
  --navy: #223f80; --navy-d: #182c5c; --orange: #f59326; --orange-d: #c9700c; --ink: #25344a; --muted: #5b6b88;
  --line: #d5ddea; --soft: #f8fafe; --tint: #e9edf4; --ok: #1d7a46; --ok-bg: #e3f4ea; --bad: #b3261e; --bad-bg: #fcebea; --warn-bg: #fff4e0;
  --r: 14px; --font: Arial, "Helvetica Neue", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--font); color: var(--ink); background: var(--soft); min-height: 100vh; }
a { color: var(--navy); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 6px; }
.topbar { background: var(--navy); color: #fff; display: flex; align-items: center; gap: 12px; padding: 10px 16px; position: sticky; top: 0; z-index: 20; }
.topbar img { height: 30px; display: block; }
.topbar .t { font-weight: 700; font-size: 15px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .who { font-size: 13px; opacity: .85; white-space: nowrap; max-width: 40%; overflow: hidden; text-overflow: ellipsis; }
main { max-width: 720px; margin: 0 auto; padding: 20px 16px 80px; }
main.wide { max-width: 1180px; }
h1 { font-size: 26px; line-height: 1.2; margin: 8px 0 6px; color: var(--navy); }
h2 { font-size: 20px; margin: 0 0 8px; color: var(--navy); }
h3 { font-size: 16px; margin: 0 0 6px; }
.lead { color: var(--muted); margin: 0 0 18px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin: 0 0 14px; box-shadow: 0 1px 2px rgba(34,63,128,.05); }
.card.tint { background: var(--tint); border-color: transparent; }
label { display: block; font-weight: 700; margin: 14px 0 6px; }
input[type=text], input[type=password], input[type=url], input[type=number], select { width: 100%; padding: 13px 14px; border: 1.5px solid #b7c3d8; border-radius: 10px; background: #fff; min-height: 48px; }
input:focus { border-color: var(--navy); }
.code-input { font-size: 28px; letter-spacing: .25em; text-transform: uppercase; text-align: center; font-weight: 700; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border: 0; border-radius: 12px; background: var(--navy); color: #fff; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--navy-d); }
.btn.primary { background: var(--orange); color: #1c1200; }
.btn.primary:hover { background: #e58410; }
.btn.ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 9px; }
.btn.danger { background: var(--bad); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.block { display: flex; width: 100%; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.sp { justify-content: space-between; }
.msg { padding: 12px 14px; border-radius: 10px; margin: 12px 0; font-size: 15px; }
.msg.err { background: var(--bad-bg); color: var(--bad); }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.warn { background: var(--warn-bg); color: #7a4a00; }
.msg.info { background: var(--tint); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; background: var(--tint); color: var(--navy); }
.pill.open { background: var(--ok-bg); color: var(--ok); }
.pill.closed { background: #eceff4; color: var(--muted); }
.pill.test { background: var(--warn-bg); color: #7a4a00; }
.hub-grid { display: grid; gap: 14px; }
.hub-item { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center; }
.hub-item .ico { width: 56px; height: 56px; border-radius: 16px; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 22px; }
.hub-item .ico.o { background: var(--orange); color: #1c1200; }
.hub-item p { margin: 2px 0 8px; color: var(--muted); font-size: 14px; }
.situation { font-size: 22px; line-height: 1.35; font-weight: 700; margin: 10px 0 18px; }
.choices { display: grid; gap: 10px; }
.choice { text-align: left; padding: 14px 16px; border: 2px solid var(--line); background: #fff; border-radius: 12px; min-height: 52px; cursor: pointer; display: flex; gap: 12px; align-items: flex-start; font-size: 17px; }
.choice:hover { border-color: var(--navy); }
.choice .k { flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--tint); display: grid; place-items: center; font-weight: 800; color: var(--navy); font-size: 14px; }
.choice[aria-pressed=true], .choice.sel { border-color: var(--navy); background: #eef2fb; }
.choice[aria-pressed=true] .k, .choice.sel .k { background: var(--navy); color: #fff; }
.choice.right { border-color: var(--ok); background: var(--ok-bg); }
.choice.wrong { border-color: var(--bad); background: var(--bad-bg); }
.s5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.s5 .choice { flex-direction: column; align-items: center; text-align: center; padding: 10px 2px; font-size: 14px; gap: 4px; min-height: 78px; justify-content: center; }
.s5 .choice .k { background: var(--navy); color: #fff; }
.prog { height: 8px; background: var(--tint); border-radius: 9px; overflow: hidden; margin: 10px 0 16px; }
.prog > i { display: block; height: 100%; background: var(--orange); transition: width .25s; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 20px; }
.timer.low { color: var(--bad); }
.examhead { position: sticky; top: 50px; z-index: 10; background: var(--soft); padding: 10px 0 4px; }
.sync { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.sync.saved { background: var(--ok-bg); color: var(--ok); }
.sync.saving { background: var(--tint); color: var(--navy); }
.sync.offline { background: var(--bad-bg); color: var(--bad); }
.dots { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.dots button { width: 36px; height: 36px; border-radius: 9px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; cursor: pointer; }
.dots button.done { background: var(--navy); border-color: var(--navy); color: #fff; }
.dots button.cur { outline: 3px solid var(--orange); }
.bigscore { font-size: 64px; font-weight: 800; color: var(--navy); line-height: 1; }
.imgwrap { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #000; touch-action: manipulation; }
.imgscroll { overflow: auto; border-radius: 12px; max-height: 70vh; }
.imgwrap img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.imgwrap.zoom { width: 220%; }
.mark { position: absolute; border: 4px solid var(--ok); border-radius: 50%; background: rgba(29,122,70,.18); transform: translate(-50%, -50%); pointer-events: none; }
.mark.miss { border-color: #fff; background: rgba(179,38,30,.25); width: 28px; height: 28px; animation: fade 1.2s forwards; }
.mark.reveal { border-color: var(--orange); background: rgba(245,147,38,.2); }
@keyframes fade { to { opacity: 0; } }
.legend { font-size: 13px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--tint); font-size: 13px; color: var(--navy); }
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 0 0 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-size: 28px; color: var(--navy); line-height: 1.1; }
.stat span { font-size: 13px; color: var(--muted); }
.bar { height: 10px; background: var(--tint); border-radius: 9px; overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--orange); }
.split { display: grid; gap: 16px; grid-template-columns: 300px 1fr; align-items: start; }
.classlist button { display: block; width: 100%; text-align: left; padding: 12px 14px; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; margin-bottom: 8px; cursor: pointer; }
.classlist button[aria-current=true] { border-color: var(--navy); background: #eef2fb; }
.toggle { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.toggle:last-child { border: 0; }
.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; background: #b7c3d8; border-radius: 99px; transition: .15s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: .15s; }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(22px); }
.switch input:focus-visible + i { outline: 3px solid var(--orange); }
.qr { background: #fff; padding: 10px; border-radius: 12px; border: 1px solid var(--line); display: inline-block; }
.qr svg, .qr img { display: block; width: 220px; height: 220px; }
.big-code { font-size: 44px; font-weight: 800; letter-spacing: .2em; color: var(--navy); }
details { margin: 10px 0; }
summary { cursor: pointer; font-weight: 700; color: var(--navy); min-height: 32px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
@media (max-width: 480px) { h1 { font-size: 23px; } .situation { font-size: 20px; } .bigscore { font-size: 52px; } }
@media print { .topbar, .btn { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
