/* 기추리 (구 기출 출제실) */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; }
/* Layout: 왼쪽은 자료·출제 설정 데스크, 가운데는 시험지, 오른쪽은 OMR 답안지. 좁은 화면에서는 위에서 아래로 쌓임 */
:root {
  --desk: #e9ecf0;
  --paper: #ffffff;
  --ink: #1a2130;
  --muted: #5b6475;
  --line: #d3d8e0;
  --omr: #cf3f63;
  --omr-soft: #fbe8ed;
  --ok: #24764a;
  --ok-soft: #e3f2e9;
  --wrong: #b3261e;
  --wrong-soft: #fbe5e3;
  --chip: #f2f4f7;
  --shadow: 0 1px 2px rgba(20,30,50,.06), 0 8px 24px rgba(20,30,50,.06);
  --f-exam: "Noto Serif KR", "Batang", "AppleMyungjo", serif;
  --f-ui: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --f-num: "IBM Plex Mono", ui-monospace, "Consolas", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --desk: #11141a; --paper: #1a1e26; --ink: #e5e8ed; --muted: #98a1b0; --line: #2e3542;
    --omr: #f17c99; --omr-soft: #3a1f29; --ok: #74c795; --ok-soft: #173225; --wrong: #ff8f85; --wrong-soft: #3d1c1a;
    --chip: #232833; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --desk: #11141a; --paper: #1a1e26; --ink: #e5e8ed; --muted: #98a1b0; --line: #2e3542;
  --omr: #f17c99; --omr-soft: #3a1f29; --ok: #74c795; --ok-soft: #173225; --wrong: #ff8f85; --wrong-soft: #3d1c1a;
  --chip: #232833; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--desk); color: var(--ink); font-family: var(--f-ui); font-size: 15px; line-height: 1.6; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--omr); outline-offset: 2px; }

.wrap { max-width: 1440px; margin: 0 auto; padding-inline: 20px; padding-block: 20px 48px; display: flex; flex-direction: column; gap: 18px; }
.top { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; }
.brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.brand h1 { margin: 0; font-family: var(--f-exam); font-weight: 900; font-size: 26px; letter-spacing: -.02em; }
.brand h1 b { color: var(--omr); font-weight: 900; }
.brand p { margin: 0; color: var(--muted); font-size: 14px; }

.grid { display: grid; grid-template-columns: 340px minmax(0, 1fr) 220px; gap: 18px; align-items: start; }
@media (max-width: 1180px) { .grid { grid-template-columns: 320px minmax(0, 1fr); } .omr { grid-column: 2; } }
@media (max-width: 820px) { .grid { grid-template-columns: minmax(0, 1fr); } .omr { grid-column: auto; } }

/* 설정 패널 */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 18px; display: flex; flex-direction: column; gap: 18px; }
.lib { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lib li { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 2px 8px; align-items: center; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 13.5px; }
.lib li.cur { border-color: var(--ink); }
.lib .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lib .s { grid-column: 1 / -1; font-size: 12px; color: var(--muted); font-family: var(--f-num); }
.lib button.open { border: 0; background: none; color: var(--omr); font-weight: 600; font-size: 13px; padding: 0; }
.pill { font-size: 11.5px; border-radius: 999px; padding: 1px 8px; white-space: nowrap; background: var(--chip); color: var(--muted); }
.pill.pending { background: var(--chip); color: var(--ink); }
.pill.working { background: var(--omr-soft); color: var(--omr); }
.pill.done { background: var(--ok-soft); color: var(--ok); }
.pill.error { background: var(--wrong-soft); color: var(--wrong); }
.lib-h { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 4px 0 0; }
.step { display: flex; flex-direction: column; gap: 10px; }
.step h2 { margin: 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; display: flex; gap: 8px; align-items: center; }
.step h2 span { font-family: var(--f-num); color: var(--omr); }
.drop { border: 1.5px dashed var(--line); border-radius: 8px; padding: 18px 14px; text-align: center; display: flex; flex-direction: column; gap: 4px; align-items: center; transition: border-color .15s, background .15s; cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--omr); background: var(--omr-soft); }
.drop strong { font-weight: 600; }
.drop small { color: var(--muted); font-size: 12.5px; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.files li { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 8px; align-items: center; background: var(--chip); border-radius: 6px; padding: 7px 10px; font-size: 13.5px; }
.files .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .meta { font-family: var(--f-num); font-size: 12px; color: var(--muted); white-space: nowrap; }
.files .meta.warn { color: var(--omr); }
.files button { border: 0; background: none; color: var(--muted); padding: 0 2px; font-size: 16px; line-height: 1; }
.files button:hover { color: var(--wrong); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .lbl { font-size: 13px; font-weight: 600; }
.field input[type=text], .field textarea, .field select { width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.field textarea { resize: vertical; min-height: 56px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: inline-block; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; background: var(--paper); }
.seg input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { outline: 2px solid var(--omr); outline-offset: 2px; }
.seg .num { font-family: var(--f-num); }

.go { border: 0; background: var(--omr); color: #fff; border-radius: 8px; padding: 12px 14px; font-weight: 700; font-size: 15px; }
.go:disabled { opacity: .45; cursor: not-allowed; }
.go.stop { background: var(--ink); color: var(--paper); }
.status { font-size: 13px; color: var(--muted); min-height: 1.2em; margin: 0; }
.status.err { color: var(--wrong); }

/* 시험지 */
.sheet { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); padding: clamp(18px, 4vw, 44px); min-width: 0; }
.ex-flag { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--omr); background: var(--omr-soft); border-radius: 999px; padding: 3px 10px; margin-bottom: 14px; }
.sheet-head { text-align: center; border-bottom: 3px double var(--ink); padding-bottom: 14px; display: flex; flex-direction: column; gap: 4px; }
.sheet-head .kicker { font-family: var(--f-exam); font-size: 14px; color: var(--muted); letter-spacing: .1em; }
.sheet-head h2 { margin: 0; font-family: var(--f-exam); font-weight: 900; font-size: clamp(22px, 3.2vw, 32px); letter-spacing: -.01em; text-wrap: balance; }
.sheet-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); padding-block: 10px; border-bottom: 1px solid var(--ink); margin-bottom: 22px; }
.sheet-meta .blank { display: inline-block; width: 90px; border-bottom: 1px solid var(--muted); }
.sheet-meta .tn { font-family: var(--f-num); }

