:root {
  --desk: #eceae4;          /* 책상(배경) */
  --paper: #fdfdfb;         /* 시험지 */
  --ink: #1c1c1c;           /* 본문 잉크 */
  --ink-soft: #55554f;
  --line: #b9b7ae;          /* 괘선 */
  --line-dark: #3a3a35;     /* 표 테두리 */
  --navy: #1a3a6b;          /* 관공서 남색 */
  --navy-soft: #e9eef7;
  --red: #c0392b;           /* 채점 빨강 */
  --red-soft: #faeae8;
  --green: #1e7a45;
  --green-soft: #e8f4ec;
  --warn: #b45309;
  --stamp-ink: #3b2e8c;     /* 선생님 도장 남보라 잉크 */
  --serif: "Noto Serif KR", "Apple SD Gothic Neo", serif;
  --sans: "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--desk);
  background-image: repeating-linear-gradient(0deg, transparent 0 34px, rgba(0,0,0,0.012) 34px 35px);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

#app { max-width: 760px; margin: 0 auto; padding: 14px 12px 56px; }
.screen.hidden, .hidden { display: none !important; }

/* ── 시험지 낱장 ── */
.paper {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px double var(--line-dark);
  box-shadow: 0 1px 4px rgba(40, 36, 20, 0.12);
  padding: 22px 20px;
  margin-bottom: 16px;
  position: relative;
}

/* ── 표지 ── */
.cover { padding-top: 30px; text-align: center; }
.cover-super { margin: 0; font-size: 0.82rem; letter-spacing: 0.12em; color: var(--ink-soft); font-weight: 600; }
.cover-rule { width: 60px; border-bottom: 2px solid var(--line-dark); margin: 12px auto; }
.cover-code { font-size: 0.72rem; color: var(--ink-soft); margin: 0 0 18px; font-family: var(--sans); }
.cover-title { font-size: 2rem; font-weight: 900; letter-spacing: 0.06em; line-height: 1.35; margin: 0 0 22px; }

.stamp {
  position: absolute; top: 14px; right: 12px;
  width: 66px; height: 66px; border-radius: 50%;
  border: 3px double var(--red); color: var(--red);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 0.95rem; line-height: 1.15; letter-spacing: 0.1em;
  transform: rotate(11deg); opacity: 0.82;
  pointer-events: none;
}

.cover-info {
  width: 100%; border-collapse: collapse; margin: 0 0 18px;
  font-size: 0.88rem; font-family: var(--sans);
}
.cover-info th, .cover-info td { border: 1px solid var(--line-dark); padding: 8px 4px; }
.cover-info th { background: #f1efe8; font-weight: 700; width: 21%; white-space: nowrap; font-size: 0.8rem; }
.cover-info td { width: 29%; }

.cover-notice { text-align: left; border: 1px solid var(--line-dark); padding: 12px 14px 10px; margin-bottom: 22px; }
.notice-title { margin: 0 0 6px; font-weight: 700; text-align: center; letter-spacing: 0.15em; }
.cover-notice ol { margin: 0; padding-left: 20px; font-size: 0.86rem; }
.cover-notice li { margin-bottom: 3px; }
.cover-notice b { color: var(--red); }

/* 표지 도장은 흐름 안에 두어 아래 출처 표기와 겹치지 않게 한다 */
.cover .stamp { position: static; margin: 16px 6px 0 auto; }

/* 출처 표기 — 학습모듈 저작권자(교육부) 명시 + 비공식 자료 고지 */
.source-note {
  margin: 24px 0 0; padding-top: 12px; border-top: 1px solid var(--line);
  font-family: var(--sans); font-size: 0.71rem; line-height: 1.7;
  color: var(--ink-soft); text-align: left; word-break: keep-all;
}
.source-note b { color: var(--ink); font-weight: 700; }

.name-row {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 0 auto 20px; max-width: 340px;
}
.name-row label { font-weight: 700; letter-spacing: 0.3em; white-space: nowrap; }
.name-row input {
  flex: 1; min-width: 0; font: inherit; font-size: 1.05rem; text-align: center;
  border: none; border-bottom: 2px solid var(--line-dark); background: transparent;
  padding: 6px 4px; color: var(--ink); border-radius: 0;
}
.name-row input:focus { outline: none; border-bottom-color: var(--navy); }
.name-in { color: var(--ink-soft); font-size: 0.9rem; white-space: nowrap; }

/* ── 버튼 ── */
button { font-family: var(--sans); cursor: pointer; }
.btn-exam {
  background: var(--navy); color: #fff; font-weight: 700; font-size: 1.02rem;
  border: 1px solid var(--navy); border-radius: 4px; padding: 13px 34px;
}
.btn-exam:active { transform: translateY(1px); }
.btn-line {
  background: var(--paper); color: var(--ink); font-weight: 600;
  border: 1px solid var(--line-dark); border-radius: 4px; padding: 12px 18px;
}
.btn-exam.big, .btn-line.big { width: 100%; padding: 15px; }
.btn-exam.alt { background: var(--stamp-ink); border-color: var(--stamp-ink); }
button:disabled { opacity: 0.35; cursor: default; }

/* 시작 버튼 두 종 (전체 시험 / 주관식만) */
.start-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.start-row .btn-exam { flex: 1 1 0; min-width: 130px; padding: 14px 10px; }
.start-hint {
  margin: 12px 0 0; font-family: var(--sans); font-size: 0.76rem;
  line-height: 1.75; color: var(--ink-soft); text-align: center;
}
.start-hint b { color: var(--ink); font-weight: 700; }

.btn-line.study {
  width: 100%; margin-top: 10px; padding: 13px;
  border-style: dashed; color: var(--stamp-ink); font-weight: 700;
}

/* ── 학습 모드 ── */
.study-topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; gap: 6px; align-items: center;
  background: var(--desk); padding: 10px 2px;
  border-bottom: 2px solid var(--line-dark);
}
.study-select {
  flex: 1 1 0; min-width: 0;
  font-family: var(--sans); font-size: 0.8rem; font-weight: 600;
  border: 1px solid var(--line-dark); border-radius: 4px;
  background: var(--paper); color: var(--ink); padding: 9px 6px;
}
.study-topbar .btn-line { padding: 9px 12px; font-size: 0.82rem; white-space: nowrap; }
.study-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin: 10px 2px 8px; font-family: var(--sans);
}
.study-progress { font-weight: 700; color: var(--ink-soft); font-size: 0.9rem; }
.study-actions { display: flex; gap: 10px; margin-top: 14px; }
.study-actions button { flex: 1; padding: 13px; font-size: 0.95rem; }

