/* PWA/mobile layout guardrails. Kept separate so the website logic stays untouched. */
@media (max-width: 991px), (max-device-width: 991px), (hover: none) and (pointer: coarse), (display-mode: standalone) {
  html,
  body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  body {
    min-width: 0 !important;
  }

  .dashboard {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: auto !important;
  }

  .main-content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 18px 14px 88px !important;
  }

  .mobile-header {
    display: flex !important;
    width: 100% !important;
  }

  .sidebar {
    position: fixed !important;
    left: -88vw !important;
    top: 0 !important;
    width: 86vw !important;
    min-width: 0 !important;
    max-width: 340px !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    transition: left 0.35s ease !important;
  }

  .sidebar.active {
    left: 0 !important;
  }

  .brand .logo {
    max-width: 136px !important;
  }

  .nav {
    gap: 8px !important;
  }

  .nav a {
    padding: 12px 13px !important;
    font-size: 14px !important;
  }

  #overlay.active {
    display: block !important;
  }

  .header h1 {
    font-size: 28px !important;
    line-height: 1.2 !important;
  }

  .p-card,
  .w-card,
  .wallet-card,
  .checkout-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 20px 16px !important;
    border-radius: 16px !important;
  }

  .profile-card {
    padding-top: 22px !important;
  }

  .profile-referral,
  .profile-binary-shortcut {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 12px !important;
  }

  .profile-referral-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .profile-referral input[type="text"],
  input[type="text"],
  input[type="email"],
  input[type="password"],
  select,
  textarea {
    width: 100% !important;
    max-width: 100% !important;
  }

  .comm-grid,
  .dashboard-grid,
  .role-grid,
  .categories {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  .btn,
  .btn-primary,
  .btn-gold,
  .upgrade-btn,
  .copy-btn {
    width: 100% !important;
    text-align: center !important;
  }

  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
