.teacher-app{--bg:#f3f4ee;--paper:#fff;--line:#e3e8dd;--green:#315e4b;--light:#e5ede2;font-size:16px;background:var(--bg);-webkit-tap-highlight-color:transparent}.teacher-app button{min-height:50px;border-radius:14px;font-size:16px;font-weight:550;user-select:none}.teacher-app button:active{transform:scale(.98)}.teacher-app input,.teacher-app textarea,.teacher-app select{font-size:17px;min-height:50px;border-radius:12px}.teacher-app h1,.teacher-app h2,.teacher-app h3{letter-spacing:0}.tablet-app{max-width:1120px;margin:auto;min-height:100dvh;padding-top:env(safe-area-inset-top)}
.app-header{height:78px;padding:12px 30px;display:flex;align-items:center;justify-content:space-between;gap:20px;background:var(--bg);position:sticky;top:0;z-index:15}.app-heading{display:flex;gap:12px;align-items:center;min-width:0}.app-mark{font-size:32px;color:var(--gold)}.app-heading h1{font-size:20px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.app-header-actions{display:flex;align-items:center;gap:10px;flex-shrink:0}.connection{font-size:12px;color:var(--muted);white-space:nowrap}.teacher-app .icon-button{width:50px;height:50px;min-width:50px;padding:12px;border:0;background:transparent;font-size:28px;line-height:1}.icon-button svg,.tabbar svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}.app-header .icon-button{background:#fff9}.app-content{padding:14px 30px calc(116px + env(safe-area-inset-bottom))}.app-view{max-width:960px;margin:auto}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:20px}.section-heading h2{font-size:26px;margin:0}.subtle{font-size:14px;color:var(--muted)}
.lesson-card{background:var(--paper);border-radius:24px;border:1px solid var(--line);padding:25px 30px 22px}.lesson-top{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:20px}.status-pill{display:inline-flex;align-items:center;padding:7px 12px;border-radius:30px;background:var(--light);color:var(--green);font-size:13px;white-space:nowrap}.lesson-card>h2{font-size:24px;line-height:1.45;margin:0 0 8px}.teacher-app details summary{cursor:pointer;min-height:44px;display:flex;align-items:center;gap:8px;font-size:14px;color:var(--muted);list-style:none}.teacher-app details summary:after{content:'⌄';margin-left:auto}.teacher-app details[open] summary:after{content:'⌃'}.teacher-app details summary::-webkit-details-marker{display:none}.task-details p{font-size:15px;line-height:1.7;margin:0 0 12px;color:var(--muted);white-space:pre-wrap}.timer-main{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:16px 0 21px;gap:4px}.timer-main output{font-size:clamp(80px,11vw,116px);font-weight:500;letter-spacing:-5px;line-height:1.18;font-variant-numeric:tabular-nums}.timer-main span{font-size:14px;color:var(--muted)}.timer-actions{display:flex;justify-content:center;gap:12px}.timer-actions button:first-child{min-width:210px;min-height:56px;font-size:19px}.timer-actions button:last-child{min-width:100px}.lesson-progress{margin-top:23px}.lesson-progress>div:first-child{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:6px}.teacher-app .text-button{background:transparent;border:0;padding:8px 0;color:var(--muted);min-height:46px;font-size:15px}.text-button strong{color:var(--green);font-size:20px;margin-left:8px}.text-button span{font-size:14px}.progress{height:6px}.quick-section{margin-top:26px}.quick-section h3{font-size:15px;font-weight:500;margin-bottom:13px;color:var(--muted)}.quick-tasks{display:grid;grid-template-columns:repeat(4,1fr);gap:13px}.quick-tasks button{display:flex;align-items:center;justify-content:center;gap:13px;padding:18px 10px;border:0;background:#e8ece2;min-height:78px}.quick-tasks b{font-size:18px;font-weight:550}.task-icon{font-size:28px;color:var(--green);font-weight:400}
.tabbar{position:fixed;bottom:0;left:0;right:0;height:calc(84px + env(safe-area-inset-bottom));padding:8px max(22px,calc((100vw - 600px)/2)) calc(8px + env(safe-area-inset-bottom));display:flex;gap:18px;align-items:stretch;background:#fffffff5;border-top:1px solid var(--line);z-index:30;backdrop-filter:blur(15px)}.teacher-app .tabbar button{flex:1;border:0;background:none;border-radius:18px;color:#8b9487;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;position:relative;font-size:13px;min-width:0}.teacher-app .tabbar button.active{color:var(--green);background:var(--light)}.tabbar i{position:absolute;top:7px;left:calc(50% + 12px);width:7px;height:7px;background:var(--gold);border-radius:50%}
.remote-layout{display:grid;grid-template-columns:1fr;gap:22px}.screen-card{background:white;border:1px solid var(--line);border-radius:20px;overflow:hidden}.preview{aspect-ratio:16/9}.preview iframe{pointer-events:none}.preview-caption{padding:15px 20px;display:flex;justify-content:space-between;font-size:16px;gap:15px}.preview-caption span:last-child{color:var(--muted);font-variant-numeric:tabular-nums}.remote-controls{display:flex;flex-direction:column;gap:14px}.remote-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.remote-grid button{min-height:70px;font-size:19px;display:flex;gap:18px;align-items:center;justify-content:center}.remote-grid button span{font-size:25px}.mode-controls,.remote-secondary{display:flex;gap:10px}.mode-controls button,.remote-secondary button{flex:1;font-size:15px}.teacher-app .mode-controls button{background:var(--light);border-color:transparent}.teacher-app .mode-controls button.primary{background:var(--green)}
.result-list{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:18px}.result-card{background:white;border:2px solid transparent;border-radius:18px;box-shadow:0 0 0 1px var(--line);overflow:hidden}.result-card.is-selected{border-color:var(--green);background:#f7faf3;box-shadow:none}.result-card-main{padding:19px 20px 8px}.result-card-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.result-student{display:flex;align-items:center;gap:10px;font-size:16px}.student-avatar{width:40px;height:40px;border-radius:12px;background:var(--light);display:grid;place-items:center;font-size:19px;color:var(--green);font-weight:600}.result-card p{font-size:17px;margin:0;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere}.result-card small{font-size:12px}.result-card-footer{padding:8px 14px 14px;display:flex;justify-content:space-between;gap:12px}.teacher-app .result-card-footer button{border:0;background:transparent;min-height:46px;font-size:14px;padding:9px 12px}.teacher-app .result-card-footer button.pick{color:var(--green);background:var(--light);min-width:100px}.result-card.is-selected .pick{background:var(--green)!important;color:white!important}.result-list .empty{grid-column:1/-1;background:white;border-radius:20px;padding:75px 25px;font-size:16px}.selection-dock{position:fixed;bottom:calc(84px + env(safe-area-inset-bottom));left:0;right:0;max-width:1120px;margin:auto;background:#f3f4eef7;backdrop-filter:blur(12px);padding:13px 30px;display:flex;align-items:center;gap:12px;z-index:20;border-top:1px solid var(--line)}.selection-dock>div{margin-right:auto;min-width:0}.selection-dock>div>span{display:block;font-size:14px;margin-bottom:7px}.anonymous-toggle{display:flex;align-items:center;gap:7px;font-size:13px;margin:0}.teacher-app .anonymous-toggle input{min-height:20px;width:20px;height:20px;margin:0;accent-color:var(--green)}.selection-dock>button{min-width:110px}.selection-dock>button:last-child{min-width:65px}.app-view#view-results{padding-bottom:100px}
.teacher-app .modal-backdrop{z-index:50;padding:25px;background:#1e302d65;backdrop-filter:blur(3px)}.teacher-app .app-sheet{border-radius:25px;width:min(620px,100%);padding:25px;max-height:calc(100dvh - 50px);overscroll-behavior:contain}.sheet-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.sheet-heading h2{font-size:23px;margin:0}.sheet-heading .icon-button{background:var(--bg)}.sheet-backdrop{align-items:end}.sheet-backdrop .app-sheet{border-radius:25px 25px 0 0;margin-bottom:-25px;padding-bottom:calc(25px + env(safe-area-inset-bottom));max-height:calc(100dvh - 35px)}.task-type-tabs{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:20px}.teacher-app .task-type-tabs button{border:0;background:var(--bg)}.teacher-app .task-type-tabs button.selected{background:var(--green);color:white}.teacher-app #task-title{font-size:20px;padding:12px 0;border:0;border-bottom:1px solid var(--line);border-radius:0;font-weight:550;box-shadow:none}.edit-instruction{margin:10px 0 18px}.edit-instruction textarea{margin:3px 0}.duration-presets{display:flex;gap:8px;flex-wrap:wrap}.duration-presets>button{flex:1;min-width:65px;padding:10px}.duration-presets button.selected{background:var(--light);border-color:var(--green)}.custom-duration{display:flex;align-items:center;gap:6px;width:96px}.custom-duration input{width:68px;padding:10px;text-align:center}.custom-duration span{font-size:14px;color:var(--muted)}.publish-footer{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-top:28px}.publish-footer .primary{min-width:180px}.publish-footer small,.sheet-note{font-size:13px;color:var(--muted);line-height:1.7}.sheet-note{margin:18px 0 0}.settings-tools{display:grid;gap:10px;margin-bottom:18px}.settings-tools button{text-align:left}.teacher-app #settings-sheet details{border-top:1px solid var(--line);padding:7px 0}.teacher-app #settings-sheet summary{font-size:16px;color:var(--ink)}.teacher-app #settings-form button{margin:16px 0}.release-row{display:flex;gap:10px}.release-row input{min-width:0}.release-row button{min-width:110px}.page-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.page-grid button{text-align:left;min-height:58px;font-size:15px}.page-grid button.current{background:var(--light);border-color:var(--green)}.page-grid button b{color:var(--gold);margin-right:12px}.teacher-app .toast{bottom:calc(105px + env(safe-area-inset-bottom));border-radius:15px;font-size:15px}.teacher-app #modal-content p{line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere}.teacher-app #modal-content .join-code{font-size:42px;letter-spacing:8px}
.pair-screen{min-height:100dvh;display:grid;place-items:center;padding:25px}.pair-card{width:min(420px,100%);text-align:center}.app-symbol{font-size:65px;color:var(--gold)}.pair-card h1{font-size:28px;margin:12px 0}.pair-card>p{color:var(--muted)}.pair-card label{text-align:left;margin-top:35px}.pair-card input{font-size:26px;letter-spacing:6px;text-align:center;padding:16px 8px}.pair-card button{margin-top:18px;min-height:56px}.pair-card .pair-help{font-size:13px;line-height:1.8;margin-top:25px}.pair-card #pair-error{font-size:14px;color:var(--red)}
@media(min-width:900px) and (orientation:landscape){.remote-layout{grid-template-columns:minmax(0,1.4fr) minmax(290px,1fr);align-items:center;gap:24px}.lesson-card{max-width:790px;margin:auto;padding:20px 30px}.quick-section{max-width:790px;margin:22px auto 0}.timer-main{padding:7px 0 14px}.timer-main output{font-size:100px}.lesson-top{margin-bottom:13px}.lesson-progress{margin-top:13px}.quick-tasks button{min-height:68px}.section-heading{margin-bottom:16px}}
@media(max-width:600px){.app-header{height:70px;padding:10px 17px;gap:12px}.app-heading{gap:8px}.app-heading h1{font-size:17px}.app-mark{font-size:27px}.app-header-actions{gap:3px}.connection{display:none}.teacher-app .app-header .icon-button{min-width:44px;width:44px;height:44px;min-height:44px}.app-content{padding:14px 18px calc(112px + env(safe-area-inset-bottom))}.section-heading h2{font-size:24px}.lesson-card{padding:22px 20px;border-radius:22px}.lesson-top{gap:8px;margin-bottom:20px}.lesson-top .subtle{font-size:12px}.lesson-card>h2{font-size:21px}.timer-main{padding:24px 0}.timer-main output{font-size:88px}.timer-actions button:first-child{min-width:0;flex:1}.timer-actions button:last-child{min-width:90px}.quick-tasks{gap:9px}.quick-tasks button{flex-direction:column;gap:6px;min-height:92px;padding:13px 5px}.quick-tasks b{font-size:15px}.tabbar{gap:12px;height:calc(80px + env(safe-area-inset-bottom));padding-left:18px;padding-right:18px}.result-list{grid-template-columns:1fr}.selection-dock{bottom:calc(80px + env(safe-area-inset-bottom));padding:12px 18px;gap:8px}.selection-dock>button{min-width:90px;padding:10px;font-size:15px}.selection-dock>button:last-child{min-width:50px}.teacher-app .modal-backdrop{padding:15px}.teacher-app .app-sheet{padding:20px;max-height:calc(100dvh - 30px)}.sheet-backdrop .app-sheet{margin-bottom:-15px;border-radius:22px 22px 0 0;padding-bottom:calc(20px + env(safe-area-inset-bottom))}.publish-footer{gap:10px}.publish-footer .primary{min-width:150px}.publish-footer small{font-size:12px}.page-grid{grid-template-columns:1fr}.teacher-app #modal-content .join-code{font-size:32px;letter-spacing:5px}}
@media(max-height:650px) and (orientation:landscape){.app-header{height:62px}.app-content{padding-top:5px}.timer-main{padding:4px 0 10px}.timer-main output{font-size:70px}.quick-section{margin-top:16px}.teacher-app .app-sheet{max-height:calc(100dvh - 20px)}}
@media(min-width:900px) and (orientation:landscape){.lesson-card{display:grid;grid-template-columns:1fr 1fr;column-gap:35px;padding:23px 30px}.lesson-top{grid-column:1/-1}.lesson-card>h2{grid-column:1;grid-row:2;align-self:center}.task-details{grid-column:1;grid-row:3}.timer-main{grid-column:2;grid-row:2/4;padding:0 0 12px}.timer-actions{grid-column:2;grid-row:4;gap:10px}.timer-actions button:first-child{min-width:165px;flex:1}.timer-actions button:last-child{min-width:90px}.lesson-progress{grid-column:1;grid-row:4;align-self:end;margin-top:5px}.quick-section{margin-top:25px}.quick-tasks button{min-height:78px}}
@media(min-width:900px) and (max-height:720px) and (orientation:landscape){.app-header{height:64px}.app-content{padding-top:8px}.section-heading{margin-bottom:12px}.section-heading h2{font-size:24px}.lesson-card{padding:16px 25px}.lesson-top{margin-bottom:10px}.timer-main output{font-size:80px}.timer-main{padding-bottom:8px}.lesson-progress{margin-top:0}.quick-section{margin-top:16px}.quick-section h3{margin-bottom:10px}.quick-tasks button{min-height:60px}}
.anonymous-toggle{min-height:44px}.selection-dock>div>span{margin-bottom:0}
/* Main device: 16:9 landscape tablet. Viewport height also accounts for browser bars. */
@media (min-width:900px) and (min-aspect-ratio:8/5){
 .teacher-app{--app-gutter:clamp(24px,3vw,58px);--app-header-h:clamp(64px,9vh,90px);--app-nav-h:clamp(74px,10.8vh,104px)}
 .tablet-app{max-width:none;height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}
 .app-header{height:var(--app-header-h);flex:0 0 var(--app-header-h);padding:10px var(--app-gutter);position:relative}
 .app-heading h1{font-size:clamp(20px,1.6vw,28px)}
 .app-content{flex:1;min-height:0;overflow:auto;padding:12px var(--app-gutter) calc(var(--app-nav-h) + 18px + env(safe-area-inset-bottom));overscroll-behavior:contain}
 .app-view{max-width:none;margin:0}
 #view-classroom{height:100%;min-height:450px;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:clamp(16px,2.2vh,26px)}
 .section-heading{margin:0 0 18px}.section-heading h2{font-size:clamp(25px,2vw,34px)}
 #view-classroom>.section-heading{margin:0}
 .lesson-card{width:100%;max-width:none;min-height:0;margin:0;padding:clamp(20px,2.8vh,34px) clamp(26px,3vw,48px);column-gap:clamp(36px,5vw,85px);grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto minmax(35px,1fr) auto auto;align-content:stretch}
 .lesson-top{margin-bottom:12px}.lesson-top .subtle{font-size:clamp(14px,1.2vw,19px)}
 .status-pill{font-size:clamp(13px,1.1vw,17px)}
 .lesson-card>h2{font-size:clamp(25px,2.3vw,38px);line-height:1.45;align-self:center;margin:0 0 8px;overflow-wrap:anywhere}
 .task-details summary{font-size:clamp(14px,1.2vw,19px)}
 .task-details[open]{max-height:115px;overflow:auto;overscroll-behavior:contain}
 .timer-main{padding:0 0 12px;align-self:center}.timer-main output{font-size:clamp(110px,18vh,196px);letter-spacing:-5px}
 .timer-main span{font-size:clamp(14px,1.2vw,20px)}
 .timer-actions button:first-child{min-height:clamp(56px,7vh,76px);font-size:clamp(19px,1.6vw,26px)}
 .timer-actions button:last-child{min-width:110px;font-size:clamp(16px,1.35vw,22px)}
 .lesson-progress{margin-top:10px}.lesson-progress .text-button{font-size:clamp(15px,1.25vw,20px);min-height:50px}.text-button strong{font-size:clamp(21px,1.8vw,29px)}
 .quick-section{max-width:none;margin:0}.quick-section h3{font-size:clamp(15px,1.2vw,19px);margin-bottom:10px}
 .quick-tasks{gap:clamp(14px,1.6vw,25px)}.quick-tasks button{min-height:clamp(64px,9vh,96px);padding:12px;font-size:20px}.quick-tasks b{font-size:clamp(18px,1.6vw,26px)}.task-icon{font-size:clamp(27px,2.3vw,38px)}
 .tabbar{height:calc(var(--app-nav-h) + env(safe-area-inset-bottom));padding:9px max(var(--app-gutter),calc((100vw - 840px)/2)) calc(9px + env(safe-area-inset-bottom));gap:24px}
 .teacher-app .tabbar button{font-size:clamp(14px,1.1vw,18px);gap:5px}.tabbar svg{width:clamp(25px,2vw,32px);height:clamp(25px,2vw,32px)}
 .remote-layout{grid-template-columns:minmax(0,1.65fr) minmax(340px,.9fr);align-items:center;gap:clamp(26px,3vw,48px)}
 .screen-card{width:100%;max-width:calc((100dvh - var(--app-header-h) - var(--app-nav-h) - 150px)*16/9);margin:auto}
 .preview-caption{font-size:clamp(16px,1.4vw,22px)}
 .remote-controls{gap:clamp(14px,2.1vh,24px)}.remote-grid{gap:clamp(12px,1.5vw,23px)}.remote-grid button{min-height:clamp(70px,11vh,120px);font-size:clamp(19px,1.65vw,28px)}
 .mode-controls button,.remote-secondary button{min-height:clamp(50px,7.5vh,78px);font-size:clamp(15px,1.25vw,21px)}
 .result-list{gap:22px}.result-card p{font-size:clamp(17px,1.35vw,22px)}
 .selection-dock{max-width:none;bottom:calc(var(--app-nav-h) + env(safe-area-inset-bottom));padding:12px var(--app-gutter)}
 .teacher-app .app-sheet{width:min(720px,calc(100vw - 48px))}.teacher-app .toast{bottom:calc(var(--app-nav-h) + 24px + env(safe-area-inset-bottom))}
}