.study-stats { font-family: var(--sans); font-size: 0.82rem; font-weight: 700; margin-left: 10px; }
.study-stats .ok { color: var(--green); }
.study-stats .no { color: var(--red); }

.choice.static { cursor: default; }
.choice.static:hover { background: transparent; }
.choice.is-answer { border-color: var(--green); background: var(--green-soft); }
.choice.is-wrong { border-color: var(--red); background: var(--red-soft); }
.choice .ans-mark {
  margin-left: auto; font-family: var(--sans); font-size: 0.72rem;
  font-weight: 800; white-space: nowrap; align-self: center;
}
.choice .ans-mark.ok { color: var(--green); }
.choice .ans-mark.no { color: var(--red); }

.study-verdict {
  font-family: var(--sans); font-weight: 800; font-size: 1rem;
  border-radius: 4px; padding: 9px 12px; margin: 0 0 12px;
}
.study-verdict.ok { background: var(--green-soft); color: var(--green); }
.study-verdict.no { background: var(--red-soft); color: var(--red); }
.study-answer { font-size: 1rem; margin-top: 8px; color: var(--green); }
.study-answer b { color: var(--ink); }

/* ── 표지 양옆 배너 ──
 * 기본은 없는 셈 친다. 시험지(760px)와 배너 두 장(160px)이 서로 밀지 않을 만큼
 * 넓은 화면에서만 나타난다. 배경 이미지를 그 미디어 규칙 안에서만 지정해,
 * 좁은 화면에서는 파일을 내려받지도 않게 했다.
 */
#ads { display: none; }

