.mobile-dock {
  --dock-glass: rgba(255, 255, 255, 0.3);
  --dock-rim: rgba(255, 255, 255, 0.55);
  --dock-active: #2e1065;
  --dock-active-bg: rgba(46, 16, 101, 0.12);
  --dock-fg: #2e1065;
  --dock-blur: 16px;
  --dock-h: 55px;
  --dock-fab: 55px;
  --dock-gap: 10px;
  --dock-side: 10px;
  --dock-bottom: 15px;
  --dock-ico: 20px;
  --dock-txt: 10px;
  --dock-reserve: calc(var(--dock-h) + var(--dock-bottom) + 18px);

  display: none;
  position: fixed;
  inset-inline: var(--dock-side);
  bottom: calc(var(--dock-bottom) + env(safe-area-inset-bottom, 0px));
  z-index: 10;
  pointer-events: none;
}

.mobile-dock-row {
  display: flex;
  align-items: center;
  gap: var(--dock-gap);
  height: var(--dock-h);
  pointer-events: none;
}

.mobile-dock-pill,
.mobile-dock-fab {
  pointer-events: auto;
  height: var(--dock-h);
  border: 0.5px solid var(--dock-rim);
  background: var(--dock-glass);
  backdrop-filter: blur(var(--dock-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--dock-blur)) saturate(1.4);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.45),
    0 6px 18px rgba(46, 16, 101, 0.12);
  box-sizing: border-box;
}

.mobile-dock-pill {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 4px 6px;
  border-radius: 999px;
  overflow: hidden;
}

.mobile-dock-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--dock-fg);
  flex: 1;
  min-width: 0;
  max-width: 76px;
  height: calc(var(--dock-h) - 8px);
  border-radius: 999px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 2px 4px;
  font: inherit;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.mobile-dock-btn:active,
.mobile-dock-fab:active {
  transform: scale(0.96);
}

.mobile-dock-btn:focus-visible,
.mobile-dock-fab:focus-visible {
  outline: 2px solid var(--dock-active);
  outline-offset: 2px;
}

.mobile-dock-ico {
  display: inline-flex;
  width: var(--dock-ico);
  height: var(--dock-ico);
  align-items: center;
  justify-content: center;
}

.mobile-dock-btn svg,
.mobile-dock-fab svg {
  width: var(--dock-ico);
  height: var(--dock-ico);
  display: block;
  fill: currentColor;
}

.mobile-dock-txt {
  font-size: var(--dock-txt);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  opacity: 0.9;
}

.mobile-dock-btn.is-active {
  color: var(--dock-active);
  background: var(--dock-active-bg);
}

.mobile-dock-fab {
  appearance: none;
  width: var(--dock-fab);
  min-width: var(--dock-fab);
  max-width: var(--dock-fab);
  border-radius: 999px;
  color: var(--dock-fg);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-shrink: 0;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: none;
  transition: color 0.15s ease, transform 0.15s ease;
}

@media (max-width: 767px) {
  .mobile-dock {
    display: block;
  }

  body.relative {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-dock *,
  .mobile-dock *::before,
  .mobile-dock *::after {
    transition: none !important;
    animation: none !important;
  }
}
