:root { --bg: #f6f4ef; --paper: #fff; --navy: #11243a; --ink: #26313d; --muted: #647382; --line: #e4dfd4; --gold: #967443; --gold-bg: #f3ede1; --green: #286343; --red: #9e3b31; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: var(--bg); font: 15px/1.65 'Pretendard', 'Malgun Gothic', sans-serif; word-break: keep-all; overflow-wrap: anywhere; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 3px solid #b18b45; outline-offset: 4px; }
.wrap { max-width: 1040px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
@media (min-width: 640px) { .wrap { padding-left: 28px; padding-right: 28px; } }
.site-header { background: var(--navy); }
/* 상단 띠는 홈·자료실·퀴즈가 똑같은 폭·여백을 쓴다(페이지를 오가도 로고가 제자리에 있게) */
html { scrollbar-gutter: stable; }
.site-header .wrap { display: flex; align-items: center; min-height: 64px; max-width: 1040px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
@media (min-width: 640px) { .site-header .wrap { padding-left: 28px; padding-right: 28px; } }
.site-logo { display: block; line-height: 0; }
.site-logo img { display: block; height: 40px; width: auto; max-width: 100%; }
@media (max-width: 480px) { .site-header .wrap { min-height: 54px; } .site-logo img { height: 32px; } }
.back-links { display: flex; justify-content: space-between; gap: 16px; margin: 24px 0 26px; font-size: 13px; color: #7e6239; }
.back-links a { text-decoration: none; }
.back-links a:hover { text-decoration: underline; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.eyebrow { margin: 0 0 7px; color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: .09em; }
h1 { margin: 0; color: var(--navy); font-size: clamp(26px, 4vw, 36px); line-height: 1.25; letter-spacing: -.035em; }
h2 { color: var(--navy); line-height: 1.4; }
.lead { margin: 12px 0 0; color: var(--muted); }
.edition { flex-shrink: 0; padding: 6px 12px; border: 1px solid var(--line); border-radius: 20px; font-size: 12px; color: var(--muted); }
.ai-notice { border-left: 3px solid var(--gold); background: var(--gold-bg); padding: 15px 19px; border-radius: 0 8px 8px 0; margin: 24px 0; font-size: 13px; }
.ai-notice strong { color: #604721; }
.ai-notice p { margin: 4px 0 0; color: #6d6252; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 3px 15px #11243a04; }
.intro { display: block; padding: 38px 42px; }
.intro-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.intro h2 { font-size: 28px; margin: 8px 0 18px; letter-spacing: -.025em; }
.intro-copy { color: var(--muted); }
/* 분야 칩은 좁은 화면에서도 가로 한 줄로 둔다(글자가 작아지더라도) */
.category-tags { display: flex; gap: clamp(4px, 1.2vw, 8px); flex-wrap: nowrap; margin: 24px 0; }
.category-tags span { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 6px clamp(4px, 1.4vw, 12px); background: var(--bg); border: 1px solid var(--line); border-radius: 7px;
  font-size: clamp(11px, 2.9vw, 13px); white-space: nowrap; }
.category-tags b { margin-left: 0; color: var(--gold); }
.intro-number { flex: 0 0 150px; text-align: right; display: flex; flex-direction: column; padding: 4px 0 0; color: var(--gold); }
.intro-number span { font-size: 11px; letter-spacing: .06em; }
.intro-number strong { font-size: 72px; line-height: 1.15; color: var(--navy); letter-spacing: -.08em; font-weight: 500; }
.btn { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; padding: 9px 19px; border: 1px solid #cec8bc; border-radius: 8px; background: #fff; color: var(--navy); font-weight: 600; font-size: 14px; }
.btn:hover:not(:disabled) { background: var(--gold-bg); }
.btn.primary { color: #fff; background: var(--navy); border-color: var(--navy); }
.btn.primary:hover:not(:disabled) { background: #244460; }
.btn.resume { margin-left: 8px; }
@media (max-width: 480px) { .btn.resume { margin: 8px 0 0; } }
.small { color: var(--muted); font-size: 12px; }
.progress-row { display: flex; justify-content: space-between; gap: 12px; margin: 27px 0 8px; font-weight: 600; font-size: 13px; }
progress { display: block; width: 100%; height: 6px; border: 0; border-radius: 9px; background: var(--line); accent-color: var(--gold); margin-bottom: 22px; }
progress::-webkit-progress-bar { background: var(--line); border-radius: 9px; }
progress::-webkit-progress-value { background: var(--gold); border-radius: 9px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 255px; gap: 20px; align-items: start; }
.question-card { padding: 28px; }
.question-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; color: var(--muted); font-size: 13px; }
.category-label { background: var(--gold-bg); color: #795d32; border-radius: 5px; padding: 3px 10px; font-size: 12px; font-weight: 700; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; font-size: 20px; line-height: 1.65; font-weight: 650; color: var(--navy); width: 100%; }
.options { display: grid; gap: 10px; margin-top: 24px; }
.option { display: flex; align-items: flex-start; gap: 12px; border: 1px solid var(--line); border-radius: 9px; padding: 15px; cursor: pointer; background: #fff; }
.option:hover { border-color: #b8ab91; }
.option:has(input:checked) { border-color: var(--navy); background: #eff3f7; box-shadow: inset 0 0 0 1px var(--navy); }
.option input { margin: 5px 0 0; width: 17px; height: 17px; flex-shrink: 0; accent-color: var(--navy); }
.option-text { display: flex; gap: 10px; }
.option-letter { color: var(--muted); min-width: 15px; font-weight: 700; }
.status { min-height: 24px; font-size: 13px; color: var(--red); margin: 18px 0 10px; }
.question-actions { display: flex; justify-content: space-between; gap: 10px; }
.submit-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.submit { flex-shrink: 0; color: #755522; border-color: #c4ae87; }
.navigator { padding: 22px; }
.navigator h2 { margin: 0; font-size: 16px; }
.navigator .small { margin-top: 5px; }
.map-label { margin: 19px 0 8px; font-size: 12px; font-weight: 650; color: var(--muted); }
.map-buttons { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.map-button { min-height: 33px; border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 5px; font-size: 12px; }
.map-button.answered { background: var(--navy); border-color: var(--navy); color: #fff; }
.map-button[aria-current="step"] { outline: 2px solid var(--gold); outline-offset: 2px; }
.score-card { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 30px; }
.score-card h2 { margin: 0; font-size: 24px; }
.score-card p:last-child { margin-bottom: 0; color: var(--muted); }
.score { white-space: nowrap; }
.score strong { font-size: 56px; font-weight: 600; color: var(--navy); }
.score span { font-size: 13px; color: var(--muted); }
.category-scores { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0 32px; }
.category-score { border: 1px solid var(--line); border-radius: 9px; padding: 13px 16px; display: flex; justify-content: space-between; gap: 8px; font-size: 14px; background: white; }
.category-score span { color: var(--muted); }
.review-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.review-toolbar h2 { margin: 0; font-size: 21px; }
.review-toolbar > div { display: flex; flex-wrap: wrap; gap: 8px; }
.btn[aria-pressed="true"] { background: var(--gold-bg); border-color: var(--gold); }
.reviews { display: grid; gap: 18px; }
.review { padding: 25px 28px; }
.review .question-meta { margin-bottom: 12px; }
.review h3 { font-size: 17px; margin: 0 0 18px; line-height: 1.65; }
.result-badge { font-size: 12px; font-weight: 700; color: var(--green); }
.result-badge.wrong { color: var(--red); }
.review-options { list-style: none; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.review-options li { padding: 10px 13px; border-radius: 6px; border: 1px solid var(--line); }
.review-options .correct { background: #edf6ef; border-color: #aac6b2; color: #24543a; }
.review-options .wrong { background: #fdf0ee; border-color: #dfb7b0; color: var(--red); }
.option-tag { display: inline-block; font-size: 11px; margin-left: 8px; font-weight: 700; }
.explanation { margin: 19px 0 0; border-top: 1px solid var(--line); padding-top: 15px; font-size: 14px; }
.explanation strong { color: var(--gold); margin-right: 8px; }
.reference { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
footer { margin-top: 48px !important; padding-top: 22px !important; padding-bottom: 30px !important; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
footer p { margin: 3px 0; }
footer a { margin-left: 8px; }
@media (max-width: 780px) { .workspace { grid-template-columns: 1fr; } .map-buttons { grid-template-columns: repeat(10, 1fr); } .intro { grid-template-columns: 1fr; padding: 28px; } .intro-number { display: none; } .category-scores { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .back-links { font-size: 12px; } .title-row { align-items: flex-start; } .edition { display: none; } .ai-notice { padding: 13px 15px; } .intro { padding: 24px; } .intro h2 { font-size: 25px; } .question-card, .review { padding: 22px 18px; } legend { font-size: 18px; } .option { padding: 13px 11px; gap: 9px; } .map-buttons { grid-template-columns: repeat(5, 1fr); } .score-card { padding: 23px; flex-direction: column; align-items: flex-start; gap: 8px; } .score-card h2 { font-size: 22px; } .review-toolbar { align-items: flex-start; flex-direction: column; } .category-score { font-size: 13px; padding: 11px; } .progress-row { align-items: end; } .progress-row .small { max-width: 125px; text-align: right; } .submit-row .small { max-width: 160px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.difficulty-picker { border: 0; padding: 0; margin: 22px 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; min-width: 0; }
.difficulty-picker legend { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.difficulty-picker label { display: flex; align-items: center; gap: 12px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.difficulty-picker label:has(input:checked) { border-color: var(--navy); background: var(--gold-bg); }
.difficulty-picker input { accent-color: var(--navy); }
.difficulty-picker strong, .difficulty-picker small { display: block; }
.difficulty-picker small { color: var(--muted); }
@media (max-width: 600px) {
  .difficulty-picker label { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 8px; }
  .difficulty-picker input { margin: 0; }
  .difficulty-picker small { font-size: 11px; line-height: 1.5; word-break: keep-all; }
}
.level-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

.intro-number small { font-size: 15px; letter-spacing: 0; margin-left: 8px; color: var(--muted); }

.quiz-login { width: min(440px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 16px; padding: 28px; color: var(--navy); }
.quiz-login::backdrop { background: #11243a66; }
.quiz-login label { display: block; margin: 16px 0; }
.quiz-login input { display: block; width: 100%; margin-top: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
/* 휴대폰: 입력 칸 글자가 16px보다 작으면 iOS가 누를 때 화면을 확대하고 되돌리지 않는다 */
@media (pointer: coarse) { input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea { font-size: 16px !important; } }
