.menu {
  position: absolute;
  bottom: calc(100% + 4px);
  /* The overlay anchor is exactly the composer card's width; both insets pin
     the menu edge to edge with border and padding kept inside. */
  left: 0;
  right: 0;
  z-index: 100;
  /* Height cap: the 320px design maximum, clamped at runtime to the space
   * above the composer (inline max-height set in MenuView.tsx). */
  max-height: 320px;
  overflow: hidden;
  /* Elevated surface: the scrollbar thumb takes the l2 elevation tokens
     (see ui-theme styles/scrollbar.css for the rebinding contract). */
  --dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2);
  --dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2);
  padding: 4px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--dsw-alias-border-inverted);
  border-radius: 12px;
  background: var(--dsw-specific-menu);
  box-shadow: var(--dsw-shadow-lv3);
}

.viewport {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

.item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 22px;
  color: var(--dsw-alias-label-primary);
  text-align: left;
}

/* One shared highlight: pointer motion parks it here through the hover event,
   so there is no separate :hover tint competing with the keyboard's. */
.item.active {
  background: var(--dsw-alias-interactive-bg-hover);
}

.sectionTitle {
  flex: none;
  min-height: 26px;
  padding: 6px 10px 2px;
  color: var(--dsw-alias-label-tertiary);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
}

.sectionTitle:not(:first-child) {
  margin-top: 4px;
}

.itemIcon {
  display: inline-flex;
  flex: none;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  color: var(--dsw-alias-label-tertiary);
}

.itemName {
  flex: none;
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.itemDescription {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--dsw-alias-label-tertiary);
}

/* Trailing seat on drillable rows (directories): the Tab keycap hint plus the
   drill chevron, revealed while the row holds the shared highlight. */
.trailing {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

/* Hint naming the keyboard twin of the chevron — a caption line plus a Tab
   keycap: Tab drills the highlighted row. Hidden at rest so idle rows stay
   quiet. */
.drillHintText {
  display: none;
  color: var(--dsw-alias-label-caption);
  font-size: 11px;
  line-height: 18px;
  white-space: nowrap;
}

.drillHint {
  display: none;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--dsw-alias-interactive-bg-hover);
  color: var(--dsw-alias-label-caption);
  font-family: inherit;
  font-size: 11px;
  line-height: 18px;
}

.item.active .drillHintText,
.item.active .drillHint {
  display: inline-flex;
}

/* Descent affordance: a quiet chevron that brightens on its own hover,
   separate from the row pick. */
.drill {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  /* label-caption, the quiet tint the composer's access-mode chevron uses. */
  color: var(--dsw-alias-label-caption);
}

.drill:hover {
  background: var(--dsw-alias-interactive-bg-hover);
  color: var(--dsw-alias-label-primary);
}

/* Heading row above a source group: non-interactive small grey text,
 * padding aligned with items (mirrors ui-primitives Menu .label). */
.groupTitle {
  padding: 8px 10px;
  font-size: 12px;
  line-height: 16px;
  color: var(--dsw-alias-label-tertiary);
}

/* Pending-source skeleton rows: item cell metrics around a breathing bar
   (deepsuite Skeleton text variant: 2s color pulse; here the single
   bg-skeleton token pulses through opacity instead of a second color). */
.skeletonRow {
  display: flex;
  align-items: center;
  /* border-box so min-height matches the .item buttons, whose UA default
     box-sizing already counts the same 8px paddings inside their 40px. */
  box-sizing: border-box;
  min-height: 40px;
  padding: 8px 10px;
}

.skeletonBar {
  height: 20px;
  border-radius: 4px;
  background: var(--dsw-alias-bg-skeleton);
  animation: dsh-menu-skeleton 2s cubic-bezier(0.36, 0, 0.64, 1) infinite;
}

@keyframes dsh-menu-skeleton {
  0% { opacity: 1; }
  40% { opacity: 0.6; }
  80%, 100% { opacity: 1; }
}

/* Breadcrumb header of a drilled source: pinned outside .viewport so the
   descent stays reversible while the candidate list scrolls under it. */
.crumbs {
  flex: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  padding: 4px 6px 6px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--dsw-alias-border-inverted);
}
/* Crumbs sit outside the listbox and take no keyboard highlight, so unlike
   .item they carry their own :hover tint with nothing to compete with. */
.crumb {
  flex: 0 1 auto;
  max-width: 40%;
  overflow: hidden;
  padding: 2px 6px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--dsw-alias-label-tertiary);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crumb:hover {
  background: var(--dsw-alias-interactive-bg-hover);
  color: var(--dsw-alias-label-primary);
}
/* The step the list is already showing reads as a label, not an action. */
.crumbCurrent,
.crumbCurrent:hover {
  background: transparent;
  color: var(--dsw-alias-label-primary);
  cursor: default;
}
.crumbSeparator {
  flex: none;
  display: inline-flex;
  color: var(--dsw-alias-label-caption);
}
