@media (max-width: 767px) {
  #propertygy-mobile-navigation {
    width: min(84vw, 340px) !important;
    height: auto !important;
    max-height: calc(100dvh - 64px) !important;
    padding: 12px !important;
    border-radius: 0 0 0 20px;
  }

  #propertygy-mobile-navigation > div:first-child {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  #propertygy-mobile-navigation > div:first-child a {
    min-height: 42px !important;
    padding: 10px 12px !important;
    font-size: 0.92rem !important;
    line-height: 1.15 !important;
  }

  #propertygy-mobile-navigation > div:nth-child(2) {
    margin-top: 10px !important;
    padding-top: 10px !important;
  }

  #propertygy-mobile-navigation [role="group"] {
    width: 100%;
    min-height: 40px !important;
  }

  #propertygy-mobile-navigation [role="group"] button {
    flex: 1 1 0;
    min-height: 40px !important;
    padding: 8px 10px !important;
    font-size: 0.78rem !important;
  }

  #propertygy-mobile-navigation > div:last-child {
    margin-top: 10px !important;
    padding-top: 10px !important;
    gap: 6px !important;
  }

  #propertygy-mobile-navigation > div:last-child a {
    min-height: 42px !important;
    padding: 10px 12px !important;
    font-size: 0.9rem !important;
  }

  section.pgy-content-auto.bg-white {
    padding-top: 32px !important;
    padding-bottom: 32px !important;
  }

  section.pgy-content-auto.bg-white > div {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  section.pgy-content-auto.bg-white h2 {
    font-size: 1.85rem !important;
    line-height: 1.08 !important;
  }

  section.pgy-content-auto.bg-white a[href="/services"] {
    padding: 14px !important;
    border-radius: 16px !important;
  }

  section.pgy-content-auto.bg-white a[href="/services"] > span:first-child {
    width: 38px !important;
    height: 38px !important;
    border-radius: 10px !important;
  }

  section.pgy-content-auto.bg-white a[href="/services"] h3 {
    margin-top: 12px !important;
    font-size: 1rem !important;
    line-height: 1.2 !important;
  }

  section.pgy-content-auto.bg-white a[href="/services"] p {
    margin-top: 6px !important;
    font-size: 0.875rem !important;
    line-height: 1.45 !important;
  }

  section.pgy-content-auto.bg-white > div > div:last-child {
    margin-top: 20px !important;
    gap: 10px !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  /* The homepage market selector must remain a compact component. Historical
     global mobile rules stretched its glass card and hid descendant labels. */
  [data-testid="propertygy-market-selector"] {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 16px !important;
    border-radius: 24px !important;
    background: rgba(2, 6, 23, 0.92) !important;
    color: #fff !important;
  }

  [data-testid="propertygy-market-selector"] * {
    min-height: 0;
  }

  [data-testid="propertygy-market-selector"] p,
  [data-testid="propertygy-market-selector"] h2,
  [data-testid="propertygy-market-selector"] span {
    visibility: visible !important;
    opacity: 1 !important;
  }

  [data-testid="propertygy-market-selector"] [aria-label="Choose PropertyGY market"] > div {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  [data-testid="propertygy-market-selector"] [data-testid^="propertygy-market-"] {
    display: flex !important;
    width: 100% !important;
    min-height: 48px !important;
    margin: 0 !important;
  }

  [data-testid="propertygy-market-selector"] [aria-label="Choose display currency"] {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  [data-testid="propertygy-market-selector"] a {
    display: block !important;
  }

  [data-testid="propertygy-market-selector"] a > span {
    display: flex !important;
    height: auto !important;
    min-height: 64px !important;
  }

  /* Reserve space for the fixed mobile navigation and device safe area so the
     next section and final controls are never obscured. */
  body {
    padding-bottom: calc(92px + env(safe-area-inset-bottom)) !important;
  }

  nav[aria-label="PropertyGY quick navigation"] {
    bottom: max(12px, env(safe-area-inset-bottom)) !important;
  }
}

@media (max-width: 390px) {
  #propertygy-mobile-navigation {
    width: min(88vw, 326px) !important;
  }

  section.pgy-content-auto.bg-white > div > div:last-child {
    grid-template-columns: 1fr !important;
  }
}