@media (max-width:620px) {
  /* Header-anchored launcher, with an edge tray below it. The tray is
     deliberately above the other chart buttons while open. */
  body #ps-tools-launcher { left:10px !important; transition:background 160ms ease,border-color 160ms ease !important; }
  /* CSS alone owns the slide. Keep one opaque compositor surface rather
     than fading/recreating it while layout also rewrites its transform. */
  body #ps-tools-drawer { display:block !important; visibility:hidden; opacity:1 !important; pointer-events:none; transform:translate3d(-120%,0,0) !important; transition:transform 180ms ease !important; border-radius:0 12px 12px 0; will-change:transform; }
  body #ps-tools-drawer.open { visibility:visible; transform:translate3d(0,0,0) !important; pointer-events:auto; }
  .mobile-measure-bar { flex-wrap:wrap; }
  .mobile-measure-total { flex:1 1 auto; }
  .coord-search-panel, .draw-toolbox, .offline-info, .active-trip-quickswitch, .new-trip-panel { overscroll-behavior:contain; }
  body.ps-mobile-ui-blocked :is(.ps-mode-toggle,.ps-explore-badge,.mobile-measure-bar,.draw-toolbox,.coord-search-panel,.mobile-coord-sign-picker,.new-trip-panel,.active-trip-quickswitch,.offline-info,#ps-tools-launcher,#ps-tools-drawer,.ps-mobile-dock-actions,.offline-banner,.offline-progress,.ps-new-data-pill,.status,.global-toast,.ps-explore-notice,.locate-message,.mark-message) { visibility:hidden !important; pointer-events:none !important; }
}

@media (pointer:coarse) and (min-width:621px) and (max-height:500px) {
  /* The map spans the screen in landscape; controls must clear the notch. */
  .leaflet-left { left:calc(env(safe-area-inset-left,0px) + 58px) !important; }
  #ps-tools-drawer { left:env(safe-area-inset-left,0px) !important; }
  body.ps-mobile-ui-blocked :is(.mobile-measure-bar,.draw-toolbox,.coord-search-panel,.offline-info,.active-trip-quickswitch,.new-trip-panel,.offline-banner,.offline-progress,.ps-new-data-pill,.status,.global-toast,.ps-explore-notice,.locate-message,.mark-message) { visibility:hidden !important; pointer-events:none !important; }
}
