.teacher-dialog,.mqr-message-dialog,.mqr-push-dialog{box-sizing:border-box;width:min(560px,calc(100% - 24px));max-height:calc(100dvh - 32px);margin:auto;padding:20px;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;background:var(--panel,#151515);color:var(--text,#eee);border:1px solid var(--line,#393939)}
:root[data-student-theme=light] .teacher-dialog,:root[data-student-theme=light] .mqr-message-dialog,:root[data-student-theme=light] .mqr-push-dialog,:root[data-admin-theme=light] .mqr-message-dialog,:root[data-admin-theme=light] .mqr-push-dialog{background:#fff;color:#252525;border-color:#d8d6d0;border-radius:10px}
.teacher-dialog::backdrop,.mqr-message-dialog::backdrop,.mqr-push-dialog::backdrop{background:rgba(0,0,0,.65)}
.teacher-dialog *, .mqr-message-dialog *, .mqr-push-dialog *, #teacherHome *{box-sizing:border-box;min-width:0;overflow-wrap:anywhere}
.teacher-dialog .class-topline,.mqr-message-dialog .class-topline,.mqr-push-dialog .class-topline{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px}
.teacher-dialog h2,.mqr-message-dialog h2,.mqr-push-dialog h2{font-size:18px;line-height:1.3;margin:0}
.teacher-dialog button,.mqr-message-dialog button,.mqr-push-dialog button,#teacherHome button{font:inherit;font-size:12px;line-height:1.4;padding:10px 12px;border:1px solid var(--line,#555);color:inherit;background:transparent;cursor:pointer;transition:background .3s,border-color .3s,box-shadow .3s;min-height:40px}
.teacher-dialog button:hover,.mqr-message-dialog button:hover,.mqr-push-dialog button:hover,#teacherHome button:hover{border-color:#c8ae6d;background:rgba(200,174,109,.09);box-shadow:0 0 12px rgba(200,174,109,.10)}
.teacher-dialog button:focus-visible,.mqr-message-dialog button:focus-visible,.mqr-push-dialog button:focus-visible,#teacherHome button:focus-visible{outline:2px solid #c8ae6d;outline-offset:2px}
.teacher-dialog button:disabled,.mqr-message-dialog button:disabled,.mqr-push-dialog button:disabled{opacity:.55;cursor:wait}
.teacher-dialog [data-close],.mqr-message-dialog [data-close],.mqr-push-dialog [data-close]{flex:0 0 36px;width:36px;min-height:36px;padding:4px;font-size:23px;border:0}
body.teacher-only-account #openScannerButton,body.teacher-only-account #studentClassActions,body.teacher-only-account .plan-card,body.teacher-only-account #nextReservedClass,body.teacher-only-account #openHistoryButton{display:none!important}
body.teacher-only-account #accountView:not(.hidden){grid-template-columns:minmax(0,1fr);grid-template-areas:"hero" "upcoming" "logout";gap:16px}
body.teacher-only-account .student-shell{align-items:start}body.teacher-only-account .student-card{margin-top:0}
#teacherHome{width:100%;max-width:620px;margin:auto}#teacherHome .teacher-next{padding:18px;border:1px solid var(--line,#444)}
.teacher-kicker{font-size:10px;letter-spacing:1.4px;color:var(--gold,#b59b59)}.teacher-next h2{font-size:21px;line-height:1.3;margin:8px 0}.teacher-next p{font-size:13px;margin:8px 0 14px}
.teacher-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 0}.teacher-stats>div{padding:12px;border:1px solid var(--line,#444)}.teacher-stats strong{display:block;font-size:23px;font-weight:600}.teacher-stats span{display:block;font-size:11px;line-height:1.4;margin-top:4px;opacity:.75}
.teacher-home-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.teacher-home-actions [data-messages]{grid-column:1/-1}
.teacher-slot{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:13px 0;border-bottom:1px solid var(--line,#444)}.teacher-slot>div{flex:1}.teacher-slot strong,.teacher-roster strong{display:block;font-size:14px;line-height:1.4}.teacher-slot small,.teacher-roster small{display:block;font-size:12px;opacity:.7;line-height:1.5;margin-top:4px}.teacher-slot button{flex:0 0 auto;max-width:40%}.teacher-note{font-size:12px;line-height:1.6;opacity:.75}.teacher-roster article{padding:12px 0;border-bottom:1px solid var(--line,#444)}
.teacher-profile-form,.message-compose{display:grid;gap:12px;margin-top:16px}.teacher-profile-form label,.message-compose label{display:grid;gap:6px;font-size:12px}.teacher-profile-form input:not([type=hidden]),.teacher-profile-form textarea,.message-compose textarea,.message-compose select{font:inherit;font-size:16px;width:100%;max-width:100%;padding:10px;background:transparent;color:inherit;border:1px solid var(--line,#555);border-radius:0}.teacher-profile-form textarea,.message-compose textarea{resize:vertical}.teacher-profile-form img{max-width:100px;max-height:100px;object-fit:cover}
.message-thread-button{display:flex;width:100%;justify-content:space-between;gap:12px;text-align:left;margin:8px 0}.message-thread-button small{display:block;margin-top:5px;opacity:.7}.message-bubble{padding:12px;margin:10px 24px 10px 0;border:1px solid var(--line,#444)}.message-bubble.is-own{margin:10px 0 10px 24px;background:rgba(183,160,95,.08)}.message-bubble p{white-space:pre-wrap;font-size:14px;line-height:1.5;margin:6px 0}.message-bubble small{font-size:10px;opacity:.7}.message-bubble strong{font-size:12px}.mqr-push-dialog p{font-size:13px;line-height:1.6}.push-actions{display:flex;gap:8px;flex-wrap:wrap}
:root[data-student-theme=light] #teacherHome .teacher-next,:root[data-student-theme=light] .teacher-stats>div,:root[data-student-theme=light] #teacherHome button{border-radius:8px;border-color:#d5d2ca}
@media(max-width:420px){.teacher-dialog,.mqr-message-dialog,.mqr-push-dialog{padding:16px}.teacher-slot{gap:8px}.teacher-slot button{padding:8px;font-size:11px}.teacher-next h2{font-size:19px}}

/* Phone layout uses the available height; content can still grow on small screens. */
@media(max-width:600px){
 :root body.is-account-view.teacher-only-account .student-shell{padding:0;min-height:100vh;min-height:100dvh;display:flex;align-items:stretch;justify-content:center}
 :root body.is-account-view.teacher-only-account .student-card{width:100%;max-width:none;min-height:100vh;min-height:100dvh;height:auto;display:flex;flex-direction:column;border:0}
 :root body.is-account-view.teacher-only-account .student-brand{flex:0 0 auto}
 :root body.is-account-view.teacher-only-account #accountView:not(.hidden){flex:1 0 auto;display:grid;grid-template-rows:auto minmax(min-content,1fr) auto;grid-template-areas:"hero" "upcoming" "logout";gap:clamp(12px,2dvh,20px);padding-bottom:8px}
 :root body.is-account-view.teacher-only-account .upcoming-classes-card{display:flex;flex-direction:column;min-height:0;margin:0;padding:0}
 :root body.is-account-view.teacher-only-account #teacherHome{display:flex;flex:1;flex-direction:column;justify-content:space-evenly;gap:clamp(14px,2.5dvh,22px);width:100%;margin:0 auto}
 :root body.is-account-view.teacher-only-account .teacher-next{flex:0 0 auto;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;min-height:clamp(185px,26dvh,230px);padding:clamp(18px,3dvh,28px)}
 :root body.is-account-view.teacher-only-account .teacher-next h2{font-size:clamp(19px,5vw,23px);margin:9px 0;line-height:1.35}
 :root body.is-account-view.teacher-only-account .teacher-next button{margin-top:4px}
 :root body.is-account-view.teacher-only-account .teacher-stats{margin:0;gap:10px;flex:0 0 auto}
 :root body.is-account-view.teacher-only-account .teacher-stats>div{padding:14px}
 :root body.is-account-view.teacher-only-account .teacher-home-actions{flex:0 0 auto;gap:9px}
 :root body.is-account-view.teacher-only-account .teacher-home-actions button{min-height:44px}
 :root body.is-account-view.teacher-only-account .logout-link{margin:0;min-height:40px}
 :root body.is-account-view.teacher-only-account .student-footer{flex:0 0 auto;margin-top:auto;padding:10px 16px calc(12px + env(safe-area-inset-bottom));background:transparent}
}
