.ts-wrapper {
    position: relative;
}

.ts-control,
.ts-control input,
.ts-dropdown {
    color: var(--color-smoky-gray-800);
    font-family: sans-serif;
    font-size: 1rem;
    line-height: 1.5;
}

/* Control styling */
.ts-control {
    border-width: 1px;
    border-style: solid;
    border-color: var(--color-smoky-gray-300);
    background-color: var(--color-light-oak-beige-100); /* Assume defined */
    padding: 0.5rem;
    border-radius: 0.375rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    overflow: hidden;
    position: relative;
    z-index: 10;
    box-shadow: none;
    width: 100%;
}

.ts-control:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-primary-amber-500); /* ring-2 ring-primary-amber-500 */
    border-color: var(--color-primary-amber-500);
}

.ts-wrapper.multi.has-items .ts-control {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.ts-wrapper.single .ts-control {
    cursor: text;
}

/* Inner input styling - key for full-width and visibility */
.ts-control > input {
    display: inline-block;
    padding: 0;
    min-height: 0;
    max-width: 100%;
    margin: 0;
    text-indent: 0;
    border-width: 0;
    background-color: transparent;
    flex-grow: 1;
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
    width: 100%;
    box-shadow: none !important;
}

.ts-control > input::placeholder {
    color: var(--color-smoky-gray-500);
}

.ts-control > input:focus {
    outline: none;
}

.has-items .ts-control > input {
    margin: 0;
    margin-left: 0.25rem;
    margin-right: 0.25rem;
    margin: 0 4px !important;
}

.ts-wrapper.plugin-input_autogrow.has-items .ts-control > input {
    min-width: 0;
}

.ts-wrapper.plugin-input_autogrow.has-items.focus .ts-control > input {
    display: flex;
    min-width: 4px;
}

/* Placeholder specific styling */
.ts-wrapper .placeholder {
    color: var(--color-smoky-gray-500);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    display: block;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0.5rem;
    pointer-events: none;
}

/* Ensure placeholder shows when empty and not focused */
.ts-wrapper:not(.has-items):not(.focus) .placeholder {
    display: block;
}

/* Hide placeholder when items present or focused (optional override) */
.ts-wrapper.has-items .placeholder,
.ts-wrapper.focus .placeholder {
    display: none; /* Change to display: block if you want it always visible */
}

/* Items (tags) */
.ts-wrapper.multi .ts-control > div {
    background-color: var(--color-smoky-gray-200);
    color: var(--color-smoky-gray-800);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    border-radius: 0.375rem;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    cursor: default;
}

.ts-wrapper.multi .ts-control > div.active {
    background-color: var(--color-smoky-gray-300);
}

/* Dropdown */
.ts-dropdown {
    position: absolute;
    z-index: 50;
    width: 100%;
    background-color: white;
    border-width: 1px;
    border-style: solid;
    border-color: var(--color-smoky-gray-300);
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    margin-top: 0.25rem;
    overflow: hidden;
}

.ts-dropdown .option {
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    cursor: pointer;
}

.ts-dropdown .option:hover {
    background-color: var(--color-smoky-gray-100);
}

.ts-dropdown .option.selected {
    background-color: var(--color-smoky-gray-200);
}

/* Remove button plugin */
.plugin-remove_button .item .remove {
    margin-left: 0.25rem;
    color: var(--color-smoky-gray-500);
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

.plugin-remove_button .item .remove:hover {
    color: var(--color-smoky-gray-700);
}

/* Other plugins and states */
.ts-wrapper.disabled .ts-control {
    background-color: var(--color-smoky-gray-100);
    cursor: not-allowed;
}

/* Additional from Tailwind UI theme adaptations */
.ts-wrapper.plugin-remove_button .item {
    border-radius: 0.375rem;
}

.ts-wrapper.multi .ts-control > div {
    padding: 0;
    margin: 0;
    padding-left: 0.25rem;
}

.ts-wrapper.plugin-remove_button .item .remove {
    border: none;
    font-size: 1.125rem;
    line-height: 1;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

.ts-dropdown [data-selectable].option, .ts-dropdown .no-results {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.ts-dropdown [data-selectable].option:first-child {
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
}

.ts-dropdown [data-selectable].option:last-child {
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

.ts-dropdown .create:hover, .ts-dropdown .option:hover, .ts-dropdown .active {
    background-color: var(--color-primary-amber-100); /* Assume defined */
    color: var(--color-primary-amber-900);
}

.ts-dropdown .spinner {
    height: auto;
    width: auto;
}

.ts-dropdown .spinner:after {
    height: 1.25rem;
    width: 1.25rem;
    border-width: 2px;
    padding: 0;
    margin-top: 0;
    margin-bottom: 0;
    display: inline-block;
}
/* Grouped options (e.g. profile taste preferences) + checkbox_options plugin */
.ts-dropdown .optgroup-header {
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-smoky-gray-500);
    background-color: var(--color-smoky-gray-50, #f9fafb);
}

.ts-dropdown .option input[type="checkbox"] {
    margin-right: 0.5rem;
    pointer-events: none;
}
