/* Planyx Admin Centre mobile shell fixes */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

@media (max-width: 767px) {
  body.admin-tools-open {
    overflow: hidden !important;
    overscroll-behavior: none;
    touch-action: pan-x;
  }

  .admin-portal {
    min-width: 0 !important;
    width: 100% !important;
    overflow-x: clip !important;
  }

  .admin-portal > header > div:first-child {
    gap: 0.45rem !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .admin-portal > header > div:first-child > a {
    min-width: 0 !important;
    max-width: 128px !important;
  }

  .admin-portal > header > div:first-child > a img {
    height: 2rem !important;
    max-width: 116px !important;
  }

  .admin-portal > header details > summary {
    min-height: 2.5rem !important;
    min-width: 2.75rem !important;
    justify-content: center !important;
    gap: 0.25rem !important;
    padding: 0 0.55rem !important;
  }

  .admin-portal > header details > summary span,
  .admin-portal > header details > summary svg:last-child {
    display: none !important;
  }

  .admin-portal > header details[open] > summary {
    border-color: rgb(37 99 235 / 0.45) !important;
    background: rgb(219 234 254) !important;
    color: rgb(29 78 216) !important;
  }

  .dark .admin-portal > header details[open] > summary {
    background: rgb(37 99 235 / 0.2) !important;
    color: rgb(191 219 254) !important;
  }

  /* Convert the desktop dropdown into a proper full-screen mobile drawer. */
  .admin-portal > header details > div {
    position: fixed !important;
    inset: 4rem 0 0 0 !important;
    z-index: 90 !important;
    display: flex !important;
    width: 100vw !important;
    max-width: none !important;
    height: calc(100dvh - 4rem) !important;
    max-height: none !important;
    flex-direction: column !important;
    overflow: hidden !important;
    border: 0 !important;
    border-top: 1px solid rgb(226 232 240) !important;
    border-radius: 0 !important;
    background: rgb(255 255 255) !important;
    padding: 0.85rem !important;
    box-shadow: none !important;
  }

  .dark .admin-portal > header details > div {
    border-top-color: rgb(51 65 85) !important;
    background: rgb(2 6 23) !important;
  }

  .admin-portal > header details > div > div:first-child {
    flex: 0 0 auto !important;
    margin-bottom: 0.5rem !important;
    padding: 0.15rem 0.15rem 0.75rem !important;
  }

  .admin-portal > header details > div > div:last-child {
    display: grid !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0.75rem !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: 0.15rem 0.1rem calc(1.5rem + env(safe-area-inset-bottom)) !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .admin-portal > header details > div section {
    min-width: 0 !important;
    border: 1px solid rgb(226 232 240) !important;
    border-radius: 0.9rem !important;
    padding: 0.65rem !important;
  }

  .dark .admin-portal > header details > div section {
    border-color: rgb(51 65 85) !important;
    background: rgb(15 23 42 / 0.65) !important;
  }

  .admin-portal > header details > div section a {
    min-height: 2.75rem !important;
    padding: 0.7rem 0.75rem !important;
    font-size: 0.875rem !important;
  }

  .admin-mobile-tools-close {
    display: inline-flex !important;
    min-height: 2.5rem;
    min-width: 2.5rem;
    align-items: center;
    justify-content: center;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.7rem;
    background: rgb(248 250 252);
    color: rgb(51 65 85);
    font-size: 1.25rem;
    line-height: 1;
  }

  .dark .admin-mobile-tools-close {
    border-color: rgb(51 65 85);
    background: rgb(15 23 42);
    color: rgb(226 232 240);
  }

  .admin-portal > header > div:first-child > button,
  .admin-portal > header > div:first-child > div:last-child button {
    min-height: 2.5rem !important;
    min-width: 2.5rem !important;
  }

  .admin-portal > header > div:nth-child(2) > div {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .admin-portal > main {
    min-width: 0 !important;
    max-width: 100vw !important;
    overflow-x: clip !important;
    padding: 0.75rem !important;
  }

  .admin-portal > main > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* Replace the desktop sitemap footer with a compact mobile footer. */
  .admin-portal > footer > div {
    padding: 1.25rem 0.9rem calc(1.25rem + env(safe-area-inset-bottom)) !important;
  }

  .admin-portal > footer > div > div:first-child {
    display: block !important;
  }

  .admin-portal > footer > div > div:first-child > div:nth-child(2) {
    display: none !important;
  }

  .admin-portal > footer img {
    height: 1.8rem !important;
    max-width: 125px !important;
  }

  .admin-portal > footer > div > div:first-child > div:first-child > p:first-of-type {
    margin-top: 0.65rem !important;
    max-width: 22rem !important;
    font-size: 0.75rem !important;
    line-height: 1.5 !important;
  }

  .admin-portal > footer > div > div:first-child > div:first-child > p:nth-of-type(2) {
    display: none !important;
  }

  .admin-portal > footer > div > div:last-child {
    margin-top: 1rem !important;
    gap: 0.2rem !important;
    padding-top: 0.9rem !important;
    font-size: 0.68rem !important;
  }
}

@media (max-width: 380px) {
  .admin-portal > header > div:first-child {
    gap: 0.3rem !important;
    padding-left: 0.55rem !important;
    padding-right: 0.55rem !important;
  }

  .admin-portal > header > div:first-child > a {
    max-width: 108px !important;
  }

  .admin-portal > header > div:first-child > a img {
    max-width: 100px !important;
  }

  .admin-portal > main {
    padding: 0.55rem !important;
  }
}
