/* Canonical owner for the mobile bottom navigation: compact neutral slider. */
@view-transition {
  navigation: auto;
}

@keyframes restri-mobile-page-out {
  from { opacity: 1; }
  to { opacity: .94; }
}

@keyframes restri-mobile-page-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@media (max-width: 768px) {
  body {
    --mobile-nav-height: 76px;
    --mobile-nav-safe: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
  }

  .mobile-bottom-nav {
    --mobile-nav-pad-x: 5px;
    --mobile-nav-pad-y: 5px;
    position: fixed;
    z-index: 220;
    left: max(14px, env(safe-area-inset-left));
    right: max(14px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    height: 64px;
    min-height: 64px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    padding: var(--mobile-nav-pad-y) var(--mobile-nav-pad-x);
    box-sizing: border-box;
    border: 1px solid rgba(15, 23, 42, .05);
    border-radius: 22px;
    background: #eceef2;
    box-shadow:
      0 10px 24px rgba(15, 23, 42, .10),
      inset 0 1px 0 rgba(255, 255, 255, .84);
    overflow: hidden;
    isolation: isolate;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    view-transition-name: restri-mobile-bottom-nav;
  }

  .mobile-bottom-nav::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0));
  }

  .mobile-bottom-nav__indicator {
    position: absolute;
    z-index: 0;
    top: var(--mobile-nav-pad-y);
    left: var(--mobile-nav-pad-x);
    width: calc((100% - (var(--mobile-nav-pad-x) * 2)) / 5);
    height: calc(100% - (var(--mobile-nav-pad-y) * 2));
    transform: translate3d(calc(var(--mobile-nav-active-index, 0) * 100%), 0, 0);
    transform-origin: center;
    will-change: transform;
    pointer-events: none;
  }

  .mobile-bottom-nav__indicator::before {
    content: "";
    position: absolute;
    inset: 0 2px;
    border: 1px solid rgba(15, 23, 42, .055);
    border-radius: 18px;
    background: #dfe2e8;
    box-shadow:
      0 3px 8px rgba(15, 23, 42, .08),
      inset 0 1px 0 rgba(255, 255, 255, .72);
    pointer-events: none;
    transition: transform 180ms cubic-bezier(.22,.61,.36,1), box-shadow 180ms ease;
  }

  .mobile-bottom-nav.is-dragging .mobile-bottom-nav__indicator::before {
    transform: scaleX(1.035) scaleY(.985);
    box-shadow:
      0 5px 12px rgba(15, 23, 42, .10),
      inset 0 1px 0 rgba(255, 255, 255, .78);
  }

  .mobile-bottom-nav__item {
    position: relative;
    z-index: 2;
    min-width: 0;
    min-height: 54px;
    margin: 0;
    padding: 4px 2px 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 0;
    border-radius: 18px;
    background: transparent;
    color: #111827;
    text-decoration: none;
    text-align: center;
    box-shadow: none;
    transform: translateZ(0);
    transition: transform 200ms cubic-bezier(.22,.61,.36,1), opacity 160ms ease;
    cursor: pointer;
  }

  .mobile-bottom-nav__item:hover,
  .mobile-bottom-nav__item:focus,
  .mobile-bottom-nav__item:focus-visible,
  .mobile-bottom-nav__item:active,
  .mobile-bottom-nav__item.is-active,
  .mobile-bottom-nav__item[data-drag-active="1"],
  .mobile-bottom-nav__item[data-drag-near="1"] {
    background: transparent;
    color: #111827;
    outline: none;
    box-shadow: none;
  }

  .mobile-bottom-nav__icon {
    display: block;
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    min-width: 22px;
    color: currentColor;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    overflow: visible;
    opacity: 1;
    transform: translateZ(0);
    transition: transform 200ms cubic-bezier(.22,.61,.36,1), opacity 160ms ease;
  }

  .mobile-bottom-nav__icon--spark {
    fill: currentColor;
    stroke: none;
    width: 23px;
    height: 23px;
  }

  .mobile-bottom-nav__item.is-active .mobile-bottom-nav__icon,
  .mobile-bottom-nav__item[data-drag-active="1"] .mobile-bottom-nav__icon {
    transform: translateZ(0);
  }

  .mobile-bottom-nav__label {
    display: block;
    flex: 0 0 auto;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: currentColor;
    font-size: 9px;
    line-height: 1;
    font-weight: 560;
    letter-spacing: -.01em;
    text-align: center;
    opacity: .9;
    transform: translateZ(0);
    transition: opacity 160ms ease;
  }

  .mobile-bottom-nav__item.is-active .mobile-bottom-nav__label,
  .mobile-bottom-nav__item[data-drag-active="1"] .mobile-bottom-nav__label {
    font-weight: 560;
    opacity: .9;
  }

  ::view-transition-old(root) {
    animation: restri-mobile-page-out 120ms ease-out both;
    mix-blend-mode: normal;
  }

  ::view-transition-new(root) {
    animation: restri-mobile-page-in 180ms cubic-bezier(.22, .61, .36, 1) both;
    mix-blend-mode: normal;
  }

  ::view-transition-group(restri-mobile-bottom-nav) {
    animation-duration: 180ms;
    animation-timing-function: cubic-bezier(.22, .61, .36, 1);
  }

  ::view-transition-old(restri-mobile-bottom-nav),
  ::view-transition-new(restri-mobile-bottom-nav) {
    animation: none;
    mix-blend-mode: normal;
  }
}

@media (max-width: 380px) {
  .mobile-bottom-nav {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
  }
  .mobile-bottom-nav__label { font-size: 8.5px; }
  .mobile-bottom-nav__indicator::before { inset-inline: 1px; }
}

@media (min-width: 769px) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-bottom-nav__indicator,
  .mobile-bottom-nav__indicator::before,
  .mobile-bottom-nav__item,
  .mobile-bottom-nav__icon,
  .mobile-bottom-nav__label,
  ::view-transition-old(root),
  ::view-transition-new(root),
  ::view-transition-group(restri-mobile-bottom-nav),
  ::view-transition-old(restri-mobile-bottom-nav),
  ::view-transition-new(restri-mobile-bottom-nav) {
    transition: none !important;
    animation: none !important;
  }
}
