.recipe-ai-import-dialog {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: min(100%, 72rem);
    padding: 1rem;
    color: #111827;
}

.recipe-ai-import-dialog__header {
    padding: 0;
}

.recipe-ai-import-dialog__steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.recipe-ai-import-dialog__step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #ffffff;
    color: #6b7280;
}

.recipe-ai-import-dialog__step span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    flex: 0 0 auto;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #374151;
    font-weight: 700;
}

.recipe-ai-import-dialog__step strong {
    display: block;
    color: #111827;
    font-size: 0.92rem;
}

.recipe-ai-import-dialog__step small {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.78rem;
    color: #6b7280;
}

.recipe-ai-import-dialog__step.is-active {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.recipe-ai-import-dialog__step.is-active span {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.recipe-ai-import-dialog__surface {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #ffffff;
}

.recipe-ai-import-dialog__advanced {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
}

.recipe-ai-import-dialog__advanced summary {
    cursor: pointer;
    padding: 0.75rem 0.9rem;
    color: #374151;
    font-weight: 700;
}

.recipe-ai-import-dialog__advanced[open] summary {
    border-bottom: 1px solid #e5e7eb;
}

.recipe-ai-import-dialog__model {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.9rem;
}

.recipe-ai-import-dialog__model-hint,
.ai-ai-note {
    color: #6b7280;
    line-height: 1.45;
}

.recipe-ai-import-dialog__stage {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recipe-ai-import-dialog__stage-header,
.recipe-ai-import-dialog__review-summary,
.recipe-ai-import-dialog__ingredients-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recipe-ai-import-dialog__section-title {
    font-size: 1rem;
    font-weight: 800;
    color: #111827;
}

.recipe-ai-import-dialog__section-copy {
    margin-top: 0.2rem;
    font-size: 0.88rem;
    color: #6b7280;
    line-height: 1.45;
}

.recipe-ai-import-dialog__source-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.recipe-ai-import-dialog__source-choice {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #ffffff;
    color: #111827;
    text-align: left;
    transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.recipe-ai-import-dialog__source-choice:hover,
.recipe-ai-import-dialog__source-choice:focus-visible {
    border-color: #93c5fd;
    outline: none;
}

.recipe-ai-import-dialog__source-choice.is-active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.recipe-ai-import-dialog__source-choice span {
    font-weight: 800;
}

.recipe-ai-import-dialog__source-choice small {
    color: #6b7280;
}

.recipe-ai-import-dialog__panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recipe-ai-import-dialog__input-card,
.recipe-ai-import-dialog__results-card,
.recipe-ai-import-dialog__editor-card,
.recipe-ai-import-dialog__debug-card,
.recipe-ai-import-dialog__ingredients-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #ffffff;
}

.recipe-ai-import-dialog__status {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    background: #eff6ff;
    color: #1d4ed8;
}

.recipe-ai-import-dialog__spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid #bfdbfe;
    border-top-color: #2563eb;
    border-radius: 999px;
    animation: recipeAiImportSpin 750ms linear infinite;
}

@keyframes recipeAiImportSpin {
    to {
        transform: rotate(360deg);
    }
}

.recipe-ai-import-dialog__file-list,
.ai-recipe-suggestion-list,
.ai-ingredient-preview {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.recipe-ai-import-dialog__upload-zone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 11rem;
    padding: 1.25rem;
    border: 1.5px dashed #93c5fd;
    border-radius: 8px;
    background: #eff6ff;
    color: #1e3a8a;
    text-align: center;
    cursor: pointer;
    transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.recipe-ai-import-dialog__upload-zone:hover,
.recipe-ai-import-dialog__upload-zone:focus-within {
    border-color: #2563eb;
    background: #dbeafe;
    color: #1d4ed8;
}

.recipe-ai-import-dialog__upload-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.recipe-ai-import-dialog__upload-input:disabled {
    cursor: not-allowed;
}

.recipe-ai-import-dialog__upload-icon {
    width: 2.35rem;
    height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #2563eb;
    background: #dbeafe;
}

.recipe-ai-import-dialog__upload-icon::before {
    content: "";
    width: 1.35rem;
    height: 1.35rem;
    display: block;
    background: currentColor;
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
}

.recipe-ai-import-dialog__upload-icon--image::before {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 5h14v14H5V5Zm2 2v8.8l3.1-3.1 2.4 2.4 3.4-4.1L17 12.3V7H7Zm0 10h10.6l-1.8-2.2-3.1 3.7-2.6-2.6L7 19v-2Zm2.6-7.2a1.4 1.4 0 1 0 0-2.8 1.4 1.4 0 0 0 0 2.8Z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 5h14v14H5V5Zm2 2v8.8l3.1-3.1 2.4 2.4 3.4-4.1L17 12.3V7H7Zm0 10h10.6l-1.8-2.2-3.1 3.7-2.6-2.6L7 19v-2Zm2.6-7.2a1.4 1.4 0 1 0 0-2.8 1.4 1.4 0 0 0 0 2.8Z'/%3E%3C/svg%3E");
}

.recipe-ai-import-dialog__upload-icon--cloud::before {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3.5a5.6 5.6 0 0 1 5.3 3.8A4.9 4.9 0 0 1 17 17h-3v-4.2l1.6 1.6L17 13l-5-5-5 5 1.4 1.4 1.6-1.6V17H7.3A5.3 5.3 0 0 1 7 6.5a5.6 5.6 0 0 1 5-3Zm0 7.3V20h-2v-9.2h2Z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3.5a5.6 5.6 0 0 1 5.3 3.8A4.9 4.9 0 0 1 17 17h-3v-4.2l1.6 1.6L17 13l-5-5-5 5 1.4 1.4 1.6-1.6V17H7.3A5.3 5.3 0 0 1 7 6.5a5.6 5.6 0 0 1 5-3Zm0 7.3V20h-2v-9.2h2Z'/%3E%3C/svg%3E");
}

.recipe-ai-import-dialog__upload-title {
    font-weight: 800;
    color: #111827;
}

.recipe-ai-import-dialog__upload-copy {
    max-width: 32rem;
    color: #4b5563;
    font-size: 0.88rem;
    line-height: 1.45;
}

.recipe-ai-import-dialog__upload-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    margin-top: 0.25rem;
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    background: #2563eb;
    color: #ffffff;
    font-weight: 800;
}

.recipe-ai-import-dialog__selected-file {
    padding: 0.55rem 0.65rem;
    border: 1px solid #dbeafe;
    border-radius: 6px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.88rem;
    font-weight: 700;
    word-break: break-word;
}

.ai-import-url,
.ai-import-textarea,
.ai-import-editor,
.ai-import-debug {
    width: 100%;
}

.ai-import-textarea {
    min-height: 11rem;
}

.ai-import-editor {
    min-height: 16rem;
}

.ai-alert {
    margin: 0;
}

.ai-recipe-suggestion-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.85rem;
    background: #f9fafb;
}

.ai-recipe-suggestion-title {
    font-weight: 800;
    color: #111827;
}

.ai-recipe-suggestion-meta {
    font-size: 0.84rem;
    color: #6b7280;
    word-break: break-word;
}

.ai-recipe-suggestion-summary {
    font-size: 0.92rem;
    line-height: 1.5;
    color: #374151;
}

.recipe-ai-import-dialog__review-tabs .rz-tabview,
.recipe-ai-import-dialog__tabs {
    width: 100%;
}

.recipe-ai-import-dialog__tabs .rz-tabview-nav {
    border-bottom: 1px solid #e5e7eb;
}

.recipe-ai-import-dialog__tabs .rz-tabview-nav li a {
    color: #374151;
}

.recipe-ai-import-dialog__tabs .rz-tabview-selected a {
    color: #2563eb;
    border-bottom: 2px solid #2563eb;
}

.recipe-ai-import-dialog__summary-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.recipe-ai-import-dialog__summary-chips span {
    display: inline-flex;
    align-items: center;
    min-height: 1.75rem;
    padding: 0.25rem 0.65rem;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 700;
}

.ai-ingredient-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
}

