@import url("https://esm.sh/tom-select@2.4.3/dist/css/tom-select.min.css");

.ts-control {
  align-items: center;
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md);
  box-shadow: var(--input-box-shadow, var(--shadow-xs));
  min-block-size: var(--size-9);
  color: var(--color-text);
  display: inline-flex;
  font-size: var(--text-sm);
  line-height: inherit;
  padding: var(--size-1_5) var(--size-3);

  > input {
    color: inherit;
    font-size: inherit;
  }

  /*
   * for mobile, set font-size to text-base again, to avoid the input being too small
   * and the mobile browsers zooming in on the input when the input is focused or tapped
   */
  @media (max-width: 768px) {
    font-size: var(--text-base);
  }
}

.ts-dropdown {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-md);
  box-shadow: var(--shadow-md);
  color: var(--color-text);
  font-size: var(--text-sm);
  line-height: inherit;

  /* Setup transition */
  transition-behavior: allow-discrete;
  transition-duration: var(--time-150);
  transition-property: display, opacity, transform;

  /* Exit stage to */
  opacity: 0;
  transform: var(--scale-95);

  /* On stage */
  .dropdown-active & {
    opacity: 1;
    transform: var(--scale-100);
  }

  /* Enter stage from */
  @starting-style {
    .dropdown-active & {
      opacity: 0;
      transform: var(--scale-95);
    }
  }

  .ts-dropdown-content:not(:has(.optgroup)) {
    padding: var(--size-1);
  }

  .optgroup:not(:first-child) {
    border-block-start-width: var(--border);
  }

  .optgroup {
    padding: var(--size-1);
  }

  .optgroup-header {
    background-color: inherit;
    color: var(--color-text-subtle);
    font-size: var(--text-xs);
    padding: var(--size-1_5) var(--size-2);
  }

  .create {
    padding: var(--size-1_5) var(--size-2);
  }

  .option {
    border: 1px solid transparent;
    border-radius: var(--rounded-md);
    padding: var(--size-1_5) var(--size-2);
  }

  .active {
    background-color: var(--color-secondary);
    color: inherit !important;
  }

  .highlight {
    background-color: transparent !important;
  }

  .spinner {
    margin: var(--size-1_5) 0 0;
  }

  .spinner::after {
    border-block-color: var(--color-border-dark);
  }
}

.ts-wrapper.single .ts-control {
  background-color: var(--color-bg) !important;
  background-image: url("/assets/select-arrow-008fd2da.svg") !important;
  background-position: center right var(--size-2) !important;
  background-repeat: no-repeat !important;
  background-size: var(--size-4) auto !important;
}

.ts-wrapper.multi .ts-control > .item {
  background: var(--color-secondary);
  border-radius: var(--rounded-md);
  color: inherit;
  line-height: var(--leading-tight);
}

.disabled .ts-control {
  opacity: var(--opacity-50);
}

.disabled .ts-control * {
  cursor: not-allowed !important;
}

.invalid .ts-control {
  border-color: var(--color-negative);
}

[data-controller~="combobox"] {
  clip: rect(0 0 0 0);
  position: absolute;
}
