/* Wspólna warstwa prezentacji etapów; kontrolki zachowują kontrakty formularzy. */
/* Ciemniejszy róż wyłącznie dla nawigacji; wybory w formularzach pozostają jasne. */
body.wizard-page :is(.wizard-submit-btn, .wizard-breadcrumb .wizard-step-link.is-active) {
    --wizard-primary: #EB7099;
    --wizard-primary-hover: #DF608B;
    --wizard-primary-highlight: #DF608B;
    --wizard-primary-highlight-dark: #D65380;
    --wizard-primary-rgb: 235, 112, 153;
    --wizard-selection: var(--wizard-primary);
}

.stage-shell {
    --wizard-icon-size: 2rem;
    --wizard-section-gap: 1.25rem;
    --wizard-selection: var(--wizard-primary, #FF8FB3);
    --wizard-selection-soft: #FFE8F1;
    --wizard-info: #248ca5;
}
body.wizard-page[class*="page-stage"] .stage-shell .wizard-stage-heading-line,
body.wizard-page[class*="page-stage"] .stage-shell .stage5-final-title-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: .5rem .65rem;
    margin-bottom: .5rem !important;
    text-align: left;
}
body.wizard-page[class*="page-stage"] .stage-shell :is(.wizard-stage-title, .wizard-start-recipient-title, .stage5-final-title-line h1) {
    flex: 1;
    min-width: 0;
    margin: 0;
    text-align: left !important;
    font-size: var(--wizard-heading-size, 22px);
    line-height: 1.25;
}
body.wizard-page[class*="page-stage"] .stage-shell :is(.wizard-ui-icon, .stage1-section-icon, .wizard-project-preview-heading__icon, .stage5-final-success-icon) {
    box-sizing: border-box;
    display: inline-flex;
    flex: 0 0 var(--wizard-icon-size);
    align-items: center;
    justify-content: center;
    width: var(--wizard-icon-size);
    height: var(--wizard-icon-size);
    padding: .45rem;
    border: 0;
    border-radius: .65rem;
    background: #edf8fb;
    color: var(--wizard-info);
    box-shadow: none;
}
body.wizard-page[class*="page-stage"] .stage-shell .wizard-ui-icon__svg {
    width: 100%;
    height: 100%;
}
body.wizard-page[class*="page-stage"] .stage-shell :is(.wizard-intro-copy, .wizard-stage-description, .stage1-heading-description, .attribute-stage-intro, .stage2-custom-page-intro) {
    margin: 0 0 var(--wizard-section-gap);
    padding-left: 0;
    text-align: left;
    color: #687783;
    font-size: .9rem;
    line-height: 1.5;
}
body.wizard-page[class*="page-stage"] .stage-shell :is(.wizard-stage-description, .stage1-heading-description) {
    flex-basis: 100%;
    margin-bottom: .5rem;
}
body.wizard-page[class*="page-stage"] .stage-shell :is(.wizard-start-copy, .stage5-final-header) {
    text-align: left;
}
body.wizard-page[class*="page-stage"] .stage-shell :is(.wizard-product-select-title, .wizard-numbered-section-title) {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: .65rem;
    margin: 0 0 .65rem;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    text-align: left;
    font-size: var(--wizard-section-size, 13px);
    line-height: 1.35;
}
body.wizard-page[class*="page-stage"] .stage-shell .wizard-start-product-option {
    margin-bottom: var(--wizard-section-gap);
}
body.wizard-page[class*="page-stage"] .stage-shell .wizard-project-preview-heading {
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .75rem;
}
body.wizard-page[class*="page-stage"] .stage-shell .wizard-project-preview-heading h2 {
    text-align: left;
    font-size: .95rem;
}
body.wizard-page[class*="page-stage"] .stage-shell .wizard-project-preview-live {
    margin-left: auto;
    color: var(--wizard-info);
    font-size: .65rem;
    white-space: nowrap;
}
body.wizard-page[class*="page-stage"] .stage-shell .wizard-save-status {
    display: flex;
    align-items: baseline;
    gap: .35rem;
    margin: 0 0 .6rem;
    color: #607c71;
    font-size: .78rem;
    font-weight: 400;
    line-height: 1.4;
}
.wizard-save-status::before {
    content: "✓";
}
body.wizard-page[class*="page-stage"] .stage-shell .stage3-couple-font-style {
    margin-top: var(--wizard-section-gap);
    padding: 0;
    border: 0;
    background: transparent;
}
.stage3-couple-font-style__options {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.wizard-font-tile {
    position: relative;
}
body.wizard-page[class*="page-stage"] .stage-shell .wizard-font-label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 4rem;
    min-height: 2.1rem;
    padding: .4rem .65rem;
    border: 1px solid #dce3e9;
    border-radius: .65rem;
    background: #fff;
    color: #36434d;
    font-size: var(--wizard-style-label-size, 12px);
    font-weight: 600;
    cursor: pointer;
}
body.wizard-page[class*="page-stage"] .stage-shell .wizard-font-input:checked + .wizard-font-label,
body.wizard-page[class*="page-stage"] .stage-shell .stage1-choice-input:checked + .stage1-choice-button {
    border-color: var(--wizard-selection);
    background: var(--wizard-selection-soft);
    color: #aa3152;
    box-shadow: inset 0 0 0 1px var(--wizard-selection);
}
.wizard-font-input:focus-visible + .wizard-font-label {
    outline: 3px solid var(--wizard-info);
    outline-offset: 3px;
}
body.wizard-page[class*="page-stage"] .stage-shell :is(.stage-form-actions, .wizard-primary-actions) {
    gap: .75rem !important;
    margin-top: var(--wizard-section-gap);
}
body.wizard-page[class*="page-stage"] .stage-shell :is(.wizard-back-btn, .wizard-submit-btn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Pierwszeństwo przed rozmiarami CTA ze starszych widoków. */
    min-height: 3rem !important;
    padding: .75rem 1.25rem !important;
    border-radius: .75rem !important;
    font-family: inherit;
    font-size: .85rem !important;
    font-weight: 700 !important;
    line-height: 1.35;
    text-align: center;
}
body.wizard-page[class*="page-stage"] .stage-shell .wizard-back-btn {
    border: 1px solid #ccd5dc;
    background: #fff;
    color: #53616c;
    box-shadow: none;
}
body.wizard-page[class*="page-stage"] .stage-shell .wizard-back-btn:hover {
    background: #f3f5f7;
    border-color: #aebcc6;
}
body.wizard-page[class*="page-stage"] .stage-shell .wizard-submit-btn {
    border-color: var(--wizard-selection);
    background: var(--wizard-selection);
    color: #fff;
}
body.wizard-page[class*="page-stage"] .stage-shell .wizard-submit-btn:hover:not(:disabled) {
    background: var(--wizard-primary-hover);
    border-color: var(--wizard-primary-hover);
}
@media (max-width: 575.98px) {
    body.wizard-page[class*="page-stage"] .stage-shell .stage-form-card {
    padding: 1rem !important;
}
}
body.wizard-page[class*="page-stage"] .stage-shell :is(.stage3-couple-preview-shell, .stage2-pair-attributes-preview-shell) {
    align-content: start;
}
.wizard-save-status.text-danger::before {
    content: "!";
}
.wizard-save-status.is-saving::before {
    content: "…";
}
body.wizard-page[class*="page-stage"] .stage-shell .wizard-start-actions {
    gap: .75rem;
}

