/* ── Dropdown / context-menu popover ─────────────────────────────────────────
   The shared singleton floating menu built by web/js/ui/menu-popover.ts and used
   by the Workspaces switcher, the Sync sign-out menu, the Appearance theme
   picker, and the file-list right-click menu. JS fixed-positions it next to an
   anchor element OR at a click point. Borderless — the elevation shadow + panel
   background separate it (this codebase avoids borders as affordances; the
   active/hover row uses a background tint, not a border). */
.menu-popover {
  position: fixed;
  z-index: var(--z-toast-top);
  min-width: 0;
  /* Cap horizontal growth so a long label can't push past a phone drawer. */
  max-width: calc(min(80vw, var(--mobile-drawer-max)) - 2 * var(--gap));
  /* Cap so a long list scrolls within the menu rather than off-screen. */
  max-height: calc(100dvh - 120px);
  overflow-y: auto;
  padding: 0;
  background: var(--bg, #1e1e1e);
  border-radius: var(--radius-control);
  box-shadow: var(--elev-1);
}

/* One clickable row. */
.menu-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  margin: 0;
  padding: 6px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  flex-wrap: nowrap;
}
.menu-item:hover,
.menu-item:focus-visible {
  background: var(--hover-overlay, rgba(255, 255, 255, 0.05));
  outline: none;
}
.menu-item.active,
.menu-item.active:hover {
  background: var(--surface, #2e2e2e);
}

/* Dot/avatar + label sub-flex so the trailing tick can push to the right. */
.menu-item-identity {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}
.menu-item-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--text-base);
  color: var(--text, #e8dcf4);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.menu-item-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.menu-item-check {
  margin-left: auto;
  color: var(--accent, #a272b0);
  flex-shrink: 0;
}

/* Destructive item (e.g. the Sync sign-out). */
.menu-item-danger .menu-item-label {
  color: var(--error, #c53030);
}

/* Theme swatch rows (Appearance): the row is filled with its theme's own
   background (set inline) so the gallery reads at a glance. That inline fill
   would swallow the default hover background, so cue hover/focus with an inset
   ring, and let the label + tick take the row's own per-theme text colour (set
   inline) instead of the panel's --text / --accent. */
.menu-item-themed:hover,
.menu-item-themed:focus-visible {
  box-shadow: inset 0 0 0 2px currentColor;
}
.menu-item-themed .menu-item-label,
.menu-item-themed .menu-item-check {
  color: inherit;
}
