.ai-ticket-suggestion-container {
    border: 1px dashed var(--primary-color, #8e24aa) !important;
    background-color: #f9f9fc !important;
    margin-bottom: 1.25rem;
    border-radius: 0.5rem;
    box-shadow: none !important;
}

.ai-ticket-suggestion-inner {
    padding: 1rem 0 0.625rem 0;
}

.ai-ticket-suggestion-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 500;
}

.ai-ticket-suggestion-title-icon {
    color: var(--primary-color, #8e24aa);
    font-size: 1.5rem;
    vertical-align: middle;
}

.ai-ticket-suggestion-subtitle {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.ai-ticket-suggestion-loading-state {
    padding: 1.5rem 0;
}

.ai-ticket-suggestion-loading-text {
    margin: 0.75rem 0 0 0;
    font-size: 0.85rem;
}

.ai-ticket-suggestion-spinner {
    border-color: var(--primary-color, #8e24aa) !important;
}

.ai-ticket-suggestion-error-state {
    padding: 1.25rem 0;
}

.ai-ticket-suggestion-error-icon {
    font-size: 2.5rem;
    vertical-align: middle;
}

.ai-ticket-suggestion-error-text {
    margin: 0.625rem 0 1rem 0;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
}

.ai-ticket-suggestion-footer {
    border-top: 1px solid #e0e0e0;
    padding-top: 0.75rem;
    margin-top: 1rem;
}

.ai-ticket-suggestion-btn-dismiss {
    text-transform: none;
    border-radius: 0.25rem;
    box-shadow: none;
}

.ai-ticket-suggestion-btn-submit {
    background-color: var(--primary-color, #8e24aa) !important;
    text-transform: none;
    border-radius: 0.25rem;
}

.ai-ticket-suggestion-btn-submit .material-icons {
    font-size: 1rem;
    margin-right: 0.25rem;
}

/* Override black borders from form render styles; match the gray card used by the manual ticket modal */
.ai-ticket-suggestion-container .render-wrap-container {
    background-color: #f3f3f3;
    border: 1px solid #eeeeee !important;
    border-top: 1px solid #eeeeee !important;
    border-bottom: 1px solid #eeeeee !important;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0 !important;
}

/* Metadata row (Name + Workflow Description) inside gray card */
.ai-ticket-suggestion-container .loaded-workflow-metadata label {
    font-size: 0.85rem;
    color: #9e9e9e;
}

.ai-ticket-suggestion-container .loaded-workflow-metadata .muted-text {
    color: #616161;
    font-size: 1rem;
    margin-top: 0.25rem;
    line-height: 1.5;
}

/* Textarea sizing inside form render area */
.ai-ticket-suggestion-container .render-wrap textarea {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    min-height: 5rem !important;
    box-sizing: border-box !important;
    display: block !important;
}

.ai-ticket-suggestion-container .render-wrap .rendered-form > div,
.ai-ticket-suggestion-container .render-wrap .form-group {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
}

/* ============================================================
   Dropdown / Select2 styling — mirrors .createManualTicket
   ============================================================ */

/* browser-default <select> fallback (pre-Select2 or disabled) */
.ai-ticket-suggestion-container select.browser-default {
    display: block;
    width: 100%;
    height: 2.625rem;
    padding: 0 0.875rem;
    font-size: 0.95rem;
    color: #4a5568;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23718096' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    background-size: 0.75rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    outline: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.ai-ticket-suggestion-container select.browser-default:focus {
    border-color: #a0aec0;
    box-shadow: 0 0 0 1px #a0aec0;
}

.ai-ticket-suggestion-container select.browser-default:disabled {
    background-color: #f7fafc;
    cursor: not-allowed;
}

/* Single-select Select2 (Channel, Priority, Workflow) */
.ai-ticket-suggestion-container .select2-container--default .select2-selection--single {
    height: 2.625rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23718096' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    background-size: 0.75rem 0.75rem;
    outline: none;
    transition: all 0.2s ease;
}

.ai-ticket-suggestion-container .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #4a5568;
    font-size: 0.95rem;
    padding-left: 0.875rem;
    padding-right: 2.125rem;
    line-height: 2.5rem;
}

.ai-ticket-suggestion-container .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #9e9e9e;
}

/* Hide Select2's own arrow — the SVG background-image acts as the chevron */
.ai-ticket-suggestion-container .select2-container--default .select2-selection--single .select2-selection__arrow {
    display: none !important;
}

.ai-ticket-suggestion-container .select2-container--default.select2-container--focus .select2-selection--single,
.ai-ticket-suggestion-container .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #a0aec0;
    box-shadow: 0 0 0 1px #a0aec0;
}

/* Disabled Select2 (Workflow — read-only after AI fills it) */
.ai-ticket-suggestion-container .select2-container--disabled .select2-selection--single {
    background-color: #f7fafc !important;
    cursor: not-allowed;
}

/* Multi-select Select2 (Labels) - Mirrors #createTicket exactly */
.ai-ticket-suggestion-container .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
    margin-bottom: 0;
}
.ai-ticket-suggestion-container .select2-container--default .select2-selection--multiple .select2-search--inline {
    margin-top: 0;
}
.ai-ticket-suggestion-container .select2-container--default .select2-selection--multiple .select2-search__field {
    border: none !important;
    box-shadow: none !important;
    height: 32px !important;
    line-height: 32px !important;
    margin-top: 4px !important;
    margin-bottom: 4px !important;
    font-family: inherit;
    color: #495057 !important;
}
.ai-ticket-suggestion-container .select2-container--default .select2-selection--multiple .select2-search__field::placeholder {
    color: #a0aec0;
}
.ai-ticket-suggestion-container .select2-selection__choice {
    margin-top: 4px !important;
    margin-bottom: 4px !important;
    background-color: #f1f3f5 !important;
    border: 1px solid #ced4da !important;
    color: #495057 !important;
    border-radius: 3px !important;
    padding: 2px 6px !important;
}

