*{box-sizing:border-box}body{margin:0;font:16px/1.75 "Hiragino Sans",sans-serif;color:#182f3a;background:#f4f7f8}header{background:#143742;color:white;padding:18px max(5vw,calc((100vw - 900px)/2));display:flex;align-items:center;gap:14px;font-size:20px;letter-spacing:.08em}.mark{border:1px solid #94c6c3;padding:0 6px;color:#c1eece}main{max-width:950px;margin:auto;padding:34px 24px 70px}h1{font-size:clamp(30px,5vw,45px);margin:0}h2{font-size:22px;margin-top:30px}.meta,.stats,#topic,small{color:#4a6470}.meta{margin-top:0}button{font:inherit;color:inherit;cursor:pointer;border:1px solid #bed0d4;border-radius:8px;background:white;text-align:left;padding:14px 18px}button:focus-visible{outline:3px solid #b05817}button:hover:enabled{border-color:#187768;background:#f1fbf7}#subjects,#unitList{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}#subjects button{border-left:5px solid #257d71;font-size:21px;font-weight:700}button small{display:block;font-size:14px;font-weight:400}button[aria-pressed=true]{background:#d9eee5}#unitList button,.stats{display:flex;align-items:center;justify-content:space-between;gap:12px}.link{background:none;padding:0;border:0;text-decoration:underline}#quiz{background:white;padding:clamp(16px,4vw,40px);border:1px solid #ccdadd;border-radius:12px}#options{display:grid;gap:9px}#options button{display:flex;gap:14px;white-space:pre-wrap}#options b{color:#48656d}#options button:disabled{cursor:default;opacity:1}#options .right{border-color:#207958;background:#e4f5eb}#options .wrong{border-color:#ac4441;background:#fff0ed}progress{width:100%;accent-color:#217869}#feedback{border-top:2px solid #296e66;margin-top:24px}#reason,#question{white-space:pre-wrap;overflow-wrap:anywhere}#next{background:#174e49;color:white}#next:hover{color:#174e49}@media(max-width:560px){#unitList{grid-template-columns:1fr}main{padding:24px 14px}#subjects button{font-size:17px;padding:12px}}

body:has(#quiz:not([hidden])) header{display:none}
main:has(#quiz:not([hidden])){padding:8px 12px 24px}
#quiz{padding:12px 18px}
#back{font-size:.9rem}
#topic{margin:3px 0;font-size:.9rem}
.stats{line-height:1.4}
#bar{display:block;height:6px;margin:5px 0}
#question{margin:12px 0;line-height:1.5}
#options{gap:5px}
#options button{min-height:44px;padding:8px 12px;line-height:1.5}
#feedback{scroll-margin-top:10px;margin-top:12px;padding:10px 0 4px}
#result{margin:0;color:#183c39;font-size:1.4rem}
#answerText{margin:4px 0;font-weight:700}
#reason{margin:6px 0 12px}
@media(max-width:560px){main:has(#quiz:not([hidden])){padding:4px}#quiz{padding:10px}}
#controls{display:flex;align-items:center;justify-content:flex-end;gap:10px;margin-bottom:4px;font-size:.9rem}#controls .quiz-sound-control{padding:0}#controls button,#controls select{font:inherit;min-height:32px;padding:2px 8px;border:1px solid #759094;border-radius:5px;color:inherit;background:transparent}#controls select option{color:#142b35;background:white}
#dots{display:flex;flex-wrap:wrap;gap:2px;line-height:12px;margin:4px 0;color:#60747a}#dots span{font-size:11px;text-align:center;min-width:7px}#dots [data-result=right]{color:#1c7759}#dots [data-result=wrong]{color:#ac3434}
#history{margin:10px 0}summary{cursor:pointer}#records{padding:6px 12px;font-size:.9rem}#records details{padding:3px 0}
body[data-theme=paper]{background:#ece6d6;color:#392e1e}body[data-theme=paper] :is(#quiz,#subjects button,#unitList button,#options button:enabled){background:#fff8e6}
body[data-theme=night]{background:#101c27;color:#eff5fa}body[data-theme=night] :is(#quiz,button){background:#203241;color:#eff5fa}body[data-theme=night] :is(small,.meta,.stats,#topic,#result,#options b,#comment,#dots){color:#c7dfeb}body[data-theme=night] #options .right,body[data-theme=night] button[aria-pressed=true]{background:#164e40}body[data-theme=night] #options .wrong{background:#612d39}body[data-theme=night] #dots [data-result=right]{color:#92eac5}body[data-theme=night] #dots [data-result=wrong]{color:#ffafb2}

#controls{flex-wrap:wrap}#units select{font:inherit}#unitList,#resumelist:not(:empty){margin:8px 0}#resumelist button{display:block;width:100%;margin:4px 0}body[data-font=serif]{font-family:"Hiragino Mincho ProN","Yu Mincho",serif}body[data-font=round]{font-family:"Hiragino Maru Gothic ProN","BIZ UDGothic",ui-rounded,sans-serif}
body[data-theme=indigo]{--surface:#1e1b4b;--accent:#a5b4fc}
body[data-theme=green]{--surface:#064e3b;--accent:#6ee7b7}
body[data-theme=rose]{--surface:#450a24;--accent:#fda4af}
body[data-theme=amber]{--surface:#431407;--accent:#fbbf24}
body[data-theme=cyan]{--surface:#083344;--accent:#67e8f9}
body[data-theme=violet]{--surface:#2e1065;--accent:#d8b4fe}
body.palette{background:var(--surface);color:#fff}body.palette header,body.palette :is(#quiz,button){background:color-mix(in srgb,var(--surface) 78%,#111827);color:#fff}body.palette :is(.stats,.meta,small,#topic,#result,#options b,#dots){color:#f2f3fa}body.palette #subjects button,body.palette #feedback{border-color:var(--accent)}body.palette button:hover:enabled,body.palette button[aria-pressed=true],body.palette #next{background:var(--accent);color:#111827}body.palette button[aria-pressed=true] small,body.palette button:hover:enabled small,body.palette #options button:hover:enabled b{color:#111827}body.palette #options .right{background:#184938}body.palette #options .wrong{background:#672f42}body.palette #dots [data-result=right]{color:#abf5cf}body.palette #dots [data-result=wrong]{color:#ffbec6}body.palette progress{accent-color:var(--accent)}
#quiz.finished{--celebrate:var(--accent,#20745f);border-top:4px solid var(--celebrate)}
body[data-theme=night] #quiz.finished{--celebrate:#8be4c2}
.finished :is(.stats,#bar){display:none}
.finished #question{margin:.9rem 0 .15rem;font-size:clamp(1.8rem,5vw,3rem);line-height:1.2}
#finishScore{margin:.35rem 0 1.15rem;font-size:1.35rem;font-weight:700}
#quiz #continueSet{background:var(--celebrate);color:white;border:0;border-radius:.55rem;padding:.65rem 1.25rem;font:inherit;font-weight:700;cursor:pointer}
body:is([data-theme=night],.palette) #quiz #continueSet{color:#102129}
#review details{border-top:1px solid currentColor;padding:.55rem 0}
#review summary{font-weight:600}
@media(prefers-reduced-motion:no-preference){.finished #question{animation:finish-in .35s ease-out}@keyframes finish-in{from{opacity:0;transform:translateY(.4rem)}to{opacity:1;transform:none}}}

.finished #attempt{display:none}#attempt,#population{font-size:.9rem}#personal{margin:.65rem 0}#timeline{padding-inline-start:1.75rem}
