.setup-wrap { width: min(900px, 100%); margin-inline: auto; }
.setup { padding: clamp(16px, 3vw, 27px); border: 1px solid #d4e2e9; border-radius: 16px; background: linear-gradient(150deg, #fff, #f8fcfd); box-shadow: 0 9px 26px #17324a11; }
.setup h2 { margin: 0; font-size: 1.18rem; color: var(--navy); }
.quiet { color: var(--muted); font-size: .9rem; }
.section-head, .setup-footer, .resume { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; margin-top: 19px; }
.form-grid label { display: grid; align-content: start; gap: 6px; font-weight: 700; }
.form-grid select, .form-grid input { width: 100%; min-height: 44px; padding: 7px 11px; color: var(--ink); background: #fff; border: 1px solid #cbdde6; border-radius: 9px; font: inherit; font-weight: 500; }
.disciplines { min-width: 0; grid-column: 1 / -1; margin: 0; padding: 0; border: 0; }
.disciplines legend { padding: 0 0 7px; font-weight: 700; }
.chips, .result-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { padding: 7px 11px; min-height: 36px; color: var(--navy); background: #fff; border: 1px solid #bdd6e2; border-radius: 999px; font-size: .88rem; }
.chip[aria-pressed="true"] { background: var(--blue-soft); border-color: var(--blue); color: var(--navy); font-weight: 750; }
.setup-footer { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.resume { padding: 13px 17px; margin-bottom: 15px; border: 1px solid #c9e1ec; border-radius: 12px; background: #eef8fc; }
.resume div { display: grid; gap: 4px; }
.resume span { color: var(--muted); font-size: .86rem; }
#loadStatus { margin: 18px; }
.session-timer { color: var(--navy); font-weight: 850; font-variant-numeric: tabular-nums; background: var(--blue-soft); padding: 7px 10px; border-radius: 8px; }
.session-timer[data-urgent="true"] { color: var(--red); background: var(--red-soft); }
.source-images { margin-bottom: 22px; }
.question-stem p { margin: 0 0 12px; white-space: pre-line; }
.question-stem p:last-child { margin-bottom: 0; }
.prompt-table-wrap { margin: 14px 0; overflow-x: auto; }
.prompt-table { width: min(720px, 100%); border-collapse: collapse; font-size: .88em; line-height: 1.45; background: #fff; text-align: left; }
.prompt-table th, .prompt-table td { padding: 7px 10px; border: 1px solid var(--line); vertical-align: top; }
.prompt-table thead th, .prompt-table-group th { color: var(--navy); background: var(--rail); }
.prompt-table tbody th { font-weight: 650; }
.study-report-link { display: inline-block; margin-top: 12px; }
.study-report { margin-top: 24px; scroll-margin-top: 16px; }
.study-report h3 { margin: 22px 0 8px; color: var(--navy); font-size: 1.05rem; }
.study-report p { margin: 12px 0; line-height: 1.55; }
.study-report-table { width: 100%; font-size: .9375rem; }
.study-report-table th, .study-report-table td { padding: 10px 12px; }
.study-report-ranges { min-width: 32rem; }
.study-report-ranges td { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.study-report-ranges thead th:not(:first-child) { text-align: right; }
.study-report-priority { color: var(--navy); background: var(--blue-soft); font-weight: 750; }
.source-images .question-figure { width: fit-content; max-width: 100%; }
.source-images .question-figure img { width: auto; max-width: 100%; }
.figure-open { display: block; width: 100%; padding: 0; border: 0; background: white; cursor: zoom-in; }
.figure-open:focus-visible { outline: 3px solid var(--blue); outline-offset: -4px; }
.rail select { width: calc(100% - 16px); }
#reviewImages .slide-figure { margin-bottom: 13px; }
.link-button { color: var(--blue); background: none; border: 0; padding: 0; cursor: pointer; text-underline-offset: 3px; text-decoration: underline; font-weight: 750; }
.result-stats { margin-block: 16px; }
.result-actions { margin-top: 18px; }
dialog { max-width: min(1100px, 96vw); max-height: 95vh; border: 1px solid var(--line); border-radius: 13px; padding: 12px; }
dialog::backdrop { background: #102638b8; }
dialog form { display: flex; justify-content: flex-end; margin-bottom: 8px; position: sticky; top: 0; }
#zoomImage { display: block; width: min(1010px, calc(96vw - 32px)); height: auto; }
.controls-panel { max-height: calc(100dvh - 100px); overflow-y: auto; }
@media (max-width: 620px) {
  .form-grid { grid-template-columns: 1fr; }
  .setup-footer { align-items: stretch; flex-direction: column; }
  .question-toolbar { align-items: center; gap: 8px; }
  .flag-button { padding: 8px 10px; font-size: .79rem; flex: 0 0 auto; }
  .session-timer { padding: 4px 6px; font-size: .85rem; }
  .question-figure img { max-height: max(430px, 54dvh); }
  .source-images .question-figure { margin-bottom: 17px; }
}
@media (max-width: 365px) {
  .brand-mark { width: 30px; height: 30px; }
  .top-action { padding-inline: 6px; }
}