@media (min-width: 1240px) and (min-height: 700px) {
  body.on-home #ads { display: block; }

  .ad {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    height: 600px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(40, 36, 20, 0.18);
    background-repeat: no-repeat;
    background-size: 160px 600px;
    opacity: 0.94;
    transition: opacity 0.15s, transform 0.15s;
  }
  .ad:hover { opacity: 1; transform: translateY(-50%) scale(1.015); }

  /* 시험지 가장자리에서 20px 떨어뜨린다. 화면이 더 넓어져도 시험지에 붙어 따라온다. */
  .ad-left  { right: calc(50% + 380px + 20px); background-image: url("assets/banner-charm.webp"); }
  .ad-right { left:  calc(50% + 380px + 20px); background-image: url("assets/banner-micky.webp"); }
}

/* 아주 넓은 화면에서는 시험지에서 조금 더 떼어 놓는다 */
@media (min-width: 1500px) and (min-height: 700px) {
  .ad-left  { right: calc(50% + 380px + 56px); }
  .ad-right { left:  calc(50% + 380px + 56px); }
}

/* ── 연결형: 좌우를 눌러 선으로 잇는다 ── */
.mc-hint {
  margin: 0 0 10px; font-family: var(--sans); font-size: 0.75rem;
  color: var(--ink-soft); line-height: 1.55; word-break: keep-all;
}

.match-connect {
  position: relative;
  display: grid; grid-template-columns: 1fr 46px 1fr;
  align-items: stretch;
}
.mc-wires { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.mc-wires line { stroke-width: 2.5; stroke-linecap: round; }
.mc-wires .w-mine { stroke: var(--navy); }
.mc-wires .w-ok   { stroke: var(--green); }
.mc-wires .w-no   { stroke: var(--red); }
.mc-wires .w-want { stroke: var(--green); stroke-dasharray: 5 5; stroke-width: 2; opacity: 0.75; }

/* 두 칸의 줄 높이를 맞춰야 점이 나란히 선다 */
.mc-col { display: grid; grid-auto-rows: 1fr; gap: 8px; }

.mc-item {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 4px;
  background: #fcfbf7; padding: 9px 10px;
  font: inherit; text-align: left; color: var(--ink);
  min-height: 46px;                 /* 손가락으로 누를 만한 크기 */
}
.mc-item .mc-label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; }
.mc-mark { font-weight: 800; color: var(--navy); flex: none; }
.mc-r .mc-mark { color: var(--stamp-ink); }
.mc-text { font-size: 0.87rem; line-height: 1.45; word-break: keep-all; }

/* 선이 닿는 점 */
.mc-dot {
  flex: none; width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--line-dark); background: var(--paper);
}
.mc-item.is-linked { border-color: var(--navy); background: var(--navy-soft); }
.mc-item.is-linked .mc-dot { background: var(--navy); border-color: var(--navy); }
.mc-item.is-armed {
  border-color: var(--stamp-ink); background: #efecfb;
  box-shadow: 0 0 0 2px rgba(59, 46, 140, 0.18);
}
.mc-item.is-armed .mc-dot { background: var(--stamp-ink); border-color: var(--stamp-ink); }

/* 그림 보기 */
.mc-fig { width: 100%; max-width: 74px; height: auto; display: block; }
.match-connect.has-fig .mc-item.mc-r .mc-label { justify-content: flex-start; }

