:root { color-scheme: light; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #172033; background: #f4f6f9; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: #1558b0; }
.site-header { min-height: 64px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: #fff; border-bottom: 1px solid #dfe4ec; }
.brand { color: #172033; font-size: 1.15rem; font-weight: 750; text-decoration: none; }
.site-header nav, .actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.container { width: min(1180px, 92vw); margin: 32px auto; }
.card { background: #fff; border: 1px solid #dfe4ec; border-radius: 12px; padding: 24px; box-shadow: 0 3px 14px rgb(21 38 70 / 6%); }
.narrow { max-width: 600px; margin-inline: auto; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-grid strong { display: block; font-size: 2rem; }
.stat-grid span, .muted { color: #637087; }
form p { display: grid; gap: 6px; }
input, select, textarea { width: 100%; max-width: 640px; padding: 10px 12px; border: 1px solid #aeb8c8; border-radius: 7px; background: #fff; font: inherit; }
input[type="checkbox"] { width: auto; }
.button, button { display: inline-block; border: 1px solid #9ba8ba; border-radius: 7px; padding: 9px 14px; background: #fff; color: #172033; text-decoration: none; cursor: pointer; font: inherit; }
.button.primary { border-color: #1459b5; background: #1459b5; color: #fff; }
.button.danger { border-color: #a82132; background: #a82132; color: #fff; }
.inline { display: inline; }
.link-button { padding: 0; border: 0; color: #1558b0; background: none; }
.message { margin-bottom: 16px; padding: 12px 16px; border-radius: 8px; background: #e8f2ff; }
.message.error { background: #ffeaed; }
.filter-bar { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin: 20px 0; }
.filter-bar label { display: grid; gap: 4px; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid #dfe4ec; border-radius: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 13px; border-bottom: 1px solid #e5e9ef; text-align: left; vertical-align: top; }
th { background: #f8f9fb; white-space: nowrap; }
code { overflow-wrap: anywhere; }
.pagination { display: flex; gap: 16px; justify-content: center; margin: 20px; }
.errorlist { color: #a82132; }
.badge { display: inline-block; border-radius: 999px; padding: 3px 9px; background: #e9eef6; font-size: .86rem; }
.badge.success { background: #dff4e8; color: #17613a; }
.badge.warning { background: #fff1cf; color: #714d00; }
.pre-wrap { white-space: pre-wrap; }
.message.success { background: #dff4e8; color: #17613a; }
fieldset { margin: 22px 0; padding: 18px; border: 1px solid #dfe4ec; border-radius: 9px; }
legend { padding: 0 8px; font-weight: 700; }
.form-field { display: grid; gap: 6px; margin-bottom: 15px; }
.form-field > label { font-weight: 650; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 18px; }
.checklist-field .field-control > div, .checklist-field .field-control > ul { max-height: 280px; overflow: auto; padding: 10px 12px; border: 1px solid #dfe4ec; border-radius: 7px; background: #f8f9fb; }
.checklist-field label { display: flex; align-items: flex-start; gap: 8px; margin: 5px 0; font-weight: 400; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; margin: 18px 0; }
.detail-list { display: grid; grid-template-columns: minmax(100px, 150px) 1fr; gap: 10px 16px; }
.detail-list dt { color: #637087; }
.detail-list dd { margin: 0; }
.compact-list { display: flex; flex-wrap: wrap; gap: 8px; }
.card + .card { margin-top: 18px; }
.eyebrow { margin: 0 0 4px; color: #49617f; font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.exam-list { margin-top: 24px; }
.exam-list-item, .result-summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.exam-list-item h3, .result-summary h2 { margin-top: 0; }
.score-summary { display: grid; gap: 4px; color: #1459b5; line-height: 1.1; white-space: nowrap; }
.score-value, .score-inline { color: #1459b5; font-size: clamp(1.5rem, 4vw, 2.4rem); font-weight: 800; font-variant-numeric: tabular-nums; }
.score-maximum { color: #637087; font-size: .95rem; font-weight: 650; }
.empty-state { text-align: center; padding-block: 48px; }
.exam-shell { display: grid; gap: 18px; }
.exam-toolbar, .exam-footer { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.exam-toolbar h1 { margin: 0; }
.exam-status-box { display: flex; align-items: center; gap: 16px; }
.exam-status-box strong { min-width: 96px; font-size: 1.65rem; font-variant-numeric: tabular-nums; text-align: right; }
.exam-workspace { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 18px; align-items: start; }
.question-map { position: sticky; top: 18px; }
.question-map h2 { margin-top: 0; }
.question-map-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.question-map-grid button { aspect-ratio: 1; padding: 4px; }
.question-map-grid button.answered { border-color: #258354; background: #dff4e8; color: #17613a; }
.question-map-grid button.current { outline: 3px solid #2b6fca; outline-offset: 1px; }
.question-map-legend { display: flex; gap: 14px; margin-top: 16px; color: #637087; font-size: .85rem; }
.question-map-legend span { display: flex; align-items: center; gap: 5px; }
.question-map-legend i { width: 13px; height: 13px; border: 1px solid #9ba8ba; border-radius: 3px; }
.question-map-legend i.answered { border-color: #258354; background: #dff4e8; }
.question-stage { min-height: 420px; }
.question-meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 18px; color: #637087; }
.question-stage h2 { line-height: 1.55; }
.question-options { display: grid; gap: 11px; margin: 24px 0; }
.question-choice { display: grid; grid-template-columns: auto auto 1fr; align-items: start; gap: 10px; padding: 14px; border: 1px solid #d6dce6; border-radius: 9px; cursor: pointer; }
.question-choice:has(input:checked) { border-color: #2b6fca; background: #eef5ff; }
.question-choice input { margin-top: 4px; }
.question-actions { display: flex; justify-content: space-between; margin-top: 32px; }
.exam-footer { position: sticky; bottom: 10px; z-index: 2; box-shadow: 0 7px 28px rgb(21 38 70 / 16%); }
.exam-footer p { margin: 0; }
.exam-result { padding-block: 48px; text-align: center; }
.exam-result > .score-summary { margin: 18px auto 24px; justify-items: center; }
.exam-result > .score-summary .score-value { font-size: clamp(2.5rem, 8vw, 5rem); }
.exam-result > .score-summary .score-maximum { font-size: clamp(1rem, 3vw, 1.35rem); }
.review-list { display: grid; gap: 18px; margin: 24px 0; }
.review-question h2 { font-size: 1.15rem; }
.review-question li { margin: 6px 0; }
.badge.error { background: #ffeaed; color: #8e1726; }
.result-filter { align-items: end; }
.result-filter input, .result-filter select { min-width: 150px; }
.score-cell { color: #1459b5; font-weight: 750; white-space: nowrap; }
.result-question { padding: 18px 0; border-bottom: 1px solid #e5e9ef; }
.result-question:last-child { border-bottom: 0; }
@media (max-width: 700px) {
  body { -webkit-text-size-adjust: 100%; }
  .site-header, .page-heading, .exam-list-item, .result-summary, .exam-toolbar, .exam-footer { align-items: flex-start; flex-direction: column; padding-block: 14px; }
  .site-header { min-height: 0; padding-inline: 16px; gap: 10px; }
  .site-header nav { width: 100%; gap: 10px; }
  .container { width: calc(100% - 24px); margin: 12px auto 24px; }
  .card { padding: 16px; border-radius: 10px; }
  input, select, textarea { font-size: 16px; }
  .button, button { min-height: 44px; touch-action: manipulation; }
  .exam-list-item > .button,
  .exam-list-item > form,
  .exam-list-item > form .button,
  .result-summary > .button { width: 100%; }
  .exam-shell { gap: 12px; }
  .exam-toolbar { gap: 12px; }
  .exam-toolbar h1 { font-size: clamp(1.25rem, 6vw, 1.75rem); overflow-wrap: anywhere; }
  .exam-workspace { grid-template-columns: 1fr; }
  .question-map { position: static; max-height: 190px; overflow-y: auto; padding: 14px; }
  .question-map h2 { display: inline; margin-right: 8px; font-size: 1.1rem; }
  .question-map p { display: inline; }
  .question-map-grid { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); margin-top: 12px; }
  .question-map-grid button { min-width: 44px; min-height: 44px; }
  .question-map-legend { margin-top: 10px; }
  .question-stage { min-height: 0; padding: 16px; }
  .question-meta { flex-direction: column; gap: 4px; margin-bottom: 12px; }
  .question-stage h2 { font-size: 1.15rem; line-height: 1.5; }
  .question-options { gap: 12px; margin: 18px 0; }
  .question-choice { grid-template-columns: 24px auto 1fr; min-height: 54px; padding: 14px 12px; }
  .question-choice input { width: 22px; height: 22px; margin-top: 1px; }
  .question-actions { gap: 10px; margin-top: 24px; }
  .question-actions button { flex: 1; min-height: 48px; }
  .exam-status-box { width: 100%; justify-content: space-between; }
  .exam-footer { bottom: 0; gap: 10px; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .exam-footer .button { width: 100%; min-height: 48px; }
  .exam-footer p { font-size: .88rem; }
  .result-summary .score-summary { margin-block: 2px 6px; }
}
