/* Desktop uses the teacher's frame; mobile uses the pupil's 480px shell. */
:root{--role-desktop-width:1580px;--role-mobile-width:480px;--role-stage-height:1060px}
@media(min-width:761px) and (hover:hover) and (pointer:fine){
 html:has(.role-page),body.role-page{height:100dvh;overflow:hidden}
 #role-canvas,#board-canvas{min-height:var(--role-stage-height)}
 #role-canvas{width:100%;position:absolute;top:0;left:50%;transform-origin:top center;transform:translateX(-50%) scale(var(--role-scale,1));padding-top:40px}
 #role-canvas .board-header{max-width:var(--role-desktop-width);width:100%;padding:24px 36px;min-height:114px;margin:0 auto;gap:28px}
 #role-canvas .board-header img{width:90px;height:auto;display:block}
 #role-canvas .board-header nav{font-size:13px;display:flex;align-items:center;gap:20px}
 #role-canvas>.pupil-main,#role-canvas>.self-layout{width:calc(min(100%,var(--role-desktop-width)) - 72px);max-width:none;height:700px;margin:30px auto 35px;padding:48px 28px 24px;background:#fff;border:1px solid var(--line);border-radius:22px;overflow:auto;line-height:1.5}
 #role-canvas h1{font-size:clamp(26px,3vw,40px);letter-spacing:-1px;line-height:1.15;margin:0 0 18px}
 #role-canvas h2{font-size:23px;letter-spacing:-.5px;line-height:1.2;margin:0 0 16px}
 #role-canvas p{font-size:16px;line-height:1.5}
 #role-canvas .eyebrow{font-size:10px;letter-spacing:1.4px}
 #role-canvas .portal-join,#role-canvas .portal-login,#role-canvas .self-panel{max-width:760px;padding:24px;margin:20px 0;border:1px solid var(--line);border-radius:20px}
 #role-canvas .entry-primary{max-width:440px;display:flex;align-items:center;justify-content:center;text-decoration:none}
 #role-canvas>.site-source-strip{max-width:var(--role-desktop-width);margin:0 auto;padding:12px 28px}
 #role-canvas>.site-source-strip p{font-size:10px;line-height:1.45}
 #role-canvas>.pupil-footer{max-width:var(--role-desktop-width);width:100%;margin:0 auto;padding:20px 36px;border-top:1px solid var(--line);font-size:10px;display:flex;gap:20px}
}
@media(min-width:1000px) and (max-height:850px) and (hover:hover) and (pointer:fine){
 #role-canvas .board-header{padding:12px 28px;min-height:74px}#role-canvas .board-header img{width:68px}
 #role-canvas>.pupil-main,#role-canvas>.self-layout{width:calc(min(100%,var(--role-desktop-width)) - 56px);margin:18px auto;padding:48px 28px 24px}
}
@media(max-width:760px),(hover:none) and (pointer:coarse) and (max-width:1100px){
 .role-page .board-header{border:0;justify-content:space-between}
 .role-page.mobile-app-shell>.pupil-footer{max-width:var(--role-mobile-width);padding:10px 20px;margin:0 auto}
 .teacher-mobile-allowed.weekly-page{height:100dvh;overflow:hidden;display:flex;flex-direction:column;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}
 .teacher-mobile-allowed.weekly-page #board-canvas{position:static;transform:none!important;min-height:0;width:100%;flex:1;min-width:0;display:flex;flex-direction:column;overflow:hidden}
 .teacher-mobile-allowed.weekly-page .teacher-navigation:not(.teacher-popup-layer){display:none}
 .teacher-mobile-allowed.weekly-page .board-header{width:100%;max-width:480px;min-height:76px;padding:16px 20px 10px;margin:0 auto;gap:12px;border:0;flex-shrink:0;flex-wrap:wrap}
 .teacher-mobile-allowed.weekly-page .board-header img{width:76px}
 .teacher-mobile-allowed.weekly-page .board-intro{display:none}
 .teacher-mobile-allowed.weekly-page .board-header .quiet-button{font-size:10px;min-height:44px;padding:8px;max-width:none;margin-left:auto}
 .teacher-mobile-allowed.weekly-page .board-layout{width:100%;max-width:480px;margin:0 auto;padding:12px 20px 24px;display:flex;flex-direction:column;flex:1;min-height:0;overflow:auto;gap:0}
 .teacher-mobile-allowed.weekly-page .board-layout>.student-monitor{display:none}
 .teacher-mobile-allowed.weekly-page .board-layout>.board{width:100%;height:auto;min-height:100%;padding:42px 20px 20px;border-radius:20px;overflow:visible;display:flex;flex-direction:column}
 .teacher-mobile-allowed.weekly-page .teacher-start-flow{flex:1;min-height:420px;grid-template-rows:minmax(0,1fr) 54px}
 .teacher-mobile-allowed.weekly-page .teacher-start-content{overflow:visible;justify-content:flex-start;padding:0}
 .teacher-mobile-allowed.weekly-page .teacher-start-content h2{font-size:34px;line-height:1.08;letter-spacing:-1.2px}
 .teacher-mobile-allowed.weekly-page input{font-size:16px}
 .teacher-mobile-allowed.weekly-page .board-footer{max-width:480px;width:100%;padding:10px 20px;margin:0 auto;font-size:12px;flex-shrink:0}
 .teacher-mobile-allowed.weekly-page .source-strip{max-width:480px;width:100%;flex-shrink:0}
}
@media(min-width:761px) and (hover:hover) and (pointer:fine){#role-canvas>.site-source-strip h2{font-size:13px;letter-spacing:normal;line-height:normal;margin:0 0 5px}}
@media(max-width:760px),(hover:none) and (pointer:coarse) and (max-width:1100px){
 .teacher-mobile-allowed.weekly-page .teacher-start-flow{display:flex;flex-direction:column;gap:20px}
 .teacher-mobile-allowed.weekly-page .teacher-start-content{flex:1;flex-shrink:0}
 .teacher-mobile-allowed.weekly-page .teacher-start-flow>.slide-controls{width:100%;flex-shrink:0;margin-top:16px}
}

@media(max-width:760px),(hover:none) and (pointer:coarse) and (max-width:1100px){
 .teacher-mobile-allowed.weekly-page .teacher-start-content h3{font-size:23px;line-height:1.2;letter-spacing:-.5px}
 .teacher-mobile-allowed.weekly-page .teacher-start-content input{min-height:52px;border-radius:12px}
 .teacher-mobile-allowed.weekly-page .lesson-button{min-height:52px;border-radius:14px;font-size:13px;display:inline-flex;align-items:center;justify-content:center}
}
@media(max-width:760px),(hover:none) and (pointer:coarse) and (max-width:1100px){
 .teacher-mobile-allowed.weekly-page .board-header{gap:8px}
 .teacher-mobile-allowed.weekly-page #teacher-login{max-width:100px;white-space:normal;font-size:9px}
 .teacher-mobile-allowed.weekly-page .teacher-start-content{min-height:min-content;flex-basis:auto}
}
@media(max-width:760px),(hover:none) and (pointer:coarse) and (max-width:1100px){
 .teacher-mobile-allowed.weekly-page .board-layout>.board{display:block;flex-shrink:0;height:auto;min-height:620px}
 .teacher-mobile-allowed.weekly-page .teacher-start-flow{display:block;min-height:0}
 .teacher-mobile-allowed.weekly-page .teacher-start-content{display:block;min-height:0}
 .teacher-mobile-allowed.weekly-page .teacher-start-flow>.slide-controls{margin-top:24px}
}
