:root{color-scheme:light;--bg:#f5f7fb;--ink:#16273c;--sub:#63758b;--line:#e2e8f0;--navy:#14253b;--blue:#345d92;--surface:#fff;--soft:#f0f4f9;--mint:#e7f5ef;--mint-ink:#21744f;--red:#b33c46;--yellow:#fdf0bd;--radius:13px}*{box-sizing:border-box}body{margin:0;font-family:system-ui,-apple-system,'Malgun Gothic','Apple SD Gothic Neo',sans-serif;background:var(--bg);color:var(--ink);font-size:14px}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}input,select,textarea{border:1px solid #cbd5e2;border-radius:9px;background:#fff;color:#13283f;padding:10px 12px;max-width:100%;outline:none}input:focus,select:focus,textarea:focus{border-color:#507aac;box-shadow:0 0 0 3px #deebf8}textarea{resize:vertical;line-height:1.65}.boot{padding:90px 20px;text-align:center;color:#60748c}.layout{display:grid;grid-template-columns:230px minmax(0,1fr);min-height:100vh}.sidebar{background:var(--navy);color:#eaf0f8;padding:28px 16px;display:flex;flex-direction:column;gap:25px}.brand{padding:4px 9px}.brand h1{margin:0;font-size:19px;letter-spacing:-.5px}.brand small{display:block;color:#9daec3;margin-top:7px;font-size:11px}.nav{display:grid;gap:7px}.nav button{display:block;width:100%;border:0;background:transparent;text-align:left;color:#b9c7d8;padding:12px 13px;border-radius:10px}.nav button.active,.nav button:hover{background:#2b415d;color:white}.sidebar-foot{margin-top:auto;color:#aebed0;font-size:12px;line-height:1.8;padding:12px 10px;border-top:1px solid #40516a}.main{min-width:0;padding:35px clamp(15px,4vw,56px) 80px;max-width:1440px;width:100%;margin:auto}.topbar{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:25px}.topbar .date{font-weight:700;font-size:12px;color:var(--sub)}.eyebrow{font-size:11px;letter-spacing:1.1px;font-weight:800;color:#6582a4;margin:0 0 9px}.page-title{font-size:25px;letter-spacing:-.8px;margin:0 0 7px;font-weight:760}.lead{color:var(--sub);margin:0 0 25px;line-height:1.7}.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:22px;margin-bottom:15px}.card h3{font-size:16px;margin:0 0 11px}.muted{color:var(--sub)}.small{font-size:12px}.btn{border:1px solid #cfdae7;border-radius:9px;padding:10px 15px;background:white;color:#263c59;font-weight:700;white-space:nowrap}.btn:hover:not(:disabled){background:#f2f6fa}.btn-primary{background:#254e83;border-color:#254e83;color:white}.btn-primary:hover:not(:disabled){background:#1c3d68}.btn-subtle{background:#f2f5f9;border-color:#e4eaf2}.btn-red{color:#a33746}.btn-sm{padding:8px 11px;font-size:12px}.row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.row-between{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:16px}.grid-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.stat{background:#fff;border:1px solid var(--line);padding:18px;border-radius:12px}.stat strong{display:block;font-size:23px;margin-top:6px}.stat small{color:var(--sub)}.badge{display:inline-flex;align-items:center;border-radius:99px;padding:5px 9px;font-size:11px;font-weight:750;background:#e8edf4;color:#55677d}.badge.good{background:#e7f4ec;color:#247353}.badge.bad{background:#fbe9ea;color:#a5404a}.badge.warn{background:#fff0cf;color:#90631b}.field{display:grid;gap:7px;min-width:0}.field label{font-size:12px;font-weight:750;color:#506179}.field input,.field select{width:100%}.separator{height:1px;background:var(--line);margin:20px 0}.banner{border:1px solid #cfddf2;border-radius:11px;background:#eaf2fc;padding:13px 15px;color:#37577e;font-size:12px;line-height:1.7;margin-bottom:17px}.notice-error{background:#fff0f0;border-color:#f3bfc3;color:#a33842}.notice-good{background:#edfaef;border-color:#bce8cd;color:#28754b}.mini-progress{height:9px;background:#edf1f5;border-radius:10px;overflow:hidden}.mini-progress div{height:100%;background:#537fb3}.item{border:1px solid var(--line);border-radius:10px;background:#fff;padding:14px 15px;margin-bottom:9px}.item:hover{border-color:#b5cce7}.item-title{font-weight:750}.item-sub{font-size:12px;color:var(--sub);margin-top:6px}.divider-title{font-size:18px;margin:30px 0 12px}.book-heading{padding:10px 0 20px}.book-tools{display:flex;gap:9px;align-items:center;flex-wrap:wrap;border:1px solid var(--line);background:#fff;border-radius:13px;padding:12px 13px;margin-bottom:14px}.book-tools select{min-width:190px;flex:1}.page-control{display:flex;gap:7px;align-items:center}.page-control input{width:72px;text-align:center}.paper{background:white;border:1px solid var(--line);border-radius:14px;box-shadow:0 3px 15px #2239560a;min-height:350px;padding:clamp(18px,4vw,46px)}.paper-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-bottom:20px;margin-bottom:19px;border-bottom:1px solid #e8edf3}.paper-head h2{font-size:18px;margin:0}.source{font-size:15px;line-height:2.1;white-space:pre-wrap;overflow-wrap:anywhere;user-select:text;min-height:140px}.source mark{background:var(--yellow);border-radius:3px;cursor:pointer;color:var(--ink);padding:2px 0}.source mark:hover{background:#ffe091}.help{font-size:12px;color:#6b7e94;line-height:1.8}.book-extra{margin-top:15px}.book-extra details{border:1px solid var(--line);border-radius:11px;padding:15px;background:white}.book-extra summary{cursor:pointer;font-weight:750}.book-extra details>div{padding-top:15px}.editor-save{font-size:12px;color:#357052}.editor-save.error{color:#a63941}.cloze-text{white-space:pre-wrap;overflow-wrap:anywhere;line-height:2.4;font-size:15px}.blank-input{width:auto;min-width:85px;max-width:min(290px,85vw);background:#f9fbff;border:0;border-bottom:2px solid #7195c5;border-radius:3px;padding:4px 6px;margin:3px;vertical-align:middle;text-align:center}.blank-input:focus{box-shadow:none;border-bottom-color:#1a477d}.answer-result{display:inline-block;font-size:12px;margin:0 4px}.answer-result.good{color:#2e8157}.answer-result.bad{color:#b03d4d}.ox-statement{font-size:15px;line-height:1.75;margin-bottom:14px}.ox-choice{display:inline-flex;align-items:center;gap:5px}.ox-choice input{width:16px;height:16px;accent-color:#325e99}.ox-feedback{font-size:13px;background:#f4f7fb;border-radius:8px;padding:12px;line-height:1.7;margin-top:12px}.table-wrap{overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:13px}th,td{border-bottom:1px solid #e7ecf2;text-align:left;padding:11px 8px;vertical-align:top}th{color:#60718a;font-size:12px;background:#f9fbfd}.review-card{border:1px solid #e4eaf1;border-radius:12px;padding:15px;margin:10px 0}.review-card textarea{width:100%}.auth-box{max-width:440px;margin:60px auto}.login-form{display:grid;gap:14px}.login-form input{width:100%}.panel-toolbar{display:flex;gap:12px;align-items:center;justify-content:space-between;margin-bottom:13px;flex-wrap:wrap}.import-form{display:grid;grid-template-columns:1fr 1fr;gap:14px}.empty{color:#77869b;text-align:center;padding:45px 20px;border:1px dashed #d5dfec;border-radius:12px;line-height:1.9}.toast{position:fixed;bottom:22px;right:22px;max-width:min(430px,90vw);border-radius:10px;padding:13px 18px;box-shadow:0 8px 30px #0002;background:#17324d;color:white;font-size:13px;z-index:100}.toast.err{background:#a83440}.admin-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:15px}.admin-tabs button.active{background:#214e86;color:white}.ox-edit{width:100%;min-height:55px}.mobile-bar{display:none}.footer{color:#8998ad;font-size:11px;margin-top:45px}.check{accent-color:#34639a}.flag{display:inline-flex;gap:5px;align-items:center;font-size:12px;color:#73819a;white-space:nowrap}@media(max-width:860px){.layout{display:block}.sidebar{display:none}.mobile-bar{position:sticky;top:0;z-index:30;background:#152942;color:white;padding:12px 13px;display:flex;gap:8px;overflow-x:auto}.mobile-bar button{background:#2b415d;color:white;border:0;padding:9px 12px;border-radius:8px;white-space:nowrap}.mobile-bar button.active{background:#e0ecf8;color:#142a44}.main{padding:25px 15px 65px}.grid-3{grid-template-columns:1fr 1fr}.paper{padding:22px 17px}.source{font-size:14px}.import-form{grid-template-columns:1fr}}@media(max-width:560px){.grid-2,.grid-3{grid-template-columns:1fr}.page-title{font-size:22px}.book-tools{align-items:stretch}.book-tools select{width:100%}.page-control{justify-content:center}.card{padding:17px}.paper-head{align-items:flex-start}.ox-statement{font-size:14px}}

.auth-status{border:1px solid #bcd1e9;background:#edf4fc;color:#25517f;border-radius:9px;padding:12px 13px;line-height:1.65;overflow-wrap:anywhere;font-size:13px}.auth-status.error{background:#fff0f1;border-color:#efc5cb;color:#a03948}.auth-status.success{background:#ebf8ef;border-color:#b4dfc3;color:#236d46}

/* v4: 문단별 교재형 본문. PDF 원문을 변경하지 않고 화면 표시만 다듬는다. */
.study-paper{padding:clamp(20px,3.3vw,42px)}
.study-paper .paper-head{margin-bottom:13px;padding-bottom:12px}
.study-instructions{margin:0 0 17px;padding:9px 12px;border-radius:7px;background:#f5f8fc;color:#56677c}
.cloze-text.textbook-layout{white-space:normal;overflow-wrap:break-word;font-family:'Malgun Gothic','Apple SD Gothic Neo','Noto Sans KR',sans-serif;font-size:15px;line-height:1.8;color:#172638}
.paper-line{min-height:1.65em;white-space:pre-wrap;overflow-wrap:break-word}
.paper-line.line-major{font-weight:750;font-size:1.11em;margin-top:15px;line-height:1.85}
.paper-line.line-heading{font-weight:750;margin-top:11px;line-height:1.8}
.paper-line.line-indented{padding-left:12px;text-indent:-1px}
.paper-line.line-nested{padding-left:22px}
.paper-line.line-note{padding-left:12px;font-size:.94em;color:#405067}
.paper-line.line-empty{min-height:9px;height:9px;line-height:9px}
.blank-unit{display:inline-flex;align-items:baseline;vertical-align:baseline;gap:2px;white-space:nowrap;position:relative;margin:0 2px}
.study-paper .blank-input{font:inherit;font-weight:500;min-width:0!important;max-width:min(240px,66vw);height:29px;line-height:24px;padding:0px 4px;margin:0;vertical-align:baseline;background:#f3f7fb;border:0;border-bottom:1.5px solid #7293b9;border-radius:2px;text-align:center;color:#172f4d}
.study-paper .blank-input:focus{background:#fff;outline:0;border-bottom:2px solid #2a5c92;box-shadow:none}
.study-paper .blank-unit.is-correct .blank-input{border-bottom-color:#37825a;background:#f0f8f2;color:#275d3e}
.study-paper .blank-unit.is-incorrect .blank-input{border-bottom-color:#bf4152;background:#fff1f1;color:#93343c}
.study-paper .blank-unit.is-uncertain .blank-input{border-bottom-color:#c88b3b;background:#fff8eb}
.uncertain-toggle{border:1px solid transparent;background:transparent;color:#63758a;border-radius:50%;font-size:10px;line-height:15px;text-align:center;width:17px;height:17px;padding:0;cursor:pointer;opacity:.85;vertical-align:middle}
.uncertain-toggle:hover{opacity:1;color:#244c7a;background:#eff4fc;border-color:#c6d6e8}
.uncertain-toggle.checked{opacity:1;background:#fff0d6;color:#915c12;border-color:#e4c287;font-weight:800}
.uncertain-toggle:disabled{cursor:default;opacity:.65}
.lesson-report h3{margin-bottom:10px}.lesson-report h4{margin:18px 0 9px;font-size:13px;color:#354a63}
.correction-list{display:grid;gap:7px}.correction{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;border:1px solid #f0d1d3;background:#fff8f8;border-radius:8px;padding:9px 11px;font-size:13px}
.correction strong{color:#a73742}.correction .correct-answer{color:#aa303c;font-weight:750}
.correction.doubtful{border-color:#edd9b4;background:#fffcf5}.correction.doubtful strong{color:#a46d24}
.all-correct{font-size:13px;color:#2b7651;font-weight:700;margin:14px 0}
@media(max-width:560px){.cloze-text.textbook-layout{font-size:14px}.study-paper .blank-input{max-width:50vw}}


/* v5: 관리자 및 학습자 공통 교재 조판. 실제 원문은 변경하지 않는다. */
.book-source.source,.learner-textbook,.editor-textbook{font-family:'Malgun Gothic','Apple SD Gothic Neo','Noto Sans KR',sans-serif;font-size:15px;line-height:1.67;letter-spacing:-.025em;color:#1a2738;white-space:normal;overflow-wrap:break-word;word-break:normal}
.book-source.source{user-select:text;min-height:200px}
.textbook-layout{max-width:780px;margin:8px auto 10px;}
.textbook-row{display:block;white-space:pre-wrap;overflow-wrap:break-word;line-height:1.67;min-height:1.67em;margin:0;padding:0;position:relative}
.textbook-row.kind-major{font-weight:800;font-size:1.16em;line-height:1.75;margin:14px 0 8px;letter-spacing:-.035em}
.textbook-row.kind-heading{font-weight:750;font-size:1.04em;line-height:1.72;margin:13px 0 4px}
.textbook-row.kind-item{padding-left:14px;text-indent:-14px;margin-top:5px}
.textbook-row.kind-nested{padding-left:29px;text-indent:-11px;margin-top:3px}
.textbook-row.kind-note{padding-left:15px;font-size:.91em;color:#3c4b5d;margin:3px 0 5px}
.textbook-row.kind-bullet{padding-left:21px;text-indent:-7px}
.textbook-row.kind-running{font-size:.77em;color:#7d8692;text-align:left;margin-bottom:9px}
.textbook-row.kind-paragraph.follow-item{padding-left:14px}
.textbook-row.kind-paragraph.follow-nested{padding-left:29px}
.textbook-row.kind-paragraph.follow-note{padding-left:15px}
.textbook-row.kind-paragraph.follow-bullet{padding-left:21px}
.textbook-row.kind-empty{min-height:9px;line-height:9px;height:9px}
.textbook-row .source-fragment{white-space:pre-wrap}
.editor-textbook .editor-mark{position:relative;cursor:pointer;display:inline;vertical-align:baseline;border-radius:2px;white-space:pre-wrap}
.editor-textbook .editor-mark mark{background:#ffedac;color:inherit;border-bottom:1px solid #d6af45;border-radius:1px;padding:0 1px;font-weight:inherit}
.editor-textbook .editor-mark:hover mark{background:#ffe083}
.editor-textbook .blank-clear{position:absolute;top:-9px;right:-11px;width:15px;height:15px;padding:0;border:1px solid #efc574;border-radius:50%;line-height:12px;text-align:center;background:#fff8e8;color:#8a6019;font-size:12px;font-weight:700;opacity:0;z-index:1;cursor:pointer}
.editor-textbook .editor-mark:hover .blank-clear{opacity:1}
.study-paper .learner-textbook{font-size:15px;line-height:1.67}
.study-paper .blank-unit{display:inline-flex;vertical-align:baseline;align-items:baseline;gap:0;margin:0 2px;white-space:nowrap;position:relative}
.study-paper .blank-input{height:26px;line-height:23px;font-size:inherit;font-family:inherit;letter-spacing:inherit;font-weight:500;padding:0 4px;margin:0 2px;border-radius:2px;min-width:72px!important;max-width:230px!important;vertical-align:baseline}
.study-paper .uncertain-toggle{width:15px;height:15px;border-radius:50%;font-size:10px;line-height:13px;padding:0;vertical-align:middle;opacity:.62}
.study-paper .uncertain-toggle:hover,.study-paper .uncertain-toggle.checked{opacity:1}
.paper .paper-head{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-bottom:14px;padding-bottom:12px}
.paper-head h2{max-width:calc(100% - 20px);font-size:16px}
.source-pdf-link{white-space:nowrap;text-decoration:none!important;font-size:12px}
.study-paper .textbook-layout{margin:8px auto 13px}
.study-paper .paper-head h2{font-size:16px}
.study-paper .study-instructions{margin:0 auto 11px;max-width:780px}
@media(max-width:650px){.book-source.source,.study-paper .learner-textbook{font-size:14px}.textbook-layout{margin-left:0;margin-right:0}.textbook-row.kind-nested{padding-left:22px}.paper-head{align-items:flex-start}.source-pdf-link{font-size:11px}}

/* v6: exact source PDF's layout and font weights via rendered page canvas. */
.pdf-mode-control{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin:5px 0 13px}
.pdf-host{display:block!important;overflow-x:auto;overflow-y:hidden;max-width:100%;white-space:normal!important;line-height:normal!important}
.pdf-loader,.pdf-fallback-msg{padding:25px 14px;color:#667d94;font-size:13px;background:#f5f8fb;border:1px dashed #cdd9e9;border-radius:8px;text-align:center}
.original-pdf-page{position:relative;display:block;margin:0 auto;background:white;box-shadow:0 1px 7px #152b4430;isolation:isolate;overflow:hidden}
.original-pdf-canvas{position:absolute;top:0;left:0;display:block;z-index:1;pointer-events:none}
.pdf-select-layer,.pdf-mask-layer,.pdf-mark-layer,.pdf-input-layer{position:absolute;inset:0;pointer-events:none}
.pdf-select-layer{z-index:2;user-select:text;}
.pdf-mask-layer{z-index:3}.pdf-mark-layer{z-index:4}.pdf-input-layer{z-index:5}
.pdf-select-fragment{position:absolute;display:inline-block;white-space:pre;line-height:1!important;color:transparent!important;user-select:text;cursor:text;pointer-events:auto}
.pdf-select-fragment::selection{color:transparent;background:#76acf588}
.pdf-editor-highlight{position:absolute;background:#f6d55a99;outline:1px solid #cf9d2159;cursor:pointer;pointer-events:auto;border-radius:1px}
.pdf-editor-highlight:hover{background:#f6be4cbd}
.pdf-answer-erase{position:absolute;background:#fff;pointer-events:none}
.pdf-answer-unit{position:absolute;display:inline-flex;align-items:center;gap:1px;margin:0;white-space:nowrap;pointer-events:auto;z-index:10}
.pdf-answer-unit .pdf-blank-input{font:normal 12px/1.2 'Malgun Gothic','Apple SD Gothic Neo',sans-serif;min-width:0!important;max-width:none!important;line-height:1.15;height:100%;min-height:19px;border-radius:2px;text-align:center;background:#f4f8fd;border-bottom:1.3px solid #5487ba;padding:1px 2px;margin:0;color:#1a3d66}
.pdf-answer-unit .uncertain-toggle{position:relative;top:-1px;margin:0;padding:0;width:13px;height:13px;font-size:10px;line-height:11px;border-radius:50%;opacity:.65}
.pdf-answer-unit .uncertain-toggle.checked{opacity:1}
.pdf-answer-unit.is-correct .pdf-blank-input{background:#ebf9ef;border-color:#448b63}
.pdf-answer-unit.is-incorrect .pdf-blank-input{background:#fff2f2;border-color:#c84755}
.pdf-fallback-content{padding:12px 0}
@media(max-width:640px){.pdf-mode-control{align-items:flex-start}.original-pdf-page{margin:0}}

/* v7: continuous multi-word PDF selection, stable canvas during marking/saving. */
.pdf-hit-layer,.pdf-selected-layer{position:absolute;inset:0}
.pdf-hit-layer{z-index:8;cursor:text;touch-action:pan-y;user-select:none}
.pdf-selected-layer{z-index:7;pointer-events:none}
.pdf-editor-highlight{pointer-events:none!important}
.pdf-drag-preview{position:absolute;background:rgba(63,132,222,.31);border-bottom:1px solid #4c84cb;pointer-events:none}
.pdf-host .original-pdf-page{-webkit-user-select:none;user-select:none}

/* v8 · Unicode-character selection and optional one-glyph trimming */
.pdf-char-tools{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;position:sticky;top:0;z-index:20;background:#f2f6fd;border:1px solid #cbdaf0;border-radius:6px;padding:8px 10px;margin-bottom:8px;font:12px/1.55 'Malgun Gothic','Apple SD Gothic Neo',sans-serif;color:#234669}
.pdf-char-label{min-width:80px;flex:1;overflow-wrap:anywhere;user-select:text}
.pdf-char-adjust{display:flex;flex-wrap:wrap;gap:5px}
.pdf-char-adjust[hidden]{display:none!important}
.pdf-char-adjust .btn{font-size:11px;padding:4px 7px;white-space:nowrap}
.pdf-hit-layer{cursor:crosshair;touch-action:pan-y}
.pdf-drag-preview{background:rgba(48,131,229,.26);outline:1px solid rgba(42,106,187,.5)}


/* v9: PDF.js's own positioned text-layer is the single source of geometry.
   Canvas-only inferred font widths used in older releases are intentionally unused. */
.pdf-native-text-layer{
 position:absolute;inset:0;z-index:6;overflow:hidden;line-height:1;
 text-align:initial;text-size-adjust:none;-webkit-text-size-adjust:none;
 transform-origin:0 0;forced-color-adjust:none;
 -webkit-user-select:text;user-select:text;
}
.pdf-native-text-layer :is(span,br){
 color:transparent;position:absolute;white-space:pre;cursor:text;transform-origin:0% 0%;
}
.pdf-native-text-layer span::selection{background:rgba(69,145,242,.35);color:transparent}
.pdf-native-text-layer br::selection{background:rgba(69,145,242,.35)}
.pdf-native-text-layer span.markedContent{top:0;height:0}
.pdf-native-text-layer .pdf-mapped-text{pointer-events:auto}
.pdf-native-text-layer span:not(.pdf-mapped-text){pointer-events:none}
.pdf-mask-layer,.pdf-mark-layer,.pdf-input-layer{pointer-events:none}
.pdf-editor-highlight{pointer-events:none!important}
.pdf-input-layer{z-index:9}
.pdf-host .original-pdf-page{-webkit-user-select:auto;user-select:auto}
.pdf-native-text-layer{--scale-factor:inherit;--total-scale-factor:inherit}
