/* Mobile UI v9 — make the legacy mobile sheet the single More control. */
@media (max-width: 760px) {
  /* Hide the React <details> control so there is only one More hit target. */
  .topbar > nav > details.nav-more {
    display: none !important;
  }

  /* Bottom nav selected state lives on the outer destination only. Older
     mobile layers styled the inner span too, which can render as a dark
     rounded block inside the blue selected tile on iOS Safari. */
  .topbar > nav > a,
  .topbar > nav > a:active,
  .topbar > nav > a:focus,
  .topbar > nav > a:focus-visible {
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
  }

  .topbar > nav > a > span,
  .topbar > nav > a.active > span,
  .topbar > nav > a[aria-current="page"] > span,
  .topbar > nav > a:active > span,
  .topbar > nav > a:focus > span,
  .topbar > nav > a:focus-visible > span {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .topbar > nav > a > span::after,
  .topbar > nav > a.active > span::after,
  .topbar > nav > a[aria-current="page"] > span::after {
    content: none !important;
    display: none !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  /* The JS-injected More button owns the fourth slot. */
  .topbar > nav > .mobile-v3-more-button {
    grid-column: 4 !important;
    grid-row: 1 !important;
    display: flex !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    min-width: 0 !important;
    width: auto !important;
    height: 56px !important;
    min-height: 56px !important;
    margin: 0 2px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 11px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #a9bfce !important;
    font: inherit !important;
    position: relative !important;
    z-index: 2601 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .topbar > nav > .mobile-v3-more-button > span {
    width: 100% !important;
    height: 56px !important;
    min-height: 56px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    padding: 5px 3px 4px !important;
    border-radius: 11px !important;
    background: transparent !important;
    color: inherit !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    box-shadow: none !important;
  }

  .topbar > nav > .mobile-v3-more-button > span::before {
    content: '•••' !important;
    display: block !important;
    height: 19px !important;
    margin: 0 !important;
    font-size: 18px !important;
    line-height: 15px !important;
    letter-spacing: 1px !important;
  }

  /* Keep More visually consistent while the sheet is open. */
  .topbar > nav > .mobile-v3-more-button.active,
  .topbar > nav > .mobile-v3-more-button.active > span,
  .topbar > nav > .mobile-v3-more-button:active,
  .topbar > nav > .mobile-v3-more-button:focus,
  .topbar > nav > .mobile-v3-more-button:focus-visible,
  .topbar > nav > .mobile-v3-more-button:active > span,
  .topbar > nav > .mobile-v3-more-button:focus > span,
  .topbar > nav > .mobile-v3-more-button:focus-visible > span {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    color: #a9bfce !important;
    box-shadow: none !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  /* The dark backdrop stops at the top of the bottom navigation instead of
     covering the nav itself. */
  .mobile-v3-more-backdrop {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: 0 !important;
    bottom: calc(62px + env(safe-area-inset-bottom)) !important;
    z-index: 2500 !important;
    display: flex !important;
    align-items: flex-end !important;
    background: rgba(8,24,38,.48) !important;
  }

  .mobile-v3-more-sheet {
    width: 100% !important;
    max-height: 72dvh !important;
    overflow-y: auto !important;
    padding: 10px 12px 14px !important;
    border-radius: 20px 20px 0 0 !important;
    background: #fff !important;
    box-shadow: 0 -14px 45px rgba(13,35,53,.28) !important;
  }

  .mobile-v3-more-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .mobile-v3-more-grid a {
    min-height: 54px !important;
    padding: 9px 11px !important;
    display: flex !important;
    align-items: center !important;
    border: 1px solid #d9e2e8 !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #172b3d !important;
    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 700 !important;
  }
}
