/* Base tokens, shared components, and primary layouts. Cascade order is defined in index.html. */

:root{font-family:Inter,system-ui,-apple-system,sans-serif;color:#172033;background:#f5f7fb}*{box-sizing:border-box}body{margin:0}.wrap{max-width:1100px;margin:auto;padding:24px}.card{background:white;border:1px solid #e3e7ef;border-radius:16px;padding:20px;margin:14px 0;box-shadow:0 4px 18px #1720330b}.row{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.between{justify-content:space-between}input,textarea,select,button{font:inherit}input,textarea,select{width:100%;padding:10px 12px;border:1px solid #ccd3df;border-radius:10px;background:white}textarea{min-height:90px;resize:vertical}button{border:0;border-radius:10px;padding:10px 14px;cursor:pointer;background:#e9edf5;color:#172033}.primary{background:#2457e6;color:white}.danger{background:#fff0f0;color:#b42318}.small{font-size:13px;color:#667085}.hide{display:none!important}.grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.block{border:1px solid #dfe4ec;border-radius:14px;padding:16px;margin:12px 0;background:#fff}.pill{font-size:12px;padding:4px 8px;border-radius:999px;background:#eef2ff}.notice{background:#fff7d6;border:1px solid #f1d879;padding:12px;border-radius:12px}.nav{background:#172033;color:white}.nav .wrap{display:flex;justify-content:space-between;align-items:center;padding-top:14px;padding-bottom:14px}.listitem{padding:14px;border:1px solid #e3e7ef;border-radius:12px;margin:10px 0}.preview{background:#fbfcfe;border:1px dashed #c8d0dc;border-radius:12px;padding:18px}.inline-blank{display:inline-block;width:clamp(135px,14vw,190px);padding:2px 5px;margin:0 5px;border:0;border-bottom:2px solid #8a94a6;border-radius:0;background:transparent;font-size:1em;font-weight:500;color:#172033;vertical-align:baseline}.inline-blank:focus{outline:none;border-bottom-color:#2457e6;background:#f8faff}.inline-blank.correct{border-bottom-color:#12b76a;background:#ecfdf3}.inline-blank.wrong{border-bottom-color:#f04438;background:#fef3f2}.qline{font-weight:500;line-height:1.9;margin:12px 0}.qline.paragraph-fill{max-width:1020px;font-family:Inter,system-ui,-apple-system,sans-serif;font-size:20px;font-weight:500;line-height:2.15;letter-spacing:-.01em;color:#253044}.blank-prompt{display:inline-flex;align-items:baseline;gap:4px;padding:0 5px;margin:0 2px;border-radius:5px;background:#f1f4f8;border:1px solid #e0e5ed;font-size:.88em;font-weight:650;color:#46536a;white-space:nowrap}.blank-prompt .blank-number{font-weight:700}.preview-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:18px}.opts{display:grid;gap:8px}.optrow{display:grid;grid-template-columns:34px 1fr 110px;gap:8px;align-items:center}@media(max-width:700px){.grid{grid-template-columns:1fr}.wrap{padding:14px}.optrow{grid-template-columns:28px 1fr}.optrow select{grid-column:2}}

/* Multiple-choice student preview */
.mc-group{margin:10px 0 30px}.mc-prompt{font-weight:700;line-height:1.45;margin:0 0 8px}.mc-options{display:grid;gap:5px}.mc-option{display:flex;align-items:flex-start;gap:10px;padding:8px 10px;border:1px solid transparent;border-radius:10px;cursor:pointer;line-height:1.45;transition:background .15s,border-color .15s}.mc-option:hover{background:#f6f8fc}.mc-option input{width:auto;margin:3px 0 0;flex:0 0 auto;accent-color:#2457e6;cursor:pointer}.mc-option.selected{background:#eef4ff;border-color:#bfd0ff}.mc-option.correct{background:#ecfdf3;border-color:#75d6a3}.mc-option.wrong{background:#fef3f2;border-color:#f5a7a1}.mc-option.revealed{background:#ecfdf3;border-color:#75d6a3}.mc-label{font-weight:700;min-width:22px}.mc-text{flex:1}.mc-group+.mc-group{margin-top:30px}
.instruction-box{margin:4px 0 26px;padding:17px 20px;border:1px solid #d9e2f2;border-left:5px solid #2457e6;border-radius:10px;background:#f5f8ff}.instruction-text{font-family:Georgia,"Times New Roman",serif;font-size:1.12em;font-weight:700;line-height:1.55;color:#172033}.prompt-token{display:inline-block;padding:1px 7px;margin:0 2px;border-radius:6px;background:#eef2f7;border:1px solid #d8dee9;font-weight:700;color:#344054}.st-item{margin:14px 0 28px;padding:16px 18px;border:1px solid #e4e8f0;border-radius:12px;background:#fff}.st-original{font-size:1.02em;line-height:1.55;margin-bottom:9px}.st-keyword{display:inline-block;margin:2px 0 10px;padding:4px 9px;border-radius:6px;background:#eef2ff;color:#3446a8;font-weight:800;letter-spacing:.04em}.st-target{font-size:1.02em;line-height:1.8}.st-input{display:inline-block;width:clamp(210px,32vw,390px);padding:2px 5px;margin:0 5px;border:0;border-bottom:2px solid #8a94a6;border-radius:0;background:transparent;font:inherit;color:#172033}.st-input:focus{outline:none;border-bottom-color:#2457e6;background:#f8faff}.st-input.correct{border-bottom-color:#12b76a;background:#ecfdf3}.st-input.wrong{border-bottom-color:#f04438;background:#fef3f2}.st-note{font-size:12px;color:#667085;margin-top:7px}

/* Drag & Drop Fill */
.dd-block{margin:12px 0 28px}.dd-bank{display:flex;flex-wrap:wrap;gap:9px;padding:14px;margin:0 0 20px;border:1px solid #dfe5ee;border-radius:12px;background:#f8fafc;min-height:64px}.dd-pill{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:7px 13px;border:1px solid #cfd7e4;border-radius:999px;background:#fff;color:#253044;font-weight:700;cursor:grab;user-select:none;touch-action:pan-y;box-shadow:0 1px 2px #1720330a}.dd-pill:active{cursor:grabbing}.dd-pill.selected{border-color:#2457e6;background:#eef4ff;color:#2446a8}.dd-pill.used{display:none}.dd-items{display:grid;gap:12px}.dd-item{font-size:1.02em;line-height:2.05;font-weight:500;color:#253044}.dd-slot{display:inline-flex;align-items:center;justify-content:center;min-width:135px;min-height:38px;margin:0 5px;padding:3px 10px;border:1px dashed #98a2b3;border-bottom:2px solid #7b8495;border-radius:8px;background:#fbfcfe;vertical-align:middle;cursor:pointer}.dd-slot.filled{border-style:solid;border-color:#b7c2d2;background:#f6f8fb}.dd-slot.correct{border-color:#75d6a3;background:#ecfdf3}.dd-slot.wrong{border-color:#f5a7a1;background:#fef3f2}.dd-slot.revealed{border-color:#75d6a3;background:#ecfdf3}.dd-slot .dd-pill{min-height:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;cursor:grab;font:inherit;color:inherit}.dd-bank.drag-over,.dd-slot.drag-over{outline:2px solid #2457e6;outline-offset:2px}.dd-help{font-size:12px;color:#667085;margin:-10px 0 14px}@media(max-width:700px){.dd-slot{min-width:110px}.dd-item{line-height:2.2}}

/* Inline Choice / Underline */
.ic-group{margin:10px 0 30px}.ic-item{font-size:1.08em;line-height:2.35;font-weight:500;color:#253044;margin:0 0 16px}.ic-option{display:inline-flex;align-items:center;justify-content:center;min-height:42px;margin:0 5px;padding:5px 12px;border:1.5px solid #d2dae7;border-radius:10px;background:#fff;color:#253044;font:inherit;font-weight:500;cursor:pointer;vertical-align:middle;transition:background .15s,border-color .15s,color .15s}.ic-option:hover{background:#f7f9fc}.ic-option.selected{background:#eef4ff;border-color:#8eabf5;color:#2446a8}.ic-option.correct{background:#ecfdf3;border-color:#75d6a3;color:#087443}.ic-option.wrong{background:#fef3f2;border-color:#f5a7a1;color:#b42318}.ic-option.revealed{background:#ecfdf3;border-color:#75d6a3;color:#087443}@media(max-width:700px){.ic-item{line-height:2.6}.ic-option{margin:3px 3px;padding:5px 9px}}

/* Error Correction */
.ec-group{margin:12px 0 28px}.ec-item{margin:0 0 24px}.ec-sentence{font-size:1.08em;font-weight:500;line-height:1.55;margin-bottom:8px}.ec-answer-row{display:grid;grid-template-columns:216px 1fr;gap:14px;align-items:center}.ec-correct-btn{height:52px;border:2px solid #cfd8e6;border-radius:12px;background:#fff;color:#344054;font-weight:800;font-size:1.02em;letter-spacing:.02em}.ec-correct-btn.selected{background:#eef4ff;border-color:#8eabf5;color:#2446a8}.ec-correct-btn.correct{background:#ecfdf3;border-color:#75d6a3;color:#087443}.ec-correct-btn.wrong{background:#fef3f2;border-color:#f5a7a1;color:#b42318}.ec-input{height:52px;border:0;border-bottom:2px solid #667085;border-radius:0;background:#f7f8fa;padding:8px 12px;font-size:1.02em}.ec-input:focus{outline:none;border-bottom-color:#2457e6;background:#f8faff}.ec-input.correct{border-bottom-color:#12b76a;background:#ecfdf3}.ec-input.wrong{border-bottom-color:#f04438;background:#fef3f2}.ec-input:disabled{opacity:.5;cursor:not-allowed}.ec-key{font-size:13px;margin-top:6px;color:#b42318}.ec-key.correct-key{color:#087443}@media(max-width:700px){.ec-answer-row{grid-template-columns:1fr}.ec-correct-btn{width:100%}}

/* Teacher account */
.account-wrap{position:relative}.account-menu{position:absolute;right:0;top:calc(100% + 8px);z-index:20;width:210px;padding:8px;background:#fff;color:#172033;border:1px solid #dfe4ec;border-radius:12px;box-shadow:0 10px 30px #17203322}.account-menu button{width:100%;text-align:left;background:transparent}.pw-panel{max-width:520px}.pw-msg{margin-top:10px}.pw-msg.ok{color:#087443}.pw-msg.err{color:#b42318}

/* Split Reading layout */
.reading-shell{display:grid;grid-template-columns:minmax(0,var(--reading-left,54fr)) 8px minmax(0,var(--reading-right,46fr));height:min(78vh,820px);min-height:560px;margin:-18px;border-radius:12px;overflow:hidden;background:#fff}.reading-pane{min-width:0;overflow:auto}.reading-passage{padding:28px 30px;border-right:1px solid #e3e7ef}.reading-questions{display:flex;flex-direction:column;overflow:hidden}.reading-question-scroll{flex:1;overflow:auto;padding:0 24px 100px;scroll-behavior:smooth}.reading-resizer{cursor:col-resize;background:#e8edf5;position:relative;touch-action:none}.reading-resizer:after{content:'';position:absolute;left:2px;top:46%;width:4px;height:42px;border-radius:4px;background:#aeb8c8}.reading-qnav{position:sticky;top:0;z-index:8;display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:12px 18px;border-bottom:1px solid #e3e7ef;background:rgba(255,255,255,.96);backdrop-filter:blur(6px)}.reading-qnav-label{font-weight:700;margin-right:4px}.reading-qnav button{min-width:38px;padding:7px 9px;border:1px solid #d5dce8;background:#fff}.reading-qnav button.answered{background:#eef4ff;border-color:#9bb7ff;color:#2446a8}.reading-qnav button.active{outline:2px solid #2457e6;outline-offset:1px}.reading-qnav button.nav-correct{background:#ecfdf3;border-color:#12b76a;color:#087443}.reading-qnav button.nav-wrong{background:#fef3f2;border-color:#f04438;color:#b42318}.reading-qnav button.active.nav-correct,.reading-qnav button.active.nav-wrong{outline:2px solid #2457e6;outline-offset:2px}.reading-actions{position:sticky;bottom:0;z-index:9;display:flex;gap:8px;padding:12px 18px;border-top:1px solid #e3e7ef;background:rgba(255,255,255,.97);backdrop-filter:blur(6px)}.reading-passage-title{font-family:Georgia,"Times New Roman",serif;font-size:1.65em;line-height:1.15;text-align:center;margin:4px 0 20px}.reading-passage-text{font-family:Georgia,"Times New Roman",serif;font-size:1.08em;line-height:1.7}.reading-passage-instruction{font-family:Georgia,"Times New Roman",serif;font-size:1.02em;line-height:1.35;font-style:italic;font-weight:700;margin:0 0 14px}.reading-passage-paragraph{margin:0 0 16px;text-align:justify;text-indent:1.7em}.reading-passage-paragraph:last-child{margin-bottom:0}.reading-passage-source{margin-top:18px;font-size:.86em;font-style:italic;color:#667085}.reading-passage-text u,.reading-passage-text .rp-u{text-underline-offset:3px;text-decoration-thickness:1.5px}.reading-passage-text strong{font-weight:800}.reading-question-anchor{scroll-margin-top:68px}.reading-question-number{font-weight:800;margin-right:6px}@media(max-width:800px){.reading-shell{display:block;height:auto;min-height:0;margin:-18px}.reading-resizer{display:none}.reading-pane{overflow:visible}.reading-passage{max-height:52vh;overflow:auto;border-right:0;border-bottom:1px solid #e3e7ef;padding:22px}.reading-questions{display:block}.reading-qnav{position:sticky;top:0}.reading-question-scroll{overflow:visible;padding:0 16px 20px}.reading-actions{position:sticky;bottom:0}}

/* Global adaptive Multiple Choice cards */
.mc-group:not(.ms-group) .mc-options{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 12px}
.mc-group:not(.ms-group) .mc-options.mc-long{grid-template-columns:1fr}
.mc-group:not(.ms-group) .mc-option{align-items:center;justify-content:flex-start;text-align:left;padding:12px 16px;border:1.5px solid #d6deea;border-radius:12px;background:#fff;min-height:54px;gap:7px}
.mc-group:not(.ms-group) .mc-option:hover{background:#f7f9fc;border-color:#bdc9dc}
.mc-group:not(.ms-group) .mc-option.selected{background:#eaf2ff;border-color:#3b7cff;color:#1f5bd8}
.mc-group:not(.ms-group) .mc-option.correct,.mc-group:not(.ms-group) .mc-option.revealed{background:#ecfdf3;border-color:#75d6a3;color:#176b43}
.mc-group:not(.ms-group) .mc-option.wrong{background:#fef3f2;border-color:#f5a7a1;color:#b42318}
.mc-group:not(.ms-group) .mc-label{min-width:auto;font-weight:800}
.mc-group:not(.ms-group) .mc-text{min-width:0;text-align:left}
@media(max-width:760px){.mc-group:not(.ms-group) .mc-options{grid-template-columns:1fr}}
/* Teacher builder: match student multiple-choice cards */
.builder-mc-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 12px;margin-top:10px}.builder-mc-options.mc-long{grid-template-columns:1fr}.builder-mc-option{display:flex;align-items:center;gap:8px;padding:10px 12px;border:1.5px solid #d6deea;border-radius:12px;background:#fff;cursor:pointer;min-height:54px}.builder-mc-option:hover{background:#f7f9fc;border-color:#bdc9dc}.builder-mc-option.selected{background:#eaf2ff;border-color:#3b7cff;color:#1f5bd8}.builder-mc-label{font-weight:800}.builder-mc-option input[type=text]{border:0;background:transparent;padding:4px 2px;min-width:0}.builder-mc-option.selected input[type=text]{color:#1f5bd8;font-weight:600}.builder-mc-correct{margin-left:auto;font-size:12px;font-weight:700;white-space:nowrap}@media(max-width:760px){.builder-mc-options{grid-template-columns:1fr}}

/* Assignment System V1 */
.assignment-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.assignment-card{border:1px solid #dfe4ec;border-radius:14px;padding:16px;background:#fff}.assignment-card h3{margin:0 0 6px}.status-chip{display:inline-flex;padding:4px 9px;border-radius:999px;font-size:12px;font-weight:750;background:#eef2f7;color:#475467}.status-chip.done{background:#ecfdf3;color:#087443}.status-chip.late{background:#fef3f2;color:#b42318}.status-chip.progress{background:#eef4ff;color:#2457e6}.student-picker{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:8px}.student-check{display:flex;gap:8px;align-items:center;padding:9px 10px;border:1px solid #e3e7ef;border-radius:10px}.student-check input{width:auto}.assignment-table{width:100%;border-collapse:collapse}.assignment-table th,.assignment-table td{text-align:left;padding:10px;border-bottom:1px solid #e8ecf2}.student-work-head{margin-bottom:12px}.score-banner{padding:12px 14px;border-radius:12px;background:#eef4ff;color:#2446a8;font-weight:700;margin:12px 0}.student-preview{background:#fbfcfe;border:1px dashed #c8d0dc;border-radius:12px;padding:18px}@media(max-width:760px){.assignment-grid,.student-picker{grid-template-columns:1fr}.assignment-table{font-size:13px}}
.user-highlight{background:#ffe88a;border-radius:3px;padding:0 1px}
.selection-tools{position:fixed;z-index:9999;display:flex;gap:6px;padding:6px;background:#172033;border-radius:10px;box-shadow:0 8px 24px rgba(16,24,40,.2)}
.selection-tools button{border:0;background:#fff;color:#172033;padding:7px 10px;border-radius:7px;font-size:13px;font-weight:700}
.vocab-modal{position:fixed;inset:0;z-index:10000;background:rgba(16,24,40,.34);display:flex;align-items:center;justify-content:center;padding:18px}
.vocab-dialog{width:min(560px,100%);background:#fff;border-radius:18px;padding:22px;box-shadow:0 20px 60px rgba(16,24,40,.25)}
.vocab-dialog h3{margin:0 0 16px}.vocab-dialog textarea{min-height:84px}
.vocab-grid{display:grid;gap:12px}.vocab-card{border:1px solid #dfe4ec;border-radius:14px;padding:16px;background:#fff}
.vocab-word{font-size:20px;font-weight:800}.vocab-meaning{margin-top:8px}.vocab-context{margin-top:8px;color:#667085;font-size:13px;font-style:italic}.vocab-note{margin-top:8px;font-size:14px}
.vocab-toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:14px}


.vocab-grid{display:grid;gap:8px}
.vocab-card{display:grid!important;grid-template-columns:minmax(150px,.8fr) minmax(320px,2.4fr) 110px 42px;gap:16px;align-items:center;border:1px solid #dfe4ec;border-radius:12px;padding:12px 14px;background:#fff}
.vocab-word{font-size:18px;font-weight:800;line-height:1.3}
.vocab-context{margin:0!important;color:#475467;font-size:14px;line-height:1.45;min-width:0;font-style:normal!important}
.vocab-learned{display:flex;align-items:center;justify-content:center;gap:7px;font-size:13px;font-weight:700;color:#475467;white-space:nowrap}
.vocab-learned input{width:auto;margin:0}
.vocab-trash{width:36px;height:36px;padding:0;border:0;background:transparent;color:#667085;border-radius:8px;display:grid;place-items:center;cursor:pointer}
.vocab-trash:hover{background:#fef3f2;color:#b42318}
.vocab-trash svg{width:18px;height:18px}
@media(max-width:760px){.vocab-card{grid-template-columns:1fr auto!important;gap:8px 12px}.vocab-context{grid-column:1/-1;grid-row:2}.vocab-learned{justify-content:flex-start}.vocab-trash{grid-column:2;grid-row:1}}

.selection-tools{gap:7px!important;padding:6px!important;border-radius:12px!important}
.selection-tools .selection-icon{width:42px;height:42px;padding:0!important;border:0!important;border-radius:9px!important;display:grid;place-items:center;cursor:pointer}
.selection-tools .highlight-icon{background:#ffe88a!important;color:#172033!important}
.selection-tools .highlight-icon span{font-size:22px;font-weight:900;line-height:1}
.selection-tools .dictionary-icon{background:#fff!important;color:#172033!important}
.selection-tools .dictionary-icon svg{width:23px;height:23px}
.selection-tools .selection-icon:hover{transform:translateY(-1px)}

.selection-tools{gap:4px!important;padding:4px!important;border-radius:9px!important}
.selection-tools .selection-icon{width:31px!important;height:31px!important;border-radius:7px!important}
.selection-tools .highlight-icon span{font-size:16px!important}
.selection-tools .dictionary-icon svg{width:17px!important;height:17px!important}
.saved-vocab-mark{text-decoration:underline 1.5px #667085;text-underline-offset:3px;text-decoration-skip-ink:auto}

.selection-tools .remove-study-icon{background:#fff!important;color:#667085!important}
.selection-tools .remove-study-icon svg{width:15px!important;height:15px!important}
.vocab-context strong{font-weight:800;color:#172033}

.saved-vocab-mark{
  text-decoration-line:underline!important;
  text-decoration-style:solid!important;
  text-decoration-thickness:1.5px!important;
  text-underline-offset:3px!important;
  text-decoration-color:#667085!important;
  text-decoration-skip-ink:auto!important;
}
.user-highlight .saved-vocab-mark,.saved-vocab-mark .user-highlight{
  text-decoration-line:underline!important;
  text-decoration-thickness:1.5px!important;
  text-underline-offset:3px!important;
  text-decoration-color:#667085!important;
}
.vocab-duplicate-toast{position:fixed;z-index:10020;left:50%;bottom:28px;transform:translateX(-50%);background:#172033;color:#fff;padding:9px 13px;border-radius:9px;font-size:13px;font-weight:700;box-shadow:0 8px 24px rgba(16,24,40,.2)}

.mc-group:not(.ms-group) .mc-option{
  user-select:text!important;
  -webkit-user-select:text!important;
}
.mc-group:not(.ms-group) .mc-text{
  user-select:text!important;
  -webkit-user-select:text!important;
  cursor:text;
}

.user-highlight,.saved-vocab-mark{cursor:pointer}

/* Exercise Editor V1 */
.editor-toolbar{position:sticky;bottom:12px;z-index:25;background:rgba(255,255,255,.96);backdrop-filter:blur(10px);border:1px solid #dfe5ef;border-radius:14px;padding:10px 12px;box-shadow:0 8px 28px #17203318}
.editor-block-head{padding-bottom:10px;margin-bottom:10px;border-bottom:1px solid #eef1f5}.editor-block-type{font-weight:800;text-transform:capitalize}
.editor-field-label{font-size:12px;font-weight:750;color:#475467;margin:10px 0 5px}.editor-number{max-width:120px}
.editor-option-row{display:grid;grid-template-columns:34px 1fr auto auto;gap:8px;align-items:center;margin:7px 0}.editor-option-row input[type=radio],.editor-option-row input[type=checkbox]{width:auto}
.editor-option-row .mini-danger{padding:6px 9px}.editor-add-option{margin-top:8px}.block-picker{display:flex;gap:8px;flex-wrap:wrap;align-items:center}.block-picker select{width:auto;min-width:230px}
@media(max-width:700px){.editor-option-row{grid-template-columns:28px 1fr auto}.editor-toolbar{bottom:6px}}

.editor-shell{max-width:1120px;margin:0 auto}.editor-topbar{position:sticky;top:10px;z-index:30;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 14px;margin-bottom:14px;background:rgba(247,249,252,.96);backdrop-filter:blur(14px);border:1px solid #dfe5ef;border-radius:14px;box-shadow:0 8px 26px #1720330d}.editor-topbar-actions,.editor-layout-choices,.editor-add-bottom{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.editor-status-badge{padding:5px 10px;border-radius:999px;background:#eef2f7;font-size:12px;font-weight:800;color:#475467}.editor-meta-grid{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(220px,.7fr);gap:14px 16px}.editor-layout-choice{display:flex;align-items:center;gap:7px;border:1px solid #d0d7e2;border-radius:10px;padding:9px 12px;cursor:pointer}.editor-layout-choice input{width:auto;margin:0}.editor-add-bottom{justify-content:flex-start;padding-top:14px;margin-top:14px;border-top:1px dashed #d7dde7}.editor-add-bottom select{width:auto;min-width:230px}.editor-preview-modal{position:fixed;inset:0;z-index:100;background:#f5f7fb;overflow:auto;padding:18px}.editor-preview-modal.hide{display:none!important}.editor-preview-modal-inner{max-width:1280px;margin:auto}.editor-preview-modal-head{position:sticky;top:0;z-index:10;display:flex;justify-content:space-between;align-items:center;background:rgba(245,247,251,.96);padding:10px 0 14px}.editor-bottom-actions{display:flex;justify-content:flex-start;align-items:center;gap:10px;flex-wrap:wrap;margin:14px 0 42px}.editor-source-card{padding:0!important;overflow:hidden}.editor-source-head{padding:20px 22px 0}.editor-source-head h3{margin:0 0 4px}.editor-source-tabs{display:flex;gap:6px;padding:14px 22px 0}.editor-source-tab{border:0;background:#eef2f7;color:#475467;font-weight:800;padding:9px 16px;border-radius:9px 9px 0 0}.editor-source-tab.active{background:#2457e6;color:#fff}.editor-source-panel{padding:18px 22px 22px;border-top:1px solid #e6eaf0}.editor-source-panel textarea{min-height:210px;resize:vertical;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px;line-height:1.55;background:#fbfcfe}.editor-import-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px;flex-wrap:wrap}.editor-import-primary{padding:10px 18px}.editor-import-success{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:14px 0 0;padding:12px 14px;border:1px solid #b7e4c7;background:#f0fbf4;border-radius:11px}.editor-import-success strong{color:#15703d}.editor-structure{margin-top:14px;border:1px solid #e1e6ee;border-radius:13px;background:#fff;overflow:hidden}.editor-structure>summary{list-style:none;cursor:pointer;padding:15px 17px;display:flex;align-items:center;justify-content:space-between;gap:12px;font-weight:800}.editor-structure>summary::-webkit-details-marker{display:none}.editor-structure>summary:before{content:'›';font-size:22px;line-height:1;transition:transform .15s}.editor-structure[open]>summary:before{transform:rotate(90deg)}.editor-structure-summary{margin-left:auto;color:#667085;font-size:12px;font-weight:700}.editor-structure-body{border-top:1px solid #e8ebf0;padding:16px}.editor-empty-structure{color:#667085;font-size:13px;padding:4px 0}.editor-tools-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:10px}.editor-file-drop{border:1.5px dashed #b8c3d4;border-radius:12px;padding:28px;text-align:center;background:#fafbfe}.editor-file-drop input{max-width:420px;margin:12px auto 0}.editor-more{position:relative}.editor-more summary{cursor:pointer;padding:8px 10px;border:1px solid #d9dee7;border-radius:9px;background:#fff;font-weight:700;list-style:none}.editor-more summary::-webkit-details-marker{display:none}.editor-more-menu{position:absolute;right:0;top:42px;z-index:10;min-width:210px;background:#fff;border:1px solid #dfe4ec;border-radius:10px;box-shadow:0 12px 30px #17203318;padding:6px}.editor-more-menu button{width:100%;text-align:left;background:transparent}.editor-more-menu button:hover{background:#f3f6fb}.editor-pdf-note{margin-top:12px;padding:10px 12px;border-radius:9px;background:#fff7df;color:#7a5b00;font-size:13px}.editor-meta-card{padding:18px 22px!important}.editor-meta-card h3{margin:0 0 12px}.editor-title-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.editor-title-row h3{margin:0}.editor-bottom-actions .danger{margin-right:auto}@media(max-width:720px){.editor-meta-grid{grid-template-columns:1fr}.editor-topbar{position:sticky;top:4px}.editor-topbar strong{display:none}.editor-source-head,.editor-source-tabs,.editor-source-panel{padding-left:14px;padding-right:14px}.editor-source-panel textarea{min-height:180px}.editor-import-success{align-items:flex-start;flex-direction:column}.editor-add-bottom{flex-direction:column;align-items:stretch}.editor-add-bottom select{width:100%}}

/* ===== App Shell V3: compact classroom UI ===== */
:root{--sidebar-w:220px;--app-bg:#f6f8fc;--line:#e4e8f0;--ink:#172033;--muted:#667085;--blue:#2457e6}
body.app-mode{background:var(--app-bg)}
body.app-mode>.nav{display:none}
body.app-mode>.wrap{max-width:none;margin:0;padding:0}
body.app-mode #configWarn{display:none}
#app.app-shell{min-height:100vh;padding-left:var(--sidebar-w)}
.app-sidebar{position:fixed;inset:0 auto 0 0;width:var(--sidebar-w);z-index:60;background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column;padding:18px 12px}
.app-brand{font-weight:850;font-size:18px;padding:7px 10px 20px;letter-spacing:-.02em}.app-role{font-size:11px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.08em;padding:6px 10px}
.app-side-nav{display:flex;flex-direction:column;gap:4px}.app-side-nav button{width:100%;display:flex;align-items:center;justify-content:flex-start;gap:10px;background:transparent;padding:10px 11px;border-radius:9px;color:#344054;font-weight:650}.app-side-nav button:hover{background:#f2f5fa}.app-side-nav button.active{background:#edf3ff;color:#1f55cf}.side-icon{width:20px;text-align:center;font-size:15px}.app-sidebar-bottom{margin-top:auto;border-top:1px solid var(--line);padding-top:10px}.side-account{padding:9px 10px 5px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.side-account-role{padding:0 10px 8px;color:var(--muted);font-size:12px}.app-main{min-height:100vh;padding:24px clamp(18px,3vw,42px) 42px}.app-page-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin:0 auto 16px;max-width:1320px}.app-page-head h1{font-size:28px;letter-spacing:-.035em;margin:0 0 4px}.app-content{max-width:1320px;margin:auto}.app-content>.card:first-child{margin-top:0}.app-shell .card{box-shadow:0 2px 10px #17203308;border-color:var(--line)}
/* Focus mode: use nearly the whole viewport for exercises */
body.exercise-focus{--sidebar-w:64px;overflow:hidden}.exercise-focus .app-sidebar{width:64px;padding:12px 7px}.exercise-focus .app-brand{font-size:0;padding:8px 0 16px;text-align:center}.exercise-focus .app-brand:after{content:'EC';font-size:15px;font-weight:900}.exercise-focus .app-role,.exercise-focus .nav-label,.exercise-focus .app-sidebar-bottom{display:none}.exercise-focus .app-side-nav button{justify-content:center;padding:10px 6px}.exercise-focus .app-main{padding:8px 10px;height:100vh;overflow:hidden}.exercise-focus .app-page-head{display:none}.exercise-focus #studentWorkView{height:100%}.exercise-focus #studentWorkView>.card{height:100%;margin:0;padding:0;border-radius:10px;overflow:hidden;display:flex;flex-direction:column}.exercise-focus .student-work-head{padding:8px 12px;border-bottom:1px solid var(--line);min-height:48px;flex:none}.exercise-focus .student-work-head h2{font-size:17px!important}.exercise-focus #studentWorkMeta{font-size:11px}.exercise-focus #studentScore{flex:none}.exercise-focus #studentPreview{flex:1;min-height:0;border:0;border-radius:0;padding:0;background:#fff}.exercise-focus .reading-shell{height:100%!important;min-height:0!important;margin:0!important;border-radius:0!important}.exercise-focus .reading-passage{padding:20px 24px}.exercise-focus .reading-question-scroll{padding:0 18px 74px}.exercise-focus .reading-qnav{padding:8px 12px;gap:5px}.exercise-focus .reading-qnav button{min-width:32px;padding:5px 7px}.exercise-focus .reading-actions{padding:8px 12px}.exercise-focus .mc-group{margin:8px 0 20px}.exercise-focus .mc-option{min-height:44px!important;padding:9px 12px!important}.exercise-focus .instructions-block{margin:10px 0!important;padding:12px 14px!important}
@media(max-width:850px){:root{--sidebar-w:64px}.app-sidebar{width:64px;padding:12px 7px}.app-brand{font-size:0;padding:8px 0 16px;text-align:center}.app-brand:after{content:'EC';font-size:15px;font-weight:900}.app-role,.nav-label,.app-sidebar-bottom{display:none}.app-side-nav button{justify-content:center;padding:10px 6px}.app-main{padding:14px}.app-page-head h1{font-size:24px}}
@media(max-width:800px){body.exercise-focus{overflow:auto}.exercise-focus .app-main{height:auto;min-height:100vh;overflow:visible}.exercise-focus #studentWorkView,.exercise-focus #studentWorkView>.card{height:auto;min-height:100vh}.exercise-focus #studentPreview{min-height:0}.exercise-focus .reading-shell{height:auto!important}.exercise-focus .reading-passage{max-height:45vh}}

/* UI shell fix v2.1 — remove legacy shell and maximize exercise workspace */
body.app-mode > .nav{display:none!important}
body.app-mode{background:var(--app-bg)}
body.app-mode > .wrap{max-width:none!important;margin:0!important;padding:0!important}

/* General app shell */
.app-shell{display:block}
.app-main{width:100%}
.app-content{width:100%}

/* Exercise focus: use virtually the whole viewport for split reading */
body.exercise-focus{--sidebar-w:0px!important}
.exercise-focus .app-sidebar{display:none!important}
.exercise-focus #app.app-shell{padding-left:0!important}
.exercise-focus .app-main{padding:0!important;height:100vh!important;width:100vw!important}
.exercise-focus .app-content{max-width:none!important;width:100%!important;height:100%!important}
.exercise-focus #studentWorkView{height:100vh!important;width:100%!important}
.exercise-focus #studentWorkView>.card{
  height:100vh!important;width:100%!important;margin:0!important;padding:0!important;
  border:0!important;border-radius:0!important;box-shadow:none!important
}
.exercise-focus .student-work-head{
  min-height:46px!important;padding:6px 14px!important;background:#fff!important
}
.exercise-focus #studentPreview{height:calc(100vh - 46px)!important;min-height:0!important}
.exercise-focus .reading-shell{
  height:100%!important;width:100%!important;max-width:none!important;
  border-left:0!important;border-right:0!important;border-bottom:0!important
}
.exercise-focus .reading-passage{padding:18px 26px!important}
.exercise-focus .reading-question-scroll{padding:0 16px 66px!important}
.exercise-focus .reading-qnav{padding:7px 12px!important}
.exercise-focus .reading-actions{padding:7px 12px!important}
.exercise-focus .mc-option{min-height:42px!important;padding:8px 11px!important}
.exercise-focus .mc-prompt{margin-bottom:9px!important}
.exercise-focus .instruction-box{margin:6px 0 12px!important;padding:10px 13px!important}
@media(max-width:800px){
  .exercise-focus .app-main,.exercise-focus #studentWorkView,.exercise-focus #studentWorkView>.card{height:auto!important;min-height:100vh!important}
  .exercise-focus #studentPreview{height:auto!important}
}


/* Compact UI 2.2 — minimal page chrome + vocabulary workspace */
.app-page-head{margin-bottom:12px!important;align-items:center!important}.app-page-head h1{margin:0!important}.app-page-head .small,#appSubtitle{display:none!important}
#vocabularyView>.card{border:0!important;box-shadow:none!important;background:transparent!important;padding:0!important;margin:0!important}
.vocab-inner-title{display:none!important}
.vocab-toolbar{position:sticky;top:10px;z-index:12;display:grid!important;grid-template-columns:minmax(260px,1fr) 150px 150px auto;gap:8px!important;align-items:center!important;margin:0 0 10px!important;padding:8px;background:rgba(247,249,252,.96);backdrop-filter:blur(10px);border:1px solid var(--line);border-radius:12px}
.vocab-toolbar input,.vocab-toolbar select{margin:0!important;width:100%!important;max-width:none!important;height:40px!important;padding-top:7px!important;padding-bottom:7px!important}
#vocabCount{white-space:nowrap;text-align:right;padding:0 6px;color:#667085;font-weight:650}
.vocab-table-head{display:grid;grid-template-columns:minmax(150px,.8fr) minmax(320px,2.4fr) 110px 42px;gap:16px;padding:7px 14px;color:#667085;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}
.vocab-grid{gap:0!important;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:#fff}
.vocab-card{border:0!important;border-radius:0!important;border-bottom:1px solid #edf0f4!important;padding:9px 14px!important;min-height:58px!important;transition:background .12s}
.vocab-card:last-child{border-bottom:0!important}.vocab-card:hover{background:#fafbfc}
.vocab-word{font-size:16px!important;line-height:1.3!important}.vocab-context{font-size:13.5px!important;line-height:1.4!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.vocab-context.expanded{white-space:normal;overflow:visible}.vocab-learned{font-size:12px!important}.vocab-trash{width:32px!important;height:32px!important}.vocab-trash svg{width:16px!important;height:16px!important}
.vocab-empty{padding:24px;text-align:center;color:#667085}
@media(max-width:760px){.vocab-toolbar{position:static;grid-template-columns:1fr 1fr}.vocab-toolbar #vocabSearch{grid-column:1/-1}.vocab-toolbar #vocabCount{text-align:left}.vocab-table-head{display:none}.vocab-grid{border-radius:10px}.vocab-card{grid-template-columns:1fr auto!important;padding:10px 12px!important}.vocab-context{white-space:normal;grid-column:1/-1}}


/* UI 2.3 — vocabulary pagination + clean password modal */
.vocab-learned{display:flex!important;align-items:center!important;justify-content:center!important}
.vocab-learned input{margin:0!important;cursor:pointer}
.vocab-pagination{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 2px 0;color:#667085;font-size:13px}
.vocab-page-buttons{display:flex;align-items:center;gap:6px}
.vocab-page-buttons button{min-width:36px;height:34px;padding:5px 9px;background:#fff;border:1px solid var(--line)}
.vocab-page-buttons button.active{background:#245eea;color:#fff;border-color:#245eea}
.vocab-page-buttons button:disabled{opacity:.4;cursor:default}
#passwordPanel.pw-panel:not(.hide){display:block!important;position:fixed!important;z-index:220!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;width:min(460px,calc(100vw - 32px))!important;max-width:460px!important;margin:0!important;padding:22px!important;background:#fff!important;border:1px solid var(--line)!important;border-radius:16px!important;box-shadow:0 24px 80px #17203338!important}
body.password-open:after{content:'';position:fixed;inset:0;z-index:210;background:#10182866;backdrop-filter:blur(2px)}
body.password-open{overflow:hidden}
@media(max-width:760px){.vocab-pagination{align-items:flex-start;flex-direction:column}.vocab-page-buttons{width:100%;justify-content:flex-end}}


/* Reading Collection v1 */
.reading-collection{display:grid;grid-template-columns:168px minmax(0,1fr);height:min(82vh,900px);min-height:600px;margin:-18px;background:#fff;overflow:hidden}
.rc-topics{border-right:1px solid #e3e7ef;background:#f8fafc;padding:10px 8px;overflow:auto}
.rc-topics-title{font-size:10px;font-weight:850;letter-spacing:.12em;color:#667085;padding:7px 8px 9px}
.rc-topic-btn{width:100%;border:0;background:transparent;text-align:left;padding:9px 10px;border-radius:9px;font-size:13px;font-weight:700;color:#344054;margin:1px 0}
.rc-topic-btn:hover{background:#eef2f7}.rc-topic-btn.active{background:#eaf0ff;color:#2457e6}
.rc-main{min-width:0;display:flex;flex-direction:column;overflow:hidden}
.rc-tabs{height:46px;flex:none;display:flex;align-items:center;gap:5px;padding:6px 10px;border-bottom:1px solid #e3e7ef;background:#fff;overflow-x:auto;white-space:nowrap}
.rc-tab{border:1px solid #d7deea;background:#fff;padding:7px 11px;border-radius:9px;font-size:12px;font-weight:750;color:#475467}
.rc-tab.active{background:#2457e6;border-color:#2457e6;color:#fff}
.rc-tab .rc-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:#98a2b3;margin-left:5px;vertical-align:1px}
.rc-tab.has-answer .rc-dot{background:#12b76a}.rc-tab.complete .rc-dot{background:#fff}
.rc-sets{flex:1;min-height:0;overflow:hidden}.rc-set{display:none;height:100%}.rc-set.active{display:block}
.rc-set .reading-shell{height:100%;min-height:0;margin:0;border-radius:0}
.rc-set .reading-passage{padding:20px 24px}.rc-set .reading-question-scroll{padding:0 18px 74px}
.rc-set .reading-qnav{padding:8px 12px;gap:5px}.rc-set .reading-qnav button{min-width:32px;padding:5px 7px}.rc-set .reading-qnav button.active{border-color:#2457e6!important;box-shadow:0 0 0 2px rgba(36,87,230,.14);color:#2457e6;background:#fff}
.rc-collection-actions{position:absolute;right:14px;bottom:10px;z-index:15}
.exercise-focus .reading-collection{height:100%!important;min-height:0!important;margin:0!important}
.exercise-focus .rc-set .reading-shell{height:100%!important}
@media(max-width:900px){.reading-collection{grid-template-columns:132px minmax(0,1fr)}}
@media(max-width:700px){.reading-collection{display:block;height:auto;min-height:0;margin:-18px}.rc-topics{display:flex;gap:5px;border-right:0;border-bottom:1px solid #e3e7ef;overflow-x:auto;padding:7px}.rc-topics-title{display:none}.rc-topic-btn{width:auto;white-space:nowrap}.rc-main{overflow:visible}.rc-sets{overflow:visible}.rc-set{height:auto}.rc-set .reading-shell{height:auto}.rc-tabs{position:sticky;top:0;z-index:12}}


/* Reading Collection collapsible topic sidebar v2.8 */
.reading-collection{position:relative;transition:grid-template-columns .18s ease}
.reading-collection.rc-collapsed{grid-template-columns:0 minmax(0,1fr)}
.reading-collection.rc-collapsed .rc-topics{width:0;padding-left:0;padding-right:0;border-right:0;overflow:hidden;opacity:0;pointer-events:none}
.rc-topics{transition:width .18s ease,padding .18s ease,opacity .14s ease}
.rc-sidebar-toggle{
  position:absolute;left:154px;top:9px;z-index:30;
  width:28px;height:28px;border:1px solid #d7deea;border-radius:8px;
  background:#fff;color:#475467;display:grid;place-items:center;
  padding:0;font-size:17px;line-height:1;box-shadow:0 1px 3px rgba(16,24,40,.06)
}
.rc-sidebar-toggle:hover{background:#f2f4f7}
.reading-collection.rc-collapsed .rc-sidebar-toggle{left:8px}
.reading-collection.rc-collapsed .rc-tabs{padding-left:45px}
@media(max-width:700px){
  .reading-collection,.reading-collection.rc-collapsed{display:block}
  .reading-collection.rc-collapsed .rc-topics{display:none}
  .rc-sidebar-toggle{left:auto;right:8px;top:8px}
  .reading-collection.rc-collapsed .rc-sidebar-toggle{left:auto;right:8px}
  .reading-collection.rc-collapsed .rc-tabs{padding-left:10px;padding-right:44px}
}


/* Reading Collection v3.0 — reference layout + precise question tracking */
.reading-collection{height:calc(100vh - 58px)!important;min-height:0!important;margin:0!important}
.rc-main{position:relative}
.rc-tabs{height:36px;padding:3px 8px 0;background:#eef2f7;align-items:flex-end;gap:5px}
.rc-tab{height:32px;max-width:300px;overflow:hidden;text-overflow:ellipsis;border:1px solid #d4dce8;border-bottom-color:#c7d0dd;background:#e8edf4;border-radius:8px 8px 0 0;padding:0 12px;font-size:12px;font-weight:700;color:#667085;box-shadow:none;transition:background .14s ease,color .14s ease,border-color .14s ease,box-shadow .14s ease,transform .14s ease}
.rc-tab.active{background:#fff;color:#155eef;border-color:#155eef;border-bottom-color:#fff;box-shadow:inset 0 3px 0 #155eef;font-weight:800;position:relative;z-index:2}.rc-tab:not(.active):hover{background:#f4f6f9;color:#344054;border-color:#bfc9d8}.rc-tab.active .rc-dot{background:#155eef}
.rc-set .reading-shell{height:100%!important;grid-template-rows:minmax(0,1fr)!important}
.rc-set .reading-passage{padding:24px 34px 36px!important;overflow-y:auto!important;border-right:0}
.rc-set .reading-questions{position:relative;display:grid!important;grid-template-rows:auto minmax(0,1fr) auto!important;min-height:0!important;overflow:hidden!important}
.rc-set .reading-question-scroll{min-height:0!important;height:auto!important;overflow-y:auto!important;padding:18px 22px 28px!important}
.rc-set .reading-qnav{position:relative!important;top:auto!important;z-index:10;background:#fff;border-bottom:1px solid #e4e7ec;padding:9px 16px!important;flex:none}
.rc-set .reading-qnav button.active{border-color:#2457e6!important;box-shadow:0 0 0 2px rgba(36,87,230,.18)!important;background:#fff!important;color:#101828!important}
.rc-set .reading-qnav button.answered:not(.active){background:#eef4ff}
/* Reading question status: answer state wins over active/answered styling */
.rc-set .reading-qnav button.nav-correct{background:#ecfdf3!important;border-color:#12b76a!important;color:#087443!important;box-shadow:none!important}
.rc-set .reading-qnav button.nav-wrong{background:#fef3f2!important;border-color:#f04438!important;color:#b42318!important;box-shadow:none!important}
.rc-set .reading-qnav button.active.nav-correct{outline:2px solid #12b76a!important;outline-offset:2px!important}
.rc-set .reading-qnav button.active.nav-wrong{outline:2px solid #f04438!important;outline-offset:2px!important}
html[data-theme="dark"] .rc-set .reading-qnav button.nav-correct{background:#123627!important;border-color:#31895c!important;color:#8ce8b4!important}
html[data-theme="dark"] .rc-set .reading-qnav button.nav-wrong{background:#48201f!important;border-color:#a34a45!important;color:#ffaaa3!important}

.rc-set .reading-actions{position:relative!important;left:auto!important;right:auto!important;bottom:auto!important;width:100%!important;margin:0!important;padding:10px 22px!important;border-top:1px solid #e4e7ec;background:#fff;display:flex;gap:8px;z-index:20}
.rc-set .reading-actions button{margin:0!important}
.reading-collection>.rc-main>.reading-actions{display:none!important}
.rc-question-anchor{scroll-margin-top:12px}.rc-question-anchor>.block:first-child{margin-top:0}
.exercise-focus .reading-collection{height:100vh!important}
@media(max-width:700px){
 .reading-collection{height:auto!important}
 .rc-set .reading-questions{display:block!important}
 .rc-set .reading-actions{position:sticky!important;bottom:0!important}
}


/* Reading Collection v3.1 — exact anchor + persistent question actions */
.rc-set .reading-questions{height:100%!important;min-height:0!important}
.rc-set .reading-question-scroll{position:relative!important;min-height:0!important;overflow-y:auto!important}
.rc-set .reading-actions{
  display:flex!important;visibility:visible!important;opacity:1!important;
  min-height:58px!important;flex:0 0 58px!important;
  position:relative!important;z-index:40!important;
  background:#fff!important;border-top:1px solid #e4e7ec!important;
  padding:9px 22px!important
}
.rc-question-anchor{scroll-margin-top:12px}


/* Reading Collection v3.2 — passage text clipping fix */
.rc-set .reading-shell{
  min-height:0!important;
  overflow:hidden!important;
}
.rc-set .reading-passage{
  box-sizing:border-box!important;
  min-width:0!important;
  min-height:0!important;
  height:100%!important;
  max-height:none!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior:contain;
  padding:24px 34px 72px!important;
  scrollbar-gutter:stable;
}
.rc-set .reading-passage .passage-body,
.rc-set .reading-passage .rich-passage,
.rc-set .reading-passage .passage-text{
  max-height:none!important;
  height:auto!important;
  overflow:visible!important;
}
.rc-set .reading-passage p:last-child{margin-bottom:24px!important}


/* Reading Collection v3.3 — viewport-fit action bar fix */
.reading-collection{
  height:var(--rc-viewport-height, calc(100dvh - 120px))!important;
  max-height:var(--rc-viewport-height, calc(100dvh - 120px))!important;
  min-height:420px!important;
  overflow:hidden!important;
}
.rc-main,.rc-set,.rc-set .reading-shell,.rc-set .reading-questions{
  min-height:0!important;
}
.rc-set .reading-actions{
  flex:0 0 auto!important;
  min-height:58px!important;
  position:relative!important;
  bottom:auto!important;
  transform:none!important;
  z-index:60!important;
}


/* Reading Collection v3.4 — restore source-style tested-term underline */
.reading-tested-term{
  text-decoration-line:underline!important;
  text-decoration-style:solid!important;
  text-decoration-thickness:1.5px!important;
  text-underline-offset:2px!important;
  text-decoration-color:currentColor!important;
  font-weight:inherit!important;
}


/* Reading Collection v4.0 — tested term emphasis rebuilt */
.mc-prompt [data-tested-term="1"]{
  text-decoration-line:underline!important;
  text-decoration-style:solid!important;
  text-decoration-thickness:2px!important;
  text-underline-offset:3px!important;
  text-decoration-color:currentColor!important;
}



/* Student Assignments v2 — compact list */
.student-assignments-page{padding:0!important}
.student-assignment-shell{width:100%}
.sa-toolbar{display:flex;align-items:center;gap:8px;margin:0 0 12px;flex-wrap:wrap}
.sa-filter{height:36px;padding:0 13px;border:1px solid #d8e0eb;border-radius:9px;background:#fff;color:#475467;font-weight:700;font-size:13px;cursor:pointer}
.sa-filter.active{background:#eaf2ff;border-color:#9bbcff;color:#155eef}
.sa-count{margin-left:auto;color:#667085;font-size:13px;font-weight:700}
.sa-list{border:1px solid #dfe5ee;border-radius:12px;background:#fff;overflow:hidden}
.sa-row{display:grid;grid-template-columns:92px minmax(0,1fr) auto;gap:14px;align-items:center;min-height:78px;padding:12px 16px;border-bottom:1px solid #e9edf3;cursor:pointer;transition:background .12s ease}
.sa-row:last-child{border-bottom:0}
.sa-row:hover{background:#f8fafc}
.sa-row.disabled{cursor:default;opacity:.68}
.sa-status{display:inline-flex;justify-content:center;align-items:center;width:76px;height:27px;border-radius:999px;background:#eef2f6;color:#475467;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.02em}
.sa-status.done{background:#ecfdf3;color:#087443}
.sa-status.late{background:#fef3f2;color:#b42318}
.sa-status.progress{background:#eef4ff;color:#2457e6}
.sa-main{min-width:0}
.sa-title{font-size:16px;font-weight:800;color:#101828;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sa-meta{margin-top:5px;color:#667085;font-size:13px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sa-open{display:flex;align-items:center;gap:6px;color:#155eef;font-size:13px;font-weight:800;white-space:nowrap}
.sa-row.disabled .sa-open{color:#667085}
.sa-empty{padding:28px;text-align:center;color:#667085;background:#fff;border:1px solid #dfe5ee;border-radius:12px}
@media(max-width:700px){
 .sa-row{grid-template-columns:1fr auto;gap:8px;min-height:88px}
 .sa-status{grid-column:1/2;justify-self:start}
 .sa-main{grid-column:1/2}
 .sa-open{grid-column:2;grid-row:1/3}
 .sa-count{width:100%;margin-left:0}
}


/* ===== Dark Mode v1 ===== */
:root{
  color-scheme:light;
}
html[data-theme="dark"]{
  color-scheme:dark;
  --dm-bg:#0f172a;
  --dm-panel:#111827;
  --dm-panel-2:#182235;
  --dm-border:#2b3950;
  --dm-text:#e8edf5;
  --dm-muted:#9eabc0;
  --dm-blue:#6ea8ff;
  --dm-blue-soft:#172b4d;
  --dm-green:#53d18d;
  --dm-red:#ff8b82;
}
html[data-theme="dark"] body{background:var(--dm-bg)!important;color:var(--dm-text)!important}
html[data-theme="dark"] .app-shell,
html[data-theme="dark"] main,
html[data-theme="dark"] .main,
html[data-theme="dark"] .page-content,
html[data-theme="dark"] .content,
html[data-theme="dark"] #studentAssignmentsView,
html[data-theme="dark"] #vocabularyView{background:var(--dm-bg)!important;color:var(--dm-text)!important}
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] aside,
html[data-theme="dark"] .app-sidebar{background:#111827!important;border-color:var(--dm-border)!important;color:var(--dm-text)!important}
html[data-theme="dark"] .card,
html[data-theme="dark"] .assignment-card,
html[data-theme="dark"] .sa-list,
html[data-theme="dark"] .sa-empty,
html[data-theme="dark"] .vocab-card,
html[data-theme="dark"] .student-preview,
html[data-theme="dark"] .reading-pane,
html[data-theme="dark"] .reading-passage,
html[data-theme="dark"] .reading-questions,
html[data-theme="dark"] .reading-question-scroll,
html[data-theme="dark"] .reading-collection,
html[data-theme="dark"] .collection-reading,
html[data-theme="dark"] .collection-panel{background:var(--dm-panel)!important;border-color:var(--dm-border)!important;color:var(--dm-text)!important}
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] label,
html[data-theme="dark"] .sa-title,
html[data-theme="dark"] .vocab-word{color:var(--dm-text)!important}
html[data-theme="dark"] .small,
html[data-theme="dark"] .sa-meta,
html[data-theme="dark"] .sa-count,
html[data-theme="dark"] .vocab-context{color:var(--dm-muted)!important}
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select{background:#111827!important;color:var(--dm-text)!important;border-color:#3a4961!important}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{color:#7f8ca1!important}
html[data-theme="dark"] button:not(.primary):not(.mc-option):not(.sa-filter),
html[data-theme="dark"] .btn:not(.primary){background:#1b2638;color:var(--dm-text);border-color:#34435a}
html[data-theme="dark"] .sa-filter{background:#172033;color:#b8c3d4;border-color:#34435a}
html[data-theme="dark"] .sa-filter.active{background:var(--dm-blue-soft);color:#8bb8ff;border-color:#4778c8}
html[data-theme="dark"] .sa-row{border-color:#27354a}
html[data-theme="dark"] .sa-row:hover{background:#172235}
html[data-theme="dark"] .sa-open{color:#8bb8ff}
html[data-theme="dark"] .status-chip,
html[data-theme="dark"] .sa-status{background:#263247;color:#c2ccda}
html[data-theme="dark"] .status-chip.done,
html[data-theme="dark"] .sa-status.done{background:#123627;color:#72dda4}
html[data-theme="dark"] .status-chip.progress,
html[data-theme="dark"] .sa-status.progress{background:#172e58;color:#8bb8ff}
html[data-theme="dark"] .status-chip.late,
html[data-theme="dark"] .sa-status.late{background:#48201f;color:#ffaaa3}
html[data-theme="dark"] .mc-option,
html[data-theme="dark"] .builder-mc-option{background:#131d2c!important;border-color:#35445b!important;color:var(--dm-text)!important}
html[data-theme="dark"] .mc-group:not(.ms-group) .mc-option:hover{background:#1b293d!important;border-color:#536784!important}
html[data-theme="dark"] .mc-group:not(.ms-group) .mc-option.selected{background:#172e58!important;border-color:#6295f5!important;color:#a9c8ff!important}
html[data-theme="dark"] .mc-group:not(.ms-group) .mc-option.correct,
html[data-theme="dark"] .mc-group:not(.ms-group) .mc-option.revealed{background:#123627!important;border-color:#31895c!important;color:#8ce8b4!important}
html[data-theme="dark"] .mc-group:not(.ms-group) .mc-option.wrong{background:#48201f!important;border-color:#a34a45!important;color:#ffaaa3!important}
html[data-theme="dark"] .reading-qnav,
html[data-theme="dark"] .reading-question-nav,
html[data-theme="dark"] .collection-tabs,
html[data-theme="dark"] .reading-tabs{background:#111827!important;border-color:var(--dm-border)!important}
html[data-theme="dark"] .reading-qnav button,
html[data-theme="dark"] .reading-question-nav button,
html[data-theme="dark"] .collection-tab,
html[data-theme="dark"] .reading-tab{background:#162033!important;color:#d8e0eb!important;border-color:#35445b!important}
html[data-theme="dark"] .reading-qnav button.active,
html[data-theme="dark"] .reading-question-nav button.active,
html[data-theme="dark"] .collection-tab.active,
html[data-theme="dark"] .reading-tab.active{background:#244a88!important;color:#fff!important;border-color:#6ea8ff!important}
html[data-theme="dark"] .user-highlight{background:#725e13!important;color:#fff4bd!important}
html[data-theme="dark"] .saved-vocab-mark{text-decoration-color:#a9b8cc!important}
html[data-theme="dark"] .vocab-table-head{color:#9eabc0!important}
html[data-theme="dark"] .vocab-toolbar{border-color:var(--dm-border)!important}
html[data-theme="dark"] .vocab-dialog{background:#111827!important;color:var(--dm-text)!important}
html[data-theme="dark"] .selection-tools{background:#253247!important}
html[data-theme="dark"] .selection-tools button{background:#111827!important;color:var(--dm-text)!important}
html[data-theme="dark"] a{color:#8bb8ff}
html[data-theme="dark"] hr{border-color:var(--dm-border)!important}

/* Fixed floating theme toggle: remains accessible in normal pages and reading focus. */
.theme-toggle{
  position:fixed;right:16px;bottom:16px;z-index:12050;
  width:42px;height:42px;padding:0;border:1px solid #d5dce7;border-radius:12px;
  display:flex;align-items:center;justify-content:center;
  background:#fff;color:#344054;box-shadow:0 5px 18px rgba(16,24,40,.13);
  cursor:pointer;font-size:18px;line-height:1;
}
.theme-toggle:hover{transform:translateY(-1px)}
html[data-theme="dark"] .theme-toggle{background:#182235!important;color:#f2f5f9!important;border-color:#3b4a61!important;box-shadow:0 5px 20px rgba(0,0,0,.35)}
@media(max-width:700px){.theme-toggle{right:10px;bottom:10px;width:40px;height:40px}}


/* ===== Sidebar v2 — compact navigation ===== */
.app-shell{grid-template-columns:220px minmax(0,1fr)!important}
.app-sidebar{
  width:220px!important;
  padding:18px 12px 12px!important;
  gap:0!important;
  overflow:hidden!important;
}
.app-brand{
  padding:0 8px!important;
  margin:0!important;
  font-size:17px!important;
  line-height:1.25!important;
  font-weight:800!important;
  letter-spacing:-.02em!important;
  white-space:nowrap!important;
}
.app-role{
  padding:0 8px!important;
  margin:4px 0 18px!important;
  font-size:10px!important;
  line-height:1.2!important;
  font-weight:800!important;
  text-transform:uppercase!important;
  letter-spacing:.11em!important;
  color:#98a2b3!important;
}
.app-side-nav{display:flex!important;flex-direction:column!important;gap:3px!important}
.app-side-nav.hide{display:none!important}
.app-side-nav button{
  position:relative!important;
  min-height:38px!important;
  height:38px!important;
  width:100%!important;
  padding:0 10px!important;
  border:0!important;
  border-radius:8px!important;
  display:grid!important;
  grid-template-columns:22px minmax(0,1fr)!important;
  align-items:center!important;
  gap:8px!important;
  background:transparent!important;
  color:#475467!important;
  box-shadow:none!important;
  text-align:left!important;
  font-size:13px!important;
  font-weight:700!important;
}
.app-side-nav button:hover{background:#f2f4f7!important;color:#101828!important}
.app-side-nav button.active{
  background:#eef4ff!important;
  color:#155eef!important;
  border:0!important;
  box-shadow:none!important;
}
.app-side-nav button.active::before{
  content:""!important;
  position:absolute!important;
  left:0!important;
  top:7px!important;
  bottom:7px!important;
  width:3px!important;
  border-radius:0 3px 3px 0!important;
  background:#155eef!important;
}
.side-icon{
  width:22px!important;height:22px!important;
  display:flex!important;align-items:center!important;justify-content:center!important;
  font-size:13px!important;line-height:1!important;font-weight:800!important;
}
.nav-label{min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
.app-sidebar-bottom{
  margin-top:auto!important;
  padding:12px 0 0!important;
  border-top:1px solid #e4e7ec!important;
}
.side-account-block{padding:0 10px 9px!important}
.side-account{
  margin:0!important;
  font-size:13px!important;
  line-height:1.3!important;
  font-weight:800!important;
  color:#101828!important;
  overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;
}
.side-account-role{
  margin-top:2px!important;
  font-size:11px!important;
  line-height:1.25!important;
  color:#98a2b3!important;
}
.side-utility-nav{gap:1px!important}
.side-utility-nav button{height:34px!important;min-height:34px!important;font-size:12px!important}
.side-utility-nav button:last-child{color:#667085!important}

/* Dark sidebar */
html[data-theme="dark"] .app-sidebar{background:#101828!important;border-color:#253044!important}
html[data-theme="dark"] .app-brand{color:#f2f4f7!important}
html[data-theme="dark"] .app-role{color:#667085!important}
html[data-theme="dark"] .app-side-nav button{background:transparent!important;color:#cbd5e1!important;border:0!important}
html[data-theme="dark"] .app-side-nav button:hover{background:#182235!important;color:#f8fafc!important}
html[data-theme="dark"] .app-side-nav button.active{background:#182842!important;color:#8bb8ff!important}
html[data-theme="dark"] .app-side-nav button.active::before{background:#6ea8ff!important}
html[data-theme="dark"] .app-sidebar-bottom{border-color:#2b3950!important}
html[data-theme="dark"] .side-account{color:#f2f4f7!important}
html[data-theme="dark"] .side-account-role{color:#7f8ca1!important}
html[data-theme="dark"] .side-utility-nav button:last-child{color:#aeb9c9!important}

/* no floating theme control in v4.6 */
.theme-toggle{display:none!important}

@media(max-width:900px){
  .app-shell{grid-template-columns:200px minmax(0,1fr)!important}
  .app-sidebar{width:200px!important}
}


/* ===== UI v4.7 — unmistakable dashboard refresh ===== */
:root{--side-w:236px}
.app-shell{grid-template-columns:var(--side-w) minmax(0,1fr)!important;background:#f6f8fc!important}
.app-sidebar{width:var(--side-w)!important;background:#fff!important;border-right:1px solid #e6eaf0!important;padding:22px 14px 14px!important;box-shadow:1px 0 0 rgba(16,24,40,.02)!important}
.app-brand{font-size:18px!important;letter-spacing:-.025em!important;padding:0 10px!important;color:#101828!important}
.app-role{font-size:10px!important;margin:5px 0 24px!important;padding:0 10px!important;color:#98a2b3!important}
.app-side-nav{gap:6px!important}
.app-side-nav button{height:42px!important;min-height:42px!important;border-radius:10px!important;padding:0 11px!important;font-size:13px!important;color:#475467!important;transition:background .15s,color .15s,transform .15s!important}
.app-side-nav button:hover{background:#f5f7fa!important;transform:translateX(2px)!important}
.app-side-nav button.active{background:#eff4ff!important;color:#1849a9!important;font-weight:800!important}
.app-side-nav button.active::before{left:-14px!important;top:7px!important;bottom:7px!important;width:4px!important;border-radius:0 4px 4px 0!important;background:#2e6cf6!important}
.side-icon{font-size:12px!important;color:inherit!important}
.app-sidebar-bottom{padding-top:14px!important;border-top:1px solid #eaecf0!important}
.side-account-block{padding:0 10px 12px!important}
.side-account{font-size:13px!important}.side-account-role{font-size:11px!important}
.side-utility-nav button{height:36px!important;min-height:36px!important;font-size:12px!important}
.app-main{background:#f6f8fc!important}
.app-page-head{padding:28px 36px 14px!important;border:0!important;background:transparent!important}
.app-page-head h1{font-size:27px!important;letter-spacing:-.035em!important;margin:0!important;color:#101828!important}
.app-content{padding:0 36px 36px!important;max-width:1240px!important;width:100%!important;margin:0 auto!important}

/* Assignment page — cleaner dashboard */
.sa-toolbar{margin:0 0 14px!important;gap:7px!important}
.sa-filter{height:34px!important;border-radius:999px!important;padding:0 14px!important;border:1px solid #dfe5ee!important;background:#fff!important;font-size:12px!important;color:#667085!important;box-shadow:0 1px 2px rgba(16,24,40,.03)!important}
.sa-filter.active{background:#101828!important;border-color:#101828!important;color:#fff!important}
.sa-count{font-size:12px!important;color:#98a2b3!important}
.sa-list{border:1px solid #e4e8ef!important;border-radius:14px!important;box-shadow:0 2px 8px rgba(16,24,40,.035)!important}
.sa-row{grid-template-columns:82px minmax(0,1fr) 72px!important;min-height:82px!important;padding:14px 18px!important;gap:16px!important;background:#fff!important}
.sa-row:hover{background:#fbfcfe!important}
.sa-status{width:70px!important;height:25px!important;font-size:10px!important;letter-spacing:.04em!important}
.sa-title{font-size:15px!important;letter-spacing:-.01em!important}
.sa-meta{font-size:12px!important;color:#7b8495!important}
.sa-open{justify-content:flex-end!important;font-size:12px!important;color:#175cd3!important}

/* Dark v4.7 */
html[data-theme="dark"] .app-shell,html[data-theme="dark"] .app-main{background:#0b1220!important}
html[data-theme="dark"] .app-sidebar{background:#0f172a!important;border-color:#202b3d!important}
html[data-theme="dark"] .app-brand,html[data-theme="dark"] .app-page-head h1{color:#f8fafc!important}
html[data-theme="dark"] .app-side-nav button{color:#b8c2d2!important}
html[data-theme="dark"] .app-side-nav button:hover{background:#172033!important;color:#fff!important}
html[data-theme="dark"] .app-side-nav button.active{background:#172554!important;color:#bfdbfe!important}
html[data-theme="dark"] .app-sidebar-bottom{border-color:#263247!important}
html[data-theme="dark"] .sa-filter{background:#111c2e!important;border-color:#29364c!important;color:#aeb9c9!important}
html[data-theme="dark"] .sa-filter.active{background:#eaf2ff!important;border-color:#eaf2ff!important;color:#102a56!important}
html[data-theme="dark"] .sa-list{border-color:#263247!important;box-shadow:none!important}
html[data-theme="dark"] .sa-row{background:#101a2c!important;border-color:#263247!important}
html[data-theme="dark"] .sa-row:hover{background:#142035!important}
html[data-theme="dark"] .sa-title{color:#f1f5f9!important}
html[data-theme="dark"] .sa-meta{color:#94a3b8!important}

@media(max-width:900px){:root{--side-w:210px}.app-content{padding-left:22px!important;padding-right:22px!important}.app-page-head{padding-left:22px!important;padding-right:22px!important}}

/* ===== Exam Mode V1 ===== */
.exam-shell{height:100%;min-height:560px;display:flex;flex-direction:column;background:#fff;overflow:hidden}
.exam-top{flex:none;border-bottom:1px solid #e4e8f0;background:#fff}
.exam-summary{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:10px 16px 6px}
.exam-title{font-weight:850;font-size:16px;color:#172033;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.exam-progress{font-size:12px;font-weight:750;color:#667085;white-space:nowrap}
.exam-tabs{display:flex;gap:6px;overflow-x:auto;padding:4px 12px 9px;scrollbar-width:thin}
.exam-tab{flex:0 0 auto;min-width:106px;text-align:left;border:1px solid #d8dfeb;background:#fff;color:#475467;padding:7px 10px;border-radius:9px}
.exam-tab.active{background:#2457e6;border-color:#2457e6;color:#fff}
.exam-tab-title{display:block;font-size:12px;font-weight:800}
.exam-tab-sub{display:block;font-size:10px;opacity:.78;margin-top:2px}
.exam-tab-count{display:block;font-size:10px;font-weight:750;margin-top:3px}
.exam-body{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) 188px}
.exam-sections{min-width:0;overflow:hidden}
.exam-section{display:none;height:100%;overflow:auto;padding:18px 22px 90px}
.exam-section.active{display:block}
.exam-section-head{margin:0 0 16px;padding-bottom:10px;border-bottom:1px solid #edf0f4}
.exam-section-head h3{margin:0;font-size:18px}.exam-section-head .small{margin-top:3px}
.exam-section .exam-question-anchor{scroll-margin-top:14px}
.exam-navigator{border-left:1px solid #e4e8f0;background:#fafbfc;padding:12px;overflow:auto}
.exam-nav-title{font-size:11px;font-weight:850;letter-spacing:.08em;color:#667085;margin:2px 0 9px}
.exam-qgrid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.exam-qbtn{height:34px;min-width:0;padding:0;border:0;background:transparent;color:#344054;font-size:12px;font-weight:800;border-radius:7px}
.exam-qbtn.active{background:#e5e7eb;color:#172033;outline:0}
.exam-qbtn.answered{background:#e8f0ff;color:#2457e6}
.exam-qbtn.nav-correct{background:#ecfdf3;color:#087443}
.exam-qbtn.nav-wrong{background:#fef3f2;color:#b42318}
.exam-actions{position:absolute;left:0;right:188px;bottom:0;z-index:18;display:flex;gap:8px;align-items:center;padding:9px 14px;border-top:1px solid #e4e8f0;background:rgba(255,255,255,.97);backdrop-filter:blur(8px)}
.exam-shell{position:relative}
.exam-actions .exam-submit{margin-left:auto}
.exam-part-score{font-size:12px;font-weight:750;color:#667085;margin-left:4px}
.exercise-focus .exam-shell{height:100%!important;min-height:0!important}
@media(max-width:800px){
  .exam-shell{height:auto;min-height:0;overflow:visible}
  .exam-body{display:block}.exam-navigator{border-left:0;border-top:1px solid #e4e8f0}
  .exam-qgrid{grid-template-columns:repeat(8,1fr)}
  .exam-section{height:auto;overflow:visible;padding:14px 14px 84px}
  .exam-actions{right:0;position:sticky}
}
@media(max-width:520px){.exam-qgrid{grid-template-columns:repeat(5,1fr)}.exam-tab{min-width:94px}}

/* ===== Exam presentation V2 ===== */
.exam-section{padding-top:14px}
.exam-section-head{display:none!important}
.exam-section .mc-group:not(.ms-group) .mc-option{align-items:flex-start!important}
.exam-section .mc-group:not(.ms-group) .mc-label{padding-top:0;line-height:1.45;align-self:flex-start}
.exam-section .mc-group:not(.ms-group) .mc-text{align-self:flex-start}
.exam-arrangement .exam-arr-qno{font-weight:850;font-size:1.02em;margin:0 0 8px}
.exam-arrangement .exam-arr-text{font-weight:600;line-height:1.55;margin:0 0 12px;white-space:normal}
.exam-arrangement .exam-arr-line{display:block;margin:1px 0}
.exam-arrangement .exam-arr-line:first-child{margin-top:0}
.exam-arrangement .mc-prompt{display:none}
.exam-arrangement .mc-group{margin-top:0}
.exam-compact-cloze{display:block;margin:7px 0 18px}
.exam-compact-cloze .mc-group{margin:0}
.exam-compact-cloze .mc-prompt{display:none}
.exam-compact-cloze .mc-options{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important}
.exam-compact-cloze .mc-option{min-height:40px!important;padding:8px 10px!important;border-radius:9px!important}
.exam-compact-cloze .mc-label{min-width:20px!important}
.exam-reading-split{display:grid;grid-template-columns:minmax(0,54fr) 7px minmax(0,46fr);height:100%;min-height:520px;margin:-14px -22px -90px;overflow:hidden;background:#fff}
.exam-reading-passage,.exam-reading-questions{min-width:0;overflow:auto}
.exam-reading-passage{padding:24px 28px;border-right:1px solid #e3e7ef}
.exam-reading-questions{padding:18px 22px 100px;scroll-behavior:smooth}
.exam-reading-resizer{cursor:col-resize;background:#e8edf5;position:relative;touch-action:none}
.exam-reading-resizer:after{content:'';position:absolute;left:2px;top:46%;width:3px;height:42px;border-radius:4px;background:#aeb8c8}
.exam-reading-split .reading-passage-paragraph{text-indent:1.7em}
.exam-reading-split .reading-passage-title+.reading-passage-text .reading-passage-paragraph:first-child{margin-top:0}
.exam-reading-split .exam-question-anchor{scroll-margin-top:12px}
@media(max-width:1050px){.exam-compact-cloze .mc-options{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:800px){.exam-reading-split{display:block;height:auto;min-height:0;margin:-14px -14px -84px}.exam-reading-resizer{display:none}.exam-reading-passage{max-height:48vh;border-right:0;border-bottom:1px solid #e3e7ef}.exam-reading-questions{overflow:visible;padding:16px 14px 90px}}
@media(max-width:600px){.exam-compact-cloze .mc-options{grid-template-columns:1fr!important}}

/* ===== Exam Mode V4 — sticky global navigator + collapsible parts + adaptive options ===== */
.exam-shell{height:100%;min-height:560px;display:flex;flex-direction:column;overflow:hidden!important}
.exam-top{position:relative;z-index:35;flex:0 0 auto}.exam-summary{min-height:42px}
.exam-global-nav{display:flex;align-items:center;gap:12px;padding:8px 14px;border-top:1px solid var(--exam-border);background:var(--exam-panel);position:sticky;top:0;z-index:36}
.exam-global-nav .exam-nav-title{margin:0;flex:0 0 auto}.exam-global-nav .exam-qgrid{display:flex;gap:5px;overflow-x:auto;min-width:0;scrollbar-width:thin;padding:2px 1px 4px}.exam-global-nav .exam-qbtn{flex:0 0 34px}.exam-global-nav .exam-qbtn.exam-nav-hidden{display:none!important}
.exam-body{flex:1;min-height:0;display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;overflow:hidden}
.exam-parts-sidebar{width:190px;min-width:190px;border-right:1px solid var(--exam-border);background:var(--exam-panel-soft);padding:10px 8px;overflow-y:auto;transition:width .2s ease,min-width .2s ease,padding .2s ease}.exam-parts-sidebar.collapsed{width:48px;min-width:48px;padding:10px 6px}
.exam-parts-toggle{width:100%;height:34px;border:1px solid var(--exam-border);background:var(--exam-panel);color:var(--exam-text);border-radius:9px;margin-bottom:8px;font-weight:850}.exam-parts-sidebar .exam-tabs{display:flex!important;flex-direction:column;gap:6px;padding:0!important;overflow:visible!important}.exam-parts-sidebar .exam-tab{width:100%;min-width:0!important;padding:9px 10px!important;border-radius:9px!important}.exam-parts-sidebar.collapsed .exam-tab{height:38px;padding:0!important;display:flex;align-items:center;justify-content:center}.exam-parts-sidebar.collapsed .exam-tab-title{font-size:0}.exam-parts-sidebar.collapsed .exam-tab-title:after{content:attr(data-short);font-size:12px;font-weight:900}.exam-parts-sidebar.collapsed .exam-tab-sub,.exam-parts-sidebar.collapsed .exam-tab-count{display:none}
.exam-sections{min-width:0;min-height:0;overflow:hidden!important}.exam-section{height:100%!important;min-height:0!important;overflow:hidden!important;padding:0!important}.exam-section.active{display:block!important}.exam-unified-split{height:100%!important;min-height:0!important;overflow:hidden!important;display:grid;grid-template-columns:minmax(0,52fr) 7px minmax(0,48fr)}
.exam-source-pane,.exam-question-pane{height:100%;min-height:0;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain;scrollbar-gutter:stable}.exam-source-pane{padding:24px 28px 110px}.exam-question-pane{padding:18px 20px 110px}.exam-actions{left:190px!important;right:0!important;transition:left .2s ease}.exam-shell.parts-collapsed .exam-actions{left:48px!important}
.exam-question-pane .mc-options.exam-options-4{grid-template-columns:repeat(4,minmax(0,1fr))!important}.exam-question-pane .mc-options.exam-options-2{grid-template-columns:repeat(2,minmax(0,1fr))!important}.exam-question-pane .mc-options.exam-options-1{grid-template-columns:1fr!important}.exam-question-pane .mc-option{min-width:0!important;height:auto!important;min-height:44px!important;align-items:flex-start!important;justify-content:flex-start!important;text-align:left!important;overflow:visible!important}.exam-question-pane .mc-label{flex:0 0 auto;align-self:flex-start!important;padding-top:0!important}.exam-question-pane .mc-text{min-width:0;white-space:normal!important;overflow-wrap:anywhere;word-break:normal;line-height:1.42;text-align:left!important}.exam-question-pane .exam-compact-cloze .mc-options{gap:8px!important}
.exam-source-pane .reading-passage-paragraph{white-space:pre-line;text-indent:1.7em}.exam-source-pane .reading-passage-paragraph strong,.exam-source-pane .reading-passage-paragraph b{font-weight:800!important;color:inherit}.exam-source-pane .reading-passage-paragraph u{text-decoration-thickness:1.5px;text-underline-offset:3px}.exam-source-arrangement-q{font-weight:850;margin:0 0 8px}.exam-source-arrangement-lines{display:block}.exam-source-arrangement-line{display:block;line-height:1.55;margin:2px 0}.exam-source-arrangement-line.subline{padding-left:1.15em;text-indent:-1.15em}
html[data-theme="dark"] .exam-global-nav{background:#101827!important;border-color:#2b384d!important}html[data-theme="dark"] .exam-parts-sidebar{background:#0d1625!important;border-color:#2b384d!important}html[data-theme="dark"] .exam-parts-toggle{background:#152033!important;border-color:#34445d!important;color:#d7e0ec!important}html[data-theme="dark"] .exam-parts-sidebar .exam-tab{background:#111c2e!important;border-color:#30405a!important;color:#aebbd0!important}html[data-theme="dark"] .exam-parts-sidebar .exam-tab.active{background:#1f55d5!important;border-color:#4f8cff!important;color:#eef5ff!important}
@media(max-width:900px){.exam-body{grid-template-columns:1fr!important;overflow:visible!important}.exam-parts-sidebar{width:100%!important;min-width:0!important;border-right:0;border-bottom:1px solid var(--exam-border);padding:7px 10px!important;overflow-x:auto;overflow-y:hidden}.exam-parts-toggle{display:none}.exam-parts-sidebar .exam-tabs{flex-direction:row!important;overflow-x:auto!important}.exam-parts-sidebar .exam-tab{width:auto;min-width:112px!important}.exam-sections{overflow:visible!important}.exam-section{height:auto!important;overflow:visible!important}.exam-unified-split{display:block!important;height:auto!important;overflow:visible!important}.exam-source-pane,.exam-question-pane{height:auto!important;max-height:none!important;overflow:visible!important}.exam-actions,.exam-shell.parts-collapsed .exam-actions{left:0!important}.exam-question-pane .mc-options.exam-options-4,.exam-question-pane .mc-options.exam-options-2{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:560px){.exam-question-pane .mc-options{grid-template-columns:1fr!important}}


/* ===== Exam Mode V5 — single renderer / fixed workspace / full tracking ===== */
.exam-v5{height:calc(100vh - 150px)!important;min-height:620px!important;max-height:920px!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;border:1px solid var(--exam-border,#d8dfeb);border-radius:12px}
.exam-v5 .exam-top{flex:0 0 auto!important;position:relative!important;z-index:20!important;background:var(--exam-panel,#fff)!important}
.exam-v5 .exam-summary{padding:9px 12px 5px!important}
.exam-v5 .exam-global-nav{display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;align-items:start!important;gap:10px!important;padding:5px 12px 9px!important;border-top:1px solid var(--exam-border,#e4e8f0)!important}
.exam-v5 .exam-global-nav .exam-qgrid{display:grid!important;grid-template-columns:repeat(20,minmax(30px,1fr))!important;gap:5px!important;overflow:visible!important;padding:0!important}
.exam-v5 .exam-global-nav .exam-qbtn{display:block!important;width:auto!important;min-width:30px!important;height:32px!important}
.exam-v5 .exam-body{flex:1 1 auto!important;min-height:0!important;display:grid!important;grid-template-columns:190px minmax(0,1fr)!important;overflow:hidden!important}
.exam-v5 .exam-parts-sidebar{height:100%!important;min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important;border-right:1px solid var(--exam-border,#e4e8f0)!important;border-left:0!important;padding:10px!important;background:var(--exam-soft,#f8fafc)!important}
.exam-v5 .exam-sections{height:100%!important;min-height:0!important;overflow:hidden!important}
.exam-v5 .exam-section{height:100%!important;min-height:0!important;overflow:hidden!important}
.exam-v5 .exam-unified-split{height:100%!important;min-height:0!important;display:grid!important;grid-template-columns:minmax(0,52fr) 7px minmax(0,48fr)!important;overflow:hidden!important}
.exam-v5 .exam-source-pane,.exam-v5 .exam-question-pane{height:100%!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain!important;scrollbar-gutter:stable!important}
.exam-v5 .exam-source-pane{padding:22px 28px 90px!important}
.exam-v5 .exam-question-pane{padding:18px 18px 90px!important}
.exam-v5 .exam-unified-resizer{height:100%!important;cursor:col-resize!important;background:var(--exam-border,#e4e8f0)!important;position:relative!important;z-index:4!important}
.exam-v5 .exam-unified-resizer:hover{background:#8eabf5!important}
.exam-v5 .exam-actions{position:absolute!important;left:190px!important;right:0!important;bottom:0!important;z-index:30!important}
.exam-v5.parts-collapsed .exam-body{grid-template-columns:54px minmax(0,1fr)!important}.exam-v5.parts-collapsed .exam-actions{left:54px!important}
.exam-v5 .exam-question-pane .mc-options.exam-options-4{grid-template-columns:repeat(4,minmax(0,1fr))!important}
.exam-v5 .exam-question-pane .mc-options.exam-options-2{grid-template-columns:repeat(2,minmax(0,1fr))!important}
.exam-v5 .exam-question-pane .mc-options.exam-options-1{grid-template-columns:1fr!important}
.exam-v5 .exam-question-pane .mc-option{width:100%!important;min-width:0!important;min-height:46px!important;height:auto!important;padding:11px 13px!important;display:flex!important;align-items:flex-start!important;justify-content:flex-start!important;gap:9px!important;overflow:visible!important}
.exam-v5 .exam-question-pane .mc-label{flex:0 0 auto!important;line-height:1.42!important;align-self:flex-start!important}
.exam-v5 .exam-question-pane .mc-text{display:block!important;min-width:0!important;white-space:normal!important;overflow-wrap:normal!important;word-break:normal!important;hyphens:none!important;line-height:1.42!important;text-align:left!important}
html[data-theme="dark"] .exam-v5{--exam-panel:#111827;--exam-soft:#0f1726;--exam-border:#2d3d55;--exam-text:#d8e0ec;background:#111827!important}
html[data-theme="dark"] .exam-v5 .exam-top,html[data-theme="dark"] .exam-v5 .exam-source-pane,html[data-theme="dark"] .exam-v5 .exam-question-pane{background:#111827!important;color:#d8e0ec!important}
html[data-theme="dark"] .exam-v5 .exam-parts-sidebar{background:#0d1625!important}
html[data-theme="dark"] .exam-v5 .exam-question-pane .mc-option{background:#142033!important;border-color:#344862!important;color:#d8e0ec!important}
html[data-theme="dark"] .exam-v5 .exam-question-pane .mc-option.selected{background:#18396d!important;border-color:#4f8cff!important;color:#e8f1ff!important}
html[data-theme="dark"] .exam-v5 .exam-qbtn{background:#142033!important;border-color:#344862!important;color:#d8e0ec!important}
html[data-theme="dark"] .exam-v5 .exam-qbtn.answered{background:#17325f!important;border-color:#4f7fd7!important;color:#b9d2ff!important}
html[data-theme="dark"] .exam-v5 .exam-qbtn.nav-correct{background:#123b2c!important;border-color:#2d8b63!important;color:#a7e7c8!important}
html[data-theme="dark"] .exam-v5 .exam-qbtn.nav-wrong{background:#48201f!important;border-color:#a34b48!important;color:#ffc0bc!important}
@media(max-width:1100px){.exam-v5 .exam-global-nav .exam-qgrid{grid-template-columns:repeat(10,minmax(30px,1fr))!important}.exam-v5 .exam-question-pane .mc-options.exam-options-4{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:800px){.exam-v5{height:auto!important;max-height:none!important;min-height:0!important}.exam-v5 .exam-body{display:block!important}.exam-v5 .exam-parts-sidebar{height:auto!important;overflow:auto!important}.exam-v5 .exam-unified-split{display:block!important;height:auto!important}.exam-v5 .exam-source-pane,.exam-v5 .exam-question-pane{height:auto!important;overflow:visible!important}.exam-v5 .exam-actions{left:0!important;position:sticky!important}.exam-v5 .exam-global-nav .exam-qgrid{grid-template-columns:repeat(8,minmax(30px,1fr))!important}.exam-v5 .exam-question-pane .mc-options.exam-options-2,.exam-v5 .exam-question-pane .mc-options.exam-options-4{grid-template-columns:1fr!important}}


/* v6 — extensible importer foundation */
.pdf-pipeline{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:14px 0 12px}.pdf-pipeline>i{font-style:normal;color:var(--muted)}.pdf-step{display:flex;align-items:center;gap:7px;padding:7px 10px;border:1px solid var(--line);border-radius:999px;color:var(--muted);background:var(--card)}.pdf-step b{display:grid;place-items:center;width:20px;height:20px;border-radius:50%;background:var(--soft);font-size:12px}.pdf-step.active{color:var(--text);border-color:#8db3ff}.pdf-step.active b{background:#2f63e9;color:white}.pdf-import-actions{margin:8px 0 12px}.pdf-analysis-report{border:1px solid var(--line);border-radius:14px;padding:14px;background:var(--soft);margin-top:10px}.pdf-analysis-report h4{margin:0 0 8px}.pdf-report-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:10px}.pdf-report-stat{background:var(--card);border:1px solid var(--line);border-radius:10px;padding:10px}.pdf-report-stat b{display:block;font-size:18px}.engine-badge{display:inline-flex;align-items:center;padding:3px 8px;border-radius:999px;border:1px solid var(--line);font-size:12px;margin:2px 3px 2px 0}.engine-badge.supported{background:#eaf8ef;color:#166534}.engine-badge.review{background:#fff7df;color:#8a5a00}html[data-theme="dark"] .engine-badge.supported{background:#123322;color:#9be3b1}html[data-theme="dark"] .engine-badge.review{background:#392d12;color:#ffd980}@media(max-width:700px){.pdf-report-grid{grid-template-columns:1fr}.pdf-pipeline{gap:5px}.pdf-step{padding:6px 8px}}

/* Tabbed Exercise v1 — one exercise, multiple layout-aware tabs */
.exercise-tabs-shell{display:flex;flex-direction:column;min-height:0;background:#fff;border-radius:12px;overflow:hidden}
.exercise-tabs-bar{display:flex;gap:5px;align-items:flex-end;padding:3px 10px 0;border-bottom:1px solid #dfe5ee;background:#f5f7fb;overflow-x:auto;white-space:nowrap}
.exercise-tab-btn{height:32px;padding:0 14px;border:1px solid #d5dce8;border-bottom-color:#c8d1df;border-radius:8px 8px 0 0;background:#e9edf4;color:#667085;font-size:13px;font-weight:750}
.exercise-tab-btn:hover{background:#f8fafc;color:#344054}
.exercise-tab-btn.active{position:relative;z-index:2;background:#fff;color:#155eef;border-color:#9bb7ff;border-bottom-color:#fff;box-shadow:inset 0 3px 0 #2457e6}
.exercise-tab-panel{display:none;min-height:0;padding:18px 20px 22px;background:#fff}
.exercise-tab-panel.active{display:block}
.exercise-tab-panel[data-tab-layout="split_reading"]{padding:0}
.exercise-tab-panel[data-tab-layout="split_reading"] .reading-shell{margin:0;height:min(76vh,820px)}
.exercise-focus .exercise-tabs-shell{height:100%;border-radius:0}
.exercise-focus .exercise-tabs-bar{flex:0 0 36px;padding-top:3px}
.exercise-focus .exercise-tab-panel.active{flex:1;min-height:0;overflow:auto}
.exercise-focus .exercise-tab-panel[data-tab-layout="split_reading"].active{display:block;overflow:hidden;height:calc(100% - 47px)}
.exercise-focus .exercise-tab-panel[data-tab-layout="split_reading"] .reading-shell{height:100%!important;min-height:0!important}
html[data-theme="dark"] .exercise-tabs-shell,html[data-theme="dark"] .exercise-tab-panel{background:var(--dm-panel)!important;color:var(--dm-text)!important}
html[data-theme="dark"] .exercise-tabs-bar{background:#172033!important;border-color:var(--dm-border)!important}
html[data-theme="dark"] .exercise-tab-btn{background:#1b2638;color:#aebbd0;border-color:#34435a}
html[data-theme="dark"] .exercise-tab-btn.active{background:var(--dm-panel);color:#8bb8ff;border-color:#4778c8;border-bottom-color:var(--dm-panel)}
@media(max-width:800px){.exercise-tab-panel{padding:14px}.exercise-tab-panel[data-tab-layout="split_reading"]{padding:0}.exercise-tab-panel[data-tab-layout="split_reading"] .reading-shell{height:auto}}
