.header-menu-button {
  display: none;
}

@media (max-width: 1024px) {
  #app-module-nav {
    display: none;
  }

  .header-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 40px;
    min-width: 40px;
    cursor: pointer;
  }

  .header-menu-panel[id],
  #app-module-nav-mobile {
    display: none;
    position: absolute;
    inset: 100% 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: .25rem;
    max-height: 70vh;
    overflow: auto;
    overscroll-behavior: contain;
    padding: .5rem 1rem;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 0;
    box-shadow: 0 10px 24px rgb(15 23 42 / 12%);
  }

  .header-menu-panel[id].active,
  #app-module-nav-mobile.active {
    display: flex;
  }

  #categoryNav > a,
  #saas-header-navigation > button {
    min-height: 44px;
    height: auto;
    padding: .625rem .75rem;
    text-align: left;
    white-space: normal;
  }

  #categoryNav {
    inset: calc(100% + 6px) auto auto 12px;
    width: min(320px, calc(100% - 24px));
    height: auto;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
  }

  #categoryNav > a {
    border-radius: 8px;
  }

  #categoryNav > a:hover {
    background: #f1f5f9;
  }

  #categoryNav > div {
    display: none;
  }

  .site-header .navbar-menu.active {
    max-height: 70vh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  #app-module-nav-mobile {
    inset: calc(100% + 8px) 12px auto auto;
    width: min(340px, calc(100% - 24px));
    height: auto;
    max-height: calc(100dvh - var(--app-header-height, 72px) - 20px);
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgb(15 23 42 / 16%);
  }

  #app-module-nav-mobile > button {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #334155;
    font-size: .875rem;
    text-align: left;
    white-space: normal;
    cursor: pointer;
  }

  #app-module-nav-mobile > button:hover {
    background: #f1f5f9;
  }

  #app-module-nav-mobile > button[aria-current="page"] {
    color: #0f172a;
    background: #eff6ff;
    box-shadow: inset 3px 0 var(--module-nav-accent, #009bb6);
    font-weight: 600;
  }

  html.dark #app-module-nav-mobile {
    background: #0f172a;
    border-color: #334155;
  }

  html.dark #app-module-nav-mobile > button {
    color: #cbd5e1;
  }

  html.dark #app-module-nav-mobile > button:hover {
    background: #1e293b;
  }

  html.dark #app-module-nav-mobile > button[aria-current="page"] {
    color: #f8fafc;
    background: #1e293b;
  }
}

@media (max-width: 420px) {
  .site-header .navbar-container,
  .site-header .navbar-actions {
    gap: 8px;
  }

  .site-header .navbar-actions .btn-nav-primary {
    padding-inline: 12px !important;
  }
}
