/* C096: last-loaded mobile rules cover first login, home and standalone calendar. */
@media screen and (max-width:767px), screen and (max-device-width:1100px) and (pointer:coarse){
  #loginScreen input:not([type=checkbox]),#loginScreen select,#loginScreen textarea{font-size:16px!important;}
  html,body{width:100%;min-width:0;max-width:100%;box-sizing:border-box;}
  html{-webkit-text-size-adjust:100%;text-size-adjust:100%;overflow-x:clip;}
  body{overflow-x:clip;}
  /* Hidden login background must not contribute intrinsic layout widths. */
  body.auth-locked>header.topbar,body.auth-locked>main.module-view{display:none!important;}
  body>main.module-view{min-width:0!important;max-width:100%!important;box-sizing:border-box!important;contain:inline-size;}
  body>main.module-view:not(.active){display:none!important;}
  body>header.topbar{contain:inline-size;}
  #homeModule .v165-home-hero,#homeModule .v165-launch-grid,#homeModule .v165-launch-card{min-width:0;max-width:100%;box-sizing:border-box;}
  #homeModule .v165-home-hero>div,#homeModule .v165-launch-copy{min-width:0;overflow-wrap:anywhere;}
  #homeModule .v165-launch-grid{grid-template-columns:minmax(0,1fr);}
  #homeModule .v165-launch-card{width:100%;grid-template-columns:44px minmax(0,1fr) 22px;gap:10px;padding:16px;}
  #homeModule .v165-launch-art{width:44px;height:44px;}
  #homeModule .v165-launch-art svg{width:32px;height:32px;}
  #servicesApp .service-topbar,#servicesApp .service-topbar>div{min-width:0;max-width:100%;overflow-wrap:anywhere;}
  .calendar-shell{width:100%;min-width:0;max-width:100%;box-sizing:border-box;}
  #pageUsers,#pageUsers .access-type-directory,#pageUsers .access-type-editor,
  #pageUsers .user-permissions-section,#pageUsers .access-type-management-grid{min-width:0!important;max-width:100%!important;box-sizing:border-box!important;}
  #pageUsers .access-type-management-grid{grid-template-columns:minmax(0,1fr)!important;}
  #pageUsers .access-type-directory-head,#pageUsers .access-type-row{flex-wrap:wrap!important;gap:10px!important;}
  #pageUsers .access-type-row>div{min-width:0;max-width:100%;}
  #pageUsers .access-type-row-actions{flex-wrap:wrap!important;}
  #pageUsers .access-type-row-actions button,#pageUsers #newAccessTypeBtn,#pageUsers #saveAccessTypeBtn{min-width:0!important;max-width:100%!important;white-space:normal!important;}
  #pageUsers .user-permission-matrix{width:100%!important;min-width:0!important;max-width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch;}
  #pageUsers .user-permission-row{grid-template-columns:minmax(150px,1fr) repeat(4,68px)!important;min-width:442px!important;padding:0 10px!important;}
  #pageUsers .user-permission-row strong{white-space:normal;overflow-wrap:anywhere;}
}
/* Do not expose unauthorized navigation while the calendar profile loads. */
.calendar-nav-groups:not(.calendar-nav-ready)>[data-calendar-nav-group],
.calendar-nav-groups:not(.calendar-nav-ready)>[data-powerhub-return]:not([data-powerhub-return="home"]),
body>header.topbar .calendar-nav-groups .calendar-nav-denied{display:none!important;visibility:hidden!important;}

/* C100: mobile login scrolls in the document; keyboard resizing must not crop it. */
@media screen and (max-width:767px), screen and (max-device-width:1100px) and (pointer:coarse) {
  body.auth-locked{overflow-y:auto!important;overflow-x:clip!important;min-height:100svh;background:#062b67;}
  #loginScreen{position:relative;inset:auto;width:100%;height:auto;min-height:100svh;max-height:none;overflow:visible;align-items:flex-start;padding:32px 16px max(24px,env(safe-area-inset-bottom));box-sizing:border-box;}
  #loginScreen .login-shell{width:100%;max-width:480px;min-width:0;min-height:0;grid-template-columns:minmax(0,1fr);flex-shrink:0;margin:auto;}
  #loginScreen .login-brand-panel{padding:16px;min-width:0;}
  #loginScreen .login-logo-wrap{width:88px;height:96px;padding:8px;border-radius:14px;}
  #loginScreen .login-brand-copy{margin-top:10px;}
  #loginScreen .login-brand-copy h1{font-size:20px;margin:0 0 4px;}
  #loginScreen .login-brand-copy p{font-size:12px;margin:0;}
  #loginScreen .login-card{min-width:0;padding:20px;}
  #loginScreen .login-card h2{font-size:23px;}
  #loginScreen .login-help{margin-bottom:14px;}
}

/* C101: readable login fields even with iOS remembered page scaling. */
@media screen and (max-width:767px), screen and (max-device-width:1100px) and (pointer:coarse) {
  #loginScreen input:not([type=checkbox]):not([type=radio]){font-size:20px!important;min-width:0;max-width:100%;}
  #loginScreen .login-field,#loginScreen .password-field-wrap{min-width:0;max-width:100%;}
}
