:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#1d2a40;background:#f4f7fb;font-size:14px}*{box-sizing:border-box}body{margin:0}button,input,textarea{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.45}button,.as-button{padding:11px 15px;border-radius:10px;font-weight:700;border:1px solid transparent;white-space:nowrap;display:inline-flex;align-items:center;justify-content:center;gap:6px}button:focus-visible,.as-button:focus-within,input:focus-visible,textarea:focus-visible{outline:3px solid #9ac1ff;outline-offset:2px}.primary{background:#355ad2;color:#fff}.primary:hover:not(:disabled){background:#2345b6}.outline{background:#fff;color:#304665;border-color:#d5dfea}.outline:hover:not(:disabled),.quiet:hover{background:#eaf0fc}.quiet{background:transparent;color:#dce7ff;border-color:#6176a9}.compact{padding:7px 12px}.top{background:#1d376a;color:white;display:flex;justify-content:space-between;align-items:center;gap:14px;padding:13px max(20px,calc((100vw - 1510px)/2));min-height:73px}.brand{display:flex;gap:12px;align-items:center}.brand strong{display:block;font-size:18px}.brand small{font-size:10px;letter-spacing:2px;color:#bbcaf0}.robot{border-radius:12px;background:#4767a4;font-size:24px;padding:9px}.header-actions,.heading-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}#saveStatus{font-size:12px;color:#c1d2fa;margin-right:6px}.shell{max-width:1540px;margin:auto;padding:30px 24px 45px}.heading{display:flex;justify-content:space-between;gap:15px;align-items:center;margin-bottom:25px}.eyebrow{font-size:11px;color:#416ac7;font-weight:800;letter-spacing:1.3px}.heading h1{font-size:29px;margin:5px 0 7px;letter-spacing:-.7px}.heading p{color:#6a7890;margin:0;max-width:720px}.steps{display:flex;align-items:center;background:white;border:1px solid #e2e8f2;border-radius:17px;padding:12px 20px;margin-bottom:20px;box-shadow:0 3px 13px #1c3d6910}.step{display:flex;gap:11px;align-items:center;background:transparent;border:0;text-align:left;color:#738099;flex:0 0 auto;padding:10px 5px}.step>span{width:36px;height:36px;border-radius:50%;background:#ebeff6;color:#718097;display:grid;place-items:center;font-size:16px}.step strong,.step small{display:block}.step small{font-weight:400;font-size:12px;margin-top:2px}.step.active{color:#244fc5}.step.active>span{background:#355ad2;color:white}.step.complete>span{background:#e1f6e9;color:#14834b}.step-line{flex:1;height:2px;background:#e7ebf3;margin:0 19px}.hidden{display:none!important}.upload-card{background:white;border:2px dashed #c9d7ee;min-height:375px;border-radius:20px;text-align:center;padding:54px 24px}.upload-icon{display:inline-grid;place-items:center;width:68px;height:68px;border-radius:18px;background:#e9effd;font-size:32px}.upload-card h2{margin:16px 0 7px;font-size:24px}.upload-card p{color:#667993;max-width:475px;margin:0 auto 20px}.upload-card .big{padding:13px 28px}.upload-card .tiny{margin:15px auto}.muted{color:#77859a}.tiny{font-size:12px!important;line-height:1.5}.how{display:grid;grid-template-columns:repeat(3,1fr);gap:13px;margin-top:17px}.how>div{background:#fff;border:1px solid #e5eaf3;border-radius:14px;padding:20px;display:flex;flex-direction:column;gap:5px}.how b{color:#416bd0}.how span{color:#74839a}.work-layout{display:grid;grid-template-columns:300px minmax(0,1fr);gap:17px;align-items:start}.sidebar,.workspace{background:white;border:1px solid #e2e8f2;border-radius:16px;box-shadow:0 2px 12px #1c3d6910;overflow:hidden}.side-section{padding:20px;border-bottom:1px solid #e9edf4}.side-section label{font-size:12px;font-weight:750;color:#405371;display:block;margin-bottom:7px}.side-section input,.side-section textarea{display:block;width:100%;border:1px solid #ccd7e5;border-radius:8px;padding:10px;color:#1d2a40;margin-bottom:12px;background:white}.side-section textarea{resize:vertical}.side-section input:focus,.side-section textarea:focus{outline:2px solid #b0c8f8}.caption-label{margin-top:16px}.file-info{display:flex;gap:10px;align-items:center;background:#f4f7fd;border-radius:10px;padding:11px;min-width:0}.file-info>span{font-size:25px}.file-info div{min-width:0}.file-info strong,.file-info small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-info small{color:#73829b;margin-top:4px}.side-title{display:flex;justify-content:space-between;align-items:center}.side-title h3{font-size:16px;margin:0}.side-title span{background:#e9efff;color:#2a57c3;padding:3px 9px;border-radius:99px;font-weight:800}.window-list{margin-top:13px;display:flex;flex-direction:column;gap:8px}.list-item{border:1px solid #d9e2ef;border-radius:10px;padding:10px;background:#fff;display:flex;align-items:center;gap:7px}.list-item.selected{border-color:#486ee7;background:#f1f5ff}.list-item .select-item{flex:1;text-align:left;background:transparent;border:0;padding:1px;color:#344760;font-weight:650;white-space:normal}.list-item .mini-remove{border:0;color:#bd4450;background:transparent;padding:4px 6px;font-size:17px}.answer-editor{margin-top:15px;border-top:1px solid #e2e8f3;padding-top:16px}.answer-editor>strong{display:block;margin-bottom:15px}.answer-editor small{display:block;color:#8290a3;margin:-7px 0 16px}.danger-text{background:transparent;border:0;color:#bb3345;padding:4px 0}.workspace-bar,.workspace-footer{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:18px 21px}.workspace-bar{border-bottom:1px solid #e7edf5}.workspace-bar h2{margin:0 0 5px;font-size:18px}.workspace-bar p{margin:0;color:#728099;font-size:12px}.bar-actions,.footer-actions{display:flex;align-items:center;gap:8px;white-space:nowrap}.bar-actions>span{color:#61718a;font-size:12px}.divider-v{height:25px;border-left:1px solid #dbe2ef;margin:0 6px}.viewport{min-height:560px;max-height:70vh;overflow:auto;background:#e8edf6;display:flex;align-items:flex-start;justify-content:center;padding:27px;position:relative}.page-surface,.crop-surface{position:relative;flex-shrink:0;box-shadow:0 6px 24px #19365b2b;background:white;line-height:0}.page-surface canvas,.crop-surface canvas{display:block}.overlay{position:absolute;inset:0;cursor:crosshair;touch-action:none}.shape{position:absolute;border:2px solid #315ee3;background:#4478fc20;color:#214fcb;border-radius:3px;cursor:pointer;display:flex;align-items:flex-start;justify-content:flex-start;line-height:1.2}.shape.selected{border-color:#ff962b;background:#ffc16c29}.shape.answer{border-color:#1a9c69;background:#1a9c6920}.shape.answer.selected{border-color:#ec8a22;background:#f9ac2327}.shape .tag{background:#305bd5;color:white;padding:3px 5px;font-size:10px;font-weight:800;line-height:1.1;pointer-events:none}.shape.answer .tag{background:#159b69}.shape.selected .tag{background:#e4841c}.rubber{position:absolute;border:2px dashed #e77f25;background:#ffa93130;pointer-events:none}.workspace-footer{border-top:1px solid #e8edf4}.workspace-footer #bottomHelp{color:#8290a4;font-size:12px;max-width:500px}.message{position:fixed;bottom:20px;right:20px;background:#173664;color:white;padding:13px 18px;border-radius:10px;box-shadow:0 8px 30px #0017;display:none;max-width:380px;z-index:5}.message.show{display:block}@media(max-width:950px){.work-layout{grid-template-columns:245px minmax(0,1fr)}.top,.heading,.workspace-bar,.workspace-footer{flex-wrap:wrap}.viewport{padding:14px}.bar-actions{flex-wrap:wrap}}@media(max-width:650px){.shell{padding:18px 10px}.work-layout{grid-template-columns:1fr}.steps{padding:7px}.step{gap:4px}.step small{display:none}.step strong{font-size:11px}.step-line{margin:0 5px}.how{grid-template-columns:1fr}.top{padding:12px}.header-actions{gap:5px}.header-actions button{padding:8px}.sidebar{order:2}.workspace{order:1}.viewport{min-height:380px}}

