/*
 * Compact mobile navigation should never leave a half-visible label at the
 * edge of the page. Account and support destinations are few enough to show
 * in a small grid; the denser location-editor controls retain horizontal
 * scrolling with a persistent branded scrollbar and contained momentum.
 */

@media (max-width: 47.99rem) {
  .editor-scroll-hint,
  .compact-image-scroll-hint {
    display: none;
    align-items: center;
    justify-content: flex-end;
    gap: 0.3rem;
    color: #6a736e;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .editor-scroll-hint {
    display: flex;
    padding: 0.18rem 0.65rem 0.3rem;
  }

  .editor-scroll-hint b,
  .compact-image-scroll-hint b {
    color: var(--editor-orange);
    font-size: 0.8rem;
  }

  .compact-image-manager:has(.compact-image-card:nth-child(2)) .compact-image-scroll-hint {
    display: flex;
    margin-top: -0.2rem;
  }

  .account-page .settings-layout,
  .profile-edit-page .settings-layout,
  .site-edit-page .location-editor,
  .admin-editor-page .admin-editor,
  .admin-editor-page .admin-editor-form {
    min-width: 0;
  }

  .account-page .settings-nav,
  .profile-edit-page .settings-nav {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
    overflow: visible;
    box-shadow: var(--shadow-sm);
  }

  .account-page .settings-nav a,
  .profile-edit-page .settings-nav a {
    width: 100%;
    min-width: 0;
    justify-content: center;
    padding: 0.55rem 0.35rem;
    text-align: center;
    white-space: normal;
    line-height: 1.2;
  }

  .community-page .community-tabs {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .community-page .community-tabs a {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-inline: 0.55rem;
    text-align: center;
    white-space: normal;
  }

  .site-edit-page .location-editor-nav {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
    box-shadow: var(--shadow-sm);
  }

  .site-edit-page .location-editor-nav nav,
  .admin-editor-page .admin-editor-jumpbar,
  .site-edit-page .compact-image-strip,
  .admin-editor-page .compact-image-strip,
  .site-edit-page .location-save-bar__actions,
  .admin-editor-page .location-save-bar__actions {
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline proximity;
    scrollbar-width: auto;
    scrollbar-color: var(--editor-orange) #dce1dd;
    -webkit-overflow-scrolling: touch;
  }

  .site-edit-page .location-editor-nav nav {
    width: 100%;
    min-width: 100%;
    padding-bottom: 0.42rem;
  }

  .site-edit-page .location-editor-nav__item,
  .admin-editor-page .admin-editor-jumpbar button,
  .site-edit-page .compact-image-card,
  .admin-editor-page .compact-image-card,
  .site-edit-page .location-save-bar__actions .button,
  .admin-editor-page .location-save-bar__actions .button {
    scroll-snap-align: start;
  }

  .admin-editor-page .admin-editor-jumpbar {
    padding-bottom: 0.62rem;
  }

  .admin-editor-page .admin-editor-jumpbar + .editor-scroll-hint {
    margin-top: -0.65rem;
    padding-right: 0.35rem;
  }

  .site-edit-page .location-editor-nav nav::-webkit-scrollbar,
  .admin-editor-page .admin-editor-jumpbar::-webkit-scrollbar,
  .site-edit-page .compact-image-strip::-webkit-scrollbar,
  .admin-editor-page .compact-image-strip::-webkit-scrollbar,
  .site-edit-page .location-save-bar__actions::-webkit-scrollbar,
  .admin-editor-page .location-save-bar__actions::-webkit-scrollbar {
    height: 0.42rem;
  }

  .site-edit-page .location-editor-nav nav::-webkit-scrollbar-track,
  .admin-editor-page .admin-editor-jumpbar::-webkit-scrollbar-track,
  .site-edit-page .compact-image-strip::-webkit-scrollbar-track,
  .admin-editor-page .compact-image-strip::-webkit-scrollbar-track,
  .site-edit-page .location-save-bar__actions::-webkit-scrollbar-track,
  .admin-editor-page .location-save-bar__actions::-webkit-scrollbar-track {
    background: #dce1dd;
    border-radius: 999px;
  }

  .site-edit-page .location-editor-nav nav::-webkit-scrollbar-thumb,
  .admin-editor-page .admin-editor-jumpbar::-webkit-scrollbar-thumb,
  .site-edit-page .compact-image-strip::-webkit-scrollbar-thumb,
  .admin-editor-page .compact-image-strip::-webkit-scrollbar-thumb,
  .site-edit-page .location-save-bar__actions::-webkit-scrollbar-thumb,
  .admin-editor-page .location-save-bar__actions::-webkit-scrollbar-thumb {
    min-width: 2.75rem;
    background: var(--editor-orange);
    border: 1px solid #fff;
    border-radius: 999px;
  }
}

@media (max-width: 22rem) {
  .account-page .settings-nav,
  .profile-edit-page .settings-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
