:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --panel: #fff;
  --ink: #18263e;
  --muted: #63718a;
  --line: #dce4f0;
  --blue: #285de5;
  --green: #187347;
  --red: #b62e45;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 85% 0%, #e6edff, transparent 48%), var(--bg); color: var(--ink); font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; }
.wrap { width: min(1080px, calc(100% - 56px)); margin: auto; padding: 26px 0 24px; }
a { color: var(--blue); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 40px; }
.back { text-decoration: none; font-size: 13px; font-weight: 650; color: #536482; }
.back:hover { color: var(--blue); }
.tag { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #dce5f6; background: #ffffffa8; color: #526787; border-radius: 100px; padding: 8px 13px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.tag-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.intro { margin: 46px 0 28px; }
.eyebrow { display: block; text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 750; color: #637ca6; }
.intro > .eyebrow { color: var(--blue); }
.intro h1 { margin: 10px 0 13px; max-width: 880px; font-size: clamp(28px, 4.5vw, 46px); line-height: 1.14; letter-spacing: -.04em; font-weight: 750; }
.intro p { margin: 0; color: var(--muted); font-size: 15px; }
.panel { border: 1px solid #dfe7f3; background: var(--panel); border-radius: 22px; padding: 30px; box-shadow: 0 12px 40px #243e6807, 0 2px 5px #243e6803; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 25px; }
.section-head .eyebrow { margin-bottom: 7px; }
h2 { font-size: 23px; line-height: 1.35; letter-spacing: -.025em; margin: 0 0 5px; }
.muted { color: var(--muted); font-size: 13px; }
.section-head p { margin: 0; }
.step-label { font-size: 11px; color: #7082a1; white-space: nowrap; padding: 7px 11px; background: #f4f7fc; border-radius: 8px; }
fieldset { padding: 0; border: 0; margin: 0 0 25px; min-width: 0; }
legend, .options label { font-size: 12px; font-weight: 650; }
legend { margin-bottom: 10px; }
.topics { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.topic { display: flex; align-items: flex-start; gap: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 20px; cursor: pointer; transition: background .15s, border-color .15s; }
.topic:hover { border-color: #a2b7de; background: #fafcff; }
.topic:has(input:checked) { border-color: var(--blue); background: #f4f7ff; box-shadow: inset 0 0 0 1px var(--blue); }
.topic input { margin: 4px 0 0; flex-shrink: 0; }
.topic b { display: block; font-size: 16px; line-height: 1.4; margin-bottom: 8px; }
.topic span span { display: block; color: #61718b; font-size: 13px; }
.topic small { display: inline-block; margin-top: 16px; padding: 3px 8px; background: #eaf0fc; border-radius: 5px; color: #506b99; font-size: 10px; font-weight: 650; }
input[type=radio], input[type=checkbox] { accent-color: var(--blue); width: 18px; height: 18px; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
select { display: block; width: 100%; margin-top: 8px; min-height: 48px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 14px; font-weight: 400; background: white; color: var(--ink); cursor: pointer; }
.timer-option { display: flex; align-items: center; gap: 9px; font-size: 13px; margin: 22px 0 25px; color: #5a6b85; cursor: pointer; }
.timer-option input { margin: 0; }
.timer-option b { color: #415574; font-weight: 650; }
.start-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid #e9eef6; padding-top: 23px; }
.start-row p { display: flex; align-items: center; gap: 8px; margin: 0; color: #617391; font-size: 12px; }
.auto-icon { display: inline-grid; place-items: center; width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; background: #ebf5ef; color: var(--green); font-size: 12px; font-weight: 750; }
button { font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; min-height: 46px; padding: 11px 20px; border: 1px solid transparent; border-radius: 10px; transition: background .15s, border-color .15s, box-shadow .15s; }
.primary { background: var(--blue); color: white; box-shadow: 0 4px 12px #285de51c; }
.primary:hover:not(:disabled) { background: #1c4ed0; box-shadow: 0 6px 15px #285de529; }
.secondary { color: #4a5d7b; background: #fff; border-color: var(--line); }
.secondary:hover:not(:disabled) { background: #f5f8fd; border-color: #bdcde5; }
button:disabled { opacity: .45; cursor: not-allowed; }
:focus-visible { outline: 3px solid #83a7ff; outline-offset: 3px; }
[hidden] { display: none !important; }
.notice { border: 1px solid #eed39a; background: #fff8e8; color: #795b16; border-radius: 12px; padding: 14px 18px; margin-bottom: 18px; font-size: 14px; }
.badge { display: inline-flex; align-items: center; border: 1px solid #d9e4fc; background: #f0f5ff; color: #365caa; border-radius: 9px; padding: 8px 12px; font-size: 15px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.progress-block { padding: 17px 19px 13px; background: #f7f9fd; border: 1px solid #e9eef7; border-radius: 13px; }
.progress-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; }
.progress-row b { color: #405779; font-weight: 700; }
#score { display: flex; align-items: center; flex-wrap: wrap; gap: 13px; color: #637492; font-size: 11px; }
.score-correct { color: var(--green); }
progress { width: 100%; height: 5px; display: block; appearance: none; border: 0; border-radius: 10px; background: #e5ebf6; margin: 13px 0 12px; }
progress::-webkit-progress-bar { background: #e5ebf6; border-radius: 10px; }
progress::-webkit-progress-value { background: var(--blue); border-radius: 10px; transition: width .2s; }
progress::-moz-progress-bar { background: var(--blue); border-radius: 10px; }
.question-nav { display: flex; flex-wrap: wrap; gap: 7px; max-height: 118px; overflow: auto; padding: 3px; }
.question-nav button { padding: 0; min-height: 34px; width: 34px; flex-shrink: 0; border-radius: 8px; background: #eaf0f8; color: #697d9e; border: 1px solid transparent; font-size: 11px; }
.question-nav button:hover { background: #e0e8f7; }
.question-nav .correct { background: #e3f3e9; color: var(--green); }
.question-nav .wrong { background: #fce8ed; color: var(--red); }
.question-nav [aria-current=true] { border-color: var(--blue); background: white; color: var(--blue); box-shadow: 0 0 0 1px var(--blue); font-weight: 800; }
.question-nav .correct[aria-current=true] { background: #e3f3e9; color: var(--green); }
.question-nav .wrong[aria-current=true] { background: #fce8ed; color: var(--red); }
.question { padding-top: 28px; }
.question-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.question-meta .eyebrow { font-size: 10px; color: #6c83a6; }
.answer-type { color: #6b7f9f; background: #f2f5fa; padding: 4px 8px; border-radius: 5px; font-size: 10px; }
.question h3 { font-size: 21px; font-weight: 650; line-height: 1.5; letter-spacing: -.015em; margin: 0 0 11px; overflow-wrap: anywhere; }
.question h3:focus { outline: none; }
#answer-hint { margin: 0 0 19px; font-size: 12px; }
#answers { display: grid; gap: 10px; }
.answer { position: relative; display: flex; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 15px 18px; min-height: 62px; cursor: pointer; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; transition: border-color .15s, background .15s; }
.answer input { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; }
.answer:focus-within { outline: 3px solid #83a7ff; outline-offset: 3px; }
.answer-index { display: inline-grid; place-items: center; flex-shrink: 0; width: 29px; height: 29px; border-radius: 7px; background: #f0f4fb; color: #6b80a2; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.answer-copy { display: block; min-width: 0; }
.answer:hover:not(.locked) { border-color: #91ace3; background: #f7faff; }
.answer:has(input:checked) { background: #f2f6ff; border-color: #769be9; }
.answer:has(input:checked) .answer-index { background: #dfe9ff; color: var(--blue); }
.answer.correct, .answer.correct:has(input:checked) { border-color: #8bc7a6; background: #f0faf4; color: #195c3c; }
.answer.correct .answer-index, .answer.correct:has(input:checked) .answer-index { background: #dcefe4; color: var(--green); }
.answer.wrong, .answer.wrong:has(input:checked) { border-color: #e6a1af; background: #fff4f6; color: #a02e43; }
.answer.wrong .answer-index, .answer.wrong:has(input:checked) .answer-index { background: #f9dfe6; color: var(--red); }
.answer.locked { cursor: default; }
.answer-mark { font-size: 10px; font-weight: 700; display: block; margin-top: 5px; }
.feedback { margin-top: 16px; border: 1px solid #cde9d9; border-left: 3px solid #57a77c; border-radius: 10px; padding: 14px 17px; font-size: 12px; background: #f0faf4; color: #195c3c; overflow-wrap: anywhere; }
.feedback b { font-size: 13px; }
.feedback.wrong { border-color: #f0d2da; border-left-color: #ce7186; background: #fff5f7; color: #982d43; }
.feedback p { margin: 7px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.runner-actions { align-items: center; justify-content: space-between; padding-top: 22px; border-top: 1px solid #e9eef6; }
.runner-actions #next { min-width: 165px; }
.end-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 22px; padding-top: 16px; border-top: 1px solid #edf1f7; }
.save-note { font-size: 10px; color: #7c8ca5; }
.save-note > span { color: #7da88f; }
.text-button { background: none; color: #7486a1; padding: 6px 0 6px 8px; min-height: 36px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.text-button:hover { color: var(--blue); }
.stats { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; margin: 27px 0; background: #f5f8fe; border: 1px solid #e8eef9; border-radius: 14px; padding: 25px 12px; }
.stats > div { display: grid; text-align: center; gap: 6px; }
.stats strong { font-size: 34px; color: #315cba; line-height: 1.2; letter-spacing: -.035em; }
.stats #correct-count { color: var(--green); }
.stats #wrong-count { color: var(--red); }
.stats #skipped-count { color: #7b8ba6; }
.stats span { font-size: 11px; color: var(--muted); }
#result > .eyebrow { margin-bottom: 9px; }
.review-title { font-size: 17px; margin: 32px 0 14px; }
.review-item { border-top: 1px solid #e5eaf3; padding: 16px 0; }
.review-item summary { cursor: pointer; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.review-item summary span { display: inline-block; margin-right: 9px; font-size: 11px; }
.review-item p { font-size: 13px; margin: 12px 0 4px; overflow-wrap: anywhere; }
.review-item ul { font-size: 13px; padding-left: 23px; margin: 6px 0 12px; }
.good { color: var(--green); }
.bad { color: var(--red); }
footer { font-size: 10px; text-align: center; color: #8b9ab1; margin: 26px 0 0; }
dialog { border: 1px solid var(--line); border-radius: 18px; padding: 28px; width: min(480px, calc(100% - 32px)); color: var(--ink); }
dialog::backdrop { background: #13223b70; backdrop-filter: blur(3px); }
dialog p { font-size: 14px; color: var(--muted); }
.urgent { background: #fff0f1; color: var(--red); border-color: #efadb5; }
@media (max-width: 760px) {
  .wrap { width: calc(100% - 32px); padding-top: 16px; }
  .top { flex-wrap: wrap; gap: 12px; }
  .top .back { font-size: 11px; }
  .top .tag { order: 3; font-size: 10px; padding: 6px 10px; }
  .top .back:last-child { margin-left: auto; }
  .intro { margin: 28px 0 23px; }
  .intro h1 { font-size: clamp(28px, 5.5vw, 39px); max-width: 600px; }
  .intro p { font-size: 13px; }
  .panel { padding: 23px 19px; border-radius: 17px; }
  .section-head { align-items: flex-start; gap: 12px; margin-bottom: 21px; }
  .section-head h2 { font-size: 21px; }
  .step-label { display: none; }
  .topics { grid-template-columns: 1fr; }
  .topic { padding: 17px; }
  .topic small { margin-top: 11px; }
  .start-row { align-items: stretch; flex-direction: column; gap: 18px; }
  .start-row button { width: 100%; }
  .progress-block { padding: 14px 13px 11px; }
  .question { padding-top: 24px; }
  .question h3 { font-size: 18px; }
  .answer { font-size: 13px; padding: 14px; gap: 12px; }
  .answer-index { width: 27px; height: 27px; }
  .badge { font-size: 13px; padding: 7px 10px; }
  #run-title { font-size: 20px; }
  #run-label { font-size: 9px; letter-spacing: .08em; }
  .stats { grid-template-columns: 1fr 1fr; gap: 23px; padding: 23px 10px; }
  .stats strong { font-size: 30px; }
}
@media (max-width: 460px) {
  .wrap { width: calc(100% - 24px); }
  .intro h1 { font-size: 29px; }
  .panel { padding: 21px 15px; }
  .options { grid-template-columns: 1fr; gap: 17px; }
  .progress-row { flex-wrap: wrap; gap: 7px; }
  #score { font-size: 10px; }
  .question h3 { font-size: 17px; }
  .answer { align-items: flex-start; padding: 13px 12px; }
  .answer-index { margin-top: 1px; }
  .runner-actions #next { min-width: 0; flex: 1; }
  .runner-actions #previous { padding-right: 16px; padding-left: 16px; }
  .end-row { flex-direction: column; align-items: flex-start; gap: 9px; margin-top: 18px; }
  .text-button { padding-left: 0; }
  .result-actions { flex-direction: column; }
  dialog { padding: 22px; }
  dialog .actions > button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