/* Answer-editing window expands to make full use of the available editor. */
body:has(#answerSidebar:not(.hidden)) .viewport{min-height:72vh;max-height:none;align-items:center}
.viewport:fullscreen{width:100vw;height:100vh;max-height:none;padding:28px;align-items:center;background:#e8edf6}

/* V1.2: Direct answer entry and adjustable drawing rectangles */
.shape{touch-action:none;overflow:visible;min-width:0;min-height:0}
.shape .tag{position:absolute;top:-20px;left:-2px;white-space:nowrap;z-index:2}
.shape.answer{display:flex;align-items:center;justify-content:center;padding:4px 7px}
.shape.answer .inline-answer{display:block;width:100%;height:100%;min-width:0;min-height:20px;border:0;outline:0;background:transparent;font-size:clamp(12px,1.15vw,20px);text-align:center;color:#153e2a;font-weight:750;line-height:1.2;touch-action:auto;cursor:text;padding:0;box-sizing:border-box}
.shape.answer .inline-answer::placeholder{color:#527862a8;font-weight:500;font-size:clamp(10px,1vw,14px)}
.shape.manipulating{z-index:10}
.resize-handle{position:absolute;width:13px;height:13px;border:2px solid white;background:#315ee3;border-radius:3px;z-index:4;box-shadow:0 1px 4px #1235;touch-action:none}
.shape.answer .resize-handle{background:#159b69}
.shape.selected .resize-handle{background:#eb891c}
.resize-handle.nw{top:-7px;left:-7px;cursor:nwse-resize}
.resize-handle.ne{top:-7px;right:-7px;cursor:nesw-resize}
.resize-handle.sw{bottom:-7px;left:-7px;cursor:nesw-resize}
.resize-handle.se{bottom:-7px;right:-7px;cursor:nwse-resize}
.inline-guidance{font-size:12px;color:#53647c;line-height:1.55;background:#eef4ff;padding:10px;border-radius:9px;margin:10px 0 17px}

/* V1.4: vertical question navigation on answer-editing step */
.question-stack-heading{font-size:12px;font-weight:800;color:#526585;margin:16px 0 9px}
.question-stack{display:flex;flex-direction:column;gap:9px;max-height:410px;overflow-y:auto;padding:2px 3px 5px 1px}
.question-card{width:100%;min-width:0;display:flex;align-items:center;gap:11px;text-align:left;background:#fff;color:#334866;border:1px solid #d8e2ef;border-radius:12px;padding:12px 11px;white-space:normal}
.question-card:hover{background:#f4f7fe;border-color:#93adef}
.question-card.active{background:#edf3ff;border:2px solid #4169e1;padding:11px 10px;color:#244fc0}
.question-number{width:34px;height:34px;flex:0 0 34px;border-radius:9px;display:grid;place-items:center;background:#e9eef8;color:#456188;font-size:16px;font-weight:800}
.question-card.active .question-number{background:#4169e1;color:#fff}
.question-details{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.question-details strong{font-size:14px}
.question-details small{font-size:11px;color:#7a899d;font-weight:500}
.question-arrow{font-size:23px;font-weight:400;color:#8394ae}
.question-card.active .question-arrow{color:#4169e1}
.question-answer-heading{border-top:1px solid #e2e8f3;padding-top:15px;margin:16px 0 9px;font-size:12px;font-weight:800;color:#526585}
#answerList>.list-item{margin-top:7px}

/* V1.5: live thumbnail of page one of the uploaded PDF */
.file-info .pdf-thumbnail{width:54px;height:70px;flex:0 0 54px;border-radius:5px;border:1px solid #dde5ef;background:#fff;display:flex;align-items:center;justify-content:center;overflow:hidden;box-shadow:0 1px 4px #23354b16}
.file-info #pdfThumbnail{display:block;width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain}
.file-info .file-details{min-width:0;flex:1}

/* V1.6: Clickable teacher PDF library. All thumbnails render from real PDF bytes. */
.library-view{max-width:1220px;margin:auto}.library-header{display:flex;justify-content:space-between;align-items:center;gap:20px;margin:9px 0 29px}.library-header h1{font-size:34px;letter-spacing:-1px;margin:6px 0 7px}.library-header p{color:#6a7890;margin:0}.library-header .primary{padding:14px 19px}.library-tools{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:21px}.library-search{display:flex;align-items:center;gap:11px;width:min(100%,450px);border:1px solid #d6e0ee;background:white;padding:0 14px;border-radius:12px;color:#7890aa;box-shadow:0 2px 9px #19365b08}.library-search span{font-size:26px}.library-search input{border:0;outline:none;background:transparent;width:100%;padding:14px 0;color:#21334b}.library-count{font-weight:650;color:#6b7e98;font-size:13px}.library-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(235px,1fr));gap:21px}.library-card{min-width:0;background:white;border:1px solid #e1e8f3;border-radius:17px;overflow:hidden;box-shadow:0 3px 12px #1b3f7110;transition:transform .14s,box-shadow .14s}.library-card:hover{transform:translateY(-3px);box-shadow:0 9px 27px #1b3f7120}.library-card-open{width:100%;display:block;padding:0;border:none;border-radius:0;background:none;text-align:left;white-space:normal;color:inherit}.library-preview{height:228px;display:flex;justify-content:center;align-items:center;background:#ebf0f8;padding:14px;overflow:hidden}.library-paper{display:flex;align-items:center;justify-content:center;width:fit-content;height:100%;max-width:100%;background:white;box-shadow:0 5px 15px #263a5c25;overflow:hidden}.library-paper canvas{max-height:100%;max-width:100%;width:auto;height:auto;object-fit:contain}.library-card-body{padding:18px 17px;display:flex;flex-direction:column;gap:8px;min-height:118px}.library-card-title{font-size:16px;line-height:1.25;overflow-wrap:anywhere}.library-card-meta{color:#8390a4;font-size:12px}.library-card-edit{color:#315dd4;font-size:12px;font-weight:800;margin-top:2px}.library-card-footer{border-top:1px solid #edf0f6;margin:0 17px;padding:10px 0;display:flex;justify-content:space-between;align-items:center;gap:7px}.library-card-footer span{font-size:11px;color:#8390a4}.library-delete{background:none;border:0;color:#ad4054;font-size:11px;padding:4px 2px}.library-delete:hover{text-decoration:underline}.library-empty{text-align:center;padding:60px 20px;background:white;border:1px dashed #cbd6e7;border-radius:16px}.library-empty>div{font-size:42px}.library-empty p{color:#7c899d}.library-footnote{color:#8290a3;font-size:12px;line-height:1.6;margin-top:25px}@media(max-width:700px){.library-header,.library-tools{align-items:stretch;flex-direction:column}.library-header h1{font-size:28px}.library-grid{grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:12px}.library-preview{height:180px}}

.library-dedupe{border:1px solid #ccd5e6;background:#fff;color:#34549a;border-radius:10px;padding:9px 12px;cursor:pointer;font-weight:700}.library-dedupe:hover{background:#eaf0ff}.library-dedupe.hidden{display:none}

/* V1.8: Student reading and optional self-checking; deliberately no student tracking. */
.student-view{max-width:1320px;margin:auto}.student-heading,.student-practice-top{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:8px 0 25px}.student-heading h1,.student-practice-top h1{font-size:32px;margin:5px 0}.student-heading p,.student-practice-top p{color:#6e7d94;margin:0}.student-search{display:flex;align-items:center;gap:10px;border:1px solid #d4dfef;border-radius:12px;background:#fff;padding:0 16px;max-width:460px;margin-bottom:23px;font-size:26px;color:#6b80a0}.student-search input{padding:16px 4px;border:0;outline:0;flex:1;min-width:0;font:inherit;font-size:15px}.student-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(235px,1fr));gap:20px}.student-tile{display:flex;flex-direction:column;text-align:left;padding:0;overflow:hidden;border:1px solid #dbe4f2;border-radius:16px;background:#fff;color:#243650;cursor:pointer}.student-tile:hover,.student-tile:focus-visible{outline:3px solid #b5c9ff}.student-tile-preview{height:220px;display:grid;place-items:center;padding:15px;background:#eaf0f9}.student-tile-preview canvas{max-width:100%;max-height:100%;box-shadow:0 4px 16px #2237}.student-tile-body{display:flex;flex-direction:column;gap:9px;padding:18px}.student-tile-body strong{font-size:17px}.student-tile-body small{color:#7485a0}.student-tile-body b{color:#285fd1}.student-empty{padding:35px;background:#fff;border-radius:15px;color:#61748e}.student-practice-layout{display:grid;grid-template-columns:230px minmax(0,1fr);gap:19px}.student-questions{background:#fff;border:1px solid #dce5f2;border-radius:16px;padding:19px;align-self:start;max-height:75vh;overflow:auto}.student-questions h2{font-size:17px;margin:0 0 16px}.student-question-list{display:flex;flex-direction:column;gap:8px}.student-q-btn{text-align:left;border:1px solid #d9e3f1;border-radius:11px;background:#fff;padding:13px;display:flex;flex-direction:column;gap:4px;font-weight:750;color:#334a68}.student-q-btn small{font-size:11px;color:#8390a6}.student-q-btn.active{background:#eaf1ff;border-color:#4269e4;color:#2854c5}.student-main{min-width:0;overflow:hidden;background:#fff;border:1px solid #dce5f2;border-radius:17px}.student-question-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:17px 21px;border-bottom:1px solid #e0e7f2}.student-question-bar strong{font-size:20px}.student-question-bar span{color:#72829c;font-size:13px}.student-canvas-area{min-height:470px;background:#e8edf6;display:flex;align-items:center;justify-content:center;padding:24px;overflow:auto}.student-page{position:relative;max-width:100%;max-height:75vh;background:#fff;box-shadow:0 8px 22px #21354a18}.student-page canvas{display:block;max-width:100%;max-height:75vh;width:auto;height:auto}.student-answer-overlay{position:absolute;inset:0}.student-answer-box{position:absolute;box-sizing:border-box;border:2px solid #3482e0;background:#f3f8ffeb;border-radius:6px;display:flex;align-items:center;justify-content:center;min-width:15px;min-height:17px;overflow:visible}.student-answer-box input{display:block;width:100%;height:100%;min-width:0;min-height:0;border:0;background:transparent;text-align:center;font-weight:750;font-size:clamp(12px,1.4vw,19px);outline:0;color:#203f76;padding:2px}.student-answer-box:focus-within{outline:3px solid #91b3fd}.student-answer-box.correct{background:#dcfae7;border-color:#1c9960}.student-answer-box.incorrect{background:#fff0e8;border-color:#d58331}.student-answer-box .check-one{position:absolute;right:0;top:100%;margin-top:5px;padding:5px 9px;border-radius:7px;background:#315ed4;color:white;border:0;font-size:12px;white-space:nowrap;z-index:3}.student-feedback{padding:18px 22px;border-top:1px solid #e0e7f2;display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap}.student-feedback #studentFeedbackText{font-weight:650;color:#435a77}.student-feedback #studentFeedbackText.good{color:#138050}.student-feedback #studentFeedbackText.try{color:#99581f}.student-actions{display:flex;gap:8px}.student-actions button{white-space:nowrap}.top .header-actions #studentModeBtn{font-weight:800;color:#2557c4}.student-view.hidden{display:none}@media(max-width:780px){.student-practice-layout{grid-template-columns:1fr}.student-questions{max-height:none}.student-question-list{display:flex;flex-direction:row;overflow-x:auto}.student-q-btn{min-width:125px}.student-canvas-area{padding:12px;min-height:330px}.student-heading,.student-practice-top{flex-wrap:wrap}.student-heading h1,.student-practice-top h1{font-size:25px}}

/* V1.9 access and assignment management */
body:not(.teacher-unlocked) #saveBtn,body:not(.teacher-unlocked) #newBtn,body:not(.teacher-unlocked) #openBtn,body:not(.teacher-unlocked) #libraryBtn{display:none!important}
body:not(.teacher-unlocked) #libraryView,body:not(.teacher-unlocked) #editorView{display:none!important}
.teacher-tabs{display:flex;gap:8px;margin:0 0 21px;flex-wrap:wrap}
.teacher-tab{padding:12px 19px;border:1px solid #d5dfec;border-radius:11px;background:white;color:#475d7b;font-weight:750}
.teacher-tab.active{background:#315cdb;color:white;border-color:#315cdb}
.assign-toggle{padding:8px 10px;border:1px solid #b7c4d7;border-radius:9px;color:#526882;background:#f5f7fb;font-size:12px;font-weight:750}
.assign-toggle.assigned{color:#116e4b;border-color:#9bd8bd;background:#e3f6ea}
.pin-backdrop{position:fixed;z-index:10000;inset:0;background:#10264799;display:flex;align-items:center;justify-content:center;padding:18px}
.pin-dialog{width:min(420px,100%);padding:30px;border-radius:20px;background:#fff;box-shadow:0 25px 70px #10264735;color:#243753}
.pin-icon{font-size:36px}.pin-dialog h2{margin:8px 0;font-size:27px}.pin-dialog p{color:#687a94;line-height:1.5}.pin-dialog label{display:block;margin-top:20px;font-weight:750}.pin-dialog input{width:100%;font-size:27px;letter-spacing:8px;text-align:center;margin-top:8px;padding:13px}.pin-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}.pin-error{color:#b52d45!important;font-size:13px;min-height:19px}
.pin-backdrop.hidden{display:none!important}

/* V2.0: checkboxes and batch assignment on worksheet cards */
.assignment-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;background:#fff;border:1px solid #d8e2f0;border-radius:14px;padding:15px 18px;margin:0 0 22px}
.assignment-bar.hidden{display:none!important}
.assignment-bar-info{display:flex;flex-direction:column;gap:4px;color:#293c5b}.assignment-bar-info strong{font-size:16px}.assignment-bar-info span{font-size:13px;color:#7687a1}
.assignment-bar-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.assignment-bar-actions button{padding:10px 13px;font-size:13px}
.assignment-bar-actions button:disabled{opacity:.45;cursor:not-allowed}
.assignment-card{position:relative}.assignment-card .library-card-open{cursor:pointer}.assignment-card.is-selected{outline:3px solid #4268df;border-color:#4268df}
.assignment-checkbox{position:absolute;top:15px;right:15px;width:27px;height:27px;accent-color:#315cdb;z-index:3;cursor:pointer;background:white;box-shadow:0 2px 8px #162b4e44}
.assignment-status{display:inline-flex;margin-top:7px;padding:5px 8px;border-radius:7px;background:#f1f4f8;color:#667893;font-size:12px;font-weight:700;align-self:start}
.assignment-status.is-assigned{color:#166b49;background:#def6e9}
@media(max-width:720px){.assignment-bar-actions{width:100%}.assignment-bar-actions button{flex:1}}

/* V2.1: Checkbox is always visible regardless of Edit/Assign tab. */
.library-card.assignment-card{overflow:visible}
.assignment-checkbox{appearance:auto!important;display:block!important;opacity:1!important;visibility:visible!important;pointer-events:auto!important;width:30px;height:30px;margin:0;border:2px solid #2e59d3;border-radius:6px;accent-color:#315cdb}
.assignment-checkbox:focus-visible{outline:3px solid #f59e0b;outline-offset:3px}

/* V2.2: Assigned activities form their own upper section; original cards are moved, never copied. */
.worksheet-section{margin:24px 0 34px}.worksheet-section-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:17px}
.worksheet-section-heading h2{font-size:25px;letter-spacing:-.5px;color:#243754;margin:4px 0 6px}
.worksheet-section-heading p{font-size:13px;color:#71839e;margin:0}.worksheet-section-kicker{font-size:10px;letter-spacing:1.5px;font-weight:850;color:#4772c9}
#assignedSection{padding-bottom:27px;border-bottom:2px solid #dbe3f0}
#assignedSection .worksheet-section-kicker{color:#167353}
.section-count{display:inline-flex;vertical-align:middle;align-items:center;justify-content:center;border-radius:100px;min-width:29px;padding:2px 9px;background:#e9eef7;color:#41608d;font-size:15px;letter-spacing:0;margin-left:6px}
#assignedSection .section-count{background:#def6e9;color:#14764e}
.section-empty{border:1px dashed #bfd5c9;border-radius:14px;background:#f6fbf8;color:#637b70;padding:22px;font-size:13px}
.section-empty.hidden{display:none!important}

/* V2.4: worksheet thumbnail markings and prominent worksheet statistics */
.library-card-body{gap:9px;min-height:0;padding:17px 17px 14px}
.library-card-title{font-size:17px}
.library-card-pages{font-size:12px;color:#8390a4;font-weight:600}
.library-card-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:5px 0 1px}
.library-stat{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;border:1px solid #dfe7f4;background:#f5f8fd;border-radius:10px;padding:10px 5px}
.library-stat strong{color:#2e58af;font-size:22px;line-height:1;font-weight:850}
.library-stat span{font-size:11px;color:#647790;font-weight:750}
.library-paper canvas{display:block}

/* V2.5: dark, accessible student feedback. No check button required. */
.student-answer-box{border:3px solid #315b95;background:#e0eafb;transition:background-color .16s,border-color .16s}
.student-answer-box input{color:#152e54;font-weight:850}
.student-answer-box.correct{background:#8de0ad;border:3px solid #08753a}
.student-answer-box.incorrect{background:#ffaaa9;border:3px solid #a31929}
.student-answer-box.correct input{color:#063b23}
.student-answer-box.incorrect input{color:#710c1d}
.student-feedback #studentFeedbackText.good{color:#075c30}
.student-feedback #studentFeedbackText.try{color:#9e1825}

/* V2.6 branding: approved Remy logo retained as website art and icon. */
.top .brand{gap:12px;min-width:0}
.top .brand-logo{display:block;width:116px;height:90px;object-fit:contain;flex:none;filter:drop-shadow(0 2px 3px rgba(0,0,0,.18))}
.top .brand-text{min-width:0}
@media(min-width:1150px){.top .brand-logo{width:144px;height:106px}}
@media(max-width:650px){.top .brand-logo{width:92px;height:74px}.top .brand strong{font-size:16px}.top .brand small{letter-spacing:1px}}

/* V2.7: student-first logo-centered homepage; teacher screens remain unchanged. */
body:not(.teacher-unlocked):has(#studentLibrary:not(.hidden)) .top{position:absolute;top:0;left:0;width:100%;height:0;min-height:0;padding:0;background:transparent;z-index:20;overflow:visible}
body:not(.teacher-unlocked) .top .brand,body:not(.teacher-unlocked) .top #saveStatus{display:none}
body:not(.teacher-unlocked) .top .header-actions{position:absolute;right:max(22px,calc((100vw - 1450px)/2));top:24px}
body:not(.teacher-unlocked) .top #studentModeBtn{display:inline-flex;color:#a93348;border:1px solid #f0cfd5;background:white;box-shadow:0 3px 13px #1a356311;padding:13px 17px}
body:not(.teacher-unlocked) .top #studentModeBtn:hover{background:#fff2f4}
body:not(.teacher-unlocked) .shell{padding-top:22px}
.student-home{max-width:1360px;margin:0 auto;padding:0 12px 40px}
.student-home-toolbar{display:flex;align-items:center;justify-content:flex-start;min-height:62px;margin-bottom:14px;padding-right:190px}
.student-home-toolbar .student-search{margin:0;width:min(340px,100%);height:47px;box-shadow:0 2px 12px #1d335b0b}
.student-home-toolbar .student-search input{padding:10px 4px}
.student-home-stage{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,390px) minmax(0,1fr);grid-template-areas:'left logo right';gap:30px;align-items:center;min-height:490px}
.student-home-logo{grid-area:logo;text-align:center;align-self:center;justify-self:center;min-width:0}
.student-home-logo img{display:block;width:min(100%,370px);height:auto;margin:0 auto;filter:drop-shadow(0 12px 18px #1b3e7326)}
.student-home-logo p{font-size:14px;color:#667791;max-width:270px;line-height:1.55;margin:11px auto}
.student-featured{display:contents}
.student-featured .student-tile{width:100%;max-width:320px;min-width:0;justify-self:center;box-shadow:0 8px 22px #183b6316;transition:transform .15s,box-shadow .15s}
.student-featured .student-tile:hover{transform:translateY(-4px);box-shadow:0 14px 34px #183b6328}
.student-featured .student-tile-preview{height:235px;padding:16px}
.student-featured .student-tile-body{padding:15px 16px 16px;gap:6px}
.student-featured .student-tile-body strong{font-size:19px}
.student-featured .student-tile-body small{font-size:14px}
.student-featured .student-tile-preview canvas{box-shadow:0 6px 18px #2237}
.student-featured .featured-position-0{grid-column:1;grid-row:1;align-self:start;margin-top:12px}
.student-featured .featured-position-1{grid-column:3;grid-row:1;align-self:start;margin-top:12px}
.student-featured .featured-position-2{grid-column:1;grid-row:1;align-self:end;margin-bottom:12px}
.student-featured .featured-position-3{grid-column:3;grid-row:1;align-self:end;margin-bottom:12px}
.student-more-controls{display:flex;justify-content:center;margin:16px auto 18px}
.student-more-controls button{padding:14px 38px;font-size:16px;border-radius:14px}
.student-more-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(205px,1fr));gap:20px;max-width:1150px;margin:0 auto 30px}
.student-more-grid .student-tile-preview{height:190px}
.student-home .student-empty{text-align:center;margin:12px auto;max-width:540px}
@media(max-width:860px){.student-home-stage{grid-template-columns:1fr 1fr;grid-template-areas:'logo logo';gap:16px;min-height:0}.student-home-logo{grid-column:1/-1;grid-row:1;margin-bottom:8px}.student-home-logo img{width:min(65vw,310px)}.student-featured .student-tile{max-width:none}.student-featured .featured-position-0,.student-featured .featured-position-1,.student-featured .featured-position-2,.student-featured .featured-position-3{grid-row:auto;grid-column:auto;margin:0;align-self:stretch}.student-home-toolbar{padding-top:75px;padding-right:0;justify-content:center}}
@media(max-width:480px){.student-home-stage{gap:10px}.student-featured .student-tile-preview{height:155px}.student-featured .student-tile-body{padding:10px}.student-featured .student-tile-body strong{font-size:14px}.student-home-logo img{width:min(80vw,280px)}.student-home-toolbar .student-search{width:100%}.student-more-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}}

/* V2.9 — Approved techno artwork behind the student homepage only.
   The teacher dashboard/editor and individual question practice keep their existing backgrounds. */
body:not(.teacher-unlocked):has(#studentLibrary:not(.hidden)) {
  background-color: #eaf6ff;
  background-image: url('assets/student-techno-background.png');
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
}
/* Keep controls and previews legible on the illustrated background. */
body:not(.teacher-unlocked):has(#studentLibrary:not(.hidden)) .student-home-toolbar .student-search {
  background: rgba(255,255,255,.96);
}
@media (max-width: 860px) {
  body:not(.teacher-unlocked):has(#studentLibrary:not(.hidden)) {
    background-attachment: scroll;
    background-position: center top;
  }
}

/* V3.0: Turquoise circuit backdrop on the student answer-checking screen only. */
body:not(.teacher-unlocked):has(#studentPractice:not(.hidden)) {
  background-color: #e6fafb;
  background-image: url('assets/student-answer-techno-background.png');
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
}
body:not(.teacher-unlocked):has(#studentPractice:not(.hidden)) .student-canvas-area {
  background-color: #e9fbfc;
  background-image: url('assets/student-answer-techno-background.png');
  background-position: left center;
  background-size: cover;
  background-repeat: no-repeat;
}
/* Keep the actual worksheet, navigation and inputs solid for readability. */
body:not(.teacher-unlocked):has(#studentPractice:not(.hidden)) .student-page,
body:not(.teacher-unlocked):has(#studentPractice:not(.hidden)) .student-main,
body:not(.teacher-unlocked):has(#studentPractice:not(.hidden)) .student-questions {
  background-color: #fff;
}
@media (max-width: 860px) {
  body:not(.teacher-unlocked):has(#studentPractice:not(.hidden)) {
    background-attachment: scroll;
  }
}

/* V3.1: PDF page on the left, with the active zoom window highlighted. */
.student-practice-layout{grid-template-columns:minmax(280px, 38%) minmax(0, 1fr);align-items:start;gap:20px}
.student-pdf-sidebar{padding:0;max-height:none;overflow:visible;min-width:0}
.student-pdf-header{padding:16px 17px 13px;display:flex;align-items:flex-start;justify-content:space-between;gap:8px;border-bottom:1px solid #e0e7f1}
.student-pdf-header h2{margin:0 0 5px;font-size:18px}
.student-pdf-header p{font-size:12px;line-height:1.35;color:#6f829e;margin:0}
.student-pdf-header span{white-space:nowrap;font-size:12px;color:#526b90;font-weight:750}
.student-pdf-page-wrap{background:#e9eef5;padding:15px 12px;display:flex;align-items:start;justify-content:center;overflow:auto;max-height:70vh}
.student-pdf-surface{position:relative;line-height:0;display:inline-block;background:#fff;box-shadow:0 4px 16px #142f4f28;max-width:100%}
.student-pdf-surface canvas{display:block;max-width:100%;height:auto}
.student-pdf-overlay{position:absolute;inset:0}
.student-pdf-window{position:absolute;display:flex;align-items:flex-start;justify-content:flex-start;padding:0;background:#3676cb0c;border:2px solid #4773bb8c;border-radius:3px;cursor:pointer;min-width:0;min-height:0;transition:background-color .12s,border-color .12s}
.student-pdf-window:hover,.student-pdf-window:focus-visible{background:#58aef04a;border-color:#1759bf;outline:2px solid white;outline-offset:1px}
.student-pdf-window.active{background:rgba(255,217,73,.48);border:4px dashed #25bd60;z-index:2}
.student-pdf-window span{position:absolute;left:2px;top:2px;display:grid;place-items:center;min-width:21px;height:21px;padding:0 3px;background:#2f5cbb;color:white;border-radius:5px;font-size:11px;font-weight:850;line-height:1}
.student-pdf-window.active span{background:#138447}
.student-pdf-controls{display:flex;align-items:center;justify-content:center;gap:12px;padding:12px;border-top:1px solid #dce5f0}
.student-pdf-controls span{color:#536883;font-size:13px;font-weight:750}
.student-pdf-help{font-size:12px;color:#6d819d;line-height:1.45;padding:0 15px 14px;margin:0;text-align:center}
@media(max-width:960px){.student-practice-layout{grid-template-columns:minmax(230px, 37%) minmax(0,1fr);gap:12px}.student-pdf-page-wrap{padding:8px}}
@media(max-width:700px){.student-practice-layout{grid-template-columns:1fr}.student-pdf-page-wrap{max-height:55vh}.student-pdf-sidebar{order:1}.student-main{order:2}}

/* V3.2 — Remy dances only after a freshly confirmed correct answer. */
#studentPractice .student-main{position:relative}
#studentPractice .remy-correct-dance{position:absolute;right:10px;bottom:88px;width:188px;height:188px;pointer-events:none;z-index:8;filter:drop-shadow(0 12px 24px rgba(20,58,100,.28));animation:remy-dance-arrive .22s ease-out both}
#studentPractice .remy-correct-dance.hidden{display:none!important}
#studentPractice .remy-correct-dance img{width:100%;height:100%;object-fit:contain}
@keyframes remy-dance-arrive{from{opacity:0;transform:translateY(10px) scale(.85)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:700px){#studentPractice .remy-correct-dance{width:126px;height:126px;right:6px;bottom:88px}}
@media(prefers-reduced-motion:reduce){#studentPractice .remy-correct-dance{animation:none}}

/* V3.7: Thinking Remy sits directly under the question panel and larger. Dancing Remy stays in the question card corner. */
#studentPractice .student-remy-stage{grid-column:2;display:flex;justify-content:center;align-items:flex-start;min-height:56px;height:56px;padding:0 12px 0;margin-top:-212px;position:relative;overflow:visible;z-index:3;pointer-events:none}
#studentPractice .student-remy-stage .remy-thinking{display:block;width:228px;height:228px;max-width:100%;object-fit:contain;pointer-events:none;filter:drop-shadow(0 10px 18px rgba(20,58,100,.18))}
#studentPractice .student-remy-stage .hidden{display:none!important}
@media(max-width:700px){#studentPractice .student-remy-stage{grid-column:1;min-height:70px;height:70px;padding:0 8px 0;margin-top:-138px}#studentPractice .student-remy-stage .remy-thinking{width:148px;height:148px}}


/* V3.6 — no navy header on the student answer screen.
   Keep PIN-protected Teacher Access available independently at top right. */
body:not(.teacher-unlocked):has(#studentPractice:not(.hidden)) .top {
  position: absolute;
  inset: 0 0 auto 0;
  width: 100%;
  height: 0;
  min-height: 0;
  padding: 0;
  background: transparent;
  overflow: visible;
  z-index: 20;
}
body:not(.teacher-unlocked):has(#studentPractice:not(.hidden)) .top .brand,
body:not(.teacher-unlocked):has(#studentPractice:not(.hidden)) .top #saveStatus {
  display: none;
}
body:not(.teacher-unlocked):has(#studentPractice:not(.hidden)) .top .header-actions {
  position: absolute;
  top: 14px;
  right: max(20px, calc((100vw - 1450px)/2));
}
body:not(.teacher-unlocked):has(#studentPractice:not(.hidden)) .top #studentModeBtn {
  display: inline-flex;
  color: #a93348;
  border: 1px solid #f0cfd5;
  background: white;
  box-shadow: 0 3px 13px #1a356311;
  padding: 12px 16px;
}
body:not(.teacher-unlocked):has(#studentPractice:not(.hidden)) .top #studentModeBtn:hover {
  background: #fff2f4;
}
body:not(.teacher-unlocked):has(#studentPractice:not(.hidden)) .shell {
  padding-top: 68px;
}
body:not(.teacher-unlocked):has(#studentPractice:not(.hidden)) .student-practice-top {
  margin-top: 0;
  margin-bottom: 18px;
}
@media (max-width: 700px) {
  body:not(.teacher-unlocked):has(#studentPractice:not(.hidden)) .shell {
    padding-top: 72px;
  }
  body:not(.teacher-unlocked):has(#studentPractice:not(.hidden)) .top .header-actions {
    right: 12px;
    top: 10px;
  }
}

/* V4.1 — teacher answer mode tabs and bubble overlay */
.answer-mode-tabs{display:flex;gap:8px;margin-top:12px}.answer-mode-tab{background:#f3f6fc;border:1px solid #cbd8ec;color:#38557c;padding:10px 14px;border-radius:10px;font-size:13px}.answer-mode-tab.active{background:#315cdb;color:white;border-color:#315cdb}
.choice-guide{margin-top:15px;padding-top:12px;border-top:1px solid #e2e8f2}.choice-guide p{color:#60728d;font-size:12px;line-height:1.5}.choice-guide>strong{display:block;font-size:12px;margin:12px 0;color:#3059b6}.choice-row{display:flex;gap:7px;margin:7px 0}.choice-correct-btn{flex:1;text-align:left;background:#f1f5fe;border:1px solid #d7e1f2;color:#35537d;white-space:normal;padding:9px 7px}.choice-correct-btn.is-correct{background:#d7f5df;color:#12613a;border-color:#159b69}
.shape.choice{border:3px solid #2765db;border-radius:50%;background:#92b6ff3b;align-items:center;justify-content:center}.shape.choice.choice-correct{border-color:#12874b;background:#57ce8140}.shape.choice .tag{font-size:10px;border-radius:5px}.shape.choice .resize-handle{border-radius:50%}
.student-choice{position:absolute;border:3px solid #2c64d8;border-radius:50%;background:#a8cdff4a;cursor:pointer;min-width:16px;min-height:16px;padding:0;transition:background-color .16s}.student-choice:hover:not(:disabled){background:#80afff99}.student-choice.eliminated{border:3px solid #b12c43;background:#ff8f8f99}.student-choice.eliminated::after{content:'×';color:#971e36;font-weight:900;font-size:clamp(15px,2.2vw,30px)}.student-choice.correct{border:3px solid #08753a;background:#8de0ad}.student-choice.correct::after{content:'✓';color:#075c30;font-weight:900;font-size:clamp(15px,2.2vw,30px)}.student-choice:disabled{cursor:default}.student-choice:focus-visible{outline:3px solid #ffbc36}

/* V4.2 — compact teacher dashboard, retaining editor tools when needed */
body.teacher-unlocked:has(#libraryView:not(.hidden)) .top #libraryBtn,
body.teacher-unlocked:has(#libraryView:not(.hidden)) .top #openBtn,
body.teacher-unlocked:has(#libraryView:not(.hidden)) .top #saveBtn,
body.teacher-unlocked:has(#libraryView:not(.hidden)) .top #saveStatus{display:none!important}
body.teacher-unlocked:has(#editorView:not(.hidden)) .top #assignTab{display:none!important}
.top #assignTab{background:#fff;color:#3152a7;border:1px solid #dce6fb;padding:12px 17px;font-weight:800;border-radius:10px}
.top #assignTab[aria-pressed="true"]{background:#dceaff;border-color:#8babf9;color:#1e4cb7}
body.teacher-unlocked:has(#libraryView:not(.hidden)) .shell{padding-top:0}
body.teacher-unlocked .library-view{max-width:1220px}
.dashboard-search-row{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:12px 0 6px}
.dashboard-search-row .library-search{margin:0 0 0 auto;width:min(390px,100%);order:2}
.dashboard-search-row .library-search input{padding:10px 0}
.dashboard-search-row .library-count{order:1}
.library-view .library-header{margin:3px 0 14px}
.library-view .library-header h1{font-size:30px;margin:2px 0 3px}
.library-view .library-header p{font-size:13px}
.library-view #libraryNew,.library-view .teacher-tabs{display:none!important}
.library-view .library-tools{margin:0;min-height:0;justify-content:flex-end}
.library-view .library-tools:has(.library-dedupe.hidden){display:none}
.library-view .assignment-bar{padding:10px 14px;margin-bottom:10px}
.library-view .worksheet-section{margin:14px 0 22px}
.library-view .worksheet-section-heading{margin-bottom:10px}
.library-view .worksheet-section-heading h2{font-size:22px;margin:2px 0 4px}
#assignedSection{padding-bottom:13px}
@media(max-width:700px){.dashboard-search-row{flex-wrap:wrap;padding:8px 0}.dashboard-search-row .library-search{order:1;width:100%}.dashboard-search-row .library-count{order:2}.top #assignTab{padding:9px 11px;font-size:12px}}

/* V4.3: Assignment controls are strictly teacher-only and dashboard-only. */
body:not(.teacher-unlocked) .top #assignTab{display:none!important}
body.teacher-unlocked:not(:has(#libraryView:not(.hidden))) .top #assignTab{display:none!important}


/* V4.4: Multiple-choice answer regions highlight the whole printed answer.
   Stored geometry is unchanged, so all existing options remain editable. */
.shape.choice {
  border-radius: 9px;
  border: 2px solid #2864d7;
  background: rgba(70,133,247,.16);
  align-items: center;
  justify-content: center;
}
.shape.choice.choice-correct {
  border-color: #12874b;
  background: rgba(43,189,99,.23);
}
.shape.choice .resize-handle { border-radius: 3px; }
.student-choice {
  border-radius: 9px;
  border: 2px solid #2c64d8;
  background: rgba(115,168,255,.17);
  min-width: 24px;
  min-height: 24px;
}
.student-choice:hover:not(:disabled) { background: rgba(99,158,252,.32); }
.student-choice.eliminated {
  border: 3px solid #b12c43;
  background: rgba(255,105,105,.31);
}
.student-choice.correct {
  border: 3px solid #08753a;
  background: rgba(67,203,121,.36);
}
.student-choice.eliminated::after,
.student-choice.correct::after {
  position:absolute;
  right:6px;
  top:50%;
  transform:translateY(-50%);
  line-height:1;
  text-shadow:0 1px 2px rgba(255,255,255,.85);
}

/* V4.6 — line matching: large, click-friendly rectangles, no dragging for students. */
.shape.match{border:2px solid #2978d4;background:rgba(73,162,246,.19);border-radius:9px;align-items:center;justify-content:center}
.shape.match.left{border-color:#2358d3;background:rgba(85,139,238,.18)}
.shape.match.right{border-color:#8c55c8;background:rgba(164,119,229,.18)}
.shape.match .resize-handle{border-radius:3px}
.student-match-point{position:absolute;z-index:2;display:flex;align-items:center;justify-content:center;border:3px solid #3569c6;border-radius:9px;background:rgba(65,139,249,.14);cursor:pointer;touch-action:manipulation;padding:0;min-width:22px;min-height:22px;transition:background .15s}
.student-match-point.right{border-color:#8753b9;background:rgba(177,128,235,.14)}
.student-match-point.active{border-color:#e68b14;background:rgba(255,194,89,.4);box-shadow:0 0 0 3px white}
.student-match-point.matched{border-color:#08753a;background:rgba(57,205,111,.42);cursor:default}
.student-match-point.matched::after{content:'✓';font-size:22px;font-weight:900;color:#075c30;text-shadow:0 1px white}
.student-match-point.locked{border-color:#1b2230;background:rgba(18,24,34,.79);cursor:not-allowed}
.student-match-point.locked::after{content:'✕';color:white;font-size:23px;font-weight:900}
.student-match-point:disabled{pointer-events:none}
.student-match-point:focus-visible{outline:3px solid #f2a61d;outline-offset:2px}


/* V4.7: Give every featured worksheet its own grid cell. Previously the
   first/third and second/fourth cards shared grid-row:1 and overlapped. */
@media (min-width:861px) {
  .student-home-stage {
    grid-template-areas: none;
    grid-template-rows: repeat(2, minmax(0, auto));
    row-gap: 22px;
    align-items: center;
  }
  .student-home-logo {
    grid-area: auto;
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
  }
  .student-featured .featured-position-0 {
    grid-column: 1; grid-row: 1; align-self: center; margin: 0;
  }
  .student-featured .featured-position-1 {
    grid-column: 3; grid-row: 1; align-self: center; margin: 0;
  }
  .student-featured .featured-position-2 {
    grid-column: 1; grid-row: 2; align-self: center; margin: 0;
  }
  .student-featured .featured-position-3 {
    grid-column: 3; grid-row: 2; align-self: center; margin: 0;
  }
}
/* On smaller Chromebooks stack the logo above two-column worksheet rows. */
@media (max-width:860px) {
  .student-home-stage { grid-template-areas: none; }
  .student-home-logo { grid-area: auto; grid-column: 1 / -1; grid-row: 1; }
  .student-featured .featured-position-0,
  .student-featured .featured-position-1,
  .student-featured .featured-position-2,
  .student-featured .featured-position-3 {
    grid-column: auto; grid-row: auto; align-self: stretch; margin: 0;
  }
}


/* V4.8 — lower Thinking Remy on tall matching windows and draw persistent connector lines. */
#studentPractice .student-practice-layout.tall-window-remy .student-remy-stage{margin-top:-78px;min-height:154px;height:154px;align-items:flex-end}
#studentPractice .student-practice-layout.tall-window-remy .student-remy-stage .remy-thinking{width:210px;height:210px}
@media(max-width:700px){#studentPractice .student-practice-layout.tall-window-remy .student-remy-stage{margin-top:-44px;min-height:120px;height:120px}#studentPractice .student-practice-layout.tall-window-remy .student-remy-stage .remy-thinking{width:146px;height:146px}}
.student-match-lines{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible;z-index:1}
.student-match-lines line{stroke:#1b9a57;stroke-width:6;stroke-linecap:round;filter:drop-shadow(0 1px 2px rgba(255,255,255,.7))}
.student-match-point{z-index:2}

/* V4.9: linked problem and remote answer crop */
.shape.split-region{border:3px solid #f18c16;background:#f39c3d35;border-radius:7px}
.split-problem-surface{width:min(100%,950px);max-width:100%;background:transparent!important;box-shadow:none!important}
.split-student-layout{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(180px,1fr);align-items:center;gap:20px;width:100%;}
.split-student-part{display:flex;flex-direction:column;gap:12px;align-items:center;background:white;border:1px solid #dce5f2;border-radius:12px;padding:14px;min-width:0}
.split-student-part strong{color:#334d73;font-size:16px}
.split-student-part canvas{display:block;max-width:100%;height:auto}
.split-answer-input{width:100%;min-height:55px;border:3px solid #3569c6;border-radius:9px;text-align:center;font:750 20px system-ui;background:#ecf4ff;color:#233c64;padding:8px}
.split-answer-input.correct{background:#c9f4d7;border-color:#168344}
.split-answer-input.incorrect{background:#fbe0de;border-color:#c33e3e}
@media(max-width:700px){.split-student-layout{grid-template-columns:1fr}}

/* V5.0 optional linking controls in Zoom Windows. */
.split-window-controls{display:flex;flex-direction:column;gap:9px;margin-bottom:16px;padding-bottom:16px;border-bottom:1px solid #dbe4f2}
.split-window-controls strong{color:#28476f;font-size:15px}
.split-window-controls p{margin:0;line-height:1.45}
.split-window-controls button{font-size:13px;min-height:38px}

/* V5.1: teacher drag-and-drop window pairing and dual crop confirmation */
.split-drop-builder{margin-top:18px;padding-top:15px;border-top:1px solid #e0e7f1;display:grid;gap:9px}
.split-drop-builder p{margin:0}.split-drop-slots{display:grid;grid-template-columns:minmax(0,1fr) 15px minmax(0,1fr);align-items:center;gap:5px}
.split-drop-slot{min-height:87px;border:2px dashed #8fa9d1;border-radius:11px;padding:9px 5px;text-align:center;font-size:11px;font-weight:750;background:#f4f8ff;color:#405e8b;display:flex;flex-direction:column;justify-content:center;gap:8px}
.split-drop-slot b{font-size:12px;color:#214fb2}.split-drop-slot.drag-over{background:#dceaff;border-color:#315bd8}
.split-drop-symbol{text-align:center;font-size:20px;font-weight:800;color:#3864c7}.window-list .list-item[draggable=true]{cursor:grab}
.split-editor-preview{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:18px;width:min(100%,1000px);margin:auto;align-items:center}
.split-editor-preview>div{background:white;padding:14px;border:1px solid #cfd9e8;border-radius:13px;min-width:0;display:flex;flex-direction:column;gap:12px;text-align:center}
.split-editor-preview strong{font-size:14px;color:#33547e}.split-editor-preview canvas{display:block;max-width:100%;height:auto;max-height:480px;object-fit:contain;margin:auto}
@media(max-width:720px){.split-editor-preview{grid-template-columns:1fr}}

/* V5.2 linked answer drawing and compact paired windows */
.split-answer-edit-surface{position:relative;line-height:0;max-width:100%;margin:auto;align-self:center}
.split-answer-edit-surface canvas{display:block;max-width:100%;height:auto;margin:0}
.split-answer-draw-layer{position:absolute;inset:0;touch-action:none;cursor:crosshair}
.split-answer-draw-box{position:absolute;border:2px solid #15955d;background:rgba(49,193,113,.18);pointer-events:none;border-radius:5px}
.split-answer-draw-box::after{content:'Answer';position:absolute;top:-20px;left:0;background:#168653;color:white;font:700 11px system-ui;padding:3px 6px;border-radius:4px}
.split-window-pair{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:5px;padding:8px;border:1px solid #c9d9f0;background:#f0f5ff;border-radius:10px}
.split-window-pair button{min-width:0;white-space:normal;text-align:center;font-size:11px;padding:8px 4px;background:white;color:#294a8e;border:1px solid #d4e0f6}
.split-window-pair.selected{border:2px solid #456ae5}
.split-window-pair .pair-link-symbol{font-weight:900;color:#3463bf}
.split-answer-image-wrap{position:relative;width:fit-content;max-width:100%;margin:auto}
.split-answer-image-wrap canvas{display:block;max-width:100%;height:auto}
.split-answer-image-wrap .split-answer-input{position:absolute;box-sizing:border-box;margin:0;min-width:22px;min-height:24px;text-align:center;border:2px solid #3565d9;background:#ecf4ffea;border-radius:5px;font-weight:750;font-size:clamp(12px,1.5vw,18px)}

/* V5.3: split answer drawing must capture mouse/touch events above the PDF canvas. */
#splitAnswerEditSurface{position:relative;isolation:isolate;user-select:none;-webkit-user-select:none}
#splitAnswerEditSurface canvas{pointer-events:none;user-select:none;-webkit-user-select:none}
#splitAnswerDrawLayer{position:absolute;inset:0;z-index:15;display:block;touch-action:none;cursor:crosshair;user-select:none;-webkit-user-select:none}
#splitAnswerDrawBox{z-index:1;pointer-events:none;box-sizing:border-box}

/* V5.4: a deterministic add-box action, with move/resize affordances. */
.split-answer-toolbox{grid-column:1/-1;display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap;font-size:12px;color:#58708f}
.split-answer-toolbox button{font-size:13px;padding:9px 13px}
#splitAnswerDrawBox:not(.hidden){pointer-events:auto;cursor:move;z-index:20}
#splitAnswerDrawBox .split-box-resize-handle{position:absolute;right:-7px;bottom:-7px;width:16px;height:16px;border:2px solid white;border-radius:4px;background:#13834a;cursor:nwse-resize;pointer-events:auto;box-shadow:0 1px 5px #1237}
#splitAnswerDrawBox{touch-action:none}


/* V5.5: Freeform answer canvas; identical normalized stage for teacher and student. */
#splitEditorPreview.split-editor-preview{display:block;width:min(100%,1000px);margin:auto}
#splitEditorPreview.hidden{display:none!important}
.split-freeform-stage,.split-freeform-student{position:relative;box-sizing:border-box;width:100%;aspect-ratio:1.6/1;min-height:360px;background:#eef4fb;border:1px solid #ccdae9;border-radius:13px;overflow:hidden}
.split-freeform-images{position:absolute;inset:4% 3% 38% 3%;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:2%;align-items:center;pointer-events:none}
.split-image-card{box-sizing:border-box;min-width:0;min-height:0;width:100%;height:100%;background:#fff;border:1px solid #d5e2ed;border-radius:11px;display:flex;justify-content:center;align-items:center;padding:10px;overflow:hidden}
#splitEditorPreview .split-image-card canvas,.split-freeform-student .split-image-card canvas{display:block;max-width:100%;max-height:100%;object-fit:contain;width:auto;height:auto;margin:auto}
.split-freeform-layer{position:absolute;inset:0;touch-action:none;cursor:crosshair;z-index:3;user-select:none;-webkit-user-select:none}
.split-freeform-layer .split-answer-draw-box{pointer-events:auto;cursor:move;touch-action:none;box-sizing:border-box;z-index:5}
.split-freeform-layer .split-answer-draw-box .split-box-resize-handle{pointer-events:auto;cursor:nwse-resize}
.split-freeform-student .split-answer-input{position:absolute;z-index:3;box-sizing:border-box;margin:0;min-width:0;min-height:0;width:auto;height:auto;font-size:clamp(13px,1.5vw,20px)}
#studentPractice .split-problem-surface{width:min(100%,950px)}
@media(max-width:700px){.split-freeform-stage,.split-freeform-student{min-height:280px;aspect-ratio:1.25/1}.split-freeform-images{inset:4% 3% 40% 3%;gap:2%}}

/* V5.8: one obvious editing surface for linked questions. */
#splitEditorPreview .split-freeform-stage{background:#f0f5fb;outline:2px solid #bfd4ed;outline-offset:0}
#splitAnswerDrawBox:not(.hidden){pointer-events:auto!important;cursor:grab;z-index:30;box-shadow:0 0 0 2px #fff8,0 4px 12px #134a7733}
#splitAnswerDrawBox:active{cursor:grabbing}
#splitAnswerDrawBox .split-box-resize-handle{width:19px;height:19px;right:-9px;bottom:-9px;z-index:40;pointer-events:auto!important}
#splitAnswerDrawLayer{pointer-events:auto!important;z-index:20}

/* V5.9: one teacher navigation surface — zoom windows and linked pairs */
.window-answer-settings{margin-top:12px}
.window-answer-settings:empty{display:none}
#workstage .split-window-pair{cursor:pointer;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);padding:10px;gap:7px}
#workstage .split-window-pair:hover{border-color:#406add;background:#e7efff}
#workstage .split-window-pair:focus-visible{outline:3px solid #8db2ff;outline-offset:2px}
#workstage .split-window-pair .pair-link-symbol{font-size:18px}
#workstage .split-window-pair>button:last-child{grid-column:1/-1;justify-self:end;padding:3px 10px;font-size:12px;color:#ab3142}

/* V6.0: original four-corner resizing restored for split freeform answer boxes. */
#splitAnswerDrawBox .split-box-resize-handle{position:absolute;width:16px;height:16px;border:2px solid white;border-radius:3px;background:#139b66;box-shadow:0 1px 4px #1237;pointer-events:auto!important;touch-action:none;z-index:45}
#splitAnswerDrawBox .split-box-resize-handle.nw{top:-9px;left:-9px;right:auto;bottom:auto;cursor:nwse-resize}
#splitAnswerDrawBox .split-box-resize-handle.ne{top:-9px;right:-9px;left:auto;bottom:auto;cursor:nesw-resize}
#splitAnswerDrawBox .split-box-resize-handle.sw{bottom:-9px;left:-9px;top:auto;right:auto;cursor:nesw-resize}
#splitAnswerDrawBox .split-box-resize-handle.se{bottom:-9px;right:-9px;top:auto;left:auto;cursor:nwse-resize}

/* V6.1 - in-place answer key editing for linked windows */
#splitAnswerDrawBox .split-box-typed-answer{display:block;position:absolute;inset:0;width:100%;height:100%;box-sizing:border-box;border:0;background:transparent;color:#075b35;text-align:center;font:700 clamp(13px,1.5vw,23px) system-ui,sans-serif;padding:8px;outline:none;cursor:text;z-index:12;min-width:0}
#splitAnswerDrawBox .split-box-typed-answer::placeholder{color:#547c69;opacity:.85;font-weight:500;font-size:clamp(11px,1vw,14px)}
#splitAnswerDrawBox:focus-within{outline:2px solid #108755;outline-offset:1px}
#splitAnswerDrawBox .split-box-resize-handle{z-index:50}


/* V6.2 — a compact worksheet locator leaves space for enlarged student questions. */
@media(min-width:701px){
 #studentPractice .student-practice-layout{grid-template-columns:minmax(205px,27%) minmax(0,1fr);gap:15px}
 #studentPractice .student-pdf-page-wrap{max-height:75vh;padding:9px 7px}
 #studentPractice .student-canvas-area{padding:14px;min-height:420px}
 #studentPractice .split-problem-surface{width:min(100%,1180px)}
}
#studentPractice .student-pdf-window.linked-partner{border-style:dashed}
#studentPractice .student-pdf-window.linked-partner:not(.active){background:rgba(104,133,232,.12);border-color:#527dce}
#studentPractice .student-pdf-window.active.linked-partner{background:rgba(255,217,73,.48);border:4px dashed #25bd60}

/* V6.4: Answer inventory under the existing zoom window list. */
.answer-inventory{padding-top:18px;margin-top:18px;border-top:1px solid #e1e8f3}
.answer-inventory .side-title{margin-bottom:8px}
.answer-inventory .list-item{display:flex;align-items:center;gap:8px;margin:7px 0}
.answer-inventory .select-item{flex:1;min-width:0;text-align:left}
.answer-inventory .mini-remove{flex:none;min-width:35px;min-height:35px;color:#bf3347;font-size:22px}
.answer-inventory.hidden{display:none!important}