body.wizard-page[class*="page-stage"] .stage-shell .wizard-start-copy {
    justify-items: stretch;
    text-align: left !important;
}
body.wizard-page[class*="page-stage"] .stage-shell .wizard-start-recipient-intro {
    max-width: none;
    text-align: left;
}
body.wizard-page.page-stage0.wizard-project-oto-on .wizard-start-recipient-title {
    --wizard-heading-size: var(--oto-start-heading-size, 22px);
}

body.wizard-page[class*="page-stage"] .stage-shell .wizard-start-recipient-title {
    font-size: var(--wizard-heading-size, 22px);
}
body.wizard-page[class*="page-stage"] .stage-shell .stage1-choice-strip[aria-label="Styl tekstu"] .stage1-choice-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4rem;
    min-height: 2.1rem;
    padding: .4rem .65rem;
    border-radius: .65rem;
    font-size: var(--wizard-style-label-size, 12px);
    font-weight: 600;
}
/* Starsze widoki definiują rozmiary CTA osobno; wspólny kontrakt ma pierwszeństwo. */
body.wizard-page[class*="page-stage"] .stage-shell :is(.wizard-back-btn, .wizard-submit-btn) {
    min-height: 3rem !important;
    padding: .75rem 1.25rem !important;
    border-radius: .75rem !important;
    font-size: .85rem !important;
    font-weight: 700 !important;
}

