
/* surveyhub-vip-mobile-layout-v4 */

@media screen and (max-width: 760px) {

  /* Prevent package content from widening the page. */
  html:has(.sh-vip-page),
  body:has(.sh-vip-page) {
    max-width: 100%;
    overflow-x: clip;
  }

  body:has(.sh-vip-page) {
    width: 100%;
    margin: 0;
  }

  /* Restore the mobile application container. */
  body:has(.sh-vip-page) .main-wrap {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    transform: none !important;
  }

  body:has(.sh-vip-page) .main-wrap > main {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 16px 12px 28px !important;
    box-sizing: border-box;
  }

  /* VIP page must fit the available screen width. */
  body:has(.sh-vip-page) .sh-vip-page {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
  }

  body:has(.sh-vip-page) .sh-vip-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 14px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body:has(.sh-vip-page) .sh-vip-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
  }

  /* Keep values and controls inside their cards. */
  body:has(.sh-vip-page) .sh-vip-metrics {
    grid-template-columns:
      repeat(2, minmax(0, 1fr)) !important;
    min-width: 0;
  }

  body:has(.sh-vip-page) .sh-vip-metric,
  body:has(.sh-vip-page) .sh-vip-card-price,
  body:has(.sh-vip-page) .sh-vip-card-top {
    min-width: 0;
    max-width: 100%;
  }

  body:has(.sh-vip-page) .sh-vip-card
  :is(strong, span, p) {
    overflow-wrap: anywhere;
  }

  body:has(.sh-vip-page) .sh-vip-card button {
    max-width: 100%;
  }

  /* History table scrolls without widening the page. */
  body:has(.sh-vip-page) .sh-vip-history {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  body:has(.sh-vip-page) .sh-vip-history-scroll {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  body:has(.sh-vip-page)
  .sh-vip-history-scroll table {
    min-width: 620px;
  }

  /* Restore header width and alignment. */
  body:has(.sh-vip-page) .main-wrap > .topbar {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  /* Website footer follows the package content. */
  body:has(.sh-vip-page) .main-wrap > footer {
    display: block !important;
    position: relative !important;
    visibility: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    box-sizing: border-box;
    padding-bottom:
      calc(105px + env(safe-area-inset-bottom, 0px))
      !important;
  }

  /* Fixed five-button mobile navigation. */
  body:has(.sh-vip-page) > .mobile-nav,
  body:has(.sh-vip-page) .sh-mobile-nav {
    display: flex !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
    visibility: visible !important;
    z-index: 100 !important;
    box-sizing: border-box;
  }
}

@media screen and (max-width: 375px) {
  body:has(.sh-vip-page) .sh-vip-metrics {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
