:root {
  --fb-nav-amber: #ffc864;
  --fb-nav-muted: #77858a;
  --fb-nav-line: #2a373d;
  --fb-nav-bg-top: rgba(20,29,33,.98);
  --fb-nav-bg-bottom: rgba(8,12,14,.995);
  --fb-nav-height: 54px;
  --fb-nav-reserved-height: calc(var(--fb-nav-height) + env(safe-area-inset-bottom));
}

/*
 * Shared app shell. The bottom navigation is pinned to the visible viewport
 * instead of relying on a second grid row. Android standalone PWAs can report
 * a layout viewport taller than the actually visible area while system chrome
 * settles; a fixed shell keeps Radio / Explore / Lookup reachable throughout.
 */
html,
body {
  height: 100%;
  overflow: hidden !important;
}

body {
  min-height: 100vh !important;
  min-height: 100dvh !important;
}

.has-fb-bottom-nav {
  position: relative;
  height: 100vh;
  height: 100dvh;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  display: block !important;
}

.fb-page-scroll {
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scroll-padding-bottom: calc(var(--fb-nav-reserved-height) + 20px);
}

.zero-radio > .fb-page-scroll,
.lookup-app > .fb-page-scroll {
  padding: max(10px, env(safe-area-inset-top)) 10px calc(var(--fb-nav-reserved-height) + 20px);
}

.explore-app > .fb-page-scroll {
  padding: env(safe-area-inset-top) 0 calc(var(--fb-nav-reserved-height) + 20px);
}

.fb-bottom-nav {
  position: fixed !important;
  z-index: 1000;
  left: 50% !important;
  right: auto !important;
  bottom: 0 !important;
  width: min(100vw, 720px);
  min-height: var(--fb-nav-reserved-height);
  padding-bottom: env(safe-area-inset-bottom);
  transform: translateX(-50%) !important;
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--fb-nav-line);
  background: linear-gradient(180deg, var(--fb-nav-bg-top), var(--fb-nav-bg-bottom));
  box-shadow: 0 -8px 20px rgba(0,0,0,.26);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.fb-nav-item {
  position: relative;
  min-width: 0;
  min-height: var(--fb-nav-height);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  color: var(--fb-nav-muted);
  text-decoration: none;
  font: 800 8px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .04em;
  -webkit-tap-highlight-color: transparent;
}

.fb-nav-item svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fb-nav-item.active {
  color: var(--fb-nav-amber);
  background: linear-gradient(180deg, rgba(255,200,100,.12), rgba(255,200,100,.025));
}

.fb-nav-item.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 2px;
  background: var(--fb-nav-amber);
  box-shadow: 0 0 8px rgba(255,200,100,.42);
}

.fb-nav-item:focus-visible {
  outline: 2px solid rgba(255,200,100,.65);
  outline-offset: -3px;
}

/* Zero intentionally keeps its instrument panel non-scrolling on phones. Its
 * later viewport stylesheet sets compact padding; keep this bottom reservation
 * authoritative so the receiver strip and controls finish above the fixed bar. */
.zero-radio > .fb-page-scroll {
  padding-bottom: calc(var(--fb-nav-reserved-height) + 3px) !important;
}

@media (min-width: 720px) {
  .explore-app > .fb-page-scroll {
    padding-inline: 22px;
  }
}
