/* ==========================================================================
   DataFlex WebApp — Mobile/Tablet Modal Safety Net
   - Keeps dialogs from being too wide on iPad/tablets
   - Lets tall dialogs scroll
   - Adds a few px of white space below the button row
   - No sticky/fixed footers, no fullscreen hacks
   - Safe for portrait & landscape
   ========================================================================== */

html, body {
  overflow-x: hidden; /* avoid accidental sideways scroll */
}

/* ------------------------------
   Tablet / iPad and below
   ------------------------------ */
@media (max-width: 1024px) {
  /* Fit the modal within the viewport with small side gutters.
     We don't change position or force fullscreen — just prevent overflow. */
  .WebWindow {
    max-width: 95vw !important;   /* ~2.5vw gutter left/right */
    width: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Neutralize DF inline width/min-width that can cause horizontal overflow. */
  .WebWindow .WebWin_main_c,
  .WebWindow .WebContainer,
  .WebWindow .WebCon_Sizer {
    width: auto !important;
    min-width: 0 !important;
    max-width: 95vw !important;
    box-sizing: border-box !important;
  }

  /* Allow the dialog body to scroll if it's tall, and give a little
     breathing room below the footer so buttons aren't trimmed. */
  .WebWindow .WebCon_Content {
    max-height: 70dvh !important;           /* modest cap; keeps buttons reachable */
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px !important;        /* white space below footer */
  }

  /* Tiny extra space under the button row itself (covers both DF footer class names). */
  .WebWindow .WebWin_bottom_1,
  .WebWindow .WebWin_bottom {
    margin-bottom: 8px !important;
  }
}