.questions { columns: 2 320px; column-gap: 40px; column-rule: 1px solid var(--line); }
.q { break-inside: avoid; margin: 0 0 28px; font-family: var(--f-exam); font-size: 15.5px; line-height: 1.75; }
.q-text { margin: 0 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.q-no { font-weight: 900; margin-right: 6px; font-family: var(--f-num); }
.q-pts { font-family: var(--f-ui); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.q-type { font-family: var(--f-ui); font-size: 11.5px; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; margin-left: 4px; vertical-align: 2px; }
.choices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.choice { display: grid; grid-template-columns: 26px minmax(0,1fr); gap: 4px; width: 100%; text-align: left; background: none; border: 0; border-radius: 6px; padding: 3px 6px; font-family: inherit; font-size: inherit; line-height: 1.6; }
.choice:hover { background: var(--chip); }
.choice .mk { font-family: var(--f-ui); }
.choice.sel { background: var(--chip); font-weight: 700; }
.choice.sel .mk { color: var(--omr); }
.choice.right { background: var(--ok-soft); }
.choice.right .mk { color: var(--ok); }
.choice.miss { background: var(--wrong-soft); text-decoration: line-through; text-decoration-color: var(--wrong); }
.ox { display: flex; gap: 10px; }
.ox .choice { width: auto; grid-template-columns: auto; padding: 4px 18px; border: 1px solid var(--line); font-family: var(--f-num); font-weight: 600; }
.write { width: 100%; min-height: 172px; border: 0; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(transparent 0 27px, var(--line) 27px 28px); line-height: 28px; resize: vertical; overflow: hidden; font-family: var(--f-exam); font-size: inherit; padding: 0 4px; }
.write.short { min-height: 60px; }
/* 수식 */
.katex { font-size: 1.06em; }
.katex-display { margin: .5em 0; overflow-x: auto; overflow-y: hidden; padding-block: 2px; }
.choice .katex-display { margin: 0; }
.q-tools { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; font-family: var(--f-ui); }
.link { background: none; border: 0; padding: 0; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--omr); }
.sol { margin-top: 10px; font-family: var(--f-ui); font-size: 13.5px; line-height: 1.65; border-left: 3px solid var(--omr); padding: 8px 12px; background: var(--chip); border-radius: 0 6px 6px 0; display: flex; flex-direction: column; gap: 4px; }
.sol .ans { font-weight: 700; }
.sol .src { color: var(--muted); font-size: 12.5px; }
.sol p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.selfcheck { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12.5px; }
.selfcheck button { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; }
.selfcheck button.on-ok { background: var(--ok); border-color: var(--ok); color: var(--paper); }
.selfcheck button.on-no { background: var(--wrong); border-color: var(--wrong); color: var(--paper); }

.empty { text-align: center; padding-block: 60px; color: var(--muted); font-family: var(--f-ui); }
.loading { display: flex; flex-direction: column; gap: 14px; padding-block: 8px; }
.loading .bar { height: 12px; border-radius: 4px; background: linear-gradient(90deg, var(--chip), var(--line), var(--chip)); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .loading .bar { animation: none; } }

/* OMR 답안지 */
.omr { background: var(--paper); border: 1px solid var(--omr); border-radius: 6px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 16px); overflow: hidden; }
@media (max-width: 820px) { .omr { position: static; } }
.omr-head { background: var(--omr); color: #fff; padding: 8px 12px; display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-size: 13px; letter-spacing: .08em; }
.omr-score { padding: 12px; border-bottom: 1px solid var(--omr); display: flex; flex-direction: column; gap: 2px; text-align: center; }
.omr-score .big { font-family: var(--f-num); font-size: 30px; font-weight: 600; color: var(--omr); line-height: 1.2; font-variant-numeric: tabular-nums; }
.omr-score small { color: var(--muted); font-size: 12px; }
.omr-rows { padding: 6px 8px; display: flex; flex-direction: column; max-height: 60vh; overflow-y: auto; }
@media (max-width: 1180px) { .omr-rows { max-height: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); column-gap: 14px; } }
.omr-row { display: grid; grid-template-columns: 26px 1fr; align-items: center; gap: 4px; padding-block: 3px; border-bottom: 1px dotted var(--omr-soft); }
.omr-row .n { font-family: var(--f-num); font-size: 12px; color: var(--omr); text-align: right; padding-right: 4px; font-variant-numeric: tabular-nums; }
.omr-row.right .n { color: var(--ok); }
.omr-row.wrongrow .n { color: var(--wrong); }
.bubbles { display: flex; gap: 4px; }
.bub { width: 22px; height: 26px; border-radius: 50%; border: 1px solid var(--omr); background: transparent; font-family: var(--f-num); font-size: 10.5px; color: var(--omr); padding: 0; display: grid; place-items: center; }
.bub.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.bub.key { box-shadow: 0 0 0 2px var(--ok); }
.omr-note { font-size: 12px; color: var(--muted); padding: 2px 4px; }
.omr-actions { padding: 10px; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--omr); }
.btn { border: 1px solid var(--line); background: var(--paper); border-radius: 6px; padding: 8px 10px; font-size: 13.5px; font-weight: 600; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* 휴대폰: 화면 아래 고정 채점 바, 누르기 쉬운 OMR 칸 */
.mbar { display: none; }
@media (max-width: 820px) {
  .mbar { display: flex; align-items: center; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--paper); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(20,30,50,.08); }
  .mbar-prog { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
  .mbar-prog b { color: var(--omr); font-family: var(--f-num); }
  .wrap { padding-bottom: 96px; }
  .bub { width: 30px; height: 32px; font-size: 12px; }
  .bubbles { gap: 6px; }
  .omr-rows { grid-template-columns: 1fr; }
}
.sheet-tools { display: flex; justify-content: flex-end; margin-bottom: 12px; }

/* 문제집 목록의 취소·삭제 */
.lib .s.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lib .s.row > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link.danger { font-family: var(--f-ui); font-size: 12px; white-space: nowrap; }
.link.danger:hover, .link.danger.armed { color: var(--wrong); }
.link.danger.armed { font-weight: 700; text-decoration: none; }
.lib .acts { display: inline-flex; gap: 10px; align-items: center; flex: none; }
.link.retry { font-family: var(--f-ui); font-size: 12px; white-space: nowrap; color: var(--omr); text-decoration: none; font-weight: 600; }
.link.retry:hover { text-decoration: underline; }
.link.retry:disabled { opacity: .45; cursor: wait; }
/* 답안 수식 미리보기 */
.math-preview { margin-top: 6px; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 6px; font-family: var(--f-exam); display: flex; flex-direction: column; gap: 2px; }
.math-preview-label { font-family: var(--f-ui); font-size: 11.5px; color: var(--muted); }
.math-preview-body { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
/* 문제 그림 */
.fig { margin: 4px 0 12px; }
.fig-box { max-width: 560px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: #fff; }
.fig-box img { display: block; width: 100%; height: auto; }
.fig-box.cropped { position: relative; width: 100%; }
.fig-box.cropped img { position: absolute; max-width: none; }
.fig-missing { font-family: var(--f-ui); font-size: 12.5px; color: var(--muted); }
/* 남은 요청 수 */
.quota { margin: -10px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.quota.out { color: var(--wrong); }
/* 사용법 안내 */
.help-btn { padding: 6px 12px; font-size: 13px; }
.tour-shield { position: fixed; inset: 0; z-index: 50; }
.tour-hole { position: fixed; z-index: 51; border-radius: 10px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(12, 16, 26, .58), 0 0 0 2px var(--omr); transition: left .25s, top .25s, width .25s, height .25s, opacity .2s; }
.tour-card { position: fixed; z-index: 52; width: min(340px, calc(100vw - 32px)); background: var(--paper); color: var(--ink);
  border-radius: 10px; padding: 16px 18px; box-shadow: 0 12px 40px rgba(0,0,0,.25); display: flex; flex-direction: column; gap: 8px; }
.tour-card.docked { left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: auto; top: auto; }
.tour-count { font-family: var(--f-num); font-size: 12px; color: var(--omr); }
.tour-title { margin: 0; font-size: 17px; font-weight: 700; }
.tour-body { margin: 0; font-size: 14px; line-height: 1.65; color: var(--muted); }
.tour-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.tour-spacer { flex: 1; }
.tour-skip { background: none; border: 0; padding: 0; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .tour-hole { transition: none; } }
/* 오답노트 */
.lib li.note-item { border-color: var(--omr); background: var(--omr-soft); }
.lib li.note-item .t { color: var(--omr); }
.q-from { display: block; margin-top: 4px; font-family: var(--f-ui); font-size: 12px; color: var(--omr); }
/* 계정 */
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.account { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.account .btn { padding: 6px 12px; font-size: 13px; }
.btn.google { display: inline-flex; align-items: center; gap: 6px; }
.btn.google .g { font-family: var(--f-num); font-weight: 700; color: var(--omr); }
.account .who { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.account .dot.guest { background: var(--muted); }
.account .link { font-size: 13px; }

/* 문제 아래 도구: 해설 · 이 문제 다시 · 신고 */
.q-tools { align-items: center; gap: 4px 14px; }
.q-tools .link.danger { font-size: 13px; color: var(--muted); }
.q-tools .q-regen.armed { color: var(--omr); }
.q-busy { font-size: 12.5px; color: var(--omr); }
.report { margin-top: 10px; font-family: var(--f-ui); border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--paper); }
.report-h { margin: 0; font-size: 13px; font-weight: 600; }
.report-note { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: 13px; resize: vertical; background: var(--paper); }
.report-actions { display: flex; align-items: center; gap: 12px; }
.report-actions .btn { padding: 6px 12px; font-size: 13px; }

/* 시험 모드 */
.sheet-tools { gap: 8px; flex-wrap: wrap; }
.sheet-tools .btn { padding: 6px 12px; font-size: 13px; }
.timer-pick { font-family: var(--f-ui); border: 1px dashed var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.timer-pick p { margin: 0; font-size: 13px; color: var(--muted); }
.chip { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-family: var(--f-num); }
.chip:hover { border-color: var(--ink); }
.chip.on { border-color: var(--omr); color: var(--omr); font-weight: 600; }
.chip small { font-family: var(--f-ui); font-size: 11px; }
.exam-bar { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 8px); z-index: 5; display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap;
  font-family: var(--f-ui); font-size: 14px; background: var(--omr-soft); border: 1px solid var(--omr); border-radius: 8px; padding: 8px 12px; margin-bottom: 16px; }
.exam-bar .btn { margin-left: auto; padding: 6px 12px; font-size: 13px; }
.exam-bar-note { font-size: 12.5px; color: var(--muted); }
.timer-left { font-family: var(--f-num); font-variant-numeric: tabular-nums; color: var(--omr); }
.timer-left.low { color: var(--wrong); }

/* 친구와 점수 비교 */
.rank { font-family: var(--f-ui); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 22px; display: flex; flex-direction: column; gap: 8px; }
.rank-head { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; }
.rank-head h3 { margin: 0; font-size: 15px; }
.rank-sub { font-size: 12.5px; color: var(--muted); margin: 0; }
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rank-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 5px 4px; border-bottom: 1px dotted var(--line); font-size: 14px; }
.rank-list li.me { background: var(--omr-soft); border-radius: 6px; font-weight: 700; }
.rank-list .rk { font-family: var(--f-num); color: var(--omr); text-align: right; }
.rank-list .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list .sc { font-family: var(--f-num); font-variant-numeric: tabular-nums; }
.rank-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rank-nick { width: 130px; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: 13.5px; background: var(--paper); }
.rank-form .btn { padding: 6px 12px; font-size: 13px; }

/* 오답노트 과목 고르기 */
.note-subject { width: 100%; border: 1px solid var(--omr); border-radius: 6px; padding: 4px 6px; font-size: 12.5px; background: var(--paper); font-family: var(--f-ui); }

/* 답안지 아래 링크 · 사이트 아래 */
.save-txt { font-size: 12.5px; padding: 2px 0; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 10px; justify-content: center; font-size: 12.5px; color: var(--muted); padding-top: 8px; }
.foot-links a { color: var(--muted); }

/* 인쇄 · PDF: 시험지만 깨끗하게, 항상 밝은 색 */
@media print {
  :root:not([data-print]), :root[data-theme="dark"] {
    --desk: #fff; --paper: #fff; --ink: #000; --muted: #444; --line: #bbb; --chip: #fff;
    --omr: #000; --omr-soft: #fff; --ok: #000; --ok-soft: #fff; --wrong: #000; --wrong-soft: #fff; color-scheme: light;
  }
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff; }
  .top, .panel, .omr, .mbar, .foot-links, .q-tools, .sheet-tools, .timer-pick, .exam-bar, .ex-flag, .rank, .report, .math-preview, .selfcheck { display: none !important; }
  .wrap { padding: 0; max-width: none; }
  .grid { display: block; }
  .sheet { border: 0; box-shadow: none; padding: 0; }
  .choice.sel, .choice.right, .choice.miss { background: none; font-weight: inherit; text-decoration: none; }
  .ox .choice { border-color: #888; }
  .write { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body:not(.print-key) .sol { display: none !important; }
  .sol { border-left: 2px solid #000; background: none; break-inside: avoid; }
  .fig-box { break-inside: avoid; }
}