/* Stop page-level globals from leaking in */
.bottom-nav, .bottom-nav * { box-sizing: border-box; }
.bottom-nav button, .bottom-nav button * { margin: 0; padding: 0; }

/* ===== Shared Bottom Navigation ===== */
:root {
  --nav-offset: 16px;       /* distance from bottom */
  --nav-height: 72px;       /* consistent height across all pages */
  --nav-width: clamp(260px, 60vw, 360px); /* responsive pill width */
  --icon-size: 30px;        /* common app icon size */
  --active: #1976d2;
  --muted: #555;
  --border: #ccc;
}

/* Container: fixed size + 3 equal tracks */
.bottom-nav {
  position: fixed;
  bottom: var(--nav-offset);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9999px;
  width: var(--nav-width);
  height: var(--nav-height);
  padding: 0 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,.15);
  z-index: 50;

  /* 🔒 Equal columns (no “space-between” artifacts) */
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  column-gap: 0;
}

/* Prevent overlap with page content */
body, #main-content {
  padding-bottom: calc(var(--nav-height) + var(--nav-offset) + 12px);
}

/* Each button fills its grid cell and centers its content */
.bottom-nav button {
  all: unset;                /* reset page/global button styles */
  grid-column: span 1;
  width: 100%;
  height: 100%;
  cursor: pointer;

  display: grid;
  place-items: center;       /* centers icon+label as a block */
  padding: 0;
  text-align: center;
}

/* Stack icon over label */
.bottom-nav button .stack {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
}

/* Icon & label */
.bottom-nav button svg {
  width: var(--icon-size);
  height: var(--icon-size);
  flex-shrink: 0;
  fill: var(--muted);
}

.bottom-nav button span {
  font-size: 12px;
  line-height: 1;
  color: var(--muted);
}

.bottom-nav button.active svg,
.bottom-nav button.active span {
  fill: var(--active);
  color: var(--active);
}

/* Small phones */
@media (max-width: 400px) {
  :root {
    --nav-height: 68px;
    --nav-width: clamp(220px, 70vw, 320px);
    --icon-size: 28px;
  }
  .bottom-nav button span { font-size: 11px; }
}

/* Larger screens */
@media (min-width: 768px) {
  :root {
    --nav-width: clamp(300px, 40vw, 420px);
  }
}
