/*
 * PokeTeamOn M8.2 — Builder Global Shell Restoration v2
 *
 * Mobile-only presentation correction.
 * The single-owner builder remains the owner of builder content/state.
 * This file restores the site-wide header/footer shell that belongs to
 * layouts/app.blade.php and must remain visible on /builder.
 */
@media (max-width: 820px) {
  html.ptm8so-mobile-page body > header.site-header,
  html.ptm8so-mobile-page .site-header {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 80 !important;
  }

  html.ptm8so-mobile-page body > footer.site-footer,
  html.ptm8so-mobile-page .site-footer {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    /*
     * Keep final footer links clear of the fixed single-owner bottom action bar.
     */
    padding-bottom: calc(104px + env(safe-area-inset-bottom)) !important;
  }
}

/*
 * M8.2 — short-tap selection + dynamic footer-spacing correction.
 *
 * No ad space is reserved by default. A future ad integration may set
 * --ptm8-ad-reserve through the global-shell JS ad-request event.
 */
@media (max-width: 820px) {
  html.ptm8so-mobile-page {
    --ptm8-ad-reserve: 0px;
  }

  html.ptm8so-mobile-page .ptm8so-app {
    padding-bottom: calc(18px + var(--ptm8-ad-reserve, 0px)) !important;
  }

  /*
   * Applied only during the first 320ms of a non-interactive touch.
   * The class is removed before normal long-press selection time.
   */
  html.ptm8so-mobile-page.ptm8-quicktap-no-select body {
    -webkit-user-select: none !important;
    user-select: none !important;
  }
}

/*
 * M8.2 text-selection/footer-spacing v2
 *
 * Release the old mobile-root viewport floor now that the global footer
 * is restored. Natural content height owns the tools -> footer distance.
 * Ad reserve remains 0 unless the dormant ad-request hook is explicitly used.
 */
@media (max-width: 820px) {
  html.ptm8so-mobile-page [data-m8-mobile-single-owner-root] {
    min-height: 0 !important;
  }

  html.ptm8so-mobile-page .ptm8so-tools {
    margin-bottom: 0 !important;
  }
}

/*
 * M8.2 v2.1 — touch short-tap guard across viewport modes.
 * This is intentionally outside the mobile media query so Android Chrome
 * "Desktop site" touch input receives the same short-tap selection guard.
 * It does not change desktop layout, spacing, controls, or workspace owner.
 */
html.ptm8-quicktap-no-select body {
  -webkit-user-select: none !important;
  user-select: none !important;
}
