.mobile-nav {
  --bar-paper: #fffdf9;
  --bar-ink: #60472f;
  --bar-honey: #996724;
  position: fixed;
  z-index: 8;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  align-items: end;
  max-width: 428px;
  height: 65px;
  margin-inline: auto;
  padding: 0 7px;
  border: 0;
  background: transparent;
  backdrop-filter: none;
  isolation: isolate;
  filter: drop-shadow(0 5px 12px rgb(65 48 34 / 20%));
  pointer-events: none;
}

.mobile-nav::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: 26px;
  background: var(--bar-paper);
  -webkit-mask-image: radial-gradient(circle 34px at 50% 0, transparent 98%, black 100%);
  mask-image: radial-gradient(circle 34px at 50% 0, transparent 98%, black 100%);
}

/* Keep the cutout a fixed size as the outer tabs spread on wider phones. */
@supports (clip-path: shape(from 0 0, line to 100% 0, line to 0 100%, close)) {
  .mobile-nav::before {
    -webkit-mask-image: none;
    mask-image: none;
    clip-path: shape(
      from 0 0,
      line to calc(50% - 49px) 0,
      curve to calc(50% - 29px) 15px with calc(50% - 38px) 0 / calc(50% - 35px) 4px,
      curve to 50% 33px with calc(50% - 22px) 28px / calc(50% - 12px) 33px,
      curve to calc(50% + 29px) 15px with calc(50% + 12px) 33px / calc(50% + 22px) 28px,
      curve to calc(50% + 49px) 0 with calc(50% + 35px) 4px / calc(50% + 38px) 0,
      line to 100% 0, line to 100% 100%, line to 0 100%, close
    );
  }
}

.mobile-nav button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  min-width: 0;
  height: 62px;
  padding: 0 0 9px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: #685b4f;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: auto;
  touch-action: manipulation;
}

.mobile-nav button i {
  display: grid;
  width: 36px;
  height: 25px;
  place-items: center;
  border-radius: 12px;
}

.mobile-nav .ico {
  width: 19px;
  height: 19px;
}

.mobile-nav button.active,
.mobile-nav button[aria-current="page"] {
  color: var(--bar-ink);
  font-weight: 750;
}

.mobile-nav button.active i,
.mobile-nav button[aria-current="page"] i {
  background: #f1e5d3;
}

.mobile-nav button[data-act="post"] {
  height: 87px;
  color: var(--bar-ink);
  font-weight: 750;
}

.mobile-nav button[data-act="post"] i {
  position: absolute;
  top: 0;
  left: 50%;
  width: 48px;
  height: 48px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--bar-honey);
  color: #fffdf7;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 24%), 0 3px 8px #69471c2b;
}

.mobile-nav button[data-act="post"] .ico {
  width: 24px;
  height: 24px;
}

.mobile-nav button:focus-visible {
  outline: 2px solid #956220;
  outline-offset: -3px;
}

.page {
  padding-bottom: calc(114px + env(safe-area-inset-bottom));
}

#toast {
  bottom: calc(111px + env(safe-area-inset-bottom));
}

@media (min-width: 721px) {
  .mobile-nav {
    max-width: 456px;
    bottom: 18px;
    padding-inline: 9px;
  }

  .mobile-nav button {
    font-size: 11px;
  }
}

@media (hover: hover) {
  .mobile-nav button:not([data-act="post"]):hover i {
    background: #f1e6d9;
    color: var(--bar-ink);
  }

  .mobile-nav button[data-act="post"]:hover i {
    background: #81551d;
  }
}
