.ui-select {
  position: relative;
  width: 100%;
}

.ui-select-native {
  height: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  width: 0;
}

.ui-select-control {
  align-items: center;
  appearance: none;
  background: var(--color-surface-default);
  border: 1px solid var(--color-border-default);
  border-radius: 0.75rem;
  color: var(--color-text-primary);
  cursor: pointer;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  min-height: 44px;
  padding: 0.55rem 0.75rem 0.55rem 0.95rem;
  text-align: left;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  width: 100%;
}

.ui-select-control:focus-visible {
  border-color: var(--color-brand-focus);
  box-shadow: 0 0 0 3px var(--color-focus-ring-strong);
  outline: none;
}

.ui-select-control:disabled {
  color: var(--color-text-faint);
  cursor: not-allowed;
}

.ui-select-value-wrapper {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

.ui-select-placeholder {
  color: var(--color-text-faint);
}

.ui-select-chip {
  background: var(--color-surface-muted);
  border-radius: 999px;
  color: var(--color-text-primary);
  display: inline-flex;
  font-size: 0.875rem;
  line-height: 1;
  padding: 0.35rem 0.6rem;
}

.ui-select-arrow-zone {
  align-items: center;
  color: var(--color-text-secondary);
  display: inline-flex;
  flex: 0 0 auto;
  justify-content: center;
}

.ui-select-arrow-icon {
  height: 1rem;
  transition: transform 0.2s ease;
  width: 1rem;
}

.ui-select.is-open .ui-select-arrow-icon {
  transform: rotate(180deg);
}

.ui-select-menu {
  background: var(--color-surface-default);
  border: 1px solid var(--color-border-default);
  border-radius: 0.9rem;
  box-shadow: var(--shadow-surface-md);
  display: grid;
  gap: 0.25rem;
  left: 0;
  margin-top: 0.45rem;
  max-height: 16rem;
  overflow-y: auto;
  padding: 0.4rem;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 30;
}

.ui-select-menu[hidden] {
  display: none;
}

.ui-select-option {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 0.7rem;
  color: var(--color-text-primary);
  cursor: pointer;
  display: flex;
  font: inherit;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.7rem 0.8rem;
  text-align: left;
  width: 100%;
}

.ui-select-option:hover,
.ui-select-option:focus-visible {
  background: var(--color-surface-muted);
  outline: none;
}

.ui-select-option.is-selected {
  background: var(--color-status-info-soft-bg);
  color: var(--color-text-brand);
}

.ui-select-option:disabled {
  color: var(--color-text-faint);
  cursor: not-allowed;
}

.ui-select-option-text {
  flex: 1 1 auto;
}

.ui-select-option-check {
  color: currentColor;
  opacity: 0;
}

.ui-select-option.is-selected .ui-select-option-check {
  opacity: 1;
}
