/* Classroom touch layout V4. Management Web keeps its own layout. */
.touch-classroom{background:#0c1622}
.touch-classroom .touch-header{height:40px;min-height:40px;padding:0 16px;gap:18px}
.touch-brand{font-size:14px;font-weight:600}.touch-lesson-title{font-size:14px;color:#9eb4c5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.touch-header .online-count{font-size:14px}
.touch-classroom .paper-wall{padding:0 4px 4px;gap:4px}
.touch-classroom .sheet-scroll{touch-action:none;display:block;position:relative;padding-bottom:48px;cursor:grab;scrollbar-width:none}
.touch-classroom .sheet{margin-inline:auto;max-width:none;flex-shrink:0;max-height:none}
.touch-classroom .student-overlay{height:48px;gap:8px;padding:0 6px;background:#f4f8f7f5;font-size:14px}
.touch-classroom .student-overlay label{font-size:14px;min-height:48px;gap:6px;min-width:0;cursor:pointer}
.touch-classroom .student-overlay label b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.touch-classroom .student-overlay input{width:24px;height:24px;flex-shrink:0}
.touch-classroom .student-overlay .pen-status{font-size:12px;flex-shrink:0}
.touch-classroom .student-overlay .zoom-student{width:48px;height:48px;padding:0;flex-shrink:0}
.touch-classroom .student-overlay .notebook-page-button{min-width:48px;min-height:48px;font-size:12px}
.touch-classroom .notebook-page{display:none!important}
.annotation-target{outline:2px solid #61e0cf;outline-offset:-2px}
.teacher-ink{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:3;overflow:hidden}
[data-tool=pen],[data-tool=highlight],[data-tool=line],[data-tool=arrow],[data-tool=ellipse],[data-tool=rect],[data-tool=triangle],[data-tool=axes],[data-tool=star],[data-tool=check]{cursor:crosshair!important}
[data-tool=eraser]{cursor:cell!important}
.green-stage{flex:1;min-height:0;min-width:0;background:#123f36;overflow:hidden}
.green-viewport{width:100%;height:100%;overflow:auto;touch-action:none;scrollbar-width:none}
.green-sheet{position:relative;margin-inline:auto;flex-shrink:0;background:#123f36;min-height:0}
.laser-dot{fill:#ff6262;filter:drop-shadow(0 0 5px #fff);animation:laser-fade 1.6s forwards;pointer-events:none}
@keyframes laser-fade{0%,55%{opacity:1}100%{opacity:0}}
.touch-dock{position:relative;height:92px;flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:4px 24px;background:#0c1622;z-index:30}
.touch-classroom .corner-launcher{width:104px;height:64px;min-height:64px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;background:#0c1622;font-size:15px;border-radius:14px;flex-shrink:0;touch-action:manipulation}
.corner-launcher svg{width:28px;height:28px}.corner-launcher[aria-expanded=true]{background:#263e4b;color:#61e0cf}
.touch-center{max-width:920px;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px}
.touch-tools{display:flex;align-items:center;justify-content:center;gap:4px;min-width:0}
.touch-classroom .touch-tool{height:60px;width:clamp(48px,4.45vw,64px);min-width:48px;min-height:60px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:4px;background:transparent;border-radius:10px;font-size:13px;touch-action:manipulation;flex-shrink:0}
.touch-tool svg{width:24px;height:24px}.touch-classroom .touch-tool.active{background:#263e4b;color:#61e0cf}
.touch-classroom .touch-tool[disabled]{opacity:.32}
.touch-tool[data-tool=palette] svg{color:var(--pen-color,#ef626b)}
.touch-classroom .zoom-step{min-width:44px;width:44px}
.touch-classroom .zoom-value{height:48px;min-width:58px;padding:0 4px;background:transparent;font-size:16px;font-variant-numeric:tabular-nums}
.tool-divider{height:28px;width:1px;background:#29414e;margin:0 3px;flex-shrink:0}
.touch-status{font-size:12px;color:#9eb4c5;display:flex;align-items:center;gap:8px;min-height:18px;white-space:nowrap}
.touch-classroom .wall-pager{display:none}
.touch-classroom .timer-chip{position:fixed;right:24px;bottom:104px;min-width:104px;height:48px;min-height:48px;font-size:20px;color:#61e0cf;background:#203640;z-index:16;border-radius:12px}
.touch-classroom .timer-overlay button{min-height:52px;padding-inline:24px;font-size:18px}
.touch-dismiss{position:fixed;inset:0;z-index:35;border:0;background:#06121c22;border-radius:0;cursor:default}
.touch-popover{position:fixed;bottom:104px;width:344px;max-width:calc(100vw - 32px);max-height:calc(100vh - 160px);overflow:auto;background:#142431;color:#eaf2f7;border:1px solid #324d5b;padding:18px;border-radius:20px;box-shadow:0 12px 50px #0006;z-index:40;animation:touch-rise .16s ease-out}
.touch-popover.left{left:20px}.touch-popover.right{right:20px}.touch-popover.center{left:50%;transform:translateX(-50%)}
@keyframes touch-rise{from{opacity:0;translate:0 12px}to{opacity:1;translate:0 0}}
.touch-popover h2{font-size:20px;margin:0 0 16px}.touch-menu-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.touch-popover button,.touch-mode dialog button{touch-action:manipulation}
.touch-popover button{background:#1e3443;border:1px solid transparent;color:#eaf2f7;border-radius:12px;font-size:16px;min-height:56px;padding:10px}
.touch-popover button:active,.touch-popover button.active{background:#294b55;color:#61e0cf;border-color:#4e8f8a}
.touch-tile{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-height:80px!important;width:100%}
.touch-tile svg{width:28px;height:28px}.touch-tile[disabled]{opacity:.35}
.touch-popover .touch-wide{width:100%;margin-top:16px;min-height:56px}
.touch-popover .primary{background:#61e0cf;color:#0c1622}
.touch-segments{display:flex;gap:8px;margin:12px 0}.touch-segments button{flex:1;min-width:0;white-space:normal}
.touch-page-list{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:12px 0}
.touch-colors{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.touch-colors button{display:flex;flex-direction:column;align-items:center;gap:8px;min-height:80px}
.touch-colors i{display:block;width:28px;height:28px;border-radius:50%;box-shadow:0 0 0 1px #ffffff44}
.touch-choice-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:12px 0 24px}
.touch-choice-list button{padding:12px 16px;white-space:normal;text-align:left;min-height:64px}
.touch-mode dialog{max-height:calc(100vh - 48px);font-size:16px}
.touch-mode dialog>header{padding:14px 20px}.touch-mode dialog>header button{min-width:48px;min-height:48px;font-size:28px}
.touch-mode dialog button{min-height:48px;font-size:16px}
.touch-mode dialog input,.touch-mode dialog select{min-height:48px;font-size:16px}
.touch-mode .modal-body{max-height:calc(100vh - 150px);overflow:auto}
.touch-mode .timer-presets{flex-wrap:wrap}.touch-mode .timer-presets button{flex:1;min-width:90px}
.touch-mode .assistant-presets{flex-wrap:wrap}.touch-mode .assistant-presets button{min-height:56px;font-size:16px}
.touch-mode #toast{bottom:112px}
.touch-classroom .dictation-work{padding:24px 40px}
.touch-classroom .dictation-title{margin-bottom:16px}
.touch-classroom .dictation-work button,.touch-classroom .dictation-work select,.touch-classroom .dictation-work input{min-height:48px;font-size:16px}
.touch-classroom .word{min-height:72px}
.touch-classroom .word>input{width:24px;height:24px;min-height:24px}
.touch-classroom .dictation-start>button{min-height:60px;font-size:18px}
.touch-mode button:focus-visible{outline:3px solid #61e0cf;outline-offset:2px}
@media(max-width:1100px){.touch-dock{padding-inline:12px;gap:6px}.touch-classroom .corner-launcher{width:68px}.touch-tools{gap:2px}.touch-classroom .touch-tool{font-size:12px}.touch-classroom .zoom-value{min-width:48px;font-size:14px}.tool-divider{margin-inline:0}.touch-classroom .dictation-work{padding:20px}.touch-classroom .student-overlay{gap:4px}.touch-classroom .grade-label{font-size:10px}}
@media(prefers-reduced-motion:reduce){.touch-popover{animation:none}}

.touch-classroom .touch-tool{cursor:pointer!important}

/* Preserve student identity when a whole-class wall makes each paper narrow. */
.touch-classroom .student-paper{container-type:inline-size}
.touch-classroom .student-overlay label{flex:1}
@container(max-width:230px){
 .touch-classroom .student-overlay .pen-status,.touch-classroom .student-overlay .grade-label,.touch-classroom .student-overlay .grow{display:none}
}

/* V5: the same Agent is reachable from either side of a touch display. */
.brand-lockup{display:inline-flex;align-items:center;gap:6px;padding:3px 7px;border-radius:6px;background:#fff;max-width:100%;vertical-align:middle;flex-shrink:0}
.brand-lockup .brand-symbol{width:28px!important;height:28px!important;object-fit:contain}
.brand-lockup .brand-wordmark{width:136px!important;height:20px!important;object-fit:contain}
.brand{max-width:100%}.touch-header .brand-lockup{padding-block:1px}
.sidebar .brand{min-width:0;padding-left:0}.sidebar .brand-lockup{width:100%;min-width:0;flex-shrink:1}.sidebar .brand-lockup .brand-symbol{width:24px!important;height:24px!important;flex:0 0 24px}.sidebar .brand-lockup .brand-wordmark{width:calc(100% - 30px)!important;max-width:136px;min-width:0}
.touch-header.dictating{height:56px;min-height:56px}
.touch-classroom .end-dictation{min-height:48px;min-width:112px;background:#713747;border:1px solid #f0a3ac;color:#fff;font-size:16px;padding:8px 14px;touch-action:manipulation}
#dictation-progress{white-space:nowrap;font-variant-numeric:tabular-nums;color:#61e0cf;font-size:14px}
.touch-popover.agent{width:308px;display:flex;flex-direction:column;overflow:hidden;max-height:calc(100vh - 148px);padding:14px}
.agent-menu-head{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-shrink:0}
.touch-popover .agent-menu-head>button{min-width:44px;min-height:44px;width:44px;height:44px;padding:0;font-size:28px;background:transparent}
.agent-menu-label{font-size:14px;color:#9eb4c5;margin:6px 0 10px;flex-shrink:0}
.touch-agent-list{display:flex;flex-direction:column;gap:6px;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;min-height:52px}
.touch-popover.agent .touch-tile{flex-direction:row;justify-content:flex-start;text-align:left;min-height:52px!important;flex-shrink:0;gap:14px;padding:10px 14px;border-radius:10px}
.touch-popover.agent .touch-tile svg{width:24px;height:24px;flex-shrink:0}
.agent-command-form{display:flex;gap:8px;padding-top:10px;flex-shrink:0}
.agent-command-form input{flex:1;min-width:0;min-height:48px;font-size:15px;background:#0c1622;border:1px solid #324d5b;border-radius:10px;color:#eaf2f7;padding:10px}
.touch-popover .agent-command-form button{min-width:60px;min-height:48px;padding:8px;background:#61e0cf;color:#0c1622}
.agent-inline-reply{font-size:14px;color:#b6e8dd;line-height:1.5;max-height:76px;overflow-y:auto;flex-shrink:0;margin-top:8px}
.agent-inline-reply:empty{display:none}
@media(max-width:1100px){.touch-header{gap:10px!important}.touch-header .brand-wordmark{width:110px!important}.touch-header .online-count{font-size:12px}.touch-lesson-title{font-size:12px}.end-dictation{min-width:100px!important}#dictation-progress{font-size:12px}}

/* Keep both touch entrances and the dictation stop control above the dismiss layer. */
.touch-dock{z-index:36}
.touch-classroom .touch-header{position:relative;z-index:36}
.touch-popover,.touch-popover.agent{max-height:calc(100vh - 176px)}

/* The name owns the remaining row width; a second spacer must not compete with it. */
.touch-classroom .student-overlay>.grow{display:none}

/* Exam collection keeps the paper wall visible and the touch target reachable. */
.touch-classroom .touch-header.quiz-collection{height:56px;min-height:56px}
.touch-classroom .collect-exam{min-height:48px;min-width:104px;background:#61e0cf;color:#0c1622;border:0;border-radius:8px;font-size:16px;padding:8px 16px;flex-shrink:0;touch-action:manipulation}
#collection-progress{color:#b9cfdb;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.grading-overlay{position:absolute;inset:0;pointer-events:none;z-index:2}
.grading-overlay svg{width:100%;height:100%;display:block}
@media(max-width:1100px){#collection-progress{max-width:230px;font-size:12px}.quiz-collection .touch-lesson-title{max-width:160px}}
@media(max-width:800px){.quiz-collection .brand-wordmark,.quiz-collection .touch-lesson-title{display:none}}

/* The collected exam stays on a dedicated screen while the saved results arrive. */
.grading-app{height:100dvh;display:flex;flex-direction:column;background:#0c1622;color:#e6eff5}
.grading-app [hidden]{display:none}
.grading-header{flex:none;display:flex;align-items:center;gap:16px;min-height:64px;padding:8px 20px;background:#182535;border-bottom:1px solid #2a3c4f}
.grading-header>b{color:#aec2d2;font-size:14px}
.grading-header button,.grading-actions button{min-height:44px;color:#e9f6f7;border:1px solid #385363;background:#233747}
.grading-header button:hover,.grading-actions button:hover{background:#304957}
.grading-work{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(290px,360px)}
.grading-paper{overflow:auto;min-height:0;padding:16px;scrollbar-gutter:stable;container-type:size}
.grading-sheet{width:min(100%,880px,calc(100cqh * var(--paper-ratio,.707)));margin-inline:auto;position:relative;background:#fff;box-shadow:0 3px 16px #0005}
.grading-sheet>img,.grading-sheet>canvas{position:absolute;inset:0;width:100%;height:100%;display:block}
.grading-results{overflow:auto;min-height:0;display:flex;flex-direction:column;gap:14px;padding:20px;background:#131f2d;border-inline-start:1px solid #2a3c4f}
.grading-progress{padding:16px;border:1px solid #314455;background:#1b2c3c;border-radius:12px}
.grading-title{display:flex;gap:12px;align-items:center}
.grading-title h1{margin:0;font-size:20px;line-height:1.4;color:#ecf9f8}
.grading-title h1:focus{outline:none}
.grading-spinner{flex:none;width:22px;height:22px;border-radius:50%;border:2px solid #426776;border-top-color:#61e0cf;animation:grading-rotate .9s linear infinite}
.grading-progress.finished .grading-spinner{display:none}
.grading-count,.grading-notice{margin:8px 0 0;color:#b6cad8;line-height:1.55;font-size:14px}
.grading-progress progress{width:100%;height:8px;margin-top:10px;display:block;accent-color:#61e0cf}
.grading-student-row{display:flex;gap:12px}
.grading-student-row>label{flex:1;min-width:0;color:#b6cad8;font-size:14px}
.grading-student-row select{width:100%;min-height:44px;margin-top:5px;color:#e6eff5;background:#182939;border-color:#426073}
.grading-score{font-size:18px;color:#8cf0df;font-weight:600}
.grading-score:empty,.grading-questions:empty,.grading-actions:not(:has(button:not([hidden]))){display:none}
.grading-questions{display:grid;gap:8px}
.grading-question{padding:12px;background:#1b2c3c;border:1px solid #314455;border-radius:8px}
.grading-question>div{display:flex;gap:8px;justify-content:space-between;align-items:baseline}
.grading-question span{color:#bfd0dc;font-size:13px}
.grading-question.correct span{color:#8cf0df}
.grading-question.partial span,.grading-question.review span{color:#ffd489}
.grading-question.incorrect span{color:#ffb0b0}
.grading-question p,.grading-question small{display:block;margin:6px 0 0;color:#c4d6e0;line-height:1.5;overflow-wrap:anywhere}
.grading-actions{display:flex;flex-wrap:wrap;gap:8px}
.grading-actions [data-grading-report]{background:#17665f;border-color:#2b8c81}
@keyframes grading-rotate{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.grading-spinner{animation:none}}
@media(max-width:680px){
 .grading-header{min-height:56px;padding-inline:10px;gap:8px}
 .grading-header>b{display:none}
 .grading-work{display:flex;flex-direction:column;overflow:auto}
 .grading-paper{flex:none;order:2;overflow:visible;padding:12px;container-type:normal}
 .grading-sheet{width:100%}
 .grading-results{flex:none;border-inline-start:0;padding:12px;overflow:visible}
}
