.ai-import-url {
    width: 100%;
}

.ai-import-textarea {
    min-height: 140px;
    width: 100%;
}

.ai-import-editor {
    min-height: 220px;
    width: 100%;
}

.ai-alert {
    margin-bottom: 0.75rem;
}

.ai-ai-note {
    color: #475569;
}

.ai-ingredient-preview {
    border-top: 1px solid #e5e7eb;
    padding-top: 0.75rem;
}

.ai-ingredient-group {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
}

.ai-ingredient-group-title {
    color: #0f172a;
    font-weight: 600;
}

.ai-ingredient-group .connected-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ai-ingredient-row--matched {
    background: #dcfce7;
    border-radius: 8px;
    border: 1px solid #22c55e;
}

.ai-ingredient-group .connected-form > .connected-row > .ai-ingredient-summary {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 30%;
    min-width: 0;
    overflow: hidden;
    text-align: left;
}

.ai-ingredient-group .connected-form > .connected-row > .ai-ingredient-controls {
    width: 70%;
    min-width: 0;
}

.ai-ingredient-group .connected-form > .connected-row > .ai-ingredient-summary .ai-ingredient-name,
.ai-ingredient-group .connected-form > .connected-row > .ai-ingredient-summary .ai-ingredient-status {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-ingredient-group .connected-form > .connected-row {
    border-top: 1px solid #f1f5f9;
}

.ai-ingredient-group .connected-form > .connected-row:first-of-type {
    border-top: none;
}

.ai-ingredient-group .connected-form > .connected-row {
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: space-between;
}

.ai-ingredient-name {
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-right: 0.25rem;
    color: #0f172a;
    font-weight: 500;
}

.ai-ingredient-unit--missing {
    background: #fee2e2;
    color: #ef4444;
    font-weight: 600;
    padding: 0.1rem 0.35rem;
    border-radius: 6px;
}

.ai-ingredient-status {
    color: #475569;
    font-size: 0.85rem;
}

.ai-ingredient-group .connected-form > .connected-row > .ai-ingredient-controls {
    padding: 0.25rem;
    min-width: 320px;
}

.ai-ingredient-group .connected-form > .connected-row > .ai-ingredient-summary,
.ai-ingredient-group .connected-form > .connected-row > .ai-ingredient-controls {
    margin-left: 0.5rem;
}

.ai-ingredient-controls {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-end;
}

.ai-ingredient-controls > * + * {
    margin-left: -1px;
}

.ai-ingredient-mode-switch {
    flex: 0 0 120px;
    min-width: 120px;
}

.ai-ingredient-mode-switch .jans-vertical-switch {
    --jans-vertical-switch-height: 46px;
    height: 46px;
}

.ai-ingredient-controls .ai-ingredient-product-select,
.ai-ingredient-controls .ai-ingredient-unit-select,
.ai-ingredient-controls .ai-ingredient-product-select .rz-dropdown-label,
.ai-ingredient-controls .ai-ingredient-unit-select .rz-dropdown-label {
    min-height: 46px;
    height: 46px;
}

.ai-ingredient-controls .ai-ingredient-product-select,
.ai-ingredient-controls .ai-ingredient-unit-select {
    flex: 1 1 auto;
    min-width: 0;
}

.ai-ingredient-icon-actions {
    display: flex;
    flex: 1 1 auto;
    align-items: stretch;
}

.ai-ingredient-icon-actions .rz-button {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    height: 46px !important;
    min-height: 46px !important;
    margin: 0;
    border-radius: 0;
}

.ai-ingredient-icon-actions .rz-button + .rz-button {
    margin-left: -1px;
}

.ai-ingredient-controls > .ai-ingredient-icon-actions:first-child .rz-button:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.ai-ingredient-controls > .ai-ingredient-icon-actions:last-child .rz-button:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

@media (min-width: 768px) {
    .ai-ingredient-group .connected-form > .connected-row {
        flex-direction: row;
        justify-content: space-between;
        align-items: stretch;
    }

    .ai-ingredient-group .connected-form > .connected-row > .ai-ingredient-controls {
        min-width: 280px;
    }
}
