:root {
  --mobile-page-padding: 16px;
  --mobile-header-height: 64px;
}

.mobile-header-toggle {
  display: none;
}

.mobile-header-drawer {
  display: contents;
}

.mobile-header-backdrop {
  display: none;
}

.mobile-header-drawer-close {
  display: none;
}

@media (max-width: 1080px) {
  .site-header-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  .site-nav {
    position: static;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
    transform: none;
  }

  .site-header-actions {
    margin-left: 0;
    justify-self: end;
  }
}

@media (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  body {
    min-height: 100vh;
    min-height: 100dvh;
  }

  body.has-mobile-menu {
    overflow: hidden;
  }

  .site-header-inner,
  .page-shell {
    padding-left: max(var(--mobile-page-padding), env(safe-area-inset-left));
    padding-right: max(var(--mobile-page-padding), env(safe-area-inset-right));
  }

  .site-header-inner {
    min-height: var(--mobile-header-height);
    grid-template-columns: minmax(0, 1fr) 44px;
    grid-template-rows: auto;
    gap: 0 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .brand-mark {
    width: max-content;
    min-width: 0;
  }

  .brand-icon {
    width: 32px;
    height: 32px;
  }

  .brand-wordmark {
    font-size: 18px;
  }

  .mobile-header-toggle {
    position: relative;
    z-index: 43;
    grid-column: 2;
    grid-row: 1;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var(--theme-text-strong);
    cursor: pointer;
  }

  .mobile-header-toggle svg {
    width: 23px;
    height: 23px;
    overflow: visible;
  }

  .mobile-header-toggle path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    transform-origin: center;
    transition: opacity 150ms ease, transform 150ms ease;
  }

  .mobile-header-backdrop {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(4, 8, 20, 0.46);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  .mobile-header-drawer {
    position: fixed;
    z-index: 101;
    top: 0;
    right: 0;
    width: min(86vw, 340px);
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: calc(var(--mobile-header-height) + max(18px, env(safe-area-inset-top))) max(18px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) 18px;
    border-left: 1px solid var(--theme-border);
    background: var(--theme-surface-solid);
    box-shadow: -24px 0 56px rgba(12, 20, 46, 0.2);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    clip-path: inset(0 0 0 100%);
    visibility: hidden;
    pointer-events: none;
    transition: clip-path 220ms cubic-bezier(0.22, 1, 0.36, 1), visibility 220ms ease;
  }

  body.has-mobile-menu .mobile-header-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.has-mobile-menu .mobile-header-drawer {
    clip-path: inset(0);
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-header-drawer-close {
    position: absolute;
    top: max(10px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 13px;
    background: transparent;
    box-shadow: none;
    appearance: none;
    color: var(--theme-text-strong);
    cursor: pointer;
  }

  .mobile-header-drawer-close svg {
    width: 22px;
    height: 22px;
  }

  .mobile-header-drawer-close path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
  }

  .mobile-header-drawer .site-nav {
    position: static;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    transform: none;
  }

  .mobile-header-drawer .site-header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin: auto 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--theme-border);
  }

  .site-nav-link {
    min-width: 0;
    min-height: 44px;
    justify-content: flex-start;
    padding: 0 14px;
    border-radius: 11px;
  }

  .site-nav-link.is-active,
  .site-nav-link:hover {
    background: var(--theme-chip);
  }

  .guest-header-shell {
    min-width: 0;
    width: 100%;
    justify-content: space-between;
    border-radius: 14px;
  }

  .account-chip {
    min-width: 0;
  }

  .header-waitlist-button,
  .credit-chip,
  .theme-toggle {
    min-height: 44px;
    flex: 0 0 auto;
  }

  .theme-toggle {
    width: 44px;
    height: 44px;
  }

  .mobile-header-drawer .header-waitlist-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .page-shell {
    padding-top: 12px;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }

  .cookie-warning-banner {
    width: 100%;
    min-height: 50px;
    margin: 0;
    padding: 8px var(--mobile-page-padding);
    align-items: center;
    gap: 9px;
  }

  .cookie-warning-icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .cookie-warning-text {
    font-size: 12px;
    line-height: 1.4;
  }

  .cookie-warning-dismiss {
    min-width: 58px;
    height: 32px;
    padding-inline: 10px;
  }

  .signup-modal-overlay {
    align-items: flex-end;
    padding: 12px;
  }

  .signup-modal {
    width: 100%;
    max-height: calc(100dvh - 24px);
    overflow: auto;
    border-radius: 18px;
  }
}

@media (max-width: 420px) {
  .mobile-header-drawer {
    width: min(90vw, 320px);
  }

  .account-label,
  .credit-label {
    display: none;
  }

  .account-chip {
    padding-right: 7px;
  }

  .guest-id-badge {
    max-width: 92px;
  }

  .credit-chip {
    padding-inline: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-header-toggle path,
  .mobile-header-backdrop,
  .mobile-header-drawer {
    transition: none;
  }
}