/* Container styling */
.ai-ticket-suggestion-container .select2-container--default .select2-selection--multiple {
    display: flex !important;
    align-items: center;
    flex-wrap: nowrap;
    padding: 0 14px !important;
    min-height: 42px !important;
    overflow: hidden;
    border: 1px solid #e2e8f0 !important;
    border-radius: 0.375rem !important;
    background-color: #fff !important;
}
.ai-ticket-suggestion-container .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-wrap: nowrap;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 100%;
    width: 100% !important;
    flex-grow: 1 !important;
    text-align: left !important;
}

/* Remove tag pill appearance — show as plain inline text */
.ai-ticket-suggestion-container .select2-selection__choice {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    color: #4a5568 !important;
    font-size: 0.95rem;
    line-height: 40px;
    display: inline !important;
    float: none !important;
}
/* Add comma separator between labels */
.ai-ticket-suggestion-container .select2-selection__choice + .select2-selection__choice::before {
    content: ",\00a0";
}
/* Hide the × remove button on each tag */
.ai-ticket-suggestion-container .select2-selection__choice__remove {
    display: none !important;
}

/* Hide inline search input (search is in the dropdown via DropdownSearch adapter)
   Only hide it when there are selections so the placeholder remains visible when empty */
.ai-ticket-suggestion-container .select2-container--default .select2-selection--multiple:has(.select2-selection__choice) .select2-search--inline {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Disable pointer events on the inline search so it acts as a click-through to open the dropdown.
   Force flex-grow so it spans the remaining space, ensuring the placeholder stays left-aligned. */
.ai-ticket-suggestion-container .select2-container--default .select2-selection--multiple .select2-search--inline {
    float: left !important;
    pointer-events: none !important;
    flex-grow: 1 !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    position: static !important;
    opacity: 1 !important;
}

.ai-ticket-suggestion-container .select2-container--default .select2-selection--multiple .select2-search__field {
    font-family: 'Poppins', 'Segoe UI', sans-serif !important;
    font-size: 0.95rem !important;
    text-align: left !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 40px !important;
    line-height: 40px !important;
    width: 100% !important;
    color: #4a5568 !important;
}

.ai-ticket-suggestion-container .select2-container--default .select2-selection--multiple .select2-search__field::placeholder {
    font-family: 'Poppins', 'Segoe UI', sans-serif !important;
    font-size: 0.95rem !important;
    font-weight: 400 !important;
    color: #a0aec0 !important;
    text-align: left !important;
}

.ai-ticket-suggestion-container .select2-results__options {
    position: relative;
}

/* Labels dropdown results: match font to other modal dropdowns */
.ai-ticket-suggestion-container .select2-results__option {
    font-size: 0.95rem;
    color: #4a5568;
    font-family: inherit;
}
.ai-ticket-suggestion-container .select2-results__option label span {
    font-size: 0.95rem !important;
    color: #4a5568 !important;
}

/* Standardize Select2 dropdown placeholders in Create Ticket modal */
.ai-ticket-suggestion-container .select2-container--default .select2-selection__placeholder,
.ai-ticket-suggestion-container .select2-container--default .select2-search--inline .select2-search__field::placeholder {
    color: #9e9e9e !important;
    font-weight: 400 !important;
    font-family: inherit !important;
}

.ai-ticket-suggestion-container .select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
    text-align: left !important;
    color: #9e9e9e !important;
    font-weight: 400 !important;
    font-family: inherit !important;
    margin-top: 0 !important;
    padding-left: 0 !important;
    width: 100% !important;
}

.ai-ticket-suggestion-container .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    padding-left: 0 !important;
    width: auto !important;
    flex: 0 1 auto !important;
}
