:root {
  color-scheme: light;
  --ink: #1f1b24;
  --dim: #625b68;
  --hint: #746d79;
  --paper: #fff;
  --bg: #f7f6f8;
  --line: #e8e4ea;
  --red: #b71939;
  --red-hover: #98112e;
  --red-soft: #fce9ed;
  --blue: #17519c;
  --blue-soft: #eaf2ff;
  --green: #176446;
  --green-soft: #e4f3eb;
  --amber: #8a5105;
  --amber-soft: #fff0d8;
  --radius: 18px;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  accent-color: var(--red);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; display: flex; flex-direction: column; }
main { flex: 1; }
button,input,select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .64; }
a { color: var(--red); text-underline-offset: 3px; }
a:hover { color: var(--red-hover); }
:focus-visible { outline: 3px solid #9232a1; outline-offset: 3px; }
h1,h2,h3,p { margin: 0; }
h1,h2,h3 { line-height: 1.16; letter-spacing: -.035em; }
h1 { font-size: clamp(2rem, 4vw, 3.15rem); }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.1rem; }
small { color: var(--dim); font-size: .83rem; }
.sr-only, .skip-link:not(:focus) {
  position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
  clip:rect(0,0,0,0); white-space:nowrap; border:0;
}
.skip-link:focus { position: absolute; left: 1rem; top: .8rem; z-index: 10; background:#fff; padding: .75rem; border-radius:.5rem; }
.topbar { height: 72px; background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-inner, .footer, .wrap { max-width: 1248px; margin: 0 auto; padding-inline: clamp(16px,4vw,52px); width: 100%; }
.topbar-inner { height: 100%; display:flex; align-items:center; justify-content:space-between; gap:12px; }
.brand { display:flex; gap:.66rem; align-items:center; font-weight:850; font-size:1rem; letter-spacing:.03em; line-height:1; color:var(--ink); text-decoration:none; }
.brand:hover { color:var(--ink); }
.brand-mark { width:34px; height:34px; border-radius:9px; background:var(--red); display:grid; place-items:center; color:#fff; }
.brand-mark svg { width:22px; height:22px; }
.brand small { font-size:.72rem; font-weight:600; color:var(--dim); letter-spacing:0; margin-left:.35rem; }
.toolbar { display:flex; align-items:center; gap:.65rem; }
.account-label { max-width: 26ch; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.footer { display:flex; justify-content:space-between; gap:1rem; color:var(--dim); font-size:.82rem; padding-block: 22px; }
.footer a { color:var(--dim); }
.wrap { padding-block: clamp(25px,5vw,58px); }
.narrow { max-width: 580px; }
.loading { padding:48px; text-align:center; color:var(--dim); }
.login-shell {
  width:min(calc(100% - 36px),1080px); margin:clamp(28px,6vw,80px) auto;
  display:grid; grid-template-columns: 1.08fr 1fr; border:1px solid var(--line);
  border-radius:23px; overflow:hidden; background:var(--paper); box-shadow:0 20px 65px #2c122310;
}
.hero {
  display:flex; flex-direction:column; justify-content:space-between; gap:clamp(24px,4vw,48px);
  min-height:530px; position:relative; isolation:isolate;
  padding:clamp(26px,4.5vw,54px);
  color:#fff; background:radial-gradient(ellipse at 100% 100%,#7e1d51 0%,transparent 70%),linear-gradient(135deg,#231723,#342132);
}
.hero::after {
  content:""; position:absolute; z-index:-1; bottom:0; left:0; right:0; height:58%;
  opacity:.22; background-image:linear-gradient(#dbb0cf48 1px,transparent 1px),linear-gradient(90deg,#dbb0cf48 1px,transparent 1px);
  background-size:27px 27px; mask-image:linear-gradient(transparent,#000);
}
.hero h1 { max-width:13ch; text-wrap:balance; font-weight:770; }
.hero .eyebrow { color:#ffd3df; margin-bottom:18px; }
.hero p:not(.eyebrow) { margin-top:18px; max-width:35ch; color:#eddee9; }
.hero-visual { margin-top:auto; display:flex; gap:9px; flex-wrap:wrap; }
.visual-set { font-weight:720; width:56px; height:49px; border:1px solid #ffffff34; border-radius:12px; display:grid; place-items:center; background:#ffffff12; font-size:1.12rem; }
.visual-set:first-child { background:#f6d5e3; color:#701a41; border-color:#f6d5e3; }
.login-pane { padding:clamp(24px,4.6vw,54px); display:flex; flex-direction:column; justify-content:center; }
.login-pane > h2 { margin-bottom:.48rem; font-size:1.8rem; }
.eyebrow { font-size:.77rem; letter-spacing:.105em; font-weight:800; text-transform:uppercase; color:var(--red); }
.lede { color:var(--dim); margin-top:.65rem; }
form.stack { display:grid; gap:14px; }
label.field { display:grid; gap:6px; font-size:.86rem; font-weight:700; }
input:not([type=radio]):not([type=checkbox]) {
  border:1px solid #d9d3dd; border-radius:9px; padding:10px 12px; width:100%;
  background:#fff; color:var(--ink); min-height:45px;
}
input:read-only { background:var(--bg); }
input::placeholder { color:#797380; }
.tabs { display:flex; padding:4px; background:var(--bg); border:1px solid var(--line); border-radius:11px; margin:20px 0; gap:3px; }
.tabs button { flex:1; background:transparent; border:1px solid transparent; border-radius:8px; padding:8px 5px; color:var(--dim); font-weight:680; font-size:.87rem; }
.tabs button[aria-selected=true] { color:var(--red); background:white; border-color:var(--line); box-shadow:0 1px 2px #2b203010; }
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:42px;
  padding:9px 14px; border-radius:9px; border:1px solid transparent;
  font-weight:720; font-size:.89rem; line-height:1.25; text-decoration:none; white-space:normal;
}
.primary { color:#fff; background:var(--red); }
.primary:hover:not(:disabled) { color:#fff; background:var(--red-hover); }
.secondary { color:var(--ink); background:#fff; border-color:#dcd6df; }
.secondary:hover:not(:disabled) { background:var(--bg); color:var(--ink); }
.quiet { color:var(--red); background:transparent; }
.quiet:hover:not(:disabled) { background:var(--red-soft); }
.full { width:100%; }
.password-row { position:relative; }
.password-row input { padding-right:4.9rem !important; }
.password-row button { position:absolute; right:5px; top:50%; transform:translateY(-50%); border:0; background:transparent; color:var(--red); font-weight:700; padding:7px 8px; border-radius:6px; }
.forgot { margin-top:.95rem; font-size:.84rem; }
.forgot summary { cursor:pointer; color:var(--red); font-weight:720; }
.forgot p { margin-top:.48rem; color:var(--dim); }
.error { color:#8b1b31; background:var(--red-soft); border-radius:8px; padding:10px 12px; font-size:.88rem; }
.error:empty { display:none; }
.form-card, .card { background:var(--paper); border:1px solid var(--line); border-radius:var(--radius); padding:clamp(15px,2.5vw,28px); }
.form-card > p { margin-block:.6rem 1.15rem; }
.section-head { display:flex; justify-content:space-between; align-items:flex-end; gap:16px; margin-bottom:20px; }
.section-head .eyebrow { margin-bottom:8px; }
.section-head h1 { text-wrap:balance; }
.metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:24px 0 32px; }
.metric { padding:15px 18px; border:1px solid var(--line); border-radius:13px; background:var(--paper); }
.metric strong { display:block; font-size:1.5rem; letter-spacing:-.035em; color:var(--ink); }
.metric span { display:block; color:var(--dim); font-size:.8rem; }
.quiz-cards { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.quiz-card { display:grid; gap:14px; }
.quiz-card-head { display:flex; align-items:center; gap:12px; }
.set-icon { width:43px; height:43px; border-radius:11px; display:grid; place-items:center; color:var(--red); background:var(--red-soft); font-weight:800; font-size:1.12rem; flex:none; }
.card-actions { display:flex; gap:8px; flex-wrap:wrap; }
.note { padding:12px 14px; border-radius:10px; background:var(--bg); color:var(--dim); border:1px solid var(--line); font-size:.9rem; }
.notice { background:var(--amber-soft); border-color:#f2d7a8; color:#69410e; }
.subsection { margin-top:32px; }
.subsection > h2 { margin-bottom:12px; }
.table-scroll { overflow-x:auto; border:1px solid var(--line); border-radius:13px; background:var(--paper); }
.table-scroll:focus-visible { outline-offset:2px; }
table { border-collapse:collapse; width:100%; font-size:.88rem; text-align:left; }
th,td { padding:11px 14px; border-bottom:1px solid var(--line); vertical-align:middle; }
th { color:var(--dim); font-weight:700; background:#faf9fb; white-space:nowrap; }
tr:last-child td { border-bottom:0; }
.table-link { border:0; background:transparent; color:var(--red); text-decoration:underline; text-underline-offset:3px; padding:4px 0; font-weight:730; }
.badge { display:inline-flex; align-items:center; border-radius:99px; border:1px solid transparent; padding:3px 8px; color:var(--dim); font-size:.74rem; font-weight:730; background:#efedf1; white-space:nowrap; }
.badge.green { background:var(--green-soft); color:var(--green); }
.badge.amber { background:var(--amber-soft); color:var(--amber); }
.muted { color:var(--dim); }
.search-row { display:flex; gap:8px; margin-bottom:14px; }
.search-row input { max-width:380px; }
.cols { display:grid; grid-template-columns:1fr 1fr; gap:15px; align-items:start; }
.details { display:grid; grid-template-columns:auto 1fr; gap:7px 14px; font-size:.9rem; margin:16px 0 0; }
.details dt { color:var(--dim); }
.details dd { margin:0; overflow-wrap:anywhere; }
.access-sets { display:flex; gap:8px; flex-wrap:wrap; }
.check-pill { display:flex; align-items:center; gap:4px; padding:6px 9px; border:1px solid var(--line); border-radius:8px; font-size:.84rem; }
fieldset { min-width:0; border:0; margin:0; padding:0; }
legend { font-weight:750; font-size:.86rem; margin-bottom:7px; padding:0; }
.quiz-head { margin-bottom:18px; }
.quiz-head h1 { font-size:clamp(1.65rem,3vw,2.5rem); }
.quiz-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(238px,300px); gap:16px; align-items:start; }
.navigation { display:grid; gap:13px; position:sticky; top:16px; }
.timer { font-size:1.48rem; font-weight:800; font-variant-numeric:tabular-nums; letter-spacing:-.04em; }
.timer.low { color:var(--red); }
.question-meta { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:16px; }
.question-meta h2 { font-size:1.29rem; }
.question-stem { font-size:1.12rem; line-height:1.55; margin-bottom:19px; white-space:pre-wrap; overflow-wrap:anywhere; }
.answer-list { display:grid; gap:8px; }
.answer-option { display:grid; cursor:pointer; }
.answer-option input { grid-area:1 / 1; align-self:start; z-index:1; margin:15px 0 0 14px; width:16px; height:16px; cursor:inherit; accent-color:var(--blue); }
.answer-content { grid-area:1 / 1; display:grid; grid-template-columns:1.25em minmax(0,1fr); gap:3px 6px;
  align-content:center; min-height:46px; padding:10px 13px 10px 40px; border:1px solid #dcd6df;
  border-radius:9px; background:#fff; line-height:1.5; white-space:pre-wrap; overflow-wrap:anywhere; }
.answer-list.ungraded input:checked + .answer-content { color:var(--blue); background:var(--blue-soft); border-color:var(--blue); }
.answer-option input:focus-visible + .answer-content { outline:3px solid #9232a1; outline-offset:2px; }
.answer-option:hover input:not(:disabled):not(:checked) + .answer-content { background:var(--bg); }
.answer-option:has(input:disabled) { cursor:default; }
.answer-option.correct .answer-content { color:var(--green); background:var(--green-soft); border-color:var(--green); }
.answer-option.incorrect .answer-content { color:var(--red-hover); background:var(--red-soft); border-color:var(--red); }
.answer-option.correct input { accent-color:var(--green); }
.answer-option.incorrect input { accent-color:var(--red); }
.answer-result { grid-column:2; font-size:.82rem; font-weight:750; }
.feedback { padding:13px 15px; border-radius:11px; border:1px solid var(--line); margin-top:16px; background:#faf9fb; }
.feedback h3 { font-size:1.04rem; margin-bottom:9px; }
.feedback ol { margin:0; padding-left:22px; font-size:.88rem; }
.feedback li { padding:3px 0; }
.feedback li.good { color:var(--green); font-weight:650; }
.feedback li.bad { color:#8b1b31; }
.question-footer { display:flex; justify-content:space-between; gap:8px; margin-top:16px; }
.grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:6px; }
.grid button { position:relative; display:flex; justify-content:center; align-items:center; border:1px solid #ded9e2; border-radius:7px; background:#eeedf0; color:#504956; min-height:39px; font-size:.8rem; font-weight:720; }
.grid button.skipped { background:#fff; border-style:dashed; }
.grid button.answered { background:var(--green-soft); color:var(--green); border-color:#9ccab5; }
.grid button[aria-current=step] { outline:2px solid var(--red); outline-offset:1px; }
.grid .flag-dot { position:absolute; right:-2px; top:-5px; color:#975900; font-size:.84rem; line-height:1; }
.legend { display:flex; gap:8px 12px; flex-wrap:wrap; color:var(--dim); font-size:.73rem; }
.legend span { display:inline-flex; align-items:center; gap:4px; }
.legend i { width:10px; height:10px; display:inline-block; border:1px solid #d2cbd8; background:#eeeaf1; border-radius:3px; }
.legend .done { background:var(--green-soft); border-color:#9ccab5; }
.legend .skip { background:#fff; border-style:dashed; }
.legend .flag { color:#935200; font-style:normal; background:none; border:0; }
.sync-state { font-size:.76rem; color:var(--dim); min-height:1.2em; }
.sync-state.warn { color:var(--amber); }
.result-score { background:var(--green-soft); color:var(--green); border-radius:12px; padding:10px 16px; white-space:nowrap; font-weight:800; }
dialog { width:min(calc(100% - 30px),540px); border:1px solid var(--line); border-radius:15px; box-shadow:0 22px 75px #1a0d25aa; padding:24px; max-height:calc(100% - 26px); }
dialog::backdrop { background:#231a2bc0; }
dialog h2 { margin-bottom:10px; }
dialog p { margin-bottom:12px; }
dialog .card-actions { justify-content:flex-end; margin-top:16px; }
.temp-code { width:100%; font-family:ui-monospace,monospace!important; font-size:1.05rem!important; }
@media(max-width:810px) {
  .quiz-layout { grid-template-columns:minmax(0,1fr) 220px; }
  .login-shell { grid-template-columns:1fr 1fr; }
  .hero { min-height:440px; }
  .hero h1 { font-size:2.1rem; }
}
@media(max-width:660px) {
  .topbar { height:60px; }
  .brand small, .account-label { display:none; }
  .login-shell, .cols, .quiz-layout, .quiz-cards { grid-template-columns:1fr; }
  .login-shell { margin-block:18px 28px; }
  .hero { min-height:0; gap:20px; }
  .hero h1 { max-width:17ch; font-size:clamp(1.65rem,6.8vw,2.12rem); }
  .hero .eyebrow { margin-bottom:9px; }
  .hero p:not(.eyebrow) { margin-top:9px; }
  .hero-visual { display:none; }
  .section-head { align-items:flex-start; flex-direction:column; }
  .quiz-head { flex-direction:row; align-items:center; }
  .metrics { gap:6px; }
  .metric { padding:10px 8px; }
  .metric strong { font-size:1.15rem; }
  .metric span { font-size:.73rem; }
  .navigation { position:static; }
  .grid { grid-template-columns:repeat(10,minmax(0,1fr)); }
  .grid button { min-height:34px; }
  th,td { padding:9px 11px; }
}
@media(max-width:385px) {
  .grid { grid-template-columns:repeat(5,minmax(0,1fr)); }
  .quiz-head { flex-wrap:wrap; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto!important; } }
.details-list { color:var(--dim); margin:14px 0 0; padding-left:22px; font-size:.86rem; }
.details-list li { padding-block:2px; }
