/* Android/mobile scroll safety.
   Samsung Internet and iPhone keep native document scrolling. Android Chrome
   receives a manual high-frequency Pointer Events fallback, but the real
   vertical scroll surface is the document, not .main-content. */

/* Update checks continue in the background, but they must never cover the
   hotel dashboard. Temporary network/Supabase/update-check failures are retried
   silently by the existing watchdog and service-worker logic. */
#sunwine-update-notice,
#sunwine-update-warning {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (max-width: 900px) {
  html,
  body {
    min-height: 100% !important;
    touch-action: pan-x pan-y !important;
  }

  body:has(.mobile-panel-layer),
  body:has(.mobile-panel-layer.closing),
  body:has(.modal-backdrop) {
    overscroll-behavior-y: auto !important;
  }

  .app-shell,
  .workspace-shell,
  .main-content,
  .page-stack,
  .today-page,
  .calendar-page,
  .sw-ops-root,
  .restaurant-admin-root {
    touch-action: pan-x pan-y !important;
  }

  html.sunwine-android-scroll-root,
  html.sunwine-android-scroll-root body {
    width: 100% !important;
    height: auto !important;
    min-height: 100% !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    overscroll-behavior-y: auto !important;
  }

  html.sunwine-android-scroll-root .app-shell {
    width: 100% !important;
    height: auto !important;
    min-height: 100dvh !important;
    max-height: none !important;
    overflow: visible !important;
  }

  html.sunwine-android-scroll-root .main-content {
    width: 100% !important;
    height: auto !important;
    min-height: 100dvh !important;
    max-height: none !important;
    overflow: visible !important;
    overscroll-behavior-y: auto !important;
    scroll-behavior: auto !important;
    padding-bottom: calc(116px + env(safe-area-inset-bottom)) !important;
  }

  .calendar-shell {
    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-x pan-y !important;
  }

  /* Chrome Android only: our JS drives scrolling from pointerrawupdate and
     requestAnimationFrame. Force auto scrolling to avoid CSS smooth-scroll
     interpolation fighting the frame loop. */
  html.sunwine-android-chrome-manual-scroll,
  html.sunwine-android-chrome-manual-scroll body {
    scroll-behavior: auto !important;
  }

  html.sunwine-android-chrome-manual-scroll .main-content,
  html.sunwine-android-chrome-manual-scroll .calendar-shell {
    touch-action: none !important;
  }

  .mobile-panel-backdrop,
  .global-search-backdrop,
  .modal-backdrop {
    touch-action: none !important;
  }

  .mobile-nav-panel,
  .global-search-panel,
  .modal {
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .mobile-panel-layer.closing {
    pointer-events: none !important;
  }
}