/* 복기 — 누를 수 없고 선 색으로 맞고 틀림을 보인다 */
.match-connect.is-review .mc-item { opacity: 1; cursor: default; }
.match-connect.is-review .mc-item.is-linked { background: #fcfbf7; border-color: var(--line); }
.match-connect.is-review .mc-item.is-linked .mc-dot { background: var(--line-dark); border-color: var(--line-dark); }
.mc-legend {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 12px 0 0; font-family: var(--sans); font-size: 0.8rem; font-weight: 700;
}
.mc-legend span {
  border: 1px solid currentColor; border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
.mc-legend .ok { color: var(--green); background: var(--green-soft); }
.mc-legend .no { color: var(--red); background: var(--red-soft); }

@media (max-width: 400px) {
  .match-connect { grid-template-columns: 1fr 30px 1fr; }
  .mc-item { padding: 8px 7px; gap: 6px; min-height: 44px; }
  .mc-text { font-size: 0.79rem; }
  .mc-fig { max-width: 66px; }
}

/* 순위표에 못 올린 점수 알림 — 조용히 사라지면 아무도 모른다 */
.pending-note {
  color: var(--red); font-weight: 700;
  background: var(--red-soft); border-radius: 4px; padding: 7px 10px;
}
.rank-warn { color: var(--red); font-weight: 700; font-size: 0.82rem; line-height: 1.5; }

/* 과목 탭 — 표지 맨 위, 문제은행과 순위표가 통째로 바뀐다 */
.subject-tabs {
  display: flex; gap: 0; justify-content: center; margin: -6px 0 18px;
  border-bottom: 1px solid var(--line-dark);
}
.subject-tab {
  font-family: var(--sans); font-size: 0.82rem; font-weight: 700;
  border: 1px solid transparent; border-bottom: none; background: none; color: var(--ink-soft);
  border-radius: 5px 5px 0 0; padding: 8px 18px; margin-bottom: -1px;
}
.subject-tab.is-on {
  background: var(--paper); border-color: var(--line-dark); color: var(--navy);
  box-shadow: inset 0 3px 0 var(--navy);
}

/* 순위표 유형 탭 */
.rank-tabs { display: flex; gap: 6px; justify-content: center; margin: 8px 0 6px; }
.rank-tab {
  font-family: var(--sans); font-size: 0.8rem; font-weight: 700;
  border: 1px solid var(--line-dark); background: var(--paper); color: var(--ink-soft);
  border-radius: 999px; padding: 5px 16px;
}
.rank-tab.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ── 순위판·기록 ── */
.board { padding-top: 16px; }
.board-title {
  margin: 0 0 4px; font-size: 1.05rem; font-weight: 700; letter-spacing: 0.2em; text-align: center;
}
.board-note { text-align: center; font-size: 0.75rem; color: var(--ink-soft); margin: 0 0 10px; font-family: var(--sans); }
.rank-table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.82rem; table-layout: fixed; }
.rank-table th, .rank-table td { border: 1px solid var(--line-dark); padding: 7px 2px; text-align: center; word-break: keep-all; }
.rank-table thead th { background: #f1efe8; font-weight: 700; font-size: 0.72rem; }
.rank-table col.c-rank { width: 15%; }

/* 1·2·3등 왕관 — 좁은 칸이라 아주 작게, 숫자와 나란히 */
.rank-table .r-top {
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  font-weight: 800; line-height: 1;
}
.rank-table .crown { width: 16px; height: 16px; flex: none; display: block; }
@media (max-width: 360px) {
  .rank-table .crown { width: 14px; height: 14px; }
}
.rank-table col.c-name { width: 20%; }
.rank-table col.c-score { width: 16%; }
.rank-table col.c-pass { width: 17%; }
.rank-table col.c-when { width: 23%; }
.rank-table col.c-cnt { width: 12%; }
.rank-table .r-when { font-size: 0.76rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.rank-table .empty { color: var(--ink-soft); padding: 16px 0; }
.rank-table .r-first td { background: #fdf6df; font-weight: 700; }
.rank-table .r-me td { background: var(--navy-soft); }
.rank-table .pass { color: var(--green); font-weight: 700; }
.rank-table .fail { color: var(--red); font-weight: 700; }

/* ── 학습 자료실 ── */
.files { list-style: none; margin: 0; padding: 0; }
.files li { border-top: 1px dashed var(--line); padding: 12px 2px 10px; }
.files li:first-child { border-top: none; }
.files a {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  text-decoration: none; color: var(--navy); font-family: var(--sans);
}
.files a:hover .f-name { text-decoration: underline; }
.files .f-name { font-weight: 700; font-size: 0.95rem; }
.files .f-name b { color: var(--stamp-ink); }
.files .f-meta { font-size: 0.74rem; color: var(--ink-soft); margin-left: auto; white-space: nowrap; }
.files .f-desc {
  margin: 4px 0 0; font-family: var(--sans); font-size: 0.78rem;
  color: var(--ink-soft); line-height: 1.6; word-break: keep-all;
}
.files-credit {
  margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--line);
  font-family: var(--sans); font-size: 0.7rem; line-height: 1.7;
  color: var(--ink-soft); word-break: keep-all;
}
.files-credit b { color: var(--ink); }
.files-credit a { color: var(--navy); }

.history-list { list-style: none; margin: 0; padding: 0; font-family: var(--sans); }
.history-list li {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px dashed var(--line); padding: 8px 2px; font-size: 0.9rem;
}
.history-list .h-score { font-weight: 800; display: flex; align-items: center; gap: 6px; }
.history-list .h-mode {
  font-size: 0.68rem; font-weight: 700; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px;
}
.history-list .h-meta { color: var(--ink-soft); font-size: 0.8rem; }
.history-list .pass { color: var(--green); }
.history-list .fail { color: var(--red); }

/* ── 시험 상단 ── */
.exam-topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  background: var(--desk); padding: 10px 2px;
  border-bottom: 2px solid var(--line-dark);
}
.timer-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--paper); border: 1.5px solid var(--line-dark); border-radius: 4px;
  padding: 5px 12px;
}
.timer-label { font-size: 0.72rem; font-weight: 700; color: var(--ink-soft); font-family: var(--sans); }
.timer { font-family: var(--sans); font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.3rem; letter-spacing: 0.04em; }
.timer.warn { color: var(--warn); }
.timer.danger { color: var(--red); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0.4; } }
.progress { margin-left: auto; font-family: var(--sans); font-weight: 700; color: var(--ink-soft); }

