:root {
  color-scheme: light;
  --bg: #f5f7fa; --surface: #fff; --surface-soft: #f5f7fb; --text: #172438; --muted: #59677b; --border: #dce2eb;
  --accent: #2f5bd3; --accent-hover: #2148b3; --accent-soft: #edf2ff;
  --success: #176544; --success-bg: #eff9f3; --danger: #ad303b; --danger-bg: #fff2f3; --warning: #855209; --warning-bg: #fff8e8;
  --reading-size: 18px; --radius: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", "맑은 고딕", sans-serif;
  font-size: 16px; line-height: 1.6;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121923; --surface: #1b2533; --surface-soft: #222e3f; --text: #edf2fa; --muted: #aab8cd; --border: #38465a;
  --accent: #a4bbff; --accent-hover: #c4d3ff; --accent-soft: #283b65;
  --success: #8ee0b1; --success-bg: #203d33; --danger: #ffadb6; --danger-bg: #422a34; --warning: #efca82; --warning-bg: #3e3424;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; max-width: 100%; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible, [tabindex="0"]:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
button, a { touch-action: manipulation; }
a { color: var(--accent); text-underline-offset: 3px; }
svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
img { max-width: 100%; height: auto; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--text); line-height: 1.4; overflow-wrap: anywhere; }
h1 { font-size: 1.6rem; margin-bottom: 0; letter-spacing: -.04em; }
h2 { font-size: 1.38rem; margin-bottom: .65rem; letter-spacing: -.035em; }
h3 { font-size: 1.05rem; margin-bottom: .65rem; }
p { margin-bottom: 1rem; }
strong { font-weight: 700; }
[hidden] { display: none !important; }
.skip-link { position: fixed; left: 12px; top: -70px; z-index: 30; padding: 12px 20px; background: var(--surface); border: 2px solid var(--accent); border-radius: 10px; }
.skip-link:focus { top: 12px; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { max-width: 1160px; min-height: 80px; margin: auto; padding: 12px 28px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.brand strong { font-size: 1.7rem; letter-spacing: -.07em; line-height: 1; }
.brand strong span { color: var(--accent); }
.brand > span { color: var(--muted); font-size: .875rem; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-item { min-height: 44px; border: 0; background: transparent; color: var(--muted); border-radius: 9px; padding: 10px 16px; font-size: .95rem; font-weight: 600; white-space: nowrap; }
.nav-item:hover { background: var(--surface-soft); color: var(--text); }
.nav-item.active { color: var(--accent); background: var(--accent-soft); }
.header-actions { display: flex; align-items: center; gap: 2px; }
.icon-button, .bookmark-button { width: 44px; height: 44px; padding: 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); flex: none; }
.icon-button:hover, .bookmark-button:hover { background: var(--surface-soft); color: var(--text); }
.bookmark-button { font-size: 1.5rem; line-height: 1; }
.bookmark-button.active, .bookmark-star { color: var(--warning); }
.main { width: min(100% - 48px, 1000px); margin: 0 auto; padding: 30px 0 20px; }
.page-heading { margin-bottom: 22px; }
.eyebrow { color: var(--muted); font-size: .875rem; font-weight: 600; margin: 0 0 7px; }
.eyebrow:empty { display: none; }
.app-content { min-width: 0; }
.app-content:focus { outline: none; }
.app-content > * + * { margin-top: 20px; }
.main-footer { margin-top: 38px; padding: 20px 0; border-top: 1px solid var(--border); color: var(--muted); text-align: center; font-size: .8125rem; }
.panel, .question-card, .result-panel, .exam-map, .library-detail { padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.muted { color: var(--muted); }
.small, small { font-size: .875rem; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.full-width { width: 100%; }
.button { min-height: 44px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 10px 18px; border: 1px solid transparent; border-radius: 10px; font-size: 1rem; font-weight: 600; line-height: 1.45; text-decoration: none; overflow-wrap: anywhere; }
.button.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
[data-theme="dark"] .button.primary { color: #12234b; }
.button.secondary { color: var(--text); background: var(--surface); border-color: var(--border); }
.button.secondary:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.button.ghost { color: var(--muted); background: transparent; }
.button.ghost:hover:not(:disabled) { color: var(--accent); background: var(--accent-soft); }
.button.danger { color: var(--danger); background: var(--danger-bg); border-color: var(--danger); }
.button:disabled { opacity: .45; }
.button.small { font-size: .875rem; padding: 9px 12px; }
.button.large { min-height: 52px; padding: 13px 28px; }
.inline-icon { font-size: 1.15em; }
.study-home { max-width: 760px; margin-left: auto; margin-right: auto; padding: 32px; }
.study-summary { padding: 0; }
.study-summary h2 { font-size: 1.55rem; }
.study-start-actions { margin-top: 4px; }
.study-start-actions + p { margin: 14px 0 0; }
.count-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 26px 0; padding: 24px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.count-item { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; color: var(--muted); }
.count-item + .count-item { padding-left: 24px; border-left: 1px solid var(--border); }
.count-item strong { font-size: 2.1rem; color: var(--text); line-height: 1.3; letter-spacing: -.04em; }
.count-item small { color: var(--muted); font-weight: 400; }
.study-finish { max-width: 760px; margin-inline: auto; padding: 34px; }
.study-finish > .row { margin-top: 24px; }
.session-header, .session-nav, .session-footer, .setup-footer, .section-heading, .exam-question-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.session-header h2, .section-heading h2 { margin-bottom: 0; }
.session-header { margin-bottom: 18px; }
.session-nav, .session-footer { margin: 18px 0 0; }
.session-progress { display: flex; align-items: center; gap: 14px; margin: 16px 0; font-variant-numeric: tabular-nums; }
.progress, .progress-track { display: block; height: 6px; overflow: hidden; background: var(--border); border-radius: 10px; flex: 1; min-width: 40px; }
.progress-bar, .progress-track > span, .progress-track > div { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.question-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 24px; }
.question-meta .row { gap: 8px; }
.question-id { color: var(--muted); font-size: .875rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pill, .chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-soft); color: var(--muted); font-size: .8125rem; font-weight: 500; }
.chip { min-height: 44px; }
.pill.warning, .correction-chip { color: var(--warning); background: var(--warning-bg); border-color: transparent; }
.prompt { font-size: var(--reading-size); font-weight: 650; line-height: 1.85; letter-spacing: -.02em; white-space: pre-wrap; overflow-wrap: anywhere; word-break: keep-all; margin: 0 0 24px; }
.choices { display: grid; gap: 10px; }
.option { width: 100%; display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px; text-align: left; border: 1px solid var(--border); border-radius: 11px; color: var(--text); background: var(--surface); font-size: var(--reading-size); line-height: 1.75; }
.option:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.option.selected { border-color: var(--accent); background: var(--accent-soft); }
.option.correct { border-color: var(--success); background: var(--success-bg); }
.option.incorrect { border-color: var(--danger); background: var(--danger-bg); }
.option:disabled { opacity: 1; }
.option-number { color: var(--muted); flex: none; }
.option-text { flex: 1; white-space: pre-wrap; overflow-wrap: anywhere; word-break: keep-all; }
.option-state { align-self: center; color: var(--success); font-size: .8125rem; white-space: nowrap; }
.option.incorrect .option-state { color: var(--danger); }
.question-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
.feedback, .recall-status { padding: 14px 16px; border-radius: 10px; background: var(--surface-soft); margin: 22px 0; font-weight: 600; }
.feedback span { font-size: .875rem; font-weight: 400; }
.feedback.success, .recall-status.success { color: var(--success); background: var(--success-bg); }
.feedback.error, .recall-status.error { color: var(--danger); background: var(--danger-bg); }
.answer-panel { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); min-width: 0; }
.answer-panel .eyebrow { color: var(--accent); margin-bottom: 12px; }
.answer-key { color: var(--success); font-weight: 700; font-size: 1.2rem; }
.source-text, .answer-text { white-space: pre-wrap; overflow-wrap: anywhere; word-break: keep-all; font-size: var(--reading-size); line-height: 1.9; }
.source-text + .source-text { margin-top: 18px; }
.divider { border-top: 1px solid var(--border); margin: 24px 0; }
.correction-note { padding: 18px; border-radius: 10px; margin-top: 24px; background: var(--warning-bg); color: var(--warning); font-size: .9375rem; }
.correction-note p { margin: 10px 0; }
.self-assessment { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.rating-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.rating-actions .button { flex: 1 1 150px; min-height: 50px; }
.rating-actions .button small { display: block; font-weight: 400; }
.undo-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; color: var(--muted); border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: .875rem; }
.undo-bar .button { margin-left: auto; }
.comparison, .my-answer { padding: 18px; border-radius: 11px; background: var(--surface-soft); margin: 20px 0; min-width: 0; }
.comparison > :last-child, .my-answer > :last-child { margin-bottom: 0; }
.field { display: flex; flex-direction: column; gap: 8px; color: var(--text); font-size: .9375rem; font-weight: 600; min-width: 0; }
.field span .small { font-weight: 400; }
input, select, textarea, .field-value { width: 100%; min-height: 46px; border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; color: var(--text); background: var(--surface); font-weight: 400; }
select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='m1 1 5 5 5-5' stroke='%23727d90' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
textarea { resize: vertical; font-size: var(--reading-size); line-height: 1.8; min-height: 170px; }
textarea:disabled { color: var(--text); opacity: 1; background: var(--surface-soft); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.answer-field > span { display: flex; gap: 8px 12px; align-items: baseline; flex-wrap: wrap; }
.save-hint { margin: 7px 0 0; font-size: .8125rem; }
.field-value { background: var(--surface-soft); color: var(--muted); }
.filters, .library-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 24px 0; }
.search-field { grid-column: 1 / -1; }
.library-toolbar { padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0; }
.library-toolbar .field:has(input[type="search"]) { grid-column: 1 / -1; }
.library-list { display: grid; gap: 10px; }
.library-item { padding: 19px 22px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); min-width: 0; }
.library-item .question-meta { margin-bottom: 10px; }
.library-item h3 { font-size: 1rem; font-weight: 500; line-height: 1.7; white-space: pre-wrap; }
.library-item .row:last-child { justify-content: space-between; }
.library-item > button { max-width: 100%; }
.library-item:is(button) { width: 100%; text-align: left; color: var(--text); }
.library-item:is(button):hover { border-color: var(--accent); }
.library-item > span:last-child { display: block; margin-top: 9px; line-height: 1.75; overflow-wrap: anywhere; word-break: keep-all; white-space: pre-wrap; }
.library-detail { margin-top: 18px; }
.exam-rules, .info-line, .footnote { color: var(--muted); font-size: .875rem; line-height: 1.7; }
.exam-rules { padding: 18px 20px; background: var(--surface-soft); border-radius: 10px; margin: 22px 0; }
.exam-rules p { margin: 4px 0; }
.footnote { margin: 16px 0; }
.setup-footer { padding-top: 20px; border-top: 1px solid var(--border); margin-top: 24px; }
.form-error { color: var(--danger); font-size: .9375rem; }
.form-error:empty { display: none; }
.exam-layout { display: grid; grid-template-columns: minmax(0, 1fr) 238px; gap: 20px; align-items: start; }
.exam-content { min-width: 0; }
.exam-map { padding: 20px; position: sticky; top: 20px; }
.exam-map-heading { margin-bottom: 16px; }
.exam-map-heading h3 { margin-bottom: 3px; }
.question-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.question-number { min-width: 0; min-height: 44px; padding: 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--muted); position: relative; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.question-number.answered { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-soft); }
.question-number.wrong { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-bg); }
.question-number.current { border: 2px solid var(--accent); font-weight: 700; }
.question-number.flagged::after { content: ''; position: absolute; right: 4px; top: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--warning); }
.map-legend { display: flex; flex-wrap: wrap; gap: 8px 13px; color: var(--muted); font-size: .8125rem; margin: 16px 0 22px; }
.map-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 3px; }
.legend-dot.answered { background: var(--accent); }
.legend-dot.flagged { background: var(--warning); border-radius: 50%; }
.legend-dot.wrong { background: var(--danger); }
.exam-map > p { margin: 12px 0 0; }
.exam-question-heading { margin-bottom: 16px; }
.timer-box { display: flex; align-items: center; gap: 10px; background: var(--surface); padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px; }
#timer { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
#timer.urgent { color: var(--danger); }
.result-stats, .result-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 22px 0; }
.result-stats > div { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.result-stats strong { font-size: 2rem; line-height: 1.3; }
.result-stats strong small { font-size: 1rem; color: var(--muted); font-weight: 400; }
.history-list { margin-top: 18px; }
.history-row { width: 100%; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; border: 0; border-top: 1px solid var(--border); padding: 18px 0; background: transparent; color: var(--text); text-align: left; font-size: .9375rem; }
.history-row:hover { color: var(--accent); }
.history-row:last-child { padding-bottom: 0; }
.table-scroll { overflow: auto; max-width: 100%; border: 1px solid var(--border); border-radius: 10px; margin: 12px 0 20px; overscroll-behavior-x: contain; }
table { border-collapse: collapse; width: 100%; min-width: 600px; font-size: var(--reading-size); line-height: 1.75; text-align: left; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); white-space: pre-wrap; overflow-wrap: anywhere; vertical-align: top; }
th { font-weight: 600; background: var(--surface-soft); }
th:last-child, td:last-child { border-right: 0; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
.table-hint { margin: 15px 0 0; font-size: .8125rem; }
.modal { width: min(860px, calc(100% - 40px)); max-height: calc(100dvh - 48px); border: 1px solid var(--border); padding: 34px; border-radius: 18px; background: var(--surface); color: var(--text); overflow: auto; box-shadow: 0 24px 80px #0003; }
.modal::backdrop { background: #0e172b80; }
.modal-close { position: sticky; top: -18px; float: right; margin: -18px -18px 0 10px; background: var(--surface); z-index: 2; }
#modal-body { min-width: 0; }
#modal-body > h2:first-child, .modal-heading { padding-right: 30px; }
.modal-heading p { margin-bottom: 24px; }
.settings-grid { display: grid; gap: 26px; margin-top: 26px; }
.settings-grid > section + section { padding-top: 24px; border-top: 1px solid var(--border); }
.settings-grid .field { max-width: 240px; margin-bottom: 12px; }
.file-button { position: relative; overflow: hidden; cursor: pointer; }
.file-button:focus-within { outline: 3px solid var(--accent); outline-offset: 3px; }
.file-button input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.source-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.source-page { margin: 22px 0 0; }
.source-page figcaption { color: var(--muted); font-size: .875rem; margin-bottom: 10px; }
.source-page img { display: block; width: 100%; border: 1px solid var(--border); border-radius: 8px; }
.correction-list { display: grid; gap: 14px; margin: 24px 0; }
.correction-list .panel { padding: 20px; }
.correction-list .panel p:last-child { margin-bottom: 0; }
.empty-state, .loading-state { padding: 36px 24px; text-align: center; color: var(--muted); }
.empty-state h2, .empty-state h3 { margin-top: 0; }
.empty-state .button { margin-top: 8px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 15px); opacity: 0; z-index: 50; width: max-content; max-width: calc(100% - 32px); background: var(--text); color: var(--surface); padding: 13px 20px; border-radius: 12px; font-size: .9375rem; box-shadow: 0 5px 25px #0002; pointer-events: none; transition: opacity .15s, transform .15s; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.storage-alert, .noscript { padding: 16px 20px; border: 1px solid var(--warning); border-radius: 12px; background: var(--warning-bg); color: var(--warning); margin-bottom: 20px; font-size: .9375rem; }
.noscript { position: fixed; bottom: 0; left: 16px; right: 16px; z-index: 30; }
details { margin-top: 20px; }
summary { cursor: pointer; min-height: 44px; padding: 10px 0; color: var(--muted); font-size: .9375rem; }
@media (min-width: 1100px) {
  .question-card:not(.exam-content > .question-card), .session-header, .session-progress, .progress-track, .session-footer, .session-nav, .undo-bar { max-width: 860px; margin-left: auto; margin-right: auto; }
  .exam-layout .session-footer { max-width: none; }
}
@media (max-width: 900px) {
  .brand > span { display: none; }
  .header-inner { gap: 20px; }
  .exam-layout { grid-template-columns: minmax(0, 1fr); }
  .exam-map { position: static; }
  .question-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); }
  .exam-map-heading { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
  .exam-map .full-width { width: auto; min-width: 160px; }
  .exam-map > p { display: inline-block; margin-left: 12px; }
}
@media (max-width: 600px) {
  .header-inner { padding: 13px 16px 0; gap: 8px; flex-wrap: wrap; }
  .brand { flex: 1; }
  .brand strong { font-size: 1.5rem; }
  .brand > span { display: inline; font-size: .8125rem; }
  .header-actions { margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; margin: 5px -4px 0; padding-bottom: 9px; gap: 4px; }
  .nav-item { flex: 1; min-width: 0; padding: 10px 8px; font-size: .9375rem; }
  .main { width: calc(100% - 28px); padding-top: 22px; }
  .page-heading { margin-bottom: 18px; }
  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.22rem; }
  .panel, .question-card, .result-panel, .library-detail { padding: 21px 18px; border-radius: 13px; }
  .study-home { padding: 25px 22px; }
  .study-summary h2 { font-size: 1.4rem; }
  .study-start-actions .button { width: 100%; }
  .count-grid { gap: 18px; margin: 22px 0; padding: 20px 0; }
  .count-item + .count-item { padding-left: 18px; }
  .count-item strong { font-size: 1.8rem; }
  .study-finish { padding: 28px 22px; }
  .question-meta { margin-bottom: 20px; gap: 8px; }
  .question-meta > .row:last-child { margin-left: auto; }
  .question-meta .button.small { padding-inline: 8px; }
  .question-meta .row { gap: 6px; }
  .question-meta .pill { padding: 3px 7px; }
  .question-meta .small { font-size: .8125rem; }
  .prompt { line-height: 1.8; margin-bottom: 20px; }
  .option { padding: 14px 12px; gap: 9px; flex-wrap: wrap; }
  .option-text { flex-basis: calc(100% - 35px); }
  .option-state { margin-left: 30px; }
  .rating-actions { gap: 8px; }
  .rating-actions .button { flex-basis: 100%; }
  .answer-panel { margin-top: 22px; padding-top: 22px; }
  .answer-field > span { gap: 3px; }
  .answer-field > span .small { flex-basis: 100%; }
  .source-text, .answer-text { line-height: 1.85; }
  .comparison, .my-answer, .correction-note { padding: 15px; }
  .session-header { gap: 10px; }
  .session-header .button { font-size: .875rem; }
  .session-progress { flex-wrap: wrap; gap: 10px; }
  .session-progress > .small { font-size: .8125rem; }
  .session-footer, .session-nav { gap: 8px; }
  .session-footer > .button, .session-nav > .button { padding-inline: 13px; font-size: .9375rem; }
  .session-footer > .small { font-size: .8125rem; }
  .filters, .library-toolbar { gap: 14px; }
  .library-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 18px; }
  .library-toolbar .field:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .library-item { padding: 17px; }
  .setup-footer > .row { width: 100%; }
  .setup-footer > .row .button { flex: 1; }
  .exam-rules { padding: 15px; }
  .exam-map { padding: 18px; }
  .question-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  .exam-map > p { display: block; margin-left: 0; }
  .exam-map .full-width { width: 100%; }
  .result-stats { gap: 15px; }
  .result-stats strong { font-size: 1.8rem; }
  .result-stats > div > span:first-child { font-size: .875rem; }
  .history-row { align-items: flex-start; flex-direction: column; gap: 4px; }
  .modal { width: calc(100% - 20px); max-height: calc(100dvh - 24px); padding: 25px 20px; border-radius: 14px; }
  .modal-close { margin: -12px -10px 0 8px; top: -15px; }
  .source-toolbar .button { flex: 1; font-size: .875rem; padding-inline: 10px; }
  .table-scroll { border-radius: 7px; }
  th, td { padding: 11px 13px; }
  .toast { bottom: 16px; }
  .main-footer { margin-top: 26px; text-align: left; }
}
@media (max-width: 360px) {
  .brand > span { display: none; }
  .main { width: calc(100% - 24px); }
  .panel, .question-card, .result-panel, .library-detail { padding: 18px 14px; }
  .filters { grid-template-columns: minmax(0, 1fr); }
  .session-footer > .small { flex-basis: 100%; text-align: center; order: 2; }
  .question-meta > .row { flex-basis: 100%; }
  .question-meta > .row:last-child { justify-content: flex-end; }
  .question-grid { gap: 6px; }
  .exam-map { padding: 14px; }
  .rating-actions .button { font-size: .9375rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media print {
  .site-header, .main-footer, .question-actions, .rating-actions, .session-footer, .session-nav, .toast, .bookmark-button { display: none !important; }
  body { background: #fff; color: #000; }
  .main { width: 100%; padding: 0; }
  .question-card, .panel, .answer-panel { border-color: #ddd; box-shadow: none; }
  .table-scroll { overflow: visible; }
  table { min-width: 0; }
}
