:root { font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #182b25; background: #f4f6f3; line-height: 1.6; }
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; max-width: 1120px; margin: auto; padding: 1rem 1.5rem; }
a { color: #1a6343; text-underline-offset: .2em; }
main { max-width: 1120px; margin: 0 auto 3rem; padding: 1rem 1.5rem; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.12; letter-spacing: -.04em; margin: .5rem 0 1.5rem; }
h2 { line-height: 1.25; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; }
button { cursor: pointer; font: inherit; font-weight: 600; border-radius: .7rem; border: 1px solid #65776d; background: white; color: #182b25; padding: .7rem 1rem; min-height: 48px; }
button:hover { background: #e7eee9; }
.primary { background: #205d40; border-color: #205d40; color: white; }
.primary:hover { background: #16452e; }
:focus-visible { outline: 3px solid #1669c1; outline-offset: 4px; }
#progress { position: sticky; top: 0; z-index: 1; background: #f4f6f3; padding: .6rem 0; border-bottom: 1px solid #ccd7ce; font-weight: 600; }
#error { color: #9d2217; font-weight: 600; }
fieldset { min-width: 0; border: 1px solid #cbd7cf; border-radius: 1rem; padding: 1.2rem; margin: 1.5rem 0; background: white; }
legend { float: left; width: 100%; padding: 0; margin-bottom: 1rem; font-weight: 600; }
.options { clear: both; display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; }
.options label { display: flex; align-items: center; gap: .6rem; min-height: 52px; padding: .6rem .8rem; border: 1px solid #cbd7cf; border-radius: .6rem; cursor: pointer; }
.options label:has(input:checked) { border-color: #205d40; background: #e4f0e7; }
input { width: 1.2rem; height: 1.2rem; accent-color: #205d40; flex-shrink: 0; margin: 0; }
.unanswered { border: 2px solid #a62b20; }
.score-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .7rem; margin: 1.5rem 0; }
.score-card { border: 1px solid #cbd7cf; border-radius: .8rem; padding: 1rem; background: white; }
.score-card h3 { font-size: 1rem; margin: 0; overflow-wrap: anywhere; }
.score-card p { font-size: .9rem; }
.score-card .score { font-size: 2rem; font-weight: 700; margin: .6rem 0; }
.highest { border: 2px solid #205d40; background: #edf5ea; }
.badge { font-weight: 700; color: #205d40; }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.5rem 0; }
footer { border-top: 1px solid #cbd7cf; margin-top: 2rem; padding-top: 1rem; font-size: .85rem; }
.print-only { display: none; }
dialog { border: 0; border-radius: 1rem; padding: 2rem; max-width: 650px; width: calc(100% - 2rem); max-height: 90vh; overflow: auto; }
dialog::backdrop { background: #12251dcc; }
#qr-image { background: white; max-width: 430px; margin: 1rem auto; }
#qr-image svg { display: block; width: 100%; height: auto; }
#quiz-link { display: block; overflow-wrap: anywhere; }
@media (max-width: 700px) {
  main, .toolbar { padding: 1rem; }
  .options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .score-grid { grid-template-columns: 1fr; }
  .score-card h3 { overflow-wrap: normal; }
  fieldset { padding: 1rem .7rem; }
  dialog { padding: 1rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
@media print {
  @page { margin: 16mm; }
  :focus, :focus-visible { outline: none !important; }
  :root { color: black; background: white; font-size: 10pt; }
  body, main { margin: 0; padding: 0; max-width: none; }
  h1 { font-size: 24pt; }
  .toolbar, #quiz, .actions, .screen-only, dialog, #qr-dialog { display: none !important; }
  .print-only { display: block; }
  #results { display: none !important; }
  .print-complete #results { display: block !important; }
  .score-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5pt; }
  .score-card { padding: 6pt; background: white; border: 1px solid #555; break-inside: avoid; }
  .score-card h3 { font-size: 9pt; }
  .score-card .score { font-size: 17pt; }
  .score-card p { font-size: 9pt; }
  .report-answer { break-inside: avoid; border-bottom: 1px solid #ccc; padding: 5pt 0; }
  .report-answer p { margin: 3pt 0; }
  .report-answer p:last-child { font-weight: bold; }
  footer { break-inside: avoid; }
  footer a::after { content: " (" attr(href) ")"; overflow-wrap: anywhere; }
}
