/* 2026-09-23: shared floating five-item navigation. */
.bottom-nav.bottom-nav-four {
  position: fixed;
  z-index: 70;
  right: max(12px, calc((100vw - 480px) / 2 + 12px));
  bottom: max(10px, env(safe-area-inset-bottom));
  left: max(12px, calc((100vw - 480px) / 2 + 12px));
  width: auto;
  height: 68px;
  transform: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  box-sizing: border-box;
  padding: 7px 8px 6px;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 34px;
  background:
    linear-gradient(105deg, rgba(255, 240, 220, .88), rgba(250, 246, 255, .9) 48%, rgba(238, 249, 236, .84));
  box-shadow:
    0 15px 38px rgba(54, 38, 66, .17),
    inset 0 1px 0 rgba(255, 255, 255, .8);
  -webkit-backdrop-filter: blur(20px) saturate(1.22);
  backdrop-filter: blur(20px) saturate(1.22);
}

.bottom-nav.bottom-nav-four::before,
.bottom-nav.bottom-nav-four::after {
  display: none;
}

.bottom-nav.bottom-nav-four .nav-item {
  position: relative;
  min-width: 0;
  min-height: 52px;
  margin: 0;
  padding: 3px 0 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  transform: none;
  border: 0;
  border-radius: 24px;
  color: #756d79;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  font-weight: 560;
  line-height: 1.15;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav.bottom-nav-four .nav-item strong {
  width: 24px;
  height: 24px;
  margin: 0;
  display: grid;
  place-items: center;
  border: 0;
  color: inherit;
  background: transparent;
  box-shadow: none;
  font-size: 0;
  line-height: 1;
}

.bottom-nav.bottom-nav-four .nav-item strong svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav.bottom-nav-four .nav-item.active {
  color: #5b3ed6;
  background: rgba(108, 76, 241, .1);
}

.bottom-nav.bottom-nav-four .nav-item.active span {
  font-weight: 800;
}

.bottom-nav.bottom-nav-four .nav-add,
.bottom-nav.bottom-nav-four .nav-add.active {
  align-self: stretch;
  overflow: visible;
  color: #5f5368;
  background: transparent;
}

.bottom-nav.bottom-nav-four .nav-add strong {
  position: absolute;
  top: -19px;
  left: 50%;
  width: 54px;
  height: 54px;
  transform: translateX(-50%);
  border: 4px solid rgba(255, 255, 255, .96);
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #ff9a47, #ff6f25);
  box-shadow:
    0 10px 22px rgba(241, 112, 35, .3),
    0 0 0 1px rgba(238, 105, 20, .08);
  font-size: 34px;
  font-weight: 300;
  line-height: 1;
}

.bottom-nav.bottom-nav-four .nav-add span {
  margin-top: 30px;
  color: #6d5a67;
}

.bottom-nav.bottom-nav-four .nav-add.active span {
  color: #5b3ed6;
}

.bottom-nav.bottom-nav-four .nav-item:focus-visible {
  outline: 3px solid rgba(108, 76, 241, .32);
  outline-offset: -2px;
}

.page:has(> .bottom-nav.bottom-nav-four) {
  padding-bottom: calc(116px + env(safe-area-inset-bottom));
}

/* Keep page-level action docks above the raised center button. */
body:has(.bottom-nav.bottom-nav-four) .library-menu-selection-bar,
body:has(.bottom-nav.bottom-nav-four) .library-bulk-bar,
body:has(.bottom-nav.bottom-nav-four) .order-batch-bar,
body:has(.bottom-nav.bottom-nav-four) .meal-order-dock,
body:has(.bottom-nav.bottom-nav-four) .meal-order-status,
body:has(.bottom-nav.bottom-nav-four) .meal-flow-page .flow-check-confirm,
body:has(.bottom-nav.bottom-nav-four) .sticky-actions {
  bottom: calc(104px + env(safe-area-inset-bottom));
}

.page:has(> .bottom-nav.bottom-nav-four):has(.sticky-actions) {
  padding-bottom: calc(218px + env(safe-area-inset-bottom));
}

@media (max-width: 767px), (hover: none) and (pointer: coarse) {
  body:has(input:focus, textarea:focus, select:focus, [contenteditable]:focus) .bottom-nav.bottom-nav-four {
    transform: translateY(calc(100% + 28px));
    opacity: 0;
    pointer-events: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .bottom-nav.bottom-nav-four {
    transition: transform .2s ease, opacity .2s ease;
  }

  .bottom-nav.bottom-nav-four .nav-item {
    transition: color .16s ease, background-color .16s ease, transform .16s ease;
  }

  .bottom-nav.bottom-nav-four .nav-item:active {
    transform: scale(.96);
  }
}