.ai-ingredient-group-title {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7280;
}

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

.ai-ingredient-group .connected-form > .connected-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    padding: 0.65rem 0.4rem;
    border-top: 1px solid #e5e7eb;
    border-radius: 6px;
}

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

.ai-ingredient-row--matched {
    background: #f8fefb;
}

.ai-ingredient-summary {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.ai-ingredient-name {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    color: #111827;
    font-weight: 700;
}

.ai-ingredient-unit--missing {
    border-radius: 4px;
    background: #fef3c7;
    color: #92400e;
    padding: 0.05rem 0.3rem;
}

.ai-ingredient-status {
    font-size: 0.84rem;
    color: #6b7280;
}

.ai-ingredient-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.ai-ingredient-controls--editing {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
}

.ai-ingredient-product-select,
.ai-ingredient-unit-select {
    width: 100%;
    min-width: 0;
}

.ai-ingredient-assignment {
    min-width: 0;
    padding: 0.35rem 0.5rem;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    background: #f0fdf4;
    color: #166534;
    overflow: hidden;
}

.ai-ingredient-assignment--open {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.ai-ingredient-assignment__label {
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1;
    text-transform: uppercase;
}

.ai-ingredient-assignment strong {
    display: block;
    margin-top: 0.12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.86rem;
}

.ai-ingredient-icon-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.4rem;
}

.ai-ingredient-icon-actions .rz-button {
    min-height: 2.15rem;
}

.recipe-ai-import-dialog__footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}

@media (min-width: 720px) {
    .recipe-ai-import-dialog__steps {
        grid-template-columns: repeat(3, 1fr);
    }

    .recipe-ai-import-dialog__source-list {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .recipe-ai-import-dialog__stage-header,
    .recipe-ai-import-dialog__review-summary,
    .recipe-ai-import-dialog__ingredients-header {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
    }

    .recipe-ai-import-dialog__model {
        max-width: 26rem;
    }

    .ai-ingredient-group .connected-form > .connected-row {
        grid-template-columns: minmax(13rem, 0.85fr) minmax(0, 1.45fr);
        align-items: center;
        padding-inline: 0.55rem;
    }

    .ai-ingredient-summary {
        min-width: 0;
    }

    .ai-ingredient-controls {
        align-items: center;
    }

    .ai-ingredient-controls--editing {
        grid-template-columns: minmax(12rem, 1fr) minmax(8rem, 12rem) auto;
        align-items: center;
    }

    .ai-ingredient-icon-actions {
        flex-wrap: nowrap;
        justify-content: flex-end;
    }
}
