/* Toggle Chip Component */
.toggle-chip-wrapper {
  display: inline-block;
}

.toggle-chip-label {
  cursor: pointer;
  display: block;
  -webkit-tap-highlight-color: transparent;
}

.toggle-chip-input {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 2.75rem; /* 44px — touch-friendly */
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  border: 2px solid rgb(209 213 219); /* gray-300 */
  background-color: white;
  color: rgb(107 114 128); /* gray-500 */
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

/* Checkmark icon (hidden by default) */
.toggle-chip::before {
  content: '';
  display: inline-block;
  width: 0;
  height: 1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transition: width 0.15s ease-in-out;
  flex-shrink: 0;
}

.toggle-chip:hover {
  border-color: #4292C6;
  color: #4292C6;
}

/* Checked state */
.toggle-chip-input:checked ~ .toggle-chip {
  background-color: #4292C6;
  border-color: #4292C6;
  color: white;
  box-shadow: 0 1px 3px 0 rgb(66 146 198 / 0.3), 0 1px 2px -1px rgb(66 146 198 / 0.3);
}

.toggle-chip-input:checked ~ .toggle-chip::before {
  width: 1rem;
}

/* Focus state for accessibility */
.toggle-chip-input:focus-visible ~ .toggle-chip {
  outline: 2px solid #4292C6;
  outline-offset: 2px;
}

.toggle-chip-text {
  line-height: 1;
}
