@font-face { font-family: 'GmarketSans'; src: url('/static/fonts/GmarketSansLight.woff2') format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'GmarketSans'; src: url('/static/fonts/GmarketSansMedium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'GmarketSans'; src: url('/static/fonts/GmarketSansBold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --ink: #17181c; --paper: #eeebe3; --dot: #d3cebf; --lime: #c9f03a; --lime-d: #a9cf1c;
  --gray: #66635b; --line: #c9c4b6; --white: #fffdf8; --warn: #b3261e;
  --font: 'GmarketSans', 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-weight: 500; color: var(--ink); line-height: 1.55;
  background: var(--paper) radial-gradient(var(--dot) 1px, transparent 1.2px) 0 0 / 22px 22px;
  min-height: 100vh; word-break: keep-all; overflow-wrap: anywhere;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* ---------- 공통 머리 ---------- */
.top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 15px; }
.stage { font-weight: 700; color: var(--ink); letter-spacing: .02em; }
.stage b { background: var(--lime); padding: 0 6px; }
.muted { color: var(--gray); font-weight: 500; }

.wrap { max-width: 760px; margin: 0 auto; padding: 20px 18px 120px; }

/* 진행 막대 — 시안의 상단 탭과 같은 결 */
.steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 18px 0 8px; }
.steps span { border-top: 4px solid var(--line); padding-top: 6px; font-size: 13px; color: var(--gray); text-align: center; white-space: nowrap; }
.steps span.done { border-color: var(--ink); color: var(--ink); }
.steps span.now { border-color: var(--ink); color: var(--ink); font-weight: 700; position: relative; }
.steps span.now::before { content: ''; position: absolute; left: 0; top: -4px; width: 14px; height: 4px; background: var(--lime); }
.count { font-size: 13px; color: var(--gray); text-align: right; }

h1 { font-weight: 700; font-size: clamp(28px, 6vw, 40px); line-height: 1.2; margin: 14px 0 6px; letter-spacing: -.01em; }
h1 .hl { background: var(--lime); padding: 0 .18em; box-shadow: 4px 0 0 var(--ink); }
.lead { font-size: 17px; margin: 0 0 18px; }

