.choices,
.choices__inner,
.choices__button,
.choices__input,
.choices__input--cloned,
select.choices__input {
    cursor: pointer !important;
}

.choices__inner {
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0;
    font-size: 0.875rem;
    min-height: 2.5rem;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.choices__inner:focus-within {
    outline: none;
    border-color: #56aa1c;
    box-shadow: 0 0 0 3px rgba(86, 170, 28, 0.15);
}

.choices__input {
    background-color: transparent;
    border: none;
    font-size: 0.875rem;
    padding: 0;
    margin: 0;
}

.choices__input:focus {
    outline: none;
}

/* Single select item styling */
.choices__item--selectable {
    background-color: transparent;
    border: none;
    color: #374151;
    font-size: 0.875rem;
    padding: 0;
}

/* Dropdown option styling - fix hover text visibility */
.choices__item--choice {
    background-color: #ffffff;
    border: none;
    color: #374151;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
}

.choices__item--choice:hover {
    background-color: #f3f4f6 !important;
    color: #1f2937 !important;
}

.choices__item--choice.is-highlighted {
    background-color: #56aa1c !important;
    color: white !important;
}

/* Selected items in multi-select */
.choices__list--multiple .choices__item {
    background-color: #56aa1c;
    border: 1px solid #56aa1c;
    border-radius: 1rem;
    color: white;
    font-size: 0.75rem;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    padding: 0.25rem 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
}

/*remove button visibility and styling - single X only */
.choices__button {
    border: none !important;
    color: currentColor !important;
    cursor: pointer !important;
    font-size: 1rem !important;
    font-weight: normal !important;
    height: 1.25rem !important;
    line-height: 1 !important;
    margin-left: 0.5rem !important;
    opacity: 0.8 !important;
    padding: 0 !important;
    width: 1.25rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
}

/* Hide any existing content and show only one X - but not for multi-select items */
.choices__item--selectable .choices__button * {
    display: none !important;
}

.choices__button::before {
    content: '×' !important;
    font-size: 1.125rem !important;
    line-height: 1 !important;
    display: block !important;
}

.choices__button:hover {
    opacity: 1 !important;
}

.choices__button:focus {
    outline: none !important;
}

/* Remove button for single-select items */
.choices__list--single .choices__item--selectable .choices__button {
    background-image: none;
}

.choices__item--selectable .choices__button:hover {
    color: #374151 !important;
}

/* Remove button for multi-select items - ensure visibility with highest specificity */
.choices__list .choices__item--selected .choices__button {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 50% !important;
    width: 1.25rem !important;
    height: 1.25rem !important;
    margin-left: 0.5rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    opacity: 1 !important;
    position: relative !important;
}

/* Hide any existing content in multi-select buttons */
.choices__list .choices__item--selected .choices__button * {
    display: none !important;
}

/* Ensure the X is visible in multi-select items - highest specificity */
.choices__list .choices__item--selected .choices__button::before {
    content: '×' !important;
    font-size: 1rem !important;
    line-height: 1 !important;
    display: block !important;
    color: white !important;
    font-weight: bold !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

.choices__list .choices__item--selected .choices__button:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

.choices__list .choices__item--selected .choices__button:hover::before {
    color: white !important;
}

/* Dropdown styling */
.choices__list--dropdown {
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    z-index: 1000;
}

/* Limit the height on the inner option list, which is the element Choices scrolls. Capping the outer
   dropdown instead clips the list's last options: the outer box also holds the search input, and
   Choices' own `.choices__list[aria-expanded] { overflow: hidden }` outranks an overflow rule here. */
.choices__list--dropdown .choices__list,
.choices__list[aria-expanded] .choices__list {
    max-height: 15rem;
    overflow-y: auto;
}

/* Option group styling */
.choices__group .choices__heading {
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Placeholder styling */
.choices__placeholder {
    color: #9ca3af;
    opacity: 1;
}

/* No results/choices text */
.choices__item--disabled {
    color: #9ca3af;
    font-style: italic;
}

.choices.is-focused .choices__inner {
    border-color: #56aa1c;
    box-shadow: 0 0 0 3px rgba(86, 170, 28, 0.15);
}

/* Open state */
.choices.is-open .choices__inner {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.choices.is-open .choices__list--dropdown {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: none;
}
