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

@media (max-width: 760px) {
  :root {
    --mobile-bottom-nav-height: calc(68px + env(safe-area-inset-bottom));
  }

  body:not(.session-active) {
    padding-bottom: var(--mobile-bottom-nav-height);
  }

  .mobile-bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 900;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    height: var(--mobile-bottom-nav-height);
    padding: 4px 2px env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(14px);
  }

  body.session-active .mobile-bottom-nav {
    display: none;
  }

  .mobile-nav-button {
    position: relative;
    display: grid;
    grid-template-rows: 30px auto;
    place-items: center;
    align-content: center;
    min-width: 0;
    min-height: 58px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    padding: 3px 1px 2px;
    font: inherit;
    cursor: pointer;
    touch-action: manipulation;
  }

  .mobile-nav-button::before {
    position: absolute;
    top: -4px;
    left: 50%;
    width: 34px;
    height: 4px;
    border-radius: 0 0 999px 999px;
    background: var(--accent);
    content: "";
    opacity: 0;
    transform: translateX(-50%);
  }

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

  .mobile-nav-button[aria-current="page"] {
    background: var(--accent-soft);
    color: var(--accent-strong);
  }

  .mobile-nav-button[aria-current="page"]::before {
    opacity: 1;
  }

  .mobile-nav-button:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 38%, transparent);
    outline-offset: -3px;
  }

  .mobile-nav-label {
    overflow: hidden;
    max-width: 100%;
    font-size: 0.64rem;
    font-weight: 800;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .image-modal,
  .detail-modal {
    z-index: 1300;
  }
}

@media (max-width: 360px) {
  .mobile-nav-label {
    font-size: 0.59rem;
  }
}
