.overlay {
  position: fixed;
  inset: 0;
  z-index: 99;
}

.dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 6px;
  width: min(440px, calc(100vw - 24px));
  min-width: 280px;
  max-height: min(70vh, 560px);
  background: var(--sidebar-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: 10px;
  padding: 0;
  z-index: 100;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.searchBar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 12px;
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}

.searchIcon {
  color: var(--text-dim);
  flex-shrink: 0;
}

.searchInput {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  padding: 0;
  min-width: 0;
}

.searchInput::placeholder {
  color: var(--text-dim);
}

/* Native clear "x" on type=search makes the focus ring jump in some
 * browsers; hide it and render our own button so spacing stays stable. */
.searchInput::-webkit-search-cancel-button {
  appearance: none;
}

.searchClearBtn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.searchClearBtn:hover {
  color: var(--text-primary);
  background: var(--hover-bg);
}

.scrollArea {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}

.section {
  padding: 2px 0 4px;
}

.section + .section {
  border-top: 1px solid var(--divider);
  margin-top: 6px;
  padding-top: 8px;
}

.groupHeader {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 6px;
}

.groupLabel {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Subtle pill that surfaces the dispatch path (e.g. "via Pi") next to
 * a section header. Visually quieter than `.groupLabel` so it reads as
 * metadata rather than competing with the section name. The Pi variant
 * picks up an accent tint so the "this section is sidecar-routed"
 * pattern is recognizable at a glance. */
.routingBadge {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--bg-secondary);
  border: 1px solid var(--divider);
  border-radius: 999px;
  padding: 1px 7px;
  line-height: 14px;
  white-space: nowrap;
}

.routingBadgePi {
  color: var(--accent-primary);
  background: rgba(var(--accent-primary-rgb), 0.08);
  border-color: rgba(var(--accent-primary-rgb), 0.28);
}

.subSection {
  margin-bottom: 2px;
}

.subSectionHeader {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 10px 2px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.subSectionCount {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 400;
}

.item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast), color var(--transition-fast);
  min-height: 34px;
}

.item:hover {
  background: var(--hover-bg);
}

.itemSelected {
  color: var(--accent-primary);
  background: var(--selected-bg);
}

.itemSelected:hover {
  background: var(--accent-bg-strong);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
  flex-shrink: 0;
}

.extraUsage {
  display: inline-flex;
  color: var(--text-dim);
  cursor: help;
  position: relative;
  top: -1px;
  flex-shrink: 0;
}

.modelLabel {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.providerBadge {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 11px;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check {
  margin-left: 4px;
  color: var(--accent-primary);
  font-size: 14px;
  flex-shrink: 0;
}

.shortcut {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 11px;
  font-family: var(--font-mono);
}

.moreToggle {
  color: var(--text-dim);
  padding-left: 22px;
  font-size: 12px;
}

.moreToggle:hover {
  color: var(--text-primary);
}

.showAllRow {
  padding: 5px 10px 5px 22px;
  color: var(--text-dim);
  font-size: 12px;
  min-height: 26px;
}

.showAllRow:hover {
  color: var(--accent-primary);
  background: var(--hover-bg-subtle);
}

.chevron {
  margin-left: auto;
  color: var(--text-dim);
  transition: transform var(--transition-fast);
}

.chevronOpen {
  transform: rotate(90deg);
}

.emptyState {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.emptyStateIcon {
  color: var(--text-dim);
  opacity: 0.6;
}
