[role='combobox'] input {
  width: 100%;
  min-height: 1.75em;
  height: 100%;
  border: none;
  background: transparent;
}

// Popup
[role='combobox'] {
  [role='grid'],
  [role='listbox'] {
    list-style: none;
    margin: 0;
    padding: 0.5rem;
    min-width: 20ch;
    max-width: 80vw;
    overflow: hidden auto;
    max-height: 16rem;
  }

  // Reset cursor (see input.scss)
  [role='listbox'],
  [role='grid'] {
    cursor: initial;
  }
}

// Options
[role='combobox'] {
  [role='separator'] {
    background: var(--text-color-muted);
    height: 1px;
    margin: 0.5rem 1rem;
  }

  // Option Groups
  [role='group'] {
    margin-bottom: 0.5rem;

    > [id] {
      font-weight: 700;
      margin-bottom: 0.25rem;
    }
  }

  // Options
  [role='row'],
  [role='option'] {
    display: flex;
    align-items: center;
    min-height: 1.5rem;
    border-radius: 0.25rem;
    padding: 0 0.5rem;
    white-space: nowrap;
    overflow: hidden;

    &[aria-expanded='true'],
    &:hover {
      color: var(--text-color-strong);
    }

    &[data-focused='true'] {
      color: var(--text-color-strong);
      background: var(--hover-color);
    }

    &::before {
      content: '';
      width: 1em;
      height: 1em;
      margin-right: 0.5rem;
      flex-shrink: 0;
    }

    &[aria-selected='false']::before {
      background-color: var(--text-color-muted);
      mask-image: url(~resources/icons/select-all.svg);
      -webkit-mask-image: url(~resources/icons/select-all.svg);
    }

    &[aria-selected='true']::before {
      background-color: var(--text-color);
      mask-image: url(~resources/icons/select-all-checked.svg);
      -webkit-mask-image: url(~resources/icons/select-all-checked.svg);
    }

    [role='gridcell'] {
      &[data-cell-focused='true'] {
        outline: 1px solid var(--text-color);
        outline-offset: 2;
      }

      &:first-child {
        display: flex;
        align-items: center;
      }
    }
  }
}

.combobox-popup-option-icon {
  display: inline-block;
  margin-right: 0.25rem;
  max-height: 1rem;
  max-width: 1rem;
}