body.wizard-page .stage-shell .wizard-product-select-title {
    justify-self: start;
    align-self: start;
    width: 100%;
    margin-inline: 0;
}
body.wizard-page .stage-shell .wizard-back-btn {
    order: 0 !important;
}
body.wizard-page .stage-shell .wizard-submit-btn {
    order: 1 !important;
}

body.wizard-page .stage-shell .wizard-start-profile-group__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 var(--wizard-icon-size);
    width: var(--wizard-icon-size) !important;
    height: var(--wizard-icon-size) !important;
    padding: .45rem;
    border-radius: .65rem;
    background: #edf8fb !important;
    color: var(--wizard-info) !important;
}
body.wizard-page .stage-shell .wizard-stage-title {
    white-space: normal !important;
    overflow-wrap: anywhere;
}
body.wizard-page .stage-shell .wizard-back-btn {
    color: #53616c !important;
    border-color: #ccd5dc !important;
    background: #fff !important;
}
body.wizard-page .stage-shell .wizard-back-btn:hover {
    background: #f3f5f7 !important;
}
/* Nazwa grupy pozostaje dostępna dla czytników bez powielania nagłówka etapu. */
body.wizard-page .stage-shell .stage3-couple-texts-heading {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}
@media (max-width: 575.98px) {
    body.wizard-page[class*="page-stage"] .stage-shell :is(.wizard-stage-title, .wizard-start-recipient-title, .stage5-final-title-line h1) {
        font-size: calc(var(--wizard-heading-size, 22px) * .85);
    }
}

/* Wspólna karta objaśniająca tworzenie postaci i atrybutu przez AI. */
body.wizard-page[class*="page-stage"] .stage-shell .wizard-ai-intro {
    display: grid;
    align-content: start;
    gap: .5rem;
    padding: .65rem .85rem;
}
body.wizard-page[class*="page-stage"] .stage-shell .wizard-ai-intro :is(.stage2-custom-hero__copy, .wizard-ai-intro__copy) {
    display: grid;
    gap: .32rem;
    min-width: 0;
}
body.wizard-page[class*="page-stage"] .stage-shell .wizard-ai-intro :is(.stage2-custom-hero__eyebrow, .attribute-custom-eyebrow) {
    color: var(--wizard-accent);
    font-size: .7rem;
    font-weight: 600;
    line-height: 1.1;
}
body.wizard-page[class*="page-stage"] .stage-shell .wizard-ai-intro h2 {
    margin: 0;
    color: #243747;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
}
body.wizard-page[class*="page-stage"] .stage-shell .wizard-ai-intro p {
    margin: 0;
    color: #365061;
    font-size: .82rem;
    line-height: 1.3;
}
body.wizard-page[class*="page-stage"] .stage-shell .wizard-ai-intro :is(.stage2-custom-chip, .attribute-custom-cost) {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    min-height: 1.5rem;
    padding: .2rem .55rem;
    border: 1px solid rgba(var(--wizard-primary-rgb), .16);
    border-radius: 999px;
    background: rgba(var(--wizard-primary-rgb), .04);
    color: var(--wizard-primary);
    font-size: .7rem;
    font-weight: 400;
    line-height: 1.1;
}
body.wizard-page[class*="page-stage"] .stage-shell .wizard-ai-intro .attribute-custom-example {
    grid-template-columns: minmax(0, 1fr);
    gap: .38rem;
    width: 100%;
    max-width: 18rem;
    justify-self: center;
}
body.wizard-page[class*="page-stage"] .stage-shell .wizard-ai-example__media {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    aspect-ratio: 1190 / 828;
    overflow: hidden;
    border: 1px solid rgba(36, 162, 189, .14);
    border-radius: .72rem;
    background: white;
}
body.wizard-page[class*="page-stage"] .stage-shell .wizard-ai-example__media img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: contain;
    border-radius: 0;
}
body.wizard-page[class*="page-stage"] .stage-shell .graphic-upload-example__media {
    grid-template-columns: minmax(0, 1fr);
    aspect-ratio: 3 / 2;
}
body.wizard-page[class*="page-stage"] .stage-shell .wizard-ai-example__media img + img {
    border-left: 1px solid rgba(36, 162, 189, .12);
}
body.wizard-page[class*="page-stage"] .stage-shell :is(.wizard-ai-example__labels, .wizard-ai-intro .stage2-custom-example__labels) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .58rem;
    color: #38576a;
    font-size: .7rem;
    font-weight: 600;
    line-height: 1.1;
    text-align: center;
}
body.wizard-page[class*="page-stage"] .stage-shell :is(.wizard-ai-example__labels, .wizard-ai-intro .stage2-custom-example__labels) span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.42rem;
    padding: .2rem .62rem;
    border: 1px solid rgba(36, 162, 189, .2);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(232, 249, 252, .9));
    box-shadow: 0 .22rem .58rem rgba(36, 162, 189, .11);
}

