.root {
  position: relative;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-shrink: 0;

  &-label {
    position: relative;
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
    height: 28px;
    padding: 6px 15px 6px 12px;
    line-height: 1.5;
    border-radius: var(--alinea-border-radius);
    background: var(--alinea-fields);
    box-shadow: var(--alinea-fields-shadow);
    cursor: text;

    &-icon {
      flex-shrink: 0;
    }

    &:focus-within {
      background: var(--alinea-fields-selected);
      outline: 2px solid var(--alinea-fields-focus);
    }

    &-input {
      border: none;
      outline: none;
      background: transparent;
      color: inherit;
      font: inherit;
      font-size: 13px;
      width: 100%;
    }
  }

  &-popover {
    position: absolute;
    top: 100%;
    left: 10px;
    right: 10px;
    min-height: 55px;
    max-height: 300px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: auto;
    border-radius: 0.5rem;
    padding: 5px;
    border-radius: var(--alinea-border-radius);
    background: var(--alinea-background);
    border: 1px solid var(--alinea-outline);
    box-shadow: 0 2px 10px var(--alinea-shadow);

    &::-webkit-scrollbar {
      width: 12px;
      height: 4px;
    }
    &::-webkit-scrollbar-track {
      background: transparent; //var(--alinea-outline);
    }
    &::-webkit-scrollbar-thumb {
      background: hsla(var(--alinea-negative), 0.2);
      border: 4px solid rgba(0, 0, 0, 0);
      background-clip: padding-box;
    }
    &::-webkit-scrollbar-thumb:hover {
      background-color: hsla(var(--alinea-negative), 0.4);
    }
    &::-webkit-scrollbar-thumb:active {
      background-color: hsla(var(--alinea-negative), 0.9);
    }

    &:empty {
      display: none;
    }

    &-item {
      display: flex;
      cursor: default;
      scroll-margin: 0.5rem;
      align-items: center;
      border-radius: 0.25rem;
      padding: 4px 8px;
      color: inherit;
      text-decoration: none;
      font-size: 13px;
      width: 100%;
      flex-shrink: 0;

      &:hover {
        background: var(--alinea-selected);
      }

      &[aria-selected] {
        background: var(--alinea-inner-outline);
        color: var(--alinea-focus-foreground);
        color: white;
      }
    }
  }
}
