:root {
  --bg: #f3f4f6; --panel: #ffffff; --fg: #1a212d; --fg2: #3a4350; --muted: #66707e; --line: #e1e4e9; --line2: #ccd2da; --soft: #f1f3f6;
  --primary: #2453bd; --primary-2: #1c449f; --primary-soft: #eaf0fc;
  --ok: #11734f; --ok-soft: #e5f3ec; --bad: #b9342a; --bad-soft: #fbeae8; --warn: #95560a; --warn-soft: #fcf2df;
  --strip: #1b222e;
  --sans: "Pretendard", -apple-system, BlinkMacSystemFont, "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --paper: "Noto Serif KR", "Batang", "바탕", "AppleMyungjo", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 14.5px/1.55 var(--sans); -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere; }
body.modal-open { overflow: hidden; }
a { color: var(--primary); text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
h1, h2 { margin: 0; }
.muted { color: var(--muted); }
.ic { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.paper-font { font-family: var(--paper); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line2); background: #fff; color: var(--fg); border-radius: 8px; padding: 8px 14px; font-weight: 600; font-size: 14px; line-height: 1.3; white-space: nowrap; text-decoration: none; }
.btn:hover:not(:disabled) { border-color: #aab3bf; background: #fafbfc; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--primary-2); border-color: var(--primary-2); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--fg2); }
.btn.ghost:hover:not(:disabled) { background: var(--soft); border-color: transparent; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 7px; }
.btn.block { display: flex; width: 100%; }
.btn:disabled { opacity: .45; }
.link { background: none; border: 0; padding: 0; color: var(--primary); font-size: 13px; font-weight: 600; }
.input { border: 1px solid var(--line2); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; background: #fff; color: var(--fg); min-width: 0; }
.input:focus { outline: 2px solid #b8cbf3; outline-offset: 0; border-color: var(--primary); }
textarea.input { width: 100%; resize: vertical; line-height: 1.75; }
label { font-size: 13px; color: var(--fg2); font-weight: 600; }
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.working { display: inline-flex; align-items: center; gap: 8px; color: var(--primary); font-weight: 600; font-size: 13.5px; }
.empty { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 40px 24px; text-align: center; color: var(--muted); }
.notice { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 9px 14px; font-size: 13.5px; margin: 0 0 14px; }
.notice.sm { font-size: 13px; margin: 8px 0; }

/* ---------- strip and header ---------- */
.strip { display: flex; align-items: center; gap: 16px; background: var(--strip); color: #c9d1dd; font-size: 12.5px; padding: 6px 24px; }
.strip-note { flex: none; }
.strip-links { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.strip-links::-webkit-scrollbar { display: none; }
.strip-links a { color: #e6ebf2; padding: 3px 9px; border-radius: 5px; white-space: nowrap; }
.strip-links a:hover { background: rgba(255, 255, 255, .08); }
.strip-links a.on { background: rgba(255, 255, 255, .14); color: #fff; }
.strip-reset { flex: none; background: transparent; border: 1px solid rgba(255, 255, 255, .28); color: #fff; border-radius: 5px; padding: 3px 10px; font-size: 12.5px; }
.strip-reset:hover { background: rgba(255, 255, 255, .1); }
.top { display: flex; align-items: center; gap: 28px; height: 56px; padding: 0 24px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); }
.brand .mk { width: 30px; height: 30px; fill: none; stroke: var(--primary); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand .mk .pen { fill: #fff; }
.brand span { display: flex; flex-direction: column; line-height: 1.2; }
.brand b { font-size: 15.5px; }
.brand small { font-size: 11.5px; color: var(--muted); }
.top-nav { display: flex; gap: 4px; height: 100%; }
.top-nav a { display: flex; align-items: center; padding: 0 12px; color: var(--fg2); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.top-nav a.on { color: var(--primary); border-bottom-color: var(--primary); }
.who { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg2); }
.who i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; background: #e3e9f5; color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.main { max-width: 1480px; margin: 0 auto; padding: 20px 24px 64px; }

/* ---------- exam header and stepper ---------- */
.exam-head { margin-bottom: 16px; }
.eh-title { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.eh-title h1 { font-size: 21px; letter-spacing: -.01em; }
.eh-title span { color: var(--muted); font-size: 13.5px; }
.stepper { list-style: none; margin: 0; padding: 0; display: flex; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.stepper li { flex: 1 1 0; min-width: 132px; position: relative; }
.stepper li + li::before { content: ""; position: absolute; left: -7px; top: 50%; width: 12px; height: 12px; border-top: 1px solid var(--line2); border-right: 1px solid var(--line2); transform: translateY(-50%) rotate(45deg); background: #fff; z-index: 1; }
.stepper a { display: flex; flex-direction: column; padding: 9px 18px 9px 22px; color: var(--fg2); height: 100%; }
.stepper a:hover { background: #fafbfc; }
.stepper b { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; }
.stepper b .ic { width: 15px; height: 15px; color: var(--ok); stroke-width: 2.4; }
.stepper small { color: var(--muted); font-size: 12.5px; }
.stepper li.cur a { background: var(--primary-soft); color: var(--primary); box-shadow: inset 0 -2px 0 var(--primary); }
.stepper li.cur small { color: var(--primary); }

/* ---------- review (문항 선별) ---------- */
.rv { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.qg { background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 16px; overflow: hidden; }
.qg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; background: #fafbfc; border-bottom: 1px solid var(--line); }
.qg-head div { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.qg-head b { font-size: 15px; }
.qg-head span { color: var(--muted); font-size: 13px; }
.qg-passage { padding: 16px 22px; border-bottom: 1px solid var(--line); background: #fcfcfd; }
.paper-text { font-family: var(--paper); font-size: 15px; line-height: 1.85; color: #1d1d1d; }
.paper-text p { margin: 0 0 10px; }
.paper-text .pa { text-indent: 1em; }
.paper-text .by { text-align: right; color: var(--fg2); }
.paper-text .fig { margin: 8px 0 14px; text-align: center; }
.paper-text .fig-svg { width: 300px; max-width: 100%; color: #222; font-family: var(--paper); }
.paper-text figcaption { font-size: 13px; }
.qc { position: relative; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 4px 12px; padding: 16px 18px 14px 12px; border-bottom: 1px solid var(--line); transition: background .3s; }
.qc:last-child { border-bottom: 0; }
.qc.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { background: #e3ecfd; } 100% { background: #fff; } }
.qc-no { font-family: var(--paper); font-size: 19px; font-weight: 700; text-align: center; color: var(--fg); padding-top: 1px; }
.qc-no span { display: inline-block; font-family: var(--sans); font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--soft); border-radius: 4px; padding: 1px 5px; }
.qc.is-ex .qc-body { opacity: .42; }
.qc.is-ex .qc-ch li.ans { color: inherit; }
.qc-stem { font-family: var(--paper); font-size: 15.5px; font-weight: 600; margin: 0 0 8px; line-height: 1.6; }
.qc-stem u, .bk-stem u { text-underline-offset: 3px; }
.bogi.ui { position: relative; border: 1px solid #b9c0ca; border-radius: 4px; padding: 14px 14px 10px; margin: 14px 0 10px; font-family: var(--paper); font-size: 14px; line-height: 1.75; }
.bogi.ui p { margin: 0; }
.bogi.ui .bogi-t { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: #fff; padding: 0 8px; font-size: 13px; color: var(--fg2); }
.qc-ch { list-style: none; margin: 0; padding: 0; font-family: var(--paper); font-size: 14.5px; line-height: 1.6; }
.qc-ch li { display: flex; gap: 6px; padding: 2px 0; }
.qc-ch .n { flex: none; width: 1.3em; }
.qc-ch li.ans { color: var(--ok); font-weight: 600; }
.qc-ch em { flex: none; align-self: center; font-style: normal; font-family: var(--sans); font-size: 11px; font-weight: 700; color: var(--ok); border: 1px solid #a9d6c2; border-radius: 4px; padding: 0 5px; margin-left: 2px; }
.qc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.vf { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-weight: 600; }
.vf .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.vf.fixed { color: var(--warn); }
.qc-act { display: flex; flex-direction: column; gap: 6px; align-items: stretch; min-width: 92px; }
.qc-busy { position: absolute; inset: 0; background: rgba(255, 255, 255, .86); display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--primary); font-weight: 600; font-size: 14px; }
.qc-exp { margin-top: 10px; padding: 12px 14px; background: #f8f9fb; border-radius: 8px; font-size: 13.5px; line-height: 1.7; }
.qc-exp p { margin: 0 0 5px; }
.qc-exp .ex-h { display: flex; gap: 8px; align-items: baseline; font-weight: 700; }
.qc-exp .ex-h span { font-weight: 400; color: var(--muted); font-size: 12px; }
.qc-exp .ex-a b { font-size: 12px; color: var(--ok); margin-right: 4px; }
.qc-exp .ex-w { padding-left: 1.4em; text-indent: -1.4em; color: var(--fg2); }
.qc-exp .chk { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line2); color: var(--muted); font-size: 12.5px; }
.draft { margin-top: 10px; border: 1px solid #f0d6a8; background: #fffaf0; border-radius: 8px; padding: 10px 14px; }
.draft-h { font-size: 12.5px; font-weight: 700; color: var(--warn); margin-bottom: 6px; }
.draft .qc-ch li.same { color: var(--muted); font-weight: 400; }
.draft .qc-ch li.del s { color: var(--bad); text-decoration-thickness: 1px; }
.draft .qc-ch li.del ins { color: var(--ok); text-decoration: none; font-weight: 600; }
.draft-why { margin: 8px 0 0; font-size: 13px; color: var(--fg2); }

.rv-side { position: sticky; top: 14px; display: flex; flex-direction: column; gap: 12px; }
.sp { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.sp-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-size: 13.5px; }
.sp-h span { color: var(--muted); font-size: 12.5px; }
.sp-h a { font-size: 12.5px; font-weight: 600; }
.mini { display: block; position: relative; background: #e9ecf0; border-radius: 6px; padding: 12px 12px 0; height: 300px; overflow: hidden; }
.mini::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; background: linear-gradient(rgba(233, 236, 240, 0), #e9ecf0); }
.mini .sheet-box { margin: 0 auto; }
.sp-note { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.dist { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; text-align: center; }
.d-col { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.d-bar { width: 26px; height: 58px; background: var(--soft); border-radius: 4px; display: flex; align-items: flex-end; overflow: hidden; }
.d-bar i { display: block; width: 100%; background: #8fa9dd; border-radius: 4px 4px 0 0; transition: height .3s; }
.d-col b { font-size: 15px; }
.d-col small { font-family: var(--paper); font-size: 14px; color: var(--fg2); }
.d-col.warn .d-bar i { background: #e0a54d; }
.d-col.warn b { color: var(--warn); }
.sp-ok { display: flex; gap: 6px; align-items: flex-start; margin: 10px 0 0; font-size: 12.5px; color: var(--ok); }
.sp-ok .ic { width: 15px; height: 15px; stroke-width: 2.4; margin-top: 1px; }
.sp-warn { margin: 10px 0 8px; font-size: 12.5px; color: var(--warn); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.kv a { font-size: 12.5px; font-weight: 600; margin-left: 4px; }

/* ---------- passages (지문 입력) ---------- */
.ps { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.ps-left { display: flex; flex-direction: column; gap: 12px; }
.paste { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; border: 1.5px dashed #a9b5c6; border-radius: 10px; background: #fff; padding: 16px; cursor: text; }
.paste:focus { outline: none; border-color: var(--primary); background: #f7f9fe; }
.paste > b { font-size: 15px; }
.paste > span { font-size: 13px; color: var(--fg2); }
.paste .paste-tip { color: var(--muted); font-size: 12.5px; }
.paste .btn { margin-top: 6px; }
.paste.busy { cursor: progress; border-style: solid; border-color: #b9c9ea; }
.ocr { display: flex; gap: 12px; width: 100%; align-items: center; }
.ocr img { width: 54px; height: 70px; object-fit: cover; object-position: top; border: 1px solid var(--line2); border-radius: 4px; background: #fff; flex: none; }
.ocr img + img { margin-left: -36px; box-shadow: -2px 0 6px rgba(0, 0, 0, .12); }
.ocr-txt { flex: 1; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.bar { height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--primary); transition: width .3s; }
.pl-head { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 2px 0; font-size: 13.5px; }
.pl-head span { color: var(--muted); }
.pl { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pl-item { display: flex; gap: 12px; align-items: flex-start; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 12px 14px; }
.pl-item:last-child { border-bottom: 0; }
.pl-item:hover { background: #fafbfc; }
.pl-item.on { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.pl-ic { color: var(--muted); padding-top: 2px; }
.pl-item.on .pl-ic { color: var(--primary); }
.pl-main { display: flex; flex-direction: column; min-width: 0; }
.pl-main b { font-size: 14.5px; }
.pl-main small { color: var(--muted); font-size: 12.5px; }
.pad { padding: 16px; margin: 0; }
.pe { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }
.pe-fields { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.pe-fields label, .frow label, .modal-body > label { display: flex; flex-direction: column; gap: 5px; }
.pe-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.pe-grid.with-cap { grid-template-columns: minmax(0, .8fr) minmax(0, 1fr); }
.pe-cap { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.pe-cap figcaption, .pe-label span { font-size: 13px; font-weight: 600; color: var(--fg2); }
.pe-cap small { color: var(--muted); font-size: 12.5px; }
.cap-btn { border: 1px solid var(--line2); border-radius: 6px; padding: 0; background: #fff; overflow: hidden; max-height: 560px; overflow-y: auto; cursor: zoom-in; }
.cap-btn img { display: block; width: 100%; }
.pe-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.pe-label small { color: var(--muted); font-size: 12px; }
.pe-text textarea { font-family: var(--paper); font-size: 14.5px; }
.pe-fig { display: flex; gap: 14px; align-items: center; margin-top: 12px; padding: 12px; background: #f8f9fb; border-radius: 8px; }
.pe-fig-img { flex: none; width: 190px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 6px; }
.pe-fig-img .fig-svg { width: 100%; display: block; color: #222; font-family: var(--paper); }
.pe-fig div:last-child { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--fg2); }
.pe-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 12.5px; }

/* ---------- plan ---------- */
.plan { display: grid; grid-template-columns: minmax(0, 500px) minmax(0, 1fr); gap: 20px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }
.panel-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.panel-h h2 { font-size: 16px; }
.panel-h .muted { font-size: 12.5px; }
.panel-h + .frow { margin-bottom: 22px; }
.frow { display: flex; gap: 12px; flex-wrap: wrap; }
.frow label { min-width: 0; }
.frow .grow, .grow { flex: 1; }
.tbl-wrap { overflow-x: auto; }
table { border-collapse: collapse; }
.cnt-tbl { width: 100%; font-size: 14px; }
.cnt-tbl th, .cnt-tbl td { padding: 9px 6px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.cnt-tbl tbody th { white-space: normal; min-width: 110px; }
.cnt-tbl thead th { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.cnt-tbl tbody th { text-align: left; font-weight: 400; }
.cnt-tbl tbody th b { display: block; font-size: 14px; }
.cnt-tbl tbody th small { color: var(--muted); font-size: 12px; }
.cnt-tbl tfoot th { text-align: left; color: var(--muted); font-weight: 600; }
.cnt-tbl tfoot td, .cnt-tbl .sum { font-weight: 700; }
.stepper-n { display: inline-flex; align-items: center; border: 1px solid var(--line2); border-radius: 7px; overflow: hidden; }
.stepper-n button { width: 28px; height: 30px; border: 0; background: var(--soft); font-size: 16px; line-height: 1; }
.stepper-n button:hover { background: #e4e8ee; }
.stepper-n b { width: 28px; text-align: center; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-weight: 400; cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--primary); flex: none; }
.check span { display: flex; flex-direction: column; }
.check b { font-size: 14px; color: var(--fg); }
.check small { color: var(--muted); font-size: 12.5px; }
.check.sm { margin-top: 8px; font-size: 13.5px; color: var(--fg); }
.panel-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.plan-res.is-empty { padding: 0; border: 0; background: none; }
.plan-sum { margin: 0 0 10px; font-size: 14px; }
.plan-sum b { font-size: 16px; }
.notes { display: flex; flex-direction: column; gap: 6px; background: #f8f9fb; border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.notes p { margin: 0; font-size: 13.5px; color: var(--fg2); line-height: 1.6; }
.notes b { color: var(--fg); margin-right: 6px; }
.plan-tbl, .gen-tbl { width: 100%; font-size: 13.5px; }
.plan-tbl th, .plan-tbl td, .gen-tbl th, .gen-tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.plan-tbl thead th, .gen-tbl thead th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafbfc; }
.plan-tbl td.num { font-family: var(--paper); font-size: 15px; font-weight: 700; color: var(--ok); }
.types { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }

/* ---------- generate ---------- */
.gen-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 18px; margin-bottom: 16px; }
.gen-bar > div:first-child { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.gen-bar b { font-size: 15.5px; }
.gen-bar span { color: var(--muted); font-size: 13px; }
.gen-bar-act { display: flex; gap: 8px; }
.gen { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.gen-rows { padding: 6px 8px; }
.gen-tbl tr.bad td { background: var(--bad-soft); }
.s { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; }
.s .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.s.wait { color: #a1a9b4; font-weight: 400; }
.s.ok { color: var(--ok); }
.s.kj { color: #6b4bb8; }
.s.redo { color: var(--warn); }
.s.bad { color: var(--bad); }
.s.run { color: var(--primary); }
.gen-log { display: flex; flex-direction: column; }
.log { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow-y: auto; font-size: 13px; }
.log li { display: grid; grid-template-columns: 40px 38px minmax(0, 1fr); gap: 8px; padding: 6px 0; border-bottom: 1px solid #eef0f3; line-height: 1.55; }
.log time { color: #9aa2ad; font-variant-numeric: tabular-nums; font-size: 12px; padding-top: 1px; }
.log b { font-size: 12px; padding-top: 1px; }
.lg-plan b, .lg-sys b { color: var(--fg2); }
.lg-gen b { color: var(--primary); }
.lg-bank b { color: #6b4bb8; }
.lg-chk b { color: var(--ok); }
.log li.bad { background: var(--bad-soft); margin: 0 -8px; padding: 6px 8px; border-radius: 6px; }
.log li.bad b, .log li.bad span { color: var(--bad); }
.fixbox { margin-top: 16px; }
.fixbox .qc-stem { margin-top: 4px; }

/* ---------- print preview ---------- */
.ptb { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; }
.ptb-fields { display: flex; gap: 10px; flex: 1; flex-wrap: wrap; min-width: 0; }
.ptb-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.ptb-fields .input { padding: 6px 9px; font-size: 13.5px; }
.ptb-act { display: flex; align-items: center; gap: 12px; }
.ptb-act .muted { font-size: 12.5px; }
.print-hint { font-size: 13px; color: var(--muted); margin: 6px 2px 14px; }
.print-root { display: flex; flex-direction: column; align-items: center; gap: 18px; background: #e6e9ee; border-radius: 10px; padding: 24px 0; }
.sheet-box { width: calc(210mm * var(--s, 1)); height: calc(297mm * var(--s, 1)); overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 6px 18px rgba(16, 24, 40, .1); flex: none; }
.sheet-box > .sheet { transform: scale(var(--s, 1)); transform-origin: 0 0; }
.measure { position: absolute; left: -99999px; top: 0; visibility: hidden; pointer-events: none; }

/* ---------- paper (A4) ---------- */
.sheet { width: 210mm; height: 297mm; padding: 12mm 12.5mm 9mm; display: flex; flex-direction: column; background: #fff; color: #111; font-family: var(--paper); font-size: 9.2pt; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; text-align: left; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sheet p { margin: 0; }
.sheet u { text-underline-offset: 2px; text-decoration-thickness: .6px; }
.sheet sub, .paper-text sub, .qc sub, .bk-item sub { font-size: 72%; line-height: 0; vertical-align: -.25em; }
.sh-head { flex: none; font-family: var(--sans); }
.sh-head.run { display: flex; justify-content: space-between; gap: 6mm; font-size: 7.6pt; color: #222; border-bottom: .25mm solid #111; padding-bottom: 1.4mm; margin-bottom: 4.5mm; }
.sh-head.first { margin-bottom: 4mm; }
.hd-top { display: flex; justify-content: space-between; font-size: 8pt; padding-bottom: 1.6mm; border-bottom: .25mm solid #111; }
.hd-title { text-align: center; padding: 3mm 0 2.4mm; font-family: var(--paper); }
.hd-title small { display: block; font-size: 9.5pt; letter-spacing: .04em; margin-bottom: .6mm; }
.hd-title strong { display: block; font-size: 20pt; font-weight: 700; letter-spacing: .28em; padding-left: .28em; line-height: 1.25; }
.hd-meta { display: flex; align-items: center; gap: 5mm; border-top: .25mm solid #111; border-bottom: 1mm double #111; padding: 1.5mm 0; font-size: 8.4pt; }
.hd-meta > span:first-child { margin-right: auto; }
.hd-box { display: inline-flex; align-items: center; gap: 2mm; }
.hd-box i { display: inline-block; width: 30mm; height: 5.6mm; border: .25mm solid #111; }
.hd-box i.s { width: 14mm; }
.sh-body { flex: 1 1 auto; min-height: 0; display: flex; }
.sh-col { flex: 1 1 0; min-width: 0; height: 100%; overflow: hidden; }
.c2 .sh-col:first-child { padding-right: 4.6mm; border-right: .25mm solid #111; }
.c2 .sh-col:last-child { padding-left: 4.6mm; }
.sh-foot { flex: none; text-align: center; font-family: var(--sans); font-size: 7.6pt; padding-top: 2.6mm; color: #333; }
.sh-foot span { display: inline-block; min-width: 6mm; border: .25mm solid #111; padding: 0 1.4mm; margin-right: .6mm; font-weight: 700; color: #111; }
.blk { padding-bottom: 5mm; }
.b-passage { padding-bottom: 4mm; }
.b-q { padding-bottom: 5.6mm; }
.b-exp { padding-bottom: 3.8mm; font-size: 8.5pt; line-height: 1.58; }
.b-exp.cont { padding-top: 0; }
.b-m { padding-bottom: 4.5mm; font-size: 9.8pt; line-height: 1.72; }
.g-head { font-weight: 700; margin-bottom: 1.8mm !important; }
.pbox { border: .25mm solid #111; padding: 3mm 3.6mm; }
.pbox.cont { border-top: .25mm dashed #777; }
.pbox .st { margin-bottom: 2.4mm; }
.st .ln { display: block; padding-left: 1em; text-indent: -1em; }
.pbox .st:last-child, .pbox .pa:last-child { margin-bottom: 0; }
.pbox .pa { text-indent: 1em; text-align: justify; text-justify: inter-character; margin-bottom: 1.1mm; }

.nw { white-space: nowrap; }
.pbox .by { text-align: right; margin-top: 1.6mm; font-size: 8.8pt; }
.fig { margin: 2.4mm 0 2.8mm; text-align: center; }
.sheet .fig-svg { width: 60mm; height: auto; color: #111; font-family: var(--paper); }
.fig figcaption { font-size: 8.4pt; margin-top: .4mm; }
.q-stem { padding-left: 1.6em; text-indent: -1.6em; margin-bottom: 1.8mm !important; }
.q-stem b { font-weight: 700; }
.bogi { position: relative; border: .25mm solid #111; padding: 3.2mm 3.2mm 2.4mm; margin: 2.9mm 0 2.2mm; font-size: 8.9pt; line-height: 1.6; }
.bogi-t { position: absolute; top: -2.3mm; left: 50%; transform: translateX(-50%); background: #fff; padding: 0 2mm; font-size: 8.6pt; line-height: 1.5; white-space: nowrap; }
.chs { list-style: none; margin: 0; padding: 0; }
.chs li { padding-left: 1.38em; text-indent: -1.38em; margin-bottom: .7mm; }
.ans-title { font-family: var(--paper); font-size: 15pt; font-weight: 700; text-align: center; letter-spacing: .3em; padding-left: .3em; margin: 0 0 3mm; }
.ans-grid { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 8.4pt; text-align: center; margin-bottom: 5mm; table-layout: fixed; }
.ans-grid th, .ans-grid td { border: .25mm solid #111; padding: 1.1mm 0; }
.ans-grid th { width: 13mm; background: #f0f0f0; font-weight: 600; }
.ans-grid td.a { font-family: var(--paper); font-size: 10pt; font-weight: 700; }
.ex-h { display: flex; align-items: baseline; gap: 2mm; border-bottom: .2mm solid #111; padding-bottom: .8mm; margin-bottom: 1.2mm !important; font-weight: 700; font-size: 9pt; }
.ex-h span { margin-left: auto; font-weight: 400; font-size: 7.2pt; color: #444; font-family: var(--sans); white-space: nowrap; }
.ex-a { margin-bottom: 1mm !important; }
.sheet .ex-a b { font-family: var(--sans); font-size: 7.4pt; border: .2mm solid #111; padding: 0 1mm; margin-right: 1mm; font-weight: 600; }
.ex-w { padding-left: 1.3em; text-indent: -1.3em; margin-bottom: .5mm !important; color: #222; }
/* class materials */
.m-first { margin-bottom: 3mm; }
.m-title { text-align: center; padding: 4mm 0 3.6mm; font-family: var(--paper); border-bottom: 1mm double #111; }
.m-title small { display: block; font-size: 9pt; letter-spacing: .25em; padding-left: .25em; font-family: var(--sans); }
.m-title strong { display: block; font-size: 19pt; letter-spacing: .04em; line-height: 1.35; }
.m-title span { display: block; font-size: 8.6pt; color: #333; font-family: var(--sans); margin-top: .8mm; }
.m-first .hd-meta { border-top: 0; border-bottom: .25mm solid #111; justify-content: flex-end; }
.m-first .hd-meta > span:first-child { margin-right: 0; }
.m-h { font-family: var(--sans); font-size: 10.5pt; font-weight: 700; border-bottom: .3mm solid #111; padding-bottom: 1mm; margin: 1.6mm 0 2.6mm; }
.m-tbl { width: 100%; border-collapse: collapse; font-size: 9pt; line-height: 1.55; }
.m-tbl th, .m-tbl td { border: .25mm solid #444; padding: 1.6mm 2.4mm; text-align: left; vertical-align: top; }
.m-tbl th { background: #f1f1f1; font-family: var(--sans); font-weight: 600; font-size: 8.6pt; }
.m-tbl.kv th { width: 22mm; }
.m-tbl .c { text-align: center; width: 14mm; }
.m-tbl.tall td { height: 11mm; }
.m-p { margin-bottom: 2mm !important; }
.m-p b, .m-dl b { font-family: var(--sans); font-size: 8.8pt; margin-right: 2mm; }
.m-dl { margin-bottom: 1.6mm !important; padding-left: 32mm; text-indent: -32mm; }
.m-dl b { display: inline-block; width: 30mm; text-indent: 0; margin-right: 2mm; }
.m-ask { margin-bottom: 2.6mm; }
.m-ask b { font-family: var(--sans); font-size: 8.8pt; }
.m-ans { color: #333; padding-left: 3mm; border-left: .6mm solid #999; margin: 1mm 0 0 1mm !important; font-size: 9pt; }
.m-note { font-family: var(--sans); font-size: 8.2pt; color: #333; margin-bottom: 1.6mm !important; }
.m-blank { margin-bottom: 2.6mm !important; line-height: 2.1; }
.blank { display: inline-block; min-width: 20mm; border-bottom: .25mm solid #111; line-height: 1.3; text-align: center; padding: 0 1mm; }
.blank.fill { font-weight: 700; }
.m-memo { display: grid; grid-template-columns: minmax(0, 1fr) 46mm; gap: 4mm; }
.memo { border: .25mm dashed #888; position: relative; min-height: 30mm; }
.memo span { position: absolute; top: 1.4mm; left: 2mm; font-size: 7.6pt; color: #666; font-family: var(--sans); }
.m-think { margin-bottom: 3.4mm; }
.lines i { display: block; height: 8.5mm; border-bottom: .25mm solid #999; }
.m-key { margin: 0 0 2mm; padding-left: 5mm; }
.m-key li { margin-bottom: .8mm; }

/* ---------- bank ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 14px; }
.page-head h1 { font-size: 21px; }
.page-head span { color: var(--muted); font-size: 13.5px; }
.page-head > div { display: flex; flex-direction: column; gap: 2px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filters .input { padding: 7px 10px; font-size: 13.5px; }
.filters .grow { min-width: 200px; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: #fff; padding: 6px 12px; font-size: 13.5px; color: var(--fg2); }
.seg button + button { border-left: 1px solid var(--line2); }
.seg button.on { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.seg.wide { display: flex; }
.seg.wide button { flex: 1; }
.bank { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 80px; }
.bk-row { display: grid; grid-template-columns: 40px 150px minmax(0, 1fr) 120px 58px 190px 44px; gap: 10px; align-items: center; padding: 10px 14px; font-size: 13.5px; }
.bk-hd { background: #fafbfc; color: var(--muted); font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--line); }
.bk-item { border-bottom: 1px solid var(--line); }
.bk-item:last-child { border-bottom: 0; }
.bk-item .bk-row { cursor: pointer; }
.bk-item .bk-row:hover { background: #fafbfc; }
.bk-item.open .bk-row { background: #f6f8fc; }
.bk-chk { display: flex; justify-content: center; padding: 4px; cursor: pointer; }
.bk-chk input { width: 16px; height: 16px; accent-color: var(--primary); }
.bk-p { display: flex; flex-direction: column; min-width: 0; }
.bk-p small, .bk-src small { color: var(--muted); font-size: 12px; }
.bk-stem { font-family: var(--paper); font-size: 14px; }
.bk-type { color: var(--fg2); font-size: 13px; }
.bk-diff { font-weight: 700; text-align: center; }
.d-상 { color: #a33a2c; } .d-중 { color: #8a5b00; } .d-하 { color: #2b6a4f; }
.bk-src { display: flex; flex-direction: column; }
.bk-src b { font-size: 12.5px; }
.bk-src b.kj { color: #6b4bb8; }
.bk-src b.gn { color: var(--primary); }
.bk-ans { font-family: var(--paper); font-size: 16px; font-weight: 700; color: var(--ok); text-align: center; }
.bk-detail { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 4px 24px 18px 64px; background: #f6f8fc; }
.bk-detail .bogi.ui { background: #fff; }
.bk-detail .bogi.ui .bogi-t { background: #f6f8fc; }
.bk-exp { font-size: 13.5px; color: var(--fg2); margin: 10px 0 0; line-height: 1.7; }
.bk-exp b { color: var(--ok); font-size: 12.5px; margin-right: 4px; }
.bk-side { display: flex; flex-direction: column; gap: 6px; }
.bk-bar { position: fixed; left: 50%; bottom: 18px; transform: translate(-50%, 140%); display: flex; align-items: center; gap: 10px; background: var(--strip); color: #fff; border-radius: 12px; padding: 10px 12px 10px 18px; box-shadow: 0 10px 30px rgba(16, 24, 40, .3); transition: transform .25s; z-index: 20; white-space: nowrap; }
.bk-bar.show { transform: translate(-50%, 0); }
.bk-bar .btn.ghost { color: #c9d1dd; }
.bk-bar .btn.ghost:hover { background: rgba(255, 255, 255, .1); }

/* ---------- materials ---------- */
.mat { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 20px; align-items: start; }
.mat-side { position: sticky; top: 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px 16px 16px; }
.ms-block { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.ms-block:last-child { border-bottom: 0; }
.ms-block.act { gap: 8px; }
.ms-h { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.ms-p { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; text-align: left; border: 1px solid transparent; background: none; border-radius: 7px; padding: 7px 10px; }
.ms-p small { color: var(--muted); font-size: 12px; }
.ms-p.on { background: var(--primary-soft); border-color: #c9d7f5; }
.ms-p.on b { color: var(--primary); }
.ms-p:disabled { opacity: .55; }
.mat-pages .print-hint { margin-top: 0; }

/* ---------- modal, toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(17, 24, 39, .45); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal { background: #fff; border-radius: 12px; width: min(780px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.modal header { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
.modal header h2 { font-size: 17px; }
.modal header span { font-size: 12.5px; color: var(--muted); }
.modal .x { border: 0; background: none; padding: 4px; color: var(--muted); }
.modal-body { padding: 16px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-body small { font-weight: 400; color: var(--muted); }
.modal-body .input { font-weight: 400; }
.modal-body input[name="stem"], .modal-body textarea, .ch-edit .input { font-family: var(--paper); font-size: 14px; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: 13px; font-weight: 600; color: var(--fg2); padding: 0; margin-bottom: 8px; }
.ch-edit { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 8px; margin-bottom: 10px; }
.ch-edit > div { display: flex; flex-direction: column; gap: 4px; }
.ch-edit .why { font-family: var(--sans); font-size: 12.5px; color: var(--fg2); padding: 6px 10px; background: #fafbfc; }
.ans-r { display: flex; align-items: center; gap: 4px; padding-top: 8px; font-family: var(--paper); font-size: 16px; color: var(--fg); cursor: pointer; }
.ans-r input { accent-color: var(--ok); }
.modal footer { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }
.modal footer .muted { margin-right: auto; font-size: 12.5px; }
.lightbox { max-width: min(760px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: 8px; }
.lightbox img { display: block; width: 100%; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--strip); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); z-index: 60; max-width: calc(100vw - 32px); transition: opacity .4s, transform .4s; }
.toast.out { opacity: 0; transform: translate(-50%, 8px); }
body[data-view="bank"] .toast { bottom: 84px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .rv { grid-template-columns: minmax(0, 1fr) 290px; }
  .bk-row { grid-template-columns: 36px 130px minmax(0, 1fr) 104px 48px 160px 36px; }
}
@media (max-width: 1024px) {
  .rv { grid-template-columns: minmax(0, 1fr); }
  .rv-side { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .rv-side > .btn { grid-column: 1 / -1; }
  .plan, .gen { grid-template-columns: minmax(0, 1fr); }
  .ps { grid-template-columns: 300px minmax(0, 1fr); }
  .pe-grid.with-cap { grid-template-columns: minmax(0, 1fr); }
  .cap-btn { max-height: 320px; }
}
@media (max-width: 860px) {
  .strip-note { display: none; }
  .top { gap: 14px; padding: 0 16px; }
  .who { display: none; }
  .top-nav a { padding: 0 8px; }
  .main { padding: 16px 16px 56px; }
  .strip { padding: 6px 16px; gap: 10px; }
  .ps, .mat { grid-template-columns: minmax(0, 1fr); }
  .mat-side { position: static; }
  .pe-fields { grid-template-columns: 1fr 1fr; }
  .pe-fields label:first-child { grid-column: span 2; }
  .bk-hd { display: none; }
  .bk-row { grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-areas: "c p a" "c s s" "c m m"; gap: 4px 10px; padding: 12px; }
  .bk-chk { grid-area: c; align-self: start; padding-top: 2px; }
  .bk-p { grid-area: p; flex-direction: row; gap: 8px; align-items: baseline; }
  .bk-stem { grid-area: s; }
  .bk-ans { grid-area: a; }
  .bk-type, .bk-diff { display: none; }
  .bk-src { grid-area: m; flex-direction: row; gap: 8px; align-items: baseline; flex-wrap: wrap; }
  .bk-detail { grid-template-columns: minmax(0, 1fr); padding: 4px 14px 16px 50px; }
  .bk-side { flex-direction: row; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .brand small { display: none; }
  .brand b { font-size: 14.5px; }
  .brand .mk { width: 26px; height: 26px; }
  .top-nav a { font-size: 13.5px; padding: 0 6px; }
  .eh-title h1, .page-head h1 { font-size: 18px; }
  .stepper li { min-width: 112px; }
  .stepper a { padding: 8px 12px 8px 16px; }
  .qc { grid-template-columns: 30px minmax(0, 1fr); padding: 14px 12px 12px 6px; }
  .qc-no { font-size: 17px; }
  .qc-act { grid-column: 2; flex-direction: row; flex-wrap: wrap; margin-top: 8px; min-width: 0; }
  .qg-head { padding: 10px 12px; }
  .qg-passage { padding: 12px 14px; }
  .rv-side { grid-template-columns: minmax(0, 1fr); }

  .pe { padding: 14px; }
  .pe-fields { grid-template-columns: minmax(0, 1fr); }
  .pe-fields label:first-child { grid-column: auto; }
  .pe-fig { flex-direction: column; align-items: flex-start; }
  .panel { padding: 14px; }
  .frow label { flex: 1 1 120px; }
  .frow .grow { flex-basis: 100%; }
  .cnt-tbl th, .cnt-tbl td { padding: 8px 2px; }
  .cnt-tbl tbody th { min-width: 70px; }
  .stepper-n button { width: 22px; height: 28px; }
  .stepper-n b { width: 20px; }
  .ptb { flex-direction: column; align-items: stretch; }
  .ptb-act { justify-content: space-between; }
  .ptb-fields label { flex: 1 1 130px; }
  .print-root { padding: 12px 0; gap: 10px; border-radius: 8px; }
  .gen-bar-act { width: 100%; }
  .gen-bar-act .btn { flex: 1; }
  .log li { grid-template-columns: 34px 32px minmax(0, 1fr); gap: 6px; }
  .filters > * { flex: 1 1 140px; }
  .filters .seg { flex-basis: 100%; }
  .filters .seg button { flex: 1; padding: 6px 4px; }
  .bk-bar { left: 12px; right: 12px; transform: translateY(140%); justify-content: space-between; padding-left: 14px; }
  .bk-bar.show { transform: translateY(0); }
  .modal-bg { padding: 0; align-items: flex-end; }
  .modal { border-radius: 12px 12px 0 0; max-height: 92vh; }
  .modal footer { flex-wrap: wrap; }
  .modal footer .muted { flex-basis: 100%; }
  .toast { bottom: 16px; }
}

/* ---------- print ---------- */
@page { size: A4; margin: 0; }
@media print {
  html, body { background: #fff !important; }
  .no-print, .strip, .top, .toast, #modal, .print-hint, .page-head, .mat-side, .exam-head { display: none !important; }
  .main { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .mat { display: block !important; }
  .print-root { display: block !important; padding: 0 !important; background: none !important; border-radius: 0 !important; }
  .print-root .sheet-box { width: 210mm !important; height: 297mm !important; margin: 0 !important; box-shadow: none !important; break-after: page; page-break-after: always; }
  .print-root .sheet-box:last-child { break-after: auto; page-break-after: auto; }
  .print-root .sheet-box > .sheet { transform: none !important; }
  .measure { display: none !important; }
}