/* Kompaktowe ATRYBUTY i FINAŁ z czytelną nawigacją pod treścią. */
body.wizard-page[class*="page-stage"] .stage-shell [data-source-choice="true"] .attribute-tag-search {
    width: min(100%, 360px);
    max-width: 360px;
    align-self: flex-start;
}

/* Wspólny kolor wyboru inspiracji we wszystkich wariantach kreatora. */
body.wizard-page[class*="page-stage"] .wizard-start-inspirations .wizard-start-profile-picker__option:is(:hover, .is-active, .is-selected) {
    background: #fff0f5;
    color: #c92f62;
}

body.wizard-page[class*="page-stage"] .wizard-start-inspirations .wizard-start-profile-group:has(input:checked) .wizard-start-profile-picker__button {
    border-color: #e8b9ca;
    background: #fff0f5;
    box-shadow: none;
}
body.wizard-page .stage-shell [data-source-choice="true"] .attribute-library [data-custom-attribute-filter="true"] + label {
    display: inline-flex;
}
body.wizard-page.page-stage3 .stage-shell--oto-attributes {
    --wizard-section-gap: .55rem;
}
body.wizard-page.page-stage3 .stage-shell--oto-attributes .attribute-description-input {
    height: 6.25rem;
    min-height: 6.25rem;
}
body.wizard-page.wizard-project-oto-on.page-stage3 .stage-shell--oto-attributes .attribute-custom-form .attribute-description-input {
    height: 4.5rem;
    min-height: 4.5rem;
}
body.wizard-page.page-stage3 .stage-shell--oto-attributes .attribute-source-choice {
    padding: .45rem .65rem;
    min-height: 0;
}
body.wizard-page.page-stage3 .stage-shell--oto-attributes .attribute-source-options {
    gap: .5rem;
}
body.wizard-page.wizard-project-oto-on.page-stage3 .stage-shell--oto-attributes .attribute-suggestion-block {
    padding: .5rem .65rem;
    align-self: start;
}
body.wizard-page.wizard-project-oto-on.page-stage3 .stage-shell--oto-attributes .attribute-suggestion-list {
    max-height: 7rem;
    overflow-y: auto;
}
@media (min-width: 992px) {
    body.wizard-page:is(.page-stage3, .page-stage5) .wizard-header-shell {
        margin-top: .5rem !important;
        margin-bottom: .5rem !important;
    }
    body.wizard-page.wizard-project-oto-on.page-stage3 .stage-shell--oto-attributes .stage-form-card {
        padding: .7rem 1rem !important;
    }
    body.wizard-page.wizard-project-oto-on.page-stage3 .stage-shell--oto-attributes .attribute-description-layout {
        margin-top: .5rem !important;
    }
    body.wizard-page.wizard-project-oto-on.page-stage3 .stage-shell--oto-attributes .attribute-tag-filter {
        min-height: 2.1rem;
        height: 2.1rem;
        padding-block: .25rem;
    }
    body.wizard-page.wizard-project-oto-on.page-stage3 .stage-shell--oto-attributes .attribute-selector {
        margin-bottom: .4rem !important;
    }
    body.wizard-page.wizard-project-oto-on.page-stage3 .stage-shell--oto-attributes #attributeSelector .btn {
        min-height: 2rem;
        padding-block: .25rem;
    }
    body.wizard-page.wizard-project-oto-on.page-stage3 .stage-shell--oto-attributes .stage-form-actions {
        margin-top: .5rem !important;
    }
    body.wizard-page.page-stage5 .stage5-product-card .stage5-preview-image {
        max-height: clamp(16rem, calc(100dvh - 23rem), 29rem);
    }
    body.wizard-page.page-stage5 .stage5-product-card .stage5-preview-shell {
        max-height: clamp(16rem, calc(100dvh - 23rem), 29rem);
    }
}

