.wrapper {
  position: relative;
}

.input {
  padding-inline-end: 45px;
}

.menuButton {
  position: absolute;
  inset-inline-end: 1px;
  top: 1px;
  padding: 7px;

  &::before {
    // Subtle divider line separating the button from the input field
    content: '';
    position: absolute;
    inset-inline-start: 0;
    inset-block: 10px;
    border-inline-start: 1px solid var(--color-border-primary);
  }
}

.popover {
  z-index: 9999;
  box-sizing: border-box;
  max-height: min(320px, 50dvh);
  border-radius: 4px;
  color: var(--color-text-primary);
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border-primary);
  box-shadow: var(--dropdown-shadow);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-gutter: stable;
  overscroll-behavior-y: contain;
}

.groupTitle {
  padding: 8px 16px 4px;
  font-size: 13px;
  font-weight: bold;
  text-transform: uppercase;
}

.menuItem {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  margin-inline: 4px;
  gap: 12px;
  font-size: 14px;
  line-height: 20px;
  border-radius: 4px;
  color: var(--color-text-primary);
  cursor: pointer;
  user-select: none;

  &:first-child {
    margin-top: 4px;
  }

  &:last-child {
    margin-bottom: 4px;
  }

  &[data-highlighted='true'] {
    background: var(--color-bg-highlight);
  }

  &[aria-disabled='true'] {
    color: var(--color-text-disabled);
    cursor: not-allowed;
  }
}

.emptyMessage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 16px;
  font-size: 13px;
}

.loadingIndicator {
  --spinner-size: 20px;

  position: relative;
  display: block;
  width: var(--spinner-size);
  height: var(--spinner-size);
  overflow: hidden;

  & :global(.circular-progress) {
    width: var(--spinner-size);
    height: var(--spinner-size);
  }
}
