.footer-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  gap: 2px;
  padding: 7px max(10px, env(safe-area-inset-left)) calc(5px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-right));
  background: #ffffff;
  border-top: 1px solid var(--line, #d7dce5);
  box-shadow: 0 -8px 22px rgba(24, 32, 42, 0.08);
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  contain: layout;
  box-sizing: border-box;
  overflow: visible;
  will-change: transform;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.footer-nav-buttons {
  display: grid;
  grid-template-columns: repeat(var(--footer-nav-count, 4), minmax(0, 1fr));
  gap: 4px;
}

.footer-nav-button {
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #667085;
  display: grid;
  place-items: center;
  gap: 3px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
}

.footer-nav-button.active {
  background: #eef4ff;
  color: #1849a9;
}

@media (hover: hover) and (pointer: fine) {
  .footer-nav-button:not(:disabled):hover {
    background: var(--footer-nav-hover-background, #e4edff);
    color: var(--footer-nav-hover-color, #1849a9);
    cursor: pointer;
  }

  .footer-nav-button.active:not(:disabled):hover {
    background: var(--footer-nav-active-hover-background, #d4e2ff);
  }
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: block;
  background: currentColor;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

.nav-icon.has-icon-url {
  -webkit-mask-image: var(--footer-nav-icon);
  mask-image: var(--footer-nav-icon);
}

.icon-clock {
  -webkit-mask-image: url("/icons/ui/clock.svg");
  mask-image: url("/icons/ui/clock.svg");
}

.icon-chat {
  -webkit-mask-image: url("/icons/ui/chat.svg");
  mask-image: url("/icons/ui/chat.svg");
}

.icon-school {
  -webkit-mask-image: url("/icons/ui/school.svg");
  mask-image: url("/icons/ui/school.svg");
}

.icon-settings {
  -webkit-mask-image: url("/icons/ui/settings.svg");
  mask-image: url("/icons/ui/settings.svg");
}

.environment-badge {
  min-height: 11px;
  color: #98a2b3;
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  user-select: none;
}

@media (min-width: 720px) {
  .footer-nav {
    left: 50%;
    width: min(1040px, 100%);
    transform: translateX(-50%);
    -webkit-transform: translateX(-50%);
    border-inline: 1px solid var(--line, #d7dce5);
  }
}

.footer-nav-button { min-width: 0; touch-action: manipulation; cursor: pointer; }
.footer-nav-button:disabled { opacity: .55; cursor: not-allowed; }
.footer-nav-button:focus-visible { outline: 3px solid #1f6feb; outline-offset: -3px; }
.footer-nav-buttons .footer-nav-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Keep overflow styling aligned with the Lit element. */
.footer-nav-more-icon { display: grid; place-items: center; width: 24px; height: 24px; font-size: 19px; letter-spacing: 2px; line-height: 1; }
.footer-nav-overflow {
  position: absolute; z-index: 1; box-sizing: border-box;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
  padding: 10px; margin: 0; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--line, #d7dce5); border-radius: 18px;
  background: var(--footer-nav-menu-background, #fff);
  box-shadow: 0 -6px 32px rgba(24, 32, 42, .16);
  touch-action: pan-y; scrollbar-gutter: stable;
}
.footer-nav-overflow[hidden] { display: none; }
.footer-nav-overflow button {
  min-width: 0; min-height: 72px; padding: 10px 4px; border-radius: 12px;
  align-content: center; gap: 7px; font-size: .82rem; line-height: 1.25;
  touch-action: pan-y;
}
.footer-nav-overflow .nav-icon { width: 24px; height: 24px; }
.footer-nav-overflow .footer-nav-label { white-space: normal; overflow-wrap: anywhere; text-align: center; }
[data-footer-more][aria-expanded="true"] { background: var(--footer-nav-hover-background, #e4edff); color: var(--footer-nav-hover-color, #1849a9); }