body.wizard-page.wizard-project-oto-on.page-stage3 .stage-shell--oto-attributes .attribute-category-strip {
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: .2rem;
    scrollbar-width: thin;
}

/* Dyskretna informacja o czasie wysyłki pod opcjami kreatora. */
.wizard-shipping {
    margin: 12px 0;
    min-width: 0;
}

.wizard-shipping__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 7px 12px;
    border-radius: 18px;
    background: #edfafa;
    color: #245767;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
}

.wizard-shipping--start .wizard-shipping__badge {
    background: #e0f7f9;
    font-size: 13px;
}

.wizard-shipping__badge > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.wizard-shipping__badge strong {
    font-weight: 600;
}

.wizard-shipping__icon {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    color: #00a6bb;
}

.wizard-shipping-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    margin-bottom: 1rem;
}

.wizard-shipping-row .wizard-shipping {
    margin: 0;
}

.wizard-start-product-option__choices {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem .75rem;
}

.wizard-start-product-option__choices > .wizard-shipping {
    margin: 0;
}

.wizard-start-product-configuration .wizard-shipping-row {
    gap: .5rem;
    justify-content: space-between;
}

body.wizard-page[class*="page-stage"] .stage-shell .wizard-start-product-configuration .wizard-poster-express.wizard-numbered-section-title {
    width: auto;
    flex: 0 1 auto;
    gap: .4rem;
}

body.wizard-page[class*="page-stage"] .stage-shell .wizard-poster-express.wizard-numbered-section-title {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    margin: 0;
    min-width: 0;
}

.wizard-poster-express__label {
    text-transform: none;
    margin: 0;
    font: inherit;
    cursor: pointer;
}

body.wizard-page .wizard-poster-express .wizard-product-option-switch {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    min-height: 0;
    display: flex;
    align-items: center;
}

body.wizard-page .wizard-poster-express .wizard-product-option-toggle {
    margin: 0;
}

@media (max-width: 575.98px) {
    .wizard-poster-express {
        flex-wrap: wrap;
        margin-left: 0;
    }
}

/* W tym widoku przełącznik biblioteki dzieli wiersz z wyszukiwarką. */
@media (min-width: 768px) {
    body.wizard-project-attribute-texts.page-stage2 #attributeTextsForm[data-library-section="library"] .attribute-library:not(.d-none):has(> #graphicIdeaControls) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 0.75rem;
        align-items: start;
    }

    #attributeTextsForm[data-library-section="library"] .attribute-library > .attribute-image-title {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    body.wizard-page.wizard-project-attribute-texts.page-stage2 .stage-shell #attributeTextsForm[data-library-section="library"] .attribute-library > .attribute-tag-search {
        grid-column: 1;
        grid-row: 2;
        width: 100%;
        max-width: 360px;
        min-width: 0;
    }

    #attributeTextsForm[data-library-section="library"] .attribute-library > #graphicIdeaControls {
        grid-column: 2;
        grid-row: 2;
        align-self: start;
    }

    #attributeTextsForm[data-library-section="library"] .attribute-library #graphicLibraryTabs {
        flex-wrap: nowrap !important;
        margin-bottom: 0 !important;
    }

    #attributeTextsForm[data-library-section="library"] .attribute-library > .attribute-category-strip {
        grid-column: 1 / -1;
        grid-row: 3;
        min-width: 0;
    }

    #attributeTextsForm[data-library-section="library"] .attribute-library > .asset-thumb-grid {
        grid-column: 1 / -1;
        grid-row: 4;
        min-width: 0;
    }
}
