.wizard-mobile-preview-placeholder,
.wizard-mobile-colors-toggle { display: none; }

.wizard-mobile-show-more { display: none; }

body.wizard-page :is(.attribute-suggestion-list, .wizard-text-suggestions) > [data-mobile-choice-hidden] { display: none !important; }
body.wizard-page .wizard-show-more-inspirations:not([hidden]) {
    display: block;
    width: 100%;
    min-height: 40px;
    margin: .3rem 0 .5rem;
    padding: .45rem .65rem;
    border: 1px solid var(--wizard-border, #eadfe5);
    border-radius: .65rem;
    background: #fff;
    color: var(--wizard-primary-dark, #a5224a);
    font: inherit;
    font-size: .8rem;
    cursor: pointer;
}

@media (max-width: 767.98px) {
    body.wizard-page [data-mobile-choice-hidden],
    body.wizard-page .stage-shell .asset-grid-scroll.asset-thumb-grid .custom-radio-card[data-mobile-choice-hidden] { display: none !important; }
    body.wizard-page .wizard-mobile-show-more:not([hidden]) {
        display: block;
        order: 4;
        width: 100%;
        min-height: 40px;
        margin: .3rem 0 .5rem;
        padding: .45rem .65rem;
        border: 1px solid var(--wizard-border, #eadfe5);
        border-radius: .65rem;
        background: #fff;
        color: var(--wizard-primary-dark, #a5224a);
        font: inherit;
        font-size: .8rem;
        cursor: pointer;
    }
    body.wizard-page :is(.asset-grid-scroll, .attribute-suggestion-list, .attribute-tag-suggestions, .wizard-start-profile-picker__list, .wizard-text-suggestions) {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        scrollbar-gutter: auto;
        overscroll-behavior: auto;
    }
    body.wizard-page :is(.wizard-start-profile-picker__list, .wizard-text-suggestions) {
        position: static !important;
        width: 100% !important;
        margin-top: .35rem;
    }
    body.wizard-page .wizard-text-suggestions__header { position: static; }
    #attributeTextsForm[data-library-section="ideas"] .attribute-library > .wizard-mobile-show-more[aria-controls="attributeTextIdeas"]:not([hidden]) {
        display: block !important;
    }
    body.wizard-page .stage-shell .attribute-category-strip {
        display: flex;
        flex-wrap: wrap !important;
        max-width: 100%;
        overflow: visible !important;
        white-space: normal !important;
        gap: .25rem !important;
        padding-block: .15rem .35rem;
        scrollbar-width: none;
    }
    body.wizard-page .stage-shell .attribute-category-strip::-webkit-scrollbar { display: none; }
    body.wizard-page .stage-shell .attribute-category-button {
        flex: 0 1 auto !important;
        max-width: 100%;
        min-height: 34px !important;
        padding: .35rem .55rem !important;
        font-size: .75rem !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
    }
    body.wizard-page .wizard-mobile-show-more.wizard-show-more-categories { order: 2; }
    body.wizard-page .stage-shell .attribute-selector {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .3rem;
    }
    body.wizard-page .stage-shell .attribute-selector .btn {
        min-height: 34px !important;
        padding: .35rem 1rem .35rem .35rem !important;
        font-size: .72rem !important;
        white-space: nowrap;
    }
    body.wizard-page .stage-shell .attribute-selector .btn.selected {
        background: var(--wizard-primary, #d73978);
        border-color: var(--wizard-primary, #d73978);
        color: #fff;
    }
    body.wizard-page .stage-shell .asset-thumb-card.selected {
        border-color: var(--wizard-primary, #d73978);
        box-shadow: inset 0 0 0 1px var(--wizard-primary, #d73978);
        background-color: #fff0f5;
    }
    body.wizard-page .stage-shell .attribute-description-input {
        min-height: calc(2lh + 1rem + 2px) !important;
        max-height: none !important;
        padding: .5rem .65rem;
        line-height: 1.4;
        overflow: hidden;
        resize: none !important;
    }
    body.wizard-page .attribute-suggestion-list .list-group-item {
        padding: .5rem .65rem;
        font-size: .8rem;
    }
    body.wizard-page .attribute-suggestion-list .list-group-item.is-selected {
        border-color: var(--wizard-primary, #d73978);
        background: #fff0f5;
    }
}

.attribute-description-optional { color: #687683; font-size: .7rem; font-weight: 400; text-transform: none; }
.attribute-selection-count { margin: .3rem 0 .45rem; color: #687683; font-size: .75rem; order: 3; }

@media (max-width: 767.98px) {
    body.wizard-page .stage-shell .attribute-library .asset-thumb-grid {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: .25rem !important;
        padding: 0 !important;
        border: 0 !important;
    }
    body.wizard-page .stage-shell .attribute-library .asset-thumb-grid .custom-radio-card {
        position: relative;
        width: 100% !important;
        height: 70px !important;
        min-width: 0;
        min-height: 0 !important;
        aspect-ratio: auto;
        margin: 0 !important;
        padding: .125rem !important;
        border: 1px solid #e1e5e9 !important;
        border-radius: .7rem;
        background: #fff !important;
    }
    body.wizard-page .stage-shell .attribute-library .asset-thumb-grid .custom-radio-card .character-thumb {
        width: 60px !important;
        height: 60px !important;
        max-width: 100% !important;
        max-height: 60px !important;
        object-fit: contain;
    }
    body.wizard-page .stage-shell .attribute-library .asset-thumb-grid .custom-radio-card.selected {
        border-color: #e56b98 !important;
        background: #fff3f7 !important;
        box-shadow: inset 0 0 0 1px #e56b98;
    }
    body.wizard-page .stage-shell .attribute-library .asset-thumb-grid .custom-radio-card.selected::before {
        content: '✓';
        position: absolute;
        top: 4px;
        right: 4px;
        z-index: 2;
        display: grid;
        place-items: center;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: #bd3766;
        color: white;
        font-size: 12px;
        font-weight: 700;
        pointer-events: none;
    }
    body.wizard-page .stage-shell .attribute-tag-filter { min-height: 42px; font-size: .85rem; }
    body.wizard-page .stage-shell .attribute-description-title { flex-wrap: wrap; gap: .35rem; }
    body.wizard-page[class*="page-stage"] .stage-shell .attribute-description-layout .attribute-suggestion-block {
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }
    body.wizard-page[class*="page-stage"] .stage-shell .attribute-description-layout .attribute-suggestion-heading {
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        font-size: .75rem;
    }
    body.wizard-page[class*="page-stage"] .stage-shell .attribute-description-layout .attribute-suggestion-copy { font-size: .75rem; }
    body.wizard-page[class*="page-stage"] .stage-shell .attribute-description-layout .attribute-suggestion-list { gap: .4rem; border: 0; }
    body.wizard-page[class*="page-stage"] .stage-shell .attribute-description-layout .attribute-suggestion-list .list-group-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .5rem;
        min-height: 44px;
        margin: 0;
        padding: .6rem .7rem;
        border: 1px solid #e1e5e9;
        border-radius: .65rem;
        background: #fff;
        font-size: .8rem;
        line-height: 1.4;
        text-align: left;
    }
    body.wizard-page[class*="page-stage"] .stage-shell .attribute-description-layout .attribute-suggestion-list .list-group-item::after { content: '+'; color: #a9335d; font-size: 1rem; }
    body.wizard-page[class*="page-stage"] .stage-shell .attribute-description-layout .attribute-suggestion-list .list-group-item.is-selected {
        border-color: #e56b98;
        background: #fff0f5;
        color: #962c50;
        box-shadow: none;
    }
    body.wizard-page[class*="page-stage"] .stage-shell .attribute-description-layout .attribute-suggestion-list .list-group-item.is-selected::after { content: '✓'; }
}

@media (max-width: 767.98px) {
    body.wizard-page .stage-shell .wizard-mobile-preview-origin:empty { display: none !important; }
    body.wizard-page .stage-shell .wizard-mobile-preview {
        position: static !important;
        width: 100% !important;
        max-width: none !important;
        min-height: 0 !important;
        margin: 0 0 1.25rem !important;
        padding: .75rem !important;
        border: 1px solid var(--wizard-border, #eadfe5);
        border-radius: .85rem;
        background: #fff;
    }
    body.wizard-page .wizard-mobile-preview .wizard-project-preview-heading { margin-bottom: .5rem; }
    body.wizard-page .wizard-mobile-preview .wizard-project-preview-heading h2 { font-size: .85rem; }
    body.wizard-page .wizard-mobile-preview .wizard-project-preview-live { font-size: .6rem; }
    /* Większy projekt mieści się w tej samej karcie dzięki mniejszym odstępom. */
    body.wizard-page .stage-shell .wizard-mobile-preview:not(.wizard-mobile-preview--empty) {
        padding-block: calc(.75rem - 6px) !important;
    }
    body.wizard-page .wizard-mobile-preview:not(.wizard-mobile-preview--empty) :is(.wizard-project-preview-heading, .wizard-preview-mode) {
        margin-bottom: calc(.5rem - 4px);
    }
    body.wizard-page .wizard-mobile-preview .wizard-preview-mode-frame {
        height: 200px;
        min-height: 0 !important;
    }
    body.wizard-page .wizard-mobile-preview .wizard-preview-mode-frame > img {
        width: 100% !important;
        height: 200px !important;
        max-height: 200px !important;
        min-height: 0 !important;
        object-fit: contain;
        object-position: center;
        margin: 0 !important;
        box-shadow: none !important;
    }
    /* Arkusz ma proporcje PNG wygenerowanego dla rzeczywistego pola projektu. */
    body.wizard-page .wizard-mobile-preview .wizard-preview-mode-frame:not(.is-product) {
        display: grid;
        place-items: center;
        padding: 4px;
        box-sizing: border-box;
        border-radius: .5rem;
        background: #f4f5f6;
    }
    body.wizard-page .wizard-mobile-preview .wizard-preview-mode-frame:not(.is-product) > img:first-child {
        width: auto !important;
        height: auto !important;
        max-width: 70% !important;
        max-height: 192px !important;
        border: 1px solid #e5e7eb;
        border-radius: .3rem;
        background: #fff;
        box-shadow: 0 2px 7px rgba(15, 23, 42, .08) !important;
    }
    body.wizard-page .wizard-mobile-preview :is(.attribute-texts-preview, .stage2-attributes-preview-shell) {
        min-height: 0 !important;
        height: auto !important;
        aspect-ratio: auto !important;
    }
    body.wizard-page .wizard-mobile-preview :is(.stage5-preview-placeholder, #stage1PreviewPlaceholder, .attribute-texts-preview__message) { display: none !important; }
    body.wizard-page .wizard-mobile-preview--empty .wizard-preview-mode-frame { display: none; }
    body.wizard-page .wizard-mobile-preview--empty .wizard-preview-mode[hidden] { display: flex; }
    body.wizard-page .wizard-mobile-preview--empty .wizard-mobile-preview-placeholder {
        display: grid;
        gap: .3rem;
        padding: .8rem .5rem;
        text-align: center;
        color: #64717c;
        font-size: .78rem;
        border-radius: .4rem;
        box-shadow: inset 0 0 0 1px var(--wizard-border, #eadfe5);
    }
    body.wizard-page .wizard-mobile-preview-placeholder strong { color: #36434d; font-size: .9rem; }
    body.wizard-page[class*="page-stage"] .stage-shell :is(.stage-form-actions, .wizard-primary-actions, .wizard-start-actions) {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
    }
    body.wizard-page[class*="page-stage"] .stage-shell .wizard-back-btn {
        order: 0 !important;
        align-self: flex-start;
        width: auto !important;
        min-height: 44px !important;
        padding: .5rem 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        font-size: .85rem !important;
        font-weight: 500 !important;
        text-transform: none;
    }
    body.wizard-page[class*="page-stage"] .stage-shell .wizard-submit-btn {
        order: 1 !important;
        width: 100% !important;
    }
    body.wizard-project-oto-on.page-stage2 #colorsSection > .wizard-section-title { display: none; }
    .wizard-mobile-colors-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .5rem;
        width: 100%;
        min-height: 48px;
        padding: .75rem;
        border: 1px solid var(--wizard-border, #eadfe5);
        border-radius: .75rem;
        background: #fff;
        color: #36434d;
        font: inherit;
        font-size: .8rem;
        font-weight: 700;
        text-align: left;
    }
    .wizard-mobile-colors-toggle[aria-expanded="true"] > :last-child { transform: rotate(90deg); }
    #colorsContainer[hidden] { display: none !important; }
    body.wizard-page .stage5-product-card .stage5-preview-image {
        height: 220px !important;
        max-height: 220px !important;
        object-fit: contain;
    }
    body.wizard-page .stage5-product-card .stage5-preview-shell {
        min-height: 0 !important;
        aspect-ratio: auto !important;
    }
    body.wizard-page .stage5-product-card .stage5-preview-placeholder {
        min-height: 0 !important;
        height: auto !important;
        padding: 1rem !important;
        gap: .5rem;
    }
    body.wizard-page .stage5-edit-action--back {
        justify-self: start;
        width: auto;
        background: transparent;
        border: 0;
        box-shadow: none;
    }
}
