/* WiseLit 진단 — 공통 스타일 (학생·교사) */
:root {
  --navy: #14213d; --blue: #1f3a85; --peach: #ffc79a; --wine: #822846;
  --bg: #f4f6fb; --card: #fff; --line: #dfe4ef; --text: #1b2236; --muted: #5d6783;
  --ok: #1d7a4d; --warn: #b86a00; --bad: #b3261e; --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; font-size: 17px; }
h1, h2, h3 { color: var(--navy); line-height: 1.35; margin: 0 0 .5em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: .88rem; }
.wrap { max-width: 860px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(20,33,61,.04); }
.brand { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--navy); color: #fff; }
.brand b { font-size: 1.05rem; letter-spacing: .02em; } .brand span { color: var(--peach); font-size: .9rem; }
.brand .grow { flex: 1; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 10px 20px; border-radius: 12px; border: 1px solid var(--blue); background: var(--blue); color: #fff; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--navy); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--blue); }
.btn.ghost:hover { background: #eef2fb; }
.btn.accent { background: var(--wine); border-color: var(--wine); }
.btn.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
.btn.sm { min-height: 36px; padding: 4px 12px; font-size: .9rem; border-radius: 10px; }
input[type=text], input[type=password], input[type=tel], input[type=number], select, textarea { width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-size: 16px; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid rgba(31,58,133,.3); border-color: var(--blue); }
label.f { display: block; font-weight: 700; margin: 12px 0 4px; color: var(--navy); }
label.f small { font-weight: 400; color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1; min-width: 160px; }
.err { background: #fdecea; color: var(--bad); border-radius: 12px; padding: 10px 14px; margin: 10px 0; }
.note { background: #fff7ee; border: 1px solid var(--peach); color: #5a3a14; border-radius: 12px; padding: 10px 14px; margin: 10px 0; }
.okbox { background: #e9f6ef; color: var(--ok); border-radius: 12px; padding: 10px 14px; margin: 10px 0; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 700; background: #e8ecf6; color: var(--blue); }
.pill.done { background: #e1f3ea; color: var(--ok); } .pill.analyzing { background: #fff0d9; color: var(--warn); }
.pill.in_progress { background: #e5edff; color: var(--blue); } .pill.error { background: #fdecea; color: var(--bad); }
.pill.waiting { background: #eceff5; color: var(--muted); }

/* ---------- 학생 화면 ---------- */
.student .codebox { font-size: 2rem; letter-spacing: .35em; text-align: center; font-weight: 800; padding: 14px; }
.progress { height: 10px; background: #e3e8f4; border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--wine)); transition: width .25s; }
.topbar { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 10px 16px 8px; border-bottom: 1px solid var(--line); }
.topbar .meta { display: flex; justify-content: space-between; font-size: .88rem; color: var(--muted); margin-bottom: 6px; gap: 8px; }
.passage { background: #fbf8f3; border: 1px solid #efe3d2; border-left: 5px solid var(--peach); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.passage h3 { margin-bottom: 8px; } .passage p { margin: 0 0 .7em; white-space: pre-wrap; }
.passage.en p { font-family: Georgia, "Times New Roman", serif; font-size: 1.05em; }
.q { margin-bottom: 20px; padding-bottom: 6px; }
.q .qno { display: inline-block; min-width: 32px; padding: 2px 10px; border-radius: 99px; background: var(--navy); color: #fff; font-weight: 800; margin-right: 6px; text-align: center; }
.q .prompt { font-weight: 700; white-space: pre-wrap; margin: 6px 0 10px; }
.choice { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; padding: 12px 14px; margin-bottom: 8px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; min-height: 48px; }
.choice .mark { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #aab3cc; display: grid; place-items: center; font-weight: 700; font-size: .9rem; color: var(--muted); }
.choice.on { border-color: var(--blue); background: #eef2fb; }
.choice.on .mark { background: var(--blue); border-color: var(--blue); color: #fff; }
.why { margin-top: 8px; }
.why label { display: block; font-weight: 700; font-size: .95rem; margin-bottom: 4px; color: var(--wine); }
.navbar { position: sticky; bottom: 0; background: rgba(244,246,251,.96); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 10px; justify-content: space-between; z-index: 5; }
.navbar .btn { flex: 1; max-width: 260px; }
.chip { font-size: .8rem; color: var(--muted); }
.chip.warn { color: var(--warn); font-weight: 700; }
.timer { font-size: 2.2rem; font-weight: 800; color: var(--navy); text-align: center; font-variant-numeric: tabular-nums; }
.timer.over { color: var(--bad); }
.listenbtn { background: #fff; border: 1.5px solid var(--blue); color: var(--blue); border-radius: 99px; padding: 6px 14px; font-weight: 700; cursor: pointer; min-height: 40px; }
.listenbtn:disabled { opacity: .5; }
.bigplay { display: block; width: 100%; padding: 18px; font-size: 1.2rem; }
.assisted { font-size: 21px; }
.assisted .choice { padding: 16px 16px; font-size: 1.1em; }
.assisted .q .prompt { font-size: 1.15em; }
.modal { position: fixed; inset: 0; background: rgba(20,33,61,.55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal .box { background: #fff; border-radius: 18px; padding: 22px; max-width: 460px; width: 100%; }
.review-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.review-row:last-child { border-bottom: 0; }
.centerbox { max-width: 480px; margin: 8vh auto 0; text-align: center; }
.bigmsg { font-size: 1.4rem; font-weight: 800; color: var(--navy); }

/* ---------- 교사 화면 ---------- */
.tabs { display: flex; gap: 6px; padding: 10px 16px 0; background: var(--navy); overflow-x: auto; }
.tab { padding: 10px 16px; border-radius: 12px 12px 0 0; background: transparent; border: 0; color: #cfd6ea; font-weight: 700; cursor: pointer; white-space: nowrap; }
.tab.on { background: var(--bg); color: var(--navy); }
.teacher .wrap { max-width: 1100px; }
table.t { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.t th, table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.t th { background: #eef2fb; color: var(--navy); font-size: .85rem; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: #f3f6fd; }
.scroll { overflow-x: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } @media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }
.bar { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.bar .lab { width: 130px; font-weight: 700; flex: none; font-size: .95rem; }
.bar .track { flex: 1; height: 18px; background: #e6eaf4; border-radius: 99px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--blue); border-radius: 99px; }
.bar .fill.mid { background: #d29a2c; } .bar .fill.low { background: var(--wine); }
.bar .val { width: 120px; flex: none; font-size: .9rem; }
.typecard { background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.typecard h2 { color: #fff; margin: 0 0 4px; } .typecard .looks { color: #e8ecf9; margin: 0; }
.scorebtns { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.scorebtns button { min-width: 38px; min-height: 36px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font-weight: 800; cursor: pointer; }
.scorebtns button.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.scorebtns button.ai { border-color: var(--peach); background: #fff7ee; }
.item { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.item .hd { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
.item .hd b { color: var(--navy); }
.kv { font-size: .92rem; margin: 3px 0; } .kv i { font-style: normal; color: var(--muted); display: inline-block; min-width: 72px; }
.kv .val { white-space: pre-wrap; }
.passbox { display: inline-block; min-width: 34px; text-align: center; padding: 1px 6px; border-radius: 8px; font-weight: 700; font-size: .85rem; }
.passbox.y { background: #e1f3ea; color: var(--ok); } .passbox.n { background: #fdecea; color: var(--bad); } .passbox.p { background: #eceff5; color: var(--muted); }
.qrbox { background: #fff; padding: 12px; display: inline-block; border: 1px solid var(--line); border-radius: 12px; }
.bigcode { font-size: 2.6rem; font-weight: 800; letter-spacing: .25em; color: var(--navy); }
.flag { font-size: .8rem; color: var(--warn); font-weight: 700; }

/* ---------- 인쇄용 결과지 ---------- */
#printSheet { display: none; }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 11.5pt; }
  body > *:not(#printSheet) { display: none !important; }
  #printSheet { display: block !important; }
  .brand, .tabs, .navbar { display: none !important; }
}
#printSheet .ps-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 3px solid var(--navy); padding-bottom: 6px; margin-bottom: 10px; }
#printSheet h1 { font-size: 20pt; margin: 0; } #printSheet h2 { font-size: 13pt; margin: 14px 0 6px; border-left: 5px solid var(--peach); padding-left: 8px; }
#printSheet table { width: 100%; border-collapse: collapse; font-size: 10.5pt; }
#printSheet th, #printSheet td { border: 1px solid #aab; padding: 5px 7px; text-align: left; vertical-align: top; }
#printSheet th { background: #eef1f8; }
#printSheet .ps-type { background: #f4f1ec; border: 1px solid #d9c9b3; border-radius: 8px; padding: 8px 12px; }
#printSheet .bar .track { height: 14px; border: 1px solid #aab; background: #fff; }
#printSheet .bar .fill { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
#printSheet .ps-foot { margin-top: 14px; border-top: 1px solid #aab; padding-top: 6px; font-size: 10pt; }
#printSheet tr { break-inside: avoid; }

/* v2: 시험 구성 체크박스, 반 설정 학년 체크, 쉬는 화면 */
.checks { display: grid; gap: 8px; margin-top: 6px; }
.checks label, .gchk { display: flex; gap: 8px; align-items: center; font-weight: 600; cursor: pointer; }
.checks input[type=checkbox], .gchk input[type=checkbox] { width: 20px; height: 20px; min-height: 0; flex: none; }
.checks input[type=checkbox]:disabled + * , .checks label[style*="opacity"] { cursor: not-allowed; }
.item .hd .pill { margin-left: 8px; }
@media (max-width: 700px) { .scroll table.t { font-size: .88rem; } }
