/*
 * Menu bar: the bar along the top of the screen (system menu, app in front, Window menu;
 * background app icons, status, clock).
 */

.menubar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 205;
  display: flex;
  align-items: center;
  height: var(--menubar-h);
  padding-inline: 0.6rem;
  background: var(--bg-4);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1rem;
  user-select: none;
}

.mb-start,
.mb-end {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  height: 100%;
  min-width: 0;
}

.mb-end {
  margin-inline-start: auto;
}

/* 1.6rem, not the 2.4rem of a normal button: the bar is only 2rem high */
.mb-btn {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.4rem;
  height: 1.6rem;
  padding: 0 0.8rem;
  border: 0;
  border-radius: 0.6rem;
  background: transparent;
  color: inherit;
  font: inherit;
  white-space: nowrap;
}

/* a title is lit while it is pressed or its menu is open; nothing happens on hover */
.mb-btn:active:not(:disabled),
.mb-btn.is-open {
  background: var(--bg-pressed);
}

.mb-btn:disabled {
  color: inherit;
  opacity: 1;
}

.mb-logo .icon {
  --icon-size: 1.2rem;
}

.mb-icon {
  padding: 0 0.6rem;
}

.mb-icon[hidden] {
  display: none;
}

.mb-icon .icon {
  --icon-size: 1.2rem;
}

.mb-app {
  font-weight: 700;
}

.mb-tray {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.mb-tray:empty {
  display: none;
}

.tray-app img {
  width: 1.2rem;
  height: 1.2rem;
}

.mb-status .icon {
  --icon-size: 1.2rem;
}

.mb-clock {
  gap: 0.6rem;
}

.mb-badge {
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.2rem;
  border-radius: 0.6rem;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.6rem;
  font-weight: 600;
  line-height: 1rem;
  text-align: center;
}

/* phones: only what matters fits */
@media (max-width: 32.6rem) {
  .mb-date,
  .mb-status {
    display: none;
  }
}
