.mobile-bottom-nav {
  display: none;
}

@media (max-width: 900px), (display-mode: standalone) and (pointer: coarse) {
  .app-shell {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .mobile-bottom-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 1040;
    display: grid;
    grid-template-columns: repeat(var(--mobile-nav-items), minmax(0, 1fr));
    min-height: 68px;
    padding: 6px 4px max(6px, env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.07);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .mobile-bottom-nav.has-compact-action {
    grid-template-columns: repeat(var(--mobile-nav-main-items), minmax(0, 1fr)) 48px;
  }

  .mobile-bottom-nav-item.is-compact {
    min-height: 56px;
    padding-inline: 0;
  }

  .mobile-bottom-nav-item {
    display: flex;
    min-width: 0;
    min-height: 56px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    padding: 4px 2px;
    color: var(--muted);
    border-radius: 12px;
    font-size: clamp(0.58rem, 2.6vw, 0.68rem);
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition:
      background-color 140ms ease,
      color 140ms ease,
      transform 100ms ease;
  }

  .mobile-bottom-nav-item:active {
    background: var(--surface-subtle);
    color: var(--text);
    transform: scale(0.94);
  }

  .mobile-bottom-nav-item.active {
    background: var(--surface-subtle);
    color: var(--text);
  }

  .mobile-bottom-nav-item.is-loading-target {
    background: var(--surface-subtle);
    color: var(--text);
  }

  .mobile-bottom-nav-item.is-pressed {
    background: var(--surface-subtle);
    color: var(--text);
  }

  .mobile-bottom-nav-item.is-pressed .mobile-bottom-nav-icon {
    animation: crew-nav-press 280ms ease-out both;
  }

  .mobile-bottom-nav-item.is-pressed .mobile-bottom-nav-label {
    animation: crew-nav-label-press 280ms ease-out both;
  }

  .mobile-bottom-nav-item.is-loading-target .mobile-bottom-nav-icon {
    animation: crew-nav-confirm 420ms ease both;
  }

  .mobile-bottom-nav-icon {
    position: relative;
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
  }

  .mobile-bottom-nav-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-bottom-nav-badge {
    position: absolute;
    top: -5px;
    right: -9px;
    display: grid;
    min-width: 17px;
    height: 17px;
    place-items: center;
    padding: 0 4px;
    background: #ff3b30;
    color: #fff;
    border: 2px solid var(--surface);
    border-radius: 999px;
    font-size: 0.55rem;
    font-weight: 800;
  }

  .mobile-bottom-nav-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-header .notification-button {
    display: none;
  }
}

@keyframes crew-nav-confirm {
  0% { transform: scale(1); }
  45% { transform: scale(0.86); }
  100% { transform: scale(1); }
}

@keyframes crew-nav-press {
  0% { transform: scale(1); }
  38% { transform: scale(0.76); }
  72% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes crew-nav-label-press {
  0% { opacity: 1; transform: translateY(0); }
  38% { opacity: 0.72; transform: translateY(1px); }
  100% { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-bottom-nav-item {
    transition: none;
  }

  .mobile-bottom-nav-item.is-loading-target .mobile-bottom-nav-icon,
  .mobile-bottom-nav-item.is-pressed .mobile-bottom-nav-icon,
  .mobile-bottom-nav-item.is-pressed .mobile-bottom-nav-label {
    animation: none;
  }
}
