/* VoiceNote navigation — the only source of navigation styles. */
.page-nav {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  gap: 0;
  margin-left: 16px;
  overflow: hidden;
  border: 1px solid rgb(var(--theme-accent-rgb) / .24);
  border-radius: 12px;
  background: rgb(var(--theme-surface-strong-rgb, 20 29 45) / .72);
  box-shadow: 0 8px 24px rgb(0 0 0 / .14);
}
.page-nav__item {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 108px;
  min-height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--app-muted);
  cursor: pointer;
  font: 700 clamp(12px, 1.1vw, 15px)/1 var(--font-ui, system-ui, sans-serif);
  letter-spacing: .01em;
  transition: background-color .18s ease, color .18s ease;
}
.page-nav__item + .page-nav__item::before {
  position: absolute;
  top: 25%;
  left: 0;
  width: 1px;
  height: 50%;
  content: "";
  background: rgb(var(--theme-accent-rgb) / .38);
}
.page-nav__item:hover,
.page-nav__item[aria-current="page"] { background: rgb(var(--theme-accent-rgb) / .16); color: var(--app-text); }
.page-nav__item:active { background: rgb(var(--theme-accent-rgb) / .24); }
.page-nav__item[hidden] { display: none !important; }

/* Desktop keeps navigation in the title bar. */
html[data-device-kind="desktop"] .page-nav {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
html[data-device-kind="desktop"] .page-nav {
  position: static;
  display: flex;
  width: auto;
  height: auto;
  margin-left: 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
html[data-device-kind="desktop"] .page-nav__item {
  min-width: 88px;
  min-height: 34px;
  width: auto;
  height: auto;
  padding: 0 14px;
  font-size: clamp(12px, 1.1vw, 15px);
}
html[data-device-kind="desktop"] .page-nav__item {
  min-width: 88px;
  min-height: 34px;
  padding: 0 14px;
}

/* Mobile and tablet use the same full-width bottom navigation panel. */
html[data-device-kind="mobile"] .page-nav,
html[data-device-kind="tablet"] .page-nav {
  position: fixed;
  z-index: 900;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: max(0px, calc(var(--voice-note-bottom-nav-content-height, clamp(46px, 6vh, 56px)) - 1px)) var(--voice-note-safe-area-bottom, env(safe-area-inset-bottom, 0px));
  width: 100%;
  height: var(--voice-note-bottom-nav-height, clamp(46px, 6vh, 56px));
  margin: 0;
  padding: 0;
  border-width: 1px 0 0;
  border-radius: 0;
  background: rgb(var(--theme-surface-strong-rgb, 20 29 45) / .94);
  /* The shell reserves the nav height. A negative shadow would paint over
     the last content rows and look like an extra strip above the nav. */
  box-shadow: none;
  backdrop-filter: blur(18px);
  overflow: visible;
}
html[data-device-kind="mobile"] .page-nav.page-nav--school,
html[data-device-kind="tablet"] .page-nav.page-nav--school {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
html[data-device-kind="mobile"] .page-nav::after,
html[data-device-kind="tablet"] .page-nav::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: var(--voice-note-safe-area-bottom, env(safe-area-inset-bottom, 0px));
  content: "";
  background: color-mix(in srgb, var(--app-surface) 96%, transparent);
  pointer-events: none;
}
html[data-device-kind="mobile"] .page-nav__item,
html[data-device-kind="tablet"] .page-nav__item {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: max(0px, calc(var(--voice-note-bottom-nav-content-height, clamp(46px, 6vh, 56px)) - 1px));
  align-self: start;
  padding: 0 10px;
  font-size: clamp(12px, 2vw, 16px);
  text-align: center;
}
html[data-device-kind="mobile"] #nav-shooter-button,
html[data-device-kind="tablet"] #nav-shooter-button { display: none; }
