/* One mobile navigation pattern across the public, account and admin surfaces. */
.mobile-navigation {
  min-width: 0;
}
.mobile-navigation > .mobile-menu-toggle,
.mobile-menu-backdrop,
.mobile-menu-heading,
.mobile-menu-actions {
  display: none;
}
.site-header {
  grid-template-columns: auto minmax(0, 1fr);
}
.public-navigation > .mobile-menu-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.mobile-menu-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (min-width: 1051px) {
  .mobile-navigation::details-content {
    content-visibility: visible;
  }
}
@media (max-width: 1050px) {
  body {
    --mobile-header-height: 76px;
    --mobile-menu-gutter: 22px;
  }
  .account-surface {
    --account-header-height: var(--mobile-header-height);
    --mobile-menu-gutter: var(--account-gutter);
  }
  .site-header,
  .top {
    position: sticky;
    top: 0;
    z-index: 80;
  }
  .site-header {
    min-height: var(--mobile-header-height);
    height: var(--mobile-header-height);
    grid-template-columns: minmax(0, 1fr) 44px;
    padding: 0 var(--mobile-menu-gutter);
    gap: 16px;
  }
  .site-header .wordmark img,
  .account-top .brand img {
    width: auto;
    height: calc(var(--mobile-header-height) - 4px);
  }
  .authenticated .top > .account-actions {
    display: none;
  }
  .authenticated .account-layout,
  .authenticated .admin-layout {
    display: block;
  }
  .account-sidebar,
  .sidebar {
    padding: 0;
    border: 0;
    min-height: 0;
    background: transparent;
  }
  .mobile-navigation > .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    z-index: 123;
    top: calc((var(--mobile-header-height) - 44px) / 2);
    right: var(--mobile-menu-gutter);
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 10px;
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border-hover);
    border-radius: 8px;
    cursor: pointer;
    list-style: none;
  }
  .mobile-menu-toggle::-webkit-details-marker {
    display: none;
  }
  .mobile-menu-toggle:hover,
  .mobile-navigation[open] > .mobile-menu-toggle {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--bg-secondary);
  }
  .mobile-menu-icon {
    position: relative;
    display: block;
    width: 20px;
    height: 16px;
  }
  .mobile-menu-icon > span {
    position: absolute;
    left: 0;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
  }
  .mobile-menu-icon > span:nth-child(1) {
    top: 0;
  }
  .mobile-menu-icon > span:nth-child(2) {
    top: 7px;
  }
  .mobile-menu-icon > span:nth-child(3) {
    top: 14px;
  }
  .mobile-navigation[open] .mobile-menu-icon > span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .mobile-navigation[open] .mobile-menu-icon > span:nth-child(2) {
    opacity: 0;
  }
  .mobile-navigation[open] .mobile-menu-icon > span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  .mobile-navigation[open] .mobile-menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 120;
    background: #0009;
    cursor: pointer;
  }
  .mobile-navigation > .mobile-menu-panel {
    position: fixed;
    z-index: 122;
    top: var(--mobile-header-height);
    right: 0;
    bottom: 0;
    width: min(360px, 100%);
    padding: 24px 20px max(24px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: start;
    gap: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-hover);
    border-left: 1px solid var(--border);
    box-shadow: -12px 18px 40px #0005;
  }
  .mobile-menu-heading {
    display: block;
    margin: 0 0 22px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
  }
  .mobile-menu-panel .account-person {
    display: flex;
    flex-shrink: 0;
    margin-bottom: 18px;
    padding: 0 10px 18px;
  }
  .mobile-menu-panel .account-help,
  .mobile-menu-panel .sidebar-note {
    display: none;
  }
  .mobile-menu-panel .admin-nav,
  .mobile-menu-panel .account-nav,
  .site-header .mobile-menu-panel nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    margin: 0;
    padding: 0;
    border: 0;
    text-align: left;
  }
  .mobile-menu-panel .nav-group {
    margin: 0;
  }
  .mobile-menu-panel .nav-label {
    margin-bottom: 6px;
  }
  .mobile-menu-panel .admin-nav a,
  .mobile-menu-panel .account-nav a,
  .site-header .mobile-menu-panel .header-link {
    justify-content: flex-start;
    min-height: 44px;
    padding: 11px 12px;
    font-size: 13px;
    gap: 12px;
  }
  .site-header .mobile-menu-panel nav {
    gap: 6px;
  }
  .site-header .mobile-menu-panel .header-link .ui-icon {
    width: 19px;
    height: 19px;
  }
  .site-header .mobile-menu-panel .login-link {
    justify-content: center;
    margin-top: 24px;
  }
  .mobile-menu-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding-top: 20px;
    margin-top: 24px;
    border-top: 1px solid var(--border);
  }
  .mobile-menu-actions form {
    margin: 0;
  }
  .mobile-menu-actions button {
    width: 100%;
  }
  .navigation-is-open,
  .navigation-is-open body {
    overflow: hidden;
  }
  @media (prefers-reduced-motion: no-preference) {
    .mobile-menu-icon > span {
      transition:
        transform 160ms ease,
        opacity 160ms ease;
    }
    .mobile-navigation[open] > .mobile-menu-panel {
      animation: mobile-menu-enter 160ms ease-out;
    }
  }
  @keyframes mobile-menu-enter {
    from {
      opacity: 0;
      transform: translateX(16px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }
}
@media (max-width: 700px) {
  body {
    --mobile-header-height: 72px;
    --mobile-menu-gutter: 16px;
  }
}
