.nav-health,
.nav-more {
  position: relative;
  flex: 0 0 auto;
}

.nav-health > summary,
.nav-more > summary {
  list-style: none;
}

.nav-health > summary::-webkit-details-marker,
.nav-more > summary::-webkit-details-marker {
  display: none;
}

.nav-health .freshness-pill {
  cursor: pointer;
}

.nav-health-chevron {
  color: var(--muted);
  font-size: 12px;
  transition: transform 160ms ease;
}

.nav-health[open] .nav-health-chevron {
  transform: rotate(180deg);
}

.nav-health-menu,
.nav-more-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  border: 1px solid rgba(127, 132, 142, 0.34);
  border-radius: 10px;
  background: rgba(35, 35, 38, 0.99);
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.58);
}

.nav-health-menu {
  width: min(330px, calc(100vw - 20px));
  padding: 14px;
}

.nav-health-heading,
.nav-health-row,
.nav-health-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nav-health-heading {
  margin-bottom: 10px;
}

.nav-health-heading strong {
  color: var(--text);
  font-size: 13px;
}

.nav-health-heading span,
.nav-health-meta {
  color: var(--muted);
  font-size: 10px;
}

.nav-health-block,
.nav-health .queue-pill {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 18, 20, 0.62);
  letter-spacing: 0;
}

.nav-health .queue-pill {
  margin-top: 8px;
}

.nav-health-row span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.nav-health-row strong {
  color: var(--text);
  font-size: 11px;
  text-align: right;
}

.queue-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.queue-metrics span {
  padding: 7px 4px;
  border-radius: 6px;
  background: rgba(127, 132, 142, 0.08);
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.queue-metrics b {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-size: 14px;
}

.nav-health .queue-pill[data-queue-tone="clear"] {
  border-color: rgba(152, 195, 121, 0.28);
}

.nav-health .queue-pill[data-queue-tone="clear"] [data-queue-label] {
  color: var(--green);
}

.nav-health .queue-pill[data-queue-tone="active"] {
  border-color: rgba(97, 175, 239, 0.28);
}

.nav-health .queue-pill[data-queue-tone="active"] [data-queue-label] {
  color: var(--blue);
}

.nav-health .queue-pill[data-queue-tone="warn"] [data-queue-label] {
  color: var(--yellow);
}

.nav-health .queue-pill[data-queue-tone="alert"] [data-queue-label] {
  color: var(--red);
}

.nav-health .queue-pill[data-queue-tone="unknown"] [data-queue-label],
.nav-health .queue-pill[data-queue-tone="unconfigured"] [data-queue-label] {
  color: var(--muted);
}

.nav-more {
  display: none;
}

.nav-more > summary {
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.nav-more[open] > summary,
.nav-more > summary:hover {
  color: var(--text);
  background: var(--panel-2);
}

.nav-more-menu {
  display: grid;
  width: min(220px, calc(100vw - 20px));
  max-height: min(70svh, 520px);
  overflow-y: auto;
  padding: 8px;
}

.nav-more-menu a {
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.nav-more-menu a:hover,
.nav-more-menu a[aria-current="page"] {
  color: var(--text);
  background: var(--panel-2);
}

@media (max-width: 940px) {
  .nav-links a[data-nav-priority="secondary"] {
    display: none;
  }

  .nav-more {
    display: block;
  }
}

@media (max-width: 560px) {
  .nav-health-menu {
    position: fixed;
    top: 62px;
    right: 8px;
  }

  .nav-more-menu {
    position: fixed;
    top: 62px;
    right: 8px;
  }

  .freshness-age {
    display: none;
  }
}

@media (max-width: 380px) {
  .nav-health .freshness-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .nav-health .freshness-pill {
    width: 30px;
    justify-content: center;
    padding: 7px;
  }

  .nav-health-chevron {
    display: none;
  }

  .nav-more > summary {
    font-size: 0;
  }

  .nav-more > summary::after {
    content: "•••";
    font-size: 12px;
  }
}
