#exam-builder { max-width: 1150px; margin-inline: auto; }
#exam-builder [hidden] { display: none !important; }
.exam-panel { margin-block: 1.5rem; padding: clamp(1rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: 1rem; background: var(--paper); }
.exam-panel h2 { font-size: 1.6rem; margin: 0 0 1rem; }
.exam-fields { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; }
.exam-fields label { display: grid; gap: .35rem; flex: 1 1 11rem; }
.exam-fields input, .exam-fields select { width: 100%; min-width: 0; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--bg); color: var(--ink); }
#exam-builder button:disabled { opacity: .55; cursor: wait; }
#exam-question-list { display: grid; gap: .55rem; margin-top: 1rem; max-height: 24rem; overflow: auto; }
.exam-choice-row { display: flex; gap: .65rem; align-items: baseline; }
.exam-choice-row input { flex: 0 0 auto; }
.exam-preview-actions { margin: 1rem 0; }
#exam-output { max-width: 820px; background: white; color: #111; padding: clamp(.55rem, 3vw, 2rem); border: 1px solid #d8d8d8; }
#exam-output h2 { font-size: 1.8rem; overflow-wrap: anywhere; }
.exam-question { margin: 1.25rem 0; }
.exam-question h3 { font-size: 1rem; margin: 0 0 .5rem; }
.exam-question canvas { display: block; width: 100%; height: auto; }
#exam-coverage-details summary { cursor: pointer; color: var(--accent); }
.exam-coverage-table { margin-top: .75rem; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.exam-coverage-table th, .exam-coverage-table td { padding: .35rem clamp(.4rem, 2vw, 1rem); border-bottom: 1px solid var(--line); text-align: center; }
@media print {
  @page { size: A4; margin: 13mm; }
  body { background: white !important; }
  body > header, body > footer, .skip, .progress, #exam-builder > :not(#exam-preview), .exam-preview-actions { display: none !important; }
  #exam-builder, #exam-output { max-width: none; padding: 0; margin: 0; border: 0; }
  .exam-question + .exam-question { break-before: page; }
  .exam-question h3 { break-after: avoid; }
  .exam-mcq .exam-question { break-before: auto; break-inside: avoid; }
  .exam-question canvas { break-inside: avoid; max-height: 238mm; object-fit: contain; object-position: left top; }
}
