/* ============================================================================
   BOTTOM NAV (phone)
   Settings opens from the avatar in each tab page's header
   (.settings-avatar below).
   ============================================================================ */

.bottom-nav {
  display: none;
}

@media (max-width: 1099px), (hover: none) and (pointer: coarse) {
  .bottom-nav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 100;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    height: calc(var(--bottom-nav-h) + var(--safe-inset-bottom));
    padding: 6px max(8px, var(--safe-inset-right)) calc(24px + var(--safe-inset-bottom)) max(8px, var(--safe-inset-left));
    background: var(--bg);
    font-family: var(--font);
  }

  /* No bar: the nav is the page itself, and cards scrolling down fade into
     it instead of meeting an edge */
  .bottom-nav::before {
    content: "";
    position: absolute;
    inset: auto 0 100% 0;
    height: 24px;
    background: linear-gradient(to bottom, transparent, var(--bg));
    pointer-events: none;
  }
}

.bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: var(--tap-min);
  color: var(--tx3);
  font: var(--fw-medium) 10px/1 var(--font);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--spring-dur) var(--spring), color 120ms ease-out;
}

.bottom-nav .nav-item:active {
  transform: scale(0.92);
  transition: var(--press);
}

.bottom-nav .nav-item.active {
  color: var(--ac);
  font-weight: var(--fw-semibold);
}

.bottom-nav .nav-icon {
  width: 24px;
  height: 24px;
}

.bottom-nav .nav-label {
  white-space: nowrap;
}

/* Roster's check-in dot: 7px, --dan, off the icon's top right */
.bottom-nav-icon {
  position: relative;
  display: inline-flex;
}

.bottom-nav-dot {
  position: absolute;
  top: 0;
  left: calc(50% + 8px);
  width: 7px;
  height: 7px;
  border-radius: var(--r-pill);
  background: var(--dan);
}

/* Log session: a 52px primary circle in the centre slot, pressed like
   every primary button */
.bottom-nav-log {
  display: grid;
  place-items: center;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-log-circle {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: var(--r-pill);
  background: var(--ac);
  color: var(--ac-ink);
  box-shadow: 0 4px 14px color-mix(in oklch, var(--ac) 35%, transparent);
  transition: background-color 80ms ease-out, box-shadow 80ms ease-out, transform var(--spring-dur) var(--spring);
}

.bottom-nav-log-circle .nav-icon {
  width: 24px;
  height: 24px;
}

@media (any-hover: hover) {
  .bottom-nav-log:hover .bottom-nav-log-circle {
    background: color-mix(in oklch, var(--ac) 92%, black);
  }
}

.bottom-nav-log:active .bottom-nav-log-circle {
  transform: scale(0.92);
  box-shadow: none;
  transition: var(--press), box-shadow 80ms ease-out;
}

.bottom-nav-log:focus-visible {
  outline: none;
}

.bottom-nav-log:focus-visible .bottom-nav-log-circle {
  box-shadow: var(--focus-ring);
}

/* ============================================================================
   SETTINGS AVATAR (phone)
   The 32px avatar at the top right of each tab page's header. Desktop
   reaches Settings from the sidebar's account row instead, so it's hidden
   there.
   ============================================================================ */

.settings-avatar {
  display: none;
}

@media (max-width: 1099px), (hover: none) and (pointer: coarse) {
  .settings-avatar {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    /* 44px tap target around the 32px avatar */
    width: var(--tap-min);
    height: var(--tap-min);
    margin: -6px -6px -6px 0;
    border-radius: var(--r-pill);
    text-decoration: none;
  }
}
