:root {
  /* Fixed-navbar bottom edge (top offset + height) plus breathing room.
     Pages that render prominent content behind the transparent spotlight
     navbar (e.g. detail hero) should pad against this instead of a magic
     number, so it stays correct if the navbar's own geometry changes. */
  --spotlight-navbar-clearance: calc(max(14px, env(safe-area-inset-top)) + 44px + 24px);
}

.navbar.navbar-spotlight {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  z-index: 1860;
  height: 44px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 clamp(20px, 3vw, 34px);
  pointer-events: none;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.navbar.navbar-spotlight.mobile-open {
  z-index: 1900;
}

.navbar-left,
.navbar-center,
.navbar-right {
  display: flex;
  align-items: center;
  pointer-events: auto;
}

.navbar-left {
  justify-content: flex-start;
}

.navbar-center {
  justify-content: center;
}

.navbar-right {
  justify-content: flex-end;
  gap: 14px;
}

.navbar-top-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(var(--abyss-glass-tint), 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.navbar-top-tab {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.88rem;
  font-weight: 650;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.navbar-top-tab:hover {
  color: rgba(255, 255, 255, 0.86);
}

.navbar-top-tab.active {
  background: rgb(var(--abyss-accent));
  color: #121212;
}

.navbar-top-tab.active:hover {
  color: #121212;
}

.navbar-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mobile-menu-button,
.navbar-action-button {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  color: rgba(255, 255, 255, 0.88);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.navbar-action-button {
  flex-direction: row;
}

.navbar-action-button:hover,
.mobile-menu-button:hover,
.navbar.mobile-open .mobile-menu-button {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.mobile-menu-button:active,
.navbar-action-button:active {
  transform: scale(0.94);
}

.navbar-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.navbar-action-icon svg {
  display: block;
}

.mobile-menu-line {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

.navbar.mobile-open .mobile-menu-line:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.navbar.mobile-open .mobile-menu-line:nth-child(2) {
  opacity: 0;
}

.navbar.mobile-open .mobile-menu-line:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

@media (max-width: 768px) {
  .navbar-center {
    display: none;
  }

  .navbar.navbar-spotlight {
    grid-template-columns: auto 1fr auto;
  }
}

@media (max-width: 520px) {
  :root {
    --spotlight-navbar-clearance: calc(max(10px, env(safe-area-inset-top)) + 40px + 20px);
  }

  .navbar.navbar-spotlight {
    top: max(10px, env(safe-area-inset-top));
    height: 40px;
    padding: 0 12px;
    grid-template-columns: auto 1fr auto;
    column-gap: 8px;
  }

  .navbar-top-tab {
    min-height: 30px;
    padding: 0 12px;
    font-size: 0.78rem;
  }

  .navbar-right {
    gap: 4px;
  }

  .navbar-action-button,
  .mobile-menu-button {
    width: 34px;
    height: 34px;
  }
}

/* Shared base styles reused by the app drawer (mobile-drawer.css scopes the rest) */
.navbar-item {
  position: relative;
  list-style: none;
}

.navbar-link {
  display: inline-flex;
  align-items: center;
  position: relative;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.navbar-link:hover,
.navbar-link.active {
  color: var(--text-primary);
}

.mobile-nav-icon {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.mobile-nav-icon svg {
  display: block;
}

.mobile-nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
