/* Keep the outer document stationary; each page owns its scrolling content.
   All geometry changes are limited to phone viewports. */
#lcms-ios-status-surface { display:none; }
@media (max-width:760px) {
  html.lcms-phone,html.lcms-phone body { width:100%;max-width:100%;overflow:hidden;overscroll-behavior-y:none; }
  html.lcms-phone { height:100%; }
  html.lcms-phone body { min-height:0;height:var(--lcms-viewport-height,100dvh); }
  html.lcms-phone body.auth-mode { overflow-y:auto; }
  html.lcms-phone #layout { min-height:0;height:calc(var(--lcms-viewport-height,100dvh) - var(--nav-h) - var(--lcms-bottom-h)); }
  html.lcms-phone body.lcms-material-mobile-active:has(.mlm-screen) #layout { height:calc(var(--lcms-viewport-height,100dvh) - var(--lcms-bottom-h)) !important; }
  html.lcms-phone body.lcms-material-mobile-active:not(:has(.mlm-screen)) #layout { height:var(--lcms-viewport-height,100dvh) !important; }
  /* This also retires the menu control in an already-cached material stylesheet. */
  html.lcms-phone .mlm-heading > .mlm-menu-toggle { display:none !important; }
  html.lcms-phone .mlm-heading > button { min-height:44px; }
  html.lcms-phone .lcms-mobile-menu[open] {
    bottom:auto;height:calc(var(--lcms-viewport-height,100dvh) - var(--lcms-safe-top,env(safe-area-inset-top,0px)) - var(--lcms-bottom-h,0px));
  }
  html.lcms-phone body.lcms-material-mobile-active:not(:has(.mlm-screen)) .lcms-mobile-menu[open] {
    height:calc(var(--lcms-viewport-height,100dvh) - var(--lcms-safe-top,env(safe-area-inset-top,0px)));
  }
  /* A real painted fixed element gives WebKit an opaque top-edge colour
     surface. It is not a CSS blur or an invisible/pseudo-element workaround. */
  html.lcms-ios-pwa { --lcms-safe-top:max(12px,env(safe-area-inset-top,0px)); }
  html.lcms-ios-pwa #lcms-ios-status-surface {
    display:block;position:fixed;inset:0 0 auto;height:12px;width:100%;
    z-index:2147483646;background:var(--phone-surface,var(--surface,#fff));
    pointer-events:none;user-select:none;
  }
  html.lcms-ios-pwa.lcms-auth-resuming #lcms-ios-status-surface { background:#f5f8fc; }
  html.lcms-phone.lcms-ios-pwa { --nav-h:calc(94px + var(--lcms-safe-top)); }
  html.lcms-phone.lcms-ios-pwa #topbar { padding-top:calc(2px + var(--lcms-safe-top)) !important; }
  html.lcms-phone.lcms-ios-pwa body.proj-collapsed { --nav-h:calc(54px + var(--lcms-safe-top)) !important; }
  html.lcms-phone.lcms-ios-pwa body.proj-collapsed #topbar { padding-top:calc(2px + var(--lcms-safe-top)) !important; }
  html.lcms-phone.lcms-ios-pwa body.lcms-material-mobile-active .mlm-heading,
  html.lcms-phone.lcms-ios-pwa body.lcms-material-mobile-active .mqr-heading {
    height:calc(48px + var(--lcms-safe-top));min-height:calc(48px + var(--lcms-safe-top));flex-basis:calc(48px + var(--lcms-safe-top));
    padding-top:calc(2px + var(--lcms-safe-top)) !important;
  }
  html.lcms-phone.lcms-ios-pwa .lcms-account-dialog[open] { max-height:calc(var(--lcms-viewport-height,100dvh) - var(--lcms-safe-top) - 12px); }
}
@media print { #lcms-ios-status-surface { display:none !important; } }
