/* Application menu in the browser (redesign 2026-11). The desktop app uses
   the native menu bar instead (body.sw-native-menu hides this one). */

.sw-app-menu {
  display: none;
}

@media (min-width: 761px) {
  html body .topbar .brand {
    display: grid !important;
    grid-template-columns: auto auto;
    column-gap: 0.55rem;
    align-items: center;
    justify-items: center;
  }

  html body .topbar .brand > :not(.sw-app-menu) {
    grid-column: 2;
  }

  html body .topbar .sw-app-menu {
    position: relative;
    display: block;
    grid-column: 1;
    grid-row: 1 / span 3;
  }

  html body.sw-native-menu .topbar .sw-app-menu {
    display: none;
  }

  html body.sw-native-menu .topbar .brand {
    display: flex !important;
  }

  html body .sw-app-menu-button {
    display: inline-grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    border: 1px solid rgba(255, 248, 232, 0.14);
    border-radius: 0.55rem;
    background: rgba(255, 248, 232, 0.04);
    color: rgba(255, 248, 232, 0.82);
    cursor: pointer;
  }

  html body .sw-app-menu-button:hover,
  html body .sw-app-menu-button[aria-expanded="true"] {
    border-color: rgba(241, 201, 121, 0.55);
    background: rgba(241, 201, 121, 0.12);
    color: #f6dca3;
  }

  html body .sw-app-menu-button svg {
    width: 1.1rem;
    height: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
  }

  html body .sw-app-menu-panel {
    position: absolute;
    z-index: 400;
    top: calc(100% + 0.5rem);
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(11.5rem, 1fr));
    gap: 0.4rem 0.9rem;
    width: min(54rem, calc(100vw - 2rem));
    max-height: calc(100vh - 6rem);
    overflow: auto;
    padding: 0.8rem;
    border: 1px solid rgba(241, 201, 121, 0.24);
    border-radius: 0.8rem;
    background: rgba(18, 17, 14, 0.98);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
    text-align: left;
  }

  html body .sw-app-menu-panel[hidden] {
    display: none;
  }

  html body .sw-app-menu-panel section {
    display: grid;
    align-content: start;
    gap: 0.05rem;
  }

  html body .sw-app-menu-panel h3 {
    margin: 0.2rem 0 0.3rem;
    padding: 0 0.5rem;
    color: var(--gold-2, #f1c979);
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  html body .sw-app-menu-panel button {
    display: block;
    width: 100%;
    padding: 0.38rem 0.5rem;
    border: 0;
    border-radius: 0.4rem;
    background: transparent;
    color: #f2ecdf;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
  }

  html body .sw-app-menu-panel button:hover:not(:disabled) {
    background: rgba(241, 201, 121, 0.14);
    color: #fff3d6;
  }

  html body .sw-app-menu-panel button:disabled {
    color: rgba(255, 248, 232, 0.32);
    cursor: default;
  }

  html body .sw-app-menu-panel hr {
    margin: 0.25rem 0.5rem;
    border: 0;
    border-top: 1px solid rgba(255, 248, 232, 0.08);
  }

  html body .sw-app-menu-panel button {
    display: grid;
    grid-template-columns: 0.9rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.3rem;
    padding-left: 0.3rem;
  }

  html body .sw-app-menu-panel .sw-menu-check {
    color: var(--gold-2, #f1c979);
    font-size: 0.72rem;
    text-align: center;
  }

  html body .sw-app-menu-panel .sw-menu-key {
    color: rgba(255, 248, 232, 0.45);
    font: inherit;
    font-size: 0.72rem;
    font-weight: 500;
  }
}
