.choice-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--spacing-md);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
}

/* The legend names the group for screen readers; the chips already say what they filter. */
.choice-chips__legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.choice-chips__chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: var(--spacing-10);
  padding: 0 var(--spacing-5);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-tight);
  white-space: nowrap;
  color: var(--gray-700);
  background-color: var(--gray-25);
  border: var(--border-width-thin) var(--border-style-solid) var(--gray-300);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.choice-chips__chip:hover {
  background-color: var(--gray-50);
}

.choice-chips__chip:has(.choice-chips__input:focus-visible) {
  outline: var(--border-width-medium) var(--border-style-solid) var(--primary-300);
  outline-offset: var(--spacing-1);
}

.choice-chips__chip:has(.choice-chips__input:checked) {
  color: var(--primary-700);
  background-color: var(--primary-50);
  border-color: var(--primary-200);
}

.choice-chips__chip:has(.choice-chips__input:disabled) {
  cursor: not-allowed;
  opacity: 0.5;
}

.choice-chips__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
