/* Screen-only rules: departmental print/export templates keep their original layout. */
html, body { width:100%; max-width:100%; }
#app, #main, .panel-body, .profile-head, .workspace-bar { min-width:0; }
#app { height:calc(100dvh - 44px); }
#main .panel-body { overflow:auto; min-width:0; zoom:var(--workspace-zoom,1); }
.workspace-bar, .head-actions, .modal-actions { flex-wrap:wrap; }
.profile-title, .profile-sub, .workspace-context { overflow-wrap:anywhere; }
.modal-overlay { padding:16px; overflow:auto; }
.modal-box { max-height:calc(100dvh - 32px); overflow:auto; flex-shrink:0; }
body #authGate {
  width:100%; height:100vh; height:100dvh; min-height:0;
  display:flex; flex-direction:column; align-items:stretch; justify-content:flex-start;
  overflow:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch;
  padding:clamp(12px,3vw,32px);
  padding-bottom:max(16px,env(safe-area-inset-bottom,0px));
}
#authGate .auth-card {
  flex:none; width:100%; max-width:480px; min-width:0; margin:auto;
  padding:clamp(18px,4vw,30px); border-radius:16px;
}
#authGate .auth-crest { width:132px; height:132px; max-width:100%; object-fit:contain; margin:0 auto 16px; }
#authGate input, #authGate select { min-width:0; min-height:46px; font-size:16px; }
#authGate .auth-modes { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; }
#authGate .auth-modes button { min-width:0; min-height:44px; padding:8px 3px; font-size:11px; letter-spacing:0; }
#authGate .auth-btn, #authGate .auth-about-btn { min-height:46px; white-space:normal; }
#authGate .auth-credit { overflow-wrap:anywhere; }
#classLoadStatus { margin-top:12px; color:var(--clay); font-size:13px; line-height:1.5; }
#authGate .auth-retry { margin-top:8px; padding:10px; min-height:44px; width:100%; border:1px solid var(--line-strong); border-radius:8px; background:var(--paper); color:var(--pine); font:inherit; cursor:pointer; }
#authGate [hidden] { display:none!important; }
@media (min-width:821px) and (max-width:1200px) {
  #sidebar { width:240px; min-width:220px; }
  .panel-body, .profile-head { padding-left:20px; padding-right:20px; }
}
@media (max-width:820px) {
  #app { height:calc(100dvh - 56px); }
  #main .panel-body { min-height:0; flex:1; overflow:auto; }
  #main { overflow:hidden; }
  .workspace-bar { padding:10px 12px; gap:8px; }
  .profile-head, .panel-body { padding-left:12px; padding-right:12px; }
  .ig-grid { grid-template-columns:repeat(auto-fit,minmax(min(190px,100%),1fr)); }
  #authGate .auth-crest { width:112px; height:112px; }
}
@media (max-width:380px) {
  #authGate .auth-modes { grid-template-columns:1fr; border-radius:12px; }
  #authGate .auth-modes button { border-radius:8px; font-size:12px; }
}
@media (pointer:coarse) {
  .side-tab, .print-btn, .btn, .drawer-close, #menuBtn { min-height:44px; }
}