/* ── OMR식 문항 번호판 ── */
.qnav { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.qnav button {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid var(--line-dark); background: var(--paper);
  font-size: 0.85rem; font-weight: 700; color: var(--ink);
}
.qnav button.answered { background: var(--line-dark); color: #fff; }
.qnav button.current { border-color: var(--navy); box-shadow: 0 0 0 2.5px var(--navy); }

/* ── 문제지 ── */
.qcard { }
.qcard .qmeta { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; font-family: var(--sans); }
.tag { font-size: 0.7rem; font-weight: 700; border: 1px solid currentColor; border-radius: 3px; padding: 2px 8px; }
.tag.mc { color: var(--navy); }
.tag.sa { color: var(--warn); }
.tag.unit { color: var(--ink-soft); border-style: dashed; font-weight: 500; }
.qtext { font-size: 1.06rem; font-weight: 600; margin: 0 0 16px; white-space: pre-line; line-height: 1.75; }
.qtext .pts { font-size: 0.85rem; color: var(--ink-soft); font-weight: 400; }
.qimg { max-width: min(100%, 360px); border: 1px solid var(--line-dark); padding: 4px; background: #fff; margin: 0 0 16px; display: block; }

.choices { display: flex; flex-direction: column; gap: 2px; }
.choice {
  display: flex; gap: 10px; align-items: flex-start; text-align: left;
  background: transparent; border: 1px solid transparent; border-radius: 4px;
  padding: 9px 10px; font-size: 1rem; width: 100%; font-family: var(--serif); color: var(--ink);
  line-height: 1.6;
}
.choice .num { font-weight: 700; flex-shrink: 0; }
.choice:hover { background: #f4f2ea; }
.choice.selected { background: var(--navy-soft); border-color: var(--navy); }
.choice.selected .num { color: var(--navy); }

.sa-answers { margin-top: 6px; }
.sa-answers.multi .sa-answer-row { margin-top: 10px; }
.sa-guide {
  margin: 0 0 4px; font-family: var(--sans); font-size: 0.78rem;
  color: var(--warn); font-weight: 600;
}
.sa-answer-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.sa-answer-row .sa-mark {
  font-weight: 700; color: var(--ink-soft); white-space: nowrap;
  min-width: 26px; text-align: right;
}
.sa-input {
  flex: 1; min-width: 0; font-family: var(--serif); font-size: 1.05rem;
  border: none; border-bottom: 2px solid var(--line-dark); background: transparent;
  padding: 8px 6px; color: var(--navy); font-weight: 600; border-radius: 0;
}
.sa-input:focus { outline: none; border-bottom-color: var(--navy); }

.exam-bottombar { display: flex; gap: 10px; margin-top: 16px; }
.exam-bottombar button { flex: 1; padding: 14px; font-size: 1rem; }

/* ── 성적 통지표 ── */
.report { text-align: center; padding-top: 26px; }
.report-title { margin: 0 0 6px; font-size: 1.5rem; font-weight: 900; letter-spacing: 0.35em; }
.report-mode {
  margin: 0 0 16px; font-family: var(--sans); font-size: 0.78rem;
  font-weight: 700; color: var(--ink-soft); letter-spacing: 0.02em;
}
.report-table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.9rem; margin-bottom: 12px; table-layout: fixed; }
.report-table th, .report-table td { border: 1px solid var(--line-dark); padding: 10px 4px; word-break: keep-all; }
.report-table th { background: #f1efe8; font-weight: 700; width: 22%; font-size: 0.8rem; white-space: nowrap; }
.report-table td { width: 28%; }
#result-score-cell { font-weight: 900; font-size: 1.25rem; white-space: nowrap; }
#result-score-cell .of { font-size: 0.72rem; font-weight: 600; color: var(--ink-soft); }
#result-duration { white-space: nowrap; }
#result-date { font-size: 0.82rem; line-height: 1.35; }
#result-pass-cell.pass { color: var(--green); font-weight: 900; font-size: 1.1rem; }
#result-pass-cell.fail { color: var(--red); font-weight: 900; font-size: 1.1rem; }
.rank-line { font-family: var(--sans); font-size: 0.92rem; color: var(--ink-soft); margin: 4px 0 0; }
.rank-line b { color: var(--navy); font-size: 1.05rem; }
/* 점수 구간별 선생님 도장 */
.verdict-block { margin: 18px 0 4px; }
.verdict-stamp {
  display: block; width: 132px; height: 132px; margin: 0 auto;
  transform: rotate(-6deg);
}
.verdict-message {
  margin: 6px 0 0; font-size: 1.15rem; font-weight: 700;
  color: var(--stamp-ink); letter-spacing: 0.05em;
}

.review-title { font-size: 1.02rem; font-weight: 700; letter-spacing: 0.08em; margin: 22px 2px 10px; }

/* ── 채점 결과 카드 ── */
.rcard {
  background: var(--paper); border: 1px solid var(--line);
  padding: 16px; margin-bottom: 12px; position: relative;
}
.rcard.correct { border-left: 4px solid var(--green); }
.rcard.wrong { border-left: 4px solid var(--red); }
.rcard .rhead { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; font-family: var(--sans); }
.rcard .rnum { font-weight: 800; }
.badge { font-size: 0.72rem; font-weight: 800; border-radius: 3px; padding: 2px 9px; }
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.no { background: var(--red-soft); color: var(--red); }
.rcard .qtext { font-size: 0.98rem; margin-bottom: 10px; }
.rcard .rrow { font-size: 0.92rem; margin: 4px 0; font-family: var(--sans); }
.rcard .rrow b { font-weight: 700; }
.rcard .my-wrong { color: var(--red); }
.rcard .my-right { color: var(--green); }
.rchoices { margin: 8px 0; padding: 0; list-style: none; font-size: 0.94rem; color: var(--ink-soft); }
.rchoices li { padding: 3px 0; }
.rchoices li.answer { color: var(--green); font-weight: 700; }
.rchoices li.mine { color: var(--red); font-weight: 700; }
.rchoices li.mine.answer { color: var(--green); }
.expl {
  background: #f6f4ec; border-left: 3px solid var(--line-dark);
  padding: 12px 14px; font-size: 0.92rem; margin-top: 10px; white-space: pre-line;
}
.expl .src { display: block; margin-top: 6px; color: var(--ink-soft); font-size: 0.8rem; font-family: var(--sans); }
.self-grade { margin-top: 10px; display: flex; gap: 8px; align-items: center; font-size: 0.86rem; color: var(--ink-soft); font-family: var(--sans); }
.self-grade button { font-size: 0.85rem; font-weight: 700; padding: 7px 12px; border-radius: 4px; background: var(--paper); border: 1px solid var(--line-dark); }

.result-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

@media (min-width: 620px) {
  .cover-title { font-size: 2.5rem; }
  .qnav button { width: 38px; height: 38px; }
  .paper { padding: 28px 34px; }
}
