/* Floating mobile tabs inspired by the user's reference navigation. */
@media (max-width: 850px) {
  .content { padding-bottom: calc(124px + env(safe-area-inset-bottom)); }

  .bottom {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(8px, env(safe-area-inset-bottom));
    height: 75px;
    padding: 8px 6px 7px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border: 1px solid #e6eee8;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 16px 38px #153d2c26, 0 2px 8px #153d2c0d;
    z-index: 20;
  }

  .bottom button {
    --tab-color: #288f6b;
    position: relative;
    min-width: 0;
    width: 20%;
    height: 100%;
    padding: 9px 1px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    background: transparent;
    color: #a6b2ac;
    font-size: 0;
    line-height: 0;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
    transition: color .2s ease, transform .2s ease;
  }

  .bottom button:nth-child(2) { --tab-color: #4c7bd5; }
  .bottom button:nth-child(3) { --tab-color: #e48451; }
  .bottom button:nth-child(4) { --tab-color: #8b69c8; }
  .bottom button:nth-child(5) { --tab-color: #477d91; }

  .bottom .ico.nav-icon,
  .bottom button.add .ico.nav-icon {
    width: 35px;
    height: 35px;
    flex: none;
    border: 0 !important;
    border-radius: 10px;
    background: transparent !important;
    box-shadow: none !important;
    color: #a9b1ac !important;
    transform: none;
  }

  .bottom .nav-icon svg {
    width: 25px;
    height: 25px;
    stroke-width: 2.3;
  }

  .bottom button.active {
    color: var(--tab-color);
    font-size: 11px;
    line-height: 1.15;
    transform: translateY(-2px);
  }

  .bottom button.active::before {
    content: '';
    position: absolute;
    top: -24px;
    left: 50%;
    width: 27px;
    height: 27px;
    transform: translateX(-50%);
    border: 6px solid #f7f8f3;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 2px var(--tab-color);
    animation: mobile-tab-pop .23s ease-out both;
  }

  .bottom button.active .ico.nav-icon,
  .bottom button.add.active .ico.nav-icon {
    color: var(--tab-color) !important;
  }

  .bottom button:focus-visible {
    outline: 2px solid var(--tab-color);
    outline-offset: -3px;
    border-radius: 12px;
  }

  @keyframes mobile-tab-pop {
    from { opacity: 0; transform: translate(-50%, 5px) scale(.8); }
    to { opacity: 1; transform: translate(-50%, 0) scale(1); }
  }
}

@media (max-width: 370px) {
  .bottom { left: 8px; right: 8px; }
  .bottom button.active { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .bottom button, .bottom button.active::before { animation: none; transition: none; }
}