.tag { display: inline-block; background: var(--lime); border: 2px solid var(--ink); font-weight: 700; padding: 2px 10px; font-size: 14px; }
.band { background: var(--ink); color: var(--white); padding: 12px 16px; font-size: 15px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.band b { color: var(--lime); }

/* ---------- 문항 카드 ---------- */
.q { background: var(--white); border: 2px solid var(--ink); padding: 18px 16px 16px; margin: 0 0 14px; }
.q.missing { box-shadow: 0 0 0 4px var(--lime); }
.q .ql { font-weight: 700; font-size: 18px; margin: 0 0 12px; display: flex; gap: 10px; }
.q .qn { flex: none; font-size: 13px; background: var(--ink); color: var(--lime); padding: 2px 7px; height: fit-content; margin-top: 2px; }
.q .req { color: var(--gray); font-weight: 300; font-size: 13px; }
.q .miss-msg { color: var(--ink); background: var(--lime); font-size: 14px; padding: 4px 8px; margin-top: 10px; display: inline-block; font-weight: 700; }

.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt {
  min-height: 52px; padding: 10px 16px; border: 2px solid var(--ink); background: var(--white);
  font-size: 16px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; text-align: left;
}
.opt::before { content: ''; width: 18px; height: 18px; border: 2px solid var(--ink); flex: none; background: var(--white); }
.opt.radio::before { border-radius: 50%; }
.opt[aria-pressed='true'], .opt[aria-checked='true'] { background: var(--lime); font-weight: 700; }
.opt[aria-pressed='true']::before, .opt[aria-checked='true']::before { background: var(--ink); box-shadow: inset 0 0 0 3px var(--lime); }
.opt:hover { box-shadow: 3px 3px 0 var(--ink); }
.etc { margin-top: 10px; width: 100%; max-width: 360px; min-height: 48px; border: 2px solid var(--ink); padding: 8px 12px; background: var(--white); font-size: 16px; }

/* ○ △ ✕ */
.otx { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.otx .opt { justify-content: center; flex-direction: column; gap: 2px; padding: 8px 4px; font-size: 14px; }
.otx .opt::before { display: none; }
.otx .mk { font-size: 24px; font-weight: 700; line-height: 1; }

/* 1~5 */
.scale5 { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.scale5 .opt { width: 56px; height: 56px; border-radius: 50%; justify-content: center; font-size: 20px; font-weight: 700; padding: 0; }
.scale5 .opt::before { display: none; }
.scale5 .ends { width: 100%; display: flex; justify-content: space-between; max-width: 330px; font-size: 13px; color: var(--gray); }

/* O X */
.ox { display: flex; gap: 12px; }
.ox .opt { width: 72px; height: 72px; border-radius: 50%; justify-content: center; font-size: 30px; font-weight: 700; padding: 0; }
.ox .opt::before { display: none; }
.ox .opt.x { border-radius: 4px; }

/* 서술형 */
textarea { width: 100%; min-height: 130px; border: 2px solid var(--ink); background: var(--white); padding: 12px; font-size: 17px; line-height: 1.7;
  background-image: linear-gradient(transparent calc(1.7em - 1px), var(--line) 1px); background-size: 100% 1.7em; background-attachment: local; resize: vertical; }
.counter { text-align: right; font-size: 13px; color: var(--gray); }
.pii { background: var(--ink); color: var(--white); padding: 8px 12px; font-size: 15px; margin-top: 8px; }
.pii b { color: var(--lime); }
.example { border-left: 6px solid var(--lime); padding: 6px 12px; margin: 0 0 12px; background: #f6f4ee; font-size: 15px; }
.example s { color: var(--gray); }

/* 밑줄 과제 */
.passage { background: var(--white); border: 2px dashed var(--ink); padding: 14px; font-size: 18px; line-height: 2.2; }
.passage .meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--gray); line-height: 1.4; margin-bottom: 8px; }
.passage .meta b { color: var(--ink); }
.chunk { display: inline; border: 0; background: none; padding: 3px 2px; margin: 0 1px; font-size: inherit; line-height: inherit; text-align: left;
  border-bottom: 2px dotted var(--line); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.chunk[aria-pressed='true'] { background: var(--lime); border-bottom: 4px solid var(--ink); font-weight: 700; }
.ul-count { font-size: 14px; margin-top: 8px; }

/* ---------- 아래 고정 버튼 ---------- */
.nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--paper); border-top: 2px solid var(--ink); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); z-index: 5; }
.nav .in { max-width: 760px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.nav .saved { font-size: 12px; color: var(--gray); margin-right: auto; }
.btn { min-height: 52px; padding: 0 22px; border: 2px solid var(--ink); background: var(--white); font-weight: 700; font-size: 17px; }
.btn.primary { background: var(--ink); color: var(--lime); }
.btn.lime { background: var(--lime); }
.btn:disabled { opacity: .5; cursor: wait; }
.btn.wide { width: 100%; }

/* ---------- 입장 ---------- */
.field { margin: 0 0 18px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field input[type=text] { width: 100%; max-width: 280px; min-height: 56px; border: 2px solid var(--ink); background: var(--white); padding: 0 14px; font-size: 22px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.numgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; max-width: 460px; }
.numgrid button { min-height: 52px; border: 2px solid var(--ink); background: var(--white); font-size: 18px; font-weight: 700; }
.numgrid button[aria-checked='true'] { background: var(--lime); box-shadow: inset 0 0 0 2px var(--ink); }
.notice { border: 2px solid var(--ink); background: var(--white); padding: 14px 16px; margin: 14px 0; font-size: 16px; }
.notice.dark { background: var(--ink); color: var(--white); }
.notice.dark b { color: var(--lime); }
.error { background: var(--lime); border: 2px solid var(--ink); padding: 10px 14px; font-weight: 700; margin: 10px 0; }

/* ---------- 결과 ---------- */
.result { background: var(--ink); color: var(--white); padding: 26px 22px 22px; margin-top: 12px; }
.result .k { color: var(--lime); font-weight: 700; font-size: 15px; letter-spacing: .04em; }
.result .lv { font-size: clamp(54px, 15vw, 96px); font-weight: 700; line-height: 1.05; margin: 8px 0 2px; }
.result .lv span { background: var(--lime); color: var(--ink); padding: 0 .12em; box-shadow: 8px 0 0 var(--lime), 12px 0 0 var(--ink), 16px 0 0 var(--lime); }
.result .cheer { font-size: 18px; margin: 18px 0 20px; }
.bars { display: grid; grid-template-columns: auto 1fr auto; gap: 10px 12px; align-items: center; }
.bars .nm { font-size: 15px; white-space: nowrap; }
.bars .track { height: 16px; background: #3a3b40; }
.bars .fill { height: 100%; background: #6f6d66; }
.bars .fill.top { background: var(--lime); }
.bars .v { font-size: 13px; color: #b9b6ad; min-width: 3.2em; text-align: right; }
.bars .side { color: #b9b6ad; }
.result .sw { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.result .sw div { border: 2px solid #4a4b50; padding: 10px 12px; font-size: 15px; }
.result .sw b { display: block; color: var(--lime); font-size: 13px; }
.result .fine { color: #b9b6ad; font-size: 13px; margin-top: 16px; }

.review li { margin: 6px 0; }
.review .todo { background: var(--lime); padding: 0 6px; font-weight: 700; }

@media (max-width: 480px) {
  .wrap { padding: 14px 14px 110px; }
  .steps span { font-size: 11px; }
  .q { padding: 14px 12px; }
  .q .ql { font-size: 17px; }
  .opt { font-size: 15px; padding: 8px 12px; }
  .ox .opt { width: 64px; height: 64px; }
  .scale5 .opt { width: 50px; height: 50px; }
  .btn { padding: 0 16px; }
  .result .sw { grid-template-columns: 1fr; }
}

.demo { background: repeating-linear-gradient(-45deg, var(--lime) 0 12px, #e6f7a0 12px 24px); border: 2px solid var(--ink); font-weight: 700; text-align: center; padding: 6px; margin: 0 0 12px; font-size: 14px; }
.lbl { font-weight: 700; margin: 0 0 6px; }
.opts.col { flex-direction: column; align-items: stretch; }
.opts.col .opt { width: 100%; }
.oxhint { align-self: center; font-size: 13px; color: var(--gray); }
.pii-note { font-size: 14px; margin: 0 0 8px; color: var(--ink); }
.pii-note::before { content: '! '; font-weight: 700; background: var(--lime); padding: 0 5px; margin-right: 4px; }
.etc.wide { max-width: none; }
.passage .virtual { color: var(--ink); background: var(--lime); padding: 0 6px; }
.btn.small { min-height: 40px; padding: 0 12px; font-size: 14px; margin-left: 6px; }
.row-btns { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.row-btns .primary { flex: 1; }
#ty { font-size: clamp(34px, 8vw, 52px); }
.qnote { background: var(--lime); border: 2px solid var(--ink); padding: 6px 10px; font-size: 15px; font-weight: 700; margin: 0 0 8px; }
textarea[readonly] { background-color: #e7e4dc; color: #55534d; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--ink); }
a.btn.primary { color: var(--lime); }
