/*
 TEMVIO Brand Only 3 — Mobile Scroll/Touch Fix
 Loaded LAST. Purposefully limited to scrolling/touch behavior.
*/

/* Root document must remain vertically scrollable in Android WebView. */
html,
body {
  height: auto !important;
  min-height: 100% !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-y: auto !important;
  touch-action: pan-y pinch-zoom !important;
  -webkit-overflow-scrolling: touch;
}

/* Never let the app shell become a viewport-locked scroll trap. */
#appShell,
.app-layout,
.main,
#view {
  height: auto !important;
  max-height: none !important;
  overflow-y: visible !important;
  overscroll-behavior-y: auto !important;
  touch-action: pan-y pinch-zoom !important;
}

/* Native/Capacitor mode: keep vertical page gestures enabled. */
html.native-app,
html.native-app body,
html.native-app #appShell,
html.native-app .app-layout,
html.native-app .main,
html.native-app #view {
  height: auto !important;
  max-height: none !important;
  overflow-y: visible !important;
  overscroll-behavior-y: auto !important;
  touch-action: pan-y pinch-zoom !important;
}

/* Body/root is the actual scrolling surface. */
html.native-app body {
  overflow-y: auto !important;
  min-height: 100dvh !important;
}

/* Existing hidden modals must never intercept swipe gestures. */
.modal-wrap.hidden {
  display: none !important;
  pointer-events: none !important;
}

/* Open modals keep their own vertical scroll on small screens. */
.modal-wrap:not(.hidden) {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-y: contain !important;
  touch-action: pan-y pinch-zoom !important;
  -webkit-overflow-scrolling: touch;
}

.modal {
  max-height: 90dvh !important;
  overflow-y: auto !important;
  touch-action: pan-y pinch-zoom !important;
  -webkit-overflow-scrolling: touch;
}

/* Horizontal scrollers can still scroll horizontally without stealing
   the vertical page swipe when the user moves mostly vertically. */
.filter-row,
.team-tabs,
.channel-tabs,
.mention-picker {
  touch-action: pan-x pan-y !important;
  -webkit-overflow-scrolling: touch;
}

/* Buttons and fixed controls should respond to taps, not create gesture locks. */
.bottom-nav,
.bottom-nav button,
.fab,
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}

/* Text inputs need native selection/cursor behavior. */
input,
textarea,
select {
  -webkit-user-select: text;
  user-select: text;
}

/* Mobile-only extra safeguard against old overscroll rules. */
@media (max-width: 760px) {
  html,
  body {
    width: 100% !important;
    overflow-y: auto !important;
    overscroll-behavior-y: auto !important;
    touch-action: pan-y pinch-zoom !important;
  }

  .main,
  #view {
    min-height: 0 !important;
    overflow-y: visible !important;
  }
}
