/* F079: a nonmodal disclosure. It overlays content without moving it or
   locking document scrolling; keyboard users may tab onward to the page. */
.top-nav .top-nav-active-org {
  display: none;
}

@media (max-width: 1023px) {
  .top-nav {
    position: relative;
  }

  .top-nav .top-nav-inner {
    padding-inline: 0.75rem;
    column-gap: 0.25rem;
  }

  .top-nav .top-nav-inner > :first-child {
    min-width: 0;
  }

  .top-nav .top-nav-brand {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .top-nav .top-nav-end {
    gap: 0.25rem;
  }

  .top-nav .top-nav-active-org {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 44px;
    padding: 0.5rem 1.25rem;
    border-top: 1px solid var(--color-border-subtle);
    background: var(--color-surface);
    color: var(--color-text);
    text-align: left;
    cursor: pointer;
  }

  .top-nav .top-nav-active-org-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .top-nav .top-nav-menu-button {
    width: 44px;
    height: 44px;
  }

  .top-nav .top-nav-mobile-panel {
    position: absolute;
    z-index: 60;
    top: 100%;
    left: 0;
    right: 0;
    max-height: min(65vh, calc(100vh - 7rem), 32rem);
    max-height: min(65dvh, calc(100dvh - 7rem), 32rem);
    overflow-y: auto;
    overscroll-behavior-y: contain;
    gap: 0.25rem;
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
  }

  .top-nav .top-nav-mobile-panel .nav-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-height: 44px;
    padding: 0.625rem 0;
  }

  .top-nav .top-nav-org-menu {
    flex-shrink: 0;
    flex-wrap: wrap;
    border-top: 0;
    border-bottom: 1px solid var(--color-border-subtle);
    padding: 0 0 0.5rem;
  }

  .top-nav .top-nav-org-menu .top-nav-org-select {
    min-height: 44px;
    width: 100%;
    flex-basis: 100%;
    font-size: 1rem;
  }

  .top-nav :is(.top-nav-active-org, .top-nav-menu-button, .nav-link, .top-nav-org-select):focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
  }
}
